Struct InvocationCountingOracle
pub struct InvocationCountingOracle<A: Arch, O: Oracle<A>> { /* private fields */ }
Expand description
An oracle that counts how many times it was invoked.
Implementations§
§impl<A: Arch, O: Oracle<A>> InvocationCountingOracle<A, O>
impl<A: Arch, O: Oracle<A>> InvocationCountingOracle<A, O>
pub fn new(oracle: O) -> Self
pub fn new(oracle: O) -> Self
Wraps oracle
in an invocation-counting oracle.
Trait Implementations§
§impl<A: Arch, O: Oracle<A>> Debug for InvocationCountingOracle<A, O>
impl<A: Arch, O: Oracle<A>> Debug for InvocationCountingOracle<A, O>
§impl<A: Arch, O: Oracle<A>> Oracle<A> for InvocationCountingOracle<A, O>
impl<A: Arch, O: Oracle<A>> Oracle<A> for InvocationCountingOracle<A, O>
§const UNRELIABLE_INSTRUCTION_FETCH_ERRORS: bool = O::UNRELIABLE_INSTRUCTION_FETCH_ERRORS
const UNRELIABLE_INSTRUCTION_FETCH_ERRORS: bool = O::UNRELIABLE_INSTRUCTION_FETCH_ERRORS
Set to true if the instruction fetch errors are unreliable.
§type MappableArea = <O as Oracle<A>>::MappableArea
type MappableArea = <O as Oracle<A>>::MappableArea
The memory addresses that can be mapped by this oracle.
§fn mappable_area(&self) -> Self::MappableArea
fn mappable_area(&self) -> Self::MappableArea
Returns the memory addresses that can be mapped by this oracle.
§fn observe(
&mut self,
before: &SystemState<A>,
) -> Result<SystemState<A>, OracleError>
fn observe( &mut self, before: &SystemState<A>, ) -> Result<SystemState<A>, OracleError>
Observes the output state after executing a single instruction in the
before
state.§fn debug_dump(&mut self)
fn debug_dump(&mut self)
Prints debugging information about the oracle.
§fn scan_memory_accesses(
&mut self,
before: &SystemState<A>,
) -> Result<Vec<Addr>, OracleError>
fn scan_memory_accesses( &mut self, before: &SystemState<A>, ) -> Result<Vec<Addr>, OracleError>
Uses debugging registers to determine all memory addresses accessed by the instruction.
If this is not supported, returns an empty
Vec
.§fn batch_observe_iter<'a, S: AsSystemState<A> + 'a, I: IntoIterator<Item = S> + 'a>(
&'a mut self,
states: I,
) -> impl Iterator<Item = Observation<S, A>>
fn batch_observe_iter<'a, S: AsSystemState<A> + 'a, I: IntoIterator<Item = S> + 'a>( &'a mut self, states: I, ) -> impl Iterator<Item = Observation<S, A>>
Performs many observations in one go.
Behaves idential to
Self::observe
, but is much more efficient.§fn batch_observe_gpreg_only_iter<'a, S: AsSystemState<A> + 'a, I: IntoIterator<Item = S> + 'a>(
&'a mut self,
states: I,
) -> impl Iterator<Item = Observation<S, A>>
fn batch_observe_gpreg_only_iter<'a, S: AsSystemState<A> + 'a, I: IntoIterator<Item = S> + 'a>( &'a mut self, states: I, ) -> impl Iterator<Item = Observation<S, A>>
Performs many observations in one go.
Only reads and writes the general-purpose registers.
Other registers may have arbitrary values.
§fn random_mappable_page(&self, rng: &mut impl Rng) -> Page<A>
fn random_mappable_page(&self, rng: &mut impl Rng) -> Page<A>
Returns a random mappable page.
§fn observe_carefully(
&mut self,
before: &SystemState<A>,
) -> Result<SystemState<A>, OracleError>
fn observe_carefully( &mut self, before: &SystemState<A>, ) -> Result<SystemState<A>, OracleError>
Observes the output state after executing a single instruction in the
before
state.
If possible, uses debugging registers to exhaustively check the exact memory locations that are accessed.
Returns a memory access error if a memory is accessed that is not set in before
. Read more§fn batch_observe<'a, const N: usize, S: AsSystemState<A> + 'a>(
&mut self,
states: [S; N],
) -> [Observation<S, A>; N]
fn batch_observe<'a, const N: usize, S: AsSystemState<A> + 'a>( &mut self, states: [S; N], ) -> [Observation<S, A>; N]
Performs many observations in one go.
Behaves idential to
Self::observe
, but is much more efficient.Auto Trait Implementations§
impl<A, O> Freeze for InvocationCountingOracle<A, O>where
O: Freeze,
impl<A, O> RefUnwindSafe for InvocationCountingOracle<A, O>where
O: RefUnwindSafe,
A: RefUnwindSafe,
impl<A, O> Send for InvocationCountingOracle<A, O>where
O: Send,
impl<A, O> Sync for InvocationCountingOracle<A, O>where
O: Sync,
impl<A, O> Unpin for InvocationCountingOracle<A, O>
impl<A, O> UnwindSafe for InvocationCountingOracle<A, O>where
O: UnwindSafe,
A: UnwindSafe,
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
Mutably borrows from an owned value. Read more
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more