CVProfRecorder::Playback_Start
0x0023c3f0 · 1023 bytes · __thiscall
_ZN14CVProfRecorder14Playback_StartEPKc
Decompiled
undefined (2 params)
/* CVProfRecorder::Playback_Start(char const*) */
undefined4 __thiscall CVProfRecorder::Playback_Start(CVProfRecorder *this,char *param_1)
{
char *pcVar1;
int iVar2;
undefined4 uVar3;
char *pcVar4;
int in_GS_OFFSET;
int local_220;
undefined4 local_21c;
undefined1 local_218;
undefined1 local_217;
undefined1 local_216;
undefined1 local_215;
undefined1 local_214;
undefined1 local_213;
undefined1 local_212;
undefined1 local_211;
char local_210 [512];
int local_10;
local_10 = *(int *)(in_GS_OFFSET + 0x14);
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();
pcVar1 = strchr(param_1,0x2e);
pcVar4 = param_1;
if (pcVar1 == (char *)0x0) {
pcVar4 = local_210;
V_snprintf(pcVar4,0x200,"%s.vprof",param_1);
}
*(undefined4 *)(this + 0x19e8) = 0xffffffff;
iVar2 = (**(code **)(*(int *)(g_pFileSystem + 4) + 8))(g_pFileSystem + 4,pcVar4,&DAT_002a3e98,0);
this[0x1a08] = (CVProfRecorder)0x1;
*(int *)(this + 0x19e4) = iVar2;
*(undefined4 *)(this + 0x19e0) = 2;
if (iVar2 == 0) {
Warning("vprof_playback_start: Open( %s ) failed.\n",pcVar4);
uVar3 = 0;
}
else {
if (((byte)this[0x1a0c] & 1) == 0) {
(*(code *)**(undefined4 **)(g_pFileSystem + 4))(g_pFileSystem + 4,&local_220);
}
else {
(*(code *)**(undefined4 **)(g_pFileSystem + 4))(g_pFileSystem + 4,&local_218,4,iVar2);
local_214 = local_215;
local_213 = local_216;
local_212 = local_217;
local_211 = local_218;
_V_memcpy(&local_220,&local_214,4);
}
if (local_220 == 1) {
if (((byte)this[0x1a0c] & 1) == 0) {
(*(code *)**(undefined4 **)(g_pFileSystem + 4))
(g_pFileSystem + 4,&local_21c,4,*(undefined4 *)(this + 0x19e4));
}
else {
(*(code *)**(undefined4 **)(g_pFileSystem + 4))
(g_pFileSystem + 4,&local_218,4,*(undefined4 *)(this + 0x19e4));
local_214 = local_215;
local_213 = local_216;
local_212 = local_217;
local_211 = local_218;
_V_memcpy(&local_21c,&local_214,4);
}
*(undefined4 *)(this + 0x1090) = local_21c;
uVar3 = (**(code **)(*(int *)(g_pFileSystem + 4) + 0x14))
(g_pFileSystem + 4,*(undefined4 *)(this + 0x19e4));
this[0x19f4] = (CVProfRecorder)0x0;
*(undefined4 *)(this + 0x19f0) = uVar3;
uVar3 = (**(code **)(*(int *)(g_pFileSystem + 4) + 0x18))
(g_pFileSystem + 4,*(undefined4 *)(this + 0x19e4));
*(undefined4 *)(this + 0x100c) = 1;
*(undefined4 *)(this + 0x19f8) = uVar3;
Playback_ReadTick(this,-1,(bool *)0x0);
uVar3 = 1;
g_pVProfileForDisplay = this;
}
else {
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",0x158);
uVar3 = 0;
}
}
if (local_10 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
return uVar3;
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.