added autotranslated llmp

This commit is contained in:
Dominik Maier 2020-11-21 20:57:42 +01:00
parent db3215f6be
commit cf71410843
4 changed files with 13 additions and 5 deletions

View File

@ -18,3 +18,5 @@ xxhash-rust = { version = "0.8.0-beta.5", features = ["xxh3"] } # xxh3 hashing f
hashbrown = "0.9" # A faster hashmap, nostd compatible hashbrown = "0.9" # A faster hashmap, nostd compatible
libc = "0.2" # For (*nix) libc libc = "0.2" # For (*nix) libc
num = "*" num = "*"
#shared_memory = { version = "0.11.3", optional = true } # shared mem for windows and unix

View File

@ -168,9 +168,11 @@ where
/// Make sure to return a valid input instance loading it from disk if not in memory /// Make sure to return a valid input instance loading it from disk if not in memory
pub fn load_input(&mut self) -> Result<&I, AflError> { pub fn load_input(&mut self) -> Result<&I, AflError> {
if self.input.is_none() { if self.input.is_none() {
let input = I::from_file(self.filename.as_ref().ok_or(AflError::EmptyOptional( let input = I::from_file(
"filename not specified".into(), self.filename
))?)?; .as_ref()
.ok_or(AflError::EmptyOptional("filename not specified".into()))?,
)?;
self.input = Some(input); self.input = Some(input);
} }
Ok(self.input.as_ref().unwrap()) Ok(self.input.as_ref().unwrap())

View File

@ -199,7 +199,7 @@ where
fn fuzz_one(&mut self, state: &mut S) -> Result<usize, AflError> { fn fuzz_one(&mut self, state: &mut S) -> Result<usize, AflError> {
let (testcase, idx) = state.corpus_mut().next()?; let (testcase, idx) = state.corpus_mut().next()?;
#[cfg(feature = "std")] #[cfg(feature = "std")]
println!("Cur entry: {}\tExecutions: {}", idx, state.executions()); println!("Cur entry: {}\tExecutions: {}", idx, state.executions());
for stage in self.stages_mut() { for stage in self.stages_mut() {
stage.perform(testcase.clone(), state)?; stage.perform(testcase.clone(), state)?;

View File

@ -1,3 +1,7 @@
pub mod llmp;
mod llmp_translated;
pub use crate::events::llmp::LLMP;
use core::any::{Any, TypeId}; use core::any::{Any, TypeId};
use core::fmt::Display; use core::fmt::Display;
@ -80,7 +84,7 @@ impl EventManager for LoggerEventManager {
} }
fn fire<E: Event>(&mut self, _event: E) -> Result<(), AflError> { fn fire<E: Event>(&mut self, _event: E) -> Result<(), AflError> {
#[cfg(feature = "std")] #[cfg(feature = "std")]
println!("{}", _event); println!("{}", _event);
Ok(()) Ok(())
} }