mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
Utilize the new IDetour::DetourSetup() code, IDetour::Attach and IDetour::Detach have been removed in favor of this (significantly reduces chance of user error). Since the template check happens in the idetour header, it is much more aggressive on type mismatches, such as a difference in parameter types, between the function and detour, will now raise a compile time error. As a result, some type mismatches have been fixed in this commit as well.
24 lines
1011 B
C++
24 lines
1011 B
C++
#pragma once
|
|
|
|
/* ==== PRX ============================================================================================================================================================= */
|
|
inline CMemory p_exit_or_terminate_process;
|
|
inline void(*v_exit_or_terminate_process)(UINT uExitCode);
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
class VPRX : public IDetour
|
|
{
|
|
virtual void GetAdr(void) const
|
|
{
|
|
LogFunAdr("exit_or_terminate_process", p_exit_or_terminate_process.GetPtr());
|
|
}
|
|
virtual void GetFun(void) const
|
|
{
|
|
p_exit_or_terminate_process = g_GameDll.FindPatternSIMD("40 53 48 83 EC 20 8B D9 E8 ?? ?? ?? ?? 84 C0");
|
|
v_exit_or_terminate_process = p_exit_or_terminate_process.RCast<void(*)(UINT uExitCode)>(); /*40 53 48 83 EC 20 8B D9 E8 ? ? ? ? 84 C0 */
|
|
}
|
|
virtual void GetVar(void) const { }
|
|
virtual void GetCon(void) const { }
|
|
virtual void Detour(const bool bAttach) const;
|
|
};
|
|
///////////////////////////////////////////////////////////////////////////////
|