2023-01-19 16:11:48 +01:00
|
|
|
|
//====== Copyright <20> 1996-2005, Valve Corporation, All rights reserved. =======//
|
|
|
|
|
//
|
|
|
|
|
// Purpose:
|
|
|
|
|
//
|
|
|
|
|
// $NoKeywords: $
|
|
|
|
|
//
|
|
|
|
|
//=============================================================================//
|
|
|
|
|
#if !defined( USERCMD_H )
|
|
|
|
|
#define USERCMD_H
|
|
|
|
|
#ifdef _WIN32
|
|
|
|
|
#pragma once
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include "public/utility/memaddr.h"
|
|
|
|
|
#include "mathlib/vector.h"
|
|
|
|
|
|
|
|
|
|
//-------------------------------------------------------------------------------------
|
|
|
|
|
// Forward declarations
|
|
|
|
|
//-------------------------------------------------------------------------------------
|
|
|
|
|
class CUserCmd;
|
|
|
|
|
|
|
|
|
|
inline CMemory p_CUserCmd__Reset;
|
|
|
|
|
inline auto v_CUserCmd__Reset = p_CUserCmd__Reset.RCast<void(*)(CUserCmd* pUserCmd)>();
|
|
|
|
|
|
2023-01-19 20:45:59 +01:00
|
|
|
|
inline CMemory p_CUserCmd__Copy;
|
|
|
|
|
inline auto v_CUserCmd__Copy = p_CUserCmd__Copy.RCast<CUserCmd*(*)(CUserCmd* pDest, CUserCmd* pSource)>();
|
|
|
|
|
|
2023-01-19 16:11:48 +01:00
|
|
|
|
//-------------------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
//-------------------------------------------------------------------------------------
|
|
|
|
|
class CUserCmd
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
CUserCmd() // Cannot be constructed during DLL init.
|
|
|
|
|
{
|
|
|
|
|
v_CUserCmd__Reset(this);
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-19 20:45:59 +01:00
|
|
|
|
CUserCmd* Copy(CUserCmd* pSource)
|
|
|
|
|
{
|
2023-01-20 01:23:08 +01:00
|
|
|
|
return v_CUserCmd__Copy(this, pSource);
|
2023-01-19 20:45:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
2023-01-19 16:11:48 +01:00
|
|
|
|
int32_t command_number;
|
|
|
|
|
int32_t tick_count;
|
|
|
|
|
float curtime;
|
|
|
|
|
QAngle viewangles;
|
|
|
|
|
char pad_0x0018[12];
|
|
|
|
|
float forwardmove;
|
|
|
|
|
float sidemove;
|
|
|
|
|
float upmove;
|
|
|
|
|
int32_t buttons;
|
|
|
|
|
char pad_0x0034[336];
|
|
|
|
|
int32_t randomseed;
|
|
|
|
|
char pad_0x0188[8];
|
|
|
|
|
Vector3D headposition;
|
|
|
|
|
float maxpitch;
|
2023-01-19 20:45:59 +01:00
|
|
|
|
char pad_0x01A0[60];
|
2023-01-19 16:11:48 +01:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
class VUserCmd : public IDetour
|
|
|
|
|
{
|
|
|
|
|
virtual void GetAdr(void) const
|
|
|
|
|
{
|
|
|
|
|
spdlog::debug("| FUN: CUserCmd::Reset : {:#18x} |\n", p_CUserCmd__Reset.GetPtr());
|
2023-01-19 20:45:59 +01:00
|
|
|
|
spdlog::debug("| FUN: CUserCmd::Copy : {:#18x} |\n", p_CUserCmd__Copy.GetPtr());
|
2023-01-19 16:11:48 +01:00
|
|
|
|
spdlog::debug("+----------------------------------------------------------------+\n");
|
|
|
|
|
}
|
|
|
|
|
virtual void GetFun(void) const
|
|
|
|
|
{
|
|
|
|
|
p_CUserCmd__Reset = g_GameDll.FindPatternSIMD("E8 ?? ?? ?? ?? 83 FD FF 74 0A").FollowNearCallSelf();
|
|
|
|
|
v_CUserCmd__Reset = p_CUserCmd__Reset.RCast<void(*)(CUserCmd*)>();
|
2023-01-19 20:45:59 +01:00
|
|
|
|
|
|
|
|
|
p_CUserCmd__Copy = g_GameDll.FindPatternSIMD("E8 ?? ?? ?? ?? 4C 8B 9B ?? ?? ?? ??").FollowNearCallSelf();
|
|
|
|
|
v_CUserCmd__Copy = p_CUserCmd__Copy.RCast<CUserCmd* (*)(CUserCmd*, CUserCmd*)>();
|
2023-01-19 16:11:48 +01:00
|
|
|
|
}
|
|
|
|
|
virtual void GetVar(void) const { }
|
|
|
|
|
virtual void GetCon(void) const { }
|
|
|
|
|
virtual void Attach(void) const { }
|
|
|
|
|
virtual void Detach(void) const { }
|
|
|
|
|
};
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
|
|
REGISTER(VUserCmd);
|
|
|
|
|
|
|
|
|
|
#endif // USERCMD_H
|