diff --git a/libafl/src/bolts/os/windows_exceptions.rs b/libafl/src/bolts/os/windows_exceptions.rs index 170ef1a541..7e722642df 100644 --- a/libafl/src/bolts/os/windows_exceptions.rs +++ b/libafl/src/bolts/os/windows_exceptions.rs @@ -14,7 +14,9 @@ use num_enum::TryFromPrimitive; pub use windows::Win32::{ Foundation::NTSTATUS, System::{ - Diagnostics::Debug::{AddVectoredExceptionHandler, EXCEPTION_POINTERS}, + Diagnostics::Debug::{ + AddVectoredExceptionHandler, UnhandledExceptionFilter, EXCEPTION_POINTERS, + }, Threading::{IsProcessorFeaturePresent, PROCESSOR_FEATURE_ID}, }, }; diff --git a/libafl_frida/src/windows_hooks.rs b/libafl_frida/src/windows_hooks.rs index 06bae64a6e..61bdfad230 100644 --- a/libafl_frida/src/windows_hooks.rs +++ b/libafl_frida/src/windows_hooks.rs @@ -1,7 +1,8 @@ // Based on the example of setting hooks: Https://github.com/frida/frida-rust/blob/main/examples/gum/hook_open/src/lib.rs use frida_gum::{interceptor::Interceptor, Gum, Module, NativePointer}; use libafl::bolts::os::windows_exceptions::{ - handle_exception, IsProcessorFeaturePresent, EXCEPTION_POINTERS, PROCESSOR_FEATURE_ID, + handle_exception, IsProcessorFeaturePresent, UnhandledExceptionFilter, EXCEPTION_POINTERS, + PROCESSOR_FEATURE_ID, }; /// Initialize the hooks @@ -50,6 +51,6 @@ pub fn initialize(gum: &Gum) { exception_pointers: *mut EXCEPTION_POINTERS, ) -> i32 { handle_exception(exception_pointers); - unreachable!("handle_exception should not return"); + UnhandledExceptionFilter(exception_pointers) } }