From 59f8da56da15d2a21973f05a4cdd77283b81cd76 Mon Sep 17 00:00:00 2001 From: FunkyFr3sh Date: Fri, 4 Aug 2023 08:41:14 +0200 Subject: [PATCH] fix hook_exit --- src/hook.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/hook.c b/src/hook.c index f090bb0..474ee52 100644 --- a/src/hook.c +++ b/src/hook.c @@ -559,16 +559,16 @@ void hook_exit() g_hook_active = FALSE; hook_revert((HOOKLIST*)&g_hooks); - } #if defined(_DEBUG) && defined(_MSC_VER) - DetourTransactionBegin(); - DetourUpdateThread(GetCurrentThread()); - DetourDetach((PVOID*)&real_SetUnhandledExceptionFilter, (PVOID)fake_SetUnhandledExceptionFilter); - DetourTransactionCommit(); + DetourTransactionBegin(); + DetourUpdateThread(GetCurrentThread()); + DetourDetach((PVOID*)&real_SetUnhandledExceptionFilter, (PVOID)fake_SetUnhandledExceptionFilter); + DetourTransactionCommit(); - real_SetUnhandledExceptionFilter(g_dbg_exception_filter); + real_SetUnhandledExceptionFilter(g_dbg_exception_filter); #endif - hook_patch_iat(GetModuleHandle("AcGenral"), TRUE, "user32.dll", "SetWindowsHookExA", (PROC)fake_SetWindowsHookExA); + hook_patch_iat(GetModuleHandle("AcGenral"), TRUE, "user32.dll", "SetWindowsHookExA", (PROC)fake_SetWindowsHookExA); + } }