Frida Windows: calling original UnhandledExceptionFilter in the hook (#832)
This commit is contained in:
parent
089bc49d55
commit
bb3d6b3688
@ -14,7 +14,9 @@ use num_enum::TryFromPrimitive;
|
|||||||
pub use windows::Win32::{
|
pub use windows::Win32::{
|
||||||
Foundation::NTSTATUS,
|
Foundation::NTSTATUS,
|
||||||
System::{
|
System::{
|
||||||
Diagnostics::Debug::{AddVectoredExceptionHandler, EXCEPTION_POINTERS},
|
Diagnostics::Debug::{
|
||||||
|
AddVectoredExceptionHandler, UnhandledExceptionFilter, EXCEPTION_POINTERS,
|
||||||
|
},
|
||||||
Threading::{IsProcessorFeaturePresent, PROCESSOR_FEATURE_ID},
|
Threading::{IsProcessorFeaturePresent, PROCESSOR_FEATURE_ID},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -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
|
// 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 frida_gum::{interceptor::Interceptor, Gum, Module, NativePointer};
|
||||||
use libafl::bolts::os::windows_exceptions::{
|
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
|
/// Initialize the hooks
|
||||||
@ -50,6 +51,6 @@ pub fn initialize(gum: &Gum) {
|
|||||||
exception_pointers: *mut EXCEPTION_POINTERS,
|
exception_pointers: *mut EXCEPTION_POINTERS,
|
||||||
) -> i32 {
|
) -> i32 {
|
||||||
handle_exception(exception_pointers);
|
handle_exception(exception_pointers);
|
||||||
unreachable!("handle_exception should not return");
|
UnhandledExceptionFilter(exception_pointers)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user