L L4D2node

CUtlVector<CMatchExtensions::RegisteredInterface_t,CUtlMemory<CMatchExtensions::RegisteredInterface_t,int>>::EnsureCount

0x00058280 · 302 bytes · __thiscall

_ZN10CUtlVectorIN16CMatchExtensions21RegisteredInterface_tE10CUtlMemoryIS1_iEE11EnsureCountEi

Decompiled

undefined (2 params)

/* CUtlVector<CMatchExtensions::RegisteredInterface_t,
   CUtlMemory<CMatchExtensions::RegisteredInterface_t, int> >::EnsureCount(int) */

void __thiscall
CUtlVector<CMatchExtensions::RegisteredInterface_t,CUtlMemory<CMatchExtensions::RegisteredInterface_t,int>>
::EnsureCount(CUtlVector<CMatchExtensions::RegisteredInterface_t,CUtlMemory<CMatchExtensions::RegisteredInterface_t,int>>
              *this,int param_1)

{
  int iVar1;
  void *pvVar2;
  int iVar3;
  int iVar4;
  undefined4 *puVar5;
  int iVar6;
  int iVar7;
  
  iVar6 = *(int *)(this + 0xc);
  if (param_1 <= iVar6) {
    return;
  }
  iVar7 = param_1 - iVar6;
  if (iVar7 == 0) {
    return;
  }
  iVar4 = *(int *)(this + 4);
  iVar3 = iVar6;
  if (iVar4 < param_1) {
    iVar1 = *(int *)(this + 8);
    if (iVar1 < 0) goto LAB_000582ad;
    if (iVar1 == 0) {
      if (iVar4 == 0) {
        if (param_1 < 5) {
          iVar4 = 4;
          goto LAB_0005835f;
        }
        iVar4 = 4;
      }
      do {
        iVar4 = iVar4 * 2;
      } while (iVar4 < param_1);
    }
    else {
      for (iVar4 = ((param_1 + -1) / iVar1 + 1) * iVar1; iVar4 < param_1;
          iVar4 = (iVar4 + param_1) / 2) {
      }
    }
LAB_0005835f:
    *(int *)(this + 4) = iVar4;
    if (*(void **)this == (void *)0x0) {
      pvVar2 = malloc(iVar4 << 3);
      *(void **)this = pvVar2;
    }
    else {
      pvVar2 = realloc(*(void **)this,iVar4 << 3);
      *(void **)this = pvVar2;
      iVar3 = *(int *)(this + 0xc);
    }
  }
  else {
LAB_000582ad:
    pvVar2 = *(void **)this;
  }
  *(void **)(this + 0x10) = pvVar2;
  *(int *)(this + 0xc) = iVar3 + iVar7;
  iVar4 = ((iVar3 + iVar7) - iVar6) - iVar7;
  if (iVar4 < 1) {
    if (0 < iVar7) {
LAB_000582cd:
      iVar6 = iVar6 << 3;
      iVar4 = 0;
      do {
        puVar5 = (undefined4 *)(iVar6 + *(int *)this);
        if (puVar5 != (undefined4 *)0x0) {
          *puVar5 = 0;
          puVar5[1] = 0;
        }
        iVar4 = iVar4 + 1;
        iVar6 = iVar6 + 8;
      } while (iVar4 < iVar7);
      return;
    }
  }
  else if (0 < iVar7) {
    _V_memmove((void *)((int)pvVar2 + param_1 * 8),(void *)((int)pvVar2 + iVar6 * 8),iVar4 * 8);
    goto LAB_000582cd;
  }
  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)