kick
0x0017c3d0 · 462 bytes · __cdecl
_ZL4kickRK8CCommand
Decompiled
undefined (1 param)
/* kick(CCommand const&) */
void kick(CCommand *param_1)
{
code *pcVar1;
char cVar2;
CCommand *pCVar3;
char *pcVar4;
int iVar5;
int *piVar6;
undefined4 uVar7;
int iVar8;
int *piVar9;
int in_GS_OFFSET;
char *local_70;
char cStack_61;
undefined4 local_60;
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (*(int *)param_1 < 2) {
ConMsg("Usage: kick < name >\n");
}
else {
local_70 = (char *)&local_60;
pcVar4 = local_70;
for (iVar8 = 0x10; iVar8 != 0; iVar8 = iVar8 + -1) {
pcVar4[0] = '\0';
pcVar4[1] = '\0';
pcVar4[2] = '\0';
pcVar4[3] = '\0';
pcVar4 = pcVar4 + 4;
}
pCVar3 = (CCommand *)&DAT_002c79d4;
if (*(int *)(param_1 + 4) != 0) {
pCVar3 = param_1 + *(int *)(param_1 + 4) + 8;
}
V_strncpy(local_70,(char *)pCVar3,0x40);
if ((char)local_60 != '\0') {
iVar8 = _V_strlen(local_70);
if (((char)local_60 == '\"') && ((&cStack_61)[iVar8] == '\"')) {
(&cStack_61)[iVar8] = '\0';
local_70 = (char *)((int)&local_60 + 1);
}
if (0 < DAT_003b8080) {
iVar8 = 0;
do {
iVar5 = *(int *)(DAT_003b8074 + iVar8 * 4);
piVar9 = (int *)(iVar5 + 4);
if (iVar5 == 0) {
piVar9 = (int *)0x0;
}
cVar2 = (**(code **)(*piVar9 + 0x80))(piVar9);
if (cVar2 != '\0') {
pcVar4 = (char *)(**(code **)(*piVar9 + 0x48))(piVar9);
iVar5 = V_strcasecmp(pcVar4,local_70);
if (iVar5 == 0) {
if (iVar8 < DAT_003b8080) {
cVar2 = (**(code **)(*piVar9 + 0xa0))(piVar9);
if ((cVar2 != '\0') && (iVar8 = (**(code **)(*piVar9 + 0xac))(piVar9), iVar8 != 0))
{
piVar9 = (int *)(**(code **)(*piVar9 + 0xac))(piVar9);
}
pcVar4 = "Console";
if (cmd_source != 1) {
pcVar4 = (char *)(host_client + 0x3c);
}
piVar6 = (int *)0x0;
if (host_client != 0) {
piVar6 = (int *)(host_client + 4);
}
if ((piVar6 != piVar9) || (DAT_003b8088 != '\0')) {
pcVar1 = *(code **)(*piVar9 + 0x38);
uVar7 = va("Kicked by %s",pcVar4);
(*pcVar1)(piVar9,uVar7);
}
goto LAB_0017c429;
}
break;
}
}
iVar8 = iVar8 + 1;
} while (iVar8 < DAT_003b8080);
}
ConMsg("Can\'t kick \"%s\", name not found\n",local_70);
}
}
LAB_0017c429:
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.