windows crate
This commit is contained in:
parent
6b936826a8
commit
97ad4e92f9
@ -86,7 +86,7 @@ fn fuzz(input: Option<Vec<PathBuf>>, broker_port: u16) -> Result<(), Error> {
|
|||||||
|
|
||||||
println!("We're a client, let's fuzz :)");
|
println!("We're a client, let's fuzz :)");
|
||||||
|
|
||||||
let mut mutator = HavocBytesMutator::new_default();
|
let mut mutator = HavocBytesMutator::default();
|
||||||
mutator.set_max_size(4096);
|
mutator.set_max_size(4096);
|
||||||
let stage = StdMutationalStage::new(mutator);
|
let stage = StdMutationalStage::new(mutator);
|
||||||
let mut fuzzer = StdFuzzer::new(tuple_list!(stage));
|
let mut fuzzer = StdFuzzer::new(tuple_list!(stage));
|
||||||
|
@ -84,7 +84,7 @@ fn fuzz(corpus_dirs: Vec<PathBuf>, objective_dir: PathBuf, broker_port: u16) ->
|
|||||||
__lafl_max_edges_size as usize
|
__lafl_max_edges_size as usize
|
||||||
});
|
});
|
||||||
|
|
||||||
// If not retsrating, create a State from scratch
|
// If not restarting, create a State from scratch
|
||||||
let mut state = state.unwrap_or(State::new(
|
let mut state = state.unwrap_or(State::new(
|
||||||
InMemoryCorpus::new(),
|
InMemoryCorpus::new(),
|
||||||
tuple_list!(MaxMapFeedback::new_with_observer(
|
tuple_list!(MaxMapFeedback::new_with_observer(
|
||||||
@ -97,7 +97,7 @@ fn fuzz(corpus_dirs: Vec<PathBuf>, objective_dir: PathBuf, broker_port: u16) ->
|
|||||||
|
|
||||||
println!("We're a client, let's fuzz :)");
|
println!("We're a client, let's fuzz :)");
|
||||||
|
|
||||||
// Create a PNG dictionary of not existing
|
// Create a PNG dictionary if not existing
|
||||||
if state.metadata().get::<TokensMetadata>().is_none() {
|
if state.metadata().get::<TokensMetadata>().is_none() {
|
||||||
state.add_metadata(TokensMetadata::new(vec![
|
state.add_metadata(TokensMetadata::new(vec![
|
||||||
vec![137, 80, 78, 71, 13, 10, 26, 10], // PNG header
|
vec![137, 80, 78, 71, 13, 10, 26, 10], // PNG header
|
||||||
@ -109,7 +109,7 @@ fn fuzz(corpus_dirs: Vec<PathBuf>, objective_dir: PathBuf, broker_port: u16) ->
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Setup a basic mutator with a mutational stage
|
// Setup a basic mutator with a mutational stage
|
||||||
let mutator = HavocBytesMutator::new_default();
|
let mutator = HavocBytesMutator::default();
|
||||||
let stage = StdMutationalStage::new(mutator);
|
let stage = StdMutationalStage::new(mutator);
|
||||||
let mut fuzzer = StdFuzzer::new(tuple_list!(stage));
|
let mut fuzzer = StdFuzzer::new(tuple_list!(stage));
|
||||||
|
|
||||||
|
@ -3,6 +3,7 @@ name = "libafl"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
authors = ["Andrea Fioraldi <andreafioraldi@gmail.com>", "Dominik Maier <domenukk@gmail.com>"]
|
authors = ["Andrea Fioraldi <andreafioraldi@gmail.com>", "Dominik Maier <domenukk@gmail.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
build = "build.rs"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
@ -42,7 +43,6 @@ required-features = ["std"]
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
tuple_list = "0.1.2"
|
tuple_list = "0.1.2"
|
||||||
hashbrown = { version = "0.9", features = ["serde", "ahash-compile-time-rng"] } # A faster hashmap, nostd compatible
|
hashbrown = { version = "0.9", features = ["serde", "ahash-compile-time-rng"] } # A faster hashmap, nostd compatible
|
||||||
libc = "0.2" # For (*nix) libc
|
|
||||||
num = "*"
|
num = "*"
|
||||||
xxhash-rust = { version = "0.8.0", features = ["xxh3"] } # xxh3 hashing for rust
|
xxhash-rust = { version = "0.8.0", features = ["xxh3"] } # xxh3 hashing for rust
|
||||||
serde = { version = "1.0", default-features = false, features = ["alloc"] } # serialization lib
|
serde = { version = "1.0", default-features = false, features = ["alloc"] } # serialization lib
|
||||||
@ -51,3 +51,12 @@ postcard = { version = "0.5.1", features = ["alloc"] } # no_std compatible serde
|
|||||||
static_assertions = "1.1.0"
|
static_assertions = "1.1.0"
|
||||||
serde_json = { version = "1.0", default-features = false, features = ["alloc"] } # an easy way to debug print SerdeAnyMap
|
serde_json = { version = "1.0", default-features = false, features = ["alloc"] } # an easy way to debug print SerdeAnyMap
|
||||||
#TODO: for llmp brotli = { version = "3.3.0", default-features = false } # brotli compression
|
#TODO: for llmp brotli = { version = "3.3.0", default-features = false } # brotli compression
|
||||||
|
|
||||||
|
[target.'cfg(unix)'.dependencies]
|
||||||
|
libc = "0.2" # For (*nix) libc
|
||||||
|
|
||||||
|
[target.'cfg(windows)'.dependencies]
|
||||||
|
windows = "0.3.1"
|
||||||
|
|
||||||
|
[target.'cfg(windows)'.build-dependencies]
|
||||||
|
windows = "0.3.1"
|
||||||
|
10
libafl/build.rs
Normal file
10
libafl/build.rs
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
fn main() {
|
||||||
|
|
||||||
|
#[cfg(target_os = "windows")]
|
||||||
|
windows::build!(
|
||||||
|
// API needed for the shared memory
|
||||||
|
windows::win32::system_services::{CreateFileMappingA, MapViewOfFile, UnmapViewOfFile},
|
||||||
|
windows::win32::windows_programming::CloseHandle
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
use alloc::vec::Vec;
|
use alloc::vec::Vec;
|
||||||
use core::{fmt, marker::PhantomData};
|
use core::{fmt, default::Default, marker::PhantomData};
|
||||||
use fmt::Debug;
|
use fmt::Debug;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
@ -266,7 +266,7 @@ where
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<C, I, R, S> HavocBytesMutator<StdScheduledMutator<C, I, R, S>, C, I, R, S>
|
impl<C, I, R, S> Default for HavocBytesMutator<StdScheduledMutator<C, I, R, S>, C, I, R, S>
|
||||||
where
|
where
|
||||||
C: Corpus<I, R>,
|
C: Corpus<I, R>,
|
||||||
I: Input + HasBytesVec,
|
I: Input + HasBytesVec,
|
||||||
@ -274,7 +274,7 @@ where
|
|||||||
S: HasCorpus<C, I, R> + HasMetadata,
|
S: HasCorpus<C, I, R> + HasMetadata,
|
||||||
{
|
{
|
||||||
/// Create a new HavocBytesMutator instance wrapping StdScheduledMutator
|
/// Create a new HavocBytesMutator instance wrapping StdScheduledMutator
|
||||||
pub fn new_default() -> Self {
|
fn default() -> Self {
|
||||||
let mut scheduled = StdScheduledMutator::<C, I, R, S>::new();
|
let mut scheduled = StdScheduledMutator::<C, I, R, S>::new();
|
||||||
scheduled.add_mutation(mutation_bitflip);
|
scheduled.add_mutation(mutation_bitflip);
|
||||||
scheduled.add_mutation(mutation_byteflip);
|
scheduled.add_mutation(mutation_byteflip);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user