NET_LogBadPacket
0x001c3bd0 · 361 bytes · __cdecl
_Z16NET_LogBadPacketP11netpacket_s
Decompiled
undefined (1 param)
/* NET_LogBadPacket(netpacket_s*) */
void NET_LogBadPacket(netpacket_s *param_1)
{
bool bVar1;
int iVar2;
undefined4 uVar3;
int iVar4;
int in_GS_OFFSET;
char local_124 [260];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
iVar4 = 1;
do {
V_snprintf(local_124,0x104,"badpacket%03i.dat",iVar4 + -1);
iVar2 = (**(code **)(*(int *)(g_pFileSystem + 4) + 8))
(g_pFileSystem + 4,local_124,&DAT_002a3e98,0);
if (iVar2 == 0) {
iVar2 = (**(code **)(*(int *)(g_pFileSystem + 4) + 8))
(g_pFileSystem + 4,local_124,&DAT_002a5c80,0);
(**(code **)(*(int *)(g_pFileSystem + 4) + 4))
(g_pFileSystem + 4,*(undefined4 *)(param_1 + 0x18),*(undefined4 *)(param_1 + 0x40),
iVar2);
if (iVar2 != 0) {
(**(code **)(*(int *)(g_pFileSystem + 4) + 0xc))(g_pFileSystem + 4,iVar2);
}
if (iVar4 < 1000) {
uVar3 = netadr_s::ToString((netadr_s *)param_1,false);
Msg("Error buffer for %s written to %s\n",uVar3,local_124);
goto LAB_001c3cdd;
}
break;
}
(**(code **)(*(int *)(g_pFileSystem + 4) + 0xc))(g_pFileSystem + 4,iVar2);
bVar1 = iVar4 < 1000;
iVar4 = iVar4 + 1;
} while (bVar1);
Msg("Couldn\'t write error buffer, delete error###.dat files to make space\n");
LAB_001c3cdd:
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.