L L4D2node

GetSteamCfgPath

0x000d82a0 · 209 bytes · __cdecl

_Z15GetSteamCfgPathPci

Decompiled

undefined (2 params)

/* GetSteamCfgPath(char*, int) */

undefined4 GetSteamCfgPath(char *param_1,int param_2)

{
  char cVar1;
  undefined4 uVar2;
  int in_GS_OFFSET;
  char local_124 [260];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  *param_1 = '\0';
  cVar1 = FileSystem_GetExecutableDir(local_124,0x104);
  if (cVar1 == '\0') {
    uVar2 = SetupFileSystemError(0,3,"FileSystem_GetExecutableDir failed.");
  }
  else {
    V_strncpy(param_1,local_124,param_2);
    do {
      cVar1 = DoesFileExistIn(param_1,"steam.cfg");
      if (cVar1 != '\0') {
        V_AppendSlash(param_1,param_2);
        V_strncat(param_1,"steam.cfg",param_2,-1);
        uVar2 = 0;
        goto LAB_000d8337;
      }
      cVar1 = V_StripLastDir(param_1,param_2);
    } while (cVar1 != '\0');
    uVar2 = 0;
  }
LAB_000d8337:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return uVar2;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)