Struct lief::macho::Stub

pub struct Stub<'a> { /* private fields */ }
Expand description

This class represents a stub entry in sections like __stubs,__auth_stubs.

It wraps assembly instructions which are used to access the got where the address of the symbol is resolved.

Example:

0000000236a3c1bc: ___memcpy_chk
  adrp            x17, #0x241513aa8
  add             x17, x17, #0x241513aa8
  ldr             x16, [x17]
  braa            x16, x17

Implementations§

§

impl Stub<'_>

pub fn address(&self) -> u64

The virtual address where the stub is located

pub fn raw(&self) -> &[u8]

The (raw) instructions of this entry as a slice of bytes

pub fn target(&self) -> Result<u64, Error>

For instance, given this stub:

0x3eec: adrp    x16, #4096
0x3ef0: ldr     x16, [x16, #24]
0x3ef4: br      x16

The function returns: 0x4018.

This function is only available with LIEF's extended version

Trait Implementations§

§

impl Debug for Stub<'_>

§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for Stub<'a>

§

impl<'a> !Send for Stub<'a>

§

impl<'a> !Sync for Stub<'a>

§

impl<'a> Unpin for Stub<'a>

§

impl<'a> UnwindSafe for Stub<'a>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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 Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.