Enum goblin::mach::exports::ExportInfo

source ·
pub enum ExportInfo<'a> {
    Regular {
        address: u64,
        flags: u64,
    },
    Reexport {
        lib: &'a str,
        lib_symbol_name: Option<&'a str>,
        flags: u64,
    },
    Stub {
        stub_offset: Uleb128,
        resolver_offset: Uleb128,
        flags: u64,
    },
}
Expand description

An export can be a regular export, a re-export, or a stub

Variants§

§

Regular

A regular exported symbol, which is an address where it is found, and the flags associated with it

Fields

§address: u64
§flags: u64
§

Reexport

if lib_symbol_name None then same symbol name, otherwise reexport of lib_symbol_name with name in the trie “If the string is zero length, then the symbol is re-export from the specified dylib with the same name”

Fields

§lib: &'a str
§lib_symbol_name: Option<&'a str>
§flags: u64
§

Stub

If the flags is EXPORT_SYMBOL_FLAGS_STUB_AND_RESOLVER, then following the flags are two Uleb128s: the stub offset and the resolver offset. The stub is used by non-lazy pointers. The resolver is used by lazy pointers and must be called to get the actual address to use

Fields

§stub_offset: Uleb128
§resolver_offset: Uleb128
§flags: u64

Implementations§

source§

impl<'a> ExportInfo<'a>

source

pub fn parse( bytes: &'a [u8], libs: &[&'a str], flags: u64, offset: usize ) -> Result<ExportInfo<'a>>

Parse out the export info from bytes, at offset

Trait Implementations§

source§

impl<'a> Debug for ExportInfo<'a>

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> Freeze for ExportInfo<'a>

§

impl<'a> RefUnwindSafe for ExportInfo<'a>

§

impl<'a> Send for ExportInfo<'a>

§

impl<'a> Sync for ExportInfo<'a>

§

impl<'a> Unpin for ExportInfo<'a>

§

impl<'a> UnwindSafe for ExportInfo<'a>

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

§

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

§

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.