L L4D2node

VProfExport_SnapshotVProfHistory

0x00230af0 · 544 bytes · unknown

_Z32VProfExport_SnapshotVProfHistoryv

Decompiled

undefined (0 params)

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

void VProfExport_SnapshotVProfHistory(void)

{
  float *pfVar1;
  undefined *puVar2;
  uint uVar3;
  float fVar4;
  undefined4 uVar5;
  char cVar6;
  int iVar7;
  undefined *puVar8;
  int iVar9;
  double dVar10;
  
  uVar5 = g_VProfExport._16_4_;
  if (*(int *)(g_pVProfileForDisplay + 0x100c) == 0) {
    return;
  }
  iVar7 = CVProfile::GetNumBudgetGroups();
  if ((int)uVar5 < iVar7) {
    iVar7 = CVProfile::GetNumBudgetGroups();
    g_VProfExport._16_4_ = 0;
    if (iVar7 != 0) {
      CUtlVector<float,CUtlMemory<float,int>>::GrowVector
                ((CUtlVector<float,CUtlMemory<float,int>> *)(g_VProfExport + 4),iVar7);
      if ((0 < g_VProfExport._16_4_ - iVar7) && (0 < iVar7)) {
        _V_memmove((void *)(g_VProfExport._4_4_ + iVar7 * 4),(void *)g_VProfExport._4_4_,
                   (g_VProfExport._16_4_ - iVar7) * 4);
      }
    }
  }
  iVar7 = CVProfile::GetNumBudgetGroups();
  memset((void *)g_VProfExport._4_4_,0,iVar7 << 2);
  if ((g_pVProfileForDisplay != (undefined *)0xffffefe8) &&
     (puVar2 = *(undefined **)(g_pVProfileForDisplay + 0x1080), puVar2 != (undefined *)0x0)) {
    if (g_pVProfileForDisplay + 0x1018 == puVar2) {
      iVar7 = *(int *)(g_pVProfileForDisplay + 0x1088);
    }
    else {
      puVar8 = puVar2;
      do {
        iVar7 = *(int *)(puVar8 + 0x70);
        uVar3 = *(uint *)(*(int *)(g_pVProfileForDisplay + 0x10a0) + 4 + iVar7 * 8);
        if (((g_VProfExport._28_4_ & uVar3) != 0) && ((uVar3 & 0x8000) == 0)) goto LAB_00230bae;
        puVar8 = *(undefined **)(puVar8 + 100);
      } while (g_pVProfileForDisplay + 0x1018 != puVar8);
      iVar7 = *(int *)(g_pVProfileForDisplay + 0x1088);
    }
LAB_00230bae:
    dVar10 = (double)*(longlong *)(puVar2 + 0x48);
    if (*(int *)(puVar2 + 0x4c) < 0) {
      dVar10 = dVar10 + 1.8446744073709552e+19;
    }
    dVar10 = dVar10 * _g_ClockSpeedMillisecondsMultiplier;
    for (iVar9 = *(int *)(puVar2 + 0x68); iVar9 != 0; iVar9 = *(int *)(iVar9 + 0x6c)) {
      fVar4 = (float)*(longlong *)(iVar9 + 0x48);
      if (*(int *)(iVar9 + 0x4c) < 0) {
        fVar4 = fVar4 + 1.8446744e+19;
      }
      dVar10 = dVar10 - (double)fVar4 * _g_ClockSpeedMillisecondsMultiplier;
    }
    if (-1 < iVar7) {
      iVar9 = 0x200;
      if ((int)g_VProfExport._16_4_ < 0x200) {
        iVar9 = g_VProfExport._16_4_;
      }
      if (iVar7 < iVar9) {
        pfVar1 = (float *)(g_VProfExport._4_4_ + iVar7 * 4);
        *pfVar1 = (float)((double)*pfVar1 + dVar10);
      }
    }
    if (*(CVProfNode **)(puVar2 + 0x6c) != (CVProfNode *)0x0) {
      CVProfExport::CalculateBudgetGroupTimes_Recursive
                ((CVProfExport *)g_VProfExport,*(CVProfNode **)(puVar2 + 0x6c));
    }
    if (*(CVProfNode **)(puVar2 + 0x68) != (CVProfNode *)0x0) {
      CVProfExport::CalculateBudgetGroupTimes_Recursive
                ((CVProfExport *)g_VProfExport,*(CVProfNode **)(puVar2 + 0x68));
    }
    cVar6 = VProfRecord_IsPlayingBack();
    if (cVar6 == '\0') {
      *(undefined4 *)(puVar2 + 0x48) = 0;
      *(undefined4 *)(puVar2 + 0x4c) = 0;
    }
  }
  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)