Struct object::macho::DyldCacheHeader

source ·
#[repr(C)]
pub struct DyldCacheHeader<E: Endian> {
Show 14 fields pub magic: [u8; 16], pub mapping_offset: U32<E>, pub mapping_count: U32<E>, pub images_offset: U32<E>, pub images_count: U32<E>, pub dyld_base_address: U64<E>, pub local_symbols_offset: U64<E>, pub local_symbols_size: U64<E>, pub uuid: [u8; 16], pub subcaches_offset: U32<E>, pub subcaches_count: U32<E>, pub symbols_subcache_uuid: [u8; 16], pub images_across_all_subcaches_offset: U32<E>, pub images_across_all_subcaches_count: U32<E>, /* private fields */
}
Expand description

The dyld cache header. Corresponds to struct dyld_cache_header from dyld_cache_format.h. This header has grown over time. Only the fields up to and including dyld_base_address are guaranteed to be present. For all other fields, check the header size before accessing the field. The header size is stored in mapping_offset; the mappings start right after the theader.

Fields§

§magic: [u8; 16]

e.g. “dyld_v0 i386”

§mapping_offset: U32<E>

file offset to first dyld_cache_mapping_info

§mapping_count: U32<E>

number of dyld_cache_mapping_info entries

§images_offset: U32<E>

file offset to first dyld_cache_image_info

§images_count: U32<E>

number of dyld_cache_image_info entries

§dyld_base_address: U64<E>

base address of dyld when cache was built

§local_symbols_offset: U64<E>

file offset of where local symbols are stored

§local_symbols_size: U64<E>

size of local symbols information

§uuid: [u8; 16]

unique value for each shared cache file

§subcaches_offset: U32<E>

file offset to first dyld_subcache_info

§subcaches_count: U32<E>

number of dyld_subcache_info entries

§symbols_subcache_uuid: [u8; 16]

the UUID of the .symbols subcache

§images_across_all_subcaches_offset: U32<E>

file offset to first dyld_cache_image_info Use this instead of images_offset if mapping_offset is at least 0x1c4.

§images_across_all_subcaches_count: U32<E>

number of dyld_cache_image_info entries Use this instead of images_count if mapping_offset is at least 0x1c4.

Implementations§

source§

impl<E: Endian> DyldCacheHeader<E>

source

pub fn parse<'data, R: ReadRef<'data>>(data: R) -> Result<&'data Self>

Read the dyld cache header.

source

pub fn parse_magic(&self) -> Result<(Architecture, E)>

Returns (arch, endian) based on the magic string.

source

pub fn mappings<'data, R: ReadRef<'data>>( &self, endian: E, data: R, ) -> Result<&'data [DyldCacheMappingInfo<E>]>

Return the mapping information table.

source

pub fn subcaches<'data, R: ReadRef<'data>>( &self, endian: E, data: R, ) -> Result<Option<DyldSubCacheSlice<'data, E>>>

Return the information about subcaches, if present.

Returns None for dyld caches produced before dyld-940 (macOS 12).

source

pub fn symbols_subcache_uuid(&self, endian: E) -> Option<[u8; 16]>

Return the UUID for the .symbols subcache, if present.

source

pub fn images<'data, R: ReadRef<'data>>( &self, endian: E, data: R, ) -> Result<&'data [DyldCacheImageInfo<E>]>

Return the image information table.

Trait Implementations§

source§

impl<E: Clone + Endian> Clone for DyldCacheHeader<E>

source§

fn clone(&self) -> DyldCacheHeader<E>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<E: Debug + Endian> Debug for DyldCacheHeader<E>

source§

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

Formats the value using the given formatter. Read more
source§

impl<E: Copy + Endian> Copy for DyldCacheHeader<E>

source§

impl<E: Endian> Pod for DyldCacheHeader<E>

Auto Trait Implementations§

§

impl<E> Freeze for DyldCacheHeader<E>

§

impl<E> RefUnwindSafe for DyldCacheHeader<E>
where E: RefUnwindSafe,

§

impl<E> Send for DyldCacheHeader<E>
where E: Send,

§

impl<E> Sync for DyldCacheHeader<E>
where E: Sync,

§

impl<E> Unpin for DyldCacheHeader<E>
where E: Unpin,

§

impl<E> UnwindSafe for DyldCacheHeader<E>
where E: 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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.