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§
Structs§
- Dyld
Shared Cache - 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. - Mapping
Info - 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
to1
- 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