GetSearchPath
0x00bd7180 · 267 bytes · __cdecl
_Z13GetSearchPathR10CUtlVectorI10CUtlString10CUtlMemoryIS0_iEEPKc
Decompiled
undefined (2 params)
/* GetSearchPath(CUtlVector<CUtlString, CUtlMemory<CUtlString, int> >&, char const*) */
void GetSearchPath(CUtlVector *param_1,char *param_2)
{
int iVar1;
code *pcVar2;
undefined4 uVar3;
int iVar4;
int iVar5;
char *pcVar6;
int in_GS_OFFSET;
int *apiStack_60 [2];
char *local_58;
int local_54 [5];
char *local_40 [4];
undefined1 local_30 [16];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
local_54[2] = 0;
local_54[1] = 0;
local_54[0] = 0;
local_58 = param_2;
apiStack_60[1] = g_pFullFileSystem;
apiStack_60[0] = (int *)0xbd71c3;
iVar5 = (**(code **)(*g_pFullFileSystem + 0x34))();
iVar4 = -((iVar5 + 0xfU & 0xfffffff0) + 0x10);
iVar1 = *g_pFullFileSystem;
*(int *)((int)local_54 + iVar4 + 8) = iVar5;
*(undefined4 *)((int)local_54 + iVar4) = 0;
*(char **)((int)local_54 + iVar4 + 4) = (char *)((int)local_40 + iVar4);
local_40[0] = (char *)((int)local_40 + iVar4);
*(char **)((int)&local_58 + iVar4) = param_2;
*(int **)((int)apiStack_60 + iVar4 + 4) = g_pFullFileSystem;
pcVar2 = *(code **)(iVar1 + 0x34);
*(undefined4 *)((int)apiStack_60 + iVar4) = 0xbd71fa;
(*pcVar2)();
while( true ) {
*(char **)((int)apiStack_60 + iVar4 + 4) = local_40[0];
*(undefined4 *)((int)&local_58 + iVar4) = 0x3b;
*(undefined4 *)((int)apiStack_60 + iVar4) = 0xbd7248;
pcVar6 = strchr(*(char **)((int)apiStack_60 + iVar4 + 4),*(int *)((int)&local_58 + iVar4));
if (pcVar6 == (char *)0x0) break;
*pcVar6 = '\0';
*(char **)((int)&local_58 + iVar4) = local_40[0];
*(undefined1 **)((int)apiStack_60 + iVar4 + 4) = local_30;
*(undefined4 *)((int)apiStack_60 + iVar4) = 0xbd7217;
CUtlString::CUtlString
(*(CUtlString **)((int)apiStack_60 + iVar4 + 4),*(char **)((int)&local_58 + iVar4));
*(undefined1 **)((int)local_54 + iVar4) = local_30;
uVar3 = *(undefined4 *)(param_1 + 0xc);
*(CUtlVector **)((int)apiStack_60 + iVar4 + 4) = param_1;
*(undefined4 *)((int)&local_58 + iVar4) = uVar3;
/* try { // try from 00bd7225 to 00bd7229 has its CatchHandler @ 00bd728c */
*(undefined4 *)((int)apiStack_60 + iVar4) = 0xbd722a;
CUtlVector<CUtlString,CUtlMemory<CUtlString,int>>::InsertBefore
(*(CUtlVector<CUtlString,CUtlMemory<CUtlString,int>> **)((int)apiStack_60 + iVar4 + 4)
,*(int *)((int)&local_58 + iVar4),*(CUtlString **)((int)local_54 + iVar4));
*(undefined1 **)((int)apiStack_60 + iVar4 + 4) = local_30;
*(undefined4 *)((int)apiStack_60 + iVar4) = 0xbd7232;
CUtlMemory<unsigned_char,int>::Purge
(*(CUtlMemory<unsigned_char,int> **)((int)apiStack_60 + iVar4 + 4));
local_40[0] = pcVar6 + 1;
}
*(char **)((int)&local_58 + iVar4) = local_40[0];
*(undefined1 **)((int)apiStack_60 + iVar4 + 4) = local_30;
*(undefined4 *)((int)apiStack_60 + iVar4) = 0xbd725d;
CUtlString::CUtlString
(*(CUtlString **)((int)apiStack_60 + iVar4 + 4),*(char **)((int)&local_58 + iVar4));
*(undefined1 **)((int)local_54 + iVar4) = local_30;
uVar3 = *(undefined4 *)(param_1 + 0xc);
*(CUtlVector **)((int)apiStack_60 + iVar4 + 4) = param_1;
*(undefined4 *)((int)&local_58 + iVar4) = uVar3;
/* try { // try from 00bd726b to 00bd726f has its CatchHandler @ 00bd72a3 */
*(undefined4 *)((int)apiStack_60 + iVar4) = 0xbd7270;
CUtlVector<CUtlString,CUtlMemory<CUtlString,int>>::InsertBefore
(*(CUtlVector<CUtlString,CUtlMemory<CUtlString,int>> **)((int)apiStack_60 + iVar4 + 4),
*(int *)((int)&local_58 + iVar4),*(CUtlString **)((int)local_54 + iVar4));
*(undefined1 **)((int)apiStack_60 + iVar4 + 4) = local_30;
*(undefined4 *)((int)apiStack_60 + iVar4) = 0xbd7278;
CUtlMemory<unsigned_char,int>::Purge
(*(CUtlMemory<unsigned_char,int> **)((int)apiStack_60 + iVar4 + 4));
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
*(undefined1 **)((int)apiStack_60 + iVar4) = &LAB_00bd72a3;
__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.