LoadAddonListFile
0x0015de60 · 439 bytes · __cdecl
_Z17LoadAddonListFilePKcRP9KeyValues
Decompiled
undefined (2 params)
/* LoadAddonListFile(char const*, KeyValues*&) */
undefined4 LoadAddonListFile(char *param_1,KeyValues **param_2)
{
code *pcVar1;
char cVar2;
KeyValues *pKVar3;
undefined4 uVar4;
int iVar5;
char *pcVar6;
int *piVar7;
int in_GS_OFFSET;
char local_334 [260];
char local_230 [260];
CFmtStrN<256> local_12c [5];
undefined1 local_127 [263];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
V_snprintf(local_334,0x104,"%s%s",param_1,"addonlist.txt");
pKVar3 = (KeyValues *)ReadKeyValuesFile(local_334);
*param_2 = pKVar3;
uVar4 = 0;
if (pKVar3 == (KeyValues *)0x0) {
LAB_0015df95:
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return uVar4;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
pKVar3 = (KeyValues *)KeyValues::GetFirstValue(pKVar3);
joined_r0x0015decf:
if (pKVar3 != (KeyValues *)0x0) {
do {
iVar5 = KeyValues::GetInt(pKVar3,(char *)0x0,0);
if (iVar5 != 0) {
pcVar6 = (char *)KeyValues::GetName(pKVar3);
V_strncpy(local_230,pcVar6,0x104);
V_FixSlashes(local_230,'/');
iVar5 = V_strnicmp(local_230,"workshop\\",9);
if (iVar5 == 0) {
cVar2 = (**(code **)(*(int *)workshop + 0x2c))(workshop);
if (cVar2 == '\0') {
if (DAT_003b8088 == '\0') goto code_r0x0015df74;
}
else {
piVar7 = (int *)(**(code **)(*(int *)workshop + 0x14))(workshop);
pcVar1 = *(code **)(*piVar7 + 0x40);
CFmtStrN<256>::CFmtStrN(local_12c,"%s%c%s","addons",0x2f,local_230);
iVar5 = (*pcVar1)(piVar7,local_127);
if (iVar5 != 4) {
KeyValues::Clear(pKVar3);
goto LAB_0015df7c;
}
}
}
}
pKVar3 = (KeyValues *)KeyValues::GetNextValue(pKVar3);
if (pKVar3 == (KeyValues *)0x0) break;
} while( true );
}
uVar4 = 1;
goto LAB_0015df95;
code_r0x0015df74:
KeyValues::Clear(pKVar3);
LAB_0015df7c:
pKVar3 = (KeyValues *)KeyValues::GetNextValue(pKVar3);
goto joined_r0x0015decf;
}
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.