L L4D2node

CUtlVector<OpenListInfo_t,CUtlMemoryFixedGrowable<OpenListInfo_t,4096u,int>>::GrowVector

0x00713f60 · 286 bytes · __thiscall

_ZN10CUtlVectorI14OpenListInfo_t23CUtlMemoryFixedGrowableIS0_Lj4096EiEE10GrowVectorEi

Decompiled

undefined (2 params)

/* CUtlVector<OpenListInfo_t, CUtlMemoryFixedGrowable<OpenListInfo_t, 4096u, int> >::GrowVector(int)
    */

void __thiscall
CUtlVector<OpenListInfo_t,CUtlMemoryFixedGrowable<OpenListInfo_t,4096u,int>>::GrowVector
          (CUtlVector<OpenListInfo_t,CUtlMemoryFixedGrowable<OpenListInfo_t,4096u,int>> *this,
          int param_1)

{
  int iVar1;
  void *__dest;
  int iVar2;
  int iVar3;
  
  iVar1 = *(int *)(this + 4);
  iVar2 = *(int *)(this + 0x8010) + param_1;
  if (iVar2 <= iVar1) {
    __dest = *(void **)this;
    goto LAB_00713f80;
  }
  iVar3 = *(int *)(this + 8);
  iVar2 = iVar2 - iVar1;
  if (iVar3 < 0) {
    iVar3 = *(int *)(this + 0xc);
    *(int *)(this + 8) = iVar3;
    if (iVar1 == 0) {
      *(undefined4 *)this = 0;
      __dest = (void *)0x0;
    }
    else {
      __dest = malloc(iVar1 * 8);
      memcpy(__dest,*(void **)this,iVar1 * 8);
      iVar3 = *(int *)(this + 8);
      *(void **)this = __dest;
    }
    if (-1 < iVar3) {
      iVar1 = *(int *)(this + 4);
      goto LAB_00713fa3;
    }
  }
  else {
LAB_00713fa3:
    iVar2 = iVar2 + iVar1;
    if (iVar3 == 0) {
      if (iVar1 == 0) {
        iVar1 = 4;
      }
      for (; iVar1 < iVar2; iVar1 = iVar1 * 2) {
      }
    }
    else {
      for (iVar1 = ((iVar2 + -1) / iVar3 + 1) * iVar3; iVar1 < iVar2; iVar1 = (iVar1 + iVar2) / 2) {
      }
    }
    *(int *)(this + 4) = iVar1;
    if (*(void **)this != (void *)0x0) {
      __dest = realloc(*(void **)this,iVar1 << 3);
      iVar2 = param_1 + *(int *)(this + 0x8010);
      *(void **)this = __dest;
      goto LAB_00713f80;
    }
    __dest = malloc(iVar1 << 3);
    *(void **)this = __dest;
  }
  iVar2 = param_1 + *(int *)(this + 0x8010);
LAB_00713f80:
  *(int *)(this + 0x8010) = iVar2;
  *(void **)(this + 0x8014) = __dest;
  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)