himddiskformat
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
himddiskformat [2009/09/30 16:37] – Expanded Codec specific info with data from the ffmpeg oma demuxer (oma files also have this 3-byte-filed) megadiscman | himddiskformat [2011/09/04 12:49] – [The Track-Index File] megadiscman | ||
---|---|---|---|
Line 138: | Line 138: | ||
==== The file mclist0X.hma ==== | ==== The file mclist0X.hma ==== | ||
- | The filename " | + | The filename " |
+ | Furthermore, | ||
+ | The final authentication is done by combining checksums of the medium-specific and the track-specific parts into a master " | ||
- | The contents of " | + | The contents of " |
< | < | ||
Line 152: | Line 154: | ||
</ | </ | ||
- | It contains information | + | The MAC list file is divided into three parts. The first 16 bytes are the file header, the next 80 bytes are for disc authentication and the remaining part is for track authentication. Both authentication parts start with an encrypted 3DES key used for authentication, |
+ | |||
+ | < | ||
+ | 0000 BYTES magic signature " | ||
+ | 0004 DWORD unknown purpose | ||
+ | 0008 BYTES 8 unknown bytes, always zero, maybe padding. | ||
+ | |||
+ | 0010 BYTES 16 bytes encrypted 3DES key for authenticating | ||
+ | 0020 DWORD Generation number of the DRM info | ||
+ | 0024 BYTES 20 unknown bytes, always zero, maybe padding | ||
+ | 0038 DWORD | ||
+ | 003C DWORD 4 unknown bytes, always zero, maybe padding | ||
+ | 0040 BYTES 16 bytes disc ID. This is a copy of the real disc ID stored outside of the file system | ||
+ | 0050 BYTES 16 unknown bytes, always zero, maybe padding | ||
+ | |||
+ | 0060 BYTES 16 bytes encrypted 3DES key for authenticating | ||
+ | 0070 BYTES 4000 * 8 bytes MAC values of tracks. Intersting count, as Hi-MD only has 2048 tracks. | ||
+ | </ | ||
- | The fields at offset 10h and 60h are presumably encryption keys for 3DES. It's not yet confirmed, whether those are the keys in cleartext or those are the keys in an encrypted form themselves. | ||
==== The file 00010012.hma ==== | ==== The file 00010012.hma ==== | ||
Line 160: | Line 178: | ||
This file contains the " | This file contains the " | ||
- | ==== The Audio-Data File ==== | + | ==== The Audio Data File ==== |
- | The audio-data file contains the raw audio-data. | + | The audio data file contains the raw audio data. |
It is divided into 16k blocks of the following layout | It is divided into 16k blocks of the following layout | ||
< | < | ||
- | 0000 DWORD Block Type (" | + | 0000 DWORD Block Type (" |
- | 0004 WORD | + | 0004 WORD |
0006 WORD " | 0006 WORD " | ||
- | 0008 WORD Data size in bytes (for MP3) | + | 0008 WORD Data size in bytes (MP3 blocks only) |
000A WORD | 000A WORD | ||
000C DWORD Serial number of block in stream | 000C DWORD Serial number of block in stream | ||
- | 0010 BYTES | + | 0010 BYTES |
- | 0018 BYTES | + | 0018 BYTES |
- | 0020 BYTES up to 3FC0 of encrypted audio data | + | 0020 BYTES up to 3FC0 of encrypted audio data (ATRAC never uses all 3FC0 bytes) |
- | 3FE0 BYTES | + | 3FE0 BYTES |
3FE8 BYTES 8 bytes reserved | 3FE8 BYTES 8 bytes reserved | ||
3FF0 DWORD backup of Block Type | 3FF0 DWORD backup of Block Type | ||
3FF4 WORD | 3FF4 WORD | ||
3FF6 WORD | 3FF6 WORD | ||
- | 3FF8 DWORD | + | 3FF8 DWORD |
3FFC DWORD backup of serial number | 3FFC DWORD backup of serial number | ||
</ | </ | ||
- | In case of MP3-audio, the data is XOR encrypted. The key for encryption is created from the DiscID which read/ | + | In case of MP3 audio, the data is XOR encrypted. The key for encryption is created from the DiscID which read/ |
+ | Each audio block contains only complete frames. The space in the audio block after the last complete frame is unused - which is especially wasteful for 352kbit/s ATRAC3+, as the frame size is exactly 2K, so 1984 bytes per frame are ignored, i.e. 12% of the block size. | ||
==== The _MDHIFI.HMA File ==== | ==== The _MDHIFI.HMA File ==== | ||
Line 272: | Line 291: | ||
< | < | ||
0000 DWORD - date of recording (FAT format, 16 bit date, 16 bit time of day) | 0000 DWORD - date of recording (FAT format, 16 bit date, 16 bit time of day) | ||
- | 0004 DWORD + " | + | 0004 DWORD ! " |
0008 WORD - Title (string number) | 0008 WORD - Title (string number) | ||
000A WORD - Artist (string number) | 000A WORD - Artist (string number) | ||
Line 278: | Line 297: | ||
000E BYTE - Track number (within Album, not on MD) | 000E BYTE - Track number (within Album, not on MD) | ||
000F BYTE - " | 000F BYTE - " | ||
- | 0010 8 BYTES + MgrCK (upload requirement: | + | 0010 8 BYTES ! MgrCK (upload requirement: |
0018 8 BYTES CMac | 0018 8 BYTES CMac | ||
- | 0020 BYTE | + | 0020 BYTE |
- | 0021 3 BYTES ? Codec specific info | + | 0021 3 BYTES - Codec specific info |
- | 0024 WORD | + | 0024 WORD |
- | 0026 WORD | + | 0026 WORD |
- | 0028 WORD | + | 0028 WORD |
- | 002A BYTE | + | 002A BYTE |
- | 002B BYTE | + | 002B BYTE |
002C WORD + More codec specific info | 002C WORD + More codec specific info | ||
002E WORD + reserved | 002E WORD + reserved | ||
0030 20 BYTE + Content ID (for Mac Transferred Data: 02 03 00 00 + 16 random bytes) | 0030 20 BYTE + Content ID (for Mac Transferred Data: 02 03 00 00 + 16 random bytes) | ||
- | 0044 DWORD + Start time (FAT format) | + | 0044 DWORD + Start of playback license validity |
- | 0048 DWORD + End time (FAT format) | + | 0048 DWORD + End of playback license validity |
004C BYTE + " | 004C BYTE + " | ||
- | 004D BYTE | + | 004D BYTE |
- | 004E BYTE | + | 004E BYTE |
004F BYTE + " | 004F BYTE + " | ||
</ | </ | ||
- | The +/-/? means: " | + | The +/-/! means: " |
" | " | ||
Line 310: | Line 329: | ||
* 0021 Bit 1: Set for joint stereo (LP4) | * 0021 Bit 1: Set for joint stereo (LP4) | ||
* 0022 Bit 7-5: Sample rate | * 0022 Bit 7-5: Sample rate | ||
- | ** 00: 32kHz | + | |
- | ** 20: 44.1kHz | + | * 20: 44.1kHz |
- | ** 40: 48kHz | + | * 40: 48kHz |
- | ** 60: 88.2kHz | + | * 60: 88.2kHz |
- | ** 80: 96kHz | + | * 80: 96kHz |
* 0023 Bit 5-0: Frame size in 8 bytes units | * 0023 Bit 5-0: Frame size in 8 bytes units | ||
- | ** 18: (Frame size 192 bytes) 66 kbit/s (LP4) | + | |
- | ** 26: (Frame size 304 bytes) 105 kbit/s | + | * 26: (Frame size 304 bytes) 105 kbit/s |
- | ** 30: (Frame size 384 bytes) 132 kbit/s (LP2) | + | * 30: (Frame size 384 bytes) 132 kbit/s (LP2) |
== Codec specific info for ATRAC3+ == | == Codec specific info for ATRAC3+ == | ||
* 0022 Bit 7-5: Sample rate (like ATRAC3) | * 0022 Bit 7-5: Sample rate (like ATRAC3) | ||
- | ** 00: 32kHz | + | |
- | ** 20: 44.1kHz | + | * 20: 44.1kHz |
- | ** 40: 48kHz | + | * 40: 48kHz |
- | ** 60: 88.2kHz | + | * 60: 88.2kHz |
- | ** 80: 96kHz | + | * 80: 96kHz |
* 0022 Bit 4-2: Number of Channels | * 0022 Bit 4-2: Number of Channels | ||
- | ** 04: Mono | + | |
- | ** 08: Stereo | + | * 08: Stereo |
* 0023 Frame size in 8 bytes units (-1) | * 0023 Frame size in 8 bytes units (-1) | ||
- | ** 17: (Frame size 192 bytes) 32 kbit/s | + | |
- | ** 22: (Frame size 280 bytes) 48 kbit/s | + | * 22: (Frame size 280 bytes) 48 kbit/s |
- | ** 2E: (Frame size 376 bytes) 64 kbit/s (Hi-LP) | + | * 2E: (Frame size 376 bytes) 64 kbit/s (Hi-LP) |
- | ** 8B: (Frame size 1120 bytes) 192 kbit/s | + | * 8B: (Frame size 1120 bytes) 192 kbit/s |
- | ** B9: (Frame size 1488 bytes) 256 kbit/s (Hi-SP) | + | * B9: (Frame size 1488 bytes) 256 kbit/s (Hi-SP) |
- | ** FF: (Frame size 2048 bytes) 352 kbit/s | + | * FF: (Frame size 2048 bytes) 352 kbit/s |
== Codec specific info for MPEG == | == Codec specific info for MPEG == | ||
Line 342: | Line 361: | ||
* 0022 unused, zero | * 0022 unused, zero | ||
* 0023 bit field | * 0023 bit field | ||
- | ** 80: Always set | + | |
- | ** 40: Variable MPEG version | + | * 40: Variable MPEG version |
- | ** 20: Variable MPEG Layer | + | * 20: Variable MPEG Layer |
- | ** 10: Variable bitrate | + | * 10: Variable bitrate |
- | ** 08: Variable sample rate | + | * 08: Variable sample rate |
- | ** 04: Variable channel mode (Joint stereo/ | + | * 04: Variable channel mode (Joint stereo/ |
- | ** 02: Variable preemphasis | + | * 02: Variable preemphasis |
- | ** 01: Always cleared | + | * 01: Always cleared |
* 002C: Bit field: | * 002C: Bit field: | ||
- | ** C0: MPEG version (C0 = MPEG1, 80 = MPEG2, 00 = MPEG2.5, as in MPEG spec) | + | |
- | ** 30: MPEG layer (encoded as in MPEG stream) | + | * 30: MPEG layer (encoded as in MPEG stream) |
- | ** 0F: Bitrate number (see MPEG spec) | + | * 0F: Bitrate number (see MPEG spec) |
* 002D: Bit field: | * 002D: Bit field: | ||
- | ** C0: Sample rate from header (see MPEG spec) | + | |
- | ** 30: Channel mode (00 = split stereo; 10 = joint stereo; 20 = 2*mono; 30 = mono) | + | * 30: Channel mode (00 = split stereo; 10 = joint stereo; 20 = 2*mono; 30 = mono) |
- | ** 0C: Preemphasis (see MPEG spec) | + | * 0C: Preemphasis (see MPEG spec) |
- | ** 02, 01: always cleared. | + | * 02, 01: always cleared. |
=== The Part Info Table === | === The Part Info Table === | ||
Line 595: | Line 614: | ||
{{: | {{: | ||
- | Red boxes indicate data stored on HiMD, Black boxes indicate "black boxes" - Operations we don't know how they work. For so called " | + | Red boxes indicate data stored on HiMD, Black boxes indicate "black boxes" - Operations we don't know how they work. For so called " |
==== Fragment keys ==== | ==== Fragment keys ==== |
himddiskformat.txt · Last modified: 2012/01/05 22:55 by megadiscman