L L4D2node

netadr_s::ToSockadr

0x000481a0 · 151 bytes · __thiscall

_ZNK8netadr_s9ToSockadrEP8sockaddr

Decompiled

undefined (2 params)

/* netadr_s::ToSockadr(sockaddr*) const */

void __thiscall netadr_s::ToSockadr(netadr_s *this,sockaddr *param_1)

{
  undefined2 uVar1;
  int iVar2;
  
  _V_memset(param_1,0,0x10);
  iVar2 = *(int *)this;
  if (iVar2 == 2) {
    param_1->sa_family = 2;
    uVar1 = *(undefined2 *)(this + 8);
    param_1->sa_data[2] = -1;
    param_1->sa_data[3] = -1;
    param_1->sa_data[4] = -1;
    param_1->sa_data[5] = -1;
    *(undefined2 *)param_1->sa_data = uVar1;
    return;
  }
  if (iVar2 != 3) {
    if (iVar2 != 1) {
      return;
    }
    param_1->sa_family = 2;
    uVar1 = *(undefined2 *)(this + 8);
    param_1->sa_data[2] = '\x01';
    param_1->sa_data[3] = '\0';
    param_1->sa_data[4] = '\0';
    param_1->sa_data[5] = '\x7f';
    *(undefined2 *)param_1->sa_data = uVar1;
    return;
  }
  param_1->sa_family = 2;
  *(undefined4 *)(param_1->sa_data + 2) = *(undefined4 *)(this + 4);
  *(undefined2 *)param_1->sa_data = *(undefined2 *)(this + 8);
  return;
}

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)