FileSystem_RemoveAllAddonSearchPaths
0x0015e130 · 836 bytes · __regparm3
_ZL36FileSystem_RemoveAllAddonSearchPathsPKc
Decompiled
undefined (1 param)
/* FileSystem_RemoveAllAddonSearchPaths(char const*) */
void __regparm3 FileSystem_RemoveAllAddonSearchPaths(char *param_1)
{
code *pcVar1;
void *pvVar2;
int iVar3;
char *pcVar4;
CUtlMemory<unsigned_char,int> *this;
int iVar5;
int in_GS_OFFSET;
int local_b74 [5];
int local_b60 [5];
char local_b4c [260];
char local_a48 [2600];
int local_20;
local_b74[0] = 0;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
local_b74[1] = 0;
local_b74[2] = 0;
local_b74[3] = 0;
local_b74[4] = 0;
/* try { // try from 0015e1ab to 0015e261 has its CatchHandler @ 0015e475 */
V_snprintf(local_b4c,0x104,"%s%s",param_1,"addons");
(**(code **)(*g_pFileSystem + 0x34))(g_pFileSystem,&DAT_002a076d,0,local_a48,0xa28);
V_SplitString(local_a48,";",(CUtlVector *)local_b74);
iVar5 = 0;
if (0 < local_b74[3]) {
do {
iVar3 = V_stristr(*(char **)(local_b74[0] + iVar5 * 4),local_b4c);
if (iVar3 != 0) {
(**(code **)(*g_pFileSystem + 0x20))
(g_pFileSystem,*(undefined4 *)(local_b74[0] + iVar5 * 4),&DAT_002a076d);
}
iVar5 = iVar5 + 1;
} while (iVar5 < local_b74[3]);
}
local_b60[0] = 0;
local_b60[1] = 0;
local_b60[2] = 0;
local_b60[3] = 0;
local_b60[4] = 0;
/* try { // try from 0015e2b3 to 0015e321 has its CatchHandler @ 0015e492 */
(**(code **)(*g_pFileSystem + 0x1b8))(g_pFileSystem,local_b60);
if (0 < local_b60[3]) {
iVar5 = 0;
do {
pcVar4 = CUtlString::operator_cast_to_char_((CUtlString *)(local_b60[0] + iVar5 * 0x10));
iVar3 = V_stristr(pcVar4,local_b4c);
if (iVar3 != 0) {
pcVar1 = *(code **)(*g_pFileSystem + 0x1b0);
pcVar4 = CUtlString::operator_cast_to_char_((CUtlString *)(iVar5 * 0x10 + local_b60[0]));
(*pcVar1)(g_pFileSystem,pcVar4);
}
iVar5 = iVar5 + 1;
} while (iVar5 < local_b60[3]);
}
iVar5 = local_b60[3] + -1;
iVar3 = iVar5 * 0x10;
if (-1 < iVar5) {
do {
iVar5 = iVar5 + -1;
this = (CUtlMemory<unsigned_char,int> *)(local_b60[0] + iVar3);
iVar3 = iVar3 + -0x10;
CUtlMemory<unsigned_char,int>::Purge(this);
} while (iVar5 != -1);
}
iVar5 = 0;
local_b60[3] = 0;
CUtlMemory<CUtlString,int>::Purge((CUtlMemory<CUtlString,int> *)local_b60);
local_b60[4] = local_b60[0];
CUtlMemory<CUtlString,int>::Purge((CUtlMemory<CUtlString,int> *)local_b60);
if (0 < local_b74[3]) {
do {
pvVar2 = *(void **)(local_b74[0] + iVar5 * 4);
if (pvVar2 != (void *)0x0) {
operator_delete__(pvVar2);
}
iVar5 = iVar5 + 1;
} while (iVar5 < local_b74[3]);
}
iVar5 = 0;
local_b74[3] = 0;
CUtlMemory<char*,int>::Purge((CUtlMemory<char*,int> *)local_b74);
local_b74[4] = local_b74[0];
if (0 < local_b74[3]) {
do {
iVar3 = iVar5 * 4;
iVar5 = iVar5 + 1;
operator_delete(*(void **)(local_b74[0] + iVar3));
} while (iVar5 < local_b74[3]);
}
local_b74[3] = 0;
CUtlMemory<char*,int>::Purge((CUtlMemory<char*,int> *)local_b74);
local_b74[3] = 0;
local_b74[4] = local_b74[0];
CUtlMemory<char*,int>::Purge((CUtlMemory<char*,int> *)local_b74);
local_b74[4] = local_b74[0];
CUtlMemory<char*,int>::Purge((CUtlMemory<char*,int> *)local_b74);
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
return;
}
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.