2021-12-25 22:36:38 +01:00
|
|
|
#pragma once
|
2022-02-19 02:31:16 +01:00
|
|
|
#include "engine/common.h"
|
2021-12-25 22:36:38 +01:00
|
|
|
|
2022-04-09 02:18:57 +02:00
|
|
|
/* ==== UTILITY ========================================================================================================================================================= */
|
2022-04-18 03:35:08 +02:00
|
|
|
inline CMemory p_Sys_Error_Internal;
|
|
|
|
inline auto Sys_Error_Internal = p_Sys_Error_Internal.RCast<int (*)(char* fmt, va_list args)>();
|
2022-02-19 02:31:16 +01:00
|
|
|
|
2022-04-18 03:35:08 +02:00
|
|
|
inline bool* gfExtendedError = nullptr;
|
2021-12-25 22:36:38 +01:00
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
int HSys_Error_Internal(char* fmt, va_list args);
|
|
|
|
|
|
|
|
void SysDll_Attach();
|
|
|
|
void SysDll_Detach();
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
2022-05-13 14:53:25 +02:00
|
|
|
class VSys_Dll : 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
|
|
|
{
|
2022-05-13 14:53:25 +02:00
|
|
|
spdlog::debug("| FUN: Sys_Error_Internal : {:#18x} |\n", p_Sys_Error_Internal.GetPtr());
|
|
|
|
spdlog::debug("| VAR: gfExtendedError : {:#18x} |\n", reinterpret_cast<uintptr_t>(gfExtendedError));
|
|
|
|
spdlog::debug("+----------------------------------------------------------------+\n");
|
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_Sys_Error_Internal = g_GameDll.FindPatternSIMD("48 89 5C 24 08 48 89 74 24 10 57 48 81 EC 30 08 ?? ?? 48 8B DA 48 8B F9 E8 ?? ?? ?? FF 33 F6 48");
|
2022-04-18 03:35:08 +02:00
|
|
|
Sys_Error_Internal = p_Sys_Error_Internal.RCast<int (*)(char*, va_list)>(); /*48 89 5C 24 08 48 89 74 24 10 57 48 81 EC 30 08 00 00 48 8B DA 48 8B F9 E8 ?? ?? ?? FF 33 F6 48*/
|
|
|
|
}
|
|
|
|
virtual void GetVar(void) const
|
|
|
|
{
|
|
|
|
gfExtendedError = p_COM_ExplainDisconnection.Offset(0x0).FindPatternSelf("C6 05", CMemory::Direction::DOWN, 300).ResolveRelativeAddressSelf(0x2, 0x7).RCast<bool*>();
|
|
|
|
}
|
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
|
|
|
};
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2022-05-13 14:53:25 +02:00
|
|
|
REGISTER(VSys_Dll);
|