mirror of
https://github.com/AFLplusplus/AFLplusplus.git
synced 2025-06-24 22:53:24 +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",
|
"custom_mutator",
|
||||||
"example",
|
"example",
|
||||||
# Lain needs a nightly toolchain
|
# Lain needs a nightly toolchain
|
||||||
# "example_lain",
|
"example_lain",
|
||||||
]
|
]
|
@ -9,6 +9,7 @@ edition = "2018"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
custom_mutator = { path = "../custom_mutator" }
|
custom_mutator = { path = "../custom_mutator" }
|
||||||
lain="0.5"
|
lain="0.5"
|
||||||
|
libafl= {version = "0.5", default-features = false, features = ["std", "rand_trait"]}
|
||||||
|
|
||||||
[[example]]
|
[[example]]
|
||||||
name = "example_lain"
|
name = "example_lain"
|
||||||
|
@ -4,8 +4,9 @@ use custom_mutator::{export_mutator, CustomMutator};
|
|||||||
use lain::{
|
use lain::{
|
||||||
mutator::Mutator,
|
mutator::Mutator,
|
||||||
prelude::*,
|
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)]
|
#[derive(Debug, Mutatable, NewFuzzed, BinarySerialize)]
|
||||||
struct MyStruct {
|
struct MyStruct {
|
||||||
@ -25,7 +26,7 @@ struct MyStruct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
struct LainMutator {
|
struct LainMutator {
|
||||||
mutator: Mutator<StdRng>,
|
mutator: Mutator<StdRand>,
|
||||||
buffer: Vec<u8>,
|
buffer: Vec<u8>,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -34,7 +35,7 @@ impl CustomMutator for LainMutator {
|
|||||||
|
|
||||||
fn init(seed: u32) -> Result<Self, ()> {
|
fn init(seed: u32) -> Result<Self, ()> {
|
||||||
Ok(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(),
|
buffer: Vec::new(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user