L L4D2node

CSoundParametersInternal::AddToTail

0x00599940 · 216 bytes · __thiscall

_ZN24CSoundParametersInternal9AddToTailEPP9SoundFilePtRKS0_

Decompiled

undefined (4 params)

/* CSoundParametersInternal::AddToTail(SoundFile**, unsigned short*, SoundFile const&) */

void __thiscall
CSoundParametersInternal::AddToTail
          (CSoundParametersInternal *this,SoundFile **param_1,ushort *param_2,SoundFile *param_3)

{
  SoundFile *pSVar1;
  ushort uVar2;
  SoundFile local_20;
  SoundFile local_1f;
  undefined2 local_1e;
  
  uVar2 = *param_2 + 1;
  *param_2 = uVar2;
  if (uVar2 == 1) {
    *(undefined2 *)param_1 = *(undefined2 *)param_3;
    *(SoundFile *)((int)param_1 + 2) = param_3[2];
    *(SoundFile *)((int)param_1 + 3) = param_3[3];
    return;
  }
  if (uVar2 == 2) {
    local_1e = *(undefined2 *)param_1;
    local_1f = *(SoundFile *)((int)param_1 + 2);
    local_20 = *(SoundFile *)((int)param_1 + 3);
    *param_1 = (SoundFile *)0x0;
    uVar2 = *param_2;
    pSVar1 = (SoundFile *)0x0;
  }
  else {
    pSVar1 = *param_1;
    local_20 = (SoundFile)0x1;
    local_1f = (SoundFile)0x0;
    local_1e = 0xffff;
  }
  pSVar1 = realloc(pSVar1,(uint)uVar2 << 2);
  *param_1 = pSVar1;
  pSVar1 = pSVar1 + (uint)*param_2 * 4 + -4;
  *(undefined2 *)pSVar1 = *(undefined2 *)param_3;
  pSVar1[2] = param_3[2];
  pSVar1[3] = param_3[3];
  if (*param_2 != 2) {
    return;
  }
  pSVar1 = *param_1;
  *(undefined2 *)pSVar1 = local_1e;
  pSVar1[2] = local_1f;
  pSVar1[3] = local_20;
  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)