Fwd: mdbackup binary plist files
From: Aaron Burghardt <[EMAIL PROTECTED]> Date: July 19, 2008 4:13:44 PM EDT To: Ryan Chapman <[EMAIL PROTECTED]> Cc: cocoa-dev@lists.apple.com Subject: Re: mdbackup binary plist files On Jul 16, 2008, at 11:15 PM, Ryan Chapman wrote: NSLog(@"%s", plist); You were so close :-) The plist is an object, not a char string, so the above should have been: NSLog(@"%@", plist); Aaron ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: mdbackup binary plist files
On Jul 16, 2008, at 8:15 PM, Ryan Chapman wrote: Hopefully there is someone here who knows something about binary plist files. When an iPhone's firmware is upgraded in iTunes, a framework called MobileSync creates a backup of the iPhone's data files. The backup is stored in .mdbackup files, in ~/Library/Application Support/MobileSync// I've found that the .mdbackup files are Apple binary plists (the magic is bplist00, followed by 0xD4), however any attempts to read the files give the error "Conversion of data failed. The file is not UTF-8, or in the encoding specified in XML header if XML." The plists are encoded in base-64. You can use this to decode them: http://code.google.com/p/iphone-backup-decoder/ (Found via Craig Hockenberry on Twitter) smime.p7s Description: S/MIME cryptographic signature ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: mdbackup binary plist files
On Wed, Jul 16, 2008 at 11:15 PM, Ryan Chapman <[EMAIL PROTECTED]> wrote: > Hopefully there is someone here who knows something about binary plist > files. When an iPhone's firmware is upgraded in iTunes, a framework called > MobileSync creates a backup of the iPhone's data files. The backup is > stored in .mdbackup files, in ~/Library/Application > Support/MobileSync// > I've found that the .mdbackup files are Apple binary plists (the magic is > bplist00, followed by 0xD4), however any attempts to read the files give the > error "Conversion of data failed. The file is not UTF-8, or in the encoding > specified in XML header if XML." I've tried the Property List Editor and > the code below: > > #import > #import > > int main(int argc, char **argv) > { >NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; > >NSString *path = @"./file42.mdbackup"; >NSData *plistData; >NSString *error; >NSPropertyListFormat format; >id plist; >plistData = [NSData dataWithContentsOfFile:path]; > >plist = [NSPropertyListSerialization propertyListFromData:plistData >mutabilityOption:NSPropertyListImmutable >format:&format >errorDescription:&error]; >if(!plist) >{ >NSLog(error); >[error release]; >} >NSLog(@"%s", plist); >[pool release]; >return 0; > } > > > Is there are way to use the Cocoa classes to read this type of binary plist, > or am I stuck with straight C? If C is the only way, does anyone have a > file structure (format) reference for binary plists? NSPropertyListSerialization can read binary plists with no trouble, so the fact that it doesn't work indicates that either your code is broken or the file isn't really a binary plist, despite looking like it is. Your code looks just fine, but I would recommend stepping through it in the debugger (if you haven't already) to make sure everything looks the way it should. In particular, make sure that it's really reading the file you think it is, and that the data you get is correct. The format is available, although cryptic. A description can be found here: http://www.cocoadev.com/index.pl?CrossPlatformPropertyListOrArchive At the bottom of that page you'll find links to a working implementation which, incidentally, I helped write. It's possible that this code will read your file, and if it doesn't then it may illuminate what's wrong with it. Mike ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
mdbackup binary plist files
Hopefully there is someone here who knows something about binary plist files. When an iPhone's firmware is upgraded in iTunes, a framework called MobileSync creates a backup of the iPhone's data files. The backup is stored in .mdbackup files, in ~/Library/Application Support/MobileSync// I've found that the .mdbackup files are Apple binary plists (the magic is bplist00, followed by 0xD4), however any attempts to read the files give the error "Conversion of data failed. The file is not UTF-8, or in the encoding specified in XML header if XML." I've tried the Property List Editor and the code below: #import #import int main(int argc, char **argv) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSString *path = @"./file42.mdbackup"; NSData *plistData; NSString *error; NSPropertyListFormat format; id plist; plistData = [NSData dataWithContentsOfFile:path]; plist = [NSPropertyListSerialization propertyListFromData:plistData mutabilityOption:NSPropertyListImmutable format:&format errorDescription:&error]; if(!plist) { NSLog(error); [error release]; } NSLog(@"%s", plist); [pool release]; return 0; } Is there are way to use the Cocoa classes to read this type of binary plist, or am I stuck with straight C? If C is the only way, does anyone have a file structure (format) reference for binary plists? Thanks Ryan ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]