L L4D2node

CVProfRecorder::Playback_ReadTimings_R

0x00236360 · 1323 bytes · __thiscall

_ZN14CVProfRecorder22Playback_ReadTimings_REP10CVProfNode

Decompiled

undefined (2 params)

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

undefined4 __thiscall
CVProfRecorder::Playback_ReadTimings_R(CVProfRecorder *this,CVProfNode *param_1)

{
  CVProfNode *pCVar1;
  longlong lVar2;
  char cVar3;
  int iVar4;
  uint uVar5;
  int iVar6;
  undefined8 uVar7;
  byte local_2e;
  byte local_2d;
  ushort local_2c;
  ushort local_2a;
  uint local_28;
  undefined1 local_24;
  undefined1 local_23;
  undefined1 local_22;
  undefined1 local_21;
  undefined1 local_20;
  undefined1 local_1f;
  undefined1 local_1e;
  undefined1 local_1d;
  
  if (((byte)this[0x1a0c] & 1) == 0) {
    iVar4 = (*(code *)**(undefined4 **)(g_pFileSystem + 4))
                      (g_pFileSystem + 4,&local_2e,1,*(undefined4 *)(this + 0x19e4));
  }
  else {
    iVar4 = (*(code *)**(undefined4 **)(g_pFileSystem + 4))(g_pFileSystem + 4,&local_24);
    local_20 = local_24;
    _V_memcpy(&local_2e,&local_20,1);
  }
  if (iVar4 == 1) {
    uVar5 = (uint)local_2e;
    if (local_2e == 0xff) {
      if (((byte)this[0x1a0c] & 1) == 0) {
        iVar4 = (*(code *)**(undefined4 **)(g_pFileSystem + 4))(g_pFileSystem + 4,&local_28);
      }
      else {
        iVar4 = (*(code *)**(undefined4 **)(g_pFileSystem + 4))
                          (g_pFileSystem + 4,&local_24,2,*(undefined4 *)(this + 0x19e4));
        local_20 = local_23;
        local_1f = local_24;
        _V_memcpy(&local_28,&local_20,2);
      }
      if (iVar4 != 2) {
        return 0;
      }
      uVar5 = local_28 & 0xffff;
      *(uint *)(param_1 + 0x38) = uVar5;
    }
    else {
      *(uint *)(param_1 + 0x38) = uVar5;
    }
    *(uint *)(param_1 + 0x44) = uVar5;
    if (((byte)this[0x1a0c] & 1) == 0) {
      iVar4 = (*(code *)**(undefined4 **)(g_pFileSystem + 4))(g_pFileSystem + 4,&local_2c);
    }
    else {
      iVar4 = (*(code *)**(undefined4 **)(g_pFileSystem + 4))
                        (g_pFileSystem + 4,&local_24,2,*(undefined4 *)(this + 0x19e4));
      local_20 = local_23;
      local_1f = local_24;
      _V_memcpy(&local_2c,&local_20,2);
    }
    if (iVar4 == 2) {
      uVar5 = (uint)local_2c;
      if (local_2c == 0xffff) {
        if (((byte)this[0x1a0c] & 1) == 0) {
          iVar4 = (*(code *)**(undefined4 **)(g_pFileSystem + 4))
                            (g_pFileSystem + 4,&local_28,4,*(undefined4 *)(this + 0x19e4));
        }
        else {
          iVar4 = (*(code *)**(undefined4 **)(g_pFileSystem + 4))(g_pFileSystem + 4,&local_24);
          local_20 = local_21;
          local_1f = local_22;
          local_1e = local_23;
          local_1d = local_24;
          _V_memcpy(&local_28,&local_20,4);
        }
        uVar5 = local_28;
        if (iVar4 != 4) {
          return 0;
        }
      }
      lVar2 = (ulonglong)(uVar5 * 4) * (ulonglong)_g_ClockSpeed;
      uVar7 = __udivdi3((int)lVar2,(int)((ulonglong)lVar2 >> 0x20) + _vswprintf * uVar5 * 4,1000000,
                        0);
      *(undefined8 *)(param_1 + 0x3c) = uVar7;
      *(undefined4 *)(param_1 + 0x48) = *(undefined4 *)(param_1 + 0x3c);
      *(undefined4 *)(param_1 + 0x4c) = *(undefined4 *)(param_1 + 0x40);
      iVar4 = *(int *)(param_1 + 0x68);
      while( true ) {
        if (iVar4 == 0) {
          return 1;
        }
        if (((byte)this[0x1a0c] & 1) == 0) {
          iVar6 = (*(code *)**(undefined4 **)(g_pFileSystem + 4))
                            (g_pFileSystem + 4,&local_2d,1,*(undefined4 *)(this + 0x19e4));
        }
        else {
          iVar6 = (*(code *)**(undefined4 **)(g_pFileSystem + 4))(g_pFileSystem + 4,&local_24);
          local_20 = local_24;
          _V_memcpy(&local_2d,&local_20,1);
        }
        if (iVar6 != 1) break;
        uVar5 = (uint)local_2d;
        if (local_2d == 0xff) {
          if (((byte)this[0x1a0c] & 1) == 0) {
            iVar6 = (*(code *)**(undefined4 **)(g_pFileSystem + 4))(g_pFileSystem + 4,&local_28);
          }
          else {
            iVar6 = (*(code *)**(undefined4 **)(g_pFileSystem + 4))
                              (g_pFileSystem + 4,&local_24,2,*(undefined4 *)(this + 0x19e4));
            local_20 = local_23;
            local_1f = local_24;
            _V_memcpy(&local_28,&local_20,2);
          }
          if (iVar6 != 2) {
            return 0;
          }
          uVar5 = local_28 & 0xffff;
          *(uint *)(iVar4 + 0x38) = uVar5;
        }
        else {
          *(uint *)(iVar4 + 0x38) = uVar5;
        }
        *(uint *)(iVar4 + 0x44) = uVar5;
        if (((byte)this[0x1a0c] & 1) == 0) {
          iVar6 = (*(code *)**(undefined4 **)(g_pFileSystem + 4))
                            (g_pFileSystem + 4,&local_2a,2,*(undefined4 *)(this + 0x19e4));
        }
        else {
          iVar6 = (*(code *)**(undefined4 **)(g_pFileSystem + 4))(g_pFileSystem + 4,&local_24);
          local_20 = local_23;
          local_1f = local_24;
          _V_memcpy(&local_2a,&local_20,2);
        }
        if (iVar6 != 2) {
          return 0;
        }
        uVar5 = (uint)local_2a;
        if (local_2a == 0xffff) {
          if (((byte)this[0x1a0c] & 1) == 0) {
            iVar6 = (*(code *)**(undefined4 **)(g_pFileSystem + 4))
                              (g_pFileSystem + 4,&local_28,4,*(undefined4 *)(this + 0x19e4));
          }
          else {
            iVar6 = (*(code *)**(undefined4 **)(g_pFileSystem + 4))(g_pFileSystem + 4,&local_24);
            local_20 = local_21;
            local_1f = local_22;
            local_1e = local_23;
            local_1d = local_24;
            _V_memcpy(&local_28,&local_20,4);
          }
          uVar5 = local_28;
          if (iVar6 != 4) {
            return 0;
          }
        }
        lVar2 = (ulonglong)(uVar5 * 4) * (ulonglong)_g_ClockSpeed;
        uVar7 = __udivdi3((int)lVar2,(int)((ulonglong)lVar2 >> 0x20) + _vswprintf * uVar5 * 4,
                          1000000,0);
        pCVar1 = *(CVProfNode **)(iVar4 + 0x68);
        *(undefined8 *)(iVar4 + 0x3c) = uVar7;
        *(undefined4 *)(iVar4 + 0x48) = *(undefined4 *)(iVar4 + 0x3c);
        *(undefined4 *)(iVar4 + 0x4c) = *(undefined4 *)(iVar4 + 0x40);
        for (; pCVar1 != (CVProfNode *)0x0; pCVar1 = *(CVProfNode **)(pCVar1 + 0x6c)) {
          cVar3 = Playback_ReadTimings_R(this,pCVar1);
          if (cVar3 == '\0') {
            return 0;
          }
        }
        iVar4 = *(int *)(iVar4 + 0x6c);
      }
    }
  }
  return 0;
}

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)