2022-02-19 02:31:16 +01:00
# pragma once
///////////////////////////////////////////////////////////////////////////////
2022-04-18 03:35:08 +02:00
inline CMemory SCR_BeginLoadingPlaque ;
2022-02-19 02:31:16 +01:00
///////////////////////////////////////////////////////////////////////////////
2022-04-18 03:35:08 +02:00
inline bool * scr_drawloading = nullptr ;
inline bool * scr_engineevent_loadingstarted = nullptr ;
2022-02-19 02:31:16 +01:00
void SCR_EndLoadingPlaque ( void ) ;
///////////////////////////////////////////////////////////////////////////////
2022-05-13 14:53:25 +02:00
class VGL_Screen : public IDetour
2022-02-19 02:31:16 +01:00
{
2022-04-11 01:44:30 +02:00
virtual void GetAdr ( void ) const
2022-02-19 02:31:16 +01:00
{
2023-01-25 02:26:52 +01:00
LogFunAdr ( " SCR_BeginLoadingPlaque " , SCR_BeginLoadingPlaque . GetPtr ( ) ) ;
LogVarAdr ( " scr_drawloading " , reinterpret_cast < uintptr_t > ( scr_drawloading ) ) ;
LogVarAdr ( " scr_engineevent_loadingstarted " , reinterpret_cast < uintptr_t > ( scr_engineevent_loadingstarted ) ) ;
2022-02-19 02:31:16 +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
SCR_BeginLoadingPlaque = g_GameDll . FindPatternSIMD ( " 48 89 5C 24 ?? 48 89 74 24 ?? 57 48 83 EC 30 0F 29 74 24 ?? 48 8B F9 " ) ;
2022-04-18 03:35:08 +02:00
// 0x14022A4A0 // 48 89 5C 24 ? 48 89 74 24 ? 57 48 83 EC 30 0F 29 74 24 ? 48 8B F9 //
# elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
2022-12-01 22:44:55 +01:00
SCR_BeginLoadingPlaque = g_GameDll . FindPatternSIMD ( " 48 83 EC 38 0F 29 74 24 ?? 48 89 5C 24 ?? " ) ;
2022-04-18 03:35:08 +02:00
// 0x14022A4A0 // 48 83 EC 38 0F 29 74 24 ? 48 89 5C 24 ? //
# endif
}
virtual void GetVar ( void ) const
{
2022-12-01 22:44:55 +01:00
scr_drawloading = g_GameDll . FindPatternSIMD ( " 0F B6 05 ?? ?? ?? ?? C3 CC CC CC CC CC CC CC CC 48 83 EC 28 " ) . ResolveRelativeAddressSelf ( 0x3 , 0x7 ) . RCast < bool * > ( ) ;
2022-04-18 03:35:08 +02:00
# if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
2022-04-19 00:00:45 +02:00
scr_engineevent_loadingstarted = SCR_BeginLoadingPlaque . Offset ( 0x130 ) . FindPatternSelf ( " C6 05 ?? ?? ?? ?? 01 " , CMemory : : Direction : : DOWN ) . ResolveRelativeAddress ( 0x2 , 0x7 ) . RCast < bool * > ( ) ;
2022-04-18 03:35:08 +02:00
# elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
scr_engineevent_loadingstarted = SCR_BeginLoadingPlaque . Offset ( 0x60 ) . FindPatternSelf ( " C6 05 ?? ?? ?? ?? 01 " , CMemory : : Direction : : DOWN ) . ResolveRelativeAddress ( 0x2 , 0x7 ) . RCast < bool * > ( ) ;
# 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-02-19 02:31:16 +01:00
} ;
///////////////////////////////////////////////////////////////////////////////