Struct libafl::stages::tuneable::TuneableMutationalStage
source · pub struct TuneableMutationalStage<E, EM, I, M, Z> { /* private fields */ }
Expand description
A crate::stages::MutationalStage
where the mutator iteration can be tuned at runtime
Implementations§
source§impl<E, EM, I, M, Z> TuneableMutationalStage<E, EM, I, M, Z>where
E: UsesState<State = Z::State>,
EM: UsesState<State = Z::State>,
M: Mutator<I, Z::State>,
Z: Evaluator<E, EM>,
Z::State: HasCorpus + HasRand + HasNamedMetadata + HasMetadata + HasExecutions,
I: MutatedTransform<Z::Input, Z::State> + Clone,
impl<E, EM, I, M, Z> TuneableMutationalStage<E, EM, I, M, Z>where
E: UsesState<State = Z::State>,
EM: UsesState<State = Z::State>,
M: Mutator<I, Z::State>,
Z: Evaluator<E, EM>,
Z::State: HasCorpus + HasRand + HasNamedMetadata + HasMetadata + HasExecutions,
I: MutatedTransform<Z::Input, Z::State> + Clone,
sourcepub fn new(state: &mut Z::State, mutator: M) -> Self
pub fn new(state: &mut Z::State, mutator: M) -> Self
Creates a new default tuneable mutational stage
sourcepub fn with_name(state: &mut Z::State, mutator: M, name: &str) -> Self
pub fn with_name(state: &mut Z::State, mutator: M, name: &str) -> Self
Crates a new tuneable mutational stage with the given name
sourcepub fn set_iters<S>(&self, state: &mut S, iters: u64) -> Result<(), Error>where
S: HasNamedMetadata,
pub fn set_iters<S>(&self, state: &mut S, iters: u64) -> Result<(), Error>where
S: HasNamedMetadata,
Set the number of iterations to be used by this TuneableMutationalStage
sourcepub fn set_iters_std(state: &mut Z::State, iters: u64) -> Result<(), Error>
pub fn set_iters_std(state: &mut Z::State, iters: u64) -> Result<(), Error>
Set the number of iterations to be used by the std TuneableMutationalStage
sourcepub fn set_iters_by_name<S>(
state: &mut S,
iters: u64,
name: &str
) -> Result<(), Error>where
S: HasNamedMetadata,
pub fn set_iters_by_name<S>(
state: &mut S,
iters: u64,
name: &str
) -> Result<(), Error>where
S: HasNamedMetadata,
Set the number of iterations to be used by the TuneableMutationalStage
with the given name
sourcepub fn fixed_iters<S>(&self, state: &S) -> Result<Option<u64>, Error>where
S: HasNamedMetadata,
pub fn fixed_iters<S>(&self, state: &S) -> Result<Option<u64>, Error>where
S: HasNamedMetadata,
Get the set iterations for this TuneableMutationalStage
, if any
sourcepub fn iters_std(state: &Z::State) -> Result<Option<u64>, Error>
pub fn iters_std(state: &Z::State) -> Result<Option<u64>, Error>
Get the set iterations for the std TuneableMutationalStage
, if any
sourcepub fn iters_by_name<S>(state: &S, name: &str) -> Result<Option<u64>, Error>where
S: HasNamedMetadata,
pub fn iters_by_name<S>(state: &S, name: &str) -> Result<Option<u64>, Error>where
S: HasNamedMetadata,
Get the set iterations for the TuneableMutationalStage
with the given name, if any
sourcepub fn set_seed_fuzz_time<S>(
&self,
state: &mut S,
fuzz_time: Duration
) -> Result<(), Error>where
S: HasNamedMetadata,
pub fn set_seed_fuzz_time<S>(
&self,
state: &mut S,
fuzz_time: Duration
) -> Result<(), Error>where
S: HasNamedMetadata,
Set the time to mutate a single input in this TuneableMutationalStage
sourcepub fn set_seed_fuzz_time_std(
state: &mut Z::State,
fuzz_time: Duration
) -> Result<(), Error>
pub fn set_seed_fuzz_time_std( state: &mut Z::State, fuzz_time: Duration ) -> Result<(), Error>
Set the time to mutate a single input in the std TuneableMutationalStage
sourcepub fn set_seed_fuzz_time_by_name<S>(
state: &mut S,
fuzz_time: Duration,
name: &str
) -> Result<(), Error>where
S: HasNamedMetadata,
pub fn set_seed_fuzz_time_by_name<S>(
state: &mut S,
fuzz_time: Duration,
name: &str
) -> Result<(), Error>where
S: HasNamedMetadata,
Set the time to mutate a single input in the TuneableMutationalStage
with the given name
sourcepub fn seed_fuzz_time<S>(&self, state: &S) -> Result<Option<Duration>, Error>where
S: HasNamedMetadata,
pub fn seed_fuzz_time<S>(&self, state: &S) -> Result<Option<Duration>, Error>where
S: HasNamedMetadata,
Set the time to mutate a single input in this TuneableMutationalStage
sourcepub fn seed_fuzz_time_std(
&self,
state: &Z::State
) -> Result<Option<Duration>, Error>
pub fn seed_fuzz_time_std( &self, state: &Z::State ) -> Result<Option<Duration>, Error>
Set the time to mutate a single input for the std TuneableMutationalStage
sourcepub fn seed_fuzz_time_by_name<S>(
&self,
state: &S,
name: &str
) -> Result<Option<Duration>, Error>where
S: HasNamedMetadata,
pub fn seed_fuzz_time_by_name<S>(
&self,
state: &S,
name: &str
) -> Result<Option<Duration>, Error>where
S: HasNamedMetadata,
Set the time to mutate a single input for the TuneableMutationalStage
with a given name
sourcepub fn reset<S>(&self, state: &mut S) -> Result<(), Error>where
S: HasNamedMetadata,
pub fn reset<S>(&self, state: &mut S) -> Result<(), Error>where
S: HasNamedMetadata,
Reset this to a normal, randomized, stage with
sourcepub fn reset_std(state: &mut Z::State) -> Result<(), Error>
pub fn reset_std(state: &mut Z::State) -> Result<(), Error>
Reset the std stage to a normal, randomized, stage
sourcepub fn reset_by_name<S>(state: &mut S, name: &str) -> Result<(), Error>where
S: HasNamedMetadata,
pub fn reset_by_name<S>(state: &mut S, name: &str) -> Result<(), Error>where
S: HasNamedMetadata,
Reset this to a normal, randomized, stage by name
source§impl<E, EM, I, M, Z> TuneableMutationalStage<E, EM, I, M, Z>
impl<E, EM, I, M, Z> TuneableMutationalStage<E, EM, I, M, Z>
sourcepub fn transforming(state: &mut Z::State, mutator: M, name: &str) -> Self
pub fn transforming(state: &mut Z::State, mutator: M, name: &str) -> Self
Creates a new transforming mutational stage
Trait Implementations§
source§impl<E: Clone, EM: Clone, I: Clone, M: Clone, Z: Clone> Clone for TuneableMutationalStage<E, EM, I, M, Z>
impl<E: Clone, EM: Clone, I: Clone, M: Clone, Z: Clone> Clone for TuneableMutationalStage<E, EM, I, M, Z>
source§fn clone(&self) -> TuneableMutationalStage<E, EM, I, M, Z>
fn clone(&self) -> TuneableMutationalStage<E, EM, I, M, Z>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<E: Debug, EM: Debug, I: Debug, M: Debug, Z: Debug> Debug for TuneableMutationalStage<E, EM, I, M, Z>
impl<E: Debug, EM: Debug, I: Debug, M: Debug, Z: Debug> Debug for TuneableMutationalStage<E, EM, I, M, Z>
source§impl<E, EM, I, M, Z> MutationalStage<E, EM, I, M, Z> for TuneableMutationalStage<E, EM, I, M, Z>where
E: UsesState<State = Z::State>,
EM: UsesState<State = Z::State>,
M: Mutator<I, Z::State>,
Z: Evaluator<E, EM>,
Z::State: HasCorpus + HasRand + HasNamedMetadata + HasMetadata + HasExecutions,
I: MutatedTransform<Z::Input, Z::State> + Clone,
impl<E, EM, I, M, Z> MutationalStage<E, EM, I, M, Z> for TuneableMutationalStage<E, EM, I, M, Z>where
E: UsesState<State = Z::State>,
EM: UsesState<State = Z::State>,
M: Mutator<I, Z::State>,
Z: Evaluator<E, EM>,
Z::State: HasCorpus + HasRand + HasNamedMetadata + HasMetadata + HasExecutions,
I: MutatedTransform<Z::Input, Z::State> + Clone,
source§fn perform_mutational(
&mut self,
fuzzer: &mut Z,
executor: &mut E,
state: &mut Z::State,
manager: &mut EM
) -> Result<(), Error>
fn perform_mutational( &mut self, fuzzer: &mut Z, executor: &mut E, state: &mut Z::State, manager: &mut EM ) -> Result<(), Error>
Runs this (mutational) stage for the given testcase
Exactly the same functionality as MutationalStage::perform_mutational
, but with added timeout support.
source§fn mutator_mut(&mut self) -> &mut M
fn mutator_mut(&mut self) -> &mut M
The list of mutators, added to this stage (as mutable ref)
source§impl<E, EM, I, M, Z> Stage<E, EM, Z> for TuneableMutationalStage<E, EM, I, M, Z>where
E: UsesState<State = Z::State>,
EM: UsesState<State = Z::State>,
M: Mutator<I, Z::State>,
Z: Evaluator<E, EM>,
Z::State: HasCorpus + HasRand + HasNamedMetadata + HasMetadata + HasExecutions,
I: MutatedTransform<Z::Input, Z::State> + Clone,
impl<E, EM, I, M, Z> Stage<E, EM, Z> for TuneableMutationalStage<E, EM, I, M, Z>where
E: UsesState<State = Z::State>,
EM: UsesState<State = Z::State>,
M: Mutator<I, Z::State>,
Z: Evaluator<E, EM>,
Z::State: HasCorpus + HasRand + HasNamedMetadata + HasMetadata + HasExecutions,
I: MutatedTransform<Z::Input, Z::State> + Clone,
source§fn perform(
&mut self,
fuzzer: &mut Z,
executor: &mut E,
state: &mut Z::State,
manager: &mut EM
) -> Result<(), Error>
fn perform( &mut self, fuzzer: &mut Z, executor: &mut E, state: &mut Z::State, manager: &mut EM ) -> Result<(), Error>
source§fn restart_progress_should_run(
&mut self,
state: &mut Self::State
) -> Result<bool, Error>
fn restart_progress_should_run( &mut self, state: &mut Self::State ) -> Result<bool, Error>
Stage::perform
.
Initialize the restart tracking for this stage, if it is not yet initialized.
On restart, this will be called again.
As long as Stage::clear_restart_progress
, all subsequent calls happen on restart.
Returns true
, if the stage’s Stage::perform
method should run, else false
.source§fn clear_restart_progress(
&mut self,
state: &mut Self::State
) -> Result<(), Error>
fn clear_restart_progress( &mut self, state: &mut Self::State ) -> Result<(), Error>
source§fn perform_restartable(
&mut self,
fuzzer: &mut Z,
executor: &mut E,
state: &mut Self::State,
manager: &mut EM
) -> Result<(), Error>
fn perform_restartable( &mut self, fuzzer: &mut Z, executor: &mut E, state: &mut Self::State, manager: &mut EM ) -> Result<(), Error>
Stage::restart_progress_should_run
and Stage::clear_restart_progress
appropriatelysource§impl<E, EM, I, M, Z> UsesState for TuneableMutationalStage<E, EM, I, M, Z>
impl<E, EM, I, M, Z> UsesState for TuneableMutationalStage<E, EM, I, M, Z>
Auto Trait Implementations§
impl<E, EM, I, M, Z> Freeze for TuneableMutationalStage<E, EM, I, M, Z>where
M: Freeze,
impl<E, EM, I, M, Z> RefUnwindSafe for TuneableMutationalStage<E, EM, I, M, Z>
impl<E, EM, I, M, Z> Send for TuneableMutationalStage<E, EM, I, M, Z>
impl<E, EM, I, M, Z> Sync for TuneableMutationalStage<E, EM, I, M, Z>
impl<E, EM, I, M, Z> Unpin for TuneableMutationalStage<E, EM, I, M, Z>
impl<E, EM, I, M, Z> UnwindSafe for TuneableMutationalStage<E, EM, I, M, Z>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> FmtForward for T
impl<T> FmtForward for T
source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moresource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moresource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R ) -> R
source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.source§impl<Tail, T> Prepend<T> for Tail
impl<Tail, T> Prepend<T> for Tail
§type PreprendResult = Tail
type PreprendResult = Tail
TupleList
, of an Prepend::prepend()
call,
including the prepended entry.source§fn prepend(self, value: T) -> (T, <Tail as Prepend<T>>::PreprendResult)
fn prepend(self, value: T) -> (T, <Tail as Prepend<T>>::PreprendResult)
source§impl<T> Tap for T
impl<T> Tap for T
source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read moresource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read moresource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read moresource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read moresource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read moresource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read moresource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.