L L4D2node

CStringPool::Allocate

0x00b7a2b0 · 94 bytes · __thiscall

_ZN11CStringPool8AllocateEPKc

Decompiled

undefined (2 params)

/* CStringPool::Allocate(char const*) */

char * __thiscall CStringPool::Allocate(CStringPool *this,char *param_1)

{
  ushort uVar1;
  char *pcVar2;
  char *local_10;
  
  uVar1 = CUtlRBTree<char_const*,unsigned_short,bool(*)(char_const*const&,char_const*const&),CUtlMemory<UtlRBTreeNode_t<char_const*,unsigned_short>,unsigned_short>>
          ::Find((CUtlRBTree<char_const*,unsigned_short,bool(*)(char_const*const&,char_const*const&),CUtlMemory<UtlRBTreeNode_t<char_const*,unsigned_short>,unsigned_short>>
                  *)this,&param_1);
  if (uVar1 != 0xffff) {
    return *(char **)(*(int *)(this + 4) + (uint)uVar1 * 0xc + 8);
  }
  pcVar2 = strdup(param_1);
  local_10 = pcVar2;
  CUtlRBTree<char_const*,unsigned_short,bool(*)(char_const*const&,char_const*const&),CUtlMemory<UtlRBTreeNode_t<char_const*,unsigned_short>,unsigned_short>>
  ::Insert((CUtlRBTree<char_const*,unsigned_short,bool(*)(char_const*const&,char_const*const&),CUtlMemory<UtlRBTreeNode_t<char_const*,unsigned_short>,unsigned_short>>
            *)this,&local_10);
  return pcVar2;
}

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)