L L4D2node

CNetChan::~CNetChan

0x001b5e90 · 726 bytes · __thiscall

_ZN8CNetChanD1Ev

Decompiled

undefined (1 param)

/* CNetChan::~CNetChan() */

void __thiscall CNetChan::~CNetChan(CNetChan *this)

{
  CUtlMemory<CNetChan::SocketProcessingStats_t*,int> *this_00;
  CUtlMemory<CNetChan::SocketProcessingStats_t*,int> *this_01;
  void *pvVar1;
  CUtlMemory<CNetChan::dataFragments_s*,int> *this_02;
  int iVar3;
  bool bVar4;
  CNetChan *in_stack_ffffffd4;
  char *in_stack_ffffffd8;
  CUtlMemory<CNetChan::dataFragments_s*,int> *pCVar2;
  
  bVar4 = this == g_pNetChannelProcessingActivePacket;
  *(undefined ***)this = &PTR_GetName_002bb9c8;
  if (bVar4) {
    NetChannelProcessingCallbacksRunOnProcessingFinished(this,true);
  }
  iVar3 = *(int *)(this + 0x8c);
  if (0 < iVar3) {
    in_stack_ffffffd8 = "destroying netchan";
    in_stack_ffffffd4 = this;
    DumpSocketProcessingStats(this,"destroying netchan");
    iVar3 = *(int *)(this + 0x8c);
  }
  if (-1 < iVar3) {
    Shutdown(in_stack_ffffffd4,in_stack_ffffffd8);
  }
  iVar3 = 0;
  if (0 < *(int *)(this + 17000)) {
    do {
      pvVar1 = *(void **)(*(int *)(this + 0x425c) + iVar3 * 4);
      if (pvVar1 != (void *)0x0) {
        CUtlRBTree<CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::Node_t,int,CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::Node_t,int>,int>>
        ::RemoveAll((CUtlRBTree<CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::Node_t,int,CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::Node_t,int>,int>>
                     *)((int)pvVar1 + 0x24));
        *(undefined4 *)((int)pvVar1 + 0x3c) = 0xffffffff;
        CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::Node_t,int>,int>
        ::Purge((CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::Node_t,int>,int>
                 *)((int)pvVar1 + 0x28));
        *(undefined4 *)((int)pvVar1 + 0x40) = 0xffffffff;
        CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::Node_t,int>,int>
        ::Purge((CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::Node_t,int>,int>
                 *)((int)pvVar1 + 0x28));
        operator_delete(pvVar1);
      }
      iVar3 = iVar3 + 1;
    } while (iVar3 < *(int *)(this + 17000));
  }
  this_00 = (CUtlMemory<CNetChan::SocketProcessingStats_t*,int> *)(this + 0x425c);
  iVar3 = 0;
  *(undefined4 *)(this + 17000) = 0;
  CUtlMemory<CNetChan::SocketProcessingStats_t*,int>::Purge(this_00);
  *(undefined4 *)(this + 0x426c) = *(undefined4 *)(this + 0x425c);
  if (0 < *(int *)(this + 0x427c)) {
    do {
      pvVar1 = *(void **)(*(int *)(this + 0x4270) + iVar3 * 4);
      if (pvVar1 != (void *)0x0) {
        CUtlRBTree<CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::Node_t,int,CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::Node_t,int>,int>>
        ::RemoveAll((CUtlRBTree<CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::Node_t,int,CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::Node_t,int>,int>>
                     *)((int)pvVar1 + 0x24));
        *(undefined4 *)((int)pvVar1 + 0x3c) = 0xffffffff;
        CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::Node_t,int>,int>
        ::Purge((CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::Node_t,int>,int>
                 *)((int)pvVar1 + 0x28));
        *(undefined4 *)((int)pvVar1 + 0x40) = 0xffffffff;
        CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::Node_t,int>,int>
        ::Purge((CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::Node_t,int>,int>
                 *)((int)pvVar1 + 0x28));
        operator_delete(pvVar1);
      }
      iVar3 = iVar3 + 1;
    } while (iVar3 < *(int *)(this + 0x427c));
  }
  *(undefined4 *)(this + 0x427c) = 0;
  this_01 = (CUtlMemory<CNetChan::SocketProcessingStats_t*,int> *)(this + 0x4270);
  CUtlMemory<CNetChan::SocketProcessingStats_t*,int>::Purge(this_01);
  *(undefined4 *)(this + 0x4280) = *(undefined4 *)(this + 0x4270);
  CUtlRBTree<CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::Node_t,int,CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::Node_t,int>,int>>
  ::RemoveAll((CUtlRBTree<CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::Node_t,int,CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::Node_t,int>,int>>
               *)(this + 0x42a8));
  *(undefined4 *)(this + 0x42c0) = 0xffffffff;
  CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::Node_t,int>,int>
  ::Purge((CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::Node_t,int>,int>
           *)(this + 0x42ac));
  *(undefined4 *)(this + 0x42c4) = 0xffffffff;
  CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::Node_t,int>,int>
  ::Purge((CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,CNetChan::MessageProcessingStats_t,int>::Node_t,int>,int>
           *)(this + 0x42ac));
  *(undefined4 *)(this + 0x427c) = 0;
  CUtlMemory<CNetChan::SocketProcessingStats_t*,int>::Purge(this_01);
  *(undefined4 *)(this + 0x4280) = *(undefined4 *)(this + 0x4270);
  CUtlMemory<CNetChan::SocketProcessingStats_t*,int>::Purge(this_01);
  *(undefined4 *)(this + 17000) = 0;
  CUtlMemory<CNetChan::SocketProcessingStats_t*,int>::Purge(this_00);
  *(undefined4 *)(this + 0x426c) = *(undefined4 *)(this + 0x425c);
  CUtlMemory<CNetChan::SocketProcessingStats_t*,int>::Purge(this_00);
  CUtlRBTree<CNetChan::SplitPlayer_t,unsigned_short,bool(*)(CNetChan::SplitPlayer_t_const&,CNetChan::SplitPlayer_t_const&),CUtlMemory<UtlRBTreeNode_t<CNetChan::SplitPlayer_t,unsigned_short>,unsigned_short>>
  ::RemoveAll((CUtlRBTree<CNetChan::SplitPlayer_t,unsigned_short,bool(*)(CNetChan::SplitPlayer_t_const&,CNetChan::SplitPlayer_t_const&),CUtlMemory<UtlRBTreeNode_t<CNetChan::SplitPlayer_t,unsigned_short>,unsigned_short>>
               *)(this + 0x4240));
  *(undefined2 *)(this + 0x4254) = 0xffff;
  CUtlMemory<UtlRBTreeNode_t<CNetChan::SplitPlayer_t,unsigned_short>,unsigned_short>::Purge
            ((CUtlMemory<UtlRBTreeNode_t<CNetChan::SplitPlayer_t,unsigned_short>,unsigned_short> *)
             (this + 0x4244));
  *(undefined2 *)(this + 0x4256) = 0xffff;
  CUtlMemory<UtlRBTreeNode_t<CNetChan::SplitPlayer_t,unsigned_short>,unsigned_short>::Purge
            ((CUtlMemory<UtlRBTreeNode_t<CNetChan::SplitPlayer_t,unsigned_short>,unsigned_short> *)
             (this + 0x4244));
  *(undefined4 *)(this + 0x4218) = 0;
  CUtlMemory<INetMessage*,int>::Purge((CUtlMemory<INetMessage*,int> *)(this + 0x420c));
  *(undefined4 *)(this + 0x421c) = *(undefined4 *)(this + 0x420c);
  CUtlMemory<INetMessage*,int>::Purge((CUtlMemory<INetMessage*,int> *)(this + 0x420c));
  CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)(this + 0x540));
  pCVar2 = (CUtlMemory<CNetChan::dataFragments_s*,int> *)(this + 0xe4);
  do {
    this_02 = pCVar2 + -0x14;
    *(undefined4 *)(pCVar2 + -8) = 0;
    CUtlMemory<CNetChan::dataFragments_s*,int>::Purge(this_02);
    *(undefined4 *)(pCVar2 + -4) = *(undefined4 *)this_02;
    CUtlMemory<CNetChan::dataFragments_s*,int>::Purge(this_02);
    pCVar2 = this_02;
  } while ((CUtlMemory<CNetChan::dataFragments_s*,int> *)(this + 0xbc) != this_02);
  CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)(this + 0x80));
  CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)(this + 0x5c));
  CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)(this + 0x38));
  *(undefined ***)this = &PTR___cxa_pure_virtual_002bb868;
  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)