From fd64556462f32f0287636ee1ce2419a03fbf9cee Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Thu, 30 Jun 2022 20:20:32 +0200 Subject: [PATCH] Find pattern instead of using offsets --- r5dev/common/netmessages.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/r5dev/common/netmessages.h b/r5dev/common/netmessages.h index f7f6edfa..3943f88f 100644 --- a/r5dev/common/netmessages.h +++ b/r5dev/common/netmessages.h @@ -81,9 +81,9 @@ class HMM_Heartbeat : public IDetour virtual void GetVar(void) const { // We get the actual address of the vtable here, not the class instance. - g_pSVC_Print_VTable = g_mGameDll.FindPatternSIMD(reinterpret_cast("\x74\x1E\x48\x8D\x05\x00\x00\x00\x00\x89\x5F\x08"), "xxxxx????xxx").OffsetSelf(0x2).ResolveRelativeAddressSelf(0x3, 0x7); + g_pSVC_Print_VTable = g_mGameDll.FindPatternSIMD(reinterpret_cast("\x74\x1E\x48\x8D\x05\x00\x00\x00\x00\x89\x5F\x08"), "xxxxx????xxx").FindPatternSelf("48 8D").ResolveRelativeAddressSelf(0x3, 0x7); // 74 1E 48 8D 05 ? ? ? ? 89 5F 08 - g_pSVC_UserMessage_VTable = g_mGameDll.FindPatternSIMD(reinterpret_cast("\xE8\x00\x00\x00\x00\x48\x85\xFF\x74\x65"), "x????xxxxx").OffsetSelf(0xD).ResolveRelativeAddressSelf(0x3, 0x7); + g_pSVC_UserMessage_VTable = g_mGameDll.FindPatternSIMD(reinterpret_cast("\xE8\x00\x00\x00\x00\x48\x85\xFF\x74\x65"), "x????xxxxx").FindPatternSelf("48 8D").ResolveRelativeAddressSelf(0x3, 0x7); // E8 ? ? ? ? 48 85 FF 74 65 } virtual void GetCon(void) const { }