L L4D2node

CNetChan::_ProcessMessages(bf_read&)::CPerMessageStatsRecorder_t::RecordStats

0x001b6190 · 707 bytes · __thiscall

_ZZN8CNetChan16_ProcessMessagesER7bf_readEN26CPerMessageStatsRecorder_t11RecordStatsEv

Decompiled

undefined (1 param)

/* RecordStats() */

void __thiscall
CNetChan::_ProcessMessages(bf_read&)::CPerMessageStatsRecorder_t::RecordStats
          (CPerMessageStatsRecorder_t *this)

{
  int *piVar1;
  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>>
  *pCVar2;
  uint *puVar3;
  uint uVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  int iVar7;
  uint uVar8;
  int iVar9;
  undefined4 *in_EAX;
  int iVar10;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  if (*(char *)(in_EAX + 7) == '\0') {
    *(undefined1 *)(in_EAX + 7) = 1;
    if ((g_pNetChannelProcessingActivePacket != 0) &&
       (g_pNetChannelProcessingActivePacket == in_EAX[6])) {
      iVar10 = Plat_MSTime();
      iVar7 = g_pNetChannelProcessingActivePacket;
      uVar4 = in_EAX[2];
      in_EAX[2] = iVar10 * 1000 - in_EAX[2];
      in_EAX[3] = -(uint)((uint)(iVar10 * 1000) < uVar4) - in_EAX[3];
      piVar1 = (int *)(**(int **)(iVar7 + 0x425c) + 0x1c);
      *piVar1 = *piVar1 + 1;
      *(int *)(iVar7 + 0x42a0) = *(int *)(iVar7 + 0x42a0) + 1;
      uVar5 = in_EAX[1];
      uVar6 = *in_EAX;
      iVar7 = **(int **)(iVar7 + 0x425c);
      _V_memset(&local_2c,0,0x10);
      pCVar2 = (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>>
                *)(iVar7 + 0x24);
      local_34 = uVar6;
      local_30 = uVar5;
      iVar10 = 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>>
               ::Find(pCVar2,(Node_t *)&local_34);
      if (iVar10 == -1) {
        _V_memset(&local_2c,0,0x10);
        local_34 = uVar6;
        local_30 = uVar5;
        iVar10 = 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>>
                 ::Find(pCVar2,(Node_t *)&local_34);
        if (iVar10 == -1) {
          _V_memset(&local_2c,0,0x10);
          local_2c = in_EAX[2];
          local_28 = in_EAX[3];
          local_24 = in_EAX[4];
          local_20 = in_EAX[5];
          local_34 = uVar6;
          local_30 = uVar5;
          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>>
          ::Insert(pCVar2,(Node_t *)&local_34);
        }
        else {
          iVar7 = *(int *)(iVar7 + 0x28) + iVar10 * 0x28;
          *(undefined4 *)(iVar7 + 0x18) = in_EAX[2];
          *(undefined4 *)(iVar7 + 0x1c) = in_EAX[3];
          *(undefined4 *)(iVar7 + 0x20) = in_EAX[4];
          *(undefined4 *)(iVar7 + 0x24) = in_EAX[5];
        }
      }
      else {
        uVar8 = in_EAX[2];
        iVar7 = *(int *)(iVar7 + 0x28) + iVar10 * 0x28;
        iVar10 = in_EAX[3];
        puVar3 = (uint *)(iVar7 + 0x18);
        uVar4 = *puVar3;
        *puVar3 = *puVar3 + uVar8;
        *(int *)(iVar7 + 0x1c) = *(int *)(iVar7 + 0x1c) + iVar10 + (uint)CARRY4(uVar4,uVar8);
        *(int *)(iVar7 + 0x20) = *(int *)(iVar7 + 0x20) + in_EAX[4];
        *(int *)(iVar7 + 0x24) = *(int *)(iVar7 + 0x24) + in_EAX[5];
      }
      iVar7 = g_pNetChannelProcessingActivePacket;
      uVar5 = in_EAX[1];
      uVar6 = *in_EAX;
      _V_memset(&local_2c,0,0x10);
      pCVar2 = (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>>
                *)(iVar7 + 0x42a8);
      local_34 = uVar6;
      local_30 = uVar5;
      iVar10 = 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>>
               ::Find(pCVar2,(Node_t *)&local_34);
      if (iVar10 == -1) {
        _V_memset(&local_2c,0,0x10);
        local_34 = uVar6;
        local_30 = uVar5;
        iVar10 = 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>>
                 ::Find(pCVar2,(Node_t *)&local_34);
        if (iVar10 == -1) {
          _V_memset(&local_2c,0,0x10);
          local_2c = in_EAX[2];
          local_28 = in_EAX[3];
          local_24 = in_EAX[4];
          local_20 = in_EAX[5];
          local_34 = uVar6;
          local_30 = uVar5;
          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>>
          ::Insert(pCVar2,(Node_t *)&local_34);
        }
        else {
          iVar7 = *(int *)(iVar7 + 0x42ac) + iVar10 * 0x28;
          *(undefined4 *)(iVar7 + 0x18) = in_EAX[2];
          *(undefined4 *)(iVar7 + 0x1c) = in_EAX[3];
          *(undefined4 *)(iVar7 + 0x20) = in_EAX[4];
          *(undefined4 *)(iVar7 + 0x24) = in_EAX[5];
        }
      }
      else {
        iVar9 = in_EAX[3];
        iVar7 = *(int *)(iVar7 + 0x42ac) + iVar10 * 0x28;
        uVar8 = in_EAX[2];
        puVar3 = (uint *)(iVar7 + 0x18);
        uVar4 = *puVar3;
        *puVar3 = *puVar3 + uVar8;
        *(int *)(iVar7 + 0x1c) = *(int *)(iVar7 + 0x1c) + iVar9 + (uint)CARRY4(uVar4,uVar8);
        *(int *)(iVar7 + 0x20) = *(int *)(iVar7 + 0x20) + in_EAX[4];
        *(int *)(iVar7 + 0x24) = *(int *)(iVar7 + 0x24) + in_EAX[5];
      }
    }
  }
  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)