2021-12-25 22:36:38 +01:00
# pragma once
2022-04-09 02:18:57 +02:00
/* ==== CMATSYSTEMSURFACE =============================================================================================================================================== */
2022-04-18 03:35:08 +02:00
inline CMemory p_CMatSystemSurface_DrawColoredText ;
2022-07-03 11:33:42 +02:00
inline auto CMatSystemSurface_DrawColoredText = p_CMatSystemSurface_DrawColoredText . RCast < void * ( * ) ( void * thisptr , short font , int fontHeight , int offsetX , int offsetY , int red , int green , int blue , int alpha , const char * text , . . . ) > ( ) ;
2022-01-05 22:56:49 +01:00
2022-06-12 17:50:12 +02:00
class CMatSystemSurface
{
} ;
inline CMatSystemSurface * g_pMatSystemSurface ;
2022-11-10 15:34:41 +01:00
inline CMatSystemSurface * g_pVGuiSurface ;
2022-01-05 22:56:49 +01:00
2021-12-25 22:36:38 +01:00
///////////////////////////////////////////////////////////////////////////////
2022-05-13 14:53:25 +02:00
class VMatSystemSurface : public IDetour
2021-12-25 22:36:38 +01:00
{
2022-04-11 01:44:30 +02:00
virtual void GetAdr ( void ) const
2021-12-25 22:36:38 +01:00
{
2023-01-25 02:26:52 +01:00
LogFunAdr ( " CMatSystemSurface::DrawColoredText " , p_CMatSystemSurface_DrawColoredText . GetPtr ( ) ) ;
LogVarAdr ( " g_pMatSystemSurface " , reinterpret_cast < uintptr_t > ( g_pMatSystemSurface ) ) ;
LogVarAdr ( " g_pVGuiSurface " , reinterpret_cast < uintptr_t > ( g_pVGuiSurface ) ) ;
2021-12-25 22:36:38 +01:00
}
2022-04-18 03:35:08 +02:00
virtual void GetFun ( void ) const
{
2022-12-01 22:44:55 +01:00
p_CMatSystemSurface_DrawColoredText = g_GameDll . FindPatternSIMD ( " 4C 8B DC 48 83 EC 68 49 8D 43 58 0F 57 C0 " ) ;
2022-07-03 11:33:42 +02:00
CMatSystemSurface_DrawColoredText = p_CMatSystemSurface_DrawColoredText . RCast < void * ( * ) ( void * , short , int , int , int , int , int , int , int , const char * , . . . ) > ( ) ; /*4C 8B DC 48 83 EC 68 49 8D 43 58 0F 57 C0*/
2022-04-18 03:35:08 +02:00
}
virtual void GetVar ( void ) const
{
# if defined (GAMEDLL_S0) || defined (GAMEDLL_S1)
2022-12-01 22:44:55 +01:00
g_pMatSystemSurface = g_GameDll . FindPatternSIMD ( " 48 83 3D ?? ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? 48 89 05 ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? 48 89 05 ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? 48 89 05 ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? 48 89 05 ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? 48 89 05 ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? 48 89 05 ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? 48 89 05 ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? 48 89 05 ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? " )
. ResolveRelativeAddressSelf ( 0x3 , 0x8 ) . RCast < CMatSystemSurface * > ( ) ;
2022-04-18 03:35:08 +02:00
# elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
2022-12-01 22:44:55 +01:00
g_pMatSystemSurface = g_GameDll . FindPatternSIMD ( " 48 83 EC 28 48 83 3D ?? ?? ?? ?? ?? 48 8D 05 ?? ?? ?? ?? " )
2022-06-12 17:50:12 +02:00
. FindPatternSelf ( " 48 83 3D " , CMemory : : Direction : : DOWN , 40 ) . ResolveRelativeAddressSelf ( 0x3 , 0x8 ) . RCast < CMatSystemSurface * > ( ) ;
2022-04-18 03:35:08 +02:00
# endif
2022-12-01 22:44:55 +01:00
g_pVGuiSurface = g_GameDll . FindPatternSIMD ( " 48 8B 05 ?? ?? ?? ?? C3 CC CC CC CC CC CC CC CC 48 8B 05 ?? ?? ?? ?? C3 CC CC CC CC CC CC CC CC 8B 81 ?? ?? ?? ?? " )
2022-06-12 17:50:12 +02:00
. ResolveRelativeAddressSelf ( 0x3 , 0x7 ) . RCast < CMatSystemSurface * > ( ) ;
2022-04-18 03:35:08 +02:00
}
2022-04-11 01:44:30 +02:00
virtual void GetCon ( void ) const { }
virtual void Attach ( void ) const { }
virtual void Detach ( void ) const { }
2021-12-25 22:36:38 +01:00
} ;
///////////////////////////////////////////////////////////////////////////////