kickid
0x0017c5c0 · 1051 bytes · __cdecl
_ZL6kickidRK8CCommand
Decompiled
undefined (1 param)
/* kickid(CCommand const&) */
void kickid(CCommand *param_1)
{
code *pcVar1;
bool bVar2;
char cVar3;
char *pcVar4;
int iVar5;
int *piVar6;
undefined4 uVar7;
char *pcVar8;
undefined1 *puVar9;
undefined1 *puVar10;
int iVar11;
int *piVar12;
int iVar13;
int in_GS_OFFSET;
CCommand *local_b8;
int local_b4;
int local_b0;
char local_a0 [128];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (*(int *)param_1 < 2) {
ConMsg("Usage: kickid < userid | uniqueid > { message }\n");
goto LAB_0017c8f1;
}
pcVar4 = *(char **)(param_1 + 0x40c);
if ((byte)(*pcVar4 - 0x30U) < 10) {
local_b0 = V_atoi(pcVar4);
LAB_0017c616:
bVar2 = false;
local_b4 = 1;
if (*(int *)param_1 < 2) goto LAB_0017c870;
LAB_0017c624:
iVar11 = 1;
local_b8 = param_1 + *(int *)(param_1 + 4) + 8;
if (*(int *)(param_1 + 4) == 0) {
local_b8 = (CCommand *)&DAT_002c79d4;
}
iVar13 = 0;
do {
pcVar4 = "";
if (iVar11 < *(int *)param_1) {
pcVar4 = *(char **)(param_1 + iVar11 * 4 + 0x408);
}
iVar11 = iVar11 + 1;
iVar5 = _V_strlen(pcVar4);
iVar13 = iVar5 + 1 + iVar13;
} while (iVar11 <= local_b4);
if (bVar2) {
iVar13 = iVar13 + -5;
}
iVar11 = _V_strlen((char *)local_b8);
if (iVar11 < iVar13) goto LAB_0017c870;
local_b8 = local_b8 + iVar13;
}
else {
iVar11 = V_strnicmp(pcVar4,"STEAM_",6);
if (iVar11 != 0) {
LAB_0017c880:
V_snprintf(local_a0,0x80,"%s",pcVar4);
local_b0 = -1;
goto LAB_0017c616;
}
pcVar8 = "";
if (2 < *(int *)param_1) {
pcVar8 = *(char **)(param_1 + 0x410);
}
iVar11 = _V_strstr(pcVar8,":");
if (iVar11 == 0) goto LAB_0017c880;
if (*(int *)param_1 < 6) {
puVar9 = &DAT_002c79d4;
if (3 < *(int *)param_1) goto LAB_0017c984;
puVar10 = &DAT_002c79d4;
}
else {
puVar9 = *(undefined1 **)(param_1 + 0x41c);
LAB_0017c984:
puVar10 = *(undefined1 **)(param_1 + 0x414);
}
V_snprintf(local_a0,0x80,"%s:%s:%s",pcVar4,puVar10,puVar9);
bVar2 = true;
local_b4 = 5;
local_b0 = -1;
if (5 < *(int *)param_1) goto LAB_0017c624;
LAB_0017c870:
local_b8 = (CCommand *)0x0;
}
if (0 < DAT_003b8080) {
iVar11 = 0;
do {
iVar13 = *(int *)(DAT_003b8074 + iVar11 * 4);
piVar12 = (int *)(iVar13 + 4);
if (iVar13 == 0) {
piVar12 = (int *)0x0;
}
cVar3 = (**(code **)(*piVar12 + 0x80))(piVar12);
if (cVar3 != '\0') {
if (local_b0 == -1) {
pcVar4 = (char *)(**(code **)(*piVar12 + 0x58))();
iVar13 = _V_stricmp(pcVar4,local_a0);
if (iVar13 == 0) {
if (DAT_003b8080 <= iVar11) goto LAB_0017c969;
cVar3 = (**(code **)(*piVar12 + 0xa0))(piVar12);
joined_r0x0017c925:
if ((cVar3 != '\0') && (iVar11 = (**(code **)(*piVar12 + 0xac))(piVar12), iVar11 != 0))
{
piVar12 = (int *)(**(code **)(*piVar12 + 0xac))(piVar12);
}
if (cmd_source == 1) {
pcVar4 = "Console";
}
else {
piVar6 = (int *)0x0;
if (host_client != 0) {
piVar6 = (int *)(host_client + 4);
}
pcVar4 = (char *)(host_client + 0x3c);
if ((piVar6 == piVar12) && (DAT_003b8088 == '\0')) goto LAB_0017c8f1;
}
if ((local_b0 != -1) || (cVar3 = (**(code **)(*piVar12 + 0x8c))(piVar12), cVar3 == '\0')
) {
if (local_b8 == (CCommand *)0x0) {
pcVar1 = *(code **)(*piVar12 + 0x38);
uVar7 = va("Kicked by %s",pcVar4);
(*pcVar1)(piVar12,uVar7);
}
else {
pcVar1 = *(code **)(*piVar12 + 0x38);
uVar7 = va("Kicked by %s : %s",pcVar4,local_b8);
(*pcVar1)(piVar12,uVar7);
}
}
goto LAB_0017c8f1;
}
}
else {
iVar13 = (**(code **)(*piVar12 + 0x40))(piVar12);
if (local_b0 == iVar13) {
if (iVar11 < DAT_003b8080) {
cVar3 = (**(code **)(*piVar12 + 0xa0))(piVar12);
goto joined_r0x0017c925;
}
goto LAB_0017c8db;
}
}
}
iVar11 = iVar11 + 1;
} while (iVar11 < DAT_003b8080);
}
if (local_b0 == -1) {
LAB_0017c969:
ConMsg("uniqueid \"%s\" not found\n",local_a0);
}
else {
LAB_0017c8db:
ConMsg("userid \"%d\" not found\n",local_b0);
}
LAB_0017c8f1:
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.