Struct libafl::executors::inprocess::InProcessExecutor[][src]

pub struct InProcessExecutor<'a, EM, H, I, OT, S> where
    H: FnMut(&[u8]) -> ExitKind,
    I: Input + HasTargetBytes,
    OT: ObserversTuple
{ /* fields omitted */ }

The inmem executor simply calls a target function, then returns afterwards.

Implementations

impl<'a, EM, H, I, OT, S> InProcessExecutor<'a, EM, H, I, OT, S> where
    H: FnMut(&[u8]) -> ExitKind,
    I: Input + HasTargetBytes,
    OT: ObserversTuple
[src]

pub fn new<OC, OF>(
    harness_fn: &'a mut H,
    observers: OT,
    _state: &mut S,
    _event_mgr: &mut EM
) -> Result<Self, Error> where
    EM: EventManager<I, S>,
    OC: Corpus<I>,
    OF: Feedback<I>,
    S: HasObjective<OF, I> + HasSolutions<OC, I>, 
[src]

Create a new in mem executor. Caution: crash and restart in one of them will lead to odd behavior if multiple are used, depending on different corpus or state.

  • harness_fn - the harness, executiong the function
  • observers - the observers observing the target during execution This may return an error on unix, if signal handler setup fails

pub fn harness(&self) -> &H[src]

Retrieve the harness function.

pub fn harness_mut(&mut self) -> &mut H[src]

Retrieve the harness function for a mutable reference.

Trait Implementations

impl<'a, EM, H, I, OT, S> Executor<I> for InProcessExecutor<'a, EM, H, I, OT, S> where
    H: FnMut(&[u8]) -> ExitKind,
    I: Input + HasTargetBytes,
    OT: ObserversTuple
[src]

fn run_target(&mut self, input: &I) -> Result<ExitKind, Error>[src]

Instruct the target about the input and run

impl<'a, EM, H, I, OT, S> HasExecHooks<EM, I, S> for InProcessExecutor<'a, EM, H, I, OT, S> where
    H: FnMut(&[u8]) -> ExitKind,
    I: Input + HasTargetBytes,
    OT: ObserversTuple
[src]

fn pre_exec(
    &mut self,
    _state: &mut S,
    _event_mgr: &mut EM,
    _input: &I
) -> Result<(), Error>
[src]

Called right before exexution starts

fn post_exec(
    &mut self,
    _state: &mut S,
    _event_mgr: &mut EM,
    _input: &I
) -> Result<(), Error>
[src]

Called right after execution finished.

impl<'a, EM, H, I, OT, S> HasObservers<OT> for InProcessExecutor<'a, EM, H, I, OT, S> where
    H: FnMut(&[u8]) -> ExitKind,
    I: Input + HasTargetBytes,
    OT: ObserversTuple
[src]

fn observers(&self) -> &OT[src]

Get the linked observers

fn observers_mut(&mut self) -> &mut OT[src]

Get the linked observers

impl<'a, EM, H, I, OT, S> HasObserversHooks<EM, I, OT, S> for InProcessExecutor<'a, EM, H, I, OT, S> where
    H: FnMut(&[u8]) -> ExitKind,
    I: Input + HasTargetBytes,
    OT: ObserversTuple + HasExecHooksTuple<EM, I, S>, 
[src]

fn pre_exec_observers(
    &mut self,
    state: &mut S,
    mgr: &mut EM,
    input: &I
) -> Result<(), Error>
[src]

Run the pre exec hook for all crate::observers::Observers linked to this Executor.

fn post_exec_observers(
    &mut self,
    state: &mut S,
    mgr: &mut EM,
    input: &I
) -> Result<(), Error>
[src]

Run the post exec hook for all the crate::observers::Observers linked to this Executor.

Auto Trait Implementations

impl<'a, EM, H, I, OT, S> RefUnwindSafe for InProcessExecutor<'a, EM, H, I, OT, S> where
    EM: RefUnwindSafe,
    H: RefUnwindSafe,
    I: RefUnwindSafe,
    OT: RefUnwindSafe,
    S: RefUnwindSafe

impl<'a, EM, H, I, OT, S> Send for InProcessExecutor<'a, EM, H, I, OT, S> where
    EM: Send,
    H: Send,
    I: Send,
    OT: Send,
    S: Send

impl<'a, EM, H, I, OT, S> Sync for InProcessExecutor<'a, EM, H, I, OT, S> where
    EM: Sync,
    H: Sync,
    I: Sync,
    OT: Sync,
    S: Sync

impl<'a, EM, H, I, OT, S> Unpin for InProcessExecutor<'a, EM, H, I, OT, S> where
    EM: Unpin,
    I: Unpin,
    OT: Unpin,
    S: Unpin

impl<'a, EM, H, I, OT, S> !UnwindSafe for InProcessExecutor<'a, EM, H, I, OT, S>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.