r5sdk/r5dev/tier0/platform_internal.h

36 lines
1.7 KiB
C
Raw Normal View History

#ifndef PLATFORM_INTERNAL_H
#define PLATFORM_INTERNAL_H
inline CMemory p_Plat_FloatTime;
inline auto v_Plat_FloatTime = p_Plat_FloatTime.RCast<double(*)(void)>();
inline CMemory p_Plat_MSTime;
inline auto v_Plat_MSTime = p_Plat_MSTime.RCast<uint64_t(*)(void)>();
///////////////////////////////////////////////////////////////////////////////
class VPlatform : public IDetour
{
virtual void GetAdr(void) const
{
spdlog::debug("| FUN: Plat_FloatTime : {:#18x} |\n", p_Plat_FloatTime.GetPtr());
spdlog::debug("| FUN: Plat_MSTime : {:#18x} |\n", p_Plat_MSTime.GetPtr());
spdlog::debug("+----------------------------------------------------------------+\n");
}
virtual void GetFun(void) const
{
p_Plat_FloatTime = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x28\x80\x3D\x00\x00\x00\x00\x00\x75\x05\xE8\x00\x00\x00\x00\x80\x3D\x00\x00\x00\x00\x00\x74\x1D"), "xxxxxx?????xxx????xx?????xx");
p_Plat_MSTime = g_mGameDll.FindPatternSIMD(reinterpret_cast<rsig_t>("\x48\x83\xEC\x28\x80\x3D\x00\x00\x00\x00\x00\x75\x05\xE8\x00\x00\x00\x00\x80\x3D\x00\x00\x00\x00\x00\x74\x2A"), "xxxxxx?????xxx????xx?????xx");
v_Plat_FloatTime = p_Plat_FloatTime.RCast<double(*)(void)>(); /*48 83 EC 28 80 3D ? ? ? ? ? 75 05 E8 ? ? ? ? 80 3D ? ? ? ? ? 74 1D*/
v_Plat_MSTime = p_Plat_MSTime.RCast<uint64_t(*)(void)>(); /*48 83 EC 28 80 3D ? ? ? ? ? 75 05 E8 ? ? ? ? 80 3D ? ? ? ? ? 74 2A*/
}
virtual void GetVar(void) const { }
virtual void GetCon(void) const { }
virtual void Attach(void) const { }
virtual void Detach(void) const { }
};
///////////////////////////////////////////////////////////////////////////////
REGISTER(VPlatform);
#endif /* PLATFORM_INTERNAL_H */