L L4D2node

netadr_s::ToString

0x00255140 · 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,(char *)((int)&DAT_002cc88c + 2),(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 into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)