mirror of
https://github.com/JotaRandom/hfsutils.git
synced 2026-04-27 05:19:22 +00:00
Complete Bit-by-Bit Documentation: - Every byte of MDB documented with exact offset (162 bytes total) - All 16 bits of drAtrb explained individually with hex masks - drNxtCNID: Reserved CNIDs 1-15 fully documented - Volume name Pascal string format with byte examples - Extent records complete structure (12 bytes, 3 descriptors) Memory Layouts: - Complete volume layout from byte 0 to end - MDB field map with types and byte counts - Node descriptor (14 bytes) for B-trees - BTHeaderRec (106 bytes) complete structure - Extent descriptor byte-by-byte breakdown Critical Formulas: - Alternate MDB: device_size - 1024 (NOT sector-based) - Date conversion: Unix epoch offset (2082844800) - Y2K28 limit calculation - Volume size limits with 16-bit addressing Endianness Details: - Big-endian byte order for all multi-byte fields - Examples of 16-bit and 32-bit value storage - Code snippets showing correct/incorrect writing - Hex dump verification commands Oddities and Edge Cases: - BD signature origin mystery - Pascal vs C strings - MacRoman character encoding differences - Allocation block alignment requirements - 16-bit addressing limitations (65,535 blocks max) Verification: - xxd commands for checking every critical field - Expected hex output for validation - Common errors and how to detect them Goal: Complete reimplementation possible with only this document