NET_StringToAdr
0x001c2620 · 205 bytes · __cdecl
_Z15NET_StringToAdrPKcP8netadr_s
Decompiled
undefined (2 params)
/* NET_StringToAdr(char const*, netadr_s*) */
undefined4 NET_StringToAdr(char *param_1,netadr_s *param_2)
{
int iVar1;
undefined4 uVar2;
int in_GS_OFFSET;
sockaddr local_b0;
char local_a0 [128];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
V_strncpy(local_a0,param_1,0x80);
iVar1 = V_strncmp(local_a0,"localhost",10);
if ((iVar1 == 0) || (iVar1 = V_strncmp(local_a0,"localhost:",10), iVar1 == 0)) {
_V_memcpy(local_a0,&DAT_002bbd6b,9);
}
uVar2 = NET_StringToSockaddr(local_a0,&local_b0);
if ((char)uVar2 != '\0') {
netadr_s::SetFromSockadr(param_2,&local_b0);
}
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
return uVar2;
}
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.