L L4D2node

COM_GetModDirectory

0x00057d60 · 246 bytes · unknown

_Z19COM_GetModDirectoryv

Decompiled

undefined (0 params)

/* WARNING: Unknown calling convention -- yet parameter storage is locked */
/* COM_GetModDirectory() */

undefined1 * COM_GetModDirectory(void)

{
  code *pcVar1;
  int iVar2;
  int *piVar3;
  int *piVar4;
  undefined4 uVar5;
  char *pcVar6;
  char *pcVar7;
  
  iVar2 = _V_strlen(COM_GetModDirectory()::modDir);
  if (iVar2 == 0) {
    piVar3 = (int *)CommandLine_Tier0();
    pcVar1 = *(code **)(*piVar3 + 0x18);
    piVar4 = (int *)CommandLine_Tier0();
    uVar5 = (**(code **)(*piVar4 + 0x18))(piVar4,"-defaultgamedir",&DAT_000b3a3c);
    pcVar6 = (char *)(*pcVar1)(piVar3,"-game",uVar5);
    V_strncpy(COM_GetModDirectory()::modDir,pcVar6,0x104);
    pcVar7 = strchr(COM_GetModDirectory()::modDir,0x2f);
    if ((pcVar7 != (char *)0x0) ||
       (pcVar7 = strchr(COM_GetModDirectory()::modDir,0x5c), pcVar7 != (char *)0x0)) {
      V_StripLastDir(COM_GetModDirectory()::modDir,0x104);
      iVar2 = _V_strlen(COM_GetModDirectory()::modDir);
      V_strncpy(COM_GetModDirectory()::modDir,pcVar6 + iVar2,0x104 - iVar2);
      return COM_GetModDirectory()::modDir;
    }
  }
  return COM_GetModDirectory()::modDir;
}

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)