George Garside Blog

If you find something useful on here, it's probably an accident.

Property lists, or plists, can contain data key-value pairs, which are binary property list files encoded in Base64. As they are, they’re impossible to parse and extract any meaningful data from. However, decoding them is very easy and you end up with a very nice looking pretty-printed property list file. Here’s how to decode data plist from a property list.

Decode data plist

  1. Extract the data from the plist file, using a text editor or other method of opening property list files.
    You should end up with a block of encoded data that looks something like this. Line breaks are unimportant here, as is superfluous whitespace at the beginning or end of a line. I’ve stripped the whitespace and the line breaks to produce this.

    YnBsaXN0MDDUAQIDBAUIKClUJHRvcFgkb2JqZWN0c1gkdmVyc2lvblkkYXJjaGl2ZXLRBgdUcm9vdIABqQkKDxkaGxwdJFUkbnVsbNILDA0OViRjbGFzc18QGk5TRm9udERlc2NyaXB0b3JBdHRyaWJ1dGVzgAiAAtMQCxESFRZaTlMub2JqZWN0c1dOUy5rZXlzohMUgAWABoAHohcYgAOABF8QE05TRm9udE5hbWVBdHRyaWJ1dGVfEBNOU0ZvbnRTaXplQXR0cmlidXRlXU1lbmxvLVJlZ3VsYXIiQUAAANIeHyAhWCRjbGFzc2VzWiRjbGFzc25hbWWjISIjXxATTlNNdXRhYmxlRGljdGlvbmFyeVxOU0RpY3Rpb25hcnlYTlNPYmplY3TSHh8lJ6ImI18QEE5TRm9udERlc2NyaXB0b3JfEBBOU0ZvbnREZXNjcmlwdG9yEgABhqBfEA9OU0tleWVkQXJjaGl2ZXIACAARABYAHwAoADIANQA6ADwARgBMAFEAWAB1AHcAeQCAAIsAkwCWAJgAmgCcAJ8AoQCjALkAzwDdAOIA5wDwAPsA/wEVASIBKwEwATMBRgFZAV4AAAAAAAACAQAAAAAAAAAqAAAAAAAAAAAAAAAAAAABcA==
  2. Decode this using a Base64 decoder, such as this one. Paste in the encoded data block from the plist and click Decode. This will download a .bin file entitled DecodedBase64.bin, the contents of which is as follows. This is a plist, but it’s not the standard XML plist — instead, it’s a binary plist, as denoted by the bplist at the beginning of the file. This has decoded some of the words in the data, but it’s still not very easy to understand.
    bplist00�()T$topX$objectsX$versionY$archiver�Troot��
    $U$null�
    V$class_NSFontDescriptorAttributes���ZNS.objectsWNS.keys�������_NSFontNameAttribute_NSFontSizeAttribute]Menlo-Regular"[email protected]��� !X$classesZ$classname�!"#_NSMutableDictionary\NSDictionaryXNSObject�%'�&#_NSFontDescriptor_NSFontDescriptor���_NSKeyedArchiver�����(�2�5�:�<�F�L�Q�X�u�w�y������������������������������������"+03FY^�������������*��������������p
  3. Open the DecodedBase64.bin file with TextMate. This pretty-prints the binary property list as an old-style key-value plist.
    TextMate pretty-printed plist full for decode data plist

    // !!! BINARY PROPERTY LIST WARNING !!!
    //
    // The pretty-printed property list below has been created
    // from a binary version on disk and should not be saved as
    // the ASCII format is a subset of the binary representation!
    //
    {	"$archiver" = "NSKeyedArchiver";
    "$objects" = (
    	"$null",
    	{	"$class" = :false;
    		NSFontDescriptorAttributes = :false;
    	},
    	{	"$class" = :false;
    		NS.keys = ( :false, :false );
    		NS.objects = ( :false, :false );
    	},
    	"NSFontNameAttribute",
    	"NSFontSizeAttribute",
    	"Menlo-Regular",
    	12,
    	{	"$classes" = ( "NSMutableDictionary", "NSDictionary", "NSObject" );
    		"$classname" = "NSMutableDictionary";
    	},
    	{	"$classes" = ( "NSFontDescriptor", "NSObject" );
    		"$classname" = "NSFontDescriptor";
    	},
    );
    "$top" = { root = :false; };
    "$version" = 100000;
    }

That’s it; that’s how you decode data plist from a plist file! The data is decoded as a normal-looking property list file which you can do whatever you wish with.