L L4D2node

FileSystem_GetExecutableDir

0x000d79b0 · 205 bytes · __cdecl

_Z27FileSystem_GetExecutableDirPci

Decompiled

undefined (2 params)

/* FileSystem_GetExecutableDir(char*, int) */

undefined4 FileSystem_GetExecutableDir(char *param_1,int param_2)

{
  char *pcVar1;
  int *piVar2;
  int iVar3;
  undefined4 uVar4;
  bool bVar5;
  
  bVar5 = s_bUseVProjectBinDir == '\0';
  *param_1 = '\0';
  if (bVar5) {
    piVar2 = (int *)CommandLine_Tier0();
    iVar3 = (**(code **)(*piVar2 + 0x2c))(piVar2,0);
    if (iVar3 == 0) {
      return 0;
    }
    piVar2 = (int *)CommandLine_Tier0();
    pcVar1 = (char *)(**(code **)(*piVar2 + 0x2c))(piVar2,0);
    V_MakeAbsolutePath(param_1,param_2,pcVar1,(char *)0x0);
    uVar4 = FileSystem_GetExecutableDir(param_1,param_2);
    return uVar4;
  }
  pcVar1 = (char *)GetVProjectCmdLineValue();
  if ((pcVar1 == (char *)0x0) && (pcVar1 = getenv("VProject"), pcVar1 == (char *)0x0)) {
    return 0;
  }
  V_snprintf(param_1,param_2,"%s%c..%cbin",pcVar1,0x2f,0x2f);
  return 1;
}

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)