L L4D2node

KeyValues::SaveToFile

0x00041b60 · 165 bytes · __thiscall

_ZN9KeyValues10SaveToFileEP15IBaseFileSystemPKcS3_

Decompiled

undefined (4 params)

/* KeyValues::SaveToFile(IBaseFileSystem*, char const*, char const*) */

undefined4 __thiscall
KeyValues::SaveToFile(KeyValues *this,IBaseFileSystem *param_1,char *param_2,char *param_3)

{
  void *pvVar1;
  char *pcVar2;
  
  pvVar1 = (void *)(**(code **)(*(int *)param_1 + 8))(param_1,param_2,&DAT_000b2b75,param_3);
  if (pvVar1 != (void *)0x0) {
    RecursiveSaveToFile(this,param_1,pvVar1,(CUtlBuffer *)0x0,0);
    (**(code **)(*(int *)param_1 + 0xc))(param_1,pvVar1);
    return 1;
  }
  if (param_3 == (char *)0x0) {
    param_3 = "NULL";
  }
  pcVar2 = "NULL";
  if (param_2 != (char *)0x0) {
    pcVar2 = param_2;
  }
  DevMsg(1,"KeyValues::SaveToFile: couldn\'t open file \"%s\" in path \"%s\".\n",pcVar2,param_3);
  return 0;
}

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)