CheckCheatCodes
0x001147b0 · 249 bytes · unknown
_Z15CheckCheatCodesv
Decompiled
undefined (0 params)
/* WARNING: Unknown calling convention -- yet parameter storage is locked */
/* CheckCheatCodes() */
void CheckCheatCodes(void)
{
int iVar1;
int iVar2;
undefined4 uVar3;
undefined4 uVar4;
int iVar5;
int iVar6;
int iVar7;
if (DAT_00355d0c < 1) {
return;
}
iVar7 = 0;
iVar5 = s_CheatCodeCommands;
do {
if ((*(char *)(iVar5 + 0x20) == '\0') || (*(int *)(developer._28_4_ + 0x30) != 0)) {
iVar1 = *(int *)(iVar5 + 0x24);
iVar6 = s_nKeyLogIndex - iVar1;
if (-1 < iVar6) {
if (iVar1 < 1) {
if (iVar1 == 0) {
LAB_00114837:
DevMsg("Cheat code \"%s\" activated!",iVar5);
uVar3 = va("sv_cheats 1\n%s\n",iVar5 + 0x50);
uVar4 = Cbuf_GetCurrentPlayer();
Cbuf_AddText(uVar4,uVar3,0);
s_nKeyLogIndex = 0;
return;
}
}
else if (*(int *)(iVar5 + 0x28) == (&s_pKeyLog)[iVar6]) {
iVar2 = 0;
do {
iVar2 = iVar2 + 1;
if (iVar2 == iVar1) goto LAB_00114837;
} while (*(int *)(iVar5 + 0x28 + iVar2 * 4) == (&s_pKeyLog)[iVar2 + iVar6]);
}
}
}
iVar7 = iVar7 + 1;
iVar5 = iVar5 + 0xd0;
if (iVar7 == DAT_00355d0c) {
return;
}
} while( true );
}
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.