L L4D2node

vprof_playback_average

0x00232d00 · 421 bytes · __cdecl

_ZL22vprof_playback_averageRK8CCommand

Decompiled

undefined (1 param)

/* vprof_playback_average(CCommand const&) */

void vprof_playback_average(CCommand *param_1)

{
  int iVar1;
  undefined4 uVar2;
  undefined4 local_40;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  if (*(int *)param_1 < 2) {
    Warning("vprof_playback_average [# frames]\n");
    Warning("If # frames is -1, then it will average all the remaining frames in the vprof file.\n")
    ;
    return;
  }
  iVar1 = strtol(*(char **)(param_1 + 0x40c),(char **)0x0,10);
  if (iVar1 == -1) {
    uVar2 = (**(code **)(*(int *)(g_pFileSystem + 4) + 0x14))
                      (g_pFileSystem + 4,g_VProfRecorder._6628_4_);
    iVar1 = 9999999;
  }
  else {
    uVar2 = (**(code **)(*(int *)(g_pFileSystem + 4) + 0x14))();
    local_30 = 0;
    local_2c = 0;
    local_28 = 0;
    local_24 = 0;
    local_20 = 0;
    local_40 = g_VProfRecorder._6636_4_;
    if (iVar1 < 1) goto LAB_00232de4;
  }
  local_40 = g_VProfRecorder._6636_4_;
  local_20 = 0;
  local_24 = 0;
  local_28 = 0;
  local_2c = 0;
  local_30 = 0;
  do {
    if (g_VProfRecorder[0x19f4] != '\0') break;
                    /* try { // try from 00232dc0 to 00232e22 has its CatchHandler @ 00232eaa */
    CVProfRecorder::Playback_ReadTick((CVProfRecorder *)g_VProfRecorder,-1,(bool *)0x0);
    CVProfRecorder::UpdateAverages_R
              ((CVProfRecorder *)g_VProfRecorder,(CUtlVector *)&local_30,
               (CVProfNode *)(g_VProfRecorder + 0x1018));
    iVar1 = iVar1 + -1;
  } while (0 < iVar1);
LAB_00232de4:
  CVProfRecorder::DumpAverages_R
            ((CVProfRecorder *)g_VProfRecorder,(CUtlVector *)&local_30,
             (CVProfNode *)(g_VProfRecorder + 0x1018));
  (**(code **)(*(int *)(g_pFileSystem + 4) + 0x10))
            (g_pFileSystem + 4,g_VProfRecorder._6628_4_,uVar2,0);
  local_24 = 0;
  g_VProfRecorder._6636_4_ = local_40;
  CUtlMemory<CVProfRecorder::CNodeAverage,int>::Purge
            ((CUtlMemory<CVProfRecorder::CNodeAverage,int> *)&local_30);
  local_20 = local_30;
  CUtlMemory<CVProfRecorder::CNodeAverage,int>::Purge
            ((CUtlMemory<CVProfRecorder::CNodeAverage,int> *)&local_30);
  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)