liblisa::oracle

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>

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>

§

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

Formats the value using the given formatter. Read more
§

impl<A: Arch, O: Oracle<A>> Oracle<A> for InvocationCountingOracle<A, O>

§

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

The memory addresses that can be mapped by this oracle.
§

fn mappable_area(&self) -> Self::MappableArea

Returns the memory addresses that can be mapped by this oracle.
§

fn page_size(&mut self) -> u64

Returns the page size of the oracle.
§

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)

Prints debugging information about the oracle.
§

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 restart(&mut self)

Restart the oracle, if possible.
§

fn kill(self)

Kills the oracle, if possible.
§

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>>

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>

Returns a random mappable page.
§

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]

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>

§

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>
where O: Unpin, A: Unpin,

§

impl<A, O> UnwindSafe for InvocationCountingOracle<A, O>
where O: UnwindSafe, A: UnwindSafe,

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, W> HasTypeWitness<W> for T
where W: MakeTypeWitness<Arg = T>, T: ?Sized,

§

const WITNESS: W = W::MAKE

A constant of the type witness
§

impl<T> Identity for T
where T: ?Sized,

§

const TYPE_EQ: TypeEq<T, <T as Identity>::Type> = TypeEq::NEW

Proof that Self is the same type as Self::Type, provides methods for casting between Self and Self::Type.
§

type Type = T

The same type as Self, used to emulate type equality bounds (T == U) with associated type equality constraints (T: Identity<Type = U>).
Source§

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

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<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V