L L4D2node

CUtlStreamBuffer::Close

0x00bf0950 · 213 bytes · __thiscall

_ZN16CUtlStreamBuffer5CloseEv

Decompiled

undefined (1 param)

/* CUtlStreamBuffer::Close() */

void __thiscall CUtlStreamBuffer::Close(CUtlStreamBuffer *this)

{
  int iVar1;
  int iVar2;
  int iVar3;
  
  if ((((byte)this[0x15] & 8) == 0) &&
     (iVar1 = *(int *)(this + 0x10), iVar2 = *(int *)(this + 0x20), 0 < iVar1 - iVar2)) {
    iVar3 = *(int *)(this + 0x38);
    if (iVar3 != 0) {
LAB_00bf0976:
      if (g_pFullFileSystem != 0) {
        (**(code **)(*(int *)(g_pFullFileSystem + 4) + 4))
                  (g_pFullFileSystem + 4,*(undefined4 *)this,iVar1 - iVar2,iVar3);
        goto LAB_00bf099a;
      }
      goto LAB_00bf09ba;
    }
    if (*(char **)(this + 0x3c) == (char *)0x0) goto LAB_00bf09d7;
    iVar3 = OpenFile(this,*(char **)(this + 0x3c),*(char **)(this + 0x40),*(int *)(this + 0x44));
    *(int *)(this + 0x38) = iVar3;
    if (iVar3 != 0) goto LAB_00bf0976;
  }
  else {
LAB_00bf099a:
    if (*(int *)(this + 0x38) != 0) {
      if (g_pFullFileSystem != 0) {
        (**(code **)(*(int *)(g_pFullFileSystem + 4) + 0xc))
                  (g_pFullFileSystem + 4,*(int *)(this + 0x38));
      }
LAB_00bf09ba:
      *(undefined4 *)(this + 0x38) = 0;
    }
  }
  if (*(void **)(this + 0x3c) != (void *)0x0) {
    operator_delete__(*(void **)(this + 0x3c));
    *(undefined4 *)(this + 0x3c) = 0;
  }
LAB_00bf09d7:
  if (*(void **)(this + 0x40) != (void *)0x0) {
    operator_delete__(*(void **)(this + 0x40));
    *(undefined4 *)(this + 0x40) = 0;
  }
  this[0x14] = (CUtlStreamBuffer)0x0;
  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)