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
sourceimpl<E: Endian> DyldCacheHeader<E>
impl<E: Endian> DyldCacheHeader<E>
sourcepub fn parse<'data, R: ReadRef<'data>>(data: R) -> Result<&'data Self>
pub fn parse<'data, R: ReadRef<'data>>(data: R) -> Result<&'data Self>
Read the dyld cache header.
sourcepub fn parse_magic(&self) -> Result<(Architecture, E)>
pub fn parse_magic(&self) -> Result<(Architecture, E)>
Returns (arch, endian) based on the magic string.
sourcepub fn mappings<'data, R: ReadRef<'data>>(
&self,
endian: E,
data: R
) -> Result<&'data [DyldCacheMappingInfo<E>]>
pub fn mappings<'data, R: ReadRef<'data>>(
&self,
endian: E,
data: R
) -> Result<&'data [DyldCacheMappingInfo<E>]>
Return the mapping information table.
sourcepub fn subcaches<'data, R: ReadRef<'data>>(
&self,
endian: E,
data: R
) -> Result<Option<&'data [DyldSubCacheInfo<E>]>>
pub fn subcaches<'data, R: ReadRef<'data>>(
&self,
endian: E,
data: R
) -> Result<Option<&'data [DyldSubCacheInfo<E>]>>
Return the information about subcaches, if present.
Trait Implementations
sourceimpl<E: Clone + Endian> Clone for DyldCacheHeader<E>
impl<E: Clone + Endian> Clone for DyldCacheHeader<E>
sourcefn clone(&self) -> DyldCacheHeader<E>
fn clone(&self) -> DyldCacheHeader<E>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<E: Debug + Endian> Debug for DyldCacheHeader<E>
impl<E: Debug + Endian> Debug for DyldCacheHeader<E>
impl<E: Copy + Endian> Copy for DyldCacheHeader<E>
impl<E: Endian> Pod for DyldCacheHeader<E>
Auto Trait Implementations
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more