L L4D2node

COM_InitFilesystem

0x00127120 · 417 bytes · __cdecl

_Z18COM_InitFilesystemPKc

Decompiled

undefined (1 param)

/* COM_InitFilesystem(char const*) */

void COM_InitFilesystem(char *param_1)

{
  int iVar1;
  char *pcVar2;
  int in_GS_OFFSET;
  KeyValues *local_228;
  KeyValues *local_224;
  KeyValues *local_220;
  char *local_21c [2];
  int *local_214;
  char local_210 [512];
  int local_10;
  
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  CFSSearchPathsInit::CFSSearchPathsInit((CFSSearchPathsInit *)local_21c);
  local_21c[0] = param_1;
  local_214 = g_pFileSystem;
  if (param_1 == (char *)0x0) {
    local_21c[0] = DAT_003a1544;
  }
  FileSystem_LoadSearchPaths((CFSSearchPathsInit *)local_21c);
  iVar1 = LoadGameInfoFile(param_1,&local_228,&local_224,&local_220);
  if ((iVar1 == 0) && (local_228 != (KeyValues *)0x0)) {
    pcVar2 = (char *)KeyValues::GetString(local_228,"type","singleplayer_only");
    iVar1 = _V_stricmp(pcVar2,"singleplayer_only");
    if (iVar1 == 0) {
      DevMsg("Disabling whitelist file tracking in filesystem...\n");
      (**(code **)(*g_pFileSystem + 0x16c))(g_pFileSystem,0);
    }
    else {
      DevMsg("Enabling whitelist file tracking in filesystem...\n");
      (**(code **)(*g_pFileSystem + 0x16c))(g_pFileSystem,1);
    }
    KeyValues::deleteThis();
  }
  V_MakeAbsolutePath(com_gamedir,0x104,local_210,(char *)0x0);
  V_strncpy(com_basedir,host_parms,0x104);
  _V_strlower(com_basedir);
  V_FixSlashes(com_basedir,'/');
  COM_SetupLogDir((char *)0x0);
  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* 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)