FileSystem_AddLoadedSearchPath
0x000d76a0 · 671 bytes · __regparm3
_ZL30FileSystem_AddLoadedSearchPathR18CFSSearchPathsInitPKcPbbS2_S2_b
Decompiled
undefined (7 params)
/* FileSystem_AddLoadedSearchPath(CFSSearchPathsInit&, char const*, bool*, bool, char const*, char
const*, bool) */
void __regparm3
FileSystem_AddLoadedSearchPath
(CFSSearchPathsInit *param_1,char *param_2,bool *param_3,bool param_4,char *param_5,
char *param_6,bool param_7)
{
bool bVar1;
char cVar2;
int iVar3;
char *pcVar4;
int *piVar5;
int in_GS_OFFSET;
char local_228 [260];
char local_124 [260];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
V_MakeAbsolutePath(local_228,0x104,param_6,param_5);
V_FixSlashes(local_228,'/');
cVar2 = V_RemoveDotSlashes(local_228,'/');
if (cVar2 == '\0') {
Error("FileSystem_AddLoadedSearchPath - Can\'t resolve pathname for \'%s\'",local_228);
}
iVar3 = _V_stricmp(param_2,"game");
if (iVar3 != 0) goto LAB_000d7733;
pcVar4 = (char *)V_UnqualifiedFileName(local_228);
iVar3 = _V_strcmp(pcVar4,"hl2");
if (iVar3 == 0) {
LAB_000d77a4:
piVar5 = (int *)CommandLine_Tier0();
(**(code **)(*piVar5 + 0x28))(piVar5,"-tempcontent");
bVar1 = false;
}
else {
iVar3 = _V_strcmp(pcVar4,"update");
if (iVar3 == 0) goto LAB_000d77a4;
if (param_7) {
V_snprintf(local_124,0x104,"%s_lv",local_228);
(**(code **)(**(int **)(param_1 + 8) + 0x1c))(*(int **)(param_1 + 8),local_124,param_2,1,0);
}
piVar5 = (int *)CommandLine_Tier0();
iVar3 = (**(code **)(*piVar5 + 0x28))(piVar5,"-tempcontent");
if (iVar3 == 0) {
bVar1 = true;
}
else {
V_snprintf(local_124,0x104,"%s_tempcontent",local_228);
(**(code **)(**(int **)(param_1 + 8) + 0x1c))(*(int **)(param_1 + 8),local_124,param_2,1,0);
bVar1 = true;
}
}
if ((*param_3 != false) && (param_4)) {
*param_3 = false;
(**(code **)(**(int **)(param_1 + 8) + 0x1c))
(*(int **)(param_1 + 8),local_228,&DAT_002a0772,1,0);
V_strncpy((char *)(param_1 + 0xc),local_228,0x200);
}
if (bVar1) {
AddGameBinDir(*(IFileSystem **)(param_1 + 8),local_228);
}
LAB_000d7733:
(**(code **)(**(int **)(param_1 + 8) + 0x1c))(*(int **)(param_1 + 8),local_228,param_2,1,0);
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.