L L4D2node

CUtlVector<CUtlVector<CSplitPacketEntry,CUtlMemory<CSplitPacketEntry,int>>,CUtlMemory<CUtlVector<CSplitPacketEntry,CUtlMemory<CSplitPacketEntry,int>>,int>>::EnsureCount

0x001ca2f0 · 345 bytes · __thiscall

_ZN10CUtlVectorIS_I17CSplitPacketEntry10CUtlMemoryIS0_iEES1_IS3_iEE11EnsureCountEi

Decompiled

undefined (2 params)

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

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

{
  int iVar1;
  undefined4 *puVar2;
  void *pvVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  
  iVar6 = *(int *)(this + 0xc);
  if (param_1 <= iVar6) {
    return;
  }
  iVar7 = param_1 - iVar6;
  if (iVar7 == 0) {
    return;
  }
  iVar5 = *(int *)(this + 4);
  iVar4 = iVar6;
  if (iVar5 < param_1) {
    iVar1 = *(int *)(this + 8);
    if (iVar1 < 0) goto LAB_001ca321;
    if (iVar1 == 0) {
      if (iVar5 == 0) {
        if (param_1 < 3) {
          iVar5 = 2;
          goto LAB_001ca3f7;
        }
        iVar5 = 2;
      }
      do {
        iVar5 = iVar5 * 2;
      } while (iVar5 < param_1);
    }
    else {
      for (iVar5 = ((param_1 + -1) / iVar1 + 1) * iVar1; iVar5 < param_1;
          iVar5 = (iVar5 + param_1) / 2) {
      }
    }
LAB_001ca3f7:
    *(int *)(this + 4) = iVar5;
    if (*(void **)this == (void *)0x0) {
      pvVar3 = malloc(iVar5 * 0x14);
      *(void **)this = pvVar3;
    }
    else {
      pvVar3 = realloc(*(void **)this,iVar5 * 0x14);
      *(void **)this = pvVar3;
      iVar4 = *(int *)(this + 0xc);
    }
  }
  else {
LAB_001ca321:
    pvVar3 = *(void **)this;
  }
  *(void **)(this + 0x10) = pvVar3;
  *(int *)(this + 0xc) = iVar4 + iVar7;
  iVar5 = ((iVar4 + iVar7) - iVar6) - iVar7;
  if (iVar5 < 1) {
    if (0 < iVar7) {
LAB_001ca341:
      iVar5 = 0;
      iVar6 = iVar6 * 0x14;
      do {
        puVar2 = (undefined4 *)(iVar6 + *(int *)this);
        if (puVar2 != (undefined4 *)0x0) {
          *puVar2 = 0;
          puVar2[1] = 0;
          puVar2[2] = 0;
          puVar2[3] = 0;
          puVar2[4] = 0;
        }
        iVar5 = iVar5 + 1;
        iVar6 = iVar6 + 0x14;
      } while (iVar5 < iVar7);
      return;
    }
  }
  else if (0 < iVar7) {
    _V_memmove((void *)((int)pvVar3 + param_1 * 0x14),(void *)((int)pvVar3 + iVar6 * 0x14),
               iVar5 * 0x14);
    goto LAB_001ca341;
  }
  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)