netadr_s::ToString
0x00047f50 · 318 bytes · __thiscall
_ZNK8netadr_s8ToStringEb
Decompiled
undefined (2 params)
/* netadr_s::ToString(bool) const */
char * __thiscall netadr_s::ToString(netadr_s *this,bool param_1)
{
char *pcVar1;
int iVar2;
pcVar1 = ToString(bool)::s + (ToString(bool)::slot % 4) * 0x40;
ToString(bool)::slot = ToString(bool)::slot + 1;
V_strncpy(pcVar1,"unknown",0x40);
iVar2 = *(int *)this;
if (iVar2 == 1) {
V_strncpy(pcVar1,"loopback",0x40);
}
else if (iVar2 == 2) {
V_strncpy(pcVar1,"broadcast",0x40);
}
else if (iVar2 == 3) {
if (!param_1) {
V_snprintf(pcVar1,0x40,"%i.%i.%i.%i:%i",(uint)(byte)this[4],(uint)(byte)this[5],
(uint)(byte)this[6],(uint)(byte)this[7],
(uint)(ushort)(*(ushort *)(this + 8) >> 8 | *(ushort *)(this + 8) << 8));
return pcVar1;
}
V_snprintf(pcVar1,0x40,"%i.%i.%i.%i",(uint)(byte)this[4],(uint)(byte)this[5],(uint)(byte)this[6]
,(uint)(byte)this[7]);
}
return pcVar1;
}
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.