Frida Windows: calling original UnhandledExceptionFilter in the hook (#832)

This commit is contained in:
expend20 2022-10-13 09:06:15 +02:00 committed by GitHub
parent 089bc49d55
commit bb3d6b3688
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 3 deletions

View File

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

View File

@ -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)
}
}