ipod_db 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,3979 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <!-- saved from url=(0071)http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB -->
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4
+
5
+ <meta name="KEYWORDS" content="ITunesDB,Template:Lowercase,ITunesDB/Basic Information,ITunesDB/iTunesDB File,ITunesDB/Play Counts File,ITunesDB/OTG Playlist File,ITunesDB/Equalizer Presets File,ITunesDB/Artwork Database,ITunesDB/Photo Database,ITunesDB/Misc. Files">
6
+ <meta name="robots" content="index,follow">
7
+ <link rel="shortcut icon" href="http://web.archive.org/web/20080414195734im_/http://ipodlinux.org/favicon.ico">
8
+ <link title="Creative Commons" type="application/rdf+xml" href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB&action=creativecommons" rel="meta">
9
+ <link rel="copyright" href="http://web.archive.org/web/20080414195734/http://www.gnu.org/copyleft/fdl.html">
10
+ <title>ITunesDB - wikiPodLinux</title>
11
+ <style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "/stylesheets/monobook/main.css"; /*]]>*/</style>
12
+ <link rel="stylesheet" type="text/css" media="print" href="./ITunesDB - wikiPodLinux_files/commonPrint.css">
13
+ <!--[if lt IE 5.5000]><style type="text/css">@import "/stylesheets/monobook/IE50Fixes.css";</style><![endif]-->
14
+ <!--[if IE 5.5000]><style type="text/css">@import "/stylesheets/monobook/IE55Fixes.css";</style><![endif]-->
15
+ <!--[if IE 6]><style type="text/css">@import "/stylesheets/monobook/IE60Fixes.css";</style><![endif]-->
16
+ <!--[if IE]><script type="text/javascript" src="/stylesheets/common/IEFixes.js"></script>
17
+ <meta http-equiv="imagetoolbar" content="no" /><![endif]-->
18
+ <script type="text/javascript" src="./ITunesDB - wikiPodLinux_files/index.php"></script><style type="text/css"></style> <script type="text/javascript" src="./ITunesDB - wikiPodLinux_files/wikibits.js"></script><link rel="stylesheet" type="text/css" href="./ITunesDB - wikiPodLinux_files/KHTMLFixes.css">
19
+ <style type="text/css">/*<![CDATA[*/
20
+ @import "/index.php?title=MediaWiki:Monobook.css&action=raw&ctype=text/css&smaxage=18000";
21
+ @import "/index.php?title=-&action=raw&gen=css";
22
+ /*]]>*/</style> <style type="text/css">@media print { #feedlyMiniIcon { display: none; } }</style></head>
23
+ <body class="ns-0"><div id="wm-ipp" style="display: none; position: relative; padding: 0px 5px; min-height: 70px; min-width: 800px; z-index: 9000;">
24
+ <div id="wm-ipp-inside" style="position:fixed;padding:0!important;margin:0!important;width:97%;min-width:780px;border:5px solid #000;border-top:none;background-image:url(/static/images/toolbar/wm_tb_bk_trns.png);text-align:center;-moz-box-shadow:1px 1px 3px #333;-webkit-box-shadow:1px 1px 3px #333;box-shadow:1px 1px 3px #333;font-size:11px!important;font-family:&#39;Lucida Grande&#39;,&#39;Arial&#39;,sans-serif!important;">
25
+ <table style="border-collapse:collapse;margin:0;padding:0;width:100%;"><tbody><tr>
26
+ <td style="padding:10px;vertical-align:top;min-width:110px;">
27
+ <a href="http://web.archive.org/web/" title="Wayback Machine home page" style="background-color:transparent;border:none;"><img src="./ITunesDB - wikiPodLinux_files/wayback-toolbar-logo.png" alt="Wayback Machine" width="110" height="39" border="0"></a>
28
+ </td>
29
+ <td style="padding:0!important;text-align:center;vertical-align:top;width:100%;">
30
+
31
+ <table style="border-collapse:collapse;margin:0 auto;padding:0;width:570px;"><tbody><tr>
32
+ <td style="padding:3px 0;" colspan="2">
33
+ <form target="_top" method="get" action="http://web.archive.org/web/form-submit.jsp" name="wmtb" id="wmtb" style="margin:0!important;padding:0!important;"><input type="text" name="url" id="wmtbURL" value="http://ipodlinux.org/ITunesDB" style="width:400px;font-size:11px;font-family:&#39;Lucida Grande&#39;,&#39;Arial&#39;,sans-serif;" onfocus="javascript:this.focus();this.select();"><input type="hidden" name="type" value="replay"><input type="hidden" name="date" value="20080414195734"><input type="submit" value="Go" style="font-size:11px;font-family:&#39;Lucida Grande&#39;,&#39;Arial&#39;,sans-serif;margin-left:5px;"><span id="wm_tb_options" style="display:block;"></span></form>
34
+ </td>
35
+ <td style="vertical-align:bottom;padding:5px 0 0 0!important;" rowspan="2">
36
+ <table style="border-collapse:collapse;width:110px;color:#99a;font-family:&#39;Helvetica&#39;,&#39;Lucida Grande&#39;,&#39;Arial&#39;,sans-serif;"><tbody>
37
+
38
+ <!-- NEXT/PREV MONTH NAV AND MONTH INDICATOR -->
39
+ <tr style="width:110px;height:16px;font-size:10px!important;">
40
+ <td style="padding-right:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
41
+
42
+ <a href="http://web.archive.org/web/20080212142210/http://www.ipodlinux.org/ITunesDB" style="text-decoration:none;color:#33f;font-weight:bold;background-color:transparent;border:none;" title="12 Feb 2008"><strong>FEB</strong></a>
43
+
44
+ </td>
45
+ <td id="displayMonthEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight:bold;text-transform:uppercase;width:34px;height:15px;padding-top:1px;text-align:center;" title="You are here: 19:57:34 Apr 14, 2008">APR</td>
46
+ <td style="padding-left:9px;font-size:11px!important;font-weight:bold;text-transform:uppercase;white-space:nowrap;overflow:visible;" nowrap="nowrap">
47
+
48
+ <a href="http://web.archive.org/web/20080515231621/http://ipodlinux.org/ITunesDB" style="text-decoration:none;color:#33f;font-weight:bold;background-color:transparent;border:none;" title="15 May 2008"><strong>MAY</strong></a>
49
+
50
+ </td>
51
+ </tr>
52
+
53
+ <!-- NEXT/PREV CAPTURE NAV AND DAY OF MONTH INDICATOR -->
54
+ <tr>
55
+ <td style="padding-right:9px;white-space:nowrap;overflow:visible;text-align:right!important;vertical-align:middle!important;" nowrap="nowrap">
56
+
57
+ <a href="http://web.archive.org/web/20080401092250/http://www.ipodlinux.org/ITunesDB" title="9:22:50 Apr 1, 2008" style="background-color:transparent;border:none;"><img src="./ITunesDB - wikiPodLinux_files/wm_tb_prv_on.png" alt="Previous capture" width="14" height="16" border="0"></a>
58
+
59
+ </td>
60
+ <td id="displayDayEl" style="background:#000;color:#ff0;width:34px;height:24px;padding:2px 0 0 0;text-align:center;font-size:24px;font-weight: bold;" title="You are here: 19:57:34 Apr 14, 2008">14</td>
61
+ <td style="padding-left:9px;white-space:nowrap;overflow:visible;text-align:left!important;vertical-align:middle!important;" nowrap="nowrap">
62
+
63
+ <a href="http://web.archive.org/web/20080515231621/http://ipodlinux.org/ITunesDB" title="23:16:21 May 15, 2008" style="background-color:transparent;border:none;"><img src="./ITunesDB - wikiPodLinux_files/wm_tb_nxt_on.png" alt="Next capture" width="14" height="16" border="0"></a>
64
+
65
+ </td>
66
+ </tr>
67
+
68
+ <!-- NEXT/PREV YEAR NAV AND YEAR INDICATOR -->
69
+ <tr style="width:110px;height:13px;font-size:9px!important;">
70
+ <td style="padding-right:9px;font-size:11px!important;font-weight: bold;text-align:right;white-space:nowrap;overflow:visible;" nowrap="nowrap">
71
+
72
+ <a href="http://web.archive.org/web/20070411170609/http://ipodlinux.org/ITunesDB" style="text-decoration:none;color:#33f;font-weight:bold;background-color:transparent;border:none;" title="11 Apr 2007"><strong>2007</strong></a>
73
+
74
+ </td>
75
+ <td id="displayYearEl" style="background:#000;color:#ff0;font-size:11px!important;font-weight: bold;padding-top:1px;width:34px;height:13px;text-align:center;" title="You are here: 19:57:34 Apr 14, 2008">2008</td>
76
+ <td style="padding-left:9px;font-size:11px!important;font-weight: bold;white-space:nowrap;overflow:visible;" nowrap="nowrap">
77
+
78
+ <a href="http://web.archive.org/web/20090606090700/http://www.ipodlinux.org/iTunesDB" style="text-decoration:none;color:#33f;font-weight:bold;background-color:transparent;border:none;" title="6 Jun 2009"><strong>2009</strong></a>
79
+
80
+ </td>
81
+ </tr>
82
+ </tbody></table>
83
+ </td>
84
+
85
+ </tr>
86
+ <tr>
87
+ <td style="vertical-align:middle;padding:0!important;">
88
+ <a href="http://web.archive.org/web/20080414195734*/http://ipodlinux.org/ITunesDB" style="color:#33f;font-size:11px;font-weight:bold;background-color:transparent;border:none;" title="See a list of every capture for this URL"><strong>80 captures</strong></a>
89
+ <div style="margin:0!important;padding:0!important;color:#666;font-size:9px;padding-top:2px!important;white-space:nowrap;" title="Timespan for captures of this URL">8 Mar 05 - 9 Jan 10</div>
90
+ </td>
91
+ <td style="padding:0!important;">
92
+ <a style="position:relative; white-space:nowrap; width:450px;height:27px;" href="" id="wm-graph-anchor">
93
+ <div id="wm-ipp-sparkline" style="position:relative; white-space:nowrap; width:450px;height:27px;background-color:#fff;cursor:pointer;border-right:1px solid #ccc;" title="Explore captures for this URL">
94
+ <img id="sparklineImgId" style="position:absolute; z-index:9012; top:0px; left:0px;" onmouseover="showTrackers(&#39;inline&#39;);" onmouseout="showTrackers(&#39;none&#39;);" onmousemove="trackMouseMove(event,this)" alt="sparklines" width="450" height="27" border="0" src="./ITunesDB - wikiPodLinux_files/graph.jsp">
95
+ <img id="wbMouseTrackYearImg" style="display:none; position:absolute; z-index:9010;" width="25" height="27" border="0" src="./ITunesDB - wikiPodLinux_files/transp-yellow-pixel.png">
96
+ <img id="wbMouseTrackMonthImg" style="display:none; position:absolute; z-index:9011; " width="2" height="27" border="0" src="./ITunesDB - wikiPodLinux_files/transp-red-pixel.png">
97
+ </div>
98
+ </a>
99
+
100
+ </td>
101
+ </tr></tbody></table>
102
+ </td>
103
+ <td style="text-align:right;padding:5px;width:65px;font-size:11px!important;">
104
+ <a href="javascript:;" onclick="document.getElementById(&#39;wm-ipp&#39;).style.display=&#39;none&#39;;" style="display:block;padding-right:18px;background:url(/static/images/toolbar/wm_tb_close.png) no-repeat 100% 0;color:#33f;font-family:&#39;Lucida Grande&#39;,&#39;Arial&#39;,sans-serif;margin-bottom:23px;background-color:transparent;border:none;" title="Close the toolbar">Close</a>
105
+ <a href="http://faq.web.archive.org/" style="display:block;padding-right:18px;background:url(/static/images/toolbar/wm_tb_help.png) no-repeat 100% 0;color:#33f;font-family:&#39;Lucida Grande&#39;,&#39;Arial&#39;,sans-serif;background-color:transparent;border:none;" title="Get some help using the Wayback Machine">Help</a>
106
+ </td>
107
+ </tr></tbody></table>
108
+
109
+ </div>
110
+ </div>
111
+ <!-- BEGIN WAYBACK TOOLBAR INSERT -->
112
+
113
+ <script type="text/javascript" src="./ITunesDB - wikiPodLinux_files/disclaim-element.js"></script>
114
+ <script type="text/javascript" src="./ITunesDB - wikiPodLinux_files/graph-calc.js"></script>
115
+ <script type="text/javascript" src="./ITunesDB - wikiPodLinux_files/jquery.min.js"></script>
116
+ <script type="text/javascript">
117
+ //<![CDATA[
118
+ var firstDate = 820454400000;
119
+ var lastDate = 1388534399999;
120
+ var wbPrefix = "/web/";
121
+ var wbCurrentUrl = "http:\/\/ipodlinux.org\/ITunesDB";
122
+
123
+ var curYear = -1;
124
+ var curMonth = -1;
125
+ var yearCount = 18;
126
+ var firstYear = 1996;
127
+ var imgWidth = 450;
128
+ var yearImgWidth = 25;
129
+ var monthImgWidth = 2;
130
+ var trackerVal = "none";
131
+ var displayDay = "14";
132
+ var displayMonth = "Apr";
133
+ var displayYear = "2008";
134
+ var prettyMonths = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
135
+
136
+ function showTrackers(val) {
137
+ if(val == trackerVal) {
138
+ return;
139
+ }
140
+ if(val == "inline") {
141
+ document.getElementById("displayYearEl").style.color = "#ec008c";
142
+ document.getElementById("displayMonthEl").style.color = "#ec008c";
143
+ document.getElementById("displayDayEl").style.color = "#ec008c";
144
+ } else {
145
+ document.getElementById("displayYearEl").innerHTML = displayYear;
146
+ document.getElementById("displayYearEl").style.color = "#ff0";
147
+ document.getElementById("displayMonthEl").innerHTML = displayMonth;
148
+ document.getElementById("displayMonthEl").style.color = "#ff0";
149
+ document.getElementById("displayDayEl").innerHTML = displayDay;
150
+ document.getElementById("displayDayEl").style.color = "#ff0";
151
+ }
152
+ document.getElementById("wbMouseTrackYearImg").style.display = val;
153
+ document.getElementById("wbMouseTrackMonthImg").style.display = val;
154
+ trackerVal = val;
155
+ }
156
+ function getElementX2(obj) {
157
+ var thing = jQuery(obj);
158
+ if((thing == undefined)
159
+ || (typeof thing == "undefined")
160
+ || (typeof thing.offset == "undefined")) {
161
+ return getElementX(obj);
162
+ }
163
+ return Math.round(thing.offset().left);
164
+ }
165
+ function trackMouseMove(event,element) {
166
+
167
+ var eventX = getEventX(event);
168
+ var elementX = getElementX2(element);
169
+ var xOff = eventX - elementX;
170
+ if(xOff < 0) {
171
+ xOff = 0;
172
+ } else if(xOff > imgWidth) {
173
+ xOff = imgWidth;
174
+ }
175
+ var monthOff = xOff % yearImgWidth;
176
+
177
+ var year = Math.floor(xOff / yearImgWidth);
178
+ var yearStart = year * yearImgWidth;
179
+ var monthOfYear = Math.floor(monthOff / monthImgWidth);
180
+ if(monthOfYear > 11) {
181
+ monthOfYear = 11;
182
+ }
183
+ // 1 extra border pixel at the left edge of the year:
184
+ var month = (year * 12) + monthOfYear;
185
+ var day = 1;
186
+ if(monthOff % 2 == 1) {
187
+ day = 15;
188
+ }
189
+ var dateString =
190
+ zeroPad(year + firstYear) +
191
+ zeroPad(monthOfYear+1,2) +
192
+ zeroPad(day,2) + "000000";
193
+
194
+ var monthString = prettyMonths[monthOfYear];
195
+ document.getElementById("displayYearEl").innerHTML = year + 1996;
196
+ document.getElementById("displayMonthEl").innerHTML = monthString;
197
+ // looks too jarring when it changes..
198
+ //document.getElementById("displayDayEl").innerHTML = zeroPad(day,2);
199
+
200
+ var url = wbPrefix + dateString + '/' + wbCurrentUrl;
201
+ document.getElementById('wm-graph-anchor').href = url;
202
+
203
+ //document.getElementById("wmtbURL").value="evX("+eventX+") elX("+elementX+") xO("+xOff+") y("+year+") m("+month+") monthOff("+monthOff+") DS("+dateString+") Moy("+monthOfYear+") ms("+monthString+")";
204
+ if(curYear != year) {
205
+ var yrOff = year * yearImgWidth;
206
+ document.getElementById("wbMouseTrackYearImg").style.left = yrOff + "px";
207
+ curYear = year;
208
+ }
209
+ if(curMonth != month) {
210
+ var mtOff = year + (month * monthImgWidth) + 1;
211
+ document.getElementById("wbMouseTrackMonthImg").style.left = mtOff + "px";
212
+ curMonth = month;
213
+ }
214
+ }
215
+ //]]>
216
+ </script>
217
+
218
+ <style type="text/css">body{margin-top:0!important;padding-top:0!important;min-width:800px!important;}#wm-ipp a:hover{text-decoration:underline!important;}</style>
219
+
220
+ <script type="text/javascript">
221
+ var wmDisclaimBanner = document.getElementById("wm-ipp");
222
+ if(wmDisclaimBanner != null) {
223
+ disclaimElement(wmDisclaimBanner);
224
+ }
225
+ </script>
226
+ <!-- END WAYBACK TOOLBAR INSERT -->
227
+
228
+ <div id="globalWrapper">
229
+ <div id="column-content">
230
+ <div id="content">
231
+ <a name="top" id="contentTop"></a>
232
+ <h1 class="firstHeading">ITunesDB</h1>
233
+ <div id="bodyContent">
234
+ <h3 id="siteSub">From wikiPodLinux</h3>
235
+ <div id="contentSub"></div>
236
+ <!-- start content -->
237
+ <dl><dd><i>The title of this article should be <b>iTunesDB</b>. The initial letter is capitalized due to <a href="http://web.archive.org/web/20080414195734/http://www.wikipedia.org/wiki/Naming_conventions_%28technical_restrictions%29#Lower_case_first_letter" class="extiw" title="Wikipedia:Naming conventions (technical restrictions)">technical limitations</a>.</i>
238
+ </dd></dl>
239
+ <p>This page details the format of the binary files used on the iPod to keep track of the music it contains as well as its play history. Collectively we refer to these files as the iTunesDB however there are in fact a number of files, each with their own format, that make up this database.
240
+ </p><p><b>Note that the information on this page is undergoing constant revision as new information comes to light. New versions of the iTunes or iPod software may cause drastic changes to the information in this document.</b>
241
+ </p>
242
+ <table class="infobox" style="border: 1px solid #aaaaaa; background-color: #f9f9f9; color: black; margin-bottom: 0.5em; margin-left: 1em; padding: 0.2em; float: right; clear: right; font-size: 95%; text-align: left; background-color: #f0f6fa;">
243
+ <tbody><tr>
244
+ <td colspan="2" align="center"><b>Subpages</b>
245
+ </td></tr>
246
+ <tr>
247
+ <td colspan="2" align="center"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB/Basic_Information" title="ITunesDB/Basic Information">Basic Information</a>
248
+ </td></tr>
249
+ <tr>
250
+ <td colspan="2" align="center"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB/iTunesDB_File" title="ITunesDB/iTunesDB File">iTunesDB File</a>
251
+ </td></tr>
252
+ <tr>
253
+ <td colspan="2" align="center"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB/Play_Counts_File" title="ITunesDB/Play Counts File">Play Counts File</a>
254
+ </td></tr>
255
+ <tr>
256
+ <td colspan="2" align="center"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB/OTG_Playlist_File" title="ITunesDB/OTG Playlist File">OTG Playlist File</a>
257
+ </td></tr>
258
+ <tr>
259
+ <td colspan="2" align="center"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB/Equalizer_Presets_File" title="ITunesDB/Equalizer Presets File">Equalizer Presets File</a>
260
+ </td></tr>
261
+ <tr>
262
+ <td colspan="2" align="center"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB/Artwork_Database" title="ITunesDB/Artwork Database">Artwork Database</a>
263
+ </td></tr>
264
+ <tr>
265
+ <td colspan="2" align="center"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB/Photo_Database" title="ITunesDB/Photo Database">Photo Database</a>
266
+ </td></tr>
267
+ <tr>
268
+ <td colspan="2" align="center"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB/Misc._Files" title="ITunesDB/Misc. Files">Misc. Files</a>
269
+ </td></tr></tbody></table>
270
+ <table border="0" id="toc"><tbody><tr id="toctitle"><td align="center">
271
+ <b>Table of contents</b> <script type="text/javascript">showTocToggle("show","hide")</script><span class="toctoggle">[<a href="javascript:toggleToc()" class="internal"><span id="showlink" style="display:none;">show</span><span id="hidelink">hide</span></a>]</span>
272
+ </td></tr><tr id="tocinside"><td>
273
+ <div class="tocline"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Basic_information">1 Basic information</a><br></div>
274
+ <div class="tocindent">
275
+ <p><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Endian_Note">1.1 Endian Note</a><br>
276
+ </p>
277
+ </div>
278
+ <div class="tocline"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#iTunesDB_file">2 iTunesDB file</a><br></div>
279
+ <div class="tocindent">
280
+ <p><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Chunk_Encoding">2.1 Chunk Encoding</a><br>
281
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Database_Object">2.2 Database Object</a><br>
282
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#DataSet">2.3 DataSet</a><br>
283
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#TrackList">2.4 TrackList</a><br>
284
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Track_Item">2.5 Track Item</a><br>
285
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Playlist_List">2.6 Playlist List</a><br>
286
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Playlist">2.7 Playlist</a><br>
287
+ </p>
288
+ <div class="tocindent">
289
+ <p><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#List_Sort_Order">2.7.1 List Sort Order</a><br>
290
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Podcasts">2.7.2 Podcasts</a><br>
291
+ </p>
292
+ </div>
293
+ <p><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Playlist_Item">2.8 Playlist Item</a><br>
294
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Data_Object">2.9 Data Object</a><br>
295
+ </p>
296
+ <div class="tocindent">
297
+ <p><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#String_Types">2.9.1 String Types</a><br>
298
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Podcast_URLs_.28types_15-16.29">2.9.2 Podcast URLs (types 15-16)</a><br>
299
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Chapter_Data_.28type_17.29">2.9.3 Chapter Data (type 17)</a><br>
300
+ </p>
301
+ <div class="tocindent">
302
+ <p><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Chapter_Data_mhod_details">2.9.3.1 Chapter Data mhod details</a><br>
303
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Chapter_Data_Atom_Layout">2.9.3.2 Chapter Data Atom Layout</a><br>
304
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Chapter_Data_Atoms">2.9.3.3 Chapter Data Atoms</a><br>
305
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Chapter_Data_String_Atoms_.28UTF16.29">2.9.3.4 Chapter Data String Atoms (UTF16)</a><br>
306
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Chapter_Data_String_Atoms_.28UTF8.29">2.9.3.5 Chapter Data String Atoms (UTF8)</a><br>
307
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Chapter_Data_hedr_Atom">2.9.3.6 Chapter Data hedr Atom</a><br>
308
+ </p>
309
+ </div>
310
+ <p><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Smart_Playlist_Data_.28type_50.29">2.9.4 Smart Playlist Data (type 50)</a><br>
311
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Smart_Playlist_Rules_.28type_51.29">2.9.5 Smart Playlist Rules (type 51)</a><br>
312
+ </p>
313
+ <div class="tocindent">
314
+ <p><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Important_Note_about_endian-ness">2.9.5.1 Important Note about endian-ness</a><br>
315
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Smart_Playlist_Rule_Fields">2.9.5.2 Smart Playlist Rule Fields</a><br>
316
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Smart_Playlist_Rule_Actions">2.9.5.3 Smart Playlist Rule Actions</a><br>
317
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Smart_Playlist_Rule_Values">2.9.5.4 Smart Playlist Rule Values</a><br>
318
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Putting_It_All_Together">2.9.5.5 Putting It All Together</a><br>
319
+ </p>
320
+ </div>
321
+ <p><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Library_Playlist_Index_.28type_52.29">2.9.6 Library Playlist Index (type 52)</a><br>
322
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Type_53">2.9.7 Type 53</a><br>
323
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Type_100">2.9.8 Type 100</a><br>
324
+ </p>
325
+ <div class="tocindent">
326
+ <p><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Playlist_Column_Definitions_Header">2.9.8.1 Playlist Column Definitions Header</a><br>
327
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Column_Definition">2.9.8.2 Column Definition</a><br>
328
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Playlist_Order_Entry">2.9.8.3 Playlist Order Entry</a><br>
329
+ </p>
330
+ </div>
331
+ </div>
332
+ <p><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Album_List">2.10 Album List</a><br>
333
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Album_Item">2.11 Album Item</a><br>
334
+ </p>
335
+ </div>
336
+ <div class="tocline"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Play_Counts_file">3 Play Counts file</a><br></div>
337
+ <div class="tocindent">
338
+ <p><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Play_Count_Header">3.1 Play Count Header</a><br>
339
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Play_Count_Entry">3.2 Play Count Entry</a><br>
340
+ </p>
341
+ </div>
342
+ <div class="tocline"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#On_The_Go_Playlist_files">4 On The Go Playlist files</a><br></div>
343
+ <div class="tocline"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Equalizer_Presets_file">5 Equalizer Presets file</a><br></div>
344
+ <div class="tocindent">
345
+ <p><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Equalizer_Presets_Container">5.1 Equalizer Presets Container</a><br>
346
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Equalizer_Preset">5.2 Equalizer Preset</a><br>
347
+ </p>
348
+ </div>
349
+ <div class="tocline"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Artwork_Database">6 Artwork Database</a><br></div>
350
+ <div class="tocline"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Photo_Database">7 Photo Database</a><br></div>
351
+ <div class="tocindent">
352
+ <p><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Data_File_Object">7.1 Data File Object</a><br>
353
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#DataSet_2">7.2 DataSet</a><br>
354
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Image_List">7.3 Image List</a><br>
355
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Image_Item">7.4 Image Item</a><br>
356
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Image_Name">7.5 Image Name</a><br>
357
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Album_List_2">7.6 Album List</a><br>
358
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Photo_Album">7.7 Photo Album</a><br>
359
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Album_Item_2">7.8 Album Item</a><br>
360
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#File_List">7.9 File List</a><br>
361
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#File_.28Image.29">7.10 File (Image)</a><br>
362
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Data_Object_2">7.11 Data Object</a><br>
363
+ </p>
364
+ <div class="tocindent">
365
+ <p><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Container_MHODs">7.11.1 Container MHODs</a><br>
366
+ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#String_MHODs">7.11.2 String MHODs</a><br>
367
+ </p>
368
+ </div>
369
+ </div>
370
+ <div class="tocline"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#iTunesSD_file">8 iTunesSD file</a><br></div>
371
+ <div class="tocline"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#iTunesStats_File">9 iTunesStats File</a><br></div>
372
+ <div class="tocline"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#iTunesShuffle_File">10 iTunesShuffle File</a><br></div>
373
+ <div class="tocline"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#iTunesPState_File">11 iTunesPState File</a><br></div>
374
+ <div class="tocline"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#iTunesControl_File">12 iTunesControl File</a><br></div>
375
+ <div class="tocline"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#iTunesPrefs_File">13 iTunesPrefs File</a><br></div>
376
+ <div class="tocline"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#winPrefs_File">14 winPrefs File</a><br></div>
377
+ <div class="tocline"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#DeviceInfo_File">15 DeviceInfo File</a><br></div>
378
+ <div class="tocline"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#iEKInfo_File">16 iEKInfo File</a><br></div>
379
+ <div class="tocline"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#WABContactsGroup_File">17 WABContactsGroup File</a><br></div>
380
+ <div class="tocline"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#iTunesLock_File">18 iTunesLock File</a><br></div>
381
+ <div class="tocline"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#PhotosFolderName">19 PhotosFolderName</a><br></div>
382
+ <div class="tocline"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#PhotoFolderPrefs">20 PhotoFolderPrefs</a><br></div>
383
+ <div class="tocline"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#PhotoFolderAlbums">21 PhotoFolderAlbums</a><br></div>
384
+ <div class="tocline"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#iTunesPlaylists">22 iTunesPlaylists</a><br></div>
385
+ <div class="tocline"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#iTunesPodcasts">23 iTunesPodcasts</a><br></div>
386
+ <div class="tocline"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#iTunesVideoPlaylists">24 iTunesVideoPlaylists</a><br></div>
387
+ <div class="tocline"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Preferences">25 Preferences</a><br></div>
388
+ <div class="tocline"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#_volumelocked">26 _volumelocked</a><br></div>
389
+ </td></tr></tbody></table>
390
+ <p><br>
391
+ </p>
392
+ <div align="right"><small>→ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB/Basic_Information" title="ITunesDB/Basic Information">Subpage: Basic Information</a></small></div>
393
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Basic_Information&action=edit&section=1" title="ITunesDB/Basic Information">edit</a>]</div><a name="Basic_information"></a><h2>Basic information</h2>
394
+ <p>The database directory on the iPod is <b>/iPod_Control/iTunes/</b>. This is a hidden folder (attrib +h), but is not otherwise protected.
395
+ </p>
396
+ <table border="1" cellpadding="5" cellspacing="0">
397
+ <caption><b>iPod Database Files</b>
398
+ </caption>
399
+ <tbody><tr>
400
+ <th style="background:#efefef;"> filename
401
+ </th><th style="background:#efefef;"> description
402
+ </th></tr>
403
+ <tr>
404
+ <td> iTunesDB </td><td> This is the primary database for the iPod. It contains all information about the songs that the iPod is capable of playing, as well as the playlists. It's never written to by the Apple iPod firmware. During an autosync, iTunes completely overwrites this file.
405
+ </td></tr>
406
+ <tr>
407
+ <td> Play Counts </td><td> This is the return information file for the iPod. It contains all information that is available to change via the iPod, with regards to the song. When you autosync, iTunes reads this file and updates the iTunes database accordingly. After it does this, it erases this file, so as to prevent it from duplicating data by mistake. The iPod will create this file on playback if it is not there.
408
+ </td></tr>
409
+ <tr>
410
+ <td> OTGPlaylist / OTGPlaylist_# </td><td> These are the playlist files created by the iPod when you create a new playlist. 4th Gen and up iPod's can create multiple OTGPlaylists. These have the same format as the 3rd gen models, they just get numbers appended to the name. iTunes will turn these into normal playlists and then delete these files during an autosync. The OTGPlaylists cannot survive changing the contents of the iPod.
411
+ </td></tr>
412
+ <tr>
413
+ <td> iTunesEQPresets </td><td> This is where the equalizer presets that you create in iTunes get stored on the iPod. The format of this file is easy and well understood, but strangely, no iPod actually uses this file yet. You can create an EQ preset in iTunes, sync with an iPod, and the EQ will be put in here by iTunes correctly. But the iPod never reads the file, does not use the preset in this file, and just doesn't work correctly in this respect. Perhaps it will be fixed in a future firmware release.
414
+ </td></tr>
415
+ <tr>
416
+ <td> ArtworkDB </td><td> This is where data about artwork is stored on the iPod Photo devices. The artwork itself is stored in the \iPod_Control\Artwork folder. On 5g iPods the ArtworkDB is stored in the Artwork folder along with the data.
417
+ </td></tr>
418
+ <tr>
419
+ <td> iTunesSD </td><td> This is the database that seems to hold information used by the iPod Shuffle device.
420
+ </td></tr>
421
+ <tr>
422
+ <td> iTunesStats </td><td> The equivalent of the "Play Counts" file for the Shuffle.
423
+ </td></tr>
424
+ <tr><td> iTunesShuffle </td><td> Contains a list of the tracks on the Shuffle in a random order. Possibly used to specify the order in which the songs are shuffled.</td></tr>
425
+ <tr><td> iTunesPState </td><td> Contains the current playback position and volume of the iPod shuffle.</td></tr>
426
+ <tr><td> iTunesControl </td><td> Nothing more specific is known, yet.</td></tr>
427
+ <tr><td> iTunesPrefs </td><td> Nothing more specific is known, yet.</td></tr>
428
+ <tr><td> winPrefs </td><td> Nothing more specific is known, yet.</td></tr>
429
+ <tr><td> iEKInfo </td><td> This contains the decryption key for protected M4P playback. Previously iSCInfo(?)</td></tr>
430
+ <tr><td> WABContactsGroup </td><td> Nothing more specific is known, yet.</td></tr>
431
+ <tr><td> iTunesLock </td><td> Created whenever iTunes needs exclusive control of the iPod, like when reading or writing the iTunesDB file.</td></tr>
432
+ <tr><td> PhotoFolderPrefs </td><td>Stores Photo Folder preferences.</td></tr>
433
+ <tr><td> PhotoFolderAlbums </td><td>Stores Photo Albums.</td></tr>
434
+ <tr><td> iTunesPlaylists </td><td> Nothing more specific is known, yet.</td></tr>
435
+ <tr><td> iTunesPodcasts </td><td> Nothing more specific is known, yet.</td></tr>
436
+ <tr><td> iTunesVideoPlaylists </td><td> Nothing more specific is known, yet.</td></tr>
437
+ </tbody></table>
438
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Basic_Information&action=edit&section=2" title="ITunesDB/Basic Information">edit</a>]</div><a name="Endian_Note"></a><h3>Endian Note</h3>
439
+ <p>With some exceptions, most of the data descriptions in this document are actually stored in the file in little endian byte order. Meaning that you have these representations of the data when looking at the file in a hex editor:
440
+ </p>
441
+ <pre>"01 00 00 00" = decimal 1
442
+ "10 00 00 00" = decimal 16
443
+ "00 01 00 00" = decimal 256
444
+ </pre>
445
+ <p>This means when you read the file, you need to reverse the bytes in memory to make sense of them. Keep this in mind when reading this document and trying to make sense of an iTunesDB using a hex editor.
446
+ </p><p>The exceptions are noted where appropriate (hopefully). But if you are looking at a piece of a file and can't understand the value it holds, try reversing the byte order.
447
+ </p><p>Note that this means the values themselves are in reversed byte order. The order of the fields described is the same as in this document. So if you see that field A is before field B in one of these tables, then when you look at the file with a hex editor, field A really will come before field B. This has confused some people who always reverse 4 byte chunks of data. If you're writing code to read/write these files, I recommend against *always* reversing the data in 4 byte blocks. This only makes the code more confusing in the long run.
448
+ </p><p><br>
449
+ </p>
450
+ <div align="right"><small>→ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB/iTunesDB_File" title="ITunesDB/iTunesDB File">Subpage: iTunesDB File</a></small></div>
451
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=1" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="iTunesDB_file"></a><h2>iTunesDB file</h2>
452
+ <p>The iTunesDB file consists of a sort of tree structure arranged into a flat file. Each "object" contains a header followed by some other objects. The header contains a couple of size fields that are used to define where the header ends and other objects begin. Here's the basic structure of it:
453
+ </p>
454
+ <pre>&lt;mhbd&gt; - This is a database
455
+ &lt;mhsd&gt; - This is a list holder, which holds either a mhla
456
+ &lt;mhla&gt; - This holds a list of albums
457
+ &lt;mhia&gt; - This describes a particular Album Item
458
+ &lt;mhod&gt; - These hold strings associated with an album title
459
+ &lt;mhod&gt; - These hold strings associated with an artist name/title
460
+ &lt;mhia&gt; - This is another album. And so on.
461
+ &lt;mhod&gt;...
462
+ &lt;mhod&gt;...
463
+ ...
464
+ &lt;mhsd&gt; - This is a list holder, which holds either a mhlt or an mhlp
465
+ &lt;mhlt&gt; - This holds a list of all the songs on the iPod
466
+ &lt;mhit&gt; - This describes a particular song
467
+ &lt;mhod&gt;... - These hold strings associated with a song
468
+ &lt;mhod&gt;... - Things like Artist, Song Title, Album, etc.
469
+ &lt;mhit&gt; - This is another song. And so on.
470
+ &lt;mhod&gt;...
471
+ &lt;mhod&gt;...
472
+ ...
473
+ &lt;mhsd&gt; - Here's the list holder again.. This time, it's holding an mhlp
474
+ &lt;mhlp&gt; - This holds a bunch of playlists. In fact, all the playlists.
475
+ &lt;mhyp&gt; - This is a playlist.
476
+ &lt;mhod&gt;... - These mhods hold info about the playlists like the name of the list.
477
+ &lt;mhip&gt;... - This mhip holds a reference to a particular song on the iPod.
478
+ ...
479
+ &lt;mhyp&gt; - This is another playlist. And so on.
480
+ &lt;mhod&gt;... - Note that the mhods also hold other things for smart playlists
481
+ &lt;mhip&gt;...
482
+ ...
483
+ ...
484
+ </pre>
485
+ <p>And so on. What follows is a detailed description of these various headers.
486
+ </p>
487
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=2" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Chunk_Encoding"></a><h3>Chunk Encoding</h3>
488
+ <p>Each chunk of the file is encoded in the follow form:
489
+ </p>
490
+ <table border="1" cellpadding="5" cellspacing="0">
491
+ <caption><b>Chunk Encoding</b>
492
+ </caption>
493
+ <tbody><tr>
494
+ <th style="background:#efefef;"> Offset
495
+ </th><th style="background:#efefef;"> Field
496
+ </th><th style="background:#efefef;"> Size
497
+ </th><th style="background:#efefef;"> Description
498
+ </th>
499
+ </tr>
500
+ <tr>
501
+ <td> 0 </td>
502
+ <td>Chunk Type Identifier</td>
503
+ <td> 4 </td>
504
+ <td>A 4-byte string like "mhbd", "mhlt", etc. This identifies what type of chunk is at the current location.</td>
505
+ </tr>
506
+ <tr>
507
+ <td> 4 </td>
508
+ <td>End of Type-specific Header</td>
509
+ <td> 4 </td>
510
+ <td>This is a little-endian encoded 32b value that points to the end of the chunk-specific header.
511
+ </td></tr>
512
+ <tr>
513
+ <td> 8 </td>
514
+ <td>End of Chunk or Number of Children</td>
515
+ <td> 4 </td>
516
+ <td>This is a little-endian encoded 32b value. It either points to the end of the current chunk, or the number of children the current chunk has.
517
+ </td></tr>
518
+ </tbody></table>
519
+ <p>The Chunk Type Identifier is intuitive: it's a 4-byte string letting you know what you're working with.
520
+ </p><p>The End of Type-specific Header tells you where, relative to offset 0, the header section for this chunk ends. The header starts at offset 12 and runs through to the end of the type-specific header.
521
+ </p><p>The End of Chunk or Number of Children is slightly confusing. Usually, it's an "End of Chunk" offset: what the last offset in the current chunk is. That is, it tells you how long this chunk and all its children are. There are two big exceptions to this: "mhlt" and "mhlp" chunks. In both of these, this number is how many top-level children the mhl[pt] chunk has.
522
+ </p><p><br>
523
+ </p>
524
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=3" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Database_Object"></a><h3>Database Object</h3>
525
+ <table border="1" cellpadding="5" cellspacing="0">
526
+ <caption><b>mhbd format</b>
527
+ </caption>
528
+ <tbody><tr>
529
+ <th style="background:#efefef;"> offset
530
+ </th><th style="background:#efefef;"> field
531
+ </th><th style="background:#efefef;"> size
532
+ </th><th style="background:#efefef;"> value
533
+ </th></tr>
534
+ <tr>
535
+ <td> 0 </td><td> header identifier </td><td> 4 </td><td> mhbd
536
+ </td></tr>
537
+ <tr>
538
+ <td> 4 </td><td> header length </td><td> 4 </td><td> size of the mhbd header. For dbversion &lt;= 0x15 (iTunes 7.2 and earlier), the length is 0x68. For dbversion &gt;= 0x17 (iTunes 7.3 and later), the size is 0xBC.
539
+ </td></tr>
540
+ <tr>
541
+ <td> 8 </td><td> total length </td><td> 4 </td><td> size of the header and all child records (since everything is a child of MHBD, this will always be the size of the entire file)
542
+ </td></tr>
543
+ <tr>
544
+ <td> 12 </td><td> unknown </td><td> 4 </td><td> always seems to be 1
545
+ </td></tr>
546
+ <tr>
547
+ <td> 16 </td><td> version number </td><td> 4 </td><td> appears to be a version number of the database type. 0x09 = iTunes 4.2, 0x0a = iTunes 4.5, 0x0b = iTunes 4.7, 0x0c = iTunes 4.71/4.8, 0x0d = iTunes 4.9, 0x0e = iTunes 5, 0x0f = iTunes 6, 0x10 = iTunes 6.0.1(?), 0x11 = iTunes 6.0.2-6.0.4, 0x12 = iTunes 6.0.5., 0x13 = iTunes 7.0, 0x14 = iTunes 7.1, 0x15 = iTunes 7.2, 0x16 =&nbsp;?, 0x17 = iTunes 7.3.0, 0x18 = iTunes 7.3.1-7.3.2., 0x19 = iTunes 7.4, 0x1A = iTunes 7.5, 0x1B = iTunes 7.6.0, 0x1C = iTunes 7.6.1.
548
+ </td></tr>
549
+ <tr>
550
+ <td> 20 </td><td> number of children </td><td> 4 </td><td> the number of MHSD children. This has been observed to be 2 (iTunes 4.8 and earlier) or 3 (iTunes 4.9 and older), the third being the separate podcast library in iTunes 4.9. Also it has been observed to be 4 (iTunes 7.1, 7.2) or 5 (iTunes 7.3).
551
+ </td></tr>
552
+ <tr>
553
+ <td> 24 </td><td> id </td><td> 8 </td><td> appears to a 64 bit id value for this database. Not checked by the iPod, as far as I can tell.
554
+ </td></tr>
555
+ <tr>
556
+ <td> 32 </td><td> unknown </td><td> 2 </td><td> always seems to be 2
557
+ </td></tr>
558
+ <tr>
559
+ <td> 38 </td><td> unknown </td><td> 8 </td><td> Observed in dbversion 0x11 and later. It was thought that this field is used to store some sort of starting point to generate the item's dbid, but this idea was thrown away.
560
+ </td></tr>
561
+ <tr>
562
+ <td> 48 </td><td> unknown </td><td> 2 </td><td> Observed in dbversion 0x19 and later, and must be set to 0x01 for the new iPod Nano 3G (video) and iPod Classics. The obscure hash at offset 88 needs to be set as well.
563
+ </td></tr>
564
+ <tr>
565
+ <td> 50 </td><td> unknown </td><td> 20 </td><td> Observed in dbversion 0x19 and later for the new iPod Nano 3G (video) and iPod Classics. Meaning unknown so far.
566
+ </td></tr>
567
+ <tr>
568
+ <td> 70 </td><td> language </td><td> 2 </td><td> Observed in dbversion 0x13. It looks like this is a language id (langauge of the iTunes interface). For example for English(United States) this field has values 0x65 and 0x6E which is 'en'. The size of the filed might be bigger to distinguish different 'flavors' of a language.
569
+ </td></tr>
570
+ <tr>
571
+ <td> 72 </td><td> library persistent id </td><td> 8 </td><td> Observed in dbversion 0x14. This is a 64-bit Persistent ID for this iPod Library. This matches the value of "Library Persistent ID" seen in hex form (as a 16-char hex string) in the drag object XML when dragging a song from an iPod in iTunes.
572
+ </td></tr>
573
+ <tr>
574
+ <td> 88 </td><td> obscure hash </td><td> 20 </td><td> Observed in dbversion 0x19 for iPod Nano 3G (video) and iPod Classics.
575
+ </td></tr>
576
+ <tr>
577
+ <td colspan="4"> rest of header is zero padded
578
+ </td></tr></tbody></table>
579
+ <p>The Database Object has two or three children, which are Data Sets.
580
+ </p>
581
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=4" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="DataSet"></a><h3>DataSet</h3>
582
+ <table border="1" cellpadding="5" cellspacing="0">
583
+ <caption><b>mhsd format</b>
584
+ </caption>
585
+ <tbody><tr>
586
+ <th style="background:#efefef;"> offset
587
+ </th><th style="background:#efefef;"> field
588
+ </th><th style="background:#efefef;"> size
589
+ </th><th style="background:#efefef;"> value
590
+ </th></tr>
591
+ <tr>
592
+ <td> 0 </td><td> header identifier </td><td> 4 </td><td> mhsd
593
+ </td></tr>
594
+ <tr>
595
+ <td> 4 </td><td> header length </td><td> 4 </td><td> size of the mhsd header
596
+ </td></tr>
597
+ <tr>
598
+ <td> 8 </td><td> total length </td><td> 4 </td><td> size of the header and all child records
599
+ </td></tr>
600
+ <tr>
601
+ <td> 12 </td><td> type </td><td> 4 </td><td> A type number.
602
+ <pre>1 = Track list - contains an MHLT
603
+ 2 = Playlist List - contains an MHLP
604
+ 3 = Podcast List - optional, probably. Contains an MHLP also.
605
+ This MHLP is basically the same as the full playlist section,
606
+ except it contains the podcasts in a slightly different way.
607
+ See the Playlists section.
608
+ 4 = Album List, first seen with iTunes 7.1.
609
+ 5 = New Playlist List with Smart Playlists, first seen with iTunes 7.3.
610
+ </pre>
611
+ </td></tr>
612
+ <tr>
613
+ <td colspan="4"> rest of header is zero padded
614
+ </td></tr></tbody></table>
615
+ <p>Depending on the type of Data Set, it will contain either a Track List child or a Playlist List child. Order is not guaranteed. Example files have contained the type 3 MHSD before the type 2 MHSD. In order for the iPod to list podcasts the type 3 Data Set MUST come between the type 1 and type 2 Data Sets.
616
+ </p>
617
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=5" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="TrackList"></a><h3>TrackList</h3>
618
+ <table border="1" cellpadding="5" cellspacing="0">
619
+ <caption><b>mhlt format</b>
620
+ </caption>
621
+ <tbody><tr>
622
+ <th style="background:#efefef;"> offset
623
+ </th><th style="background:#efefef;"> field
624
+ </th><th style="background:#efefef;"> size
625
+ </th><th style="background:#efefef;"> value
626
+ </th></tr>
627
+ <tr>
628
+ <td> 0 </td><td> header identifier </td><td> 4 </td><td> mhlt
629
+ </td></tr>
630
+ <tr>
631
+ <td> 4 </td><td> header length </td><td> 4 </td><td> size of the mhlt header
632
+ </td></tr>
633
+ <tr>
634
+ <td> 8 </td><td> number of songs </td><td> 4 </td><td> the total number of songs in the Track List
635
+ </td></tr>
636
+ <tr>
637
+ <td colspan="4"> rest of header is zero padded
638
+ </td></tr></tbody></table>
639
+ <p>The Track List has Track Items as its children. The number of Track Items is the same as the number of songs.
640
+ </p>
641
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=6" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Track_Item"></a><h3>Track Item</h3>
642
+ <table border="1" cellpadding="5" cellspacing="0">
643
+ <caption><b>mhit format</b>
644
+ </caption>
645
+ <tbody><tr>
646
+ <th style="background:#efefef;"> offset
647
+ </th><th style="background:#efefef;"> field
648
+ </th><th style="background:#efefef;"> size
649
+ </th><th style="background:#efefef;"> value
650
+ </th></tr>
651
+ <tr>
652
+ <td> 0 </td><td> header identifier </td><td> 4 </td><td> mhit
653
+ </td></tr>
654
+ <tr>
655
+ <td> 4 </td><td> header length </td><td> 4 </td><td> size of the mhit header. For dbversion &lt;= 0x0b (iTunes 4.7 and earlier), the length is 0x9c. For dbversion &gt;= 0x0c (iTunes 4.71 and later), the size is 0xf4. For dbversion = 0x12 (iTunes 6.0.5), 0x13 (iTunes 7.0) the size is 0x148. For dbversion &gt;= 0x14 (iTunes 7.1) the size is 0x184. For dbversion &gt;= 0x1b (iTunes 7.6), the size is 0x01b4.
656
+ </td></tr>
657
+ <tr>
658
+ <td> 8 </td><td> total length </td><td> 4 </td><td> size of the header and all child records
659
+ </td></tr>
660
+ <tr>
661
+ <td> 12 </td><td> number of strings </td><td> 4 </td><td> number of strings (mhods) that are children of this mhit
662
+ </td></tr>
663
+ <tr>
664
+ <td> 16 </td><td> unique id </td><td> 4 </td><td> unique ID for a track (referenced in playlists)
665
+ </td></tr>
666
+ <tr>
667
+ <td> 20 </td><td> visible </td><td> 4 </td><td> If this value is 1, the song is visible on the iPod. All other values cause the file to be hidden. Was previously known as unk1.
668
+ </td></tr>
669
+ <tr>
670
+ <td> 24 </td><td> filetype </td><td> 4 </td><td> This appears to always be 0 on 1st through 4th generation hard drive-based iPods. For the iTunesDB that is written to the 5th generation iPod (iPod Video) and the iPod Shuffle, iTunes 4.7.1 (and greater) writes out the file's type as an ANSI string padded with spaces. For example, an MP3 file has a filetype of 0x4d503320 -&gt; 0x4d = 'M', 0x50 = 'P', 0x33 = '3', 0x20 = &lt;space&gt;. AAC is 0x41414320 &amp; "new" AAC which is used by iTunes 7, M4A, is 0x4D344120. Protected AAC files (purchased from iTunes Store) are M4P = 0x4D345020. Was previously known as unk2. This really is an integer field and is reversed in iTunesDB used in mobile phones with reversed endianess.
671
+ </td></tr>
672
+ <tr>
673
+ <td> 28 </td><td> type1 </td><td> 1 </td><td> CBR MP3s are type 0x00, VBR MP3s are type 0x01, AAC are type 0x00
674
+ </td></tr>
675
+ <tr>
676
+ <td> 29 </td><td> type2 </td><td> 1 </td><td> CBR MP3s are type 0x01, VBR MP3s are type 0x01, AAC are type 0x00 (type1 and type2 used to be one 2 byte field, but by it doesn't get reversed in the reversed endian iTunesDB for mobile phones, so it must be two fields).
677
+ </td></tr>
678
+ <tr>
679
+ <td> 30 </td><td> compilation flag </td><td> 1 </td><td> 1 if the flag is on, 0 if the flag is off
680
+ </td></tr>
681
+ <tr>
682
+ <td> 31 </td><td> stars/rating </td><td> 1 </td><td> the rating of the track * 20. Note that the iPod does not update this value here when you change the rating. See the Play Counts file for more information.
683
+ </td></tr>
684
+ <tr>
685
+ <td> 32 </td><td> last modified time </td><td> 4 </td><td> last modified time of the track
686
+ </td></tr>
687
+ <tr>
688
+ <td> 36 </td><td> size </td><td> 4 </td><td> size of the track, in bytes
689
+ </td></tr>
690
+ <tr>
691
+ <td> 40 </td><td> length </td><td> 4 </td><td> length of the track, in milliseconds
692
+ </td></tr>
693
+ <tr>
694
+ <td> 44 </td><td> track number </td><td> 4 </td><td> the track number of the track (the 9 in 9/15)
695
+ </td></tr>
696
+ <tr>
697
+ <td> 48 </td><td> total tracks </td><td> 4 </td><td> the total number of tracks on this album (the 15 in 9/15)
698
+ </td></tr>
699
+ <tr>
700
+ <td> 52 </td><td> year </td><td> 4 </td><td> year of the track
701
+ </td></tr>
702
+ <tr>
703
+ <td> 56 </td><td> bitrate </td><td> 4 </td><td> bitrate of the track (ie, 128, 320, etc)
704
+ </td></tr>
705
+ <tr>
706
+ <td> 60 </td><td> sample rate </td><td> 4 </td><td> sample rate of the track (ie. 44100) multiplied by 0x10000.
707
+ </td></tr>
708
+ <tr>
709
+ <td> 64 </td><td> volume </td><td> 4 </td><td> Volume adjustment field. This is a value from -255 to 255 that will be applied to the track on playback. If you adjust the volume slider in iTunes track info screen, this is what you are adjusting.
710
+ </td></tr>
711
+ <tr>
712
+ <td> 68 </td><td> start time </td><td> 4 </td><td> time, in milliseconds, that the song will start playing at
713
+ </td></tr>
714
+ <tr>
715
+ <td> 72 </td><td> stop time </td><td> 4 </td><td> time, in milliseconds, that the song will stop playing at
716
+ </td></tr>
717
+ <tr>
718
+ <td> 76 </td><td> soundcheck </td><td> 4 </td><td> The SoundCheck value to apply to the song, when SoundCheck is switched on in the iPod settings. The value to put in this field can be determined by the equation: X = 1000 * 10 ^ (-.1 * Y) where Y is the adjustment value in dB and X is the value that goes into the SoundCheck field. The value 0 is special, the equation is not used and it is treated as "no Soundcheck" (basically the same as the value 1000). This equation works perfectly well with ReplayGain derived data instead of the iTunes SoundCheck derived information.
719
+ </td></tr>
720
+ <tr>
721
+ <td> 80 </td><td> play count </td><td> 4 </td><td> play count of the song. Note that the iPod does not update this value here. See the Play Counts file for more information.
722
+ </td></tr>
723
+ <tr>
724
+ <td> 84 </td><td> play count 2 </td><td> 4 </td><td> play count of the song since the last sync. Used to sync play count information back to iTunes. See the Play Counts file for more information.
725
+ </td></tr>
726
+ <tr>
727
+ <td> 88 </td><td> last played time </td><td> 4 </td><td> time the song was last played. Note that the iPod does not update this value here. See the Play Counts file for more information.
728
+ </td></tr>
729
+ <tr>
730
+ <td> 92 </td><td> disc number </td><td> 4 </td><td> disc number, for multi disc sets
731
+ </td></tr>
732
+ <tr>
733
+ <td> 96 </td><td> total discs </td><td> 4 </td><td> total number of discs, for multi disc sets.
734
+ </td></tr>
735
+ <tr>
736
+ <td> 100 </td><td> userid </td><td> 4 </td><td> Apple Store/Audible User ID (for DRM'ed files only, set to 0 otherwise). Previously known as unk5.
737
+ </td></tr>
738
+ <tr>
739
+ <td> 104 </td><td> date added </td><td> 4 </td><td> date added to the iPod or iTunes (not certain which)
740
+ </td></tr>
741
+ <tr>
742
+ <td> 108 </td><td> bookmark time </td><td> 4 </td><td> the point, in milliseconds, that the track will start playing back at. This is used for AudioBook filetypes (.AA and .M4B) based on the file extension. Note that there is also a bookmark value in the play counts file that will be set by the iPod and can be used instead of this value. See the Play Counts file for more information.
743
+ </td></tr>
744
+ <tr>
745
+ <td> 112 </td><td> dbid </td><td> 8 </td><td> Unique 64 bit value that identifies this song across the databases on the iPod. For example, this id joins an iTunesDB mhit with a ArtworkDB mhii. iTunes appears to randomly create this value for a newly formatted iPod, then increments it by 1 for each additional song added. Previously known as unk7 and unk8.
746
+ </td></tr>
747
+ <tr>
748
+ <td> 120 </td><td> checked </td><td> 1 </td><td> 0 if the track is checked, 1 if it is not (in iTunes)
749
+ </td></tr>
750
+ <tr>
751
+ <td> 121 </td><td> application rating </td><td> 1 </td><td> This is the rating that the song had before it was last changed, sorta. If you sync iTunes and the iPod, and they have different (new) ratings, the rating from iTunes will go here and the iPod rating will take precedence and go into the normal rating field. I'm uncertain what exactly this is for, but it's always set to what the iTunes rating is before each sync.
752
+ </td></tr>
753
+ <tr>
754
+ <td> 122 </td><td> BPM </td><td> 2 </td><td> the BPM of the track
755
+ </td></tr>
756
+ <tr>
757
+ <td> 124 </td><td> artwork count </td><td> 2 </td><td> The number of album artwork items put into the tags of this song. Even if you don't put any artwork items into the tags of the song, this value must at least be 1 for the iPod to display any artwork stored in the ithmb files.
758
+ </td></tr>
759
+ <tr>
760
+ <td> 126 </td><td> unk9 </td><td> 2 </td><td> unknown, but always seems to be 0xffff for MP3/AAC songs, 0x0 for uncompressed songs (like WAVE format), 0x1 for Audible
761
+ </td></tr>
762
+ <tr>
763
+ <td> 128 </td><td> artwork size </td><td> 4 </td><td> The total size of artwork (in bytes) attached to this song (i.e. put into the song as tags). Observed in iPodDB version 0x0b and with an iPod Photo as well as with iPodDB version 0x0d and an iPod Nano.
764
+ </td></tr>
765
+ <tr>
766
+ <td> 132 </td><td> unk11 </td><td> 4 </td><td> unknown
767
+ </td></tr>
768
+ <tr>
769
+ <td> 136 </td><td> sample rate 2 </td><td> 4 </td><td> The sample rate of the song expressed as an IEEE 32 bit floating point number. It's uncertain why this is here.
770
+ </td></tr>
771
+ <tr>
772
+ <td> 140 </td><td> date released </td><td> 4 </td><td> date/time added to music store? For podcasts this corresponds to the release date as displayed to the right of the podcast title. Formerly known as unk13.
773
+ </td></tr>
774
+ <tr>
775
+ <td> 144 </td><td> unk14/1 </td><td> 2 </td><td> unknown, but MPEG-1 Layer-3 songs appear to be always 0x000c, MPEG-2 Layer 3 songs (extrem low bitrate) appear to be 0x0016, MPEG-2.5 Layer 3 songs are 0x0020, AAC songs are always 0x0033, Audible files are 0x0029, WAV files are 0x0000.
776
+ </td></tr>
777
+ <tr>
778
+ <td> 146 </td><td> explicit flag </td><td> 2 </td><td> If this flag is set to 1, the track is shown as explicit content in iTunes. Otherwise set this flag to 0. Was previously known as unk14/2.
779
+ </td></tr>
780
+ <tr>
781
+ <td> 148 </td><td> unk15 </td><td> 4 </td><td> unknown - used for Apple Store DRM songs (always 0x01010100?), zero otherwise
782
+ </td></tr>
783
+ <tr>
784
+ <td> 152 </td><td> unk16 </td><td> 4 </td><td> unknown
785
+ </td></tr>
786
+ <tr>
787
+ <td> 156 </td><td> Skip Count </td><td> 4 </td><td> Number of times the track has been skipped. Formerly unknown 17 (added in dbversion 0x0c)
788
+ </td></tr>
789
+ <tr>
790
+ <td> 160 </td><td> Last Skipped </td><td> 4 </td><td> Date/time last skipped. Formerly unknown 18 (added in dbversion 0x0c)
791
+ </td></tr>
792
+ <tr>
793
+ <td> 164 </td><td> has_artwork </td><td> 1 </td><td> added in dbversion 0xd. Seems to be set to 0x02 for tracks without associated artwork (even if artwork is present, it will not be shown on the iPod) and 0x01 for tracks with associated artwork.
794
+ </td></tr>
795
+ <tr>
796
+ <td> 165 </td><td> skip_when_shuffling </td><td> 1 </td><td> sets "Skip When Shuffling" when set to 0x1 (added in dbversion 0xd, formerly known as flag2)
797
+ </td></tr>
798
+ <tr>
799
+ <td> 166 </td><td> remember_playback_position </td><td> 1 </td><td> sets "Remember Playback Position" when set to 0x1 (added in dbversion 0xd). Note that Protected AAC files (.m4b extension) and Audible files (.aa extension) do not set this flag or the previous one (skip_when_shuffling), and yet are always bookmarkable and are never included in the song shuffle. To determine if a file is bookmarkable, therefore, check the file type first. If it's not an .m4b or .aa, then check this flag in iTunesDB. (Formerly known as flag3)
800
+ </td></tr>
801
+ <tr>
802
+ <td> 167 </td><td> flag4 </td><td> 1 </td><td> some kind of "Podcast" flag (added in dbversion 0xd)? When this flag is set to 0x1 then the "Now playing" page will not show the artist name, but only title and album. When additionally has_artwork is 0x2 then there will be a new sub-page on the "Now playing" page with information about the podcast/song.
803
+ <p>If the track item is a kind of podcast then this flag must be set to 0x1 or 0x2, otherwise this flag must be set to 0x0. If this flag do not follow this, it might be removed from iTunesDB when user change there iPod to sync podcasts/songs in iTunes.
804
+ </p>
805
+ </td></tr>
806
+ <tr>
807
+ <td> 168 </td><td> dbid2 </td><td> 8 </td><td> Until dbversion 0x12, same data as dbid above (added in dbversion 0x0c). Since 0x12, this field value differs from the dbid one.
808
+ </td></tr>
809
+ <tr>
810
+ <td> 176 </td><td> lyrics flag </td><td> 1 </td><td> set to 0x01 if lyrics are stored in the MP3 tags ("USLT"), 0 otherwise.
811
+ </td></tr>
812
+ <tr>
813
+ <td> 177 </td><td> movie file flag </td><td> 1 </td><td> if 0x1, it is a movie file. Otherwise, it is an audio file.
814
+ </td></tr>
815
+ <tr>
816
+ <td> 178 </td><td> played_mark </td><td> 1 </td><td> added in dbversion 0x0c, first values observed in 0x0d. Observed to be 0x01 for non-podcasts. With podcasts, a value of 0x02 marks this track with a bullet as 'not played' on the iPod, irrespective of the value of play count above. A value of 0x01 removes the bullet. Formerly known as unk20.
817
+ </td></tr>
818
+ <tr>
819
+ <td> 179 </td><td> unk17 </td><td> 1 </td><td> unknown - added in dbversion 0x0c. So far always 0.
820
+ </td></tr>
821
+ <tr>
822
+ <td> 180 </td><td> unk21 </td><td> 4 </td><td> unknown (added in dbversion 0x0c)
823
+ </td></tr>
824
+ <tr>
825
+ <td> 184 </td><td> pregap </td><td> 4 </td><td> Number of samples of silence before the songs starts (for gapless playback).
826
+ </td></tr>
827
+ <tr>
828
+ <td> 188 </td><td> sample count </td><td> 8 </td><td> Number of samples in the song (for gapless playback).
829
+ </td></tr>
830
+ <tr>
831
+ <td> 196 </td><td> unk25 </td><td> 4 </td><td> unknown (added in dbversion 0x0c)
832
+ </td></tr>
833
+ <tr>
834
+ <td> 200 </td><td> postgap </td><td> 4 </td><td> Number of samples of silence at the end of the song (for gapless playback).
835
+ </td></tr>
836
+ <tr>
837
+ <td> 204 </td><td> unk27 </td><td> 4 </td><td> unknown - added in dbversion 0x0c, first values observed in 0x0d. Appears to be 0x1 for files encoded using the MP3 encoder, 0x0 otherwise.
838
+ </td></tr>
839
+ <tr>
840
+ <td> 208 </td><td> Media Type </td><td> 4 </td><td> (formerly known as unk28; added in dbversion 0x0c). It seems that this field denotes the type of the file on (e.g.) the 5g video iPod. It must be set to 0x00000001 for audio files, and set to 0x00000002 for video files. If set to 0x00, the files show up in both, the audio menus ("Songs", "Artists", etc.) and the video menus ("Movies", "Music Videos", etc.). It appears to be set to 0x20 for music videos, and if set to 0x60 the file shows up in "TV Shows" rather than "Movies".<br>
841
+ <p>The following list summarizes all observed types:
842
+ </p>
843
+ <ul>
844
+ <li>0x00 00 00 00 - Audio/Video </li>
845
+ <li>0x00 00 00 01 - Audio</li>
846
+ <li>0x00 00 00 02 - Video</li>
847
+ <li>0x00 00 00 04 - Podcast</li>
848
+ <li>0x00 00 00 06 - Video Podcast</li>
849
+ <li>0x00 00 00 08 - Audiobook</li>
850
+ <li>0x00 00 00 20 - Music Video</li>
851
+ <li>0x00 00 00 40 - TV Show (shows up ONLY in TV Shows</li>
852
+ <li>0x00 00 00 60 - TV Show (shows up in the Music lists as well)</li>
853
+ </ul>
854
+ <p><b>Caution:</b> Even if a track is marked as "Audiobook" here (value 0x08), it will <b>not</b> show up in the "Audiobooks" menu on the iPod. Only *.aa and *.m4b are shown there by recent firmwares. One proven exception: On the <i>nano</i> they show if they have the correct media type set here <b>and</b> the MHIT also has a <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB#Chapter_Data_.28Type_17.29" title="">chapter data mhod</a>!
855
+ </p>
856
+ </td></tr>
857
+ <tr>
858
+ <td> 212 </td><td> season number </td><td> 4 </td><td> the season number of the track, for TV shows only. Previously known as unk29. (added in dbversion 0x0c)
859
+ </td></tr>
860
+ <tr>
861
+ <td> 216 </td><td> episode number </td><td> 4 </td><td> the episode number of the track, for TV shows only - although not displayed on the iPod, the episodes are sorted by episode number. Previously known as unk30. (added in dbversion 0x0c)
862
+ </td></tr>
863
+ <tr>
864
+ <td> 220 </td><td> unk31 </td><td> 4 </td><td> unknown (added in dbversion 0x0c). Has something to do with protected files - set to 0x0 for non-protected files.
865
+ </td></tr>
866
+ <tr>
867
+ <td> 224 </td><td> unk32 </td><td> 4 </td><td> unknown (added in dbversion 0x0c)
868
+ </td></tr>
869
+ <tr>
870
+ <td> 228 </td><td> unk33 </td><td> 4 </td><td> unknown (added in dbversion 0x0c)
871
+ </td></tr>
872
+ <tr>
873
+ <td> 232 </td><td> unk34 </td><td> 4 </td><td> unknown (added in dbversion 0x0c)
874
+ </td></tr>
875
+ <tr>
876
+ <td> 236 </td><td> unk35 </td><td> 4 </td><td> unknown (added in dbversion 0x0c)
877
+ </td></tr>
878
+ <tr>
879
+ <td> 240 </td><td> unk36 </td><td> 4 </td><td> unknown (added in dbversion 0x0c)
880
+ </td></tr>
881
+ <tr>
882
+ <td> 244 </td><td> unk37 </td><td> 4 </td><td> unknown (added in dbversion 0x13)
883
+ </td></tr>
884
+ <tr>
885
+ <td> 248 </td><td> gaplessData </td><td> 4 </td><td> The size in bytes from first Synch Frame (which is usually the XING frame that includes the LAME tag) until the 8th before the last frame. The gapless playback does not work for MP3 files if this is set to zero. Maybe the iPod prepares the next track when rest 8 frames in the actual track. For AAC tracks, this may be zero. (added in dbversion 0x13)
886
+ </td></tr>
887
+ <tr>
888
+ <td> 252 </td><td> unk38 </td><td> 4 </td><td> unknown (added in dbversion 0x0c)
889
+ </td></tr>
890
+ <tr>
891
+ <td> 256 </td><td> gaplessTrackFlag </td><td> 2 </td><td> if 1, this track has gapless playback data (added in dbversion 0x13)
892
+ </td></tr>
893
+ <tr>
894
+ <td> 258 </td><td> gaplessAlbumFlag </td><td> 2 </td><td> if 1, this track does not use crossfading in iTunes (added in dbversion 0x13)
895
+ </td></tr>
896
+ <tr>
897
+ <td> 260 </td><td> unk39 </td><td> 20 </td><td> Appears to be a hash, not checked by the iPod
898
+ </td></tr>
899
+ <tr>
900
+ <td> 280 </td><td> unk40 </td><td> 4 </td><td> unknown (seen set to 0xbf)
901
+ </td></tr>
902
+ <tr>
903
+ <td> 284 </td><td> unk41 </td><td> 4 </td><td> unknown
904
+ </td></tr>
905
+ <tr>
906
+ <td> 288 </td><td> unk42 </td><td> 4 </td><td> unknown (always 0x00&nbsp;?)
907
+ </td></tr>
908
+ <tr>
909
+ <td> 292 </td><td> unk43 </td><td> 4 </td><td> unknown (previously length 8, seen as 0x818080808080)
910
+ </td></tr>
911
+ <tr>
912
+ <td> 296 </td><td> unk44 </td><td> 2 </td><td> unknown (previously length 8, seen as 0x818080808080)
913
+ </td></tr>
914
+ <tr>
915
+ <td> 298 </td><td> AlbumID </td><td> 2 </td><td> album id from the album list (previously unknown length 8, seen as 0x818080808080)
916
+ </td></tr>
917
+ <tr>
918
+ <td> 300 </td><td> mhii-link </td><td> 4 </td><td> Setting this offset to&nbsp;!= 0 triggers the 'Right-Pane-Artwork-Slideshow' on late 2007 iPods (3g Nano) and causes the iPod to use this value to do artwork lookups (dbid_1 will be ignored!). This value should be set to the id of the corresponding ArtworkDB mhii (Offset 16)
919
+ </td></tr>
920
+
921
+
922
+
923
+ <tr>
924
+ <td colspan="4"> The rest of the mhit is zero padded.
925
+ </td></tr></tbody></table>
926
+ <p>The MHIT is followed by several Data Objects which have string types. At minimum, it must have a Location type MHOD, in order to tell the iPod where the file is located on the iPod itself. It always has a FileType MHOD as well, although it's not totally necessary.
927
+ </p>
928
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=7" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Playlist_List"></a><h3>Playlist List</h3>
929
+ <table border="1" cellpadding="5" cellspacing="0">
930
+ <caption><b>mhlp format</b>
931
+ </caption>
932
+ <tbody><tr>
933
+ <th style="background:#efefef;"> offset
934
+ </th><th style="background:#efefef;"> field
935
+ </th><th style="background:#efefef;"> size
936
+ </th><th style="background:#efefef;"> value
937
+ </th></tr>
938
+ <tr>
939
+ <td> 0 </td><td> header identifier </td><td> 4 </td><td> mhlp
940
+ </td></tr>
941
+ <tr>
942
+ <td> 4 </td><td> header length </td><td> 4 </td><td> size of the mhlp header
943
+ </td></tr>
944
+ <tr>
945
+ <td> 8 </td><td> number of playlists </td><td> 4 </td><td> the number of playlists on the iPod. This includes the Library playlist.
946
+ </td></tr>
947
+ <tr>
948
+ <td colspan="4"> rest of header is zero padded
949
+ </td></tr></tbody></table>
950
+ <p>The Playlist List has all the playlists as its children. The very first playlist *must* be the Library playlist. This is a normal playlist, but it has the special "hidden" bit set in it, and it contains all the songs on the iPod (in no particular order).
951
+ </p>
952
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=8" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Playlist"></a><h3>Playlist</h3>
953
+ <table border="1" cellpadding="5" cellspacing="0">
954
+ <caption><b>mhyp format</b>
955
+ </caption>
956
+ <tbody><tr>
957
+ <th style="background:#efefef;"> offset
958
+ </th><th style="background:#efefef;"> field
959
+ </th><th style="background:#efefef;"> size
960
+ </th><th style="background:#efefef;"> value
961
+ </th></tr>
962
+ <tr>
963
+ <td> 0 </td><td> header identifier </td><td> 4 </td><td> mhyp
964
+ </td></tr>
965
+ <tr>
966
+ <td> 4 </td><td> header length </td><td> 4 </td><td> size of the mhyp header
967
+ </td></tr>
968
+ <tr>
969
+ <td> 8 </td><td> total length </td><td> 4 </td><td> size of the header and all child records
970
+ </td></tr>
971
+ <tr>
972
+ <td> 12 </td><td> Data Object Child Count </td><td> 4 </td><td> number of Data Objects in the List
973
+ </td></tr>
974
+ <tr>
975
+ <td> 16 </td><td> Playlist Item Count </td><td> 4 </td><td> number of Playlist Items in the List
976
+ </td></tr>
977
+ <tr>
978
+ <td> 20 </td><td> Is Master Playlist flag </td><td> 1 </td><td> 1 if the playlist is the Master (Library) playlist, 0 if it is not. Only the Master (Library) Playlist should have a 1 here.
979
+ </td></tr>
980
+ <tr>
981
+ <td> 21 </td><td> unk </td><td> 3 </td><td> Probably three more flags, the first of which has been observed to have been set to 1 for some playlists.
982
+ </td></tr>
983
+ <tr>
984
+ <td> 24 </td><td> timestamp </td><td> 4 </td><td> time of the playlists creation
985
+ </td></tr>
986
+ <tr>
987
+ <td> 28 </td><td> persistent playlist ID </td><td> 8 </td><td> a unique, randomly generated ID for the playlist
988
+ </td></tr>
989
+ <tr>
990
+ <td> 36 </td><td> unk3 </td><td> 4 </td><td> Always zero?
991
+ </td></tr>
992
+ <tr>
993
+ <td> 40 </td><td> String MHOD Count </td><td> 2 </td><td> This appears to be the number of string MHODs (type &lt; 50) associated with this playlist (typically 0x01). Doesn't seem to be signficant unless you include Type 52 MHODs. Formerly known as unk4.
994
+ </td></tr>
995
+ <tr>
996
+ <td> 42 </td><td> Podcast Flag </td><td> 1 </td><td> This is set to 0 on normal playlists and to 1 for the Podcast playlist. If set to 1, the playlist will not be shown under 'Playlists' on the iPod, but as 'Podcasts' under the Music menu.. The actual title of the Playlist does not matter. If more than one playlist is set to 1, they don't show up at all. They also don't show up if you set this to 1 on one playlist and 2 on the other. Please note that podcast playlists are organized slightly different than ordinary playlists (see below).
997
+ </td></tr>
998
+ <tr>
999
+ <td> 43 </td><td> Group Flag </td><td> 1 </td><td> This is set to 0 on normal playlists and to 1 for a grouping playlist which is a new feature of iTunes 7. If set to 1, this playlist will show up as a toplevel folder on the iPod, if you hit the center button you will get a list of included playlists. Unclear so far: How are the included playlists determined? MHOD 100?
1000
+ </td></tr>
1001
+ <tr>
1002
+ <td> 44 </td><td> List Sort Order </td><td> 4 </td><td> The field that the playlist will be sorted by. See list below.
1003
+ </td></tr>
1004
+ <tr>
1005
+ <td colspan="4"> rest of header is zero padded
1006
+ </td></tr></tbody></table>
1007
+ <p>The structure of the Playlists are different than most others. Each Playlist looks like this, conceptually:
1008
+ </p>
1009
+ <pre> &lt;mhyp&gt;
1010
+ &lt;mhod type=1&gt;Playlist Name&lt;/mhod&gt;
1011
+ &lt;mhod type=50&gt;Smart Playlist Info&lt;/mhod&gt; (optional)
1012
+ &lt;mhod type=51&gt;Smart Playlist Rules&lt;/mhod&gt; (optional)
1013
+ ...
1014
+ &lt;mhip&gt;Playlist Item&lt;/mhip&gt;
1015
+ &lt;mhod type=100&gt;Position Indicator&lt;/mhod&gt;
1016
+ &lt;mhip&gt;Playlist Item&lt;/mhip&gt;
1017
+ &lt;mhod type=100&gt;Position Indicator&lt;/mhod&gt;
1018
+ ...
1019
+ &lt;/mhyp&gt;
1020
+ </pre>
1021
+ <p>The point being that these are all considered in the MHYP for the size calculations. However, in the "Data Object" child count, ONLY those MHODs that come before the first MHIP are counted. The "position indicators" are children of the MHIPs (older firmwares had a bug in this respect).
1022
+ </p><p><br>
1023
+ </p>
1024
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=9" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="List_Sort_Order"></a><h4>List Sort Order</h4>
1025
+ <pre>1 - playlist order (manual sort order)
1026
+ 2 -&nbsp;???
1027
+ 3 - songtitle
1028
+ 4 - album
1029
+ 5 - artist
1030
+ 6 - bitrate
1031
+ 7 - genre
1032
+ 8 - kind
1033
+ 9 - date modified
1034
+ 10 - track number
1035
+ 11 - size
1036
+ 12 - time
1037
+ 13 - year
1038
+ 14 - sample rate
1039
+ 15 - comment
1040
+ 16 - date added
1041
+ 17 - equalizer
1042
+ 18 - composer
1043
+ 19 -&nbsp;???
1044
+ 20 - play count
1045
+ 21 - last played
1046
+ 22 - disc number
1047
+ 23 - my rating
1048
+ 24 - release date (I guess, it's the value for the "Podcasts" list)
1049
+ 25 - BPM
1050
+ 26 - grouping
1051
+ 27 - category
1052
+ 28 - description
1053
+ 29 - show
1054
+ 30 - season
1055
+ 31 - episode number
1056
+ </pre>
1057
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=10" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Podcasts"></a><h4>Podcasts</h4>
1058
+ <p>The podcasts playlist is organized slightly differently, in the Type 3 MHSD. For example:
1059
+ </p>
1060
+ <pre>mhyp (MHODs: 2, MHIPs: 5, hidden: 0, list sort order: 0x18)
1061
+ mhod (type: 1, string: 'Podcasts')
1062
+ mhod (type: 100)
1063
+ mhip (MHODs: 1, groupflag: 256, groupid: 8232, trackid: 0, timestamp: 0, groupref: 0)
1064
+ mhod (type: 1, string: 'Example podcast')
1065
+ mhip (MHODs: 1, groupflag: 0, groupid: 8233, trackid: 8230, timestamp: 3206828281, groupref: 8232)
1066
+ mhod (type: 100)
1067
+ mhip (MHODs: 1, groupflag: 0, groupid: 8234, trackid: 8226, timestamp: 3206828379, groupref: 8232)
1068
+ mhod (type: 100)
1069
+ mhip (MHODs: 1, groupflag: 0, groupid: 8235, trackid: 8228, timestamp: 3206828327, groupref: 8232)
1070
+ mhod (type: 100)
1071
+ mhip (MHODs: 1, groupflag: 0, groupid: 8236, trackid: 8224, timestamp: 3206828394, groupref: 8232)
1072
+ mhod (type: 100)
1073
+ </pre>
1074
+ <p>The first mhip (probably identified by groupflag==256) contains the name of a podcast which will then appear as a submenu of the Podcasts menu on the iPod. The other mhips (which reference the episodes in that podcast) seem to use the groupref field to link to their 'parent' mhip (using the groupid field). At the same time the groupids of the episodes are unique as well, but don't seem to be used anywhere else.
1075
+ </p>
1076
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=11" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Playlist_Item"></a><h3>Playlist Item</h3>
1077
+ <table border="1" cellpadding="5" cellspacing="0">
1078
+ <caption><b>mhip format</b>
1079
+ </caption>
1080
+ <tbody><tr>
1081
+ <th style="background:#efefef;"> offset
1082
+ </th><th style="background:#efefef;"> field
1083
+ </th><th style="background:#efefef;"> size
1084
+ </th><th style="background:#efefef;"> value
1085
+ </th></tr>
1086
+ <tr>
1087
+ <td> 0 </td><td> header identifier </td><td> 4 </td><td> mhip
1088
+ </td></tr>
1089
+ <tr>
1090
+ <td> 4 </td><td> header length </td><td> 4 </td><td> size of the mhip header
1091
+ </td></tr>
1092
+ <tr>
1093
+ <td> 8 </td><td> total length </td><td> 4 </td><td> size of the header and all child records
1094
+ </td></tr>
1095
+ <tr>
1096
+ <td> 12 </td><td> Data Object Child Count </td><td> 4 </td><td> number of mhod following this Playlist Item (always 1 so far)
1097
+ </td></tr>
1098
+ <tr>
1099
+ <td> 16 </td><td> Podcast Grouping Flag </td><td> 2 </td><td> Formerly unk1. 0x0 = normal file. 0x100 = Podcast Group. Podcast Groups will be followed by a single child, an MHOD type 1 string, which specifies the name of the Podcast Group. They will also have a 0 (zero) for the Track ID. This field used to be some kind of correlation ID or something, but this may have been a bug. In any case, the old way breaks iPods now, and this should be set to zero on all normal songs.
1100
+ </td></tr>
1101
+ <tr>
1102
+ <td> 18 </td><td> unk4 </td><td> 1 </td><td> 0 or 1 in iTunes 7.2.
1103
+ </td></tr>
1104
+ <tr>
1105
+ <td> 19 </td><td> unk5 </td><td> 1 </td><td> 0 or 8 in iTunes 7.2.
1106
+ </td></tr>
1107
+ <tr>
1108
+ <td> 20 </td><td> Group ID (?) </td><td> 4 </td><td> Formerly unk2. A unique ID for the track. It appears it is made sure that this ID does not correspond to any real track ID. Doesn't seem to correlate to anything, but other bits reference it. See Podcast Grouping Reference below.
1109
+ </td></tr>
1110
+ <tr>
1111
+ <td> 24 </td><td> track ID </td><td> 4 </td><td> the ID number of the track in the track list. See Track Item for more info
1112
+ </td></tr>
1113
+ <tr>
1114
+ <td> 28 </td><td> timestamp </td><td> 4 </td><td> some kind of time stamp, possibly time the song was added to the playlist
1115
+ </td></tr>
1116
+ <tr>
1117
+ <td> 32 </td><td> Podcast Grouping Reference </td><td> 4 </td><td> Formerly unk3. This is the parent group that this podcast should be listed under. It should be zero the rest of the time.
1118
+ </td></tr>
1119
+ <tr>
1120
+ <td colspan="4"> rest of header is zero padded
1121
+ </td></tr></tbody></table>
1122
+ <p>For purposes of size calculations, Playlist Items have no children. However, every Playlist Item is invariably followed by a Data Object of type 100, which contains nothing but a number that is used to order/sort the playlist. See the Playlist description above for more information.
1123
+ </p><p>Please note that starting with iTunes 4.9 (mhbd file version number 0x0d) the Type 100 MHOD following the Playlist Item is considered a child of the Playlist Item and is included into the size calculation. The old behaviour was probably a bug in iTunes.
1124
+ </p>
1125
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=12" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Data_Object"></a><h3>Data Object</h3>
1126
+ <p>The Data Object is a complex beast. It's used in many places in the iTunesDB file, and there are many forms of it. We'll cover the forms one by one.
1127
+ </p>
1128
+ <table border="1" cellpadding="1" cellspacing="0">
1129
+ <caption><b>mhod types</b>
1130
+ </caption>
1131
+ <tbody><tr>
1132
+ <th style="background:#efefef;"> value
1133
+ </th><th style="background:#efefef;"> description
1134
+ </th></tr>
1135
+ <tr>
1136
+ <td>1</td><td>Title
1137
+ </td></tr>
1138
+ <tr>
1139
+ <td>2</td><td>Location (this string should be less than 112 bytes/56 UTF-16 chars (not including the terminating \0) or the iPod will skip the song when trying to play it)
1140
+ </td></tr>
1141
+ <tr>
1142
+ <td>3</td><td>Album
1143
+ </td></tr>
1144
+ <tr>
1145
+ <td>4</td><td>Artist
1146
+ </td></tr>
1147
+ <tr>
1148
+ <td>5</td><td>Genre
1149
+ </td></tr>
1150
+ <tr>
1151
+ <td>6</td><td>Filetype
1152
+ </td></tr>
1153
+ <tr>
1154
+ <td>7</td><td>EQ Setting
1155
+ </td></tr>
1156
+ <tr>
1157
+ <td>8</td><td>Comment
1158
+ </td></tr>
1159
+ <tr>
1160
+ <td>9</td><td>Category - This is the category ("Technology", "Music", etc.) where the podcast was located. Introduced in db version 0x0d.
1161
+ </td></tr>
1162
+ <tr>
1163
+ <td>12</td><td>Composer
1164
+ </td></tr>
1165
+ <tr>
1166
+ <td>13</td><td>Grouping
1167
+ </td></tr>
1168
+ <tr>
1169
+ <td>14</td><td>Description text (such as podcast show notes). Accessible by selecting the center button on the iPod, where this string is displayed along with the song title, date, and timestamp. Introduced in db version 0x0d.
1170
+ </td></tr>
1171
+ <tr>
1172
+ <td>15</td><td>Podcast Enclosure URL. Note: this is either a UTF-8 or ASCII encoded string (NOT UTF-16). Also, there is no mhod::length value for this type. Introduced in db version 0x0d.
1173
+ </td></tr>
1174
+ <tr>
1175
+ <td>16</td><td>Podcast RSS URL. Note: this is either a UTF-8 or ASCII encoded string (NOT UTF-16). Also, there is no mhod::length value for this type. Introduced in db version 0x0d.
1176
+ </td></tr>
1177
+ <tr>
1178
+ <td>17</td><td>Chapter data. This is a m4a-style entry that is used to display subsongs within a mhit. Introduced in db version 0x0d.
1179
+ </td></tr>
1180
+ <tr>
1181
+ <td>18</td><td>Subtitle (usually the same as Description). Introduced in db version 0x0d.
1182
+ </td></tr>
1183
+ <tr>
1184
+ <td>19</td><td>Show (for TV Shows only). Introduced in db version 0x0d?
1185
+ </td></tr>
1186
+ <tr>
1187
+ <td>20</td><td>Episode # (for TV Shows only). Introduced in db version 0x0d?
1188
+ </td></tr>
1189
+ <tr>
1190
+ <td>21</td><td>TV Network (for TV Shows only). Introduced in db version 0x0d?
1191
+ </td></tr>
1192
+ <tr><td>22</td><td>Album Artist. Introduced in db version 0x13?</td></tr>
1193
+ <tr><td>23</td><td>Artist name, for sorting. Artists with names like "The Beatles" will be in here as "Beatles, The". Introduced in db version 0x13?</td></tr>
1194
+ <tr><td>24</td><td>Appears to be a list of keywords pertaining to a track. Introduced in db version 0x13?</td></tr>
1195
+ <tr><td>25</td><td>Locale for TV show? (e.g. "us-tv||0|", v.0x18)</td></tr>
1196
+ <tr>
1197
+ </tr><tr><td>27</td><td>Title, for sorting.</td></tr>
1198
+ <tr><td>28</td><td>Album, for sorting.</td></tr>
1199
+ <tr><td>29</td><td>Album-Artist, for sorting.</td></tr>
1200
+ <tr><td>30</td><td>Composer, for sorting.</td></tr>
1201
+ <tr><td>31</td><td>TV-Show, for sorting.</td></tr>
1202
+ <tr><td>32</td><td>Unknown, created by iTunes 7.1 for video tracks. Binary field, no string.</td></tr>
1203
+ <tr><td>50</td><td>Smart Playlist Data
1204
+ </td></tr>
1205
+ <tr>
1206
+ <td>51</td><td>Smart Playlist Rules
1207
+ </td></tr>
1208
+ <tr>
1209
+ <td>52</td><td>Library Playlist Index
1210
+ </td></tr>
1211
+ <tr>
1212
+ <td>53</td><td>Library Playlist Index Letter Jump Table
1213
+ </td></tr>
1214
+ <tr>
1215
+ <td>100</td><td>Seems to vary. iTunes uses it for column sizing info as well as an order indicator in playlists.
1216
+ </td></tr>
1217
+ <tr>
1218
+ <td>200</td><td>Album (in Album List, iTunes 7.1)
1219
+ </td></tr>
1220
+ <tr>
1221
+ <td>201</td><td>Artist (in Album List, iTunes 7.1)
1222
+ </td></tr>
1223
+ <tr>
1224
+ <td>202</td><td>Artist, for sorting (in Album List, iTunes 7.1)
1225
+ </td></tr>
1226
+ <tr>
1227
+ <td>203</td><td>Podcast Url (in Album List, iTunes 7.1)
1228
+ </td></tr>
1229
+ <tr>
1230
+ <td>204</td><td>TV Show (in Album List, v. 0x18)
1231
+ </td></tr>
1232
+ </tbody></table>
1233
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=13" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="String_Types"></a><h4>String Types</h4>
1234
+ <p>The simplest form of MHOD. These are any MHOD with a "type" that is less than 15.
1235
+ </p>
1236
+ <table border="1" cellpadding="5" cellspacing="0">
1237
+ <caption><b>mhod format - strings</b>
1238
+ </caption>
1239
+ <tbody><tr>
1240
+ <th style="background:#efefef;"> offset
1241
+ </th><th style="background:#efefef;"> field
1242
+ </th><th style="background:#efefef;"> size
1243
+ </th><th style="background:#efefef;"> value
1244
+ </th></tr>
1245
+ <tr>
1246
+ <td> 0 </td><td> header identifier </td><td> 4 </td><td> mhod
1247
+ </td></tr>
1248
+ <tr>
1249
+ <td> 4 </td><td> header length </td><td> 4 </td><td> size of the mhod header. This is always 0x18 for string type MHOD's.
1250
+ </td></tr>
1251
+ <tr>
1252
+ <td> 8 </td><td> total length </td><td> 4 </td><td> size of the header and the string it contains
1253
+ </td></tr>
1254
+ <tr>
1255
+ <td> 12 </td><td> type </td><td> 4 </td><td> the type indicator
1256
+ </td></tr>
1257
+ <tr>
1258
+ <td> 16 </td><td> unk1 </td><td> 4 </td><td> unknown
1259
+ </td></tr>
1260
+ <tr>
1261
+ <td> 20 </td><td> unk2 </td><td> 4 </td><td> unknown
1262
+ </td></tr>
1263
+ <tr>
1264
+ <td> 24 </td><td> position </td><td> 4 </td><td> In type 100 mhod's in playlists, this is where the playlist order info is. It does not seem to be significant in string mhod's (except for location - see following notes).
1265
+ <p><i>Note:</i> This field does not exist in ArtworkDB string dohms. This was observed to be 2 for inversed endian ordered iTunesDBs for mobile phones with UTF8 strings and 1 for standard iPod iTunesDBs with UTF16 strings.
1266
+ </p><p><i>Note:</i> If you leave this set to zero on the type 2 (location) string MHOD of a Song (mhit) record, the track will show on the menu, but will not play.
1267
+ </p>
1268
+ </td></tr>
1269
+ <tr>
1270
+ <td> 28 </td><td> length </td><td> 4 </td><td> Length of the string, in bytes. If the string is UTF-16, each char takes two bytes. The string in the iTunesDB is not NULL-terminated either. Keep this in mind. Be careful with very long strings - it has been observed that strings longer than ~512 characters will cause the iPod to continously reboot when it attempts to read the database.
1271
+ </td></tr>
1272
+ <tr>
1273
+ <td> 32 </td><td> unknown </td><td> 4 </td><td> unknown. It was thought that this was string encoding: 0 == UTF-16, 1 == UTF-8, however, recent iTunesDB files have had this set to 1 even with UTF-16 strings. Therefore this is definitely incorrect, and the correct meaning has not yet been discovered yet.
1274
+ </td></tr>
1275
+ <tr>
1276
+ <td> 36 </td><td> unk4 </td><td> 4 </td><td> unknown
1277
+ </td></tr>
1278
+ <tr>
1279
+ <td> 40 </td><td> string </td><td> length </td><td> The string.
1280
+ </td></tr>
1281
+ <tr>
1282
+ <td colspan="4"> string mhods are NOT zero padded
1283
+ </td></tr></tbody></table>
1284
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=14" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Podcast_URLs_.28types_15-16.29"></a><h4>Podcast URLs (types 15-16)</h4>
1285
+ <p>Introduced in db version 0x0d, MHOD's with type 15 and 16 hold the Enclosure and RSS URL for the Podcast. The string is probably UTF-8, but only Unicode symbols U+0000 through U+007F (a.k.a ASCII) have been observed.
1286
+ </p>
1287
+ <table border="1" cellpadding="5" cellspacing="0">
1288
+ <caption><b>mhod format - podcast urls (types 15-16)</b>
1289
+ </caption>
1290
+ <tbody><tr>
1291
+ <th style="background:#efefef;"> offset
1292
+ </th><th style="background:#efefef;"> field
1293
+ </th><th style="background:#efefef;"> size
1294
+ </th><th style="background:#efefef;"> value
1295
+ </th></tr>
1296
+ <tr>
1297
+ <td> 0 </td><td> header identifier </td><td> 4 </td><td> mhod
1298
+ </td></tr>
1299
+ <tr>
1300
+ <td> 4 </td><td> header length </td><td> 4 </td><td> size of the mhod header. This is always 0x18 for string type MHOD's.
1301
+ </td></tr>
1302
+ <tr>
1303
+ <td> 8 </td><td> total length </td><td> 4 </td><td> size of the header and the string it contains
1304
+ </td></tr>
1305
+ <tr>
1306
+ <td> 12 </td><td> type </td><td> 4 </td><td> the type indicator ( 15 or 16 )
1307
+ </td></tr>
1308
+ <tr>
1309
+ <td> 16 </td><td> unk1 </td><td> 4 </td><td> unknown (always 0?)
1310
+ </td></tr>
1311
+ <tr>
1312
+ <td> 20 </td><td> unk2 </td><td> 4 </td><td> unknown (always 0?)
1313
+ </td></tr>
1314
+ <tr>
1315
+ <td> 24 </td><td> string </td><td> (total length - header length) </td><td> The string.
1316
+ </td></tr>
1317
+ <tr>
1318
+ <td colspan="4"> string mhods are NOT zero padded
1319
+ </td></tr></tbody></table>
1320
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=15" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Chapter_Data_.28type_17.29"></a><h4>Chapter Data (type 17)</h4>
1321
+ <p>The chapter data is a style of data that's very, very out of place in this file, but is here nonetheless. It defines where the chapter stops are in the track, as well as what info should be displayed for each section of the track. It seems that the format of this mhod changed significantly over time. The following is analysed from an iTunesDB version 0x13 (iTunes 7.0).
1322
+ </p>
1323
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=16" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Chapter_Data_mhod_details"></a><h5>Chapter Data mhod details</h5>
1324
+ <table border="1" cellpadding="5" cellspacing="0">
1325
+ <caption><b>mhod format - chapter data (type 17)</b>
1326
+ </caption>
1327
+ <tbody><tr>
1328
+ <th style="background:#efefef;"> offset
1329
+ </th><th style="background:#efefef;"> field
1330
+ </th><th style="background:#efefef;"> size
1331
+ </th><th style="background:#efefef;"> value
1332
+ </th></tr>
1333
+ <tr>
1334
+ <td> 0 </td><td> header identifier </td><td> 4 </td><td> mhod
1335
+ </td></tr>
1336
+ <tr>
1337
+ <td> 4 </td><td> header length </td><td> 4 </td><td> size of the mhod header. This is always 0x18.
1338
+ </td></tr>
1339
+ <tr>
1340
+ <td> 8 </td><td> total length </td><td> 4 </td><td> size of the mhod
1341
+ </td></tr>
1342
+ <tr>
1343
+ <td> 12 </td><td> type </td><td> 4 </td><td> the type indicator ( 0x11 = 17 )
1344
+ </td></tr>
1345
+ <tr>
1346
+ <td> 16 </td><td> unk1 </td><td> 4 </td><td> unknown (always 0?)
1347
+ </td></tr>
1348
+ <tr>
1349
+ <td> 20 </td><td> unk2 </td><td> 4 </td><td> unknown (always 0?)
1350
+ </td></tr>
1351
+ <tr>
1352
+ <td> 24 </td><td> unk3 </td><td> 4 </td><td> unknown (always 0?) This is not part of the header (otherwise the header length would have been different), but it is also not part of the first atom.
1353
+ </td></tr>
1354
+ <tr>
1355
+ <td> 28 </td><td> unk4 </td><td> 4 </td><td> unknown (always 0?) This is not part of the header (otherwise the header length would have been different), but it is also not part of the first atom.
1356
+ </td></tr>
1357
+ <tr>
1358
+ <td> 32 </td><td> unk5 </td><td> 4 </td><td> unknown (always 0?) This is not part of the header (otherwise the header length would have been different), but it is also not part of the first atom.
1359
+ </td></tr>
1360
+ <tr>
1361
+ <td> 36 </td><td> data </td><td> (total length - header length - 12) </td><td> The chapter stop data atoms, starting with a "sean" atom (see below).
1362
+ <p>This part of the mhod is <b>not little-endian</b> like the rest of the file. It's big-endian/
1363
+ E.g. the value 0x0123 in a 4 byte word is found as 00 00 01 23.
1364
+ It is also arranged in a tree like structure, much like the iTunesDB itself is, only the
1365
+ information is in a slightly different arrangement.
1366
+ </p>
1367
+ </td></tr></tbody></table>
1368
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=17" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Chapter_Data_Atom_Layout"></a><h5>Chapter Data Atom Layout</h5>
1369
+ <p>The atoms appear to be arranged in the following layout:
1370
+ </p>
1371
+ <pre><b>sean</b> (exactly one atom of this type is present,
1372
+ childcount is number of chapters + 1 for the hedr atom)
1373
+ <b>chap</b> (chapter indicator, childcount is always 1)
1374
+ <b>name</b> (contains a UTF16 string with name of the chapter or Artist name,
1375
+ childcount is always 0)
1376
+ chap (next chapter)
1377
+ name (and so on)...
1378
+ ...
1379
+ <b>hedr</b> (signals the end, childcount is always 0)
1380
+ </pre>
1381
+ <p>There are multiple "chap" entries, one for each chapter.
1382
+ </p><p>Older DBs seem to have a different, more complex layout, like this:
1383
+ </p>
1384
+ <pre>sean (?)
1385
+ chap (chapter indicator&nbsp;?)
1386
+ name (contains a UTF16 string with name of the chapter or Artist name)
1387
+ ploc (position/location?)
1388
+ trak (specifies track number, perhaps? This should be obvious after looking at some examples)
1389
+ urlt (contains a UTF16 string with the name of the song in the chapter or some kind of subname)
1390
+ url (contains a UTF8 string with a URL)
1391
+ chap (next chapter)
1392
+ name (and so on)...
1393
+ ...
1394
+ hedr (signals the end)
1395
+ </pre>
1396
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=18" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Chapter_Data_Atoms"></a><h5>Chapter Data Atoms</h5>
1397
+ <p>Each atom consists of the following:
1398
+ </p>
1399
+ <table border="1" cellpadding="5" cellspacing="0">
1400
+ <caption><b>chapter data atom</b>
1401
+ </caption>
1402
+ <tbody><tr>
1403
+ <th style="background:#efefef;"> offset
1404
+ </th><th style="background:#efefef;"> field
1405
+ </th><th style="background:#efefef;"> size
1406
+ </th><th style="background:#efefef;"> value
1407
+ </th></tr>
1408
+ <tr>
1409
+ <td> 0 </td><td> size </td><td> 4 </td><td> size of the atom and all its children<br>
1410
+ <pre><b>Caution:</b> This is different to all other structures in the file, where the
1411
+ name always comes first. Here, the length is the first word of the atom!
1412
+ </pre>
1413
+ </td></tr>
1414
+ <tr>
1415
+ <td> 4 </td><td> atom name </td><td> 4 </td><td> the name of the atom
1416
+ </td></tr>
1417
+ <tr>
1418
+ <td> 8 </td><td> startpos/unk1</td><td> 4 </td><td> <i>For chap atoms:</i> the starting position of this chapter in ms, except for the very first chap where this field is 1 (not 0 as expected). <br>
1419
+ <p><i>For all other atoms:</i> always 1?
1420
+ </p>
1421
+ </td></tr>
1422
+ <tr>
1423
+ <td> 12 </td><td> number of childs </td><td> 4 </td><td> the number of childs
1424
+ </td></tr>
1425
+ <tr>
1426
+ <td> 16 </td><td> unk2 </td><td> 4 </td><td> always 0?
1427
+ </td></tr>
1428
+ <tr>
1429
+ <td> 20 </td><td> data </td><td> varies </td><td> some kind of data or children
1430
+ </td></tr></tbody></table>
1431
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=19" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Chapter_Data_String_Atoms_.28UTF16.29"></a><h5>Chapter Data String Atoms (UTF16)</h5>
1432
+ <p>UTF16 String entries in these atoms (like 'name') fit the following mold:
1433
+ </p>
1434
+ <table border="1" cellpadding="5" cellspacing="0">
1435
+ <caption><b>chapter data atom - UTF16 string entries</b>
1436
+ </caption>
1437
+ <tbody><tr>
1438
+ <th style="background:#efefef;"> offset
1439
+ </th><th style="background:#efefef;"> field
1440
+ </th><th style="background:#efefef;"> size
1441
+ </th><th style="background:#efefef;"> value
1442
+ </th></tr>
1443
+ <tr>
1444
+ <td> 0 </td><td> size </td><td> 4 </td><td> size of the atom and all its children (0x16 + 2*string length in characters, e.g. for a 8 char string this is 0x26)
1445
+ </td></tr>
1446
+ <tr>
1447
+ <td> 4 </td><td> atom name </td><td> 4 </td><td> the name of the atom
1448
+ </td></tr>
1449
+ <tr>
1450
+ <td> 8 </td><td> unknown </td><td> 4 </td><td> always 1?
1451
+ </td></tr>
1452
+ <tr>
1453
+ <td> 12 </td><td> unk1 </td><td> 4 </td><td> always 0? (child count)
1454
+ </td></tr>
1455
+ <tr>
1456
+ <td> 16 </td><td> unk2 </td><td> 4 </td><td> always 0?
1457
+ </td></tr>
1458
+ <tr>
1459
+ <td> 20 </td><td> string length </td><td> 2 </td><td> string length in characters
1460
+ </td></tr>
1461
+ <tr>
1462
+ <td> 22 </td><td> string </td><td> length *2 </td><td> UTF16 string, 2 bytes per character
1463
+ </td></tr></tbody></table>
1464
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=20" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Chapter_Data_String_Atoms_.28UTF8.29"></a><h5>Chapter Data String Atoms (UTF8)</h5>
1465
+ <p>UTF8 entries fit the following mold:
1466
+ </p>
1467
+ <table border="1" cellpadding="5" cellspacing="0">
1468
+ <caption><b>chapter data atom - UTF8 string entries</b>
1469
+ </caption>
1470
+ <tbody><tr>
1471
+ <th style="background:#efefef;"> offset
1472
+ </th><th style="background:#efefef;"> field
1473
+ </th><th style="background:#efefef;"> size
1474
+ </th><th style="background:#efefef;"> value
1475
+ </th></tr>
1476
+ <tr>
1477
+ <td> 0 </td><td> size </td><td> 4 </td><td> size of the atom and all its children
1478
+ </td></tr>
1479
+ <tr>
1480
+ <td> 4 </td><td> atom name </td><td> 4 </td><td> the name of the atom
1481
+ </td></tr>
1482
+ <tr>
1483
+ <td> 8 </td><td> unknown </td><td> 4 </td><td> always 1?
1484
+ </td></tr>
1485
+ <tr>
1486
+ <td> 12 </td><td> unknown </td><td> 4 </td><td> varies.. some kind of type?
1487
+ </td></tr>
1488
+ <tr>
1489
+ <td> 16 </td><td> null </td><td> 8 </td><td> zeros
1490
+ </td></tr>
1491
+ <tr>
1492
+ <td> 24 </td><td> string </td><td> size - 24 </td><td> UTF8 string, 1 byte per character
1493
+ </td></tr></tbody></table>
1494
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=21" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Chapter_Data_hedr_Atom"></a><h5>Chapter Data hedr Atom</h5>
1495
+ <table border="1" cellpadding="5" cellspacing="0">
1496
+ <caption><b>chapter data atom - hedr</b>
1497
+ </caption>
1498
+ <tbody><tr>
1499
+ <th style="background:#efefef;"> offset
1500
+ </th><th style="background:#efefef;"> field
1501
+ </th><th style="background:#efefef;"> size
1502
+ </th><th style="background:#efefef;"> value
1503
+ </th></tr>
1504
+ <tr>
1505
+ <td> 0 </td><td> size </td><td> 4 </td><td> size of the atom, 0x1c </td></tr>
1506
+ <tr>
1507
+ <td> 4 </td><td> atom name </td><td> 4 </td><td> the name of the atom, 'hedr'
1508
+ </td></tr>
1509
+ <tr>
1510
+ <td> 8 </td><td> unk1</td><td> 4 </td><td> always 1?
1511
+ </td></tr>
1512
+ <tr>
1513
+ <td> 12 </td><td> number of childs </td><td> 4 </td><td> the number of childs, always 0
1514
+ </td></tr>
1515
+ <tr>
1516
+ <td> 16 </td><td> unk2 </td><td> 4 </td><td> always 0
1517
+ </td></tr>
1518
+ <tr>
1519
+ <td> 20 </td><td> unk3 </td><td> 4 </td><td> always 0
1520
+ </td></tr>
1521
+ <tr>
1522
+ <td> 24 </td><td> unk4 </td><td> 4 </td><td> always 1
1523
+ </td></tr>
1524
+ </tbody></table>
1525
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=22" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Smart_Playlist_Data_.28type_50.29"></a><h4>Smart Playlist Data (type 50)</h4>
1526
+ <p>A slightly more complex MHOD. These are any MHOD with a "type" that is 50.
1527
+ </p><p>This MHOD defines the stuff in the Smart playlist that is not the "rules". Basically all the checkboxes and such. It's pretty straightforward.
1528
+ </p>
1529
+ <table border="1" cellpadding="5" cellspacing="0">
1530
+ <caption><b>mhod format - Smart Playlist Data (type 50)</b>
1531
+ </caption>
1532
+ <tbody><tr>
1533
+ <th style="background:#efefef;"> offset
1534
+ </th><th style="background:#efefef;"> field
1535
+ </th><th style="background:#efefef;"> size
1536
+ </th><th style="background:#efefef;"> value
1537
+ </th></tr>
1538
+ <tr>
1539
+ <td> 0 </td><td> header identifier </td><td> 4 </td><td> mhod
1540
+ </td></tr>
1541
+ <tr>
1542
+ <td> 4 </td><td> header length </td><td> 4 </td><td> size of the mhod header.
1543
+ </td></tr>
1544
+ <tr>
1545
+ <td> 8 </td><td> total length </td><td> 4 </td><td> total length of the mhod
1546
+ </td></tr>
1547
+ <tr>
1548
+ <td> 12 </td><td> type </td><td> 4 </td><td> the type indicator ( 50 )
1549
+ </td></tr>
1550
+ <tr>
1551
+ <td> 16 </td><td> unk1 </td><td> 4 </td><td> unknown
1552
+ </td></tr>
1553
+ <tr>
1554
+ <td> 20 </td><td> unk2 </td><td> 4 </td><td> unknown
1555
+ </td></tr>
1556
+ <tr>
1557
+ <td> 24 </td><td> live update </td><td> 1 </td><td> Live Update flag. 0x01 = on, 0x00 = off
1558
+ </td></tr>
1559
+ <tr>
1560
+ <td> 25 </td><td> check rules </td><td> 1 </td><td> Rules enable flag. 0x01 = on, 0x00 = off. When this is enabled, Rules from the type 51 MHOD will be used.
1561
+ </td></tr>
1562
+ <tr>
1563
+ <td> 26 </td><td> check limits </td><td> 1 </td><td> Limits enable flag. 0x01 = on, 0x00 = off. When this is enabled, Limits listed below will actually be used.
1564
+ </td></tr>
1565
+ <tr>
1566
+ <td> 27 </td><td> limit type </td><td> 1 </td><td> Limit Type. See below for the list of limit types.
1567
+ </td></tr>
1568
+ <tr>
1569
+ <td> 28 </td><td> limit sort </td><td> 1 </td><td> Limit Sort. See below for the list of limit sorting types.
1570
+ </td></tr>
1571
+ <tr>
1572
+ <td> 29 </td><td> unknown </td><td> 3 </td><td> always zero bytes
1573
+ </td></tr>
1574
+ <tr>
1575
+ <td> 32 </td><td> limit value </td><td> 4 </td><td> The actual value used for the limit
1576
+ </td></tr>
1577
+ <tr>
1578
+ <td> 36 </td><td> match checked only </td><td> 1 </td><td> match checked only flag, 0x01 = on, 0x00 = off. When this is enabled, only songs marked as "checked" will be matched. Checked is a field in the mhit.
1579
+ </td></tr>
1580
+ <tr>
1581
+ <td> 37 </td><td> reverse limit sort </td><td> 1 </td><td> Reverse the Limit Sort flag. 0x01 = on, 0x00 = off. When this is enabled, the sort will be reversed. More on this below.
1582
+ </td></tr>
1583
+ <tr>
1584
+ <td colspan="4"> the mhod IS zero padded at the end (58 null bytes)
1585
+ </td></tr></tbody></table>
1586
+ <table border="1" cellpadding="1" cellspacing="0">
1587
+ <caption><b>Limit Types</b>
1588
+ </caption>
1589
+ <tbody><tr>
1590
+ <th style="background:#efefef;"> value
1591
+ </th><th style="background:#efefef;"> description
1592
+ </th></tr>
1593
+ <tr>
1594
+ <td>1</td><td>Minutes
1595
+ </td></tr>
1596
+ <tr>
1597
+ <td>2</td><td>Megabytes
1598
+ </td></tr>
1599
+ <tr>
1600
+ <td>3</td><td>Songs
1601
+ </td></tr>
1602
+ <tr>
1603
+ <td>4</td><td>Hours
1604
+ </td></tr>
1605
+ <tr>
1606
+ <td>5</td><td>Gigabytes
1607
+ </td></tr></tbody></table>
1608
+ <table border="1" cellpadding="1" cellspacing="0">
1609
+ <caption><b>Limit Sort Types</b>
1610
+ </caption>
1611
+ <tbody><tr>
1612
+ <th style="background:#efefef;"> value
1613
+ </th><th style="background:#efefef;"> description
1614
+ </th></tr>
1615
+ <tr>
1616
+ <td>0x02</td><td>Random
1617
+ </td></tr>
1618
+ <tr>
1619
+ <td>0x03</td><td>Song Name (alphabetical)
1620
+ </td></tr>
1621
+ <tr>
1622
+ <td>0x04</td><td>Album (alphabetical)
1623
+ </td></tr>
1624
+ <tr>
1625
+ <td>0x05</td><td>Artist (alphabetical)
1626
+ </td></tr>
1627
+ <tr>
1628
+ <td>0x07</td><td>Genre (alphabetical)
1629
+ </td></tr>
1630
+ <tr>
1631
+ <td>0x10</td><td>Most Recently Added
1632
+ </td></tr>
1633
+ <tr>
1634
+ <td>0x14</td><td>Most Often Played
1635
+ </td></tr>
1636
+ <tr>
1637
+ <td>0x15</td><td>Most Recently Played
1638
+ </td></tr>
1639
+ <tr>
1640
+ <td>0x17</td><td>Highest Rating
1641
+ </td></tr></tbody></table>
1642
+ <p>When the Reverse Limit Sort flag is set, the sort will be reversed. So most recently added becomes least recently added, and highest rating becomes lowest rating, and so on. It's just reversing the sorted list before applying the limit to it.
1643
+ </p>
1644
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=23" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Smart_Playlist_Rules_.28type_51.29"></a><h4>Smart Playlist Rules (type 51)</h4>
1645
+ <p>The most complex (and annoying) MHOD. These are any MHOD with a "type" that is 51.
1646
+ </p><p>This MHOD defines all the rules in the Smart Playlist. It is not straightforward at all. In fact, I have to break it down into subtypes itself.
1647
+ </p><p>If you've used iTunes, you know what a rule looks like. "Rating is less than 3 stars", for example. The rule consists of three parts.
1648
+ </p><p>The first part is the "field". In our example, the field is "Rating". It's the very first thing in the rule and the first pull down box in iTunes. Simple enough.
1649
+ </p><p>The second part is the "action". In our example, the action is "is less than". In iTunes, it's the second pull down box. Also pretty simple.
1650
+ </p><p>The final part is the "value". In our example, it'd be "3 stars". Since stars are always multiplied by 20 for whatever reason, it'd be "60" for our example, in the iTunesDB file.
1651
+ </p><p>We'll cover these one at a time.
1652
+ </p>
1653
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=24" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Important_Note_about_endian-ness"></a><h5>Important Note about endian-ness</h5>
1654
+ <p>Smart Playlist Rules MHODs are NOT wholly little-endian. Everything after the "SLst" to the end of the MHOD is big-endian. This is important to remember, especially when dealing with the Action types.
1655
+ </p>
1656
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=25" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Smart_Playlist_Rule_Fields"></a><h5>Smart Playlist Rule Fields</h5>
1657
+ <p>Fields are easy. Much more so than Actions. The "expected comparison" column will make more sense when you see the Values explained below.
1658
+ </p>
1659
+ <table border="1" cellpadding="1" cellspacing="0">
1660
+ <caption><b>Smart Playlist Rule Field Types</b>
1661
+ </caption>
1662
+ <tbody><tr>
1663
+ <th style="background:#efefef;"> value
1664
+ </th><th style="background:#efefef;"> description
1665
+ </th><th style="background:#efefef;"> expected comparison
1666
+ </th></tr>
1667
+ <tr>
1668
+ <td>0x02</td><td>Song Name</td><td>String
1669
+ </td></tr>
1670
+ <tr>
1671
+ <td>0x03</td><td>Album</td><td>String
1672
+ </td></tr>
1673
+ <tr>
1674
+ <td>0x04</td><td>Artist</td><td>String
1675
+ </td></tr>
1676
+ <tr>
1677
+ <td>0x05</td><td>Bitrate</td><td>Integer
1678
+ </td></tr>
1679
+ <tr>
1680
+ <td>0x06</td><td>Sample Rate</td><td>Integer
1681
+ </td></tr>
1682
+ <tr>
1683
+ <td>0x07</td><td>Year</td><td>Integer
1684
+ </td></tr>
1685
+ <tr>
1686
+ <td>0x08</td><td>Genre</td><td>String
1687
+ </td></tr>
1688
+ <tr>
1689
+ <td>0x09</td><td>Kind</td><td>String
1690
+ </td></tr>
1691
+ <tr>
1692
+ <td>0x0a</td><td>Date Modified</td><td>Timestamp
1693
+ </td></tr>
1694
+ <tr>
1695
+ <td>0x0b</td><td>Track Number</td><td>Integer
1696
+ </td></tr>
1697
+ <tr>
1698
+ <td>0x0c</td><td>Size</td><td>Integer
1699
+ </td></tr>
1700
+ <tr>
1701
+ <td>0x0d</td><td>Time</td><td>Integer
1702
+ </td></tr>
1703
+ <tr>
1704
+ <td>0x0e</td><td>Comment</td><td>String
1705
+ </td></tr>
1706
+ <tr>
1707
+ <td>0x10</td><td>Date Added</td><td>Timestamp
1708
+ </td></tr>
1709
+ <tr>
1710
+ <td>0x12</td><td>Composer</td><td>String
1711
+ </td></tr>
1712
+ <tr>
1713
+ <td>0x16</td><td>Play Count</td><td>Integer
1714
+ </td></tr>
1715
+ <tr>
1716
+ <td>0x17</td><td>Last Played</td><td>Timestamp
1717
+ </td></tr>
1718
+ <tr>
1719
+ <td>0x18</td><td>Disc Number</td><td>Integer
1720
+ </td></tr>
1721
+ <tr>
1722
+ <td>0x19</td><td>Stars/Rating</td><td>Integer (multiply by 20 for stars/rating)
1723
+ </td></tr>
1724
+ <tr>
1725
+ <td>0x1f</td><td>Compilation</td><td>Integer
1726
+ </td></tr>
1727
+ <tr>
1728
+ <td>0x23</td><td>BPM</td><td>Integer
1729
+ </td></tr>
1730
+ <tr>
1731
+ <td>0x27</td><td>Grouping</td><td>String (see special note)
1732
+ </td></tr>
1733
+ <tr>
1734
+ <td>0x28</td><td>Playlist</td><td>Integer - the playlist ID number (see special note)
1735
+ </td></tr>
1736
+ <tr>
1737
+ <td>0x36</td><td>Description</td><td>String
1738
+ </td></tr>
1739
+ <tr>
1740
+ <td>0x37</td><td>Category</td><td>String
1741
+ </td></tr>
1742
+ <tr>
1743
+ <td>0x39</td><td>Podcast</td><td>Integer
1744
+ </td></tr><tr>
1745
+ <td>0x3c</td><td>Video Kind</td><td>Logic integer, works on mediatype
1746
+ </td></tr><tr>
1747
+ <td>0x3e</td><td>TV Show</td><td>String
1748
+ </td></tr><tr>
1749
+ <td>0x3f</td><td>Season Nr</td><td>Integer
1750
+ </td></tr><tr>
1751
+ <td>0x44</td><td>Skip Count</td><td>Integer
1752
+ </td></tr><tr>
1753
+ <td>0x45</td><td>Last Skipped</td><td>Timestamp
1754
+ </td></tr><tr>
1755
+ <td>0x47</td><td>Album Artist</td><td>String
1756
+ </td></tr></tbody></table>
1757
+ <p>Special Note about Grouping and Playlist fields - They don't work with Live Updating on 3rd gen iPods, yet. This might get fixed in a future firmware release. Maybe.
1758
+ </p>
1759
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=26" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Smart_Playlist_Rule_Actions"></a><h5>Smart Playlist Rule Actions</h5>
1760
+ <p>The Action type is a 4 byte field. It is a bitmapped value, meaning that each bit of these four bytes has a different meaning.
1761
+ </p>
1762
+ <table border="1" cellpadding="1" cellspacing="0">
1763
+ <caption><b>Smart Playlist Rule Action High Byte</b>
1764
+ </caption>
1765
+ <tbody><tr>
1766
+ <th style="background:#efefef;"> bit
1767
+ </th><th style="background:#efefef;"> description
1768
+ </th></tr>
1769
+ <tr>
1770
+ <td>0</td><td>The action is referring to a string value if set, not a string if not set
1771
+ </td></tr>
1772
+ <tr>
1773
+ <td>1</td><td>NOT flag. If set, this negates the rule. Is becomes is not, contains becomes does not contain, and so forth.
1774
+ </td></tr></tbody></table>
1775
+ <table border="1" cellpadding="1" cellspacing="0">
1776
+ <caption><b>Smart Playlist Rule Action Low 2 bytes</b>
1777
+ </caption>
1778
+ <tbody><tr>
1779
+ <th style="background:#efefef;"> bit
1780
+ </th><th style="background:#efefef;"> description
1781
+ </th></tr>
1782
+ <tr>
1783
+ <td>0</td><td>Simple "IS" query
1784
+ </td></tr>
1785
+ <tr>
1786
+ <td>1</td><td>Contains
1787
+ </td></tr>
1788
+ <tr>
1789
+ <td>2</td><td>Begins with
1790
+ </td></tr>
1791
+ <tr>
1792
+ <td>3</td><td>Ends with
1793
+ </td></tr>
1794
+ <tr>
1795
+ <td>4</td><td>Greater Than
1796
+ </td></tr>
1797
+ <tr>
1798
+ <td>5</td><td>Greater Than or Equal To
1799
+ </td></tr>
1800
+ <tr>
1801
+ <td>6</td><td>Less Than
1802
+ </td></tr>
1803
+ <tr>
1804
+ <td>7</td><td>Less Than or Equal To
1805
+ </td></tr>
1806
+ <tr>
1807
+ <td>8</td><td>Is in the Range
1808
+ </td></tr>
1809
+ <tr>
1810
+ <td>9</td><td>In the Last
1811
+ </td></tr><tr>
1812
+ <td>10</td><td>Is / Is Not (binary AND, only used for "Video Kind" so far)
1813
+ </td></tr></tbody></table>
1814
+ <p>This is complicated, obviously, and iTunes abstracts this all by defining various actions for various fields. Here's the complete possible list of actions, including those that iTunes does not have but which still work on the iPod:
1815
+ </p>
1816
+ <table border="1" cellpadding="1" cellspacing="2">
1817
+ <caption><b>Smart Playlist Rule Actions</b>
1818
+ </caption>
1819
+ <tbody><tr>
1820
+ <th style="background:#efefef;"> value
1821
+ </th><th style="background:#efefef;"> action
1822
+ </th></tr>
1823
+ <tr>
1824
+ <td>0x00000001</td><td>Is Int (also Is Set in iTunes)
1825
+ </td></tr>
1826
+ <tr>
1827
+ <td>0x00000010</td><td>Is Greater Than (also Is After in iTunes)
1828
+ </td></tr>
1829
+ <tr>
1830
+ <td>0x00000020</td><td>Is Greater Than Or Equal To (not in iTunes)
1831
+ </td></tr>
1832
+ <tr>
1833
+ <td>0x00000040</td><td>Is Less Than (also Is Before in iTunes)
1834
+ </td></tr>
1835
+ <tr>
1836
+ <td>0x00000080</td><td>Is Less Than Or Equal To (not in iTunes)
1837
+ </td></tr>
1838
+ <tr>
1839
+ <td>0x00000100</td><td>Is in the Range
1840
+ </td></tr>
1841
+ <tr>
1842
+ <td>0x00000200</td><td>Is in the Last
1843
+ </td></tr>
1844
+ <tr>
1845
+ <td>0x00000400</td><td>Is / Is Not (Binary AND, used for media type so far)
1846
+ </td></tr>
1847
+ <tr>
1848
+ <td>0x01000001</td><td>Is String
1849
+ </td></tr>
1850
+ <tr>
1851
+ <td>0x01000002</td><td>Contains
1852
+ </td></tr>
1853
+ <tr>
1854
+ <td>0x01000004</td><td>Starts With
1855
+ </td></tr>
1856
+ <tr>
1857
+ <td>0x01000008</td><td>Ends With
1858
+ </td></tr>
1859
+ <tr>
1860
+ <td>0x02000001</td><td>Is Not Int (also Is Not Set in iTunes)
1861
+ </td></tr>
1862
+ <tr>
1863
+ <td>0x02000010</td><td>Is Not Greater Than (not in iTunes)
1864
+ </td></tr>
1865
+ <tr>
1866
+ <td>0x02000020</td><td>Is Not Greater Than Or Equal To (not in iTunes)
1867
+ </td></tr>
1868
+ <tr>
1869
+ <td>0x02000040</td><td>Is Not Less Than (not in iTunes)
1870
+ </td></tr>
1871
+ <tr>
1872
+ <td>0x02000080</td><td>Is Not Less Than Or Equal To (not in iTunes)
1873
+ </td></tr>
1874
+ <tr>
1875
+ <td>0x02000100</td><td>Is Not In the Range (not in iTunes)
1876
+ </td></tr>
1877
+ <tr>
1878
+ <td>0x02000200</td><td>Is Not In The Last
1879
+ </td></tr>
1880
+ <tr>
1881
+ <td>0x03000001</td><td>Is Not
1882
+ </td></tr>
1883
+ <tr>
1884
+ <td>0x03000002</td><td>Does Not Contain
1885
+ </td></tr>
1886
+ <tr>
1887
+ <td>0x03000004</td><td>Does Not Start With (not in iTunes)
1888
+ </td></tr>
1889
+ <tr>
1890
+ <td>0x03000008</td><td>Does Not End With (not in iTunes)
1891
+ </td></tr></tbody></table>
1892
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=27" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Smart_Playlist_Rule_Values"></a><h5>Smart Playlist Rule Values</h5>
1893
+ <p>Values are generally pretty straightforward. For String rules, it's a string. For Integer and Timestamp rules, it's a bit more complicated. Furthermore, the "In the Last" type action requires a Units value as well.
1894
+ </p><p>So there are two major rule formats, the String Rule and the Non-String Rule.
1895
+ </p>
1896
+ <table border="1" cellpadding="3" cellspacing="0">
1897
+ <caption><b>SPLRule String format</b>
1898
+ </caption>
1899
+ <tbody><tr>
1900
+ <th style="background:#efefef;"> offset
1901
+ </th><th style="background:#efefef;"> field
1902
+ </th><th style="background:#efefef;"> size
1903
+ </th><th style="background:#efefef;"> value
1904
+ </th></tr>
1905
+ <tr>
1906
+ <td> 0 </td><td> field </td><td> 4 </td><td> The Field type
1907
+ </td></tr>
1908
+ <tr>
1909
+ <td> 4 </td><td> action </td><td> 4 </td><td> The Action type
1910
+ </td></tr>
1911
+ <tr>
1912
+ <td> 8 </td><td> padding </td><td> 44 </td><td> zero padding
1913
+ </td></tr>
1914
+ <tr>
1915
+ <td> 52 </td><td> length </td><td> 4 </td><td> length of the string, in bytes. Maximum length is 255
1916
+ </td></tr>
1917
+ <tr>
1918
+ <td> 56 </td><td> string </td><td> length </td><td> the string in UTF-16 format (2 bytes per character)
1919
+ </td></tr>
1920
+ <tr>
1921
+ <td colspan="4"> rules are NOT zero padded at the end
1922
+ </td></tr></tbody></table>
1923
+ <table border="1" cellpadding="3" cellspacing="0">
1924
+ <caption><b>SPLRule Non-String format</b>
1925
+ </caption>
1926
+ <tbody><tr>
1927
+ <th style="background:#efefef;"> offset
1928
+ </th><th style="background:#efefef;"> field
1929
+ </th><th style="background:#efefef;"> size
1930
+ </th><th style="background:#efefef;"> value
1931
+ </th></tr>
1932
+ <tr>
1933
+ <td> 0 </td><td> field </td><td> 4 </td><td> The Field type
1934
+ </td></tr>
1935
+ <tr>
1936
+ <td> 4 </td><td> action </td><td> 4 </td><td> The Action type
1937
+ </td></tr>
1938
+ <tr>
1939
+ <td> 8 </td><td> padding </td><td> 44 </td><td> zero padding
1940
+ </td></tr>
1941
+ <tr>
1942
+ <td> 52 </td><td> length </td><td> 4 </td><td> always 0x44 for non-string types
1943
+ </td></tr>
1944
+ <tr>
1945
+ <td> 56 </td><td> from value </td><td> 8 </td><td> the from value in an 8 byte form (unsigned int64)
1946
+ </td></tr>
1947
+ <tr>
1948
+ <td> 64 </td><td> from date </td><td> 8 </td><td> the from date in an 8 byte form (signed int64)
1949
+ </td></tr>
1950
+ <tr>
1951
+ <td> 72 </td><td> from units </td><td> 8 </td><td> the from units in an 8 byte form (unsigned int64)
1952
+ </td></tr>
1953
+ <tr>
1954
+ <td> 80 </td><td> to value </td><td> 8 </td><td> the to value in an 8 byte form (unsigned int64)
1955
+ </td></tr>
1956
+ <tr>
1957
+ <td> 88 </td><td> to date </td><td> 8 </td><td> the to date in an 8 byte form (signed int64)
1958
+ </td></tr>
1959
+ <tr>
1960
+ <td> 96 </td><td> to units </td><td> 8 </td><td> the to units in an 8 byte form (unsigned int64)
1961
+ </td></tr>
1962
+ <tr>
1963
+ <td> 104 </td><td> unknown </td><td> 20 </td><td> unknown, used by all field types, unknown purpose
1964
+ </td></tr>
1965
+ <tr>
1966
+ <td colspan="4"> rules are NOT zero padded at the end
1967
+ </td></tr></tbody></table>
1968
+ <p>For integer type rules, the from and to values are the ones that you care about, the date = 0, and the units = 1.
1969
+ </p>
1970
+ <pre>Example: BPM is less than 150
1971
+ field = 0x23 (BPM)
1972
+ action = 0x00000040 (is less than)
1973
+ from and to value = 150
1974
+ from and to date = 0
1975
+ from and to units = 1
1976
+ </pre>
1977
+ <pre>Example: BPM is in the range 70 to 150
1978
+ field = 0x23 (BPM)
1979
+ action = 0x00000100 (is in the range)
1980
+ from value = 70
1981
+ to value = 150
1982
+ from and to date = 0
1983
+ from and to units = 1
1984
+ </pre>
1985
+ <p>For binary and type rules, the from and to values are the ones that you care about, the date = 0, and the units = 1.
1986
+ </p>
1987
+ <pre>Example: Video Kind is TV-Show
1988
+ field = 0x3c (Video Kind)
1989
+ action = 0x00000400 (Is / Is Not)
1990
+ from and to value = 0x0040
1991
+ from and to date = 0
1992
+ from and to units = 1
1993
+ </pre>
1994
+ <pre>Example: Video Kind is not TV-Show
1995
+ field = 0x3c (Video Kind / mediatype)
1996
+ action = 0x00000400 (Is / Is Not)
1997
+ from and to value = 0x0e22
1998
+ from and to date = 0
1999
+ from and to units = 1
2000
+ </pre>
2001
+ <p>For the latter one would expect a value of 0x0022 (either Movie or Music Video). The additional 0x0e00 in the mask hints for further video types to come.
2002
+ </p><p>Timestamp type rules use the same format as integer type rules, only the from and to values are Mac timestamps. This is the number of seconds since 1/1/1904.
2003
+ </p>
2004
+ <pre>Example: Date Added is in the range 6/19/2004 to 6/20/2004
2005
+ field = 0x10 (Date Added)
2006
+ action = 0x00000100 (is in the range)
2007
+ from value = bcfa83ff (6/19/2004)
2008
+ to value = 0xbcfbd57f (6/20/2004)
2009
+ from and to date = 0
2010
+ from and to units = 1
2011
+ </pre>
2012
+ <p>For "in the last" type rules, the from and to values are set to a constant of 0x2dae2dae2dae2dae. The from dates become the value, and the from units becomes the unit you're measuring in. The way to think of this is that it's saying "Today (2dae) plus this number of units".
2013
+ </p>
2014
+ <pre>Example: Last Played Time is in the last 2 weeks.
2015
+ field = 0x17 (Last Played Time)
2016
+ action = 0x00000200 (is in the last)
2017
+ from value = 0x2dae2dae2dae2dae
2018
+ from date = -2
2019
+ from units = 604800 (number of seconds in a week)
2020
+ to value = 0x2dae2dae2dae2dae
2021
+ to date = 0
2022
+ to units = 1
2023
+ </pre>
2024
+ <p>That rule is saying "Today minus 2 times this number of seconds" which is 2 weeks before "now", whatever now happens to be.
2025
+ </p><p>If you're creating your own rules in an iTunesDB, you may find it more convienent to leave the units set to "1" all the time and just put the number of seconds into the date field. This is perfectly acceptable and the iPod can handle it just fine. If you're not sure how to make a particular rule, create it or a similar one in iTunes and put it on the iPod, then examine the iTunesDB file to see how it did it.
2026
+ </p><p><br>
2027
+ But if you're programming the iPod side of things, you need to be able to correctly understand the units field and deal with it accordingly. The best way to do this is to always compare the contents of the field in question with (value+date*unit), and replacing the "value" with the current timestamp ("now") when it is equal to 3,291,618,603,768,360,366 (0x2dae2dae2dae2dae). This will work for *all* integer and timestamp comparisons if done correctly. It's also exactly what the Apple iPod firmware does. It's also why you have to set the time/date on an iPod for these smart playlists to work correctly (3rd gen and up).
2028
+ </p><p>Also, remember that all timestamps should be dealt with in Apple format, which is the number of seconds since 1/1/1904.
2029
+ </p>
2030
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=28" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Putting_It_All_Together"></a><h5>Putting It All Together</h5>
2031
+ <p>So, now you know how to create a given rule. All that's left is to put all the rules together and shove them into a type 51 MHOD.
2032
+ </p>
2033
+ <table border="1" cellpadding="5" cellspacing="0">
2034
+ <caption><b>mhod format - Smart Playlist Rules (type 51)</b>
2035
+ </caption>
2036
+ <tbody><tr>
2037
+ <th style="background:#efefef;"> offset
2038
+ </th><th style="background:#efefef;"> field
2039
+ </th><th style="background:#efefef;"> size
2040
+ </th><th style="background:#efefef;"> value
2041
+ </th></tr>
2042
+ <tr>
2043
+ <td> 0 </td><td> header identifier </td><td> 4 </td><td> mhod
2044
+ </td></tr>
2045
+ <tr>
2046
+ <td> 4 </td><td> header length </td><td> 4 </td><td> size of the mhod header.
2047
+ </td></tr>
2048
+ <tr>
2049
+ <td> 8 </td><td> total length </td><td> 4 </td><td> size of the header and the rules it contains
2050
+ </td></tr>
2051
+ <tr>
2052
+ <td> 12 </td><td> type </td><td> 4 </td><td> the type indicator ( 51 )
2053
+ </td></tr>
2054
+ <tr>
2055
+ <td> 16 </td><td> unk1 </td><td> 4 </td><td> unknown
2056
+ </td></tr>
2057
+ <tr>
2058
+ <td> 20 </td><td> unk2 </td><td> 4 </td><td> unknown
2059
+ </td></tr>
2060
+ <tr>
2061
+ <td> 24 </td><td> smart list rules identifier </td><td> 4 </td><td> "SLst" (note that this is the point at which bytes are no longer little-endian in the mhod.. it switches to big-endian at this point)
2062
+ </td></tr>
2063
+ <tr>
2064
+ <td> 28 </td><td> unk5 </td><td> 4 </td><td> unknown
2065
+ </td></tr>
2066
+ <tr>
2067
+ <td> 32 </td><td> number of rules </td><td> 4 </td><td> number of rules
2068
+ </td></tr>
2069
+ <tr>
2070
+ <td> 36 </td><td> rules operator </td><td> 4 </td><td> 0 = AND (as in "Match All"), 1 = OR (as in "Match Any")
2071
+ </td></tr>
2072
+ <tr>
2073
+ <td> 40 </td><td> padding </td><td> 120 </td><td> zero padding
2074
+ </td></tr>
2075
+ <tr>
2076
+ <td> 160 </td><td> rules </td><td> whatever size the rules are </td><td> the rules themselves, one after another.
2077
+ </td></tr>
2078
+ <tr>
2079
+ <td colspan="4"> the mhod is NOT is zero padded at the end
2080
+ </td></tr></tbody></table>
2081
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=29" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Library_Playlist_Index_.28type_52.29"></a><h4>Library Playlist Index (type 52)</h4>
2082
+ <p>The type 52 MHOD is only found as a child of the Main Library Playlist. It is an index of the mhit's ordered by the major categories in the Browse menu. The purpose of these mhod's is to speed up the operation of the Browse menu itself. This is how it displays the information so quickly when selecting one of the major categories, it's all presorted for the iPod in these MHOD's.
2083
+ </p><p>Note that this MHOD is not mandatory, however the iPod menu system will operate much slower without it (on large libraries), as it will have to build the information provided here on the fly. Therefore it is recommended to build this MHOD for anything more than trivial numbers of songs.
2084
+ </p><p>Essentially, every MHIT is numbered from 0 to the total number of songs-1. The type 52 MHOD contains a list of these index numbers using one of the strings contained in these MHIT's, ordered alphabetically.
2085
+ </p><p>To build one of these, take all your songs, order them alphabetically by one of these fields, then simply insert the index numbers of the ordered songs into the type 52 mhod.
2086
+ </p>
2087
+ <table border="1" cellpadding="5" cellspacing="0">
2088
+ <caption><b>Library Playlist Index types</b>
2089
+ </caption>
2090
+ <tbody><tr>
2091
+ <th style="background:#efefef;"> type number
2092
+ </th><th style="background:#efefef;"> field that it indexes
2093
+ </th></tr>
2094
+ <tr>
2095
+ <td>0x03 </td><td> Title
2096
+ </td></tr>
2097
+ <tr>
2098
+ <td>0x04 </td><td> Album, then Disc/Tracknumber, then Title
2099
+ </td></tr>
2100
+ <tr>
2101
+ <td>0x05 </td><td> Artist, then Album, then Disc/Tracknumber, then Title
2102
+ </td></tr>
2103
+ <tr>
2104
+ <td>0x07 </td><td> Genre, then Artist, then Album, then Disc/Tracknumber, then Title
2105
+ </td></tr>
2106
+ <tr>
2107
+ <td>0x12 </td><td> Composer, then Title
2108
+ </td></tr>
2109
+ <tr>
2110
+ <td>0x1d </td><td> Observed with iTunes 7.2, probably sorted by 'Show' first. Someone with TV shows on his iPod please fill in the secondary sort orders.
2111
+ </td></tr>
2112
+ <tr>
2113
+ <td>0x1e </td><td> Observed with iTunes 7.2, probably sorted by 'Season Number' first. Someone with TV shows on his iPod please fill in the secondary sort orders.
2114
+ </td></tr>
2115
+ <tr>
2116
+ <td>0x1f </td><td> Observed with iTunes 7.2, probably sorted by 'Episode Number' first. Someone with TV shows on his iPod please fill in the secondary sort orders.
2117
+ </td></tr>
2118
+ <tr>
2119
+ <td>0x23 </td><td> Observed with iTunes 7.3 (but may possibly exist in earlier versions, too), Album Artist, then Artist Field (disregarding artist for sort in MHOD23), then Album, Disc/Tracknumber and Title.
2120
+ </td></tr>
2121
+ <tr>
2122
+ <td>0x24 </td><td> Observed with iTunes 7.3 (but may possibly exist in earlier versions, too), Artist Field (disregarding artist for sort in MHOD23), then Album, then Disc/Tracknumber, then Title
2123
+ </td></tr>
2124
+ </tbody></table>
2125
+ <p>(Note that the above list roughly matches the limit sort list.. I think that these lists are actually the same in some way.)
2126
+ </p>
2127
+ <table border="1" cellpadding="5" cellspacing="0">
2128
+ <caption><b>mhod format - Library Playlist Index (type 52)</b>
2129
+ </caption>
2130
+ <tbody><tr>
2131
+ <th style="background:#efefef;"> offset
2132
+ </th><th style="background:#efefef;"> field
2133
+ </th><th style="background:#efefef;"> size
2134
+ </th><th style="background:#efefef;"> value
2135
+ </th></tr>
2136
+ <tr>
2137
+ <td> 0 </td><td> header identifier </td><td> 4 </td><td> mhod
2138
+ </td></tr>
2139
+ <tr>
2140
+ <td> 4 </td><td> header length </td><td> 4 </td><td> size of the mhod header.
2141
+ </td></tr>
2142
+ <tr>
2143
+ <td> 8 </td><td> total length </td><td> 4 </td><td> size of the header and all the index entries
2144
+ </td></tr>
2145
+ <tr>
2146
+ <td> 12 </td><td> type </td><td> 4 </td><td> the type indicator ( 52 )
2147
+ </td></tr>
2148
+ <tr>
2149
+ <td> 16 </td><td> unk1 </td><td> 4 </td><td> unknown (always zero)
2150
+ </td></tr>
2151
+ <tr>
2152
+ <td> 20 </td><td> unk2 </td><td> 4 </td><td> unknown (always zero)
2153
+ </td></tr>
2154
+ <tr>
2155
+ <td> 24 </td><td> index type </td><td> 4 </td><td> what this index is sorted on (see list above)
2156
+ </td></tr>
2157
+ <tr>
2158
+ <td> 28 </td><td> count </td><td> 4 </td><td> number of entries. Always the same as the number of entries in the playlist, which is the same as the number of songs on the iPod.
2159
+ </td></tr>
2160
+ <tr>
2161
+ <td> 32 </td><td> null padding </td><td> 40 </td><td> lots of padding
2162
+ </td></tr>
2163
+ <tr>
2164
+ <td> 72 </td><td> index entries </td><td> 4 * count </td><td> The index entries themselves. This is an index into the mhit list, in order, starting from 0 for the first mhit.
2165
+ </td></tr>
2166
+ <tr>
2167
+ <td colspan="4"> the mhod is NOT zero padded at the end
2168
+ </td></tr></tbody></table>
2169
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=30" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Type_53"></a><h4>Type 53</h4>
2170
+ <p>The type 53 MHOD is only found as a child of the Main Library Playlist.
2171
+ </p>
2172
+ <table border="1" cellpadding="5" cellspacing="0">
2173
+ <caption><b>mhod format - Letter jump table for fast scrolling (type 53)</b>
2174
+ </caption>
2175
+ <tbody><tr>
2176
+ <th style="background:#efefef;"> offset
2177
+ </th><th style="background:#efefef;"> field
2178
+ </th><th style="background:#efefef;"> size
2179
+ </th><th style="background:#efefef;"> value
2180
+ </th></tr>
2181
+ <tr>
2182
+ <td> 0 </td><td> header identifier </td><td> 4 </td><td> mhod
2183
+ </td></tr>
2184
+ <tr>
2185
+ <td> 4 </td><td> header length </td><td> 4 </td><td> size of the mhod header.
2186
+ </td></tr>
2187
+ <tr>
2188
+ <td> 8 </td><td> total length </td><td> 4 </td><td> size of the header and all the index entries
2189
+ </td></tr>
2190
+ <tr>
2191
+ <td> 12 </td><td> type </td><td> 4 </td><td> the type indicator ( 53 )
2192
+ </td></tr>
2193
+ <tr>
2194
+ <td> 16 </td><td> unk1 </td><td> 4 </td><td> unknown (always zero)
2195
+ </td></tr>
2196
+ <tr>
2197
+ <td> 20 </td><td> unk2 </td><td> 4 </td><td> unknown (always zero)
2198
+ </td></tr>
2199
+ <tr>
2200
+ <td> 24 </td><td> index type </td><td> 4 </td><td> what this index is sorted on (see list above)
2201
+ </td></tr>
2202
+ <tr>
2203
+ <td> 28 </td><td> count </td><td> 4 </td><td> number of entries. Unused letters are left out and umlauts (at least German ones) are added after the letter they are derived from. Don't yet know about the order of the French accented letters.
2204
+ </td></tr>
2205
+ <tr>
2206
+ <td> 32 </td><td> null padding </td><td> 8 </td><td> lots of padding
2207
+ </td></tr>
2208
+ <tr>
2209
+ <td> 40 </td><td> index entries </td><td> 12 * count </td><td> The index entries themselves.
2210
+ </td></tr>
2211
+ <tr>
2212
+ <td colspan="4"> the mhod is NOT zero padded at the end
2213
+ </td></tr></tbody></table>
2214
+ <p><br>
2215
+ </p>
2216
+ <table border="1" cellpadding="5" cellspacing="0">
2217
+ <caption><b>Letter jump table entry</b>
2218
+ </caption>
2219
+ <tbody><tr>
2220
+ <th style="background:#efefef;"> offset
2221
+ </th><th style="background:#efefef;"> field
2222
+ </th><th style="background:#efefef;"> size
2223
+ </th><th style="background:#efefef;"> value
2224
+ </th></tr>
2225
+ <tr>
2226
+ <td> 0 </td><td> letter </td><td> 4 </td><td> The letter of this table entry. Looks like uppercase UTF-16LE with 2 padding null bytes (i.e. A would be 0x00000041 little endian / 0x41000000 big endian)
2227
+ </td></tr>
2228
+ <tr>
2229
+ <td> 4 </td><td> header length </td><td> 4 </td><td> the number of the first entry in the corresponding MHOD52 index starting with this letter. Zero-based and incremented by one for each entry, not 4.
2230
+ </td></tr>
2231
+ <tr>
2232
+ <td> 8 </td><td> total length </td><td> 4 </td><td> the count of entries starting with this letter in the corresponding MHOD52.
2233
+ </td></tr></tbody></table>
2234
+ <p><br>
2235
+ I don't know how these are associated with the corresponding MHOD52s, I would guess by the sort order field, but I'm not sure because they always turn up immediately after their MHOD52. Could someone please have a look at this and the other yet unknown things above?
2236
+ </p>
2237
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=31" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Type_100"></a><h4>Type 100</h4>
2238
+ <p>There are a couple forms of Type 100 MHOD's (that we know of).
2239
+ </p><p>The first form is at the beginning of every playlist (before any MHIP entries). Only iTunes puts it there, and only iTunes uses it. It contains information on what columns to display, and what size to display them as, when displaying the playlist in iTunes when the iPod is in a manual mode. This is absolutely optional. The iPod itself doesn't appear to use it in any way.
2240
+ </p><p>The second form is after every MHIP in a playlist, there's a small type 100 MHOD. It gives an order number to the song immediately before it. It is not optional, but it's also not particularly useful.
2241
+ </p>
2242
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=32" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Playlist_Column_Definitions_Header"></a><h5>Playlist Column Definitions Header</h5>
2243
+ <table border="1" cellpadding="5" cellspacing="0">
2244
+ <caption><b>mhod format - Playlist Column Definition (type 100)</b>
2245
+ </caption>
2246
+ <tbody><tr>
2247
+ <th style="background:#efefef;"> offset
2248
+ </th><th style="background:#efefef;"> field
2249
+ </th><th style="background:#efefef;"> size
2250
+ </th><th style="background:#efefef;"> value
2251
+ </th></tr>
2252
+ <tr>
2253
+ <td> 0 </td><td> header identifier </td><td> 4 </td><td> mhod
2254
+ </td></tr>
2255
+ <tr>
2256
+ <td> 4 </td><td> header length </td><td> 4 </td><td> size of the mhod header. This is always 0x18 for this type of MHOD.
2257
+ </td></tr>
2258
+ <tr>
2259
+ <td> 8 </td><td> total length </td><td> 4 </td><td> size of the header and it's data. This is always 0x288 for this type of MHOD.
2260
+ </td></tr>
2261
+ <tr>
2262
+ <td> 12 </td><td> type </td><td> 4 </td><td> the type indicator ( 100 )
2263
+ </td></tr>
2264
+ <tr>
2265
+ <td> 16 </td><td> unk1 </td><td> 4 </td><td> unknown, always 0
2266
+ </td></tr>
2267
+ <tr>
2268
+ <td> 20 </td><td> unk2 </td><td> 4 </td><td> unknown, always 0
2269
+ </td></tr>
2270
+ <tr>
2271
+ <td> 24 </td><td> unk3 </td><td> 4 </td><td> unknown, always 0
2272
+ </td></tr>
2273
+ <tr>
2274
+ <td> 28 </td><td> unk4 </td><td> 8 </td><td> unknown, appears to be 0x0088004A02EF0281 for everything except normal playlists. Some kind of identifier?
2275
+ </td></tr>
2276
+ <tr>
2277
+ <td> 36 </td><td> unk8 </td><td> 4 </td><td> unknown, always 0
2278
+ </td></tr>
2279
+ <tr>
2280
+ <td> 40 </td><td> unk9 </td><td> 2 </td><td> unknown, appears to be 130 for normal playlists and 200 for everything else
2281
+ </td></tr>
2282
+ <tr>
2283
+ <td> 42 </td><td> unk10 </td><td> 2 </td><td> unknown, appears to be 3 for the iPod library and 1 for everything else
2284
+ </td></tr>
2285
+ <tr>
2286
+ <td> 44 </td><td> sort type </td><td> 4 </td><td> the sort type for this playlist. Use this value to figure out which column is selected by mapping it to the correct column ID (listed below).
2287
+ </td></tr>
2288
+
2289
+ <tr>
2290
+ <td> 48 </td><td> number of columns </td><td> 4 </td><td> the number of columns visible in iTunes for this playlist. In iTunes 6, this value can be anywhere from 2 to 28.
2291
+ </td></tr>
2292
+
2293
+ <tr>
2294
+ <td> 52 </td><td> unknown1 </td><td> 2 </td><td> unknown (always 1?) (Selected column?)
2295
+ </td></tr>
2296
+ <tr>
2297
+ <td> 54 </td><td> unknown2 </td><td> 2 </td><td> unknown (always 0?) (Column sort direction? asc/desc)
2298
+ </td></tr>
2299
+
2300
+ <tr>
2301
+ <td> 56 </td><td> column definitions </td><td> 16 * number of columns </td><td> the column definitions
2302
+ </td></tr>
2303
+
2304
+ <tr>
2305
+ <td colspan="4"> after the column definitions, the rest of the MHOD is zero-padded
2306
+ </td></tr>
2307
+ </tbody></table>
2308
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=33" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Column_Definition"></a><h5>Column Definition</h5>
2309
+ <p>Each column definition only consists of an ID for the playlist and the sort direction for the column. The order they appear in this MHOD are the order they appear in iTunes, from left to right. The first two columns are always song position and title, in that order.
2310
+ </p>
2311
+ <table border="1" cellpadding="5" cellspacing="0">
2312
+ <caption><b>Single Column Definition</b>
2313
+ </caption>
2314
+ <tbody><tr>
2315
+ <th style="background:#efefef;"> offset
2316
+ </th><th style="background:#efefef;"> field
2317
+ </th><th style="background:#efefef;"> size
2318
+ </th><th style="background:#efefef;"> value
2319
+ </th></tr>
2320
+ <tr>
2321
+ <td> 0 </td><td> ID </td><td> 2 </td><td> the ID for this column, see below for possible values
2322
+ </td></tr>
2323
+ <tr>
2324
+ <td> 2 </td><td> width </td><td> 2 </td><td> the width of the column, in pixels
2325
+ </td></tr>
2326
+ <tr>
2327
+ <td> 4 </td><td> sort direction </td><td> 4 </td><td> if equal to 0x1, the sort is reversed for this column. Set to 0x0 otherwise.
2328
+ </td></tr>
2329
+
2330
+ <tr>
2331
+ <td> 8 </td><td> unknown </td><td> 4 </td><td> seems to be null padding
2332
+ </td></tr>
2333
+
2334
+ <tr>
2335
+ <td> 12 </td><td> unknown </td><td> 4 </td><td> seems to be null padding
2336
+ </td></tr>
2337
+
2338
+ </tbody></table>
2339
+ <table border="1" cellpadding="5" cellspacing="0">
2340
+ <caption><b>Column IDs</b>
2341
+ </caption>
2342
+ <tbody><tr>
2343
+ <th style="background:#efefef;"> ID
2344
+ </th><th style="background:#efefef;"> description
2345
+ </th></tr>
2346
+ <tr>
2347
+ <td> 0x01 </td><td> position; leftmost column in all playlists
2348
+ </td></tr>
2349
+ <tr>
2350
+ <td> 0x02 </td><td> Name
2351
+ </td></tr>
2352
+ <tr>
2353
+ <td> 0x03 </td><td> Album
2354
+ </td></tr>
2355
+ <tr>
2356
+ <td> 0x04 </td><td> Artist
2357
+ </td></tr>
2358
+ <tr>
2359
+ <td> 0x05 </td><td> Bit Rate
2360
+ </td></tr>
2361
+ <tr>
2362
+ <td> 0x06 </td><td> Sample Rate
2363
+ </td></tr>
2364
+ <tr>
2365
+ <td> 0x07 </td><td> Year
2366
+ </td></tr>
2367
+ <tr>
2368
+ <td> 0x08 </td><td> Genre
2369
+ </td></tr>
2370
+ <tr>
2371
+ <td> 0x09 </td><td> Kind
2372
+ </td></tr>
2373
+ <tr>
2374
+ <td> 0x0A </td><td> Date Modified
2375
+ </td></tr>
2376
+ <tr>
2377
+ <td> 0x0B </td><td> Track Number
2378
+ </td></tr>
2379
+ <tr>
2380
+ <td> 0x0C </td><td> Size
2381
+ </td></tr>
2382
+ <tr>
2383
+ <td> 0x0D </td><td> Time
2384
+ </td></tr>
2385
+ <tr>
2386
+ <td> 0x0E </td><td> Comment
2387
+ </td></tr>
2388
+ <tr>
2389
+ <td> 0x10 </td><td> Date Added
2390
+ </td></tr>
2391
+ <tr>
2392
+ <td> 0x11 </td><td> Equalizer
2393
+ </td></tr>
2394
+ <tr>
2395
+ <td> 0x12 </td><td> Composer
2396
+ </td></tr>
2397
+ <tr>
2398
+ <td> 0x14 </td><td> Play Count
2399
+ </td></tr>
2400
+ <tr>
2401
+ <td> 0x15 </td><td> Last Played
2402
+ </td></tr>
2403
+ <tr>
2404
+ <td> 0x16 </td><td> Disc Number
2405
+ </td></tr>
2406
+ <tr>
2407
+ <td> 0x17 </td><td> My Rating
2408
+ </td></tr>
2409
+ <tr>
2410
+ <td> 0x19 </td><td> Date Released (Podcasts group only)
2411
+ </td></tr>
2412
+ <tr>
2413
+ <td> 0x1A </td><td> BPM
2414
+ </td></tr>
2415
+ <tr>
2416
+ <td> 0x1C </td><td> Grouping
2417
+ </td></tr>
2418
+ <tr>
2419
+ <td> 0x1E </td><td> Category
2420
+ </td></tr>
2421
+ <tr>
2422
+ <td> 0x1F </td><td> Description
2423
+ </td></tr>
2424
+ <tr>
2425
+ <td> 0x21 </td><td> Show
2426
+ </td></tr>
2427
+ <tr>
2428
+ <td> 0x22 </td><td> Season
2429
+ </td></tr>
2430
+ <tr>
2431
+ <td> 0x23 </td><td> Episode Number
2432
+ </td></tr>
2433
+
2434
+ </tbody></table>
2435
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=34" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Playlist_Order_Entry"></a><h5>Playlist Order Entry</h5>
2436
+ <table border="1" cellpadding="5" cellspacing="0">
2437
+ <caption><b>mhod format - Playlist Order Entry (type 100)</b>
2438
+ </caption>
2439
+ <tbody><tr>
2440
+ <th style="background:#efefef;"> offset
2441
+ </th><th style="background:#efefef;"> field
2442
+ </th><th style="background:#efefef;"> size
2443
+ </th><th style="background:#efefef;"> value
2444
+ </th></tr>
2445
+ <tr>
2446
+ <td> 0 </td><td> header identifier </td><td> 4 </td><td> mhod
2447
+ </td></tr>
2448
+ <tr>
2449
+ <td> 4 </td><td> header length </td><td> 4 </td><td> size of the mhod header. This is always 0x18 for this type of MHOD.
2450
+ </td></tr>
2451
+ <tr>
2452
+ <td> 8 </td><td> total length </td><td> 4 </td><td> size of the header and it's data. This is always 0x2C for this type of MHOD.
2453
+ </td></tr>
2454
+ <tr>
2455
+ <td> 12 </td><td> type </td><td> 4 </td><td> the type indicator ( 100 )
2456
+ </td></tr>
2457
+ <tr>
2458
+ <td> 16 </td><td> unk1 </td><td> 4 </td><td> unknown, always 0
2459
+ </td></tr>
2460
+ <tr>
2461
+ <td> 20 </td><td> unk2 </td><td> 4 </td><td> unknown, always 0
2462
+ </td></tr>
2463
+ <tr>
2464
+ <td> 24 </td><td> position </td><td> 4 </td><td> Position of the song in the playlist. These numbers do not have to be sequentially ordered, numbers can be skipped.
2465
+ </td></tr>
2466
+ <tr>
2467
+ <td> 28 </td><td> unknown </td><td> 16 </td><td> zero padding
2468
+ </td></tr></tbody></table>
2469
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=35" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Album_List"></a><h3>Album List</h3>
2470
+ <p>Album List, first seen with iTunes 7.1. It was seen on iPod nano 2nd gen and Shuffle 2nd gen restored with iTunes 7.1.1, but not on iPod Video 30GB(restored with the same version of iTunes).
2471
+ </p>
2472
+ <table border="1" cellpadding="5" cellspacing="0">
2473
+ <caption><b>mhla format</b>
2474
+ </caption>
2475
+ <tbody><tr>
2476
+ <th style="background:#efefef;"> offset
2477
+ </th><th style="background:#efefef;"> field
2478
+ </th><th style="background:#efefef;"> size
2479
+ </th><th style="background:#efefef;"> value
2480
+ </th></tr>
2481
+ <tr>
2482
+ <td> 0 </td><td> header identifier </td><td> 4 </td><td> mhla
2483
+ </td></tr>
2484
+ <tr>
2485
+ <td> 4 </td><td> header length </td><td> 4 </td><td> size of the mhla header
2486
+ </td></tr>
2487
+ <tr>
2488
+ <td> 8 </td><td> number of album items</td><td> 4 </td><td> the total number of songs in the Album List
2489
+ </td></tr>
2490
+ <tr>
2491
+ <td colspan="4"> rest of header is zero padded
2492
+ </td></tr></tbody></table>
2493
+ <p>The Album List has Album Items as its children. The number of Album Items is the same all albums on iPod.
2494
+ </p>
2495
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/iTunesDB_File&action=edit&section=36" title="ITunesDB/iTunesDB File">edit</a>]</div><a name="Album_Item"></a><h3>Album Item</h3>
2496
+ <table border="1" cellpadding="5" cellspacing="0">
2497
+ <caption><b>mhia format</b>
2498
+ </caption>
2499
+ <tbody><tr>
2500
+ <th style="background:#efefef;"> offset
2501
+ </th><th style="background:#efefef;"> field
2502
+ </th><th style="background:#efefef;"> size
2503
+ </th><th style="background:#efefef;"> value
2504
+ </th></tr>
2505
+ <tr>
2506
+ <td> 0 </td><td> header identifier </td><td> 4 </td><td> mhia
2507
+ </td></tr>
2508
+ <tr>
2509
+ <td> 4 </td><td> header length </td><td> 4 </td><td> size of the mhia header. Length is 0x58
2510
+ </td></tr>
2511
+ <tr>
2512
+ <td> 8 </td><td> total length </td><td> 4 </td><td> size of the header and all child records
2513
+ </td></tr>
2514
+ <tr>
2515
+ <td> 12 </td><td> number of strings </td><td> 4 </td><td> number of strings (mhods) that are children of this mhia
2516
+ </td></tr>
2517
+ <tr>
2518
+ <td> 16 </td><td> unknown </td><td> 2 </td><td> (previously long length 4 with possibly album ID)
2519
+ </td></tr>
2520
+ <tr>
2521
+ <td> 18 </td><td> album id for track </td><td> 2 </td><td> album ID (v. 0x18 file) (previously long length 4)
2522
+ </td></tr>
2523
+ <tr>
2524
+ <td> 20 </td><td> unknown </td><td> 8 </td><td> timestamp? (v. 0x18 file)
2525
+ </td></tr>
2526
+ <tr>
2527
+ <td> 28 </td><td> unknown </td><td> 4 </td><td> always 2? (v. 0x18 file)
2528
+ </td></tr></tbody></table>
2529
+ <p>Usually mhia has two child strings: album title and artist name.
2530
+ </p><p><br>
2531
+ </p>
2532
+ <div align="right"><small>→ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB/Play_Counts_File" title="ITunesDB/Play Counts File">Subpage: Play Counts File</a></small></div>
2533
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Play_Counts_File&action=edit&section=1" title="ITunesDB/Play Counts File">edit</a>]</div><a name="Play_Counts_file"></a><h2>Play Counts file</h2>
2534
+ <p>The play count information, since the last sync with iTunes, is stored in the "Play Counts" file.
2535
+ </p><p>The play counts file is deleted by the iPod and rebuilt whenever it detects that the iTunesDB file has changed (immediately after a sync). So writing anything into this file yourself is more than a little pointless, as the iPod simply will overwrite it. This is the iPod's way of sending information back to iTunes (or whatever program you happen to sync with).
2536
+ </p><p>When iTunes syncs, the first thing it does is read the values that the iPod has put into this file, and merges them back into the iTunes Library. iTunes will update the iTunesDB play count fields with the new total play counts and clear the play count 2 field if the iPod is linked to the iTunes library.
2537
+ </p><p>If the iPod is configured to sync but is mounted in an iTunes library to which it is not linked, iTunes will read the playcounts file and update the iPod iTunesDB play count fields with the total play counts. In addition, iTunes will update the play count 2 fields with the recent play counts. The play count 2 field is used to sync back to the iTunes library that the iPod is linked to. Thus, even after mounting in a non-linked iTunes library and deleting the playcounts file, the play count will still be correctly updated in the linked iTunes library by using the values in the play count 2 fields.
2538
+ </p>
2539
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Play_Counts_File&action=edit&section=2" title="ITunesDB/Play Counts File">edit</a>]</div><a name="Play_Count_Header"></a><h3>Play Count Header</h3>
2540
+ <p>The play count header indicates a valid play count file and specifies how many entries follow and the size of each entry record. The is an entry record for each song on the iPod; the entry position corresponding to the position of the song in the iTunesDB.
2541
+ </p>
2542
+ <table border="1" cellpadding="5" cellspacing="0">
2543
+ <caption><b>Play Count Header</b>
2544
+ </caption>
2545
+ <tbody><tr>
2546
+ <th style="background:#efefef;"> offset
2547
+ </th><th style="background:#efefef;"> field
2548
+ </th><th style="background:#efefef;"> size
2549
+ </th><th style="background:#efefef;"> value
2550
+ </th></tr>
2551
+ <tr>
2552
+ <td> 0 </td><td> header identifier </td><td> 4 </td><td> mhdp
2553
+ </td></tr>
2554
+ <tr>
2555
+ <td> 4 </td><td> header length </td><td> 4 </td><td> 0x60
2556
+ </td></tr>
2557
+ <tr>
2558
+ <td> 8 </td><td> single entry length </td><td> 4 </td><td> 0x0c (firmware 1.3), 0x10 (firmware 2.0), 0x14 (with version 0x0d of iTunesDB), 0x1C (with version 0x13 of iTunesDB)
2559
+ </td></tr>
2560
+ <tr>
2561
+ <td> 12 </td><td> number of entries </td><td> 4 </td><td> number of songs on iPod
2562
+ </td></tr>
2563
+ <tr>
2564
+ <td colspan="4"> rest of header is zero padded
2565
+ </td></tr></tbody></table>
2566
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Play_Counts_File&action=edit&section=3" title="ITunesDB/Play Counts File">edit</a>]</div><a name="Play_Count_Entry"></a><h3>Play Count Entry</h3>
2567
+ <p>The entry record contains the play count data for each song, one record exists for each song on the iPod.
2568
+ </p>
2569
+ <table border="1" cellpadding="5" cellspacing="0">
2570
+ <caption><b>Play Count Entry</b>
2571
+ </caption>
2572
+ <tbody><tr>
2573
+ <th style="background:#efefef;"> offset
2574
+ </th><th style="background:#efefef;"> field
2575
+ </th><th style="background:#efefef;"> size
2576
+ </th><th style="background:#efefef;"> value
2577
+ </th></tr>
2578
+ <tr>
2579
+ <td> 0 </td><td> play count </td><td> 4 </td><td> number of played times since last sync
2580
+ </td></tr>
2581
+ <tr>
2582
+ <td> 4 </td><td> last played </td><td> 4 </td><td> last played time. Set to zero in older firmwares, or to the value from iTunesDB in newer ones (anything with the "Music" menu).
2583
+ </td></tr>
2584
+ <tr>
2585
+ <td> 8 </td><td> audio bookmark </td><td> 4 </td><td> position in file that the song was last paused/stopped at, in milliseconds. This works for audiobooks, podcasts, and seemingly anything else with the right bit set in the MHIT (unk19).
2586
+ </td></tr>
2587
+ <tr>
2588
+ <td> 12 </td><td> rating </td><td>4 </td><td> Rating given to song. Number of stars (1-5) * 0x14. Set to zero in older firmwares, or to the value from iTunesDB in newer ones (anything with the "Music" menu).
2589
+ </td></tr>
2590
+ <tr>
2591
+ <td> 16 </td><td> unknown </td><td> 4 </td><td> Unknown, yet. Probably something to do with podcast bookmarking or some such.
2592
+ </td></tr>
2593
+ <tr>
2594
+ <td> 20 </td><td> skip count </td><td> 4 </td><td> Number of times skipped since last sync. This field appears with firmware that supports the 0x13 version iTunesDB.
2595
+ </td></tr>
2596
+ <tr>
2597
+ <td> 24 </td><td> last skipped </td><td> 4 </td><td> Last skipped date/time. Set to zero if never skipped. This field appears with firmware that supports the 0x13 version iTunesDB.
2598
+ </td></tr>
2599
+ </tbody></table>
2600
+ <p>Older firmware versions had set the last played time and the rating to "zero" in this database, unless you changed either one on the iPod itself. Thus you could ignore zero entries.
2601
+ </p><p>Newer firmwares, however, set last played time and rating to be the same as what is in the iTunesDB file, by default. Meaning that you can't ignore zero entries for rating anymore (somebody could set the rating to a zero rating on the iPod). So you must compare the rating in Play Counts and the rating in iTunesDB to determine if it has actually changed and you need to update it on the PC (in a program on the PC that talks to the iPod that is).
2602
+ </p><p><br>
2603
+ </p>
2604
+ <div align="right"><small>→ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB/OTG_Playlist_File" title="ITunesDB/OTG Playlist File">Subpage: OTG Playlist File</a></small></div>
2605
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/OTG_Playlist_File&action=edit&section=1" title="ITunesDB/OTG Playlist File">edit</a>]</div><a name="On_The_Go_Playlist_files"></a><h2>On The Go Playlist files</h2>
2606
+ <table border="1" cellpadding="5" cellspacing="0">
2607
+ <caption><b>mhpo format</b>
2608
+ </caption>
2609
+ <tbody><tr>
2610
+ <th style="background:#efefef;"> offset
2611
+ </th><th style="background:#efefef;"> field
2612
+ </th><th style="background:#efefef;"> size
2613
+ </th><th style="background:#efefef;"> value
2614
+ </th></tr>
2615
+ <tr>
2616
+ <td> 0 </td><td> header identifier </td><td> 4 </td><td> mhpo
2617
+ </td></tr>
2618
+ <tr>
2619
+ <td> 4 </td><td> file size </td><td> 4 </td><td> the header length, always 20 on my 4gen iPod
2620
+ </td></tr>
2621
+ <tr>
2622
+ <td> 8 </td><td> unk1 </td><td> 4 </td><td> unknown, appears to always be 0 (on my 4gen iPod it seems to be always 4)
2623
+ </td></tr>
2624
+ <tr>
2625
+ <td> 12 </td><td> tracks </td><td> 4 </td><td> number of tracks in this OTG playlist
2626
+ </td></tr>
2627
+ <tr>
2628
+ <td> 16 </td><td> unk2 </td><td> 4 </td><td> unknown, appears to always be 0 (on my 4gen iPod it is a fixed number, and the OTG file will not work if this number is 0)
2629
+ </td></tr>
2630
+ <tr>
2631
+ <td> 20 </td><td> track index number </td><td> 4 * tracks </td><td> This is a list of the tracks in the playlist, one after another. The number is a zero based index into the Track List (MHLT) in the iTunesDB file. So the first track in the MHLT would be 0, the second would be 1, and so forth.
2632
+ </td></tr></tbody></table>
2633
+ <p>Because the OTG Playlist uses track indexes, it is only valid until the next time the iTunesDB changes. This means that you should read any OTGPlaylist files on a sync and create proper Playlists for them in the iTunesDB file or do something else with them. After you change the iTunesDB file, they won't be valid anymore.
2634
+ </p><p>iTunes handles this by deleting the files once they are read, during an autosync. Apple's iPod firmware also deletes these files if the iTunesDB changes and it detects it, after you undock the iPod. iTunes will read them and create real playlists from them before it syncs anything. Note that in any sync operation, this *must* occur before the iTunesDB changes, otherwise you'll lose the playlist.
2635
+ </p><p><br>
2636
+ </p>
2637
+ <div align="right"><small>→ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB/Equalizer_Presets_File" title="ITunesDB/Equalizer Presets File">Subpage: Equalizer Presets File</a></small></div>
2638
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Equalizer_Presets_File&action=edit&section=1" title="ITunesDB/Equalizer Presets File">edit</a>]</div><a name="Equalizer_Presets_file"></a><h2>Equalizer Presets file</h2>
2639
+ <p>The EQPresets file consists of a Presets Container to specify the number of EQPresets in the file, and then a series of EQ Presets as its children.
2640
+ </p>
2641
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Equalizer_Presets_File&action=edit&section=2" title="ITunesDB/Equalizer Presets File">edit</a>]</div><a name="Equalizer_Presets_Container"></a><h3>Equalizer Presets Container</h3>
2642
+ <table border="1" cellpadding="5" cellspacing="0">
2643
+ <caption><b>mqed format</b>
2644
+ </caption>
2645
+ <tbody><tr>
2646
+ <th style="background:#efefef;"> field
2647
+ </th><th style="background:#efefef;"> size
2648
+ </th><th style="background:#efefef;"> value
2649
+ </th></tr>
2650
+ <tr>
2651
+ <td> header identifier </td><td> 4 </td><td> mqed
2652
+ </td></tr>
2653
+ <tr>
2654
+ <td> header size </td><td> 4 </td><td> the size of the mqed header
2655
+ </td></tr>
2656
+ <tr>
2657
+ <td> unk1 </td><td> 4 </td><td> unknown
2658
+ </td></tr>
2659
+ <tr>
2660
+ <td> unk2 </td><td> 4 </td><td> unknown
2661
+ </td></tr>
2662
+ <tr>
2663
+ <td> number of presets </td><td> 4 </td><td> the number of presets defined in this file
2664
+ </td></tr>
2665
+ <tr>
2666
+ <td> childsize </td><td> 4 </td><td> the size of an individual preset in bytes. Always 588, thus far.
2667
+ </td></tr>
2668
+ <tr>
2669
+ <td colspan="3"> rest of header is zero padded
2670
+ </td></tr></tbody></table>
2671
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Equalizer_Presets_File&action=edit&section=3" title="ITunesDB/Equalizer Presets File">edit</a>]</div><a name="Equalizer_Preset"></a><h3>Equalizer Preset</h3>
2672
+ <p>Each EQ Preset contains two actual presets. The first one is the representation you see in iTunes - a 10 band Equalizer. iTunes actually displays the given bands slightly wrong. The real values it uses are:
2673
+ 32Hz, 64Hz, 128Hz, 256Hz, 512Hz, 1024Hz, 2048Hz, 4096Hz, 8192Hz, 16384Hz
2674
+ </p><p>The EQ Preset also contains a 5 band version of the exact same preset. The algorithim it uses to determine this from the 10 band preset is not known, but you can assume it uses some form of curve fitting method. In any case, the 5 band version would be the EQ setting that the iPod actually would use, if it actually read and used this file as it obviously was supposed to do. The reason for this is that the iPod's audio DSP is capable of applying a 5 band EQ directly.
2675
+ </p>
2676
+ <table border="1" cellpadding="5" cellspacing="0">
2677
+ <caption><b>pqed format</b>
2678
+ </caption>
2679
+ <tbody><tr>
2680
+ <th style="background:#efefef;"> field
2681
+ </th><th style="background:#efefef;"> size
2682
+ </th><th style="background:#efefef;"> value
2683
+ </th></tr>
2684
+ <tr>
2685
+ <td> header identifier </td><td> 4 </td><td> pqed
2686
+ </td></tr>
2687
+ <tr>
2688
+ <td> length of preset name </td><td> 2 </td><td> the length, in bytes, of the name of the preset
2689
+ </td></tr>
2690
+ <tr>
2691
+ <td> name </td><td> 510 </td><td> The name of the preset, padded with nulls at the end. This is always 510 bytes long.
2692
+ </td></tr>
2693
+ <tr>
2694
+ <td> preamp </td><td> 4 </td><td> The preamp value. Possible values are from -1200 to 1200, measured as dB * 100. This is a signed long.
2695
+ </td></tr>
2696
+ <tr>
2697
+ <td> number of bands </td><td> 4 </td><td> number of bands in the preset. This is always 10.
2698
+ </td></tr>
2699
+ <tr>
2700
+ <td> band values </td><td> 40 </td><td> 10 bands of values, each a signed long from -1200 to 1200 (measured as dB * 100)
2701
+ </td></tr>
2702
+ <tr>
2703
+ <td> number of bands 2 </td><td> 4 </td><td> number of bands in the second representation. This is always 5.
2704
+ </td></tr>
2705
+ <tr>
2706
+ <td> band values 2 </td><td> 20 </td><td> 5 bands of values, each a signed long from -1200 to 1200 (measured as dB * 100)
2707
+ </td></tr>
2708
+ <tr>
2709
+ <td colspan="3"> rest of pqed is NOT zero padded
2710
+ </td></tr></tbody></table>
2711
+ <p><br>
2712
+ </p>
2713
+ <div align="right"><small>→ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB/Artwork_Database" title="ITunesDB/Artwork Database">Subpage: Artwork Database</a></small></div>
2714
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Artwork_Database&action=edit&section=1" title="ITunesDB/Artwork Database">edit</a>]</div><a name="Artwork_Database"></a><h2>Artwork Database</h2>
2715
+ <p>The ArtworkDB file is only found on iPod Photos. It is created by iTunes 4.7 and up. This file, along with the thumbnail files iTunes creates, are what allows photos and album art to be displayed on the iPod Photo.
2716
+ </p><p>The Photo Database file is similar to the ArtworkDB file. The Photo Database stores photos you add manually, the ArtworkDB stores album artwork for displaying when playing music.
2717
+ </p><p>-Images are concatenated into *.ithmb files (thumbnails, basically).
2718
+ </p><p>-Large thumbnails are stored separately from small thumbnails.
2719
+ </p><p>-Large thumbnails are 140x140, small thumbnails are 56x56 - raw RGB565 packed color binary streams (bytes are swapped, little endian).
2720
+ </p><p>ArtworkDB Database layout:
2721
+ </p>
2722
+ <pre>&lt;mhfd&gt;
2723
+ &lt;mhsd&gt; (index = 1)
2724
+ &lt;mhli&gt;
2725
+ &lt;mhii&gt;
2726
+ &lt;mhod&gt; (type = 2) Info about full size thumbnail
2727
+ &lt;mhni&gt;
2728
+ &lt;mhod&gt; (type = 3)
2729
+ &lt;mhod&gt; (type = 2) Info about 'now playing' thumbnail
2730
+ &lt;mhni&gt;
2731
+ &lt;mhod&gt; (type = 3)
2732
+ &lt;mhii&gt;
2733
+ &lt;mhod&gt; (type = 2)
2734
+ &lt;mhni&gt;
2735
+ &lt;mhod&gt; (type = 3)
2736
+ &lt;mhod&gt; (type = 2)
2737
+ &lt;mhni&gt;
2738
+ &lt;mhod&gt; (type = 3)
2739
+ ...
2740
+ &lt;mhsd&gt; (index = 2)
2741
+ &lt;mhla&gt;
2742
+ &lt;mhsd&gt; (index = 3)
2743
+ &lt;mhlf&gt;
2744
+ &lt;mhif&gt;
2745
+ &lt;mhif&gt;
2746
+ ...
2747
+ </pre>
2748
+ <p><br>
2749
+ </p>
2750
+ <div align="right"><small>→ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB/Photo_Database" title="ITunesDB/Photo Database">Subpage: Photo Database</a></small></div>
2751
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Photo_Database&action=edit&section=1" title="ITunesDB/Photo Database">edit</a>]</div><a name="Photo_Database"></a><h2>Photo Database</h2>
2752
+ <p>The Photo Database is created by iTunes, and is stored in "/Photos/Photo Database".
2753
+ The Photo Database looks similar to the ArtworkDB but has additional entries in the mhla object (mhba and mhia, see below) as well as different Thumbnails. The mhiis in the Photo Database look like this for example:
2754
+ </p>
2755
+ <pre>mhii (children: 5, id: 117, srcimgsize: 0)
2756
+ mhod (type: 5)
2757
+ mhni (children: 1, corrid: 1, ithmb offset: 0, imgsize: 1567395, imgdim: 0x0)
2758
+ mhod (type: 3, length: 80, string: u':Full Resolution:2005:08:06:simg3609.jpg')
2759
+ mhod (type: 2)
2760
+ mhni (children: 1, corrid: 1019, ithmb offset: 7603200, imgsize: 691200, imgdim: 0x2c801e0)
2761
+ mhod (type: 33554435, length: 42, string: u':Thumbs:F1019_1.ithmb')
2762
+ mhod (type: 2)
2763
+ mhni (children: 1, corrid: 1020, ithmb offset: 851840, imgsize: 77440, imgdim: 0xa500e1)
2764
+ mhod (type: 33554435, length: 42, string: u':Thumbs:F1020_1.ithmb')
2765
+ mhod (type: 2)
2766
+ mhni (children: 1, corrid: 1009, ithmb offset: 27720, imgsize: 2520, imgdim: 0x29001f)
2767
+ mhod (type: 33554435, length: 42, string: u':Thumbs:F1009_1.ithmb')
2768
+ mhod (type: 2)
2769
+ mhni (children: 1, corrid: 1015, ithmb offset: 251680, imgsize: 22880, imgdim: 0x7b0058)
2770
+ mhod (type: 33554435, length: 42, string: u':Thumbs:F1015_1.ithmb')
2771
+ </pre>
2772
+ <p>The type 5 mhod references the full resolution image and is probably only there if the corresponding check box in iTunes was checked. The type 2 mhods reference different types of thumbnail versions:
2773
+ </p>
2774
+ <ol><li> The first thumbnail (imgdim: 0x2c801e0, which decodes as 712x480) is of dimension 720x480 and in YUV 4:2:2 format, interlaced. It consists of two half-frames concatenated together. This is probably used for the TV-out (dimension, color format and interlacing look like NTSC).
2775
+ </li><li> The second thumbnail (imgdim: 0xa500e1, which decodes as 165x225) is of dimension 176x220 and in RGB 565 format, but rotated 90° CCW. This is the image that is actually displayed on the iPod screen.
2776
+ </li><li> The third thumbnail (imgdim: 0x29001f(41x31)) is 42x30, RGB 565 with swapped bytes (e.g. it's more like GBRG 3553). This is the image that is used as a thumbnail.
2777
+ </li><li> The fourth thumbnail (imgdim: 0x7b0058(123x88)) is 130x88, RGB 565 with swapped bytes
2778
+ </li></ol>
2779
+ <p>There is a *.ithmb file per resolution (in the directory "/Photos/Thumbs/"), that concatenates all thumbnails with that resolution.
2780
+ </p><p>On an iPod video (5G) there are 4 different thumbnails type:
2781
+ </p>
2782
+ <ol><li> 720x480 interlaced UYVY (YUV 4:2:2) - used for TV output - 691200 bytes each single thumbnail
2783
+ </li><li> 320x240 byte swapped RGB565 - used for fullscreen on the iPod - 153600 bytes each single thumbnail
2784
+ </li><li> 130x88 byte swapped RGB565 - used on the iPod during slideshow, when current photo is displayed on TV - 22880 bytes each single thumbnail
2785
+ </li><li> 50x41 byte swapped RGB565 - used on the iPod when listing and during slideshow - 4100 bytes each single thumbnail
2786
+ </li></ol>
2787
+ <p>Dimensions of the fields in the <i>Photo Database</i> are very important. Only one total length field or one padding field with wrong value could be enough to make the Photo Database file completely unusable: then nothing will be displayed on the iPod, no photo albums, no photos.
2788
+ </p><p>Here follows a complete structure for a Photo Database file working on an iPod video 5G:
2789
+ </p>
2790
+ <pre> 'mhfd', 132, 1384, 0, 1, 3, 0, 102, 0, 0, 0, 0, 2, 0, 0, 0, 0
2791
+ 'mhsd', 96, 1276, 1
2792
+ 'mhli', 92, 1
2793
+ 'mhii', 152, 1088, 5, 100, 102, 0, 0, 0, 0, 3221487006, 3221487006, 0
2794
+ 'mhod', 24, 216, 5, 0, 0
2795
+ 'mhni', 76, 192, 1, 1, 0, 0, 0, 0, 0, 0
2796
+ 'mhod', 24, 116, 3, 0, 2
2797
+ 78, 2, 0, ':Full Resolution:2006:01:22:DSC00090.JPG'
2798
+ 'mhod', 24, 180, 2, 0, 0
2799
+ 'mhni', 76, 156, 1, 1019, 0, 691200, 0, 0, 480, 712
2800
+ 'mhod', 24, 80, 3, 0, 2
2801
+ 42, 2, 0, ':Thumbs:F1019_1.ithmb'
2802
+ 'mhod', 24, 180, 2, 0, 0
2803
+ 'mhni', 76, 156, 1, 1024, 0, 153600, 0, 0, 240, 320
2804
+ 'mhod', 24, 80, 3, 0, 2
2805
+ 42, 2, 0, ':Thumbs:F1024_1.ithmb'
2806
+ 'mhod', 24, 180, 2, 0, 0
2807
+ 'mhni', 76, 156, 1, 1015, 0, 22880, 0, 0, 88, 123
2808
+ 'mhod', 24, 80, 3, 0, 2
2809
+ 42, 2, 0, ':Thumbs:F1015_1.ithmb'
2810
+ 'mhod', 24, 180, 2, 0, 0
2811
+ 'mhni', 76, 156, 1, 1036, 0, 4100, 0, 0, 41, 53
2812
+ 'mhod', 24, 80, 3, 0, 2
2813
+ 42, 2, 0, ':Thumbs:F1036_1.ithmb'
2814
+ 'mhsd', 96, 660, 2
2815
+ 'mhla', 92, 2
2816
+ 'mhba', 148, 232, 1, 1, 101, 0, 65536, 0, 0, 0, 0, 0, 0, 0, 100
2817
+ 'mhod', 24, 44, 1, 0, 1
2818
+ 7, 1, 0, 'Library'
2819
+ 'mhia', 40, 40, 0, 100
2820
+ 'mhba', 148, 240, 1, 1, 102, 0, 393216, 0, 0, 0, 0, 0, 0, 0, 101
2821
+ 'mhod', 24, 52, 1, 0, 3
2822
+ 13, 1, 0, 'A Photo Album'
2823
+ 'mhia', 40, 40, 0, 100
2824
+ 'mhsd', 96, 684, 3
2825
+ 'mhlf', 92, 4
2826
+ 'mhif', 124, 124, 0, 1019, 691200
2827
+ 'mhif', 124, 124, 0, 1015, 22880
2828
+ 'mhif', 124, 124, 0, 1024, 153600
2829
+ 'mhif', 124, 124, 0, 1036, 4100
2830
+ </pre>
2831
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Photo_Database&action=edit&section=2" title="ITunesDB/Photo Database">edit</a>]</div><a name="Data_File_Object"></a><h3>Data File Object</h3>
2832
+ <table border="1" cellpadding="5" cellspacing="0">
2833
+ <caption><b>mhfd format</b>
2834
+ </caption>
2835
+ <tbody><tr>
2836
+ <th style="background:#efefef;"> offset
2837
+ </th><th style="background:#efefef;"> field
2838
+ </th><th style="background:#efefef;"> size
2839
+ </th><th style="background:#efefef;"> value
2840
+ </th></tr>
2841
+ <tr>
2842
+ <td>0</td><td> header identifier </td><td> 4 </td><td> mhfd
2843
+ </td></tr>
2844
+ <tr>
2845
+ <td>4</td><td> header length </td><td> 4 </td><td> size of the mhfd header (0x84)
2846
+ </td></tr>
2847
+ <tr>
2848
+ <td>8</td><td> total length </td><td> 4 </td><td> size of the header and all child records (since everything is a child of MHFD, this will always be the size of the entire file)
2849
+ </td></tr>
2850
+ <tr>
2851
+ <td>12</td><td> unknown1 </td><td> 4 </td><td> always seem to be 0
2852
+ </td></tr>
2853
+ <tr>
2854
+ <td>16</td><td> unknown2 </td><td> 4 </td><td> always seem to be 1 for older databases, in an ArtworkDB generated by iTunes 4.9 or above, it's 2. Caution: iTunes7 removes the whole database if this field is 1
2855
+ </td></tr>
2856
+ <tr>
2857
+ <td>20</td><td> number of children </td><td> 4 </td><td> always 3 since there are 3 list holders
2858
+ </td></tr>
2859
+ <tr>
2860
+ <td>24</td><td> unknown3 </td><td> 4 </td><td> always seem to be 0
2861
+ </td></tr>
2862
+ <tr>
2863
+ <td>28</td><td> next id for mhii </td><td> 4 </td><td> The id of last mhii + 1. (is probably used as the id of a newly added mhii and then incremented). On an iPod video seems to be the id of the last mhii + the total number of photo albums (mhba) + 1.
2864
+ </td></tr>
2865
+ <tr>
2866
+ <td>32</td><td> unknown5 </td><td> 8 </td><td>
2867
+ </td></tr>
2868
+ <tr>
2869
+ <td>40</td><td> unknown6 </td><td> 8 </td><td>
2870
+ </td></tr>
2871
+ <tr>
2872
+ <td>48</td><td> unknown7 </td><td> 4 </td><td> always seem to be 2
2873
+ </td></tr>
2874
+ <tr>
2875
+ <td>52</td><td> unknown8 </td><td> 4 </td><td> always seem to be 0
2876
+ </td></tr>
2877
+ <tr>
2878
+ <td>56</td><td> unknown9 </td><td> 4 </td><td> always seem to be 0
2879
+ </td></tr>
2880
+ <tr>
2881
+ <td>60</td><td> unknown10 </td><td> 4 </td><td>
2882
+ </td></tr>
2883
+ <tr>
2884
+ <td>64</td><td> unknown11 </td><td> 4 </td><td>
2885
+ </td></tr>
2886
+ <tr>
2887
+ <td>68</td><td colspan="3"> rest of header is zero padded
2888
+ </td></tr></tbody></table>
2889
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Photo_Database&action=edit&section=3" title="ITunesDB/Photo Database">edit</a>]</div><a name="DataSet_2"></a><h3>DataSet</h3>
2890
+ <p>This is basically the same as the MHSD element in the iTunes DB.
2891
+ </p>
2892
+ <table border="1" cellpadding="5" cellspacing="0">
2893
+ <caption><b>mhsd format</b>
2894
+ </caption>
2895
+ <tbody><tr>
2896
+ <th style="background:#efefef;"> field
2897
+ </th><th style="background:#efefef;"> size
2898
+ </th><th style="background:#efefef;"> value
2899
+ </th></tr>
2900
+ <tr>
2901
+ <td> header identifier </td><td> 4 </td><td> mhsd
2902
+ </td></tr>
2903
+ <tr>
2904
+ <td> header length </td><td> 4 </td><td> size of the mhsd header (0x60)
2905
+ </td></tr>
2906
+ <tr>
2907
+ <td> total length </td><td> 4 </td><td> size of the header and all child records
2908
+ </td></tr>
2909
+ <tr>
2910
+ <td> index </td><td> 4 </td><td> An index number. This value is 1 if the child is an Image List, 2 if the child is an Album List, or 3 if it's a File List.
2911
+ </td></tr>
2912
+ <tr>
2913
+ <td colspan="3"> rest of header is zero padded
2914
+ </td></tr></tbody></table>
2915
+ <p>Depending on the index, the Data Set either contains an Image List (mhli) child, an Album List (mhla) child or a File List child (mhlf).
2916
+ </p>
2917
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Photo_Database&action=edit&section=4" title="ITunesDB/Photo Database">edit</a>]</div><a name="Image_List"></a><h3>Image List</h3>
2918
+ <table border="1" cellpadding="5" cellspacing="0">
2919
+ <caption><b>mhli format</b>
2920
+ </caption>
2921
+ <tbody><tr>
2922
+ <th style="background:#efefef;"> field
2923
+ </th><th style="background:#efefef;"> size
2924
+ </th><th style="background:#efefef;"> value
2925
+ </th></tr>
2926
+ <tr>
2927
+ <td> header identifier </td><td> 4 </td><td> mhli
2928
+ </td></tr>
2929
+ <tr>
2930
+ <td> header length </td><td> 4 </td><td> size of the mhli header (0x5c)
2931
+ </td></tr>
2932
+ <tr>
2933
+ <td> number of images </td><td> 4 </td><td> the total number of images in the Image List
2934
+ </td></tr>
2935
+ <tr>
2936
+ <td colspan="3"> rest of header is zero padded
2937
+ </td></tr></tbody></table>
2938
+ <p>The Image List has Image Items as its children. The number of Image Items is the same as the number of images.
2939
+ </p>
2940
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Photo_Database&action=edit&section=5" title="ITunesDB/Photo Database">edit</a>]</div><a name="Image_Item"></a><h3>Image Item</h3>
2941
+ <table border="1" cellpadding="5" cellspacing="0">
2942
+ <caption><b>mhii format</b>
2943
+ </caption>
2944
+ <tbody><tr>
2945
+ <th style="background:#efefef;"> offset
2946
+ </th><th style="background:#efefef;"> field
2947
+ </th><th style="background:#efefef;"> size
2948
+ </th><th style="background:#efefef;"> value
2949
+ </th></tr>
2950
+ <tr>
2951
+ <td>0</td><td> header identifier </td><td> 4 </td><td> mhii
2952
+ </td></tr>
2953
+ <tr>
2954
+ <td>4</td><td> header length </td><td> 4 </td><td> size of the mhii header (0x98)
2955
+ </td></tr>
2956
+ <tr>
2957
+ <td>8</td><td> total length </td><td> 4 </td><td> size of the header and all child records
2958
+ </td></tr>
2959
+ <tr>
2960
+ <td>12</td><td> number of children </td><td> 4 </td><td>In ArtworkDB there are 2 children: one mhod type 2 record for the full sized thumbnail, and one mhod type 2 record for the now-playing sized thumbnail. In Photo Database there are: a child for every thumbnail type (2 on Nanoes, 4 on Photo/Color/Video iPods) + a child for the reference to the full resolution image (if chosen to include it). In Photo Database files generated on Macs, probably by iPhoto, sometimes there could be an additional child, a type-1 string MHOD containing an UTF-8 string of a label for the image, usually found as first child just after the MHII header.
2961
+ </td></tr>
2962
+ <tr>
2963
+ <td>16</td><td> id </td><td> 4 </td><td> First mhii is 0x40, second is 0x41, ... (on mobile phones the first mhii appears to be 0x64, second 0x65, ...)
2964
+ </td></tr>
2965
+ <tr>
2966
+ <td>20</td><td> Song ID </td><td> 8 </td><td> Unique ID corresponding to the 'dbid' field in the iTunesDB mhit record, this is used to map ArtworkDB items to iTunesDB items.
2967
+ </td></tr>
2968
+ <tr>
2969
+ <td>28</td><td> unknown4 </td><td> 4 </td><td> Seems to always be 0
2970
+ </td></tr>
2971
+ <tr>
2972
+ <td>32</td><td> rating </td><td> 4 </td><td> Rating from iPhoto * 20
2973
+ </td></tr>
2974
+ <tr>
2975
+ <td>36</td><td> unknown6 </td><td> 4 </td><td> Seems to always be 0
2976
+ </td></tr>
2977
+ <tr>
2978
+ <td>40</td><td> originalDate </td><td> 4 </td><td> Seems to always be 0 in ArtworkDB; timestamp in Photo Database (creation date of file)
2979
+ </td></tr>
2980
+ <tr>
2981
+ <td>44</td><td> digitizedDate </td><td> 4 </td><td> Seems to always be 0 in ArtworkDB; timestamp in Photo Database (date when the picture was taken, probably from EXIF information)
2982
+ </td></tr>
2983
+ <tr>
2984
+ <td>48</td><td> source image size </td><td> 4 </td><td> Size in bytes of the original source image
2985
+ </td></tr>
2986
+ <tr>
2987
+ <td colspan="4"> rest of header is zero padded
2988
+ </td></tr></tbody></table>
2989
+ <p>MHOD type 2, Annoyingly, not a string like it is in iTunesDB... but still defines location of the file in question, sorta: its mhni child record contains everything that is needed about the image file.
2990
+ </p>
2991
+ <pre>header_size = 0x18
2992
+ total_size
2993
+ type = 2
2994
+ unk1 = 0
2995
+ unk2 = 0
2996
+ </pre>
2997
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Photo_Database&action=edit&section=6" title="ITunesDB/Photo Database">edit</a>]</div><a name="Image_Name"></a><h3>Image Name</h3>
2998
+ <p><br>
2999
+ </p><table border="1" cellpadding="5" cellspacing="0">
3000
+ <caption><b>mhni format</b>
3001
+ </caption>
3002
+ <tbody><tr>
3003
+ <th style="background:#efefef;"> offset
3004
+ </th><th style="background:#efefef;"> field
3005
+ </th><th style="background:#efefef;"> size
3006
+ </th><th style="background:#efefef;"> value
3007
+ </th></tr>
3008
+ <tr>
3009
+ <td>0</td><td> header identifier </td><td> 4 </td><td> mhni
3010
+ </td></tr>
3011
+ <tr>
3012
+ <td>4</td><td> header length </td><td> 4 </td><td> size of the mhni header (0x4c)
3013
+ </td></tr>
3014
+ <tr>
3015
+ <td>8</td><td> total length </td><td> 4 </td><td> size of the header and all child records
3016
+ </td></tr>
3017
+ <tr>
3018
+ <td>12</td><td> number of children </td><td> 4 </td><td> mhni headers have one mhod type 3 child
3019
+ </td></tr>
3020
+ <tr>
3021
+ <td>16</td><td> correlation ID </td><td> 4 </td><td> corresponds to mhif's correlation id, it's used to generate the name of the file containing the image, see below
3022
+ </td></tr>
3023
+ <tr>
3024
+ <td>20</td><td> ithmb offset </td><td> 4 </td><td> offset where the start of image data can be found in the .ithmb file corresponding to this image
3025
+ </td></tr>
3026
+ <tr>
3027
+ <td>24</td><td> image size </td><td> 4 </td><td> size of the image in bytes
3028
+ </td></tr>
3029
+ <tr>
3030
+ <td>28</td><td> vertical padding </td><td> 2 </td><td> approximate difference between scaled image height and pixmap height (signed)
3031
+ </td></tr>
3032
+
3033
+ <tr>
3034
+ <td>30</td><td>horizontal padding </td><td> 2 </td><td>approximate difference between scaled image width and pixmap width (signed) </td></tr>
3035
+ <tr><td>32</td><td> image height </td><td> 2 </td><td> The height of the image. </td></tr>
3036
+ <tr><td>34</td><td> image width </td><td> 2 </td><td> The width of the image. </td></tr>
3037
+ <tr><td>36</td><td> unknown </td><td> 4 </td><td> Always zero? </td></tr>
3038
+ <tr><td>40</td><td> image size </td><td> 4 </td><td> size of the image in bytes (same as 0x18), written by iTunes 7.4 </td></tr>
3039
+
3040
+ <tr>
3041
+ <td colspan="4"> rest of header is zero padded
3042
+ </td></tr></tbody></table>
3043
+ <p>The correlation ID gives us the name of the file containing the image. For example, if the correlation ID is 1016 in decimal, then the corresponding filename will be F1016_1.ithmb.
3044
+ </p><p>In general, (vertical padding +image height) ~ pixmap height - usually within one or two pixels, probably due to rounding error. For instance, on a PhotoPod, an original image with dimensions 1200h x 1600v will have an NTSC image with image height=480, image width=558, vertical padding=0, and horizontal padding=162, with 558+162 = 720, the actual width of the pixel map. For an image scaled to be contained entirely within the pixel map, such as the video image or the full-screen image the padding values are basically the total width of the black bars.
3045
+ </p><p>For the smallest thumbnails, you can have negative values for padding, because the pixel map is scaled to be contained <i>within</i> the image - you get a central "slice" with no black bars.
3046
+ </p><p>As noted, there appear to be some rounding errors when the padding values are calculated, as the sums are sometimes off by 1 to 2.
3047
+ </p><p>There is no indication in this object what the pixel format, actual pixel map dimensions or rotation of images will be, so this must be entirely derived from the image size.
3048
+ </p><p>Here are the dimensions and formats for all known image sizes:
3049
+ </p>
3050
+ <table border="1" cellpadding="5" cellspacing="0">
3051
+ <tbody><tr><td>size</td><td>height</td><td>width</td><td>format</td><td>description</td></tr>
3052
+ <tr><td>691200</td><td>480</td><td>720</td><td>UYVY</td><td>PhotoPod and VideoPod NTSC image</td></tr>
3053
+ <tr><td>153600</td><td>240</td><td>320</td><td>RGB565_LE</td><td>VideoPod full screen</td></tr>
3054
+ <tr><td>80000</td><td>200</td><td>200</td><td>RGB565_LE</td><td>VideoPod album art big version</td></tr>
3055
+ <tr><td>77440</td><td>176</td><td>220</td><td>RGB565_BE_90</td><td>PhotoPod full screen</td></tr>
3056
+ <tr><td>46464</td><td>132</td><td>176</td><td>RGB565_BE</td><td>Nano full screen</td></tr>
3057
+ <tr><td>39200</td><td>140</td><td>140</td><td>RGB565_LE</td><td>PhotoPod album art big version</td></tr>
3058
+ <tr><td>22880</td><td>88</td><td>130</td><td>RGB565_LE</td><td>PhotoPod and VideoPod video preview</td></tr>
3059
+ <tr><td>20000</td><td>100</td><td>100</td><td>RGB565_LE</td><td>VideoPod album art small version, Nano album art big version</td></tr>
3060
+ <tr><td>6272</td><td>56</td><td>56</td><td>RGB565_LE</td><td>PhotoPod album art small version</td></tr>
3061
+ <tr><td>4100</td><td>41</td><td>50</td><td>RGB565_LE</td><td>VideoPod list thumbnail</td></tr>
3062
+ <tr><td>3528</td><td>42</td><td>42</td><td>RGB565_LE </td><td>Nano album art small version</td></tr>
3063
+ <tr><td>3108</td><td>37</td><td>42</td><td>RGB565_LE</td><td>Nano list thumbnail</td></tr>
3064
+ <tr><td>2520</td><td>30</td><td>42</td><td>RGB565_LE</td><td>PhotoPod list thumbnail</td></tr>
3065
+ </tbody></table>
3066
+ <p>where:
3067
+ </p>
3068
+ <ul><li> UYVY is a byte stream where U,Y0,V,Y1 creates two YUV pixels of Y0,U,V and Y1,U,V, interlaced, all even fields, then all odd fields.
3069
+ </li><li> RGB565_LE is a stream of byte-swapped 16-bit pixels ordered from top-&gt;bottom, left-&gt;right
3070
+ </li><li> RGB565_BE_90 is a stream of 16-bit pixels ordered right to left, top to bottom
3071
+ </li></ul>
3072
+ <p>The "full screen" images are rotated because the iPod displays used are actually portrait, not landscape, and this format is just a memory dump of the frame buffer memory.
3073
+ </p>
3074
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Photo_Database&action=edit&section=7" title="ITunesDB/Photo Database">edit</a>]</div><a name="Album_List_2"></a><h3>Album List</h3>
3075
+ <table border="1" cellpadding="5" cellspacing="0">
3076
+ <caption><b>mhla format</b>
3077
+ </caption>
3078
+ <tbody><tr>
3079
+ <th style="background:#efefef;"> field
3080
+ </th><th style="background:#efefef;"> size
3081
+ </th><th style="background:#efefef;"> value
3082
+ </th></tr>
3083
+ <tr>
3084
+ <td> header identifier </td><td> 4 </td><td> mhla
3085
+ </td></tr>
3086
+ <tr>
3087
+ <td> header length </td><td> 4 </td><td> size of the mhla header (0x5c)
3088
+ </td></tr>
3089
+ <tr>
3090
+ <td> number of children </td><td> 4 </td><td> the total number of children in the Album List (no children in ArtworkDB, 1 or more children in Photo Database)
3091
+ </td></tr>
3092
+ <tr>
3093
+ <td colspan="3"> rest of header is zero padded
3094
+ </td></tr></tbody></table>
3095
+ <p>The Album List has no children in the case of the ArtworkDB file, and 1 or more children for the Photo Database: 1 child for the Photo Library and possible some more children for additional photo albums.
3096
+ </p><p>For the Photo Database the layout looks like this, for example:
3097
+ </p>
3098
+ <pre>mhsd (type: 2)
3099
+ mhla (children: 3)
3100
+ mhba (number of mhods: 1, number of mhias: 5, unk3: 0x10000)
3101
+ mhod (string: "My Pictures")
3102
+ mhia (image id: 100)
3103
+ mhia (image id: 101)
3104
+ mhia (image id: 102)
3105
+ mhia (image id: 103)
3106
+ mhia (image id: 104)
3107
+ mhba (number of mhods: 1, number of mhias: 2, unk3: 0x60000)
3108
+ mhod (string: "Folder A")
3109
+ mhia (image id: 100)
3110
+ mhia (image id: 101)
3111
+ mhba (number of mhods: 1, number of mhias: 3, unk3: 0x60000)
3112
+ mhod (string: "Folder B")
3113
+ mhia (image id: 102)
3114
+ mhia (image id: 103)
3115
+ mhia (image id: 104)
3116
+ </pre>
3117
+ <p>In this case "My Pictures" was the folder that was selected in iTunes to synchronize photos with, and it contained 2 folders "Folder A" and "Folder B" with 2 and 3 photos respectively. The iPod will show this on its Photo menu as a submenu called "Photo Library" (containing all 5 photos), a submenu called "Folder A" with the first 2 photos and a submenu "Folder B" with the other 3 photos.
3118
+ </p><p>Note that the string MHODs are zero-padded to a length that is a multiple of 4 so that in the Photo Database all objects start on a 4-byte boundary. The iPod won't list any photo or photo album otherwise.
3119
+ </p>
3120
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Photo_Database&action=edit&section=8" title="ITunesDB/Photo Database">edit</a>]</div><a name="Photo_Album"></a><h3>Photo Album</h3>
3121
+ <p>An MHBA allows you to setup an Album of photos (grouping photos together in an album). The MHBA is implemented similar to playlist.
3122
+ </p><p>These are only supported on models that support photos.
3123
+ </p>
3124
+ <table border="1" cellpadding="5" cellspacing="0">
3125
+ <caption><b>mhba format</b>
3126
+ </caption>
3127
+ <tbody><tr>
3128
+ <th style="background:#efefef;"> offset</th>
3129
+ <th style="background:#efefef;"> field
3130
+ </th><th style="background:#efefef;"> size
3131
+ </th><th style="background:#efefef;"> value
3132
+ </th></tr>
3133
+ <tr>
3134
+ <td>0</td><td> header identifier </td><td> 4 </td><td> mhba
3135
+ </td></tr>
3136
+ <tr>
3137
+ <td>4</td><td> header length </td><td> 4 </td><td> size of the mhba header (0x94)
3138
+ </td></tr>
3139
+ <tr>
3140
+ <td>8</td><td> total length </td><td> 4 </td><td> size of the header and all child records
3141
+ </td></tr>
3142
+ <tr>
3143
+ <td>12</td><td> Data Object Child Count </td><td> 4 </td><td> number of Data Objects in the List, probably always 1. Sometimes seems to be 2 in the new video iPods' Photo Database, see below.
3144
+ </td></tr>
3145
+ <tr>
3146
+ <td>16</td><td> Album Item Count </td><td> 4 </td><td> number of pictures in the album
3147
+ </td></tr>
3148
+ <tr>
3149
+ <td>20</td><td> playlist id </td><td> 4 </td><td> a unique integer for each playlist - starts out at $64 and increments by 1. Really seems to be the total number of pictures (MHII) + photo album number (+1 for the first album, +2 for the second, etc. etc.)
3150
+ </td></tr>
3151
+ <tr>
3152
+ <td>24</td><td> unk2 </td><td> 4 </td><td> unknown, seems to be always 0
3153
+ </td></tr>
3154
+ <tr>
3155
+ <td>28</td><td> unk3 </td><td> 2 </td><td> unknown, seems to be always 0
3156
+ </td></tr>
3157
+ <tr>
3158
+ <td>30</td><td> Album Type </td> <td> 1 </td> <td> 1 = master photo list ("Photo Library"), 2 = normal album, sometimes 4 and 5
3159
+ </td></tr>
3160
+ <tr>
3161
+ <td>31</td><td> playMusic </td> <td> 1 </td> <td> play music during slideshow (from iPhoto setting)
3162
+ </td></tr>
3163
+ <tr>
3164
+ <td>32</td><td> repeat </td> <td> 1 </td> <td> repeat the slideshow (from iPhoto setting)
3165
+ </td> </tr>
3166
+ <tr>
3167
+ <td>33</td><td> random </td> <td> 1 </td> <td> show the slides in random order (from iPhoto setting)
3168
+ </td> </tr>
3169
+ <tr>
3170
+ <td>34</td><td>showTitles </td> <td> 1 </td> <td> show slide captions (from iPhoto setting)
3171
+ </td> </tr>
3172
+ <tr>
3173
+ <td>35</td><td> transitionDirection </td> <td> 1 </td> <td> 0=none, 1=left-to-right, 2=right-to-left, 3=top-to-bottom, 4=bottom-to-top (from iPhoto setting)
3174
+ </td></tr>
3175
+ <tr>
3176
+ <td>36</td><td> slideDuration </td><td> 4 </td> <td> in seconds (from iPhoto setting)
3177
+ </td> </tr>
3178
+ <tr>
3179
+ <td>40</td><td> transitionDuration </td> <td> 4 </td> <td> in milliseconds (from iPhoto setting)
3180
+ </td> </tr>
3181
+ <tr>
3182
+ <td>44</td><td> unk7 </td> <td> 4 </td> <td> unknown, seems to always be 0
3183
+ </td> </tr>
3184
+ <tr>
3185
+ <td>48</td><td> unk8 </td> <td> 4 </td><td> unknown, seems to always be 0
3186
+ </td> </tr>
3187
+ <tr>
3188
+ <td>52</td><td> dbid2 </td> <td> 8 </td> <td> dbid2 of track in iTunesDB to play during slideshow (from iPhoto setting)
3189
+ </td> </tr>
3190
+ <tr><td>60</td><td> prev playlist id </td><td> 4 </td><td> the id of the previous playlist<br>
3191
+ <p>Seems generated by this formula: value of the same field in the previous photo album MHBA + number of photos of the previous photo album + 1<br>
3192
+ In particular, this formula is valid starting from the second album: in fact, the value of this field for the library is 100, and for the first photo album is 101.<br>
3193
+ Example: if the first album contains 50 photos, the value of this field in the second album will be 152.
3194
+ </p>
3195
+ </td></tr>
3196
+ <tr>
3197
+ <td colspan="4"> rest of header is zero
3198
+ </td></tr></tbody></table>
3199
+ <p>The MHBA has several children: The first is a MHOD containing the album name (which is ignored if the MHBA is the Photo Library). After that there are several MHIAs that define which image to show in that album. The MHBA that is marked as Photo Library contains one MHIA record for every photo on the iPod.
3200
+ </p><p>On the new video iPods and nanos of recent vintage, the MHBA has a second MHOD as a child which contains a string of which specifies the transition effect configured in iPhoto for the slideshow associated with this album. Apparently, the iPod ignores the slideshow settings that come from iPhoto, except for the slideshow soundtrack.
3201
+ </p>
3202
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Photo_Database&action=edit&section=9" title="ITunesDB/Photo Database">edit</a>]</div><a name="Album_Item_2"></a><h3>Album Item</h3>
3203
+ <table border="1" cellpadding="5" cellspacing="0">
3204
+ <caption><b>mhia format</b>
3205
+ </caption>
3206
+ <tbody><tr>
3207
+ <th style="background:#efefef;"> field
3208
+ </th><th style="background:#efefef;"> size
3209
+ </th><th style="background:#efefef;"> value
3210
+ </th></tr>
3211
+ <tr>
3212
+ <td> header identifier </td><td> 4 </td><td> mhia
3213
+ </td></tr>
3214
+ <tr>
3215
+ <td> header length </td><td> 4 </td><td> size of the mhia header (0x28)
3216
+ </td></tr>
3217
+ <tr>
3218
+ <td> total length? </td><td> 4 </td><td> probably the size of the header and all child records; as there aren't any child records this is equal to header length (40)
3219
+ </td></tr>
3220
+ <tr>
3221
+ <td> unk1 </td><td> 4 </td><td> seems to be zero
3222
+ </td></tr>
3223
+
3224
+ <tr>
3225
+ <td> image id </td><td> 4 </td><td> the id of the mhii record this mhia refers to
3226
+ </td></tr>
3227
+ <tr>
3228
+ <td colspan="3"> rest of header is zero
3229
+ </td></tr></tbody></table>
3230
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Photo_Database&action=edit&section=10" title="ITunesDB/Photo Database">edit</a>]</div><a name="File_List"></a><h3>File List</h3>
3231
+ <table border="1" cellpadding="5" cellspacing="0">
3232
+ <caption><b>mhlf format</b>
3233
+
3234
+ </caption>
3235
+ <tbody><tr>
3236
+ <th style="background:#efefef;"> field
3237
+ </th><th style="background:#efefef;"> size
3238
+ </th><th style="background:#efefef;"> value
3239
+ </th></tr>
3240
+ <tr>
3241
+ <td> header identifier </td><td> 4 </td><td> mhlf
3242
+ </td></tr>
3243
+
3244
+ <tr>
3245
+ <td> header length </td><td> 4 </td><td> size of the mhlf header (0x5c)
3246
+ </td></tr>
3247
+ <tr>
3248
+ <td> number of files </td><td> 4 </td><td> the total number of files in the File List
3249
+ </td></tr>
3250
+ <tr>
3251
+
3252
+ <td colspan="3"> rest of header is zero padded
3253
+ </td></tr></tbody></table>
3254
+ <p>The File List has Files (Images) as its children.
3255
+ </p>
3256
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Photo_Database&action=edit&section=11" title="ITunesDB/Photo Database">edit</a>]</div><a name="File_.28Image.29"></a><h3>File (Image)</h3>
3257
+ <table border="1" cellpadding="5" cellspacing="0">
3258
+ <caption><b>mhif format</b>
3259
+ </caption>
3260
+ <tbody><tr>
3261
+ <th style="background:#efefef;"> field
3262
+ </th><th style="background:#efefef;"> size
3263
+ </th><th style="background:#efefef;"> value
3264
+ </th></tr>
3265
+ <tr>
3266
+ <td> header identifier </td><td> 4 </td><td> mhif
3267
+ </td></tr>
3268
+ <tr>
3269
+ <td> header length </td><td> 4 </td><td> size of the mhif header (0x7c)
3270
+ </td></tr>
3271
+
3272
+ <tr>
3273
+ <td> total length </td><td> 4 </td><td> size of the header and all child records
3274
+ </td></tr>
3275
+ <tr>
3276
+ <td> unknown1 </td><td> 4 </td><td> always seems to be 0
3277
+ </td></tr>
3278
+ <tr>
3279
+
3280
+ <td> correlation id </td><td> 4 </td><td> used to link this entry with a file and an Image Name, see Image Name for more details.
3281
+ </td></tr>
3282
+ <tr>
3283
+ <td> image size </td><td> 4 </td><td> size of the image in bytes. A full sized thumbnail is 39,200 bytes, a 'Now Playing' thumbnail is 6,272 bytes on the iPod Photo/Color. On the iPod Nano, a full sized thumbnail is 20,000 bytes while a 'Now Playing' thumbnail is 3,528 bytes.
3284
+ </td></tr>
3285
+ <tr>
3286
+ <td colspan="3"> rest of header is zero padded
3287
+ </td></tr></tbody></table>
3288
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Photo_Database&action=edit&section=12" title="ITunesDB/Photo Database">edit</a>]</div><a name="Data_Object_2"></a><h3>Data Object</h3>
3289
+ <p>The MHODs found in the ArtworkDB and Photo Database files are significantly different than those found in the normal iTunesDB files.
3290
+ </p>
3291
+ <table border="1" cellpadding="5" cellspacing="0">
3292
+ <caption><b>mhod format</b>
3293
+ </caption>
3294
+ <tbody><tr>
3295
+ <th style="background:#efefef;"> offset
3296
+ </th><th style="background:#efefef;"> field
3297
+ </th><th style="background:#efefef;"> size
3298
+ </th><th style="background:#efefef;"> value
3299
+ </th></tr>
3300
+
3301
+ <tr>
3302
+ <td> 0 </td><td> header identifier </td><td> 4 </td><td> mhod
3303
+ </td></tr>
3304
+ <tr>
3305
+ <td> 4 </td><td> header length </td><td> 4 </td><td> size of the MHOD header (0x18)
3306
+ </td></tr>
3307
+ <tr>
3308
+
3309
+ <td> 8 </td><td> total length </td><td> 4 </td><td> size of the header and content, including child records
3310
+ </td></tr>
3311
+ <tr>
3312
+ <td> 12 </td><td> type </td><td> 2 </td><td> type of the MHOD, see below
3313
+ </td></tr>
3314
+ <tr>
3315
+ <td> 14 </td><td> unknown </td><td> 1 </td><td> unknown, always 0 so far
3316
+ </td></tr>
3317
+ <tr>
3318
+ <td> 15 </td><td> padding length </td><td> 1 </td><td> all MHODs must be zero-padded so that the length is a multiple of 4, this field contains the number of padding bytes added (e.g. 0, 1, 2 or 3). <font color="darkred">WARNING!</font> This field was always set to 2 for a while. To avoid parser crash, the best way is to ignore it when parsing.
3319
+ </td></tr>
3320
+ <tr>
3321
+ <td> 16 </td><td colspan="3"> rest of header is zero padded
3322
+ </td></tr></tbody></table>
3323
+ <p>There are 2 groups of types of MHODs in the ArtworkDB: container MHODs contain a MHNI as a child, while 'normal' string MHODs contain a string.
3324
+ </p><p><b>Attention</b>: Sometimes seems that the MHBAs in the new video and nano iPods' Photo Database have a second MHOD child which, although being identified by a type of 2, is a string (and not container) MHOD. This second string MHOD in photo album is usually found in Photo Database files generated on Macs, probably by iPhoto, and contains an UTF-8 string describing a transition effect such as "Dissolve". However in Photo Database files generated on PCs for example by iTunes 6 for an iPod video 30Gb this does not happen, and there is only one type-1 string MHOD as child, just like with iPod Photo/Color Photo Database files.
3325
+ </p>
3326
+ <table border="1" cellpadding="5" cellspacing="0">
3327
+ <caption><b>MHOD types</b>
3328
+ </caption>
3329
+ <tbody><tr>
3330
+ <th style="background:#efefef;"> type
3331
+ </th><th style="background:#efefef;"> group
3332
+ </th><th style="background:#efefef;"> description
3333
+ </th></tr>
3334
+ <tr>
3335
+ <td> 1 </td><td> string </td><td> Album name (in the Photo Database)
3336
+ </td></tr>
3337
+ <tr>
3338
+ <td> 2 </td><td> container </td><td> Thumbnail image
3339
+ </td></tr>
3340
+ <tr>
3341
+ <td> 3 </td><td> string </td><td> File name
3342
+ </td></tr>
3343
+ <tr>
3344
+ <td> 5 </td><td> container </td><td> Full Resolution image (in the Photo Database)
3345
+ </td></tr></tbody></table>
3346
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Photo_Database&action=edit&section=13" title="ITunesDB/Photo Database">edit</a>]</div><a name="Container_MHODs"></a><h4>Container MHODs</h4>
3347
+ <p>MHODs with type 2 contain a MHNI that (contains a type 3 MHOD that) references a thumbnail. MHODs with type 5 contain a MHNI that (contains a type 3 MHOD that) references a full resolution image (in the Photo Database).
3348
+ </p>
3349
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Photo_Database&action=edit&section=14" title="ITunesDB/Photo Database">edit</a>]</div><a name="String_MHODs"></a><h4>String MHODs</h4>
3350
+ <p>The content of string MHODs (probably all types except 2 and 5, although only 1 and 3 have been observed so far) is structured again with something like a sub-header:
3351
+ </p>
3352
+ <table border="1" cellpadding="5" cellspacing="0">
3353
+ <caption><b>string mhod content format</b>
3354
+ </caption>
3355
+ <tbody><tr>
3356
+ <th style="background:#efefef;"> field
3357
+ </th><th style="background:#efefef;"> size
3358
+ </th><th style="background:#efefef;"> value
3359
+ </th></tr>
3360
+ <tr>
3361
+ <td> string length </td><td> 4 </td><td> length in bytes of the string (e.g. after encoding)
3362
+ </td></tr>
3363
+ <tr>
3364
+ <td> unknown </td><td> 4 </td><td> might be the string encoding: 0,1 == UTF-8; 2 == UTF-16-LE. Observed values are: 1 in type 1 MHODs and 2 in type 3 MHODs.
3365
+ </td></tr>
3366
+ <tr>
3367
+ <td> unknown </td><td> 4 </td><td> always zero?
3368
+ </td></tr>
3369
+ <tr>
3370
+ <td> content </td><td> variable </td><td> the actual, encoded string content
3371
+ </td></tr>
3372
+
3373
+ <tr>
3374
+ <td> padding </td><td> 0..3 </td><td> zero to three bytes of padding to get the length of the whole MHOD to a multiple of 4, note that this is not included in the string length but <b>is</b> included in the total length
3375
+ </td></tr></tbody></table>
3376
+ <p><br>
3377
+ </p>
3378
+ <div align="right"><small>→ <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/ITunesDB/Misc._Files" title="ITunesDB/Misc. Files">Subpage: Misc. Files</a></small></div>
3379
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Misc._Files&action=edit&section=1" title="ITunesDB/Misc. Files">edit</a>]</div><a name="iTunesSD_file"></a><h2>iTunesSD file</h2>
3380
+ <p>The iTunesSD file is in a big-endian byte order. It consists of a header followed by a bunch of entries, one after the other. The format is much simpler than the iTunesDB. Only the iPod Shuffle is known to use this file at the moment. The Shuffle uses only this file for playing songs, but nevertheless a valid iTunesDB must be present on the device. When connecting to iTunes, only the iTunesDB is read back, not the iTunesSD.
3381
+ </p>
3382
+ <table border="1" cellpadding="5" cellspacing="0">
3383
+ <caption><b>iTunesSD header format</b>
3384
+ </caption>
3385
+ <tbody><tr>
3386
+ <th style="background:#efefef;"> field
3387
+ </th><th style="background:#efefef;"> size
3388
+ </th><th style="background:#efefef;"> value
3389
+ </th></tr>
3390
+ <tr>
3391
+ <td> num songs </td><td> 3 </td><td> Number of song entries in the file.
3392
+ </td></tr>
3393
+ <tr>
3394
+ <td> unknown </td><td> 3 </td><td> 0x010600? iTunes 7.2 puts 0x010800 here
3395
+ </td></tr>
3396
+ <tr>
3397
+ <td> header size </td><td> 3 </td><td> size of the header (0x12, 18 byte header)
3398
+ </td></tr>
3399
+ <tr>
3400
+ <td> unknown </td><td> 9 </td><td> possibly zero padding
3401
+ </td></tr>
3402
+ <tr>
3403
+ <td colspan="3"> rest of header is NOT zero padded
3404
+ </td></tr></tbody></table>
3405
+ <table border="1" cellpadding="5" cellspacing="0">
3406
+ <caption><b>iTunesSD song entry format</b>
3407
+ </caption>
3408
+ <tbody><tr>
3409
+ <th style="background:#efefef;"> field
3410
+ </th><th style="background:#efefef;"> size
3411
+ </th><th style="background:#efefef;"> value
3412
+ </th></tr>
3413
+ <tr>
3414
+ <td> size of entry </td><td> 3 </td><td> Always 0x22e (558 bytes)
3415
+ </td></tr>
3416
+ <tr>
3417
+ <td> unk1 </td><td> 3 </td><td> unknown (always 0x5aa501&nbsp;?)
3418
+ </td></tr>
3419
+ <tr>
3420
+ <td> starttime </td><td> 3 </td><td> Start Time, in 256 millisecond increments - e.g. 60 seconds = 0xea (234 dec). The reason for this is that the iPodShuffle has only a simplistic "clock". Every millisecond it increments an 8 bit counter. When the counter overflows, this causes an interrupt or something like that which causes it to increment this "clock" value. Very simple clock, easy to do in a an 8-bit register. Basically multiply whatever value you find here by 0.256 to convert it to seconds. Leaving this as zero means it plays from the beginning of the file.
3421
+ </td></tr>
3422
+ <tr>
3423
+ <td> unk2 </td><td> 3 </td><td> unknown (always 0?)
3424
+ </td></tr>
3425
+ <tr>
3426
+ <td> unk3 </td><td> 3 </td><td> Unknown, but seems to be associated with start time (start time of 0xea resulted in unk3 = 0x1258ee)
3427
+ </td></tr>
3428
+ <tr>
3429
+ <td> stoptime </td><td> 3 </td><td> Stop Time, also in 256 millisecond increments - e.g. 120 seconds = 0x1d4 (468 dec). Leaving this as zero means it'll play to the end of the file.
3430
+ </td></tr>
3431
+ <tr>
3432
+ <td> unk4 </td><td> 3 </td><td> unknown
3433
+ </td></tr>
3434
+ <tr>
3435
+ <td> unk5 </td><td> 3 </td><td> Unknown, but seems to be associated with stop time (stop time of 0x1d4 resulted in unk5 = 0x24a830)
3436
+ </td></tr>
3437
+ <tr>
3438
+ <td> volume </td><td> 3 </td><td> Volume - ranges from 0x00 (-100%) to 0x64 (0%) to 0xc8 (100%)
3439
+ </td></tr>
3440
+ <tr>
3441
+ <td> file_type </td><td> 3 </td><td> 0x01 = MP3, 0x02 = AAC, 0x04 = WAV
3442
+ </td></tr>
3443
+ <tr>
3444
+ <td> unk6 </td><td> 3 </td><td> 0x200?
3445
+ </td></tr>
3446
+ <tr>
3447
+ <td> filename </td><td> 522 </td><td> filename of the song, padded at the end with 0's, in UTF-16. Note: forward slashs are used here, not colons like in the iTunesDB - for example "/iPod_Control/Music/F00/Song.mp3".
3448
+ </td></tr>
3449
+ <tr>
3450
+ <td> shuffleflag </td><td> 1 </td><td> If this value is 0x00, the song will be skipped in while the player is in shuffle mode. Any other value (iTunes uses 0x01) will allow it be played in both normal and shuffle modes. By default, iTunes 4.7.1 sets this flag to 0x00 for audiobooks (.m4b and .aa), so they aren't played in shuffle mode.
3451
+ </td></tr>
3452
+ <tr>
3453
+ <td> bookmarkflag </td><td> 1 </td><td> If this value is 0x00, the song will not be bookmarkable (i.e. its playback position won't be saved when switching to a different song). Any other value will make it bookmarkable. Unlike hard drive based iPods, all songs can be marked as bookmarkable - not just .m4b and .aa. However, iTunes might not use this bookmark information for songs other than actual audiobooks. By default, iTunes 4.7.1 sets this flag to 0x01 for audiobooks (.m4b and .aa), and 0x00 for everything else.
3454
+ </td></tr>
3455
+ <tr>
3456
+ <td> unknownflag </td><td> 1 </td><td> This has never been observed to be anything other than 0x00, and setting it other values seemed to no effect.
3457
+ </td></tr></tbody></table>
3458
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Misc._Files&action=edit&section=2" title="ITunesDB/Misc. Files">edit</a>]</div><a name="iTunesStats_File"></a><h2>iTunesStats File</h2>
3459
+ <p>This seems to be the equivalent of the "Play Counts" file, where the Shuffle stores data that iTunes reads back in. Strangely, this file *is* byte reversed (little-endian). So a decimal 18 would be represented as 0x12 0x00 0x00, for example.
3460
+ </p>
3461
+ <table border="1" cellpadding="5" cellspacing="0">
3462
+ <caption><b>iTunesStats header format</b>
3463
+ </caption>
3464
+ <tbody><tr>
3465
+ <th style="background:#efefef;"> offset
3466
+ </th><th style="background:#efefef;"> field
3467
+ </th><th style="background:#efefef;"> size
3468
+ </th><th style="background:#efefef;"> value
3469
+ </th></tr>
3470
+ <tr>
3471
+ <td> 0 </td><td> num songs </td><td> 3 </td><td> Number of song entries in the file (same as number of songs on the iPod Shuffle).
3472
+ </td></tr>
3473
+ <tr>
3474
+ <td> 3 </td><td> unknown </td><td> 3 </td><td> zero padding?
3475
+ </td></tr></tbody></table>
3476
+ <table border="1" cellpadding="5" cellspacing="0">
3477
+ <caption><b>iTunesStats song entry format</b>
3478
+ </caption>
3479
+ <tbody><tr>
3480
+ <th style="background:#efefef;"> offset
3481
+ </th><th style="background:#efefef;"> field
3482
+ </th><th style="background:#efefef;"> size
3483
+ </th><th style="background:#efefef;"> value
3484
+ </th></tr>
3485
+ <tr>
3486
+ <td> 0 </td><td> size of entry </td><td> 3 </td><td> 0x12 (18 bytes)
3487
+ </td></tr>
3488
+ <tr>
3489
+ <td> 3 </td><td> bookmarktime </td><td> 3 </td><td> Bookmarked position in the song in 256 millisecond increments (e.g. 0xee -&gt; 60928 milliseconds = 60.928 seconds). If a song's playcount is zero, this field is 0xffffff. Otherwise, it is 0x0 or the bookmarked time.
3490
+ </td></tr>
3491
+ <tr>
3492
+ <td> 6 </td><td> unk1 </td><td> 3 </td><td> Somehow associated with bookmarktime (bookmarktime of 0x15f results in unk1 = 0x16db19, 0x1e4 -&gt; unk1 = 0x1f3215). Probably the same formatting as seen in iTunesSD unk3 &amp; unk5... Whatever the purpose, it doesn't seem to be used on the Shuffle - just supplying a valid bookmarktime works fine.
3493
+ </td></tr>
3494
+ <tr>
3495
+ <td> 9 </td><td> unk2 </td><td> 3 </td><td> always 0?
3496
+ </td></tr>
3497
+ <tr>
3498
+ <td> 12 </td><td> playcount </td><td> 3 </td><td> Number of times this track has played to the end.
3499
+ </td></tr>
3500
+ <tr>
3501
+ <td> 15 </td><td> skippedcount </td><td> 3 </td><td> Number of times that the user has skipped past this song before its end.
3502
+ </td></tr></tbody></table>
3503
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Misc._Files&action=edit&section=3" title="ITunesDB/Misc. Files">edit</a>]</div><a name="iTunesShuffle_File"></a><h2>iTunesShuffle File</h2>
3504
+ <p>This file contains a list of the track index numbers, one after another. Each number is 3 bytes in length, and in little endian byte order (reverse byte order).
3505
+ </p><p>The reason for this file is that it ensures that although the tracks are shuffled, they remain in the same order until you resync the iPodShuffle. That way you can turn the device on and off as many times as you like, and although the songs are shuffled, you can still back up and so forth.
3506
+ </p><p>iTunesShuffle can either be created by the application, or the iPod Shuffle will automatically create it when necessary. It can also be recreated on the Shuffle by pressing the play/pause button three times within one second, thus reshuffling the order of songs on the fly.
3507
+ </p><p>It also appears that the songs are automatically reshuffled if, while in shuffle playback mode, the player reaches the end of the playlist. So even if an application creates the iTunesShuffle file, the iPod Shuffle can and will replace it.
3508
+ </p>
3509
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Misc._Files&action=edit&section=4" title="ITunesDB/Misc. Files">edit</a>]</div><a name="iTunesPState_File"></a><h2>iTunesPState File</h2>
3510
+ <p>This file keeps track of the current playback state of the iPod shuffle. It contains seven 24-bit little endian values (i.e. 3 bytes per number, reverse byte order). The iPod re-creates the file with default if it is missing.
3511
+ </p>
3512
+ <table border="1" cellpadding="5" cellspacing="0">
3513
+ <caption><b>iTunesPState format</b>
3514
+ </caption>
3515
+ <tbody><tr>
3516
+ <th style="background:#efefef;"> field
3517
+ </th><th style="background:#efefef;"> size
3518
+ </th><th style="background:#efefef;"> value
3519
+ </th></tr>
3520
+ <tr>
3521
+ <td> volume </td><td> 3 </td><td> The current playback volume. 0x1d (29) is the default value. The maximum value is 0x26 (38), at least for the European model.
3522
+ </td></tr>
3523
+ <tr>
3524
+ <td> shufflepos </td><td> 3 </td><td> Current track number in the shuffle order. Value 0x00 denotes the first song. In normal playback mode, this value is equal to the entry number in the iTunesSD file (see next field).
3525
+ </td></tr>
3526
+ <tr>
3527
+ <td> trackno </td><td> 3 </td><td> Current track number in iTunesSD file order. Value 0x00 denotes the first song.
3528
+ </td></tr>
3529
+ <tr>
3530
+ <td> shuffleflag </td><td> 3 </td><td> 0x00 in ordered playback mode, 0x01 in shuffle mode.
3531
+ </td></tr>
3532
+ <tr>
3533
+ <td> trackpos </td><td> 3 </td><td> Current playback position inside the track, in bytes(?)
3534
+ </td></tr>
3535
+ <tr>
3536
+ <td> unk1 </td><td> 3 </td><td> high bits for trackpos?
3537
+ </td></tr>
3538
+ <tr>
3539
+ <td> unk2 </td><td> 3 </td><td> Always 0x01?
3540
+ </td></tr></tbody></table>
3541
+ <p><br>
3542
+ On some models this file is slightly different: it is 32 byte long and the volume field is 1 byte, not 3 (the rest - shifted accordingly). What's contained in the remainder of the file is unclear.
3543
+ </p>
3544
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Misc._Files&action=edit&section=5" title="ITunesDB/Misc. Files">edit</a>]</div><a name="iTunesControl_File"></a><h2>iTunesControl File</h2>
3545
+ <p>It is quite big (several MB), and has no obvious header identifier.<br>
3546
+ It seems to have a single data section written over and over again which equals 256 bytes each.<br>
3547
+ You can see a pattern in the hex data section of growing word values.
3548
+ </p><p><br>
3549
+ </p>
3550
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Misc._Files&action=edit&section=6" title="ITunesDB/Misc. Files">edit</a>]</div><a name="iTunesPrefs_File"></a><h2>iTunesPrefs File</h2>
3551
+ <p>It seems to have a fixed length of 236 bytes.
3552
+ </p>
3553
+ <table border="1" cellpadding="5" cellspacing="0">
3554
+ <caption><b>iTunesPrefs format</b></caption>
3555
+ <tbody><tr>
3556
+ <th style="background:#efefef;"> offset</th>
3557
+ <th style="background:#efefef;"> field</th>
3558
+ <th style="background:#efefef;"> size</th>
3559
+ <th style="background:#efefef;"> value</th>
3560
+ </tr>
3561
+ <tr><td>0</td><td> header identifier </td><td> 4 </td><td> frpd (0x66 0x72 0x70 0x64) </td></tr>
3562
+ <tr><td>4</td><td> unk1 </td><td> 1 </td><td> 01?</td></tr>
3563
+ <tr><td>5</td><td> unk2 </td><td> 1 </td><td> 00?</td></tr>
3564
+ <tr><td>6</td><td> unk3 </td><td> 1 </td><td> 03?</td></tr>
3565
+ <tr><td>7</td><td> unk4 </td><td> 1 </td><td> 00?</td></tr>
3566
+ <tr><td>8</td><td> iPod set up </td><td> 1 </td><td> 0x00: iTunes has not set up iPod, 0x01: iTunes has set up iPod. Checked by iTunes to determine whether to present iPod set up dialog box.</td></tr>
3567
+ <tr><td>9</td><td> Open iTunes when attached </td><td> 1 </td><td> Open iTunes when iPod is Attached, 01 for checked. </td></tr>
3568
+ <tr><td>10</td><td> Manual/Automatic Sync flag</td><td> 1 </td><td> 00 appears to be "Manually manage my songs", 01 appears to be "Automatic Sync"</td></tr>
3569
+ <tr><td>11</td><td> Sync Type</td><td> 1 </td><td> 01 Entire Library, 02 Selected Playlists </td></tr>
3570
+ <tr><td>12</td><td> iTunes Music Library Link Identifier </td><td> 8 </td><td> 8 byte identifier of the last iTunes library synced to this iPod. Checked by iTunes to prevent automatic updates when you connect the iPod to other computers with iTunes/Libraries</td></tr>
3571
+ <tr><td>20</td><td> unk10 </td><td> 4 </td><td> unknown, possibly part of unk11</td></tr>
3572
+ <tr><td>24</td><td> unk11 </td><td> 4 </td><td> unknown, possibly part of unk10</td></tr>
3573
+ <tr><td>28</td><td> unk12 </td><td> 1 </td><td> 00? Various flags of some kind?</td></tr>
3574
+ <tr><td>29</td><td> unk13 </td><td> 1 </td><td> 00?</td></tr>
3575
+ <tr><td>30</td><td> unk14 </td><td> 1 </td><td> 01?</td></tr>
3576
+ <tr><td>31</td><td> Enable Disk Use </td><td> 1 </td><td> 00 for disabling disk use, 01 to enabling disk use.</td></tr>
3577
+ <tr><td>32</td><td> unk16 </td><td> 1 </td><td> 00?</td></tr>
3578
+ <tr><td>33</td><td> unk17 </td><td> 1 </td><td> 01?</td></tr>
3579
+ <tr><td>34</td><td> Update Checked </td><td> 1 </td><td> 01 for only update checked songs. </td></tr>
3580
+ <tr><td>35</td><td> unk19 </td><td> 1 </td><td> 01?</td></tr>
3581
+ <tr><td>36</td><td> unk20 </td><td> 1 </td><td> 01?</td></tr>
3582
+ <tr><td>37</td><td> padding? </td><td> 12 </td><td> zero padding?</td></tr>
3583
+ <tr><td>49</td><td> Show Artwork</td><td> 1 </td><td> 1 for Show Artwork in Ipod</td></tr>
3584
+ <tr><td>50</td><td> padding? </td><td> 2 </td><td> zero padding?</td></tr>
3585
+ <tr><td>52</td><td> Synchronize Photos</td><td> 1</td><td> Synchronize Photos with iPod</td></tr>
3586
+ <tr><td>53</td><td> unk21 </td><td> 2 </td><td> 0x2010?</td></tr>
3587
+ <tr><td>55</td><td> Store Hi-res photos on iPod </td><td> 1 </td><td>1 for yes, 0 for no.</td></tr>
3588
+ <tr><td>56</td><td> padding? </td><td> 16 </td><td> zero padding?</td></tr>
3589
+ <tr><td>72</td><td> Transcode </td><td> 1 </td><td> 01 For Transcode higher bitrate songs to 128 AAC (Shuffle only)</td></tr>
3590
+ <tr><td>73</td><td> Keep Ipod in the source list</td><td>1</td><td> Keep this ipod in the source list, 1 for true (Shuffle only?)</td></tr>
3591
+ <tr><td>74</td><td> unk23 </td><td> 15 </td><td> A bunch of other flags?</td></tr>
3592
+ <tr><td>89</td><td> Selected Podcast Sync Only</td><td>1</td><td> 0x01 = Sync All Podcasts, 0x02 = Sync Selected Podcasts Only</td></tr>
3593
+ <tr><td>90</td><td> Manual/Automatic Podcast Sync</td><td>1</td><td> 0x00 = Manually Manage Podcasts (selected flag is meaningless in this case), 0x01 = Autosync podcasts</td></tr>
3594
+ <tr><td>91</td><td> unk24 </td><td> 5 </td><td> Five other flags? </td></tr>
3595
+ <tr><td>96</td><td> Identifier? </td><td> 8 </td><td> Same 8 byte ID as before</td></tr>
3596
+ <tr><td>104</td><td> songs on ipod </td><td> 2 </td><td> Somehow related to the songs / disc space allowed on the shuffle. Setting songs to 0 or setting filespace to 0 sets this to 0. (0x2000 for non-shuffles?)</td></tr>
3597
+ <tr><td>106</td><td> filespace saved on ipod </td><td> 2 </td><td>Somehow related to the songs / disc space allowed on the shuffle. Setting filespace to 0 sets this to 0. (0x0000 for non-shuffles?)</td></tr>
3598
+ <tr><td>108</td><td> padding? </td><td> 8 </td><td> zero padding?</td></tr>
3599
+ <tr><td>116</td><td> Do not ask again flags </td><td> 4 </td><td> Various flags set when user checks "Do not ask again" in warning dialogs</td></tr>
3600
+ <tr><td>120</td><td> padding? </td><td> 4 </td><td> zero padding?</td></tr>
3601
+ <tr><td>124</td><td> Sound Check </td><td> 1 </td><td> Use sound Check (shuffle only setting? Perhaps for transcoding purposes?) </td></tr>
3602
+ <tr><td>125</td><td> padding? </td><td> 111 </td><td> zero padding? undetermined flags?</td></tr>
3603
+ </tbody></table>
3604
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Misc._Files&action=edit&section=7" title="ITunesDB/Misc. Files">edit</a>]</div><a name="winPrefs_File"></a><h2>winPrefs File</h2>
3605
+ <p>It seems to have a fixed length of 16 bytes.
3606
+ </p>
3607
+ <table border="1" cellpadding="5" cellspacing="0">
3608
+ <caption><b>winPrefs format</b>
3609
+ </caption>
3610
+ <tbody><tr>
3611
+ <th style="background:#efefef;"> field
3612
+ </th><th style="background:#efefef;"> size
3613
+ </th><th style="background:#efefef;"> value
3614
+ </th></tr>
3615
+ <tr>
3616
+ <td> header identifier </td><td> 4 </td><td> frpw (0x66 0x72 0x70 0x77)
3617
+ </td></tr>
3618
+ <tr>
3619
+ <td> unk1 </td><td> 4 </td><td> Unknown.
3620
+ </td></tr>
3621
+ <tr>
3622
+ <td> unk2 </td><td> 4 </td><td> Unknown.
3623
+ </td></tr>
3624
+ <tr>
3625
+ <td> unk3 </td><td> 4 </td><td> Unknown.
3626
+ </td></tr></tbody></table>
3627
+ <p><br>
3628
+ </p>
3629
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Misc._Files&action=edit&section=8" title="ITunesDB/Misc. Files">edit</a>]</div><a name="DeviceInfo_File"></a><h2>DeviceInfo File</h2>
3630
+ <p>This file has info on the iPod user's computer.<br>
3631
+ It seems to have a fixed length of 1536 bytes.<br>
3632
+ Each field is zero padded and in UTF-16LE text format.
3633
+ </p>
3634
+ <table border="1" cellpadding="5" cellspacing="0">
3635
+ <caption><b>DeviceInfo format</b>
3636
+ </caption>
3637
+ <tbody><tr>
3638
+ <th style="background:#efefef;"> field
3639
+ </th><th style="background:#efefef;"> size
3640
+ </th><th style="background:#efefef;"> value
3641
+ </th></tr>
3642
+ <tr><td> Length of iPod name </td><td> 2 </td><td> The length in symbols (not in bytes) of the string immediately following. </td></tr>
3643
+ <tr><td> iPod name </td><td> 510 </td><td> The ipod name as defined in iTunes.</td></tr>
3644
+ <tr><td> Length of User name </td><td> 2 </td><td> The length in symbols (not in bytes) of the string immediately following. </td></tr>
3645
+ <tr><td> User name </td><td> 510 </td><td> The logged on username who last used the iPod with iTunes.</td></tr>
3646
+ <tr><td> Length of Computer name </td><td> 2 </td><td> The length in symbols (not in bytes) of the string immediately following. </td></tr>
3647
+ <tr><td> Computer name </td><td> 510 </td><td> The name of the computer who used the iPod.</td></tr>
3648
+ </tbody></table>
3649
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Misc._Files&action=edit&section=9" title="ITunesDB/Misc. Files">edit</a>]</div><a name="iEKInfo_File"></a><h2>iEKInfo File</h2>
3650
+ <p>New file I found recently on a 3G iPod. Unknown purpose. The file looks to be big endian, and similar to the chapter info records found inside podcasts with chapters (as well as similar to the chapter info structures found in the iTunesDB file. One odd characteristic is that the file appears to contain no 4 character identifier at the beginning. Similar in structure to standard MPEG 4 metadata layouts.
3651
+ </p><p><a href="http://web.archive.org/web/20080414195734/http://www.adg.us/article188.html" class="external" title="http://www.adg.us/article188.html" rel="nofollow">some more information on the structure of this file</a><span class="urlexpansion">&nbsp;(<i>http://www.adg.us/article188.html</i>)</span>
3652
+ </p><p>Info copied from above webpage (adg.us):
3653
+ </p>
3654
+ <pre>FILE HEADER:
3655
+ ============
3656
+ &lt;uint32&gt; - Size of file data (excluding this 64-byte header)
3657
+ &lt;60-zero-bytes&gt; - Padding?
3658
+ FILE DATA BEGINS HERE:
3659
+ ======================
3660
+ &lt;12-zero-bytes&gt; - Padding?
3661
+ &lt;ATOM:"sean"&gt;
3662
+ &lt;uint32&gt; - ID/number (should be 1)
3663
+ &lt;uint32&gt; - No. of subatoms (should be at least 3)
3664
+ &lt;uint32&gt; - Four zero bytes
3665
+ &lt;ATOM:"sym "&gt;
3666
+ &lt;uint32&gt; - ID/number (should be 1)
3667
+ &lt;uint32&gt; - No. of subatoms ("sess" subatoms) - I expect it should be
3668
+ at least 1
3669
+ &lt;uint32&gt; - Four zero bytes
3670
+ ONE OR MORE "sess" ATOMS:
3671
+ =========================
3672
+ &lt;ATOM:"sess"&gt;
3673
+ &lt;uint32&gt; - Session ID - Used to identify which keys are encrypted
3674
+ with this session
3675
+ &lt;uint32&gt; - No. of subatoms - Should be 2 (one "valu" subatom, one
3676
+ "index" subatom)
3677
+ &lt;uint32&gt; - Four zero bytes
3678
+ &lt;ATOM:"valu"&gt;
3679
+ &lt;uint32&gt; - ID/number (should be 1)
3680
+ &lt;uint32&gt; - No. of subatoms (should be zero)
3681
+ &lt;uint32&gt; - Four zero bytes
3682
+ &lt;128 bytes of binary data&gt; - The session key or something???
3683
+ &lt;128 zero bytes&gt; - I don't know if all sessions are structured
3684
+ this way or not... These last 128 bytes
3685
+ are ignored for playback purposes.
3686
+ --- ("valu")
3687
+ &lt;ATOM:"indx"&gt;
3688
+ &lt;uint32&gt; - ID/number (should be 1)
3689
+ &lt;uint32&gt; - No. of subatoms (should be zero)
3690
+ &lt;uint32&gt; - Four zero bytes
3691
+ &lt;uint32&gt; - Every index I've seen thus far has the value six
3692
+ ('6') here. Changing this broke playback on my
3693
+ iPod, so it's important for playback.
3694
+ --- ("indx")
3695
+ --- ("sess")
3696
+ ===
3697
+ --- ("sym ")
3698
+ &lt;ATOM:"user"&gt;
3699
+ &lt;uint32&gt; - User ID (a.k.a. DSID)
3700
+ &lt;uint32&gt; - Number of keys, or no. of "key " subatoms
3701
+ &lt;uint32&gt; - Four zero bytes
3702
+ ONE OR MORE "key " ATOMS:
3703
+ =========================
3704
+ &lt;ATOM:"key "&gt;
3705
+ &lt;uint32&gt; - Key ID or key number
3706
+ &lt;uint32&gt; - Number of subatoms (should be 1)
3707
+ &lt;uint32&gt; - Four zero bytes
3708
+ &lt;ATOM:"valu"&gt;
3709
+ &lt;uint32&gt; - Session ID used to encrypt this key's contents
3710
+ &lt;uint32&gt; - No. of subatoms (Should be zero)
3711
+ &lt;uint32&gt; - Four zero bytes
3712
+ &lt;16 bytes of binary data&gt; - The key data, encrypted with the
3713
+ specified session?
3714
+ --- ("valu")
3715
+ --- ("key")
3716
+ ===
3717
+ --- ("user")
3718
+ THREE "guid" ATOMS: (Are there ever more?)
3719
+ ===================
3720
+ &lt;ATOM:"guid"&gt;
3721
+ &lt;uint32&gt; - GUID ID or number (should be one)
3722
+ &lt;uint32&gt; - Number of subatoms (should be zero)
3723
+ &lt;uint32&gt; - Four zero bytes
3724
+ &lt;GUID Data Bytes&gt; - 256 bytes for the first 'guid' atom...
3725
+ The first 9 bytes, if changed, appear to break playback on my
3726
+ iPod. The next three bytes contained data, but I could change
3727
+ it without breaking playback. Byte number 12 (position 11 if
3728
+ the first byte is at position zero) was 1 for a while on my
3729
+ iPod, but later was 2. I didn't check to see if this changed
3730
+ when I moved the iPod from one host computer to another.
3731
+ On a 4G iPod, the first 8 bytes of this field are the iPod's FireWire ID.
3732
+ --- ("guid")
3733
+ &lt;ATOM:"guid"&gt;
3734
+ &lt;uint32&gt; - GUID ID or number (should be two)
3735
+ &lt;uint32&gt; - Number of subatoms (should be zero)
3736
+ &lt;uint32&gt; - Four zero bytes
3737
+ &lt;GUID Data Bytes&gt; - 256 bytes for the second 'guid' atom...
3738
+ This has got to be a global unique identifier based on which
3739
+ host computer installation of iTunes the iPod is associated
3740
+ with. It changed when I moved my iPod from one of my host
3741
+ computers to another. But it didn't change when other
3742
+ playlist and/or authorization changes changed the 'sess'
3743
+ session atom. The last 128 bytes are all zero-bytes, and
3744
+ are ignored during playback. I was able to randomly change
3745
+ the last 128 bytes to anything without affecting playback.
3746
+ --- ("guid")
3747
+ &lt;ATOM:"guid"&gt;
3748
+ &lt;uint32&gt; - GUID ID or number (should be three)
3749
+ &lt;uint32&gt; - Number of subatoms (should be zero)
3750
+ &lt;uint32&gt; - Four zero bytes
3751
+ &lt;GUID Data Bytes&gt; - 4 bytes
3752
+ This is the final 'guid' atom, the last one, and yes, it's
3753
+ only 4 bytes long, containing probably a &lt;uint32&gt; value.
3754
+ It has been value six on my iPod. Changing it broke my
3755
+ iPod's ability to play audio files. I see that the value
3756
+ six shows up here, as well in the above 'indx' atom within
3757
+ the 'sess' atom. I can't help but think these two values
3758
+ may be related somehow.
3759
+ --- ("guid")
3760
+ ===
3761
+ --- ("sean")
3762
+ === FILE DATA ENDS HERE
3763
+ </pre>
3764
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Misc._Files&action=edit&section=10" title="ITunesDB/Misc. Files">edit</a>]</div><a name="WABContactsGroup_File"></a><h2>WABContactsGroup File</h2>
3765
+ <p>New file I found recently on a 3G iPod. Unknown purpose, although probably related to the new Contacts sync, given the name. Assuming that this may be different for people syncing to Outlook instead of to the Windows Address Book (WAB). The file is 56 bytes in size.
3766
+ </p>
3767
+ <table border="1" cellpadding="5" cellspacing="0">
3768
+ <caption><b>WABContactsGroup format</b>
3769
+ </caption>
3770
+ <tbody><tr>
3771
+ <th style="background:#efefef;"> field
3772
+ </th><th style="background:#efefef;"> size
3773
+ </th><th style="background:#efefef;"> value
3774
+ </th></tr>
3775
+ <tr><td> header identifier </td><td> 4 </td><td> frpd (0x66 0x72 0x70 0x64) (Yes, this matches the iTunesPrefs file identifier)</td></tr>
3776
+ <tr><td> padding? </td><td> 8 </td><td> zero padding</td></tr>
3777
+ <tr><td> unk1 </td><td> 4 </td><td> 0x04 02 00 00. Setting flags, perhaps? </td></tr>
3778
+ <tr><td> padding? </td><td> 40 </td><td> zero padding?</td></tr>
3779
+ </tbody></table>
3780
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Misc._Files&action=edit&section=11" title="ITunesDB/Misc. Files">edit</a>]</div><a name="iTunesLock_File"></a><h2>iTunesLock File</h2>
3781
+ <p>This file is created right before iTunes modifies or reads anything on the iPod, and is deleted when it is finished. Does not contain any data, and is probably only used to make sure only one program at a time tries accessing the important files on the iPod at one time.
3782
+ </p><p><br>
3783
+ </p>
3784
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Misc._Files&action=edit&section=12" title="ITunesDB/Misc. Files">edit</a>]</div><a name="PhotosFolderName"></a><h2>PhotosFolderName</h2>
3785
+ <p>Lists the watched folders watched and syncronized with the Ipod. Found on the iPod video (probably on the Photo as well). It is a very simple format with the length of the folder name, preceeded by the folder name in unicode letters.
3786
+ </p>
3787
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Misc._Files&action=edit&section=13" title="ITunesDB/Misc. Files">edit</a>]</div><a name="PhotoFolderPrefs"></a><h2>PhotoFolderPrefs</h2>
3788
+ <p>Stores Photo Folder preferences.
3789
+ </p><p><br>
3790
+ </p>
3791
+ <table border="1" cellpadding="5" cellspacing="0">
3792
+ <caption><b>PhotoFolderPrefs</b></caption>
3793
+ <tbody><tr>
3794
+ <th style="background:#efefef;"> offset</th>
3795
+ <th style="background:#efefef;"> field</th>
3796
+ <th style="background:#efefef;"> size</th>
3797
+ <th style="background:#efefef;"> value</th>
3798
+ </tr>
3799
+ <tr><td>0</td><td> header identifier </td><td> 4 </td><td> frpd same as iTunesPrefs</td></tr>
3800
+ <tr><td>4</td><td> unk1 </td><td> 4 </td><td> 01? </td></tr>
3801
+ <tr><td>8</td><td> unk2 </td><td> 4 </td><td> 01? </td></tr>
3802
+ <tr><td>12</td><td> unk3 </td><td> 4 </td><td>&nbsp;?</td></tr>
3803
+ <tr><td>16</td><td> unk3 </td><td> 80 </td><td> zero padding?</td></tr>
3804
+ <tr><td>96</td><td> folder name </td><td>&nbsp;?? </td><td>The watch folders names</td></tr>
3805
+ </tbody></table>
3806
+ <p><br>
3807
+ </p>
3808
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Misc._Files&action=edit&section=14" title="ITunesDB/Misc. Files">edit</a>]</div><a name="PhotoFolderAlbums"></a><h2>PhotoFolderAlbums</h2>
3809
+ <p>Stores Photo Albums .
3810
+ </p><p><br>
3811
+ </p>
3812
+ <table border="1" cellpadding="5" cellspacing="0">
3813
+ <caption><b>PhotoFolderAlbums</b></caption>
3814
+ <tbody><tr>
3815
+ <th style="background:#efefef;"> offset</th>
3816
+ <th style="background:#efefef;"> field</th>
3817
+ <th style="background:#efefef;"> size</th>
3818
+ <th style="background:#efefef;"> value</th>
3819
+ </tr>
3820
+ <tr><td>0</td><td> header identifier </td><td> 4 </td><td> frpd same as iTunesPrefs</td></tr>
3821
+ <tr><td>4</td><td> unk1 </td><td> 2 </td><td> 01? </td></tr>
3822
+ <tr><td>6</td><td> unk2 </td><td> 2 </td><td> 01? </td></tr>
3823
+ <tr><td>8</td><td> unk3 </td><td> 1 </td><td> 01? </td></tr>
3824
+ <tr><td>9</td><td> unk4 </td><td> 1 </td><td> 01? </td></tr>
3825
+ <tr><td>10</td><td> unk5 </td><td> 2 </td><td> 00? </td></tr>
3826
+ <tr><td>12</td><td> Number of Folders </td><td> 4 </td><td> Number of folders to that are directly below the folder pointed out in PhotoFolderPrefs. From offset 100 on, the folder name datastructure will repeat this many times.</td></tr>
3827
+ <tr><td>16</td><td> unk7 </td><td> 1 </td><td> 01? </td></tr>
3828
+ <tr><td>17</td><td> unk8 </td><td> 1 </td><td> 01? </td></tr>
3829
+ <tr><td>18</td><td> unk9 </td><td> 2 </td><td> 00? </td></tr>
3830
+ <tr><td>20</td><td> unk10 </td><td> 4 </td><td> 01?</td></tr>
3831
+ <tr><td>26</td><td> unk11 </td><td> 74 </td><td> zero padding?</td></tr>
3832
+ <tr><td>100</td><td>is synched</td><td>4</td><td>Whether or not the folder is synched. 1 if is, 0 if it isn't.</td></tr>
3833
+ <tr><td>104</td><td> string legnth </td><td> 2 </td><td> Length of the name of the albums to follow </td></tr>
3834
+ <tr><td>106</td><td> album name </td><td> 510 </td><td> Name of the album to follow </td></tr>
3835
+ <tr><td colspan="4">From 100-514 repeats as many times as in Number of folders (see offset 12)</td></tr>
3836
+ </tbody></table>
3837
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Misc._Files&action=edit&section=15" title="ITunesDB/Misc. Files">edit</a>]</div><a name="iTunesPlaylists"></a><h2>iTunesPlaylists</h2>
3838
+ <p><br>
3839
+ Keeps track of the iTunesPlaylists???
3840
+ </p><p><br>
3841
+ </p>
3842
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Misc._Files&action=edit&section=16" title="ITunesDB/Misc. Files">edit</a>]</div><a name="iTunesPodcasts"></a><h2>iTunesPodcasts</h2>
3843
+ <p><br>
3844
+ Keeps track of the iTunesPodcasts???
3845
+ </p><p><br>
3846
+ </p>
3847
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Misc._Files&action=edit&section=17" title="ITunesDB/Misc. Files">edit</a>]</div><a name="iTunesVideoPlaylists"></a><h2>iTunesVideoPlaylists</h2>
3848
+ <p><br>
3849
+ Keeps track of the iTunesVideoPlaylists???
3850
+ </p>
3851
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Misc._Files&action=edit&section=18" title="ITunesDB/Misc. Files">edit</a>]</div><a name="Preferences"></a><h2>Preferences</h2>
3852
+ <p>Located at /iPod_Control/Device/Preferences.
3853
+ </p>
3854
+ <table border="1" cellpadding="5" cellspacing="0">
3855
+ <caption><b>Preferences</b></caption>
3856
+ <tbody><tr>
3857
+ <th style="background:#efefef;"> offset</th>
3858
+ <th style="background:#efefef;"> field</th>
3859
+ <th style="background:#efefef;"> size</th>
3860
+ <th style="background:#efefef;"> value</th>
3861
+ </tr>
3862
+ <tr><td>0x6BC (1724)</td><td>DST-Setting (3g nano)</td><td> 1 </td><td>Set to 0x3C (=60) if DST is set. Otherwise 0x00</td></tr>
3863
+ <tr><td>2808</td><td>Language Selection</td><td> 1 </td><td>Defines the menu language selected in your iPod doing Settings-&gt;Language. English is 0.</td></tr>
3864
+ <tr><td>2832</td><td>Timezone Information</td><td> 1 </td><td>Timezone information.</td></tr>
3865
+ <tr><td>0xB50 (2896)</td><td>Volume Limit</td><td> 1 </td><td>Volume limit value on firmware 1.1.1 for 5G and nano. Range: 0-64</td></tr>
3866
+ <tr><td>0xB70 (2928)</td><td>Region (3g nano)</td><td> 1 </td><td>Selected region/timezone: 0x4f = London, 0x55 = Zurich, 0x5d = Geneva ... Seen on 3g-Nano. This might also be used to calculate the timezone offset because changing the timezone from Geneva to London only changes this offset. (Or is it a bug? The Nano displays London as UTC-1 (!)</td></tr>
3867
+ </tbody></table>
3868
+ <p>I'm unsure what is the best way to parse the timezone information field, but the previous explanation that it's the timezone information in 30 minutes steps is wrong, it doesn't hold up during DST.
3869
+ Something that works is to substract 0x19 (this corresponds to UTC+0) to that value. The resulting value divided by 2 gives the timezone (in hours), and the less significant bit (ie the resulting value modulo 2) indicates if DST is active or not (1 =&gt; DST active). When the DST bit is set, 1 hour must be added to the timezone value.
3870
+ </p><p><br><b>Example:</b>Selecting <i>Paris (DST)</i> will set this offset to 0x1c: (0x1c - 0x19) = 0x03
3871
+ 0x03 / 2 = 1
3872
+ 0x03 % 2 = 1
3873
+ which gives us a GMT+2 timezone
3874
+ </p>
3875
+ <div class="editsection" style="float:right;margin-left:5px;">[<a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB/Misc._Files&action=edit&section=19" title="ITunesDB/Misc. Files">edit</a>]</div><a name="_volumelocked"></a><h2>_volumelocked</h2>
3876
+ <p>Located at /iPod_Control/Device/
3877
+ </p><p>Exists when a 4-digit combination has been set for the Volume Limit on 5Gs and nanos (firmware 1.1.1). File length is 0x20. Appears to be encrypted? However, deleting the file removes the volume limit&nbsp;:-)
3878
+ </p><div class="printfooter">
3879
+ Retrieved from "<a href="./ITunesDB - wikiPodLinux_files/ITunesDB - wikiPodLinux.html">http://ipodlinux.org/ITunesDB</a>"</div>
3880
+ <div id="catlinks"><p class="catlinks"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=Special:Categories&article=ITunesDB" title="Special:Categories">Categories</a>: <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/Category:Documentation" title="Category:Documentation">Documentation</a> | <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/Category:Development" title="Category:Development">Development</a></p></div> <!-- end content -->
3881
+ <div class="visualClear"></div>
3882
+ </div>
3883
+ </div>
3884
+ </div>
3885
+ <div id="column-one">
3886
+ <div id="p-cactions" class="portlet">
3887
+ <h5>Views</h5>
3888
+ <ul>
3889
+ <li id="ca-nstab-main" class="selected"><a href="./ITunesDB - wikiPodLinux_files/ITunesDB - wikiPodLinux.html" accesskey="c" title="View the content page [alt-c]">Article</a></li><li id="ca-talk"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/Talk:ITunesDB" accesskey="t" title="Discussion about the content page [alt-t]">Discussion</a></li><li id="ca-edit"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB&action=edit" accesskey="e" title="You can edit this page. Please use the preview button before saving. [alt-e]">Edit</a></li><li id="ca-history"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=ITunesDB&action=history" accesskey="h" title="Past versions of this page. [alt-h]">History</a></li> </ul>
3890
+ </div>
3891
+ <div class="portlet" id="p-personal">
3892
+ <h5>Personal tools</h5>
3893
+ <div class="pBody">
3894
+ <ul>
3895
+ <li id="pt-login"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=Special:Userlogin&returnto=ITunesDB" accesskey="o" title="You are encouraged to log in, it is not mandatory however. [alt-o]">Create an account or log in</a></li> </ul>
3896
+ </div>
3897
+ </div>
3898
+ <div class="portlet" id="p-logo">
3899
+ <a style="background-image: url(/web/20080414195734im_/http://ipodlinux.org/stylesheets/images/wiki.png);" href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/Main_Page" title="Main Page"></a>
3900
+ </div>
3901
+ <script type="text/javascript"> if (window.isMSIE55) fixalpha(); </script>
3902
+ <div class="portlet" id="p-nav">
3903
+ <h5>Navigation</h5>
3904
+ <div class="pBody">
3905
+ <ul><li> <a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/Main_Page" title="Main Page">Main Page</a>
3906
+ </li><li> <a href="http://web.archive.org/web/20080414195734/http://www.ipodlinux.org/forums" class="external" title="http://www.ipodlinux.org/forums" rel="nofollow">Forums</a><span class="urlexpansion">&nbsp;(<i>http://www.ipodlinux.org/forums</i>)</span>
3907
+ </li><li> <a href="http://web.archive.org/web/20080414195734/http://ipl.nonb.org/report/1" class="external" title="http://ipl.nonb.org/report/1" rel="nofollow">Requests/Bugs</a><span class="urlexpansion">&nbsp;(<i>http://ipl.nonb.org/report/1</i>)</span>
3908
+ </li><li> <a href="http://web.archive.org/web/20080414195734/http://www.ipodlinux.org/blog" class="external" title="http://www.ipodlinux.org/blog" rel="nofollow">Dev Blog</a><span class="urlexpansion">&nbsp;(<i>http://www.ipodlinux.org/blog</i>)</span>
3909
+ </li></ul>
3910
+ <hr>
3911
+ <ul><li><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/Documentation" title="Documentation">Documentation</a>
3912
+ </li><li><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/Downloads" title="Downloads">Downloads</a>
3913
+ </li><li><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/Screenshots" title="Screenshots">Screenshots</a>
3914
+ </li><li><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/Contributors" title="Contributors">Contributors</a>
3915
+ </li><li><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/Links" title="Links">Links</a>
3916
+ </li><li><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/Donations" title="Donations">Donations</a>
3917
+ </li></ul>
3918
+ <hr>
3919
+ <ul><li><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/Special:Recentchanges" title="Special:Recentchanges">Recent Changes</a>
3920
+ </li><li><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/Special:Allpages" title="Special:Allpages">All Pages</a>
3921
+ </li><li><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/Special:Randompage" title="Special:Randompage">Random Page</a>
3922
+ </li><li><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/Help:Contents" title="Help:Contents">Help</a>
3923
+ </li></ul>
3924
+ <hr>
3925
+ <ul><li><span class="plainlinks"><a href="http://web.archive.org/web/20080414195734/http://www.google.com/custom?sa=Google+Search&cof=S%3Ahttp%3A%2F%2Fwww.ipodlinux.org%3BVLC%3Apurple%3BAH%3Acenter%3BBGC%3Awhite%3BLH%3A141%3BLC%3Ablue%3BL%3Ahttp%3A%2F%2Fipodlinux.org%2Fstylesheets%2Fimages%2Fwiki.png%3BALC%3Ablue%3BLW%3A128%3BT%3Ablack%3BAWFID%3A70a74ab66f4d59ae%3B&domains=ipodlinux.org&sitesearch=ipodlinux.org" class="external" title="http://www.google.com/custom?sa=Google Search&amp;cof=S:http://www.ipodlinux.org;VLC:purple;AH:center;BGC:white;LH:141;LC:blue;L:http://ipodlinux.org/stylesheets/images/wiki.png;ALC:blue;LW:128;T:black;AWFID:70a74ab66f4d59ae;&amp;domains=ipodlinux.org&amp;sitesearch=ipodlinux.org" rel="nofollow"><b><font color="blue">G</font><font color="red">o</font><font color="orange">o</font><font color="blue">g</font><font color="green">l</font><font color="red">e</font></b> Search</a><span class="urlexpansion">&nbsp;(<i>http://www.google.com/custom?sa=Google+Search&amp;cof=S%3Ahttp%3A%2F%2Fwww.ipodlinux.org%3BVLC%3Apurple%3BAH%3Acenter%3BBGC%3Awhite%3BLH%3A141%3BLC%3Ablue%3BL%3Ahttp%3A%2F%2Fipodlinux.org%2Fstylesheets%2Fimages%2Fwiki.png%3BALC%3Ablue%3BLW%3A128%3BT%3Ablack%3BAWFID%3A70a74ab66f4d59ae%3B&amp;domains=ipodlinux.org&amp;sitesearch=ipodlinux.org</i>)</span></span>
3926
+ </li></ul>
3927
+ </div>
3928
+ </div>
3929
+ <div id="p-search" class="portlet">
3930
+ <h5><label for="searchInput">Search</label></h5>
3931
+ <div class="pBody">
3932
+ <form name="searchform" action="http://web.archive.org/web/20080414195734/http://ipodlinux.org/Special:Search" id="searchform">
3933
+ <input id="searchInput" name="search" type="text" accesskey="f" value="">
3934
+ <input type="submit" name="go" class="searchButton" id="searchGoButton" value="Go">&nbsp;<input type="submit" name="fulltext" class="searchButton" value="Search">
3935
+ </form>
3936
+ </div>
3937
+ </div>
3938
+ <div class="portlet" id="p-tb">
3939
+ <h5>Toolbox</h5>
3940
+ <div class="pBody">
3941
+ <ul>
3942
+ <li id="t-whatlinkshere"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=Special:Whatlinkshere&target=ITunesDB" accesskey="j" title="List of all wiki pages that link here [alt-j]">What links here</a></li>
3943
+ <li id="t-recentchangeslinked"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/index.php?title=Special:Recentchangeslinked&target=ITunesDB" accesskey="k" title="Recent changes in pages linked from this page [alt-k]">Related changes</a></li>
3944
+ <li id="t-specialpages"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/Special:Specialpages" accesskey="q" title="List of all special pages [alt-q]">Special pages</a></li> </ul>
3945
+ </div>
3946
+ </div>
3947
+ </div><!-- end of the left (by default at least) column -->
3948
+ <div class="visualClear"></div>
3949
+ <div id="footer">
3950
+ <div id="f-poweredbyico"><a href="http://web.archive.org/web/20080414195734/http://www.mediawiki.org/"><img src="./ITunesDB - wikiPodLinux_files/poweredby_mediawiki_88x31.png" alt="MediaWiki"></a></div> <div id="f-copyrightico"><a href="http://web.archive.org/web/20080414195734/http://sourceforge.net/"><img src="./ITunesDB - wikiPodLinux_files/sflogo.php" width="88" height="31" border="0" alt="SourceForge.net Logo"></a></div> <ul id="f-list">
3951
+ <li id="f-lastmod"> This page was last modified 18:55, 26 Apr 2007.</li> <li id="f-viewcount">This page has been accessed 152902 times.</li> <li id="f-copyright">Content is available under <a href="http://web.archive.org/web/20080414195734/http://www.gnu.org/copyleft/fdl.html" class="external" title="http://www.gnu.org/copyleft/fdl.html" rel="nofollow">GNU Free Documentation License 1.2</a>.</li> <li id="f-about"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/iPodLinux:About" title="iPodLinux:About">About wikiPodLinux</a></li> <li id="f-disclaimer"><a href="http://web.archive.org/web/20080414195734/http://ipodlinux.org/iPodLinux:General_disclaimer" title="iPodLinux:General disclaimer">Disclaimers</a></li> </ul>
3952
+ </div>
3953
+ </div>
3954
+ <!-- Served by cpanel2.sys-techs.net in 0.75 secs. -->
3955
+ <script src="./ITunesDB - wikiPodLinux_files/urchin.js" type="text/javascript">
3956
+ </script>
3957
+ <script type="text/javascript">
3958
+ _uacct = "UA-102329-4";
3959
+ urchinTracker();
3960
+ </script>
3961
+
3962
+ <!-- Cached 20080414170411 -->
3963
+
3964
+ <iframe src="./ITunesDB - wikiPodLinux_files/index.html" style="display:none"></iframe>
3965
+ <iframe src="./ITunesDB - wikiPodLinux_files/index.html" style="display:none"></iframe>
3966
+
3967
+
3968
+
3969
+
3970
+
3971
+ <!--
3972
+ FILE ARCHIVED ON 19:57:34 Apr 14, 2008 AND RETRIEVED FROM THE
3973
+ INTERNET ARCHIVE ON 15:59:38 Mar 3, 2013.
3974
+ JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
3975
+
3976
+ ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
3977
+ SECTION 108(a)(3)).
3978
+ -->
3979
+ <img id="feedlyMiniIcon" title="feedly mini" style="position: fixed; bottom: 14px; right: 14px; z-index: 99; cursor: pointer; border: 0px; -webkit-transition: opacity 0.3s ease; visibility: visible; width: 24px; height: 24px; max-height: 24px; max-width: 24px; overflow: hidden; display: block; padding: 0px; opacity: 0.35;" width="24" height="24" src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAYlJREFUeNrMVD1rwlAUPfkwBBxFKQQlDhmjqzj4F9w7FfwThZaW9n8UnDrrn1BEXNTBRQQhEE1ERRR0Sd990A7VaKJJ6YHzEu4N99z3zrsRGo2GAuCF8YFRQzSwGOuM7zJb3hgfES2o0SdGSWRLDfGhRgLpGAXS4q0VCoUCBEHwzd8skM/nUSqVoCjKybz8O1CtVn2LeZ4H27YxnU6xXC6x3+95PJPJoFKpoN1uY7vdnhfww3w+x3A4xGaz4d3quo5sNvuTTyaTXKTb7cJ13csCzWbzKKaqKj/zXC4HSZKO8iRcLpcxGAwwmUzC7UDTNBSLRSQSiVAeyUGNpM4v4XA4oNfr8eMMLJBKpWCaJn9fLBawLAur1Qq73Y6b/H0pyNyrTDYMA7PZDKPRCOv1+uQ3ZCqZe9UcOI6DTqfjW5zMbLVa3Bu6RaE9GI/HZ/P9fp8/qfipYROj+ukEnuQgEx0GImKGHGSC//UO/kTAibG+QwIfMQrUyeRXusaM94x3ERW2GT8Zn78EGACRmoKUJhB1TQAAAABJRU5ErkJggg=="></body></html>