From 6c0d8072f94652b313a4e9bf9e47919162ffb7ae Mon Sep 17 00:00:00 2001 From: Sainan <63328889+Sainan@users.noreply.github.com> Date: Tue, 17 May 2022 15:56:17 +0200 Subject: [PATCH] Fix RCOE-Patch leaving the game in a dirty state after unload (#215) --- BigBaseV2/src/pointers.cpp | 8 +++++--- BigBaseV2/src/pointers.hpp | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/BigBaseV2/src/pointers.cpp b/BigBaseV2/src/pointers.cpp index cfa29ba3..862751ee 100644 --- a/BigBaseV2/src/pointers.cpp +++ b/BigBaseV2/src/pointers.cpp @@ -154,9 +154,7 @@ namespace big // Request Control of Entity PATCH main_batch.add("RCOE-Patch", "48 89 5C 24 ? 57 48 83 EC 20 8B D9 E8 ? ? ? ? ? ? ? ? 8B CB", [this](memory::handle ptr) { - PVOID spectator_check = ptr.add(0x11).as(); - - memset(spectator_check, 0x90, 0x4); + m_spectator_check = ptr.add(0x13).as(); }); // GET CNetGamePlayer @@ -255,11 +253,15 @@ namespace big if (!m_hwnd) throw std::runtime_error("Failed to find the game's window."); + *m_spectator_check = 0x9090; + g_pointers = this; } pointers::~pointers() { + *m_spectator_check = 0x6A75; + g_pointers = nullptr; } } diff --git a/BigBaseV2/src/pointers.hpp b/BigBaseV2/src/pointers.hpp index b5bd3365..9b8f3508 100644 --- a/BigBaseV2/src/pointers.hpp +++ b/BigBaseV2/src/pointers.hpp @@ -49,6 +49,7 @@ namespace big PVOID m_native_return; PVOID m_is_dlc_present; PVOID m_network_group_override; + PUSHORT m_spectator_check; FriendRegistry* m_friend_registry{};