Trait libafl::feedbacks::Feedback

source ·
pub trait Feedback<S>: Named
where S: State,
{ // Required method fn is_interesting<EM, OT>( &mut self, state: &mut S, manager: &mut EM, input: &S::Input, observers: &OT, exit_kind: &ExitKind ) -> Result<bool, Error> where EM: EventFirer<State = S>, OT: ObserversTuple<S>; // Provided methods fn init_state(&mut self, _state: &mut S) -> Result<(), Error> { ... } fn is_interesting_introspection<EM, OT>( &mut self, state: &mut S, manager: &mut EM, input: &S::Input, observers: &OT, exit_kind: &ExitKind ) -> Result<bool, Error> where EM: EventFirer<State = S>, OT: ObserversTuple<S> { ... } fn append_metadata<EM, OT>( &mut self, state: &mut S, manager: &mut EM, observers: &OT, testcase: &mut Testcase<S::Input> ) -> Result<(), Error> where OT: ObserversTuple<S>, EM: EventFirer<State = S> { ... } fn discard_metadata( &mut self, _state: &mut S, _input: &S::Input ) -> Result<(), Error> { ... } }
Expand description

Feedbacks evaluate the observers. Basically, they reduce the information provided by an observer to a value, indicating the “interestingness” of the last run.

Required Methods§

source

fn is_interesting<EM, OT>( &mut self, state: &mut S, manager: &mut EM, input: &S::Input, observers: &OT, exit_kind: &ExitKind ) -> Result<bool, Error>
where EM: EventFirer<State = S>, OT: ObserversTuple<S>,

is_interesting return if an input is worth the addition to the corpus

Provided Methods§

source

fn init_state(&mut self, _state: &mut S) -> Result<(), Error>

Initializes the feedback state. This method is called after that the State is created.

source

fn is_interesting_introspection<EM, OT>( &mut self, state: &mut S, manager: &mut EM, input: &S::Input, observers: &OT, exit_kind: &ExitKind ) -> Result<bool, Error>
where EM: EventFirer<State = S>, OT: ObserversTuple<S>,

Returns if the result of a run is interesting and the value input should be stored in a corpus. It also keeps track of introspection stats.

source

fn append_metadata<EM, OT>( &mut self, state: &mut S, manager: &mut EM, observers: &OT, testcase: &mut Testcase<S::Input> ) -> Result<(), Error>
where OT: ObserversTuple<S>, EM: EventFirer<State = S>,

Append to the testcase the generated metadata in case of a new corpus item

source

fn discard_metadata( &mut self, _state: &mut S, _input: &S::Input ) -> Result<(), Error>

Discard the stored metadata in case that the testcase is not added to the corpus

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<S> Feedback<S> for ()
where S: State,

Hack to use () as empty Feedback

source§

fn is_interesting<EM, OT>( &mut self, _state: &mut S, _manager: &mut EM, _input: &S::Input, _observers: &OT, _exit_kind: &ExitKind ) -> Result<bool, Error>
where EM: EventFirer<State = S>, OT: ObserversTuple<S>,

Implementors§

source§

impl<'a, S> Feedback<S> for NautilusFeedback<'a, S>
where S: HasMetadata + HasCorpus<Input = NautilusInput> + State<Input = NautilusInput>,

source§

impl<A, B, FL, S> Feedback<S> for CombinedFeedback<A, B, FL, S>
where A: Feedback<S>, B: Feedback<S>, FL: FeedbackLogic<A, B, S>, S: State,

source§

impl<A, S> Feedback<S> for NotFeedback<A, S>
where A: Feedback<S>, S: State,

source§

impl<C, N, O, R, S, T> Feedback<S> for MapFeedback<C, N, O, R, S, T>
where N: IsNovel<T>, O: MapObserver<Entry = T> + for<'it> AsIter<'it, Item = T>, R: Reducer<T>, S: State + HasNamedMetadata, T: Default + Copy + Serialize + for<'de> Deserialize<'de> + PartialEq + Debug + 'static, C: CanTrack + AsRef<O>,

source§

impl<C, O, S> Feedback<S> for MapFeedback<C, DifferentIsNovel, O, MaxReducer, S, u8>
where for<'it> O: MapObserver<Entry = u8> + AsSlice<Entry = u8> + AsIter<'it, Item = u8>, S: State + HasNamedMetadata, C: CanTrack + AsRef<O>,

Specialize for the common coverage map size, maximization of u8s

source§

impl<F, I, O1, O2, S> Feedback<S> for DiffFeedback<F, I, O1, O2, S>
where F: FnMut(&O1, &O2) -> DiffResult, I: Input, S: HasMetadata + State<Input = I>, O1: Observer<S>, O2: Observer<S>,

source§

impl<M, S> Feedback<S> for MapEqualityFeedback<M, S>
where M: MapObserver, S: State,

source§

impl<O, S> Feedback<S> for NewHashFeedback<O, S>

source§

impl<S> Feedback<S> for ConstFeedback
where S: State,

source§

impl<S> Feedback<S> for ConcolicFeedback<S>
where S: State,

source§

impl<S> Feedback<S> for StdErrToMetadataFeedback
where S: State,

source§

impl<S> Feedback<S> for StdOutToMetadataFeedback
where S: State,

source§

impl<S> Feedback<S> for CrashFeedback
where S: State,

source§

impl<S> Feedback<S> for TimeFeedback
where S: State,

source§

impl<S> Feedback<S> for TimeoutFeedback
where S: State,

source§

impl<S> Feedback<S> for TransferredFeedback
where S: HasMetadata + State,

source§

impl<S, T> Feedback<S> for ListFeedback<T>
where S: State + HasNamedMetadata, T: Debug + Serialize + Hash + Eq + DeserializeOwned + Default + Copy + 'static,