L L4D2node

CUtlMemoryPool::Alloc

0x00254cc0 · 95 bytes · __thiscall

_ZN14CUtlMemoryPool5AllocEj

Decompiled

undefined (2 params)

/* CUtlMemoryPool::Alloc(unsigned int) */

undefined4 * __thiscall CUtlMemoryPool::Alloc(CUtlMemoryPool *this,uint param_1)

{
  undefined4 *puVar1;
  int iVar2;
  
  if (param_1 <= *(uint *)this) {
    puVar1 = *(undefined4 **)(this + 0xc);
    if (puVar1 != (undefined4 *)0x0) {
LAB_00254cd8:
      iVar2 = *(int *)(this + 0x10) + 1;
      *(int *)(this + 0x10) = iVar2;
      if (iVar2 < *(int *)(this + 0x14)) {
        iVar2 = *(int *)(this + 0x14);
      }
      *(int *)(this + 0x14) = iVar2;
      *(undefined4 *)(this + 0xc) = *puVar1;
      return puVar1;
    }
    if ((*(int *)(this + 8) != 0) || (*(short *)(this + 0x1a) == 0)) {
      AddNewBlob(this);
      puVar1 = *(undefined4 **)(this + 0xc);
      if (puVar1 != (undefined4 *)0x0) goto LAB_00254cd8;
    }
  }
  return (undefined4 *)0x0;
}

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)