L L4D2node

CUtlVector<char,CUtlMemory<char,int>>::GrowVector

0x00b73b10 · 184 bytes · __thiscall

_ZN10CUtlVectorIc10CUtlMemoryIciEE10GrowVectorEi

Decompiled

undefined (2 params)

/* CUtlVector<char, CUtlMemory<char, int> >::GrowVector(int) */

void __thiscall
CUtlVector<char,CUtlMemory<char,int>>::GrowVector
          (CUtlVector<char,CUtlMemory<char,int>> *this,int param_1)

{
  int iVar1;
  size_t __size;
  void *pvVar2;
  size_t sVar3;
  int iVar4;
  
  sVar3 = *(size_t *)(this + 4);
  iVar4 = *(int *)(this + 0xc) + param_1;
  if ((int)sVar3 < iVar4) {
    iVar1 = *(int *)(this + 8);
    if (-1 < iVar1) {
      if (iVar1 == 0) {
        if (sVar3 == 0) {
          if (iVar4 < 0x21) {
            __size = 0x20;
            goto LAB_00b73b6f;
          }
          sVar3 = 0x20;
        }
        do {
          __size = sVar3 * 2;
          if (iVar4 <= (int)__size) break;
          __size = sVar3 * 4;
          sVar3 = __size;
        } while ((int)__size < iVar4);
      }
      else {
        for (__size = ((iVar4 + -1) / iVar1 + 1) * iVar1; (int)__size < iVar4;
            __size = (int)(__size + iVar4) / 2) {
        }
      }
LAB_00b73b6f:
      *(size_t *)(this + 4) = __size;
      if (*(void **)this != (void *)0x0) {
        pvVar2 = realloc(*(void **)this,__size);
        *(void **)this = pvVar2;
        *(void **)(this + 0x10) = pvVar2;
        *(int *)(this + 0xc) = param_1 + *(int *)(this + 0xc);
        return;
      }
      pvVar2 = malloc(__size);
      *(void **)this = pvVar2;
      goto LAB_00b73b2d;
    }
  }
  pvVar2 = *(void **)this;
LAB_00b73b2d:
  *(int *)(this + 0xc) = iVar4;
  *(void **)(this + 0x10) = pvVar2;
  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)