Trait libafl::stages::push::PushStage

source ·
pub trait PushStage<CS, EM, OT, Z>: Iteratorwhere
    CS: Scheduler,
    CS::State: HasClientPerfMonitor + HasRand + HasExecutions + HasMetadata,
    EM: EventFirer<State = CS::State> + EventRestarter + HasEventManagerId + ProgressReporter,
    OT: ObserversTuple<CS::State>,
    Z: ExecutionProcessor<OT, State = CS::State> + EvaluatorObservers<OT> + HasScheduler<Scheduler = CS>,
{ fn push_stage_helper(&self) -> &PushStageHelper<CS, EM, OT, Z>; fn push_stage_helper_mut(&mut self) -> &mut PushStageHelper<CS, EM, OT, Z>; fn pre_exec(
        &mut self,
        _fuzzer: &mut Z,
        _state: &mut CS::State,
        _event_mgr: &mut EM,
        _observers: &mut OT
    ) -> Option<Result<<CS::State as UsesInput>::Input, Error>>; fn set_current_corpus_idx(&mut self, corpus_idx: CorpusId) { ... } fn init(
        &mut self,
        _fuzzer: &mut Z,
        _state: &mut CS::State,
        _event_mgr: &mut EM,
        _observers: &mut OT
    ) -> Result<(), Error> { ... } fn post_exec(
        &mut self,
        _fuzzer: &mut Z,
        _state: &mut CS::State,
        _event_mgr: &mut EM,
        _observers: &mut OT,
        _input: <CS::State as UsesInput>::Input,
        _exit_kind: ExitKind
    ) -> Result<(), Error> { ... } fn deinit(
        &mut self,
        _fuzzer: &mut Z,
        _state: &mut CS::State,
        _event_mgr: &mut EM,
        _observers: &mut OT
    ) -> Result<(), Error> { ... } fn next_std(
        &mut self
    ) -> Option<Result<<CS::State as UsesInput>::Input, Error>> { ... } }
Expand description

A push stage is a generator that returns a single testcase for each call. It’s an iterator so we can chain it. After it has finished once, we will call it agan for the next fuzzer round.

Required Methods§

source

fn push_stage_helper(&self) -> &PushStageHelper<CS, EM, OT, Z>

Gets the PushStageHelper

source

fn push_stage_helper_mut(&mut self) -> &mut PushStageHelper<CS, EM, OT, Z>

Gets the PushStageHelper (mutable)

source

fn pre_exec(
    &mut self,
    _fuzzer: &mut Z,
    _state: &mut CS::State,
    _event_mgr: &mut EM,
    _observers: &mut OT
) -> Option<Result<<CS::State as UsesInput>::Input, Error>>

Called before the a test case is executed. Should return the test case to be executed. After this stage has finished, or if the stage does not process any inputs, this should return None.

Provided Methods§

source

fn set_current_corpus_idx(&mut self, corpus_idx: CorpusId)

Set the current corpus index this stage works on

source

fn init(
    &mut self,
    _fuzzer: &mut Z,
    _state: &mut CS::State,
    _event_mgr: &mut EM,
    _observers: &mut OT
) -> Result<(), Error>

Called by next_std when this stage is being initialized. This is called before the first iteration of the stage. After the stage has finished once (after deinit), this will be called again.

source

fn post_exec(
    &mut self,
    _fuzzer: &mut Z,
    _state: &mut CS::State,
    _event_mgr: &mut EM,
    _observers: &mut OT,
    _input: <CS::State as UsesInput>::Input,
    _exit_kind: ExitKind
) -> Result<(), Error>

Called after the execution of a testcase finished.

source

fn deinit(
    &mut self,
    _fuzzer: &mut Z,
    _state: &mut CS::State,
    _event_mgr: &mut EM,
    _observers: &mut OT
) -> Result<(), Error>

Called after the stage finished (pre_exec returned None)

source

fn next_std(&mut self) -> Option<Result<<CS::State as UsesInput>::Input, Error>>

This is the default implementation for next for this stage

Implementors§

source§

impl<CS, EM, M, OT, Z> PushStage<CS, EM, OT, Z> for StdMutationalPushStage<CS, EM, M, OT, Z>where
    CS: Scheduler,
    EM: EventFirer<State = CS::State> + EventRestarter + HasEventManagerId + ProgressReporter,
    M: Mutator<CS::Input, CS::State>,
    OT: ObserversTuple<CS::State>,
    CS::State: HasClientPerfMonitor + HasCorpus + HasRand + HasExecutions + HasMetadata + Clone + Debug,
    Z: ExecutionProcessor<OT, State = CS::State> + EvaluatorObservers<OT> + HasScheduler<Scheduler = CS>,