L L4D2node

CNetConsoleMgr::CNetConsoleMgr

0x001a2390 · 499 bytes · __thiscall

_ZN14CNetConsoleMgrC2Ev

Decompiled

undefined (1 param)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CNetConsoleMgr::CNetConsoleMgr() */

void __thiscall CNetConsoleMgr::CNetConsoleMgr(CNetConsoleMgr *this)

{
  netadr_s *this_00;
  int *piVar1;
  int iVar2;
  char *pcVar3;
  undefined4 uVar4;
  longdouble lVar5;
  undefined4 local_20 [4];
  
  *(undefined ***)this = &PTR_ShouldAcceptSocket_002abcd8;
  this_00 = (netadr_s *)(this + 300);
  CSocketCreator::CSocketCreator((CSocketCreator *)(this + 4),(ISocketCreatorListener *)this);
                    /* try { // try from 001a23c5 to 001a257e has its CatchHandler @ 001a2584 */
  netadr_s::SetIP(this_00,0);
  netadr_s::SetPort(this_00,0);
  netadr_s::SetType(this_00,3);
  *(undefined4 *)(this + 0x140) = 0;
  this[0x944] = (CNetConsoleMgr)0x0;
  *(undefined4 *)(this + 0x13c) = 0xffffffff;
  this[0x945] = (CNetConsoleMgr)0x0;
  this[0x138] = (CNetConsoleMgr)0x0;
  this[0x139] = (CNetConsoleMgr)0x0;
  piVar1 = (int *)CommandLine_Tier0();
  iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,"-netconpassword");
  if (iVar2 != 0) {
    piVar1 = (int *)CommandLine_Tier0();
    pcVar3 = (char *)(**(code **)(*piVar1 + 0x2c))(piVar1,iVar2 + 1);
    V_strncpy((char *)(this + 0x2c),pcVar3,0x100);
    this[0x139] = (CNetConsoleMgr)0x1;
  }
  piVar1 = (int *)CommandLine_Tier0();
  iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,"-netconport");
  if (iVar2 != 0) {
    piVar1 = (int *)CommandLine_Tier0();
    pcVar3 = (char *)(**(code **)(*piVar1 + 0x2c))(piVar1,iVar2 + 1);
    *(undefined4 *)(this + 300) = net_local_adr;
    *(undefined4 *)(this + 0x130) = _DAT_003ac14c;
    *(undefined2 *)(this + 0x134) = (undefined2)DAT_003ac150;
    lVar5 = (longdouble)EvaluateExpression(pcVar3,-1.0);
    iVar2 = (int)lVar5;
    if (0 < iVar2) {
      uVar4 = netadr_s::ToString(this_00,true);
      Msg("Network console: IP %s port %d\n",uVar4,iVar2);
      netadr_s::SetPort(this_00,(ushort)iVar2);
      this[0x138] = (CNetConsoleMgr)0x1;
      CSocketCreator::CreateListenSocket((CSocketCreator *)(this + 4),this_00,true);
    }
  }
  if (0 < g_nForkID) {
    local_20[0] = 1;
    ioctl(g_nSocketToParentProcess,0x5421,local_20);
    iVar2 = g_nSocketToParentProcess;
    this[0x944] = (CNetConsoleMgr)0x1;
    this[0x945] = (CNetConsoleMgr)0x1;
    *(int *)(this + 0x13c) = iVar2;
  }
  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)