Skip to main content

Spec

Struct Spec 

Source
pub struct Spec {
    pub addr: u64,
    /* private fields */
}
Expand description

One declared expectation for a function, checked against the binary’s facts.

Fields§

§addr: u64

Implementations§

Source§

impl Spec

Source

pub fn new(addr: u64) -> Spec

Source

pub fn calls_exact(self, t: &[u64]) -> Spec

Declared CALL set must EQUAL the binary’s (flags hallucinated + missing).

Source

pub fn calls_superset(self, t: &[u64]) -> Spec

No declared CALL may be absent (hallucination-only; tolerates inlined/unported).

Source

pub fn fields(self, t: &[u64]) -> Spec

Each declared field offset must be touched by the binary (present-check).

Source

pub fn globals(self, t: &[u64]) -> Spec

Source

pub fn vtables(self, t: &[u64]) -> Spec

Source

pub fn vcall_slots(self, t: &[u64]) -> Spec

Source

pub fn indirect_targets(self, t: &[u64]) -> Spec

Declared stack-slot/register indirect-call targets (acceptance-only).

Source

pub fn iat(self, t: &[u64]) -> Spec

Source

pub fn check(&self, pe: &Pe) -> Result<(), String>

Check this spec against the binary; Err lists every violation.

Source

pub fn check_at(&self, manifest_dir: &str, exe: &str)

Load <manifest_dir>/<exe> and panic on any violation (for #[test]s).

Trait Implementations§

Source§

impl Default for Spec

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Forget for Spec

§

impl Freeze for Spec

§

impl RefUnwindSafe for Spec

§

impl Send for Spec

§

impl Sync for Spec

§

impl Unpin for Spec

§

impl UnsafeUnpin for Spec

§

impl UnwindSafe for Spec

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.

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.