L L4D2node

CUtlStreamBuffer::CUtlStreamBuffer

0x0028d800 · 354 bytes · __thiscall

_ZN16CUtlStreamBufferC2EPKcS1_ibi

Decompiled

undefined (6 params)

/* CUtlStreamBuffer::CUtlStreamBuffer(char const*, char const*, int, bool, int) */

void __thiscall
CUtlStreamBuffer::CUtlStreamBuffer
          (CUtlStreamBuffer *this,char *param_1,char *param_2,int param_3,bool param_4,int param_5)

{
  int iVar1;
  char *pcVar2;
  int iVar3;
  undefined1 *puVar4;
  char *pcVar5;
  code *pcVar6;
  undefined4 uVar7;
  
  CUtlBuffer::CUtlBuffer((CUtlBuffer *)this,0x4000,0x4000,param_3);
  pcVar6 = StreamPutOverflow;
  uVar7 = 0;
  pcVar5 = (char *)0x0;
                    /* try { // try from 0028d854 to 0028d963 has its CatchHandler @ 0028d96f */
  CUtlBuffer::SetOverflowFuncs((_func_bool_int *)this,StreamGetOverflow);
  if (param_4) {
    iVar1 = _V_strlen(param_1);
    pcVar2 = operator_new__(iVar1 + 1);
    *(char **)(this + 0x3c) = pcVar2;
    _V_strcpy(pcVar2,param_1);
    if (param_2 == (char *)0x0) {
      puVar4 = operator_new__(1);
      *(undefined1 **)(this + 0x40) = puVar4;
      *puVar4 = 0;
    }
    else {
      iVar1 = _V_strlen(param_2);
      pcVar2 = operator_new__(iVar1 + 1);
      *(char **)(this + 0x40) = pcVar2;
      _V_strcpy(pcVar2,param_2);
    }
    *(undefined4 *)(this + 0x38) = 0;
    *(int *)(this + 0x44) = param_5;
    param_2 = pcVar5;
  }
  else {
    *(undefined4 *)(this + 0x3c) = 0;
    *(undefined4 *)(this + 0x40) = 0;
    *(undefined4 *)(this + 0x44) = 0;
    iVar1 = OpenFile(this,param_1,param_2,param_5);
    *(int *)(this + 0x38) = iVar1;
    pcVar6 = (code *)param_5;
    if (iVar1 == 0) {
      this[0x14] = (CUtlStreamBuffer)((byte)this[0x14] | 4);
      return;
    }
  }
  if (((byte)this[0x15] & 8) != 0) {
    iVar3 = (**(code **)(*(int *)(g_pFullFileSystem + 4) + 0x18))
                      (g_pFullFileSystem + 4,*(undefined4 *)(this + 0x38),param_2,pcVar6,uVar7);
    iVar1 = *(int *)(this + 4);
    *(int *)(this + 0x1c) = iVar3;
    if (0 < iVar1) {
      if (iVar3 <= iVar1) {
        iVar1 = iVar3;
      }
      ReadBytesFromFile(this,iVar1,0);
      return;
    }
  }
  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)