Struct libafl::fuzzer::StdFuzzer

source ·
pub struct StdFuzzer<CS, F, OF, OT>where
    CS: Scheduler,
    F: Feedback<CS::State>,
    OF: Feedback<CS::State>,
    CS::State: HasClientPerfMonitor,
{ /* private fields */ }
Expand description

Your default fuzzer instance, for everyday use.

Implementations§

source§

impl<CS, F, OF, OT> StdFuzzer<CS, F, OF, OT>where
    CS: Scheduler,
    F: Feedback<CS::State>,
    OF: Feedback<CS::State>,
    CS::State: UsesInput + HasExecutions + HasClientPerfMonitor,

source

pub fn new(scheduler: CS, feedback: F, objective: OF) -> Self

Create a new StdFuzzer with standard behavior.

source

pub fn execute_input<E, EM>(
    &mut self,
    state: &mut CS::State,
    executor: &mut E,
    event_mgr: &mut EM,
    input: &<CS::State as UsesInput>::Input
) -> Result<ExitKind, Error>where
    E: Executor<EM, Self> + HasObservers<Observers = OT, State = CS::State>,
    EM: UsesState<State = CS::State>,
    OT: ObserversTuple<CS::State>,

Runs the input and triggers observers and feedback

Trait Implementations§

source§

impl<CS, F, OF, OT: Debug> Debug for StdFuzzer<CS, F, OF, OT>where
    CS: Scheduler + Debug,
    F: Feedback<CS::State> + Debug,
    OF: Feedback<CS::State> + Debug,
    CS::State: HasClientPerfMonitor,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<CS, E, EM, F, OF, OT> Evaluator<E, EM> for StdFuzzer<CS, F, OF, OT>where
    CS: Scheduler,
    E: HasObservers<State = CS::State, Observers = OT> + Executor<EM, Self>,
    EM: EventFirer<State = CS::State>,
    F: Feedback<CS::State>,
    OF: Feedback<CS::State>,
    OT: ObserversTuple<CS::State> + Serialize + DeserializeOwned,
    CS::State: HasCorpus + HasSolutions + HasClientPerfMonitor + HasExecutions,

source§

fn evaluate_input_events(
    &mut self,
    state: &mut CS::State,
    executor: &mut E,
    manager: &mut EM,
    input: <CS::State as UsesInput>::Input,
    send_events: bool
) -> Result<(ExecuteInputResult, Option<CorpusId>), Error>

Process one input, adding to the respective corpora if needed and firing the right events

source§

fn add_input(
    &mut self,
    state: &mut CS::State,
    executor: &mut E,
    manager: &mut EM,
    input: <CS::State as UsesInput>::Input
) -> Result<CorpusId, Error>

Adds an input, even if it’s not considered interesting by any of the executors

source§

fn evaluate_input(
    &mut self,
    state: &mut Self::State,
    executor: &mut E,
    manager: &mut EM,
    input: <Self::State as UsesInput>::Input
) -> Result<(ExecuteInputResult, Option<CorpusId>), Error>

Runs the input and triggers observers and feedback, returns if is interesting an (option) the index of the new crate::corpus::Testcase in the corpus
source§

impl<CS, F, OF, OT> EvaluatorObservers<OT> for StdFuzzer<CS, F, OF, OT>where
    CS: Scheduler,
    OT: ObserversTuple<CS::State> + Serialize + DeserializeOwned,
    F: Feedback<CS::State>,
    OF: Feedback<CS::State>,
    CS::State: HasCorpus + HasSolutions + HasClientPerfMonitor + HasExecutions,

source§

fn evaluate_input_with_observers<E, EM>(
    &mut self,
    state: &mut Self::State,
    executor: &mut E,
    manager: &mut EM,
    input: <Self::State as UsesInput>::Input,
    send_events: bool
) -> Result<(ExecuteInputResult, Option<CorpusId>), Error>where
    E: Executor<EM, Self> + HasObservers<Observers = OT, State = Self::State>,
    EM: EventFirer<State = Self::State>,

Process one input, adding to the respective corpora if needed and firing the right events

source§

impl<CS, E, EM, F, OF> ExecutesInput<E, EM> for StdFuzzer<CS, F, OF, E::Observers>where
    CS: Scheduler,
    F: Feedback<CS::State>,
    OF: Feedback<CS::State>,
    E: Executor<EM, Self> + HasObservers<State = CS::State>,
    EM: UsesState<State = CS::State>,
    CS::State: UsesInput + HasExecutions + HasClientPerfMonitor,

source§

fn execute_input(
    &mut self,
    state: &mut CS::State,
    executor: &mut E,
    event_mgr: &mut EM,
    input: &<CS::State as UsesInput>::Input
) -> Result<ExitKind, Error>

Runs the input and triggers observers and feedback

source§

impl<CS, F, OF, OT> ExecutionProcessor<OT> for StdFuzzer<CS, F, OF, OT>where
    CS: Scheduler,
    F: Feedback<CS::State>,
    OF: Feedback<CS::State>,
    OT: ObserversTuple<CS::State> + Serialize + DeserializeOwned,
    CS::State: HasCorpus + HasSolutions + HasClientPerfMonitor + HasExecutions,

source§

fn process_execution<EM>(
    &mut self,
    state: &mut CS::State,
    manager: &mut EM,
    input: <CS::State as UsesInput>::Input,
    observers: &OT,
    exit_kind: &ExitKind,
    send_events: bool
) -> Result<(ExecuteInputResult, Option<CorpusId>), Error>where
    EM: EventFirer<State = Self::State>,

Evaluate if a set of observation channels has an interesting state

source§

impl<CS, E, EM, F, OF, OT, ST> Fuzzer<E, EM, ST> for StdFuzzer<CS, F, OF, OT>where
    CS: Scheduler,
    E: UsesState<State = CS::State>,
    EM: ProgressReporter + EventProcessor<E, Self, State = CS::State>,
    F: Feedback<CS::State>,
    OF: Feedback<CS::State>,
    CS::State: HasClientPerfMonitor + HasExecutions + HasMetadata,
    ST: StagesTuple<E, EM, CS::State, Self>,

source§

fn fuzz_one(
    &mut self,
    stages: &mut ST,
    executor: &mut E,
    state: &mut CS::State,
    manager: &mut EM
) -> Result<CorpusId, Error>

Fuzz for a single iteration. Returns the index of the last fuzzed corpus item. (Note: An iteration represents a complete run of every stage. Therefore it does not mean that the harness is executed for once, because each stage could run the harness for multiple times) Read more
source§

fn fuzz_loop(
    &mut self,
    stages: &mut ST,
    executor: &mut E,
    state: &mut EM::State,
    manager: &mut EM
) -> Result<CorpusId, Error>

Fuzz forever (or until stopped)
source§

fn fuzz_loop_for(
    &mut self,
    stages: &mut ST,
    executor: &mut E,
    state: &mut EM::State,
    manager: &mut EM,
    iters: u64
) -> Result<CorpusId, Error>

Fuzz for n iterations. Returns the index of the last fuzzed corpus item. (Note: An iteration represents a complete run of every stage. therefore the number n is not always equal to the number of the actual harness executions, because each stage could run the harness for multiple times) Read more
source§

impl<CS, F, OF, OT> HasFeedback for StdFuzzer<CS, F, OF, OT>where
    CS: Scheduler,
    F: Feedback<CS::State>,
    OF: Feedback<CS::State>,
    CS::State: HasClientPerfMonitor,

§

type Feedback = F

The feedback type
source§

fn feedback(&self) -> &Self::Feedback

The feedback
source§

fn feedback_mut(&mut self) -> &mut Self::Feedback

The feedback (mutable)
source§

impl<CS, F, OF, OT> HasObjective for StdFuzzer<CS, F, OF, OT>where
    CS: Scheduler,
    F: Feedback<CS::State>,
    OF: Feedback<CS::State>,
    CS::State: HasClientPerfMonitor,

§

type Objective = OF

The type of the Feedback used to find objectives for this fuzzer
source§

fn objective(&self) -> &OF

The objective feedback
source§

fn objective_mut(&mut self) -> &mut OF

The objective feedback (mutable)
source§

impl<CS, F, OF, OT> HasScheduler for StdFuzzer<CS, F, OF, OT>where
    CS: Scheduler,
    F: Feedback<CS::State>,
    OF: Feedback<CS::State>,
    CS::State: HasClientPerfMonitor,

§

type Scheduler = CS

The Scheduler for this fuzzer
source§

fn scheduler(&self) -> &CS

The scheduler
source§

fn scheduler_mut(&mut self) -> &mut CS

The scheduler (mutable)
source§

impl<CS, F, OF, OT> UsesState for StdFuzzer<CS, F, OF, OT>where
    CS: Scheduler,
    F: Feedback<CS::State>,
    OF: Feedback<CS::State>,
    CS::State: HasClientPerfMonitor,

§

type State = <CS as UsesState>::State

The state known by this type.

Auto Trait Implementations§

§

impl<CS, F, OF, OT> RefUnwindSafe for StdFuzzer<CS, F, OF, OT>where
    CS: RefUnwindSafe,
    F: RefUnwindSafe,
    OF: RefUnwindSafe,
    OT: RefUnwindSafe,

§

impl<CS, F, OF, OT> Send for StdFuzzer<CS, F, OF, OT>where
    CS: Send,
    F: Send,
    OF: Send,
    OT: Send,

§

impl<CS, F, OF, OT> Sync for StdFuzzer<CS, F, OF, OT>where
    CS: Sync,
    F: Sync,
    OF: Sync,
    OT: Sync,

§

impl<CS, F, OF, OT> Unpin for StdFuzzer<CS, F, OF, OT>where
    CS: Unpin,
    F: Unpin,
    OF: Unpin,
    OT: Unpin,

§

impl<CS, F, OF, OT> UnwindSafe for StdFuzzer<CS, F, OF, OT>where
    CS: UnwindSafe,
    F: UnwindSafe,
    OF: UnwindSafe,
    OT: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere
    T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere
    T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere
    U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<Tail, T> Prepend<T> for Tail

§

type PreprendResult = Tail

The Resulting TupleList, of an Prepend::prepend() call, including the prepended entry.
source§

fn prepend(self, value: T) -> (T, <Tail as Prepend<T>>::PreprendResult)

Prepend a value to this tuple, returning a new tuple with prepended value.
source§

impl<T, U> TryFrom<U> for Twhere
    U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere
    U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<KS> UsesInput for KSwhere
    KS: UsesState,

§

type Input = <<KS as UsesState>::State as UsesInput>::Input

Type which will be used throughout this state.