feat(Dbg): disable GTA window hook (#1733)
This commit is contained in:
parent
152642cf1b
commit
7a00db1c46
@ -77,6 +77,9 @@ namespace big
|
|||||||
// Prevent the attribute task from failing
|
// Prevent the attribute task from failing
|
||||||
memory::byte_patch::make(g_pointers->m_sc.m_read_attribute_patch, std::vector{0x90, 0x90})->apply();
|
memory::byte_patch::make(g_pointers->m_sc.m_read_attribute_patch, std::vector{0x90, 0x90})->apply();
|
||||||
memory::byte_patch::make(g_pointers->m_sc.m_read_attribute_patch_2, std::vector{0xB0, 0x01})->apply();
|
memory::byte_patch::make(g_pointers->m_sc.m_read_attribute_patch_2, std::vector{0xB0, 0x01})->apply();
|
||||||
|
|
||||||
|
// window hook: pt1
|
||||||
|
memory::byte_patch::make(g_pointers->m_gta.m_window_hook.as<void*>(), std::to_array({0xC3, 0x90, 0x90, 0x90}))->apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
byte_patch_manager::byte_patch_manager()
|
byte_patch_manager::byte_patch_manager()
|
||||||
|
@ -45,6 +45,8 @@ namespace big
|
|||||||
|
|
||||||
memory::handle m_crash_trigger;
|
memory::handle m_crash_trigger;
|
||||||
|
|
||||||
|
memory::handle m_window_hook;
|
||||||
|
|
||||||
memory::handle m_script_vm_patch_1;
|
memory::handle m_script_vm_patch_1;
|
||||||
memory::handle m_script_vm_patch_2;
|
memory::handle m_script_vm_patch_2;
|
||||||
memory::handle m_script_vm_patch_3;
|
memory::handle m_script_vm_patch_3;
|
||||||
|
@ -131,6 +131,8 @@ namespace big
|
|||||||
{
|
{
|
||||||
m_swapchain_hook.enable();
|
m_swapchain_hook.enable();
|
||||||
m_og_wndproc = WNDPROC(SetWindowLongPtrW(g_pointers->m_hwnd, GWLP_WNDPROC, LONG_PTR(&hooks::wndproc)));
|
m_og_wndproc = WNDPROC(SetWindowLongPtrW(g_pointers->m_hwnd, GWLP_WNDPROC, LONG_PTR(&hooks::wndproc)));
|
||||||
|
// window hook: pt2
|
||||||
|
UnhookWindowsHookEx(*g_pointers->m_gta.m_window_hook.add(45).rip().as<HHOOK*>());
|
||||||
|
|
||||||
for (const auto& detour_hook_helper : m_detour_hook_helpers)
|
for (const auto& detour_hook_helper : m_detour_hook_helpers)
|
||||||
{
|
{
|
||||||
@ -151,6 +153,8 @@ namespace big
|
|||||||
detour_hook_helper->m_detour_hook->disable();
|
detour_hook_helper->m_detour_hook->disable();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// window hook: pt2
|
||||||
|
SetWindowsHookExA(13, g_pointers->m_gta.m_window_hook.add(18).rip().as<HOOKPROC>(), GetModuleHandleA("GTA5.exe"), 0);
|
||||||
SetWindowLongPtrW(g_pointers->m_hwnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(m_og_wndproc));
|
SetWindowLongPtrW(g_pointers->m_hwnd, GWLP_WNDPROC, reinterpret_cast<LONG_PTR>(m_og_wndproc));
|
||||||
m_swapchain_hook.disable();
|
m_swapchain_hook.disable();
|
||||||
|
|
||||||
|
@ -1372,6 +1372,15 @@ namespace big
|
|||||||
g_pointers->m_gta.m_get_title_caption_error_message_box = ptr.add(1).rip().as<functions::get_title_caption_error_message_box>();
|
g_pointers->m_gta.m_get_title_caption_error_message_box = ptr.add(1).rip().as<functions::get_title_caption_error_message_box>();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
// Disable Window Hook
|
||||||
|
{
|
||||||
|
"DT",
|
||||||
|
"48 83 EC 28 33 C9 FF 15 ? ? ? ? 45 33 C9",
|
||||||
|
[](memory::handle ptr)
|
||||||
|
{
|
||||||
|
g_pointers->m_gta.m_window_hook = ptr;
|
||||||
|
}
|
||||||
|
},
|
||||||
// Vehicle Metadata Manager.
|
// Vehicle Metadata Manager.
|
||||||
{
|
{
|
||||||
"VEHMMGR",
|
"VEHMMGR",
|
||||||
|
Reference in New Issue
Block a user