CDownloadListGenerator::AddMatchingFiles
0x0013f840 · 517 bytes · __thiscall
_ZN22CDownloadListGenerator16AddMatchingFilesEPKcS1_PNS_17WhiteListFileDataEb
Decompiled
undefined (5 params)
/* CDownloadListGenerator::AddMatchingFiles(char const*, char const*,
CDownloadListGenerator::WhiteListFileData*, bool) */
bool __thiscall
CDownloadListGenerator::AddMatchingFiles
(CDownloadListGenerator *this,char *param_1,char *param_2,WhiteListFileData *param_3,
bool param_4)
{
int iVar1;
char cVar2;
char *pcVar3;
int iVar4;
int in_GS_OFFSET;
undefined4 local_330;
char local_32c [260];
char local_228 [260];
char local_124 [260];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
iVar1 = *(int *)(this + 0x18c);
V_strncpy(local_32c,param_1,0x104);
V_AppendSlash(local_32c,0x104);
pcVar3 = ".*";
if (param_2 != (char *)0x0) {
pcVar3 = param_2;
}
V_snprintf(local_228,0x104,"%s*%s",local_32c,pcVar3);
pcVar3 = (char *)(**(code **)(*g_pFullFileSystem + 0x80))
(g_pFullFileSystem,local_228,"GAME_ROOT",&local_330);
while (pcVar3 != (char *)0x0) {
if (*pcVar3 != '.') {
V_ComposeFileName(local_32c,pcVar3,local_124,0x104);
cVar2 = (**(code **)(*g_pFullFileSystem + 0x78))(g_pFullFileSystem,local_330);
if (cVar2 == '\0') {
cVar2 = (**(code **)(*g_pFullFileSystem + 0x4c))(g_pFullFileSystem,local_124,0);
if ((cVar2 == '\0') &&
((param_2 == (char *)0x0 || (iVar4 = V_stristr(local_124,param_2), iVar4 != 0)))) {
AddFileToWhiteList(this,local_124,param_3);
}
}
else if (param_4) {
AddMatchingFiles(this,local_124,param_2,param_3,true);
}
}
pcVar3 = (char *)(**(code **)(*g_pFullFileSystem + 0x74))(g_pFullFileSystem,local_330);
}
(**(code **)(*g_pFullFileSystem + 0x7c))(g_pFullFileSystem,local_330);
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return iVar1 != *(int *)(this + 0x18c);
}
/* 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.