2022-02-19 16:42:40 +01:00
|
|
|
#pragma once
|
|
|
|
|
2022-04-09 02:18:57 +02:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
// CGAME
|
|
|
|
//-------------------------------------------------------------------------
|
2022-04-18 03:35:08 +02:00
|
|
|
inline CMemory p_CVideoMode_Common__CreateGameWindow;
|
2023-07-02 23:01:29 +02:00
|
|
|
inline bool(*CVideoMode_Common__CreateGameWindow)(int* pnRect);
|
2022-04-17 02:00:06 +02:00
|
|
|
|
2022-04-18 03:35:08 +02:00
|
|
|
inline CMemory p_CVideoMode_Common__CreateWindowClass;
|
2023-07-02 23:01:29 +02:00
|
|
|
inline HWND(*CVideoMode_Common__CreateWindowClass)(vrect_t* pnRect);
|
2022-02-19 16:42:40 +01:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
class HVideoMode_Common : public IDetour
|
|
|
|
{
|
2022-04-11 01:44:30 +02:00
|
|
|
virtual void GetAdr(void) const
|
2022-02-19 16:42:40 +01:00
|
|
|
{
|
2023-01-25 02:26:52 +01:00
|
|
|
LogFunAdr("CVideoMode_Common::CreateGameWindow", p_CVideoMode_Common__CreateGameWindow.GetPtr());
|
|
|
|
LogFunAdr("CVideoMode_Common::CreateWindowClass", p_CVideoMode_Common__CreateWindowClass.GetPtr());
|
2022-02-19 16:42:40 +01:00
|
|
|
}
|
2022-04-18 03:35:08 +02:00
|
|
|
virtual void GetFun(void) const
|
|
|
|
{
|
|
|
|
#if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
|
2022-12-01 22:44:55 +01:00
|
|
|
p_CVideoMode_Common__CreateGameWindow = g_GameDll.FindPatternSIMD("40 56 57 48 83 EC 38 48 8B F9 E8 ?? ?? ?? ??");
|
|
|
|
p_CVideoMode_Common__CreateWindowClass = g_GameDll.FindPatternSIMD("40 55 53 57 41 56 48 8D AC 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 4C 8B F1");
|
2022-04-18 03:35:08 +02:00
|
|
|
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
2022-12-01 22:44:55 +01:00
|
|
|
p_CVideoMode_Common__CreateGameWindow = g_GameDll.FindPatternSIMD("40 56 57 48 83 EC 28 48 8B F9 E8 ?? ?? ?? ?? 48 8B F0");
|
|
|
|
p_CVideoMode_Common__CreateWindowClass = g_GameDll.FindPatternSIMD("40 55 53 57 48 8D AC 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 8B F9 FF 15 ?? ?? ?? ??");
|
2022-04-18 03:35:08 +02:00
|
|
|
#endif
|
|
|
|
CVideoMode_Common__CreateGameWindow = p_CVideoMode_Common__CreateGameWindow.RCast<bool (*)(int*)>(); /*40 56 57 48 83 EC 28 48 8B F9 E8 ?? ?? ?? ?? 48 8B F0*/
|
|
|
|
CVideoMode_Common__CreateWindowClass = p_CVideoMode_Common__CreateWindowClass.RCast<HWND(*)(vrect_t*)>(); /*40 55 53 57 48 8D AC 24 ?? ?? ?? ?? 48 81 EC ?? ?? ?? ?? 48 8B F9 FF 15 ?? ?? ?? ??*/
|
|
|
|
}
|
2022-04-11 01:44:30 +02:00
|
|
|
virtual void GetVar(void) const { }
|
|
|
|
virtual void GetCon(void) const { }
|
2023-11-26 13:21:20 +01:00
|
|
|
virtual void Detour(const bool bAttach) const;
|
2022-02-19 16:42:40 +01:00
|
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|