pub struct DyldCache {
pub header: DyldCacheHeader,
pub mappings: Vec<CacheMapping>,
pub images: Vec<CacheImage>,
}Expand description
Read-only index of a dyld shared cache file.
Supports enumeration and extraction of embedded Mach-O images without
modifying the cache. Extracted image slices can be fed directly into
crate::format::parse for normal inspection.
Fields§
§header: DyldCacheHeaderThe header field.
mappings: Vec<CacheMapping>The mappings field.
images: Vec<CacheImage>The images field.
Implementations§
Source§impl DyldCache
impl DyldCache
Sourcepub fn images(&self) -> &[CacheImage]
pub fn images(&self) -> &[CacheImage]
List all embedded images.
Sourcepub fn mappings(&self) -> &[CacheMapping]
pub fn mappings(&self) -> &[CacheMapping]
List cache memory mappings.
Sourcepub fn va_to_file_offset(&self, va: u64) -> Option<u64>
pub fn va_to_file_offset(&self, va: u64) -> Option<u64>
Convert a virtual address to a file offset using the mapping table.
Sourcepub fn extract_image<'data>(
&self,
index: usize,
data: &'data [u8],
) -> Result<&'data [u8]>
pub fn extract_image<'data>( &self, index: usize, data: &'data [u8], ) -> Result<&'data [u8]>
Extract the Mach-O bytes for the image at the given index.
Returns a slice into the original cache data that starts at the image’s
mapped location. When the image has a known text_size, that is used
as the slice length. Otherwise the slice extends to the next image
boundary or mapping end. The returned slice can be passed to
crate::format::parse.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DyldCache
impl RefUnwindSafe for DyldCache
impl Send for DyldCache
impl Sync for DyldCache
impl Unpin for DyldCache
impl UnsafeUnpin for DyldCache
impl UnwindSafe for DyldCache
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