L L4D2node

CUtlStreamBuffer::StreamPutOverflow

0x00bf0d30 · 330 bytes · __thiscall

_ZN16CUtlStreamBuffer17StreamPutOverflowEi

Decompiled

undefined (2 params)

/* CUtlStreamBuffer::StreamPutOverflow(int) */

uint __thiscall CUtlStreamBuffer::StreamPutOverflow(CUtlStreamBuffer *this,int param_1)

{
  int iVar1;
  undefined4 uVar2;
  int iVar3;
  
  if ((this[0x14] != (CUtlStreamBuffer)0x0) || (((byte)this[0x15] & 8) != 0)) {
    return 0;
  }
  if (0 < param_1) {
    GrowAllocatedSize(this,param_1 + 2);
  }
  iVar3 = (*(int *)(this + 0x10) - *(int *)(this + 0x20)) + -1;
  if ((0 < iVar3) || (param_1 < 0)) {
    if (*(int *)(this + 0x38) == 0) {
      uVar2 = OpenFile(this,*(char **)(this + 0x3c),*(char **)(this + 0x40),*(int *)(this + 0x44));
      *(undefined4 *)(this + 0x38) = uVar2;
    }
    if (0 < iVar3) {
      iVar1 = (**(code **)(*(int *)(g_pFullFileSystem + 4) + 4))
                        (g_pFullFileSystem + 4,*(undefined4 *)this,iVar3,
                         *(undefined4 *)(this + 0x38));
      if (iVar3 != iVar1) {
        return 0;
      }
      **(undefined1 **)this =
           (*(undefined1 **)this)[(*(int *)(this + 0x10) + -1) - *(int *)(this + 0x20)];
      iVar3 = *(int *)(this + 0x10);
      if (iVar3 < *(int *)(this + 4)) {
        *(undefined1 *)(*(int *)this + 1) =
             *(undefined1 *)(*(int *)this + (iVar3 - *(int *)(this + 0x20)));
        iVar3 = *(int *)(this + 0x10);
      }
      *(int *)(this + 0x20) = iVar3 + -1;
    }
    iVar3 = g_pFullFileSystem;
    if (param_1 < 0) {
      *(int *)(this + 0x20) = ~param_1;
      (**(code **)(*(int *)(iVar3 + 4) + 0x10))(iVar3 + 4,*(undefined4 *)(this + 0x38),~param_1,0);
      return (uint)param_1 >> 0x1f;
    }
  }
  return 1;
}

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)