Expand description
Kernelcache parsing, search, and extraction.
Supports Mach-O kernel collections (MH_FILESET) and legacy prelinked
kernels (MH_EXECUTE with __PRELINK_INFO), either raw or wrapped in IMG4
or IM4P containers and compressed with LZFSE or complzss.
File offsets in fileset members are collection-relative. Legacy prelinked kexts use image-relative offsets and are located through prelink metadata. Extracted images retain unslid virtual addresses and are intended for static analysis.
§Example
use dylex::KernelCacheContext;
fn main() -> dylex::Result<()> {
let cache = KernelCacheContext::open("kernelcache.release.mac16j")?;
let sandbox = cache.resolve_image("com.apple.security.sandbox")?;
std::fs::write("sandbox.macho", cache.extract_image(sandbox)?)?;
Ok(())
}Structs§
- Collection
Identity - Build identities read from a kernelcache.
- Discovery
Command - One captured command execution. Standard output and error are kept separate.
- Input
Encoding - Container and compression removed while decoding the input.
- Kernel
Cache Context - A decoded kernelcache with validated embedded Mach-O headers.
- Kernel
Candidate - The inspection result for one candidate kernelcache.
- Kernel
Discovery Report - Runtime identities, inspected candidates, command evidence, and issues.
- Kernel
Image - The kernel or an executable kext embedded in a kernelcache.
- Kernel
Uuid - A 128-bit Mach-O build UUID.
Enums§
- Compression
- Compression applied to a kernelcache payload.
- Container
- Container format that wrapped a kernelcache payload.
- Kernel
Cache Format - Layout of a decoded kernelcache.
Constants§
- KERNEL_
IMAGE_ ID - Image ID of the kernel itself.
Functions§
- discover_
kernelcaches - Locates boot kernelcaches matching the running macOS kernel and, optionally,
the loaded kext whose bundle identifier is exactly
target.