L L4D2node

netadr_s::SetFromSocket

0x000484e0 · 165 bytes · __thiscall

_ZN8netadr_s13SetFromSocketEi

Decompiled

undefined (2 params)

/* netadr_s::SetFromSocket(int) */

void __thiscall netadr_s::SetFromSocket(netadr_s *this,int param_1)

{
  int iVar1;
  int in_GS_OFFSET;
  socklen_t local_24;
  sockaddr local_20;
  int local_10;
  
  local_24 = 0x10;
  local_10 = *(int *)(in_GS_OFFSET + 0x14);
  this[7] = (netadr_s)0x0;
  this[6] = (netadr_s)0x0;
  this[5] = (netadr_s)0x0;
  this[4] = (netadr_s)0x0;
  *(undefined2 *)(this + 8) = 0;
  *(undefined4 *)this = 3;
  iVar1 = getsockname(param_1,&local_20,&local_24);
  if (iVar1 == 0) {
    if (local_20.sa_family == 2) {
      *(undefined4 *)this = 3;
      *(undefined4 *)(this + 4) = local_20.sa_data._2_4_;
      *(undefined2 *)(this + 8) = local_20.sa_data._0_2_;
    }
    else {
      this[7] = (netadr_s)0x0;
      this[6] = (netadr_s)0x0;
      this[5] = (netadr_s)0x0;
      this[4] = (netadr_s)0x0;
      *(undefined2 *)(this + 8) = 0;
      *(undefined4 *)this = 0;
    }
  }
  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)