NET_FindOrCreateSplitPacketEntry
0x001c61c0 · 429 bytes · __cdecl
_Z32NET_FindOrCreateSplitPacketEntryiP8netadr_s
Decompiled
undefined (2 params)
/* NET_FindOrCreateSplitPacketEntry(int, netadr_s*) */
netadr_s * NET_FindOrCreateSplitPacketEntry(int param_1,netadr_s *param_2)
{
CUtlVector<CSplitPacketEntry,CUtlMemory<CSplitPacketEntry,int>> *this;
int iVar1;
int iVar2;
char cVar3;
undefined4 *__s;
netadr_s *pnVar4;
void *__dest;
int iVar5;
int iVar6;
int in_GS_OFFSET;
undefined4 uStack_38140;
undefined4 uStack_3813c;
undefined4 uStack_38138;
undefined4 auStack_38134 [404];
undefined4 auStack_37ae4 [57013];
iVar1 = *(int *)(in_GS_OFFSET + 0x14);
this = (CUtlVector<CSplitPacketEntry,CUtlMemory<CSplitPacketEntry,int>> *)
(net_splitpackets + param_1 * 0x14);
iVar2 = *(int *)(this + 0xc);
if (0 < iVar2) {
iVar5 = 0;
do {
iVar6 = iVar5;
pnVar4 = (netadr_s *)(iVar6 * 0x38120 + *(int *)this);
cVar3 = netadr_s::CompareAdr(param_2,pnVar4,false);
if (cVar3 != '\0') goto LAB_001c6233;
iVar5 = iVar6 + 1;
} while (iVar5 != iVar2);
pnVar4 = (netadr_s *)0x0;
if (iVar6 != 0x7f && 0x7f < iVar5) goto LAB_001c6233;
}
netadr_s::SetIP((netadr_s *)&uStack_38140,0);
netadr_s::SetPort((netadr_s *)&uStack_38140,0);
netadr_s::SetType((netadr_s *)&uStack_38140,3);
__s = auStack_38134;
uStack_38140 = 0;
uStack_3813c = 0;
uStack_38138 = 0;
do {
*__s = 0xffffffff;
__s = __s + 1;
} while (__s != auStack_37ae4);
memset(__s,0,0x37ac0);
uStack_38140 = *(undefined4 *)param_2;
uStack_3813c = *(undefined4 *)(param_2 + 4);
uStack_38138 = CONCAT22(uStack_38138._2_2_,*(undefined2 *)(param_2 + 8));
iVar2 = *(int *)(this + 0xc);
CUtlVector<CSplitPacketEntry,CUtlMemory<CSplitPacketEntry,int>>::GrowVector(this,1);
CUtlVector<CSplitPacketEntry,CUtlMemory<CSplitPacketEntry,int>>::ShiftElementsRight(this,iVar2,1);
iVar5 = *(int *)this;
__dest = (void *)(iVar2 * 0x38120 + iVar5);
if (__dest != (void *)0x0) {
memcpy(__dest,(netadr_s *)&uStack_38140,0x38120);
iVar5 = *(int *)this;
}
pnVar4 = (netadr_s *)(iVar5 + (*(int *)(this + 0xc) + -1) * 0x38120);
LAB_001c6233:
if (iVar1 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
return pnVar4;
}
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.