L L4D2node

CDemoFile::Open

0x00131ca0 · 265 bytes · __thiscall

_ZN9CDemoFile4OpenEPKcb

Decompiled

undefined (3 params)

/* CDemoFile::Open(char const*, bool) */

undefined4 __thiscall CDemoFile::Open(CDemoFile *this,char *param_1,bool param_2)

{
  CUtlStreamBuffer *this_00;
  undefined4 uVar1;
  undefined4 uVar2;
  char *pcVar3;
  
  this_00 = (CUtlStreamBuffer *)(this + 0x534);
  uVar1 = CUtlStreamBuffer::IsOpen(this_00);
  if ((char)uVar1 != '\0') {
    ConMsg("CDemoFile::Open: file already open.\n");
    return 0;
  }
  *this = (CDemoFile)0x0;
  _V_memset(this + 0x104,0,0x430);
  CUtlStreamBuffer::Open(this_00,param_1,(char *)0x0,~-(uint)!param_2 & 8,0);
  uVar2 = CUtlStreamBuffer::IsOpen(this_00);
  if (((char)uVar2 != '\0') && (this[0x548] == (CDemoFile)0x0)) {
    V_strncpy((char *)this,param_1,0x104);
    return uVar2;
  }
  pcVar3 = "reading";
  if (!param_2) {
    pcVar3 = "writing";
  }
  ConMsg("CDemoFile::Open: couldn\'t open file %s for %s.\n",param_1,pcVar3);
  CUtlStreamBuffer::Close(this_00);
  return uVar1;
}

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)