L L4D2node

CEnvMicrophone::ActivateSpeaker

0x00688720 · 495 bytes · __thiscall

_ZN14CEnvMicrophone15ActivateSpeakerEv

Decompiled

undefined (1 param)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CEnvMicrophone::ActivateSpeaker() */

void __thiscall CEnvMicrophone::ActivateSpeaker(CEnvMicrophone *this)

{
  undefined4 uVar1;
  char cVar2;
  undefined4 *puVar3;
  int iVar4;
  undefined1 *puVar5;
  int iVar6;
  int iVar7;
  int *local_24;
  int local_20;
  
  if (this[0x440] == (CEnvMicrophone)0x0) {
    ConVarRef::ConVarRef((ConVarRef *)&local_24,"dsp_speaker");
    cVar2 = ConVarRef::IsValid((ConVarRef *)&local_24);
    if (cVar2 != '\0') {
      iVar4 = *(int *)(this + 0x464);
      if (iVar4 == 0) {
        iVar4 = strtol(*(char **)(local_20 + 0x20),(char **)0x0,10);
      }
      puVar5 = &DAT_00d539c2;
      if (*(undefined1 **)(this + 0x154) != (undefined1 *)0x0) {
        puVar5 = *(undefined1 **)(this + 0x154);
      }
      DevMsg(2,"Microphone %s set dsp_speaker to %d.\n",puVar5,iVar4);
      (**(code **)(*local_24 + 8))(local_24,*(undefined4 *)(this + 0x464));
    }
  }
  if (*(int *)(this + 0x458) == 0) {
    return;
  }
  puVar3 = (undefined4 *)(**(code **)(*(int *)this + 0xc))(this);
  local_24 = (int *)*puVar3;
  iVar4 = CUtlVector<CHandle<CEnvMicrophone>,CUtlMemory<CHandle<CEnvMicrophone>,int>>::Find
                    ((CUtlVector<CHandle<CEnvMicrophone>,CUtlMemory<CHandle<CEnvMicrophone>,int>> *)
                     &s_Microphones,(CHandle *)&local_24);
  if (iVar4 != -1) {
    return;
  }
  puVar3 = (undefined4 *)(**(code **)(*(int *)this + 0xc))(this);
  iVar6 = DAT_00fdba68;
  uVar1 = *puVar3;
  iVar4 = DAT_00fdba68 + 1;
  if ((iVar4 <= DAT_00fdba60) || (DAT_00fdba64 < 0)) goto LAB_00688795;
  if (DAT_00fdba64 == 0) {
    if (DAT_00fdba60 == 0) {
      if (iVar4 < 9) {
        DAT_00fdba60 = 8;
        goto LAB_00688897;
      }
      DAT_00fdba60 = 8;
    }
    do {
      DAT_00fdba60 = DAT_00fdba60 * 2;
    } while (DAT_00fdba60 < iVar4);
  }
  else {
    for (DAT_00fdba60 = (DAT_00fdba68 / DAT_00fdba64 + 1) * DAT_00fdba64; DAT_00fdba60 < iVar4;
        DAT_00fdba60 = (DAT_00fdba60 + iVar4) / 2) {
    }
  }
LAB_00688897:
  if (s_Microphones == (void *)0x0) {
    s_Microphones = malloc(DAT_00fdba60 << 2);
  }
  else {
    s_Microphones = realloc(s_Microphones,DAT_00fdba60 << 2);
    iVar4 = DAT_00fdba68 + 1;
  }
LAB_00688795:
  iVar7 = iVar6 * 4;
  iVar6 = (iVar4 - iVar6) + -1;
  DAT_00fdba68 = iVar4;
  _DAT_00fdba6c = s_Microphones;
  if (0 < iVar6) {
    _V_memmove((void *)((int)s_Microphones + iVar7 + 4),(void *)((int)s_Microphones + iVar7),
               iVar6 * 4);
  }
  if ((undefined4 *)(iVar7 + (int)s_Microphones) == (undefined4 *)0x0) {
    return;
  }
  *(undefined4 *)(iVar7 + (int)s_Microphones) = uVar1;
  return;
}

SourceMod gamedata

paste into addons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)

Just a Signatures{} block, ready to drop into a gamedata file. Wire it up in your plugin however you like - SDKCall, DHooks, raw memory ops, or anything else.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)