Crate dylex

Crate dylex 

Source
Expand description

dylex - A high-performance dyld shared cache extractor.

This library provides functionality for extracting Mach-O images from Apple’s dyld shared cache. The extraction process reverses the optimizations applied by the SharedCacheBuilder to produce standalone dylib files.

§Features

  • Fast memory-mapped file I/O
  • Support for split caches (iOS 15+, macOS 12+)
  • Slide info processing (v2, v3, v5)
  • LINKEDIT optimization
  • Stub fixing
  • ObjC metadata restoration

§Example

use std::sync::Arc;
use dylex::{DyldContext, extract_image};

fn main() -> dylex::Result<()> {
    let cache = Arc::new(DyldContext::open("/path/to/dyld_shared_cache")?);

    // Find an image
    let image = cache.find_image("UIKit").expect("UIKit not found");

    // Extract it
    extract_image(&cache, &image.path, "output/UIKit")?;

    Ok(())
}

Re-exports§

pub use dyld::DyldContext;
pub use dyld::ImageEntry;
pub use dyld::MappingEntry;
pub use error::Error;
pub use error::Result;
pub use macho::MachOContext;

Modules§

arm64
ARM64 instruction encoding and decoding.
converter
Converters for extracting images from the dyld shared cache.
dyld
Dyld shared cache handling.
error
Error types for the dyld cache extractor.
macho
Mach-O file format handling.

Structs§

ExtractionOptions
Options for image extraction.

Functions§

extract_image
Extracts a single image from the cache.
extract_image_with_options
Extracts a single image from the cache with custom options.
find_images
Finds images matching a filter.
list_images
Lists all images in the cache.