L L4D2node

CBasePlayer::GetDemoRecordingState

0x007c0830 · 906 bytes · __thiscall

_ZN11CBasePlayer21GetDemoRecordingStateEP9KeyValues

Decompiled

undefined (2 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CBasePlayer::GetDemoRecordingState(KeyValues*) */

undefined4 __thiscall CBasePlayer::GetDemoRecordingState(CBasePlayer *this,KeyValues *param_1)

{
  uint *puVar1;
  char cVar2;
  char *pcVar3;
  int iVar4;
  int iVar5;
  float local_6c;
  float local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_58;
  undefined4 local_54;
  int local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  float local_40;
  float local_3c;
  float local_38;
  Vector local_34 [12];
  Vector local_28 [24];
  
  local_64 = 0;
  local_60 = 0;
  if (_towlower == 0) {
    local_50 = 0;
  }
  else {
    (**(code **)(_towlower + 0x50))
              (_towlower,&local_64,0,0,0,0,"/data/src/game/server/player.cpp",0x27be,
               &GetDemoRecordingState(KeyValues*)::tm_fmt,"(%s)%s","Tools",
               "CBasePlayer::GetDemoRecordingState");
    local_50 = _towlower;
  }
  iVar4 = _DAT_0105db00;
  local_58 = local_64;
  local_54 = local_60;
  if ((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) {
                    /* try { // try from 007c0b16 to 007c0b76 has its CatchHandler @ 007c0bd1 */
    iVar5 = ThreadGetCurrentId();
    if (iVar4 == iVar5) {
      if ((char *)*_DAT_0105d15c != "CBasePlayer::GetDemoRecordingState") {
        _DAT_0105d15c =
             (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xcb9b94,(char *)0x0,0xc59908);
      }
      puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
      *puVar1 = *puVar1 | 4;
      CVProfNode::EnterScope();
      DAT_0105d158 = '\0';
    }
  }
                    /* try { // try from 007c08f1 to 007c0a6b has its CatchHandler @ 007c0be6 */
  CBaseFlex::GetDemoRecordingState((CBaseFlex *)this,param_1);
  KeyValues::SetInt(param_1,"baseplayer",1);
  pcVar3 = (char *)(**(code **)(*(int *)this + 0xb8))(this);
  KeyValues::SetString(param_1,"playername",pcVar3);
  if (GetDemoRecordingState(KeyValues*)::state == '\0') {
    iVar4 = __cxa_guard_acquire(&GetDemoRecordingState(KeyValues*)::state);
    if (iVar4 != 0) {
      GetDemoRecordingState(KeyValues*)::state._0_4_ = 0;
      GetDemoRecordingState(KeyValues*)::state._4_4_ = 0;
      __cxa_guard_release(&GetDemoRecordingState(KeyValues*)::state);
    }
  }
  iVar4 = GetFOV(this);
  GetDemoRecordingState(KeyValues*)::state._12_4_ = (undefined4)iVar4;
  local_6c = 0.1;
  local_68 = 10000.0;
  CalcView(this,(Vector *)(GetDemoRecordingState(KeyValues*)::state + 0x10),
           (QAngle *)(GetDemoRecordingState(KeyValues*)::state + 0x1c),&local_6c,&local_68,
           (float *)(GetDemoRecordingState(KeyValues*)::state + 0xc));
  GetDemoRecordingState(KeyValues*)::state[8] = 1;
  local_4c = 0xc2c80000;
  local_48 = 0;
  local_44 = 0;
  AngleVectors((QAngle *)&local_4c,(Vector *)&local_40,local_34,local_28);
  GetDemoRecordingState(KeyValues*)::state._16_4_ =
       local_40 * -100.0 + (float)GetDemoRecordingState(KeyValues*)::state._16_4_;
  GetDemoRecordingState(KeyValues*)::state._20_4_ =
       local_3c * -100.0 + (float)GetDemoRecordingState(KeyValues*)::state._20_4_;
  GetDemoRecordingState(KeyValues*)::state._24_4_ =
       local_38 * -100.0 + (float)GetDemoRecordingState(KeyValues*)::state._24_4_;
  GetDemoRecordingState(KeyValues*)::state._28_4_ = local_4c;
  GetDemoRecordingState(KeyValues*)::state._32_4_ = local_48;
  GetDemoRecordingState(KeyValues*)::state._36_4_ = local_44;
  KeyValues::SetInt(param_1,"type",7);
  KeyValues::SetPtr(param_1,"camera",GetDemoRecordingState(KeyValues*)::state);
  iVar4 = _DAT_0105db00;
  if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
    iVar5 = ThreadGetCurrentId();
    if (iVar4 == iVar5) {
      cVar2 = CVProfNode::ExitScope();
      if (cVar2 != '\0') {
        _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
      }
      DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
    }
  }
  if (local_50 != 0) {
    (**(code **)(local_50 + 0x54))(local_50,local_58,local_54,0,0,0);
  }
  return 1;
}

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)