L L4D2node

VProfRecord_Snapshot

0x00232370 · 2229 bytes · unknown

_Z20VProfRecord_Snapshotv

Decompiled

undefined (0 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* WARNING: Unknown calling convention -- yet parameter storage is locked */
/* VProfRecord_Snapshot() */

void VProfRecord_Snapshot(void)

{
  char *__s;
  CVProfNode *pCVar1;
  undefined4 uVar2;
  int iVar3;
  size_t sVar4;
  int iVar5;
  int iVar6;
  undefined1 local_2f;
  undefined1 local_2e;
  undefined1 local_2d;
  undefined2 local_2c;
  undefined2 local_2a;
  undefined4 local_28;
  undefined1 local_24 [4];
  undefined1 local_20;
  undefined1 local_1f;
  undefined1 local_1e;
  undefined1 local_1d;
  
  uVar2 = _DAT_0040b028;
  if (g_VProfRecorder._6624_4_ == 1) {
    _DAT_0040b028 = 0;
    _DAT_0040b0b8 = uVar2;
    if (DAT_0040b02c == '\0') {
      CVProfNode::Pause();
    }
    local_2e = 0;
    if ((g_VProfRecorder[0x1a0c] & 1) == 0) {
      (**(code **)(*(int *)(g_pFileSystem + 4) + 4))
                (g_pFileSystem + 4,&local_2e,1,g_VProfRecorder._6628_4_);
    }
    else {
      local_20 = 0;
      _V_memcpy(local_24,&local_20,1);
      (**(code **)(*(int *)(g_pFileSystem + 4) + 4))
                (g_pFileSystem + 4,local_24,1,g_VProfRecorder._6628_4_);
    }
    if ((g_VProfRecorder[0x1a0c] & 1) == 0) {
      (**(code **)(*(int *)(g_pFileSystem + 4) + 4))
                (g_pFileSystem + 4,&host_tickcount,4,g_VProfRecorder._6628_4_);
    }
    else {
      local_20 = host_tickcount._3_1_;
      local_1f = host_tickcount._2_1_;
      local_1e = host_tickcount._1_1_;
      local_1d = (undefined1)host_tickcount;
      _V_memcpy(local_24,&local_20,4);
      (**(code **)(*(int *)(g_pFileSystem + 4) + 4))
                (g_pFileSystem + 4,local_24,4,g_VProfRecorder._6628_4_);
    }
    iVar3 = CVProfile::GetNumBudgetGroups();
    iVar6 = iVar3 * 8;
    for (; iVar5 = CVProfile::GetNumBudgetGroups(), iVar3 < iVar5; iVar3 = iVar3 + 1) {
      __s = *(char **)(_DAT_0040b0bc + iVar6);
      local_2d = 2;
      local_28 = ((undefined4 *)(_DAT_0040b0bc + iVar6))[1];
      if ((g_VProfRecorder[0x1a0c] & 1) == 0) {
        (**(code **)(*(int *)(g_pFileSystem + 4) + 4))
                  (g_pFileSystem + 4,&local_2d,1,g_VProfRecorder._6628_4_);
      }
      else {
        local_20 = 2;
        _V_memcpy(local_24,&local_20,1);
        (**(code **)(*(int *)(g_pFileSystem + 4) + 4))
                  (g_pFileSystem + 4,local_24,1,g_VProfRecorder._6628_4_);
      }
      iVar5 = g_pFileSystem;
      sVar4 = strlen(__s);
      (**(code **)(*(int *)(iVar5 + 4) + 4))(iVar5 + 4,__s,sVar4 + 1,g_VProfRecorder._6628_4_);
      if ((g_VProfRecorder[0x1a0c] & 1) == 0) {
        (**(code **)(*(int *)(g_pFileSystem + 4) + 4))
                  (g_pFileSystem + 4,&local_28,4,g_VProfRecorder._6628_4_);
      }
      else {
        local_20 = local_28._3_1_;
        local_1f = local_28._2_1_;
        local_1e = local_28._1_1_;
        local_1d = (undefined1)local_28;
        _V_memcpy(local_24,&local_20,4);
        (**(code **)(*(int *)(g_pFileSystem + 4) + 4))
                  (g_pFileSystem + 4,local_24,4,g_VProfRecorder._6628_4_);
      }
      iVar6 = iVar6 + 8;
      CVProfile::AddBudgetGroupName(g_VProfRecorder,(int)__s);
    }
    if (g_VProfRecorder._6632_4_ != CVProfNode::s_iCurrentUniqueNodeID) {
      CVProfRecorder::Record_MatchTree_R
                ((CVProfRecorder *)g_VProfRecorder,(CVProfNode *)(g_VProfRecorder + 0x1018),
                 (CVProfNode *)0x40b034,(CVProfile *)&g_VProfCurrentProfile);
    }
    local_2f = 3;
    if ((g_VProfRecorder[0x1a0c] & 1) == 0) {
      (**(code **)(*(int *)(g_pFileSystem + 4) + 4))
                (g_pFileSystem + 4,&local_2f,1,g_VProfRecorder._6628_4_);
    }
    else {
      local_20 = 3;
      _V_memcpy(local_24,&local_20,1);
      (**(code **)(*(int *)(g_pFileSystem + 4) + 4))
                (g_pFileSystem + 4,local_24,1,g_VProfRecorder._6628_4_);
    }
    local_2c = 0xffff;
    if (_DAT_0040b06c < 0x10000) {
      local_2c = (ushort)_DAT_0040b06c;
    }
    if (local_2c < 0xff) {
      local_28 = CONCAT31(local_28._1_3_,(char)local_2c);
      if ((g_VProfRecorder[0x1a0c] & 1) == 0) {
        (**(code **)(*(int *)(g_pFileSystem + 4) + 4))
                  (g_pFileSystem + 4,&local_28,1,g_VProfRecorder._6628_4_);
      }
      else {
        local_20 = (char)local_2c;
        _V_memcpy(local_24,&local_20,1);
        (**(code **)(*(int *)(g_pFileSystem + 4) + 4))
                  (g_pFileSystem + 4,local_24,1,g_VProfRecorder._6628_4_);
      }
    }
    else {
      local_28 = CONCAT31(local_28._1_3_,0xff);
      if ((g_VProfRecorder[0x1a0c] & 1) == 0) {
        (**(code **)(*(int *)(g_pFileSystem + 4) + 4))
                  (g_pFileSystem + 4,&local_28,1,g_VProfRecorder._6628_4_);
      }
      else {
        local_20 = 0xff;
        _V_memcpy(local_24,&local_20,1);
        (**(code **)(*(int *)(g_pFileSystem + 4) + 4))
                  (g_pFileSystem + 4,local_24,1,g_VProfRecorder._6628_4_);
      }
      if ((g_VProfRecorder[0x1a0c] & 1) == 0) {
        (**(code **)(*(int *)(g_pFileSystem + 4) + 4))
                  (g_pFileSystem + 4,&local_2c,2,g_VProfRecorder._6628_4_);
      }
      else {
        local_20 = local_2c._1_1_;
        local_1f = (undefined1)local_2c;
        _V_memcpy(local_24,&local_20,2);
        (**(code **)(*(int *)(g_pFileSystem + 4) + 4))
                  (g_pFileSystem + 4,local_24,2,g_VProfRecorder._6628_4_);
      }
    }
    local_28 = __udivdi3((int)((ulonglong)_DAT_0040b070 * 1000000),
                         (int)((ulonglong)_DAT_0040b070 * 1000000 >> 0x20) + _DAT_0040b074 * 1000000
                         ,_g_ClockSpeed,_vswprintf);
    local_28 = local_28 >> 2;
    if (local_28 < 0xffff) {
      local_2a = (short)local_28;
      if ((g_VProfRecorder[0x1a0c] & 1) == 0) {
        (**(code **)(*(int *)(g_pFileSystem + 4) + 4))
                  (g_pFileSystem + 4,&local_2a,2,g_VProfRecorder._6628_4_);
        pCVar1 = _DAT_0040b09c;
      }
      else {
        local_2a._1_1_ = (undefined1)(local_28 >> 8);
        local_20 = local_2a._1_1_;
        local_2a._0_1_ = (undefined1)local_28;
        local_1f = (undefined1)local_2a;
        _V_memcpy(local_24,&local_20,2);
        (**(code **)(*(int *)(g_pFileSystem + 4) + 4))
                  (g_pFileSystem + 4,local_24,2,g_VProfRecorder._6628_4_);
        pCVar1 = _DAT_0040b09c;
      }
    }
    else {
      local_2a = 0xffff;
      if ((g_VProfRecorder[0x1a0c] & 1) == 0) {
        (**(code **)(*(int *)(g_pFileSystem + 4) + 4))
                  (g_pFileSystem + 4,&local_2a,2,g_VProfRecorder._6628_4_);
      }
      else {
        local_20 = 0xff;
        local_1f = 0xff;
        _V_memcpy(local_24,&local_20,2);
        (**(code **)(*(int *)(g_pFileSystem + 4) + 4))
                  (g_pFileSystem + 4,local_24,2,g_VProfRecorder._6628_4_);
      }
      if ((g_VProfRecorder[0x1a0c] & 1) == 0) {
        (**(code **)(*(int *)(g_pFileSystem + 4) + 4))
                  (g_pFileSystem + 4,&local_28,4,g_VProfRecorder._6628_4_);
        pCVar1 = _DAT_0040b09c;
      }
      else {
        local_20 = local_28._3_1_;
        local_1f = local_28._2_1_;
        local_1e = local_28._1_1_;
        local_1d = (undefined1)local_28;
        _V_memcpy(local_24,&local_20,4);
        (**(code **)(*(int *)(g_pFileSystem + 4) + 4))
                  (g_pFileSystem + 4,local_24,4,g_VProfRecorder._6628_4_);
        pCVar1 = _DAT_0040b09c;
      }
    }
    for (; pCVar1 != (CVProfNode *)0x0; pCVar1 = *(CVProfNode **)(pCVar1 + 0x6c)) {
      CVProfRecorder::Record_WriteTimings_R((CVProfRecorder *)g_VProfRecorder,pCVar1);
    }
    local_28._1_3_ = (undefined3)(local_28 >> 8);
    local_28 = CONCAT31(local_28._1_3_,4);
    if ((g_VProfRecorder[0x1a0c] & 1) == 0) {
      (**(code **)(*(int *)(g_pFileSystem + 4) + 4))
                (g_pFileSystem + 4,&local_28,1,g_VProfRecorder._6628_4_);
    }
    else {
      local_20 = 4;
      _V_memcpy(local_24,&local_20,1);
      (**(code **)(*(int *)(g_pFileSystem + 4) + 4))
                (g_pFileSystem + 4,local_24,1,g_VProfRecorder._6628_4_);
    }
    _DAT_0040b028 = _DAT_0040b0b8;
    if (DAT_0040b02c == '\0') {
      CVProfNode::Resume();
    }
  }
  else if ((g_VProfRecorder._6624_4_ == 2) && (g_VProfRecorder[0x1a08] == '\0')) {
    CVProfRecorder::Playback_ReadTick((CVProfRecorder *)g_VProfRecorder,-1,(bool *)0x0);
  }
  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)