CGameClient::ExecuteStringCommand
0x001e9be0 · 697 bytes · __thiscall
_ZN11CGameClient20ExecuteStringCommandEPKc.part.59
Decompiled
undefined (2 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CGameClient::ExecuteStringCommand(char const*) [clone .part.59] */
uint __thiscall CGameClient::ExecuteStringCommand(CGameClient *this,char *param_1)
{
char cVar1;
byte bVar2;
CGameClient *in_EAX;
uint uVar3;
int iVar4;
uint uVar5;
ConCommandBase *pCVar6;
int iVar7;
undefined1 *puVar8;
char *in_EDX;
int in_GS_OFFSET;
int local_528 [258];
undefined1 *local_120;
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
CCommand::CCommand((CCommand *)local_528);
uVar3 = CCommand::Tokenize((CCommand *)local_528,in_EDX,(characterset_t *)0x0);
if (((char)uVar3 != '\0') && (local_528[0] != 0)) {
iVar7 = *(int *)(sv_quota_stringcmdspersecond._28_4_ + 0x30);
if ((double)realtime - *(double *)(in_EAX + 0x21ae8) < 1.0) {
iVar4 = *(int *)(in_EAX + 0x21af0) + 1;
}
else {
*(double *)(in_EAX + 0x21ae8) = (double)realtime;
iVar4 = 1;
}
*(int *)(in_EAX + 0x21af0) = iVar4;
if (iVar4 <= iVar7) {
uVar5 = IsEngineClientCommand(in_EAX,(CCommand *)local_528);
if ((char)uVar5 != '\0') {
Cmd_ExecuteCommand(4,(CCommand *)local_528,0,*(undefined4 *)(in_EAX + 0x30));
goto LAB_001e9d32;
}
puVar8 = &DAT_002c79d4;
if (0 < local_528[0]) {
puVar8 = local_120;
}
pCVar6 = (ConCommandBase *)(**(code **)(*g_pCVar + 0x28))(g_pCVar,puVar8);
if (pCVar6 != (ConCommandBase *)0x0) {
cVar1 = (**(code **)(*(int *)pCVar6 + 8))(pCVar6);
if (cVar1 != '\0') {
bVar2 = (**(code **)(*(int *)pCVar6 + 0xc))(pCVar6,4);
if (bVar2 != 0) {
cVar1 = (**(code **)(*(int *)pCVar6 + 0xc))(pCVar6,0x4000);
if ((cVar1 != '\0') && (1 < DAT_003b8064)) {
cVar1 = ConVar::IsFlagSet((ConVar *)sv_hosting_lobby,2);
if (cVar1 == '\0') {
puVar8 = sv_cheats;
LAB_001e9e2b:
if (*(int *)(*(int *)(puVar8 + 0x1c) + 0x30) != 0) goto LAB_001e9e42;
}
else {
if (g_pMatchFramework == (int *)0x0) {
LAB_001e9e96:
puVar8 = sv_cheats;
}
else {
iVar7 = (**(code **)(*g_pMatchFramework + 0x24))(g_pMatchFramework);
if (iVar7 == 0) goto LAB_001e9e96;
puVar8 = (undefined1 *)0x0;
}
if (((DAT_003b80d0 == 0 && _DAT_003b80cc == 0) &&
(*(int *)(sv_hosting_lobby._28_4_ + 0x30) == 0)) &&
(puVar8 != (undefined1 *)0x0)) goto LAB_001e9e2b;
}
cVar1 = Cmd_IsRptActive();
if (cVar1 == '\0') goto LAB_001e9d30;
}
LAB_001e9e42:
cVar1 = (**(code **)(*(int *)pCVar6 + 0xc))(pCVar6,0x40);
if ((cVar1 == '\0') || (DAT_003b8064 < 2)) {
(**(code **)(*(int *)g_pServerPluginHandler + 0x28))
(g_pServerPluginHandler,*(undefined4 *)(in_EAX + 0x30));
Cmd_Dispatch(pCVar6,(CCommand *)local_528);
uVar5 = (uint)bVar2;
goto LAB_001e9d32;
}
goto LAB_001e9d30;
}
}
}
(**(code **)(*(int *)g_pServerPluginHandler + 0x34))
(g_pServerPluginHandler,*(undefined4 *)(in_EAX + 0x1d750),(CCommand *)local_528);
uVar5 = uVar3;
goto LAB_001e9d32;
}
(**(code **)(*(int *)in_EAX + 0x3c))();
}
LAB_001e9d30:
uVar5 = 0;
LAB_001e9d32:
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return uVar5;
}
/* 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.