Struct CarefulOracle
pub struct CarefulOracle<'o, A: Arch, O: Oracle<A>> { /* private fields */ }
Expand description
An oracle that always executes Oracle::observe_carefully
.
Implementations§
§impl<'a, A: Arch, O: Oracle<A>> CarefulOracle<'a, A, O>
impl<'a, A: Arch, O: Oracle<A>> CarefulOracle<'a, A, O>
pub fn new(oracle: &'a mut O) -> Self
pub fn new(oracle: &'a mut O) -> Self
Wraps oracle
in a CarefulOracle
.
Trait Implementations§
§impl<'o, A: Arch, O: Oracle<A>> Oracle<A> for CarefulOracle<'o, A, O>
impl<'o, A: Arch, O: Oracle<A>> Oracle<A> for CarefulOracle<'o, 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 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 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 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<'o, A, O> Freeze for CarefulOracle<'o, A, O>
impl<'o, A, O> RefUnwindSafe for CarefulOracle<'o, A, O>where
O: RefUnwindSafe,
A: RefUnwindSafe,
impl<'o, A, O> Send for CarefulOracle<'o, A, O>where
O: Send,
impl<'o, A, O> Sync for CarefulOracle<'o, A, O>where
O: Sync,
impl<'o, A, O> Unpin for CarefulOracle<'o, A, O>where
A: Unpin,
impl<'o, A, O> !UnwindSafe for CarefulOracle<'o, A, O>
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