Fix RCOE-Patch leaving the game in a dirty state after unload (#215)

This commit is contained in:
Sainan 2022-05-17 15:56:17 +02:00 committed by GitHub
parent 1ae2628ee3
commit 6c0d8072f9
2 changed files with 6 additions and 3 deletions

View File

@ -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<PVOID>();
memset(spectator_check, 0x90, 0x4);
m_spectator_check = ptr.add(0x13).as<PUSHORT>();
});
// 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;
}
}

View File

@ -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{};