NET_GetPublicAdr
0x001c53a0 · 399 bytes · __cdecl
_Z16NET_GetPublicAdrR8netadr_s
Decompiled
undefined (1 param)
/* NET_GetPublicAdr(netadr_s&) */
undefined4 NET_GetPublicAdr(netadr_s *param_1)
{
ushort uVar1;
short sVar2;
int iVar3;
char *pcVar4;
undefined1 *puVar5;
int in_GS_OFFSET;
uint *puStackY_6c;
uint *local_60;
undefined4 local_50;
int local_38;
uint local_34 [5];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
local_60 = (uint *)0x1c53c3;
uVar1 = NET_GetUDPPort(1);
pcVar4 = "FCVAR_NEVER_AS_STRING";
if ((net_public_adr[0x15] & 0x10) == 0) {
pcVar4 = "";
if (*(char **)(net_public_adr._28_4_ + 0x24) != (char *)0x0) {
pcVar4 = *(char **)(net_public_adr._28_4_ + 0x24);
}
}
if (*pcVar4 == '\0') {
puVar5 = &stack0xffffffa4;
if (net_dedicated != '\0') {
local_60 = (uint *)0x1c541d;
iVar3 = Steam3Server();
puVar5 = &stack0xffffffa4;
if (*(int *)(iVar3 + 4) != 0) {
local_60 = (uint *)0x1c5429;
iVar3 = Steam3Server();
local_60 = (uint *)0x1c543e;
(**(code **)(**(int **)(iVar3 + 4) + 0x84))();
puVar5 = (undefined1 *)&stack0xffffffa0;
if (local_38 == 0) {
/* try { // try from 001c5448 to 001c5461 has its CatchHandler @ 001c5541 */
iVar3 = Steam3Server();
local_60 = local_34;
(**(code **)(**(int **)(iVar3 + 4) + 0x84))();
puVar5 = &stack0xffffff9c;
if (local_34[0] != 0) {
local_60 = (uint *)0x3;
netadr_s::SetType();
iVar3 = Steam3Server();
local_60 = *(uint **)(iVar3 + 4);
(**(code **)(*local_60 + 0x84))();
netadr_s::SetIP(param_1,local_34[0]);
netadr_s::SetPort(param_1,uVar1);
local_50 = 1;
puVar5 = &stack0xffffff98;
goto LAB_001c53fa;
}
}
}
}
local_50 = 0;
}
else {
local_60 = (uint *)0x1c54d0;
netadr_s::SetType();
pcVar4 = "FCVAR_NEVER_AS_STRING";
if ((net_public_adr[0x15] & 0x10) == 0) {
pcVar4 = "";
if (*(char **)(net_public_adr._28_4_ + 0x24) != (char *)0x0) {
pcVar4 = *(char **)(net_public_adr._28_4_ + 0x24);
}
}
local_60 = (uint *)0x1c54f2;
netadr_s::SetFromString(param_1,pcVar4,false);
local_60 = (uint *)0x1c54fa;
sVar2 = netadr_s::GetPort(param_1);
local_50 = 1;
puVar5 = &stack0xffffffa4;
if (sVar2 == 0) {
local_50 = 1;
local_60 = (uint *)0x1c5519;
netadr_s::SetPort(param_1,uVar1);
puVar5 = &stack0xffffffa4;
}
}
LAB_001c53fa:
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
*(undefined1 **)(puVar5 + -4) = &LAB_001c5541;
__stack_chk_fail();
}
return local_50;
}
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.