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>
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<DyldSubCacheSlice<'data, E>>>
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).
sourcepub fn symbols_subcache_uuid(&self, endian: E) -> Option<[u8; 16]>
pub fn symbols_subcache_uuid(&self, endian: E) -> Option<[u8; 16]>
Return the UUID for the .symbols subcache, if present.
sourcepub fn images<'data, R: ReadRef<'data>>(
&self,
endian: E,
data: R,
) -> Result<&'data [DyldCacheImageInfo<E>]>
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>
impl<E: Clone + Endian> Clone for DyldCacheHeader<E>
source§fn clone(&self) -> DyldCacheHeader<E>
fn clone(&self) -> DyldCacheHeader<E>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreimpl<E: Copy + Endian> Copy for DyldCacheHeader<E>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)