Restoring file systems from iTunes backups

I’ve been reading lots of interesting information about iTunes and IOS, so I thought I would investigate, just what is in an iTunes backup.  Typically, on OS X, you can find your iTunes backup here, under the appropriate OS X user profile:

/Library/Application Support/MobileSync/Backup

When you look at the backup, it’s a giant list of 40 character hexadecimal file names.   After doing some quick reading on theiphonewiki.com, those file names are SHA-1 hashes.  Each of the files, is a backed-up file from the iPhone.   The problem of restoring the file system then is that we need to find the original file names from the hashes.

Luckily, Apple provides an index.  There is a file called “Manifest.mbdb” which is a binary index of all the SHA-1 files.  There is a pretty good description of the format of that file here.   After reading the Manifest.mbdb into memory, we have enough information to generate all the SHA-1 hashes.  From there, we can match the generated hashes to the filenames on the file system, and we have enough information to regenerate the backed-up filesystem.

Once we have the file system, it’s interesting to look around and find out what information was actually backed-up.  Here’s some highlights:

  • SMS messages:  “Library/SMS/sms.db”.  This is a sqlite database.
  • Address Book: “Library/AddressBook/AddressBook.sqlitedb”.  sqlite database.
  • Notes: “Library/notes/notes.sqlite”.  sqlite database.
  • Call History: “Library/CallHistory/call_history.db”. sqlite database.
  • Photos: “Media/DCIM/”.  File systems of JPG files.
  • SMS photos: “Library/SMS/Attachments”. File system of JPG files.
  • Safari bookmarks: “Library/Safari/Bookmarks.db”.  sqlite database.

I have working proof of concept code, however, in the interest of being a good guy, I’m keeping it private.

 

Similar Posts

  • Release builds resulting from Log4j

    There are new release builds for some of the more widely used khubla.com libraries, resulting for patching for the log4j vulnerability. They are: ParadoxReader <groupId>com.khubla.pdxreader</groupId><artifactId>pdxreader</artifactId><version>1.6</version><packaging>jar</packaging> OLMReader <groupId>com.khubla.olmreader</groupId><artifactId>olmreader</artifactId><version>1.9.0</version><packaging>jar</packaging> JVMBasic kPascal

  • AGC Grammar

    Every IT geek is, to some degree, fascinated with the Apollo program which put a human on the moon for the first time.  Naturally, there is also curiosity about the computers on the Apollo moon lander, and the software that ran on them.  The source code that went to the moon is available now, and…

  • pdp-7 Unix

    Unix version 0 was written in 1963 by Ken Thompson, on a PDP-7.  Recently, the source code code Unix V0 has been discovered, and you can read it here, as pdf scans of printouts.  You can read about the discovery, and the effort to boot Unix V0 on a real PDP-7 here.  The project home…

  • Cross-Compiler fun

    I’ve been interested in OS development for a while, and now have a prototypical ARM OS on my private source tree.  For that I used gcc-arm-embedded, which worked quite well.  However, as time went on, i became interested in building my own tool chains.  I started with this list of requirements An up-to-date C/C++ compiler,…

  • Building QEMU

    In general, I install QEMU on my Macbook using MacPorts.  However I recently had a need to get the tip of the QEMU development tree. Getting the QEMU source tree is trivial: git clone git://git.qemu-project.org/qemu.git I needed an updated version of dtc: git submodule update –init dtc The build instructions from the README are: mkdir…

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.