IOS Mobile device has a media database file, this file holds the current device media information, such as music, video, e-book, Ringtones and so on, are kept here, nonsense not to say more
ITUNESCDB is a binary file, which is organized with nodes, each node contains specific information, such as node type, nod size, number of child nodes, and so on. It's kind of like XML, but unlike XML, XML is closed.
Open this file with the binary editor to see
MHBD Head
The first four bytes of the binary file mhbd is an identity, according to the specific identity of the different parsing, when the resolution as long as the care of their own needs of the field, the other do not understand the field read out and save it. Here's a look at the fields I'm interested in when I parse
1) 4-byte header ID MHBD
2) 4 bytes of head length
3) Total length of 4 bytes
If you are parsing, just pay attention to these three fields.
M_stridentify = binaryreader.readstring (4);
Validateheader ("MHBD");
M_iheadsize = Binaryreader.readint32 ();
int itotalsize = Binaryreader.readint32 ();
ITUNESCDB file is from the beginning of the MHBD header, MHBD section to save the real media data, but this section of the data is compressed, that is, after the zip compression, so to parse the words must first read out, Then unzip it with a zip to restore the data. How to read section content
int isectionsize = itotalsize- m_iheadsize//Get the length of section
Binaryreader.seek (m_iheadsize, Seek_set); Move the file pointer to the beginning of the section
byte* pdatabuffer = new byte[isectionsize];
Binaryreader.read (pdatabuffer,isectionsize); Read the section
After reading it, unzip it with zip to restore the data. There's time to go on back.
qq:2506314894