L L4D2node

CBaseAnimating::GetDemoRecordingState

0x005e3fe0 · 1159 bytes · __thiscall

_ZN14CBaseAnimating21GetDemoRecordingStateEP9KeyValues

Decompiled

undefined (2 params)

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

byte __thiscall CBaseAnimating::GetDemoRecordingState(CBaseAnimating *this,KeyValues *param_1)

{
  ServerDemoPacket_BaseAnimating *this_00;
  uint *puVar1;
  int *piVar2;
  byte bVar3;
  char cVar4;
  byte bVar5;
  int iVar6;
  CStudioHdr *pCVar7;
  int iVar8;
  CStudioHdr *this_01;
  float fVar9;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  
  local_34 = 0;
  local_30 = 0;
  if (_towlower == 0) {
    local_20 = 0;
  }
  else {
    (**(code **)(_towlower + 0x50))
              (_towlower,&local_34,0,0,0,0,"/data/src/game/server/baseanimating.cpp",0xfbd,
               &GetDemoRecordingState(KeyValues*)::tm_fmt,"(%s)%s","Tools",
               "CBaseAnimating::GetDemoRecordingState");
    local_20 = _towlower;
  }
  iVar6 = _DAT_0105db00;
  local_28 = local_34;
  local_24 = local_30;
                    /* try { // try from 005e4306 to 005e4366 has its CatchHandler @ 005e44c6 */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar8 = ThreadGetCurrentId(), iVar6 == iVar8)) {
    if ((char *)*_DAT_0105d15c != "CBaseAnimating::GetDemoRecordingState") {
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc5a0d0,(char *)0x0,0xc59908);
    }
    puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
    *puVar1 = *puVar1 | 4;
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
                    /* try { // try from 005e409d to 005e4116 has its CatchHandler @ 005e44ca */
  bVar3 = CBaseEntity::GetDemoRecordingState((CBaseEntity *)this,param_1);
  KeyValues::SetInt(param_1,"type",4);
  if ((GetDemoRecordingState(KeyValues*)::currentState == '\0') &&
     (iVar6 = __cxa_guard_acquire(&GetDemoRecordingState(KeyValues*)::currentState), iVar6 != 0)) {
    GetDemoRecordingState(KeyValues*)::currentState._12_2_ = 0xffff;
    GetDemoRecordingState(KeyValues*)::currentState._14_2_ = 0xffff;
    GetDemoRecordingState(KeyValues*)::currentState._16_2_ = 0xffff;
    GetDemoRecordingState(KeyValues*)::currentState[0x12] = 0;
    GetDemoRecordingState(KeyValues*)::currentState[0x13] = 0;
    GetDemoRecordingState(KeyValues*)::currentState[0x14] = 0;
    GetDemoRecordingState(KeyValues*)::currentState[0x15] = 0;
    GetDemoRecordingState(KeyValues*)::currentState._24_4_ = 0;
    GetDemoRecordingState(KeyValues*)::currentState._28_4_ = 0;
    GetDemoRecordingState(KeyValues*)::currentState._32_4_ = 0;
    GetDemoRecordingState(KeyValues*)::currentState[0x24] = 0;
                    /* try { // try from 005e443c to 005e4440 has its CatchHandler @ 005e4499 */
    CBoneList::CBoneList((CBoneList *)(GetDemoRecordingState(KeyValues*)::currentState + 0x88));
    __cxa_guard_release(&GetDemoRecordingState(KeyValues*)::currentState);
  }
  piVar2 = mdlcache;
  GetDemoRecordingState(KeyValues*)::currentState._136_2_ =
       GetDemoRecordingState(KeyValues*)::currentState._136_2_ & 1;
  GetDemoRecordingState(KeyValues*)::currentState._12_2_ = (undefined2)*(undefined4 *)(this + 0x458)
  ;
  GetDemoRecordingState(KeyValues*)::currentState._14_2_ = (undefined2)*(undefined4 *)(this + 0x45c)
  ;
  GetDemoRecordingState(KeyValues*)::currentState._16_2_ = (undefined2)*(undefined4 *)(this + 0x494)
  ;
  (**(code **)(*mdlcache + 0x68))(mdlcache);
  pCVar7 = *(CStudioHdr **)(this + 0x13e0);
  if (pCVar7 == (CStudioHdr *)0x0) {
                    /* try { // try from 005e4473 to 005e4483 has its CatchHandler @ 005e44ce */
    iVar6 = CBaseEntity::GetModel((CBaseEntity *)this);
    if (iVar6 != 0) {
      LockStudioHdr(this);
    }
    pCVar7 = *(CStudioHdr **)(this + 0x13e0);
    this_01 = (CStudioHdr *)0x0;
    if (pCVar7 != (CStudioHdr *)0x0) goto LAB_005e4125;
  }
  else {
LAB_005e4125:
    this_01 = (CStudioHdr *)0x0;
    if (*(int *)pCVar7 != 0) {
      this_01 = pCVar7;
    }
  }
                    /* try { // try from 005e4144 to 005e425b has its CatchHandler @ 005e44ce */
  KeyValues::SetInt(param_1,"viewmodel",0);
  GetDemoRecordingState(KeyValues*)::currentState._24_4_ = *(undefined4 *)(this + 0x490);
  if (this_01 == (CStudioHdr *)0x0) {
    GetDemoRecordingState(KeyValues*)::currentState[0x24] = 0;
  }
  else {
    GetDemoRecordingState(KeyValues*)::currentState[0x24] =
         CStudioHdr::GetNumPoseParameters(this_01);
    iVar6 = CStudioHdr::GetNumPoseParameters(this_01);
    _V_memcpy(GetDemoRecordingState(KeyValues*)::currentState + 0x28,this + 0x498,iVar6 << 2);
  }
  fVar9 = *(float *)(this + 0x528);
  GetDemoRecordingState(KeyValues*)::currentState[0x12] = 0;
  GetDemoRecordingState(KeyValues*)::currentState[0x14] = 0;
  GetDemoRecordingState(KeyValues*)::currentState._28_4_ = 1.0;
  if (fVar9 < 0.0) {
    fVar9 = 1.0;
  }
  else {
    if (1.0 < fVar9) goto LAB_005e41ce;
    fVar9 = 1.0 - fVar9;
  }
  if (*(float *)(this + 0x468) * fVar9 != 0.0) {
    GetDemoRecordingState(KeyValues*)::currentState._28_4_ = *(float *)(this + 0x468) * fVar9;
  }
LAB_005e41ce:
  GetDemoRecordingState(KeyValues*)::currentState[0x13] = (**(code **)(*(int *)this + 0x34c))(this);
  this_00 = (ServerDemoPacket_BaseAnimating *)(this + 0x554);
  GetDemoRecordingState(KeyValues*)::currentState._32_4_ = *(undefined4 *)(gpGlobals + 4);
  GetDemoRecordingState(KeyValues*)::currentState[0x15] = (byte)(*(uint *)(this + 0xd4) >> 3) & 1;
  if (this[0x10] == (CBaseAnimating)0x0) {
                    /* try { // try from 005e4383 to 005e4387 has its CatchHandler @ 005e44ce */
    bVar5 = ServerDemoPacket_BaseAnimating::CompareAndCacheModifiedFields
                      (this_00,(ServerDemoPacket_BaseAnimating *)
                               GetDemoRecordingState(KeyValues*)::currentState);
  }
  else {
    memcpy(this_00,GetDemoRecordingState(KeyValues*)::currentState,0xe8c);
    *(undefined4 *)(this + 0x554) = 0xffffffff;
    *(undefined4 *)(this + 0x558) = 0xffffffff;
    bVar5 = 1;
  }
  KeyValues::SetPtr(param_1,"baseanimating",this_00);
  (**(code **)(*piVar2 + 0x6c))(piVar2);
  iVar6 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar8 = ThreadGetCurrentId(), iVar6 == iVar8)) {
    cVar4 = CVProfNode::ExitScope();
    if (cVar4 != '\0') {
      _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
    }
    DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
  }
  if (local_20 != 0) {
    (**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
  }
  return bVar5 | bVar3;
}

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)