2022-02-19 02:31:16 +01:00
|
|
|
#pragma once
|
2022-05-20 11:52:19 +02:00
|
|
|
#include <engine/server/sv_main.h>
|
2022-06-12 17:50:12 +02:00
|
|
|
#include <vguimatsurface/MatSystemSurface.h>
|
2022-02-19 02:31:16 +01:00
|
|
|
|
|
|
|
enum class PaintMode_t
|
|
|
|
{
|
|
|
|
PAINT_UIPANELS = (1 << 0),
|
|
|
|
PAINT_INGAMEPANELS = (1 << 1),
|
|
|
|
};
|
|
|
|
|
2022-04-18 03:35:08 +02:00
|
|
|
class CEngineVGui
|
|
|
|
{
|
|
|
|
public:
|
2022-06-12 17:50:12 +02:00
|
|
|
static int Paint(CEngineVGui* thisptr, PaintMode_t mode);
|
2022-04-18 03:35:08 +02:00
|
|
|
void EnabledProgressBarForNextLoad(void)
|
|
|
|
{
|
|
|
|
int index = 31;
|
|
|
|
CallVFunc<void>(index, this);
|
|
|
|
}
|
|
|
|
void ShowErrorMessage(void)
|
|
|
|
{
|
|
|
|
int index = 35;
|
|
|
|
CallVFunc<void>(index, this);
|
|
|
|
}
|
|
|
|
void HideLoadingPlaque(void)
|
|
|
|
{
|
|
|
|
int index = 36;
|
|
|
|
CallVFunc<void>(index, this);
|
|
|
|
}
|
|
|
|
};
|
2022-02-19 02:31:16 +01:00
|
|
|
|
2022-04-18 03:35:08 +02:00
|
|
|
/* ==== CENGINEVGUI ===================================================================================================================================================== */
|
|
|
|
inline CMemory p_CEngineVGui_Paint;
|
2022-06-12 17:50:12 +02:00
|
|
|
inline auto CEngineVGui_Paint = p_CEngineVGui_Paint.RCast<int (*)(CEngineVGui* thisptr, PaintMode_t mode)>();
|
2022-04-09 06:05:47 +02:00
|
|
|
|
2022-06-12 17:50:12 +02:00
|
|
|
inline CMemory p_CEngineVGui_RenderStart;
|
|
|
|
inline auto CEngineVGui_RenderStart = p_CEngineVGui_RenderStart.RCast<void* (*)(CMatSystemSurface* pMatSystemSurface)>();
|
|
|
|
|
|
|
|
inline CMemory p_CEngineVGui_RenderEnd;
|
|
|
|
inline auto CEngineVGui_RenderEnd = p_CEngineVGui_RenderEnd.RCast<void* (*)(void)>();
|
2022-04-18 03:35:08 +02:00
|
|
|
|
|
|
|
inline CEngineVGui* g_pEngineVGui = nullptr;
|
2022-02-19 02:31:16 +01:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2022-05-13 14:53:25 +02:00
|
|
|
class VEngineVGui : 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("CEngineVGui::Paint", p_CEngineVGui_Paint.GetPtr());
|
|
|
|
LogFunAdr("CEngineVGui::RenderStart", p_CEngineVGui_RenderStart.GetPtr());
|
|
|
|
LogFunAdr("CEngineVGui::RenderEnd", p_CEngineVGui_RenderEnd.GetPtr());
|
|
|
|
LogVarAdr("g_pEngineVGui", reinterpret_cast<uintptr_t>(g_pEngineVGui));
|
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
|
|
|
p_CEngineVGui_Paint = g_GameDll.FindPatternSIMD("89 54 24 10 55 56 41 55 48 81 EC ?? ?? ?? ??");
|
2022-06-12 17:50:12 +02:00
|
|
|
CEngineVGui_Paint = p_CEngineVGui_Paint.RCast<int (*)(CEngineVGui* thisptr, PaintMode_t mode)>(); /*41 55 41 56 48 83 EC 78 44 8B EA*/
|
2022-04-18 03:35:08 +02:00
|
|
|
|
2022-12-01 22:44:55 +01:00
|
|
|
p_CEngineVGui_RenderStart = g_GameDll.FindPatternSIMD("48 8B C4 53 56 57 48 81 EC ?? ?? ?? ?? 0F 29 70 D8");
|
2022-06-12 17:50:12 +02:00
|
|
|
CEngineVGui_RenderStart = p_CEngineVGui_RenderStart.RCast<void* (*)(CMatSystemSurface*)>(); /*48 8B C4 53 56 57 48 81 EC ?? ?? ?? ?? 0F 29 70 D8*/
|
2022-04-18 03:35:08 +02:00
|
|
|
#elif defined (GAMEDLL_S2) || defined (GAMEDLL_S3)
|
2022-12-01 22:44:55 +01:00
|
|
|
p_CEngineVGui_Paint = g_GameDll.FindPatternSIMD("41 55 41 56 48 83 EC 78 44 8B EA");
|
2022-06-12 17:50:12 +02:00
|
|
|
CEngineVGui_Paint = p_CEngineVGui_Paint.RCast<int (*)(CEngineVGui* thisptr, PaintMode_t mode)>(); /*41 55 41 56 48 83 EC 78 44 8B EA*/
|
2022-04-18 03:35:08 +02:00
|
|
|
|
2022-12-01 22:44:55 +01:00
|
|
|
p_CEngineVGui_RenderStart = g_GameDll.FindPatternSIMD("40 53 57 48 81 EC ?? ?? ?? ?? 48 8B F9");
|
2022-06-12 17:50:12 +02:00
|
|
|
CEngineVGui_RenderStart = p_CEngineVGui_RenderStart.RCast<void* (*)(CMatSystemSurface*)>(); /*40 53 57 48 81 EC ?? ?? ?? ?? 48 8B F9*/
|
2022-04-18 03:35:08 +02:00
|
|
|
#endif
|
2022-12-01 22:44:55 +01:00
|
|
|
p_CEngineVGui_RenderEnd = g_GameDll.FindPatternSIMD("40 53 48 83 EC 20 48 8B 0D ?? ?? ?? ?? C6 05 ?? ?? ?? ?? ?? 48 8B 01");
|
2022-06-12 17:50:12 +02:00
|
|
|
CEngineVGui_RenderEnd = p_CEngineVGui_RenderEnd.RCast<void* (*)(void)>(); /*40 53 48 83 EC 20 48 8B 0D ?? ?? ?? ?? C6 05 ?? ?? ?? ?? ?? 48 8B 01*/
|
2022-04-18 03:35:08 +02:00
|
|
|
}
|
|
|
|
virtual void GetVar(void) const
|
|
|
|
{
|
2022-12-01 22:44:55 +01:00
|
|
|
g_pEngineVGui = g_GameDll.FindPatternSIMD("48 8B C4 48 89 48 08 48 89 50 10 4C 89 40 18 4C 89 48 20 53 57 48 81 EC ?? ?? ?? ?? 48 8B D9 48 8D 78 10 E8 ?? ?? ?? ?? 48 89 7C 24 ?? 48 8D 54 24 ?? 33 FF 4C 8B CB 41 B8 ?? ?? ?? ?? 48 89 7C 24 ?? 48 8B 08 48 83 C9 01 E8 ?? ?? ?? ?? 85 C0 48 8D 54 24 ??")
|
|
|
|
.FindPatternSelf("48 8D ?? ?? ?? ?? 01", CMemory::Direction::DOWN, 150).ResolveRelativeAddressSelf(0x3, 0x7).RCast<CEngineVGui*>();
|
2022-04-18 03:35:08 +02:00
|
|
|
}
|
2022-04-11 01:44:30 +02:00
|
|
|
virtual void GetCon(void) const { }
|
2023-01-25 02:26:52 +01:00
|
|
|
virtual void Attach(void) const;
|
|
|
|
virtual void Detach(void) const;
|
2022-02-19 02:31:16 +01:00
|
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|