2022-01-23 18:26:48 +01:00
|
|
|
#pragma once
|
2022-02-19 02:31:16 +01:00
|
|
|
#include <launcher/IApplication.h>
|
2022-08-09 11:53:33 +02:00
|
|
|
#include <public/iengine.h>
|
2022-01-23 18:26:48 +01:00
|
|
|
|
2022-08-09 11:53:33 +02:00
|
|
|
class CEngine : public IEngine
|
2022-01-23 18:26:48 +01:00
|
|
|
{
|
2022-03-07 13:15:45 +01:00
|
|
|
private:
|
|
|
|
EngineState_t m_nDLLState;
|
|
|
|
EngineState_t m_nNextDLLState;
|
2022-08-09 11:53:33 +02:00
|
|
|
double m_flCurrentTime;
|
|
|
|
double m_flPreviousTime;
|
|
|
|
float m_flFrameTime;
|
|
|
|
float m_flPreviousFrameTime;
|
|
|
|
float m_flFilteredTime;
|
2022-03-07 13:15:45 +01:00
|
|
|
uint8_t gap2C[4];
|
|
|
|
int64_t field_30;
|
|
|
|
char field_38;
|
|
|
|
char field_39;
|
2022-01-23 18:26:48 +01:00
|
|
|
};
|
|
|
|
|
2022-04-09 02:18:57 +02:00
|
|
|
/* ==== CENGINE ======================================================================================================================================================= */
|
2022-04-18 03:35:08 +02:00
|
|
|
extern CEngine* g_pEngine;
|
2022-01-23 18:26:48 +01:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2022-05-13 14:53:25 +02:00
|
|
|
class VEngine : public IDetour
|
2022-01-23 18:26:48 +01:00
|
|
|
{
|
2022-04-11 01:44:30 +02:00
|
|
|
virtual void GetAdr(void) const
|
2022-01-23 18:26:48 +01:00
|
|
|
{
|
2022-05-13 14:53:25 +02:00
|
|
|
spdlog::debug("| VAR: g_pEngine : {:#18x} |\n", reinterpret_cast<uintptr_t>(g_pEngine));
|
|
|
|
spdlog::debug("+----------------------------------------------------------------+\n");
|
2022-01-23 18:26:48 +01:00
|
|
|
}
|
2022-04-11 01:44:30 +02:00
|
|
|
virtual void GetFun(void) const { }
|
2022-04-18 03:35:08 +02:00
|
|
|
virtual void GetVar(void) const
|
|
|
|
{
|
|
|
|
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
2022-08-09 03:02:00 +02:00
|
|
|
g_pEngine = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x28\x80\xB9\x00\x00\x00\x00\x00\x48\x8B\x15\x00\x00\x00\x00"), "xxxxxx?????xxx????").FindPatternSelf("48 8D ?? ?? ?? ?? 01", CMemory::Direction::DOWN, 300).ResolveRelativeAddressSelf(0x3, 0x7).RCast<CEngine*>();
|
2022-04-18 03:35:08 +02:00
|
|
|
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
2022-08-09 03:02:00 +02:00
|
|
|
g_pEngine = g_GameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x40\x53\x48\x83\xEC\x20\x80\xB9\x00\x00\x00\x00\x00\xBB\x00\x00\x00\x00"), "xxxxxxxx?????x????").FindPatternSelf("48 8B ?? ?? ?? ?? 01", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x3, 0x7).RCast<CEngine*>();
|
2022-04-18 03:35:08 +02:00
|
|
|
#endif
|
|
|
|
}
|
2022-04-11 01:44:30 +02:00
|
|
|
virtual void GetCon(void) const { }
|
|
|
|
virtual void Attach(void) const { }
|
|
|
|
virtual void Detach(void) const { }
|
2022-01-23 18:26:48 +01:00
|
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2022-05-13 14:53:25 +02:00
|
|
|
REGISTER(VEngine);
|