Pure-Rust forensic Apple Disk Image (DMG/UDIF) reader — every block codec, a Read + Seek virtual disk, zero C dependencies.
Decodes macOS DMG containers (UDIF): locates the 512-byte koly trailer at EOF, parses the embedded XML plist for partition block tables (blkx/mish), and serves the virtual sector stream through Read + Seek, decompressing blocks on demand. Every codec hdiutil emits is supported — ADC, zlib, bzip2, LZFSE, LZMA — all in pure Rust. #![forbid(unsafe_code)] is not used (the workspace denies unsafe), there are no C bindings, and the parser is fuzzed against malformed input.
[]
= "0.1" # imported as `dmg`
Quick start
use DmgReader;
use File;
use ;
// `open` takes any `Read + Seek` (a File, a Cursor, a decoded container…).
let mut reader = open?;
println!;
let mut sector = ;
reader.read_exact?; // first sector
reader.seek?; // seek anywhere
# Ok::
Because DmgReader is Read + Seek, it drops straight into any partition or filesystem analyzer that accepts a reader.
Supported block types
| Type | Value | Notes |
|---|---|---|
| Zero / Ignore | 0x00000000 / 0x00000002 |
sparse region → zero bytes |
| Raw | 0x00000001 |
stored verbatim |
| ADC | 0x80000004 |
Apple Data Compression (UDCO) |
| zlib | 0x80000005 |
UDZO |
| bzip2 | 0x80000006 |
UDBZ |
| LZFSE | 0x80000007 |
ULFO |
| LZMA | 0x80000008 |
ULMO (XZ-framed) |
Every codec is validated against real hdiutil-produced fixtures (each converts byte-identically to the raw image). Block sizes are bounded against the file and a per-block cap, so a malformed image fails loud rather than over-allocating.
Privacy Policy · Terms of Service · © 2026 Security Ronin Ltd