--- Begin Message ---
Subject: |
Re: [Bug-gnupod] Support for 4th gen iPod Shuffle |
Date: |
Sat, 30 May 2009 23:23:59 +0200 |
User-agent: |
Mutt/1.5.18 (2008-05-17) |
On Sat, May 30, 2009 at 12:16:51AM +0200, address@hidden wrote:
> "H. Langos" <address@hidden> wrote on 29.05.2009 13:14:11:
>
> > On Thu, May 28, 2009 at 08:54:58PM +0200, address@hidden
> wrote:
> > > Hi Henrik,
> > >
> > > thank you for spending time on that issue.
> > > I did some engeneering on the iTunesDB file (
> > > http://evil.madrax.de/itunesdb.html)
> >
> > Thats a nice link. Do you know how that page was created or
> > could you try to find out?
>
> I've done it by my own. It's just a php script which opens the file and
> reads the mhXX in it and then parses the chunk. But its still incomplete.
> Until now it reacts on mhbd, mhsd, mhlt, mhit, mhod, mhla and mhia but
> with fully ignoring any structure. Its just a dump chunk parser.
> Maybe some day i will do further work on it :D
Looks good! Please keep working on it! It would be a great tool if a user
could upload his own file and have it dissected.
Regarding the iTunesSD file created by iTunes 8.1 for the talking shuffle:
00000000 62 64 68 73 03 00 00 02 40 00 00 00 36 00 00 00 |address@hidden|
00000010 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000020 36 00 00 00 40 00 00 00 a4 4f 00 00 00 00 00 00 |address@hidden|
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
00000040 68 74 68 73 ec 00 00 00 36 00 00 00 00 00 00 00 |hths....6.......|
00000050 00 00 00 00 2c 01 00 00 a0 02 00 00 14 04 00 00 |....,...........|
00000060 88 05 00 00 fc 06 00 00 70 08 00 00 e4 09 00 00 |........p.......|
00000070 58 0b 00 00 cc 0c 00 00 40 0e 00 00 b4 0f 00 00 |address@hidden|
00000080 28 11 00 00 9c 12 00 00 10 14 00 00 84 15 00 00 |(...............|
00000090 f8 16 00 00 6c 18 00 00 e0 19 00 00 54 1b 00 00 |....l.......T...|
000000a0 c8 1c 00 00 3c 1e 00 00 b0 1f 00 00 24 21 00 00 |....<.......$!..|
000000b0 98 22 00 00 0c 24 00 00 80 25 00 00 f4 26 00 00 |."...$...%...&..|
000000c0 68 28 00 00 dc 29 00 00 50 2b 00 00 c4 2c 00 00 |h(...)..P+...,..|
000000d0 38 2e 00 00 ac 2f 00 00 20 31 00 00 94 32 00 00 |8..../.. 1...2..|
000000e0 08 34 00 00 7c 35 00 00 f0 36 00 00 64 38 00 00 |.4..|5...6..d8..|
000000f0 d8 39 00 00 4c 3b 00 00 c0 3c 00 00 34 3e 00 00 |.9..L;...<..4>..|
00000100 a8 3f 00 00 1c 41 00 00 90 42 00 00 04 44 00 00 |.?...A...B...D..|
00000110 78 45 00 00 ec 46 00 00 60 48 00 00 d4 49 00 00 |xE...F..`H...I..|
00000120 48 4b 00 00 bc 4c 00 00 30 4e 00 00 72 74 68 73 |HK...L..0N..rths|
00000130 74 01 00 00 00 00 00 00 39 7b 03 00 00 00 00 00 |t.......9{......|
00000140 01 00 00 00 2f 69 50 6f 64 5f 43 6f 6e 74 72 6f |..../iPod_Contro|
00000150 6c 2f 4d 75 73 69 63 2f 66 30 32 2f 67 30 5f 6c |l/Music/f02/g0_l|
00000160 69 61 6e 63 65 5f 5f 5f 6f 76 65 72 6e 69 67 68 |iance___overnigh|
00000170 74 2e 6d 70 33 00 00 00 00 00 00 00 00 00 00 00 |t.mp3...........|
00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000240 00 00 00 00 00 00 00 00 01 00 00 00 40 02 00 00 |address@hidden|
00000250 50 0a 00 00 70 7a 99 00 00 00 00 00 00 00 00 00 |P...pz..........|
00000260 00 00 00 00 a2 03 00 00 01 00 00 00 00 00 00 00 |................|
00000270 00 00 00 00 01 00 00 00 00 00 00 00 cf 03 00 00 |................|
00000280 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000002a0 72 74 68 73 74 01 00 00 00 00 00 00 d6 c2 02 00 |rthst...........|
000002b0 00 00 00 00 01 00 00 00 2f 69 50 6f 64 5f 43 6f |......../iPod_Co|
The database looks much more like the iTunesDB but it shows that it is
big-endian. Apparently they put the headers strings in 32bit integers and
saved them in reversed byte order. just look at the start...
"bdhs" ... clearly stands for "shdb" .. "shuffle database"
"hths" ... shuffle t? header?
the next byte(s?) (EC 00 ...) looks like the length of this chunk ...
0xEC+0x40(offset of this chunk) = 0x12C and behold.... theres another
reversed string ...
"rtsh" -> shrt -> "shuffle track"? looks like it ... the next
character is a "t" but it looks more like that is part of 0x174 ...
0x12C+0x174 = 0x2A0 ... incidentially the addresse of the next
"shuffle track" chunk... :-)
at the end there are two more chunks:
00004fa0 00 00 00 00 68 70 68 73 18 00 00 00 01 00 00 00 |....hphs........|
00004fb0 ff ff ff ff ff ff 00 00 bc 4f 00 00 6c 70 68 73 |.........O..lphs|
00004fc0 04 01 00 00 36 00 00 00 36 00 00 00 00 00 00 00 |....6...6.......|
00004fd0 00 00 00 00 01 00 00 00 00 00 00 00 00 00 00 00 |................|
00004fe0 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00 00 |................|
00004ff0 02 00 00 00 03 00 00 00 04 00 00 00 05 00 00 00 |................|
00005000 06 00 00 00 07 00 00 00 08 00 00 00 09 00 00 00 |................|
00005010 0a 00 00 00 0b 00 00 00 0c 00 00 00 0d 00 00 00 |................|
00005020 0e 00 00 00 0f 00 00 00 10 00 00 00 11 00 00 00 |................|
00005030 12 00 00 00 13 00 00 00 14 00 00 00 15 00 00 00 |................|
00005040 16 00 00 00 17 00 00 00 18 00 00 00 19 00 00 00 |................|
00005050 1a 00 00 00 1b 00 00 00 1c 00 00 00 1d 00 00 00 |................|
00005060 1e 00 00 00 1f 00 00 00 20 00 00 00 21 00 00 00 |........ ...!...|
00005070 22 00 00 00 23 00 00 00 24 00 00 00 25 00 00 00 |"...#...$...%...|
00005080 26 00 00 00 27 00 00 00 28 00 00 00 29 00 00 00 |&...'...(...)...|
00005090 2a 00 00 00 2b 00 00 00 2c 00 00 00 2d 00 00 00 |*...+...,...-...|
000050a0 2e 00 00 00 2f 00 00 00 30 00 00 00 31 00 00 00 |..../...0...1...|
000050b0 32 00 00 00 33 00 00 00 34 00 00 00 35 00 00 00 |2...3...4...5...|
000050c0
hphs -> shph -> shuffle playlist h? with a length of 0x18
and
shpl -> shpl -> shuffle playlist?
looking back at the start "shth" probably stands for "shuffle tracks header".
before diving deeper into the format of the chunks... could you do
me a favor?
create an iTunesSD with iTunes and check that your ipod works.
then grab a hex editor, open up that file and change the file name of one
of those tracks. nothing spectacular. just change a single letter.
then rename the file accordingly. disconnect your shuffle and see
if it still works.
if it doesn't play any music, there is a checksum/hash somewhere over the whole
file and we might need to find out a) where it is storred and b) if it is the
old,
known method or the new one used by the ipod touch 2.x and iphone 3g.
cheers
-henrik
--- End Message ---