mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-24 06:42:42 +00:00
Compare commits
1 Commits
Author | SHA1 | Date | |
---|---|---|---|
90c6199e69 |
Submodule custom_mutators/grammar_mutator/grammar_mutator updated: b79d51a8da...b3c4fcfa6a
@ -4,5 +4,5 @@ members = [
|
||||
"custom_mutator",
|
||||
"example",
|
||||
# Lain needs a nightly toolchain
|
||||
# "example_lain",
|
||||
"example_lain",
|
||||
]
|
@ -9,6 +9,7 @@ edition = "2018"
|
||||
[dependencies]
|
||||
custom_mutator = { path = "../custom_mutator" }
|
||||
lain="0.5"
|
||||
libafl= {version = "0.5", default-features = false, features = ["std", "rand_trait"]}
|
||||
|
||||
[[example]]
|
||||
name = "example_lain"
|
||||
|
@ -4,8 +4,9 @@ use custom_mutator::{export_mutator, CustomMutator};
|
||||
use lain::{
|
||||
mutator::Mutator,
|
||||
prelude::*,
|
||||
rand::{rngs::StdRng, SeedableRng},
|
||||
};
|
||||
// We're using RomuRand from LibAFL instead of the slower rand trait.
|
||||
use libafl::bolts::rands::StdRand;
|
||||
|
||||
#[derive(Debug, Mutatable, NewFuzzed, BinarySerialize)]
|
||||
struct MyStruct {
|
||||
@ -25,7 +26,7 @@ struct MyStruct {
|
||||
}
|
||||
|
||||
struct LainMutator {
|
||||
mutator: Mutator<StdRng>,
|
||||
mutator: Mutator<StdRand>,
|
||||
buffer: Vec<u8>,
|
||||
}
|
||||
|
||||
@ -34,7 +35,7 @@ impl CustomMutator for LainMutator {
|
||||
|
||||
fn init(seed: u32) -> Result<Self, ()> {
|
||||
Ok(Self {
|
||||
mutator: Mutator::new(StdRng::seed_from_u64(seed as u64)),
|
||||
mutator: Mutator::new(StdRand::with_seed(seed as u64)),
|
||||
buffer: Vec::new(),
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user