L L4D2node

CVProfRecorder::Playback_ReadTick

0x0023bff0 · 990 bytes · __thiscall

_ZN14CVProfRecorder17Playback_ReadTickEiPb

Decompiled

undefined (3 params)

/* WARNING: Type propagation algorithm not settling */
/* CVProfRecorder::Playback_ReadTick(int, bool*) */

undefined4 __thiscall
CVProfRecorder::Playback_ReadTick(CVProfRecorder *this,int param_1,bool *param_2)

{
  char cVar1;
  int iVar2;
  char local_29;
  int 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 (param_2 != (bool *)0x0) {
    *param_2 = false;
  }
  if (*(int *)(this + 0x19e0) != 2) {
    return 0;
  }
  if (((byte)this[0x1a0c] & 1) == 0) {
    iVar2 = (*(code *)**(undefined4 **)(g_pFileSystem + 4))
                      (g_pFileSystem + 4,&local_28,1,*(undefined4 *)(this + 0x19e4));
  }
  else {
    iVar2 = (*(code *)**(undefined4 **)(g_pFileSystem + 4))(g_pFileSystem + 4,&local_24);
    local_20 = local_24;
    _V_memcpy(&local_28,&local_20,1);
  }
  if ((iVar2 != 1) || ((char)local_28 == '\x05')) {
    Msg("VPROF playback finished.\n");
    this[0x19f4] = (CVProfRecorder)0x1;
    return 1;
  }
  if ((char)local_28 != '\0') {
    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",0x22b);
    return 0;
  }
  local_28 = *(int *)(this + 0x19ec);
  if (((byte)this[0x1a0c] & 1) == 0) {
    (*(code *)**(undefined4 **)(g_pFileSystem + 4))
              (g_pFileSystem + 4,&local_28,4,*(undefined4 *)(this + 0x19e4));
  }
  else {
    (*(code *)**(undefined4 **)(g_pFileSystem + 4))
              (g_pFileSystem + 4,&local_24,4,*(undefined4 *)(this + 0x19e4));
    local_20 = local_21;
    local_1f = local_22;
    local_1e = local_23;
    local_1d = local_24;
    _V_memcpy(&local_28,&local_20,4);
  }
  if ((param_1 != -1) && (param_1 < local_28)) {
    *param_2 = true;
    (**(code **)(*(int *)(g_pFileSystem + 4) + 0x10))
              (g_pFileSystem + 4,*(undefined4 *)(this + 0x19e4),0xfffffffb,1);
    return 1;
  }
  *(int *)(this + 0x19ec) = local_28;
LAB_0023c158:
  do {
    if (((byte)this[0x1a0c] & 1) == 0) {
      iVar2 = (*(code *)**(undefined4 **)(g_pFileSystem + 4))
                        (g_pFileSystem + 4,&local_29,1,*(undefined4 *)(this + 0x19e4));
    }
    else {
      iVar2 = (*(code *)**(undefined4 **)(g_pFileSystem + 4))(g_pFileSystem + 4,&local_24);
      local_20 = local_24;
      _V_memcpy(&local_29,&local_20,1);
    }
    if (iVar2 != 1) {
LAB_0023c1b4:
      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",0x254);
      return 0;
    }
    if (local_29 == '\x04') {
      return 1;
    }
    if (local_29 == '\x02') {
      cVar1 = Playback_ReadAddBudgetGroup(this);
joined_r0x0023c254:
      if (cVar1 == '\0') {
        return 0;
      }
      goto LAB_0023c158;
    }
    if (local_29 != '\x01') {
      if (local_29 != '\x03') goto LAB_0023c1b4;
      cVar1 = Playback_ReadTimings_R(this,(CVProfNode *)(this + 0x1018));
      goto joined_r0x0023c254;
    }
    cVar1 = Playback_ReadAddNode(this);
    if (cVar1 == '\0') {
      return 0;
    }
  } while( true );
}

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)