2021-12-25 22:36:38 +01:00
|
|
|
#pragma once
|
2022-02-22 02:45:40 +01:00
|
|
|
#include "appframework/iappsystem.h"
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Return values from the initialization stage of the application framework
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
INIT_RESTART = INIT_LAST_VAL,
|
|
|
|
RUN_FIRST_VAL,
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
// Return values from IEngineAPI::Run.
|
|
|
|
//-----------------------------------------------------------------------------
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
RUN_OK = RUN_FIRST_VAL,
|
|
|
|
RUN_RESTART,
|
|
|
|
};
|
2021-12-25 22:36:38 +01:00
|
|
|
|
2022-01-23 18:26:48 +01:00
|
|
|
class CModAppSystemGroup
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MEMBER_AT_OFFSET(bool, m_bIsServerOnly, 0xA8);
|
|
|
|
};
|
|
|
|
|
2022-02-19 16:42:40 +01:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
// Methods of IApplication
|
|
|
|
//-------------------------------------------------------------------------
|
2022-04-09 02:18:57 +02:00
|
|
|
/* ==== CAPPSYSTEMGROUP ================================================================================================================================================= */
|
2022-01-05 22:56:49 +01:00
|
|
|
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
2022-04-09 02:18:57 +02:00
|
|
|
inline ADDRESS p_CModAppSystemGroup_Main = g_mGameDll.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????");
|
2022-04-09 06:05:47 +02:00
|
|
|
inline auto CModAppSystemGroup_Main = p_CModAppSystemGroup_Main.RCast<int(*)(CModAppSystemGroup* pModAppSystemGroup)>(); /*48 83 EC 28 80 B9 ?? ?? ?? ?? ?? 48 8B 15 ?? ?? ?? ??*/
|
2021-12-25 22:36:38 +01:00
|
|
|
|
2022-04-09 02:18:57 +02:00
|
|
|
inline ADDRESS p_CModAppSystemGroup_Create = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\xC4\x57\x41\x54\x41\x55\x41\x56\x41\x57\x48\x83\xEC\x60\x48\xC7\x40\x00\x00\x00\x00\x00\x48\x89\x58\x08"), "xxxxxxxxxxxxxxxxxxx?????xxxx");
|
2022-04-09 06:05:47 +02:00
|
|
|
inline auto CModAppSystemGroup_Create = p_CModAppSystemGroup_Create.RCast<bool(*)(CModAppSystemGroup* pModAppSystemGroup)>(); /*48 8B C4 57 41 54 41 55 41 56 41 57 48 83 EC 60 48 C7 40 ?? ?? ?? ?? ?? 48 89 58 08*/
|
2021-12-25 22:36:38 +01:00
|
|
|
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
2022-04-09 02:18:57 +02:00
|
|
|
inline ADDRESS p_CModAppSystemGroup_Main = g_mGameDll.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????");
|
2022-04-09 06:05:47 +02:00
|
|
|
inline auto CModAppSystemGroup_Main = p_CModAppSystemGroup_Main.RCast<int(*)(CModAppSystemGroup* pModAppSystemGroup)>(); /*40 53 48 83 EC 20 80 B9 ?? ?? ?? ?? ?? BB ?? ?? ?? ??*/
|
2021-12-25 22:36:38 +01:00
|
|
|
|
2022-04-09 02:18:57 +02:00
|
|
|
inline ADDRESS p_CModAppSystemGroup_Create = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x8B\xC4\x55\x41\x54\x41\x55\x41\x56\x41\x57\x48\x8B\xEC\x48\x83\xEC\x60"), "xxxxxxxxxxxxxxxxxxx");
|
2022-04-09 06:05:47 +02:00
|
|
|
inline auto CModAppSystemGroup_Create = p_CModAppSystemGroup_Create.RCast<bool(*)(CModAppSystemGroup* pModAppSystemGroup)>(); /*48 8B C4 55 41 54 41 55 41 56 41 57 48 8B EC 48 83 EC 60*/
|
2021-12-25 22:36:38 +01:00
|
|
|
#endif
|
2022-04-09 02:18:57 +02:00
|
|
|
inline ADDRESS p_CSourceAppSystemGroup__PreInit = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x74\x24\x00\x55\x48\x8D\xAC\x24\x00\x00\x00\x00\x48\x81\xEC\x00\x00\x00\x00\x48\x8B\x05\x00\x00\x00\x00"), "xxxx?xxxxx????xxx????xxx????");
|
2022-04-09 06:05:47 +02:00
|
|
|
inline auto CSourceAppSystemGroup__PreInit = p_CSourceAppSystemGroup__PreInit.RCast<bool(*)(CModAppSystemGroup* pModAppSystemGroup)>(); /*48 89 74 24 ? 55 48 8D AC 24 ? ? ? ? 48 81 EC ? ? ? ? 48 8B 05 ? ? ? ?*/
|
2022-02-19 16:42:40 +01:00
|
|
|
|
2022-04-09 02:18:57 +02:00
|
|
|
inline ADDRESS p_CSourceAppSystemGroup__Create = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x89\x5C\x24\x00\x48\x89\x74\x24\x00\x57\x48\x83\xEC\x20\x48\x8B\xF9\xE8\x00\x00\x00\x00\x33\xC9"), "xxxx?xxxx?xxxxxxxxx????xx");
|
2022-04-09 06:05:47 +02:00
|
|
|
inline auto CSourceAppSystemGroup__Create = p_CSourceAppSystemGroup__Create.RCast<bool(*)(CModAppSystemGroup* pModAppSystemGroup)>(); /*48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 20 48 8B F9 E8 ? ? ? ? 33 C9*/
|
2021-12-25 22:36:38 +01:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2022-02-19 16:42:40 +01:00
|
|
|
int HModAppSystemGroup_Main(CModAppSystemGroup* modAppSystemGroup);
|
|
|
|
bool HModAppSystemGroup_Create(CModAppSystemGroup* modAppSystemGroup);
|
2021-12-25 22:36:38 +01:00
|
|
|
|
|
|
|
void IApplication_Attach();
|
|
|
|
void IApplication_Detach();
|
|
|
|
|
2022-01-27 03:55:47 +01:00
|
|
|
inline bool g_bAppSystemInit = false;
|
|
|
|
|
2021-12-25 22:36:38 +01:00
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
class HApplication : public IDetour
|
|
|
|
{
|
|
|
|
virtual void debugp()
|
|
|
|
{
|
2022-02-19 16:42:40 +01:00
|
|
|
std::cout << "| FUN: CModAppSystemGroup::Main : 0x" << std::hex << std::uppercase << p_CModAppSystemGroup_Main.GetPtr() << std::setw(npad) << " |" << std::endl;
|
|
|
|
std::cout << "| FUN: CModAppSystemGroup::Create : 0x" << std::hex << std::uppercase << p_CModAppSystemGroup_Create.GetPtr() << std::setw(npad) << " |" << std::endl;
|
|
|
|
std::cout << "| FUN: CSourceAppSystemGroup::Create : 0x" << std::hex << std::uppercase << p_CSourceAppSystemGroup__Create.GetPtr() << std::setw(npad) << " |" << std::endl;
|
|
|
|
std::cout << "| FUN: CSourceAppSystemGroup::PreInit : 0x" << std::hex << std::uppercase << p_CSourceAppSystemGroup__PreInit.GetPtr() << std::setw(npad) << " |" << std::endl;
|
2021-12-25 22:36:38 +01:00
|
|
|
std::cout << "+----------------------------------------------------------------+" << std::endl;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
REGISTER(HApplication);
|