Struct object::read::macho::DyldCache

source ·
pub struct DyldCache<'data, E = Endianness, R = &'data [u8]>
where E: Endian, R: ReadRef<'data>,
{ /* private fields */ }
Expand description

A parsed representation of the dyld shared cache.

Implementations§

source§

impl<'data, E, R> DyldCache<'data, E, R>
where E: Endian, R: ReadRef<'data>,

source

pub fn parse(data: R, subcache_data: &[R]) -> Result<Self>

Parse the raw dyld shared cache data.

For shared caches from macOS 12 / iOS 15 and above, the subcache files need to be supplied as well, in the correct order, with the .symbols subcache last (if present). For example, data would be the data for dyld_shared_cache_x86_64, and subcache_data would be the data for [dyld_shared_cache_x86_64.1, dyld_shared_cache_x86_64.2, ...].

source

pub fn architecture(&self) -> Architecture

Get the architecture type of the file.

source

pub fn endianness(&self) -> Endianness

Get the endianness of the file.

source

pub fn is_little_endian(&self) -> bool

Return true if the file is little endian, false if it is big endian.

source

pub fn images<'cache>( &'cache self ) -> DyldCacheImageIterator<'data, 'cache, E, R>

Iterate over the images in this cache.

source

pub fn data_and_offset_for_address(&self, address: u64) -> Option<(R, u64)>

Find the address in a mapping and return the cache or subcache data it was found in, together with the translated file offset.

Trait Implementations§

source§

impl<'data, E, R> Debug for DyldCache<'data, E, R>
where E: Endian + Debug, R: ReadRef<'data> + Debug,

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'data, E, R> RefUnwindSafe for DyldCache<'data, E, R>

§

impl<'data, E, R> Send for DyldCache<'data, E, R>
where E: Send + Sync, R: Send,

§

impl<'data, E, R> Sync for DyldCache<'data, E, R>
where E: Sync, R: Sync,

§

impl<'data, E, R> Unpin for DyldCache<'data, E, R>
where E: Unpin, R: Unpin,

§

impl<'data, E, R> UnwindSafe for DyldCache<'data, E, R>

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.