L L4D2node

CUtlBuffer::PutOverflow

0x00260250 · 233 bytes · __thiscall

_ZN10CUtlBuffer11PutOverflowEi

Decompiled

undefined (2 params)

/* CUtlBuffer::PutOverflow(int) */

undefined4 __thiscall CUtlBuffer::PutOverflow(CUtlBuffer *this,int param_1)

{
  int iVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  void *pvVar5;
  size_t __size;
  
  if (*(int *)(this + 8) < 0) {
    if (((byte)this[0x15] & 2) == 0) {
      return 0;
    }
    CUtlMemory<unsigned_char,int>::ConvertToGrowableMemory((int)this);
  }
LAB_00260270:
  iVar2 = *(int *)(this + 0x20);
  iVar3 = *(int *)(this + 0x10);
  __size = *(size_t *)(this + 4);
  if ((iVar3 - iVar2) + param_1 <= (int)__size) {
    return 1;
  }
  do {
    iVar4 = *(int *)(this + 8);
    do {
    } while (iVar4 < 0);
    iVar1 = __size + 1;
    if (iVar4 == 0) {
      if (__size == 0) {
        __size = 0x20;
      }
      if (iVar1 <= (int)__size) goto LAB_002602bf;
      do {
        __size = __size * 2;
      } while ((int)__size < iVar1);
      pvVar5 = *(void **)this;
      *(size_t *)(this + 4) = __size;
    }
    else {
      for (__size = ((int)__size / iVar4 + 1) * iVar4; (int)__size < iVar1;
          __size = (int)(__size + iVar1) / 2) {
      }
LAB_002602bf:
      pvVar5 = *(void **)this;
      *(size_t *)(this + 4) = __size;
    }
    if (pvVar5 != (void *)0x0) break;
    pvVar5 = malloc(__size);
    *(void **)this = pvVar5;
    if ((iVar3 - iVar2) + param_1 <= (int)__size) {
      return 1;
    }
  } while( true );
  pvVar5 = realloc(pvVar5,__size);
  *(void **)this = pvVar5;
  goto LAB_00260270;
}

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)