L L4D2node

CNetChan::BeginSocketProcessingFrame

0x001b4820 · 530 bytes · __thiscall

_ZN8CNetChan26BeginSocketProcessingFrameEv

Decompiled

undefined (1 param)

/* CNetChan::BeginSocketProcessingFrame() */

void __thiscall CNetChan::BeginSocketProcessingFrame(CNetChan *this)

{
  uint uVar1;
  uint uVar2;
  void *pvVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  SocketProcessingStats_t *pSVar7;
  int iVar8;
  int iVar9;
  SocketProcessingStats_t *local_20 [4];
  
  iVar9 = *(int *)(this + 0x427c);
  iVar8 = 0;
  if (-1 < *(int *)(net_chan_stats_lru._28_4_ + 0x30)) {
    iVar8 = *(int *)(net_chan_stats_lru._28_4_ + 0x30);
  }
  iVar5 = *(int *)(this + 17000);
  if (iVar8 < iVar5) {
    do {
      iVar5 = iVar5 + -1;
      pSVar7 = *(SocketProcessingStats_t **)(*(int *)(this + 0x425c) + iVar5 * 4);
      *(int *)(this + 17000) = iVar5;
      local_20[0] = pSVar7;
      if (iVar9 < 1) {
LAB_001b48a6:
        iVar6 = 0;
        if (iVar8 < 1) goto LAB_001b48b8;
LAB_001b49c4:
        CUtlVector<CNetChan::SocketProcessingStats_t*,CUtlMemory<CNetChan::SocketProcessingStats_t*,int>>
        ::InsertBefore((CUtlVector<CNetChan::SocketProcessingStats_t*,CUtlMemory<CNetChan::SocketProcessingStats_t*,int>>
                        *)(this + 0x4270),iVar6,local_20);
        iVar5 = *(int *)(this + 17000);
        iVar9 = *(int *)(this + 0x427c);
      }
      else {
        uVar2 = *(uint *)(pSVar7 + 0x18);
        iVar6 = **(int **)(this + 0x4270);
        uVar1 = *(uint *)(iVar6 + 0x18);
        if ((uVar1 < uVar2) ||
           ((uVar1 <= uVar2 && (*(uint *)(iVar6 + 0x14) < *(uint *)(pSVar7 + 0x14)))))
        goto LAB_001b48a6;
        iVar6 = 0;
        while (iVar6 = iVar6 + 1, iVar6 != iVar9) {
          iVar4 = (*(int **)(this + 0x4270))[iVar6];
          uVar1 = *(uint *)(iVar4 + 0x18);
          if ((uVar1 < uVar2) ||
             ((uVar1 == uVar2 && (*(uint *)(iVar4 + 0x14) < *(uint *)(pSVar7 + 0x14))))) break;
        }
        if (iVar6 < iVar8) goto LAB_001b49c4;
LAB_001b48b8:
        if (pSVar7 != (SocketProcessingStats_t *)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>>
                       *)(pSVar7 + 0x24));
          *(undefined4 *)(pSVar7 + 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>
                   *)(pSVar7 + 0x28));
          *(undefined4 *)(pSVar7 + 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>
                   *)(pSVar7 + 0x28));
          operator_delete(pSVar7);
          iVar5 = *(int *)(this + 17000);
          iVar9 = *(int *)(this + 0x427c);
        }
      }
    } while (iVar8 < iVar5);
  }
  do {
    iVar5 = iVar9 * 4;
    do {
      iVar5 = iVar5 + -4;
      if (iVar9 <= iVar8) {
        pSVar7 = operator_new(0x48);
                    /* try { // try from 001b4952 to 001b4956 has its CatchHandler @ 001b4a36 */
        SocketProcessingStats_t::SocketProcessingStats_t(pSVar7);
        local_20[0] = pSVar7;
        CUtlVector<CNetChan::SocketProcessingStats_t*,CUtlMemory<CNetChan::SocketProcessingStats_t*,int>>
        ::InsertBefore((CUtlVector<CNetChan::SocketProcessingStats_t*,CUtlMemory<CNetChan::SocketProcessingStats_t*,int>>
                        *)(this + 0x425c),0,local_20);
        return;
      }
      iVar9 = iVar9 + -1;
      pvVar3 = *(void **)(*(int *)(this + 0x4270) + iVar5);
      *(int *)(this + 0x427c) = iVar9;
    } while (pvVar3 == (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)pvVar3 + 0x24));
    *(undefined4 *)((int)pvVar3 + 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)pvVar3 + 0x28));
    *(undefined4 *)((int)pvVar3 + 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)pvVar3 + 0x28));
    operator_delete(pvVar3);
    iVar9 = *(int *)(this + 0x427c);
  } while( true );
}

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)