logaddress_del
0x001f9d40 · 398 bytes · __cdecl
_ZL14logaddress_delRK8CCommand
Decompiled
undefined (1 param)
/* logaddress_del(CCommand const&) */
void logaddress_del(CCommand *param_1)
{
char cVar1;
int iVar2;
undefined4 uVar3;
char *pcVar4;
char *pcVar5;
int in_GS_OFFSET;
undefined4 local_4c;
undefined4 local_48;
undefined4 local_44;
char local_40 [32];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
netadr_s::SetIP((netadr_s *)&local_4c,0);
netadr_s::SetPort((netadr_s *)&local_4c,0);
netadr_s::SetType((netadr_s *)&local_4c,3);
if (*(int *)param_1 == 4) {
pcVar5 = *(char **)(param_1 + 0x40c);
pcVar4 = *(char **)(param_1 + 0x414);
}
else {
if (*(int *)param_1 != 2) {
ConMsg("Usage: logaddress_del ip:port\n");
goto LAB_001f9da2;
}
pcVar5 = *(char **)(param_1 + 0x40c);
iVar2 = _V_strstr(pcVar5,":");
pcVar4 = "27015";
if (iVar2 != 0) {
pcVar4 = (char *)(iVar2 + 1);
}
}
iVar2 = V_atoi(pcVar4);
if (iVar2 == 0) {
ConMsg("logaddress_del: must specify a valid port\n");
}
else if ((pcVar5 == (char *)0x0) || (*pcVar5 == '\0')) {
ConMsg("logaddress_del: unparseable address\n");
}
else {
V_snprintf(local_40,0x20,"%s:%s",pcVar5,pcVar4);
cVar1 = NET_StringToAdr(local_40,(netadr_s *)&local_4c);
if (cVar1 == '\0') {
ConMsg("logaddress_del: unable to resolve %s\n",local_40);
}
else {
cVar1 = CLog::DelLogAddress(g_Log,local_4c,local_48,local_44);
if (cVar1 == '\0') {
uVar3 = netadr_s::ToString((netadr_s *)&local_4c,false);
ConMsg("logaddress_del: address %s not found in the list\n",uVar3);
}
else {
uVar3 = netadr_s::ToString((netadr_s *)&local_4c,false);
ConMsg("logaddress_del: %s\n",uVar3);
}
}
}
LAB_001f9da2:
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.