Module dsc

Module dsc 

Expand description

Module for Dyld shared cache support

§Getting Started

let dyld_cache = lief::dsc::from_path("macos-15.0.1/");
for dylib in dyld_cache.libraries() {
    println!("0x{:016x}: {}", dylib.address(), dylib.path());
    let macho: lief::macho::Binary = dylib.get().expect("Can't get Mach-O representation");
}

§Performance Considerations

If you aim at extracting several libraries from a dyld shared cache, it is highly recommended to enable caching. Otherwise, performances can be impacted.

See: crate::dsc::enable_cache and crate::dsc::enable_cache_from_dir

Modules§

dyld_shared_cache
dylib
mapping_info
subcache
uuid

Structs§

DyldSharedCache
This struct interfaces a dyld shared cache file.
Dylib
This structure represents a library embedded in a dyld shared cache. It mirrors the original dyld_cache_image_info structure.
MappingInfo
This structure represents a dyld_cache_mapping_info entry.
SubCache
This class represents a subcache in the case of large/split dyld shared cache.

Functions§

enable_cache
Enable globally cache/memoization. One can also leverage this function by setting the environment variable DYLDSC_ENABLE_CACHE to 1
enable_cache_from_dir
Same behavior as enable_cache but with a user-provided cache directory
is_shared_cache
Check if the given file is a dyld shared cache
load_from_files
load_from_path
Load a shared cache from a single file or from a directory specified by the path parameter.

Type Aliases§

UUID
UUID used in different places of the shared cache