Что такое формат файла CHD?
.chd - short for Compressed Hunks of Data - is a binary disk-image container developed by the MAME project. It stores arcade machine hard disks, CD-ROMs, DVDs, and LaserDisc media in a compressed form that emulators can stream efficiently.
The format divides the source media into fixed-size units called *hunks*. Each hunk is compressed independently, so the emulator decompresses only the hunk it needs rather than the entire image. Up to four compression codecs can be active in a single file: Deflate (cdzl), LZMA (cdlz), custom Huffman (huff), and FLAC (cdfl) for CD audio tracks. A typical .chd is 30-60 % smaller than the equivalent .iso or .cue+.bin source.
Every .chd begins with the 8-byte magic string MComprHD at file offset 0, followed by a big-endian header that records:
- format version (v4 or current v5)
- active codec list and total uncompressed size
- SHA-1 hashes of both the raw data and the full file
MAME validates both hashes at load time and rejects images whose hash does not match its database entry.
The chdman command-line tool, bundled with MAME, creates, verifies, and converts .chd files. Conversion back to a .bin raw image is fully lossless. Re-archiving a .chd inside a ZIP saves negligible space and breaks emulator detection, so it is discouraged.
Безопасность и защита
РИСК: LOWCHD is inert image data with no executable code, and it carries SHA-1 hashes so a tampered or corrupt file is detected on load. The practical caution is legal, not technical: distributing or downloading CHDs of copyrighted games is usually piracy - dump discs you own with chdman. Avoid shady "CHD converter" websites that bundle adware; chdman from mamedev.org is free.
Детали формата
в двух словахПрограммы, открывающие файлы CHD
Технические подробности
глубокая спецификация| Magic bytes | MComprHD (8 ASCII bytes) at file offset 0, followed by a 4-byte big-endian header length |
| Byte order | Big-endian |
| Encoding | Binary |
| Container structure | Header → hunk map → per-hunk compressed data blocks → tagged metadata records |
| Compression codecs | Up to four simultaneous codecs per file: Deflate (cdzl), LZMA (cdlz), Huffman (huff), FLAC (cdfl) for CD audio |
| Hunk size | Power-of-two byte count fixed at creation time (typically 4 KB - 512 KB); uniform for every hunk in the file |
| Integrity checksums | SHA-1 of raw uncompressed content + SHA-1 of the complete CHD file, both stored in the header; MAME enforces both at load time |
| Media types | Hard-disk images, CD-ROM, DVD, LaserDisc, and raw sector media |
| Metadata blocks | Tagged key-value records embedded after the hunk map: CD track layout, HDD geometry, drive identity strings |
| Typical compression ratio | 30-60 % smaller than an equivalent ISO or CUE+BIN source |
| Developer | MAMEdev (the MAME project) |
| Supported platforms | Windows, macOS, Linux, Android |
| Lossless round-trip | chdman can reconstruct the exact original ISO, BIN, GDI, or raw image with no data loss |
| Format versions | v4 and v5 in common use; version encoded as a 4-byte big-endian integer immediately after the magic tag |
| Выпущен | 2002 (MAME, originally for hard-disk-based arcade games) |
| Последняя версия | CHD v5 (current header/map format) |
| Открыть стандартное | Да · без роялти |
| Спецификация | docs.mamedev.org |
Конвертации CHD
Вопросы и ответы сообщества
спрошено пользователямиВопросов пока нет - станьте первым, кто спросит о файлах CHD.