key_findbinding
0x00183a40 · 400 bytes · __cdecl
_ZL15key_findbindingRK8CCommand
Decompiled
undefined (1 param)
/* key_findbinding(CCommand const&) */
void key_findbinding(CCommand *param_1)
{
char *pcVar1;
char *pcVar2;
int iVar3;
undefined4 uVar4;
uint uVar5;
uint uVar6;
int local_24;
uint local_20;
if (*(int *)param_1 == 2) {
pcVar1 = *(char **)(param_1 + 0x40c);
if ((pcVar1 != (char *)0x0) && (*pcVar1 != '\0')) {
local_20 = 0xfffffefe;
uVar6 = 0xffffff0e;
uVar5 = 0xffffff8e;
do {
pcVar2 = *(char **)(uVar5 * 8 + 0x3a3eb0);
if ((pcVar2 != (char *)0x0) && (*pcVar2 != '\0')) {
iVar3 = _V_strstr(pcVar2,pcVar1);
if (iVar3 != 0) {
if (uVar5 < 0x230) {
if (uVar5 < 0x80) {
local_24 = (int)uVar5 >> 5;
}
else if (uVar6 < 0x10) {
local_24 = (int)uVar6 >> 2;
}
else if (local_20 < 0x30) {
local_24 = ((int)local_20 / 6 + ((int)local_20 >> 0x1f) >> 1) -
((int)local_20 >> 0x1f);
}
else {
local_24 = (int)(uVar5 - 0x1b0) >> 4;
if (uVar5 - 0xc0 < 0xf0) {
local_24 = (int)(uVar5 - 0xc0) / 0x1e;
}
}
uVar4 = (**(code **)(*g_pInputSystem + 0x6c))(g_pInputSystem,uVar5 + 0x72);
ConMsg("[%d] \"%s\" = \"%s\"\n",local_24,uVar4,pcVar2);
}
else {
uVar4 = (**(code **)(*g_pInputSystem + 0x6c))(g_pInputSystem,uVar5 + 0x72);
ConMsg("\"%s\" = \"%s\"\n",uVar4,pcVar2);
}
}
}
local_20 = local_20 + 1;
uVar5 = uVar5 + 1;
uVar6 = uVar6 + 1;
} while (uVar5 != 0x230);
return;
}
}
ConMsg("usage: key_findbinding substring\n");
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.