Merge branch 'main' of github.com:AFLplusplus/libAFLrs into main
This commit is contained in:
commit
21235e846e
@ -509,6 +509,28 @@ where
|
||||
mem_move(input.bytes_mut(), token, 0, off, len);
|
||||
Ok(MutationResult::Mutated)
|
||||
}
|
||||
|
||||
// Overwrite with a dictionary token
|
||||
pub fn mutation_tokenreplace<M, C, I, R>(
|
||||
mutator: &mut M,
|
||||
rand: &mut R,
|
||||
_: &C,
|
||||
input: &mut I,
|
||||
) -> Result<MutationResult, AflError>
|
||||
where
|
||||
M: HasMaxSize,
|
||||
I: Input + HasBytesVec,
|
||||
R: Rand,
|
||||
{
|
||||
if mutator.tokens.size() > len || !len { return Ok(MutationResult::Skipped); }
|
||||
let token = &mutator.tokens[rand.below(token.size())];
|
||||
let token_len = token.size();
|
||||
let size = input.bytes().len();
|
||||
let off rand.below((mutator.max_size() - token_len) as u64)) as usize;
|
||||
mem_move(input.bytes_mut(), token, 0, off, len);
|
||||
Ok(MutationResult::Mutated)
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
pub fn mutation_bytesinsert<I, M, R, S>(
|
||||
|
@ -303,10 +303,10 @@ where
|
||||
scheduled.add_mutation(mutation_bytescopy);
|
||||
scheduled.add_mutation(mutation_bytesswap);
|
||||
|
||||
// TODO dictionary and custom dictionary (redqueen etc.)
|
||||
/*scheduled.add_mutation(mutation_bitflip);
|
||||
scheduled.add_mutation(mutation_bitflip);
|
||||
scheduled.add_mutation(mutation_bitflip);*/
|
||||
/*scheduled.add_mutation(mutation_tokeninsert);
|
||||
scheduled.add_mutation(mutation_tokenreplace);*/
|
||||
|
||||
// TODO: custom dictionary (redqueen etc.)
|
||||
|
||||
scheduled.add_mutation(mutation_splice);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user