Merge branch 'windows' of github.com:AFLplusplus/LibAFL into windows

This commit is contained in:
Andrea Fioraldi 2021-03-19 03:44:18 -07:00
commit 6840016f7d
4 changed files with 23 additions and 20 deletions

View File

@ -1,9 +1,6 @@
pub use crate::bolts::bindings::windows::win32::debug::EXCEPTION_POINTERS; pub use crate::bolts::bindings::windows::win32::debug::EXCEPTION_POINTERS;
use crate::{ use crate::{bolts::bindings::windows::win32::debug::SetUnhandledExceptionFilter, Error};
bolts::bindings::windows::win32::debug::{SetUnhandledExceptionFilter},
Error,
};
use alloc::vec::Vec; use alloc::vec::Vec;
use core::{ use core::{

View File

@ -455,7 +455,7 @@ pub mod shmem {
Error, Error,
}; };
use core::{ptr, slice, ffi::c_void}; use core::{ffi::c_void, ptr, slice};
use uuid::Uuid; use uuid::Uuid;
const INVALID_HANDLE_VALUE: isize = -1; const INVALID_HANDLE_VALUE: isize = -1;

View File

@ -2,10 +2,10 @@
//! It should usually be paired with extra error-handling, such as a restarting event manager, to be effective. //! It should usually be paired with extra error-handling, such as a restarting event manager, to be effective.
use core::{ use core::{
ffi::c_void,
marker::PhantomData,
ptr::{self, write_volatile}, ptr::{self, write_volatile},
sync::atomic::{compiler_fence, Ordering}, sync::atomic::{compiler_fence, Ordering},
ffi::c_void,
marker::PhantomData
}; };
#[cfg(unix)] #[cfg(unix)]
@ -124,7 +124,6 @@ where
} }
Ok(()) Ok(())
} }
} }
impl<I, OT> Named for InProcessExecutor<I, OT> impl<I, OT> Named for InProcessExecutor<I, OT>
@ -466,16 +465,16 @@ mod unix_signal_handler {
#[cfg(windows)] #[cfg(windows)]
mod windows_exception_handler { mod windows_exception_handler {
use alloc::vec::Vec; use alloc::vec::Vec;
use core::{ptr, ffi::c_void}; use core::{ffi::c_void, ptr};
#[cfg(feature = "std")] #[cfg(feature = "std")]
use std::{ use std::io::{stdout, Write};
io::{stdout, Write},
};
use crate::{ use crate::{
bolts::{ bolts::{
os::windows_exceptions::{Handler, ExceptionCode, EXCEPTION_POINTERS, CRASH_EXCEPTIONS}, bindings::windows::win32::system_services::ExitProcess,
bindings::windows::win32::system_services::ExitProcess os::windows_exceptions::{
ExceptionCode, Handler, CRASH_EXCEPTIONS, EXCEPTION_POINTERS,
},
}, },
corpus::{Corpus, Testcase}, corpus::{Corpus, Testcase},
events::{Event, EventManager}, events::{Event, EventManager},
@ -517,7 +516,7 @@ mod windows_exception_handler {
unsafe fn nop_handler( unsafe fn nop_handler(
_code: ExceptionCode, _code: ExceptionCode,
_exception_pointers: *mut EXCEPTION_POINTERS, _exception_pointers: *mut EXCEPTION_POINTERS,
_data: &mut InProcessExecutorHandlerData _data: &mut InProcessExecutorHandlerData,
) { ) {
} }
@ -598,8 +597,10 @@ mod windows_exception_handler {
let crash_addr = exception_pointers let crash_addr = exception_pointers
.as_mut() .as_mut()
.unwrap() .unwrap()
.exception_record.as_mut() .exception_record
.unwrap().exception_address as usize; .as_mut()
.unwrap()
.exception_address as usize;
println!( println!(
"We crashed at addr 0x{:x}, but are not in the target... Bug in the fuzzer? Exiting.", "We crashed at addr 0x{:x}, but are not in the target... Bug in the fuzzer? Exiting.",

View File

@ -96,7 +96,12 @@ where
/// Called right after execution finished. /// Called right after execution finished.
#[inline] #[inline]
fn post_exec<EM, S>(&mut self, _state: &mut S, _event_mgr: &mut EM, _input: &I) -> Result<(), Error> fn post_exec<EM, S>(
&mut self,
_state: &mut S,
_event_mgr: &mut EM,
_input: &I,
) -> Result<(), Error>
where where
EM: EventManager<I, S>, EM: EventManager<I, S>,
{ {