L L4D2node

CUtlBuffer::EnsureCapacity

0x00b7e550 · 115 bytes · __thiscall

_ZN10CUtlBuffer14EnsureCapacityEi

Decompiled

undefined (2 params)

/* CUtlBuffer::EnsureCapacity(int) */

void __thiscall CUtlBuffer::EnsureCapacity(CUtlBuffer *this,int param_1)

{
  void *pvVar1;
  int iVar2;
  
  if (*(int *)(this + 8) < 0) {
    iVar2 = *(int *)(this + 4);
    if ((((byte)this[0x15] & 2) == 0) || ((int)(param_1 + 1U) <= iVar2)) goto LAB_00b7e56b;
    CUtlMemory<unsigned_char,int>::ConvertToGrowableMemory((int)this);
  }
  iVar2 = *(int *)(this + 4);
  param_1 = param_1 + 1U;
LAB_00b7e56b:
  if ((iVar2 < param_1) && (-1 < *(int *)(this + 8))) {
    *(int *)(this + 4) = param_1;
    if (*(void **)this == (void *)0x0) {
      pvVar1 = malloc(param_1);
      *(void **)this = pvVar1;
      return;
    }
    pvVar1 = realloc(*(void **)this,param_1);
    *(void **)this = pvVar1;
  }
  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)