FindMissionsForDlcMask
0x00035d20 · 720 bytes · __cdecl
_Z22FindMissionsForDlcMaskyP9KeyValuesR10CUtlVectorIS0_10CUtlMemoryIS0_iEE
Decompiled
undefined (3 params)
/* FindMissionsForDlcMask(unsigned long long, KeyValues*, CUtlVector<KeyValues*,
CUtlMemory<KeyValues*, int> >&) */
void FindMissionsForDlcMask(ulonglong param_1,KeyValues *param_2,CUtlVector *param_3)
{
undefined4 *puVar1;
code *pcVar2;
int iVar3;
char *pcVar4;
char *pcVar5;
KeyValues *pKVar6;
undefined4 uVar7;
KeyValues *this;
int iVar8;
int iVar9;
int iVar10;
int iVar11;
int in_GS_OFFSET;
ulonglong uVar12;
CFmtStrN<256> local_12c [5];
char local_127 [263];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
pcVar4 = (char *)KeyValues::GetString(param_2,"Game/mode","");
pcVar5 = (char *)StringAfterPrefix(pcVar4,"team");
if (pcVar5 == (char *)0x0) {
pcVar5 = pcVar4;
}
pKVar6 = (KeyValues *)(**(code **)(*(int *)g_pMatchExtL4D + 0x10))(g_pMatchExtL4D,pcVar5);
pcVar2 = *(code **)(*(int *)g_pMatchExtL4D + 0x10);
uVar7 = KeyValues::GetString(pKVar6,"base",pcVar5);
this = (KeyValues *)(*pcVar2)(g_pMatchExtL4D,uVar7);
iVar8 = KeyValues::GetInt(this,"singlechapter",0);
iVar8 = KeyValues::GetInt(pKVar6,"singlechapter",(uint)(iVar8 != 0));
iVar9 = KeyValues::GetInt(pKVar6,"addon",0);
CFmtStrN<256>::CFmtStrN(local_12c,"modes/%s/chapters",pcVar5);
pKVar6 = (KeyValues *)(*(code *)**(undefined4 **)g_pMatchExtL4D)(g_pMatchExtL4D);
for (pKVar6 = (KeyValues *)KeyValues::GetFirstTrueSubKey(pKVar6); pKVar6 != (KeyValues *)0x0;
pKVar6 = (KeyValues *)KeyValues::GetNextTrueSubKey(pKVar6)) {
if ((iVar9 != 0) || (iVar10 = KeyValues::GetInt(pKVar6,"builtin",0), iVar10 != 0)) {
pcVar5 = (char *)KeyValues::GetString(pKVar6,"name","");
iVar10 = _V_stricmp("credits",pcVar5);
if ((iVar10 != 0) &&
(((iVar10 = KeyValues::GetInt(pKVar6,local_127,0), iVar10 != 0 &&
(iVar11 = KeyValues::GetInt(pKVar6,"dlcrequired",0), iVar11 == 0)) &&
(uVar12 = KeyValues::GetUint64((char *)pKVar6,0xb0b8f), (param_1 & uVar12) == uVar12)))) {
if (iVar8 == 0) {
iVar10 = 1;
}
if (uVar12 != 0) {
iVar10 = iVar10 * 2;
}
if (0 < iVar10) {
iVar11 = 0;
do {
iVar3 = *(int *)(param_3 + 0xc);
CUtlVector<KeyValues*,CUtlMemory<KeyValues*,int>>::GrowVector
((CUtlVector<KeyValues*,CUtlMemory<KeyValues*,int>> *)param_3,1);
CUtlVector<KeyValues*,CUtlMemory<KeyValues*,int>>::ShiftElementsRight
((CUtlVector<KeyValues*,CUtlMemory<KeyValues*,int>> *)param_3,iVar3,1);
puVar1 = (undefined4 *)(*(int *)param_3 + iVar3 * 4);
if (puVar1 != (undefined4 *)0x0) {
*puVar1 = pKVar6;
}
iVar11 = iVar11 + 1;
} while (iVar11 != iVar10);
}
}
}
}
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* 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.