L L4D2node

CVProfRecorder::Record_Start

0x002354b0 · 735 bytes · __thiscall

_ZN14CVProfRecorder12Record_StartEPKc

Decompiled

undefined (2 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CVProfRecorder::Record_Start(char const*) */

undefined4 __thiscall CVProfRecorder::Record_Start(CVProfRecorder *this,char *param_1)

{
  char *pcVar1;
  int iVar2;
  undefined4 uVar3;
  char *pcVar4;
  int in_GS_OFFSET;
  undefined4 local_220;
  undefined4 local_21c;
  undefined1 local_218 [4];
  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_002a5c80,0);
  *(undefined4 *)(this + 0x19e0) = 1;
  *(int *)(this + 0x19e4) = iVar2;
  uVar3 = 0;
  if (iVar2 != 0) {
    local_220 = 1;
    if (((byte)this[0x1a0c] & 1) == 0) {
      (**(code **)(*(int *)(g_pFileSystem + 4) + 4))(g_pFileSystem + 4,&local_220,4,iVar2);
    }
    else {
      local_214 = 0;
      local_213 = 0;
      local_212 = 0;
      local_211 = 1;
      _V_memcpy(local_218,&local_214,4);
      (**(code **)(*(int *)(g_pFileSystem + 4) + 4))
                (g_pFileSystem + 4,local_218,4,*(undefined4 *)(this + 0x19e4));
    }
    local_21c = _DAT_0040b0ac;
    uVar3 = local_21c;
    if (((byte)this[0x1a0c] & 1) == 0) {
      (**(code **)(*(int *)(g_pFileSystem + 4) + 4))
                (g_pFileSystem + 4,&local_21c,4,*(undefined4 *)(this + 0x19e4));
    }
    else {
      local_21c._3_1_ = (undefined1)((uint)_DAT_0040b0ac >> 0x18);
      local_214 = local_21c._3_1_;
      local_21c._2_1_ = (undefined1)((uint)_DAT_0040b0ac >> 0x10);
      local_213 = local_21c._2_1_;
      local_21c._1_1_ = (undefined1)((uint)_DAT_0040b0ac >> 8);
      local_212 = local_21c._1_1_;
      local_21c._0_1_ = (undefined1)_DAT_0040b0ac;
      local_211 = (undefined1)local_21c;
      local_21c = uVar3;
      _V_memcpy(local_218,&local_214,4);
      (**(code **)(*(int *)(g_pFileSystem + 4) + 4))
                (g_pFileSystem + 4,local_218,4,*(undefined4 *)(this + 0x19e4));
    }
    *(int *)(this + 0x1a00) = *(int *)(this + 0x1a00) + 1;
    uVar3 = Cbuf_GetCurrentPlayer();
    Cbuf_AddText(uVar3,"vprof_on\n",0);
    uVar3 = 1;
  }
  if (local_10 == *(int *)(in_GS_OFFSET + 0x14)) {
    return uVar3;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)