[][src]Crate byte_mutator

Byte Mutator

byte-mutator is a crate for defining a set of rules by which to mutate byte arrays. It contains two main primitives: Stage, and Mutator. A Stage defines how many iterations to run via the Iterations enum, and a Mutator defines which MutatorType to perform across which range of bytes.

byte-mutator internally uses an UndoBuffer, which is a data structure that exposes mutable &[u8] slices, and can undo changes in order to reset and perform another mutation from the clean starting state provided at initialization. This is important to avoid utterly mangling the input; we want to identify small novel changes that produce a different output from the target program, and then reuse that new state to perform further mutations.


pub use crate::fuzz_config::FuzzConfig;
pub use crate::mutators::Mutation;
pub use crate::mutators::MutationType;
pub use crate::undo_buffer::UndoBuffer;



Deserializes a .toml config into a FuzzConfig object that can be used to configure a ByteMutator. See tests for examples.


This module contains the available mutators.


UndoBuffer is a structure that is used to expose an 'undo' interface to a fixed size buffer. It internally maintains two fixed size ArrayVec structures. These arrays are identical on construction, but only one can be written to. UndoBuffer keeps track of which areas of the buffer have been mutably borrowed, and can then reset the buffer back to its original state.



A fixed size buffer with a defined set of stages of mutations that will be applied to the buffer


Used to define groups of mutations, and how many mutations should be performed.



Used to limit the number of iterations in a Stage.