AddFilesToList
0x00bd72b0 · 892 bytes · __cdecl
_Z14AddFilesToListR10CUtlVectorI10CUtlString10CUtlMemoryIS0_iEEPKcS6_S6_
Decompiled
undefined (4 params)
/* AddFilesToList(CUtlVector<CUtlString, CUtlMemory<CUtlString, int> >&, char const*, char const*,
char const*) */
void AddFilesToList(CUtlVector *param_1,char *param_2,char *param_3,char *param_4)
{
char cVar1;
char cVar2;
char *pcVar3;
int iVar4;
CUtlMemory<unsigned_char,int> *this;
int iVar5;
int in_GS_OFFSET;
CUtlMemory<CUtlString,int> *local_380;
undefined4 local_364;
CUtlString local_360 [16];
CUtlString local_350 [16];
int local_340 [5];
char local_32c [260];
char local_228 [260];
char local_124 [260];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
V_snprintf(local_32c,0x104,"%s\\*",param_2);
cVar1 = V_IsAbsolutePath(param_2);
pcVar3 = (char *)(**(code **)(*g_pFullFileSystem + 0x80))
(g_pFullFileSystem,local_32c,param_3,&local_364);
local_340[0] = 0;
local_340[1] = 0;
local_340[2] = 0;
local_340[3] = 0;
local_340[4] = 0;
if (pcVar3 != (char *)0x0) {
do {
V_snprintf(local_228,0x104,"%s\\%s",param_2,pcVar3);
cVar2 = (**(code **)(*g_pFullFileSystem + 0x78))(g_pFullFileSystem,local_364);
if (cVar2 == '\0') {
pcVar3 = (char *)V_GetFileExtension(pcVar3);
iVar4 = _V_stricmp(pcVar3,param_4);
if (iVar4 == 0) {
pcVar3 = local_228;
if (cVar1 == '\0') {
(**(code **)(*g_pFullFileSystem + 0x30))
(g_pFullFileSystem,local_228,param_3,local_124,0x104,0,0);
pcVar3 = local_124;
}
_V_strlower(pcVar3);
V_FixSlashes(pcVar3,'/');
CUtlString::CUtlString(local_350,pcVar3);
/* try { // try from 00bd74c6 to 00bd74ca has its CatchHandler @ 00bd769e */
CUtlVector<CUtlString,CUtlMemory<CUtlString,int>>::InsertBefore
((CUtlVector<CUtlString,CUtlMemory<CUtlString,int>> *)param_1,
*(int *)(param_1 + 0xc),local_350);
CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)local_350);
}
}
else {
/* try { // try from 00bd73a3 to 00bd74b1 has its CatchHandler @ 00bd76b0 */
iVar4 = V_strnicmp(pcVar3,".",2);
/* try { // try from 00bd74f3 to 00bd7511 has its CatchHandler @ 00bd76b0 */
if ((iVar4 != 0) && (iVar4 = V_strnicmp(pcVar3,"..",3), iVar4 != 0)) {
CUtlString::CUtlString(local_360,local_228);
/* try { // try from 00bd7529 to 00bd752d has its CatchHandler @ 00bd7633 */
CUtlVector<CUtlString,CUtlMemory<CUtlString,int>>::InsertBefore
((CUtlVector<CUtlString,CUtlMemory<CUtlString,int>> *)local_340,local_340[3],
local_360);
CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)local_360);
}
}
pcVar3 = (char *)(**(code **)(*g_pFullFileSystem + 0x74))(g_pFullFileSystem,local_364);
} while (pcVar3 != (char *)0x0);
}
local_380 = (CUtlMemory<CUtlString,int> *)local_340;
/* try { // try from 00bd756c to 00bd75b2 has its CatchHandler @ 00bd76b0 */
(**(code **)(*g_pFullFileSystem + 0x7c))(g_pFullFileSystem,local_364);
iVar4 = local_340[3];
if (0 < local_340[3]) {
iVar5 = 0;
do {
pcVar3 = CUtlString::operator_cast_to_char_((CUtlString *)(iVar5 * 0x10 + local_340[0]));
AddFilesToList(param_1,pcVar3,param_3,param_4);
iVar5 = iVar5 + 1;
} while (iVar5 != iVar4);
}
iVar5 = local_340[3] + -1;
iVar4 = iVar5 * 0x10;
if (-1 < iVar5) {
do {
iVar5 = iVar5 + -1;
this = (CUtlMemory<unsigned_char,int> *)(local_340[0] + iVar4);
iVar4 = iVar4 + -0x10;
CUtlMemory<unsigned_char,int>::Purge(this);
} while (iVar5 != -1);
}
local_340[3] = 0;
CUtlMemory<CUtlString,int>::Purge(local_380);
local_340[4] = local_340[0];
CUtlMemory<CUtlString,int>::Purge(local_380);
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.