pub struct DyldCache<'data, E = Endianness, R = &'data [u8]>{
endian: E,
data: R,
subcaches: Vec<DyldSubCache<'data, E, R>>,
mappings: &'data [DyldCacheMappingInfo<E>],
images: &'data [DyldCacheImageInfo<E>],
arch: Architecture,
}
Expand description
A parsed representation of the dyld shared cache.
Fields§
§endian: E
§data: R
§subcaches: Vec<DyldSubCache<'data, E, R>>
§mappings: &'data [DyldCacheMappingInfo<E>]
§images: &'data [DyldCacheImageInfo<E>]
§arch: Architecture
Implementations§
source§impl<'data, E, R> DyldCache<'data, E, R>
impl<'data, E, R> DyldCache<'data, E, R>
sourcepub fn parse(data: R, subcache_data: &[R]) -> Result<Self>
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, ...]
.
sourcepub fn architecture(&self) -> Architecture
pub fn architecture(&self) -> Architecture
Get the architecture type of the file.
sourcepub fn endianness(&self) -> Endianness
pub fn endianness(&self) -> Endianness
Get the endianness of the file.
sourcepub fn is_little_endian(&self) -> bool
pub fn is_little_endian(&self) -> bool
Return true if the file is little endian, false if it is big endian.
sourcepub fn images<'cache>(
&'cache self,
) -> DyldCacheImageIterator<'data, 'cache, E, R> ⓘ
pub fn images<'cache>( &'cache self, ) -> DyldCacheImageIterator<'data, 'cache, E, R> ⓘ
Iterate over the images in this cache.
sourcepub fn data_and_offset_for_address(&self, address: u64) -> Option<(R, u64)>
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§
Auto Trait Implementations§
impl<'data, E, R> Freeze for DyldCache<'data, E, R>
impl<'data, E, R> RefUnwindSafe for DyldCache<'data, E, R>where
E: RefUnwindSafe,
R: RefUnwindSafe,
impl<'data, E, R> Send for DyldCache<'data, E, R>
impl<'data, E, R> Sync for DyldCache<'data, E, R>
impl<'data, E, R> Unpin for DyldCache<'data, E, R>
impl<'data, E, R> UnwindSafe for DyldCache<'data, E, R>
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
Mutably borrows from an owned value. Read more