L L4D2node

CVProfRecorder::Playback_ReadAddNode

0x0023b740 · 2204 bytes · __thiscall

_ZN14CVProfRecorder20Playback_ReadAddNodeEv

Decompiled

undefined (1 param)

/* CVProfRecorder::Playback_ReadAddNode() */

undefined4 __thiscall CVProfRecorder::Playback_ReadAddNode(CVProfRecorder *this)

{
  CVProfRecorder CVar1;
  CVProfRecorder *pCVar2;
  CVProfRecorder *pCVar3;
  CVProfRecorder *pCVar4;
  CVProfRecorder *pCVar5;
  CVProfRecorder *pCVar6;
  CVProfRecorder *pCVar7;
  CVProfRecorder *pCVar8;
  CVProfNode *pCVar9;
  char cVar10;
  int iVar11;
  CVProfRecorder *pCVar12;
  undefined4 uVar13;
  int iVar14;
  int iVar15;
  int in_GS_OFFSET;
  Node_t *local_260;
  CVProfRecorder *local_248;
  int local_240;
  undefined4 local_238;
  int local_234;
  undefined4 local_230;
  undefined1 local_22c;
  undefined1 local_22b;
  undefined1 local_22a;
  undefined1 local_229;
  undefined4 local_228;
  undefined4 local_224;
  Node_t local_220 [512];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (((byte)this[0x1a0c] & 1) == 0) {
    (*(code *)**(undefined4 **)(g_pFileSystem + 4))
              (g_pFileSystem + 4,&local_234,4,*(undefined4 *)(this + 0x19e4));
  }
  else {
    (*(code *)**(undefined4 **)(g_pFileSystem + 4))(g_pFileSystem + 4,&local_22c);
    local_228._0_2_ = CONCAT11(local_22a,local_229);
    local_228._0_3_ = CONCAT12(local_22b,(undefined2)local_228);
    local_228 = (Node_t *)CONCAT13(local_22c,(undefined3)local_228);
    _V_memcpy(&local_234,&local_228,4);
  }
  local_260 = (Node_t *)&local_228;
  iVar15 = 0;
  while (iVar11 = (*(code *)**(undefined4 **)(g_pFileSystem + 4))
                            (g_pFileSystem + 4,local_260,1,*(undefined4 *)(this + 0x19e4)),
        iVar11 != 0) {
    if (local_228._0_1_ == (Node_t)0x0) {
      CVar1 = this[0x1a0c];
      local_220[iVar15] = (Node_t)0x0;
      if (((byte)CVar1 & 1) == 0) {
        (*(code *)**(undefined4 **)(g_pFileSystem + 4))
                  (g_pFileSystem + 4,&local_238,4,*(undefined4 *)(this + 0x19e4));
      }
      else {
        (*(code *)**(undefined4 **)(g_pFileSystem + 4))
                  (g_pFileSystem + 4,&local_22c,4,*(undefined4 *)(this + 0x19e4));
        local_228._0_2_ = CONCAT11(local_22a,local_229);
        local_228._0_3_ = CONCAT12(local_22b,(undefined2)local_228);
        local_228 = (Node_t *)CONCAT13(local_22c,(undefined3)local_228);
        _V_memcpy(&local_238,local_260,4);
      }
      if (((byte)this[0x1a0c] & 1) == 0) {
        (*(code *)**(undefined4 **)(g_pFileSystem + 4))
                  (g_pFileSystem + 4,&local_230,4,*(undefined4 *)(this + 0x19e4));
      }
      else {
        (*(code *)**(undefined4 **)(g_pFileSystem + 4))(g_pFileSystem + 4,&local_22c);
        local_228._0_2_ = CONCAT11(local_22a,local_229);
        local_228._0_3_ = CONCAT12(local_22b,(undefined2)local_228);
        local_228 = (Node_t *)CONCAT13(local_22c,(undefined3)local_228);
        _V_memcpy(&local_230,local_260,4);
      }
      pCVar12 = this + 0x1018;
      if (local_234 == *(int *)(this + 0x1090)) goto LAB_0023bb01;
      local_248 = *(CVProfRecorder **)(this + 0x1080);
      if (local_248 != (CVProfRecorder *)0x0) goto LAB_0023b9ad;
      goto LAB_0023bcef;
    }
    if (iVar15 < 0x1ff) {
      local_220[iVar15] = local_228._0_1_;
      iVar15 = iVar15 + 1;
    }
  }
  if ((*(int *)(this + 0x19e0) - 1U < 2) && (*(int *)(this + 0x19e4) != 0)) {
    if (*(int *)(this + 0x19e0) == 1) {
      *(int *)(this + 0x1a04) = *(int *)(this + 0x1a04) + 1;
    }
    (**(code **)(*(int *)(g_pFileSystem + 4) + 0xc))(g_pFileSystem + 4,*(int *)(this + 0x19e4));
  }
  *(undefined4 *)(this + 0x19e0) = 0;
  *(undefined4 *)(this + 0x19e4) = 0;
  *(undefined4 *)(this + 0x19ec) = 0xffffffff;
  this[0x19fc] = (CVProfRecorder)0x1;
  g_pVProfileForDisplay = &g_VProfCurrentProfile;
  CVProfile::Term();
  Warning("VPROF PLAYBACK ASSERT (%s, line %d) - stopping playback.\n",
          "/data/src/engine/./vprof_record.cpp",0x193);
  uVar13 = 0;
  goto LAB_0023bd52;
  while( true ) {
    pCVar2 = *(CVProfRecorder **)(local_248 + 0x68);
    if (pCVar2 != (CVProfRecorder *)0x0) {
      iVar15 = *(int *)(pCVar2 + 0x78);
      while( true ) {
        pCVar12 = pCVar2;
        if (local_234 == iVar15) goto LAB_0023bb01;
        pCVar3 = *(CVProfRecorder **)(pCVar2 + 0x68);
        if (pCVar3 != (CVProfRecorder *)0x0) {
          iVar15 = *(int *)(pCVar3 + 0x78);
          while( true ) {
            pCVar12 = pCVar3;
            if (local_234 == iVar15) goto LAB_0023bb01;
            pCVar4 = *(CVProfRecorder **)(pCVar3 + 0x68);
            if (pCVar4 != (CVProfRecorder *)0x0) {
              iVar15 = *(int *)(pCVar4 + 0x78);
              while( true ) {
                pCVar12 = pCVar4;
                if (local_234 == iVar15) goto LAB_0023bb01;
                pCVar5 = *(CVProfRecorder **)(pCVar4 + 0x68);
                if (pCVar5 != (CVProfRecorder *)0x0) {
                  iVar15 = *(int *)(pCVar5 + 0x78);
                  while( true ) {
                    pCVar12 = pCVar5;
                    if (local_234 == iVar15) goto LAB_0023bb01;
                    pCVar6 = *(CVProfRecorder **)(pCVar5 + 0x68);
                    if (pCVar6 != (CVProfRecorder *)0x0) {
                      iVar15 = *(int *)(pCVar6 + 0x78);
                      while( true ) {
                        pCVar12 = pCVar6;
                        if (local_234 == iVar15) goto LAB_0023bb01;
                        pCVar7 = *(CVProfRecorder **)(pCVar6 + 0x68);
                        if (pCVar7 != (CVProfRecorder *)0x0) {
                          iVar15 = *(int *)(pCVar7 + 0x78);
                          while( true ) {
                            pCVar12 = pCVar7;
                            if (local_234 == iVar15) goto LAB_0023bb01;
                            pCVar8 = *(CVProfRecorder **)(pCVar7 + 0x68);
                            if (pCVar8 != (CVProfRecorder *)0x0) {
                              iVar15 = *(int *)(pCVar8 + 0x78);
                              while( true ) {
                                pCVar12 = pCVar8;
                                if (local_234 == iVar15) goto LAB_0023bb01;
                                for (pCVar9 = *(CVProfNode **)(pCVar8 + 0x68);
                                    pCVar9 != (CVProfNode *)0x0;
                                    pCVar9 = *(CVProfNode **)(pCVar9 + 0x6c)) {
                                  pCVar12 = (CVProfRecorder *)
                                            FindVProfNodeByID_R(this,pCVar9,local_234);
                                  if (pCVar12 != (CVProfRecorder *)0x0) goto LAB_0023bb01;
                                }
                                pCVar8 = *(CVProfRecorder **)(pCVar8 + 0x6c);
                                if (pCVar8 == (CVProfRecorder *)0x0) break;
                                iVar15 = *(int *)(pCVar8 + 0x78);
                              }
                            }
                            pCVar7 = *(CVProfRecorder **)(pCVar7 + 0x6c);
                            if (pCVar7 == (CVProfRecorder *)0x0) break;
                            iVar15 = *(int *)(pCVar7 + 0x78);
                          }
                        }
                        pCVar6 = *(CVProfRecorder **)(pCVar6 + 0x6c);
                        if (pCVar6 == (CVProfRecorder *)0x0) break;
                        iVar15 = *(int *)(pCVar6 + 0x78);
                      }
                    }
                    pCVar5 = *(CVProfRecorder **)(pCVar5 + 0x6c);
                    if (pCVar5 == (CVProfRecorder *)0x0) break;
                    iVar15 = *(int *)(pCVar5 + 0x78);
                  }
                }
                pCVar4 = *(CVProfRecorder **)(pCVar4 + 0x6c);
                if (pCVar4 == (CVProfRecorder *)0x0) break;
                iVar15 = *(int *)(pCVar4 + 0x78);
              }
            }
            pCVar3 = *(CVProfRecorder **)(pCVar3 + 0x6c);
            if (pCVar3 == (CVProfRecorder *)0x0) break;
            iVar15 = *(int *)(pCVar3 + 0x78);
          }
        }
        pCVar2 = *(CVProfRecorder **)(pCVar2 + 0x6c);
        if (pCVar2 == (CVProfRecorder *)0x0) break;
        iVar15 = *(int *)(pCVar2 + 0x78);
      }
    }
    local_248 = *(CVProfRecorder **)(local_248 + 0x6c);
    if (local_248 == (CVProfRecorder *)0x0) break;
LAB_0023b9ad:
    pCVar12 = local_248;
    if (local_234 == *(int *)(local_248 + 0x78)) goto LAB_0023bb01;
  }
LAB_0023bcef:
  if ((*(int *)(this + 0x19e0) - 1U < 2) && (*(int *)(this + 0x19e4) != 0)) {
    if (*(int *)(this + 0x19e0) == 1) {
      *(int *)(this + 0x1a04) = *(int *)(this + 0x1a04) + 1;
    }
    (**(code **)(*(int *)(g_pFileSystem + 4) + 0xc))(g_pFileSystem + 4,*(int *)(this + 0x19e4));
  }
  *(undefined4 *)(this + 0x19e0) = 0;
  *(undefined4 *)(this + 0x19e4) = 0;
  *(undefined4 *)(this + 0x19ec) = 0xffffffff;
  this[0x19fc] = (CVProfRecorder)0x1;
  g_pVProfileForDisplay = &g_VProfCurrentProfile;
  CVProfile::Term();
  Warning("VPROF PLAYBACK ASSERT (%s, line %d) - stopping playback.\n",
          "/data/src/engine/./vprof_record.cpp",0x1d6);
  uVar13 = 0;
  goto LAB_0023bd52;
LAB_0023bb01:
  iVar15 = **(int **)(this + 0x10a0);
  local_228 = local_220;
  iVar11 = *(int *)(this + 0x19cc);
  if (iVar11 != -1) {
    iVar14 = *(int *)(this + 0x19c0);
    do {
      local_240 = iVar11 * 0x18;
      cVar10 = (**(code **)(this + 0x19bc))(local_260,iVar14 + 0x10 + local_240);
      if (cVar10 == '\0') {
        cVar10 = (**(code **)(this + 0x19bc))(*(int *)(this + 0x19c0) + local_240 + 0x10,local_260);
        if (cVar10 == '\0') goto LAB_0023bbc4;
        if ((CUtlRBTree<CUtlMap<char_const*,int,int>::Node_t,int,CUtlMap<char_const*,int,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,int>::Node_t,int>,int>>
             ::Links(int)::s_Sentinel == '\0') &&
           (iVar11 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<char_const*,int,int>::Node_t,int,CUtlMap<char_const*,int,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,int>::Node_t,int>,int>>
                                          ::Links(int)::s_Sentinel), iVar11 != 0)) {
          CUtlRBTree<CUtlMap<char_const*,int,int>::Node_t,int,CUtlMap<char_const*,int,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,int>::Node_t,int>,int>>
          ::Links(int)::s_Sentinel = 0xffffffff;
          DAT_0034075c = 0xffffffff;
          DAT_00340760 = 0xffffffff;
          __cxa_guard_release(&CUtlRBTree<CUtlMap<char_const*,int,int>::Node_t,int,CUtlMap<char_const*,int,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,int>::Node_t,int>,int>>
                               ::Links(int)::s_Sentinel);
        }
        iVar14 = *(int *)(this + 0x19c0);
        iVar11 = *(int *)(iVar14 + 4 + local_240);
      }
      else {
        if ((CUtlRBTree<CUtlMap<char_const*,int,int>::Node_t,int,CUtlMap<char_const*,int,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,int>::Node_t,int>,int>>
             ::Links(int)::s_Sentinel == '\0') &&
           (iVar14 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<char_const*,int,int>::Node_t,int,CUtlMap<char_const*,int,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,int>::Node_t,int>,int>>
                                          ::Links(int)::s_Sentinel), iVar14 != 0)) {
          CUtlRBTree<CUtlMap<char_const*,int,int>::Node_t,int,CUtlMap<char_const*,int,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,int>::Node_t,int>,int>>
          ::Links(int)::s_Sentinel = 0xffffffff;
          DAT_0034075c = 0xffffffff;
          DAT_00340760 = 0xffffffff;
          __cxa_guard_release(&CUtlRBTree<CUtlMap<char_const*,int,int>::Node_t,int,CUtlMap<char_const*,int,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,int>::Node_t,int>,int>>
                               ::Links(int)::s_Sentinel);
        }
        iVar14 = *(int *)(this + 0x19c0);
        iVar11 = *(int *)(iVar14 + iVar11 * 0x18);
      }
    } while (iVar11 != -1);
  }
  local_228 = (Node_t *)strdup((char *)local_220);
  local_224 = 0;
  local_240 = CUtlRBTree<CUtlMap<char_const*,int,int>::Node_t,int,CUtlMap<char_const*,int,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,int>::Node_t,int>,int>>
              ::Insert((CUtlRBTree<CUtlMap<char_const*,int,int>::Node_t,int,CUtlMap<char_const*,int,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,int>::Node_t,int>,int>>
                        *)(this + 0x19bc),local_260);
  local_240 = local_240 * 0x18;
LAB_0023bbc4:
  iVar15 = CVProfNode::GetSubNode
                     ((char *)pCVar12,*(int *)(*(int *)(this + 0x19c0) + 0x10 + local_240),
                      (char *)0x0,iVar15);
  *(undefined4 *)(iVar15 + 0x70) = local_238;
  *(undefined4 *)(iVar15 + 0x78) = local_230;
  uVar13 = 1;
  this[0x19fc] = (CVProfRecorder)0x1;
LAB_0023bd52:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return uVar13;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)