L L4D2node

CSentence::AddRuntimePhoneme

0x000dd140 · 293 bytes · __thiscall

_ZN9CSentence17AddRuntimePhonemeEPK11CPhonemeTag

Decompiled

undefined (2 params)

/* CSentence::AddRuntimePhoneme(CPhonemeTag const*) */

void __thiscall CSentence::AddRuntimePhoneme(CSentence *this,CPhonemeTag *param_1)

{
  int iVar1;
  undefined4 *puVar2;
  int iVar3;
  void *pvVar4;
  int iVar5;
  int iVar6;
  
  puVar2 = operator_new(0xc);
  *puVar2 = 0;
  puVar2[1] = 0;
  *(undefined2 *)(puVar2 + 2) = 0;
  *puVar2 = *(undefined4 *)param_1;
  puVar2[1] = *(undefined4 *)(param_1 + 4);
  puVar2[2] = *(undefined4 *)(param_1 + 8);
  iVar1 = *(int *)(this + 0x24);
  iVar5 = *(int *)(this + 0x1c);
  iVar6 = iVar1 + 1;
  if (iVar5 < iVar6) {
    iVar3 = *(int *)(this + 0x20);
    if (-1 < iVar3) {
      if (iVar3 == 0) {
        if (iVar5 == 0) {
          if (iVar6 < 9) {
            iVar3 = 8;
            goto LAB_000dd207;
          }
          iVar5 = 8;
        }
        do {
          iVar3 = iVar5 * 2;
          if (iVar6 <= iVar3) break;
          iVar3 = iVar5 * 4;
          iVar5 = iVar3;
        } while (iVar3 < iVar6);
      }
      else {
        for (iVar3 = (iVar1 / iVar3 + 1) * iVar3; iVar3 < iVar6; iVar3 = (iVar3 + iVar6) / 2) {
        }
      }
LAB_000dd207:
      *(int *)(this + 0x1c) = iVar3;
      if (*(void **)(this + 0x18) == (void *)0x0) {
        pvVar4 = malloc(iVar3 << 2);
        *(void **)(this + 0x18) = pvVar4;
      }
      else {
        pvVar4 = realloc(*(void **)(this + 0x18),iVar3 << 2);
        *(void **)(this + 0x18) = pvVar4;
        iVar6 = *(int *)(this + 0x24) + 1;
      }
      goto LAB_000dd190;
    }
  }
  pvVar4 = *(void **)(this + 0x18);
LAB_000dd190:
  *(int *)(this + 0x24) = iVar6;
  iVar6 = (iVar6 - iVar1) + -1;
  *(void **)(this + 0x28) = pvVar4;
  iVar1 = iVar1 * 4;
  if (0 < iVar6) {
    _V_memmove((void *)((int)pvVar4 + iVar1 + 4),(void *)((int)pvVar4 + iVar1),iVar6 * 4);
    pvVar4 = *(void **)(this + 0x18);
  }
  if ((undefined4 *)((int)pvVar4 + iVar1) != (undefined4 *)0x0) {
    *(undefined4 *)((int)pvVar4 + iVar1) = puVar2;
  }
  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)