diff --git a/Format documentation.md b/Format documentation.md index 008e1d0..0269304 100644 --- a/Format documentation.md +++ b/Format documentation.md @@ -22,7 +22,7 @@ File Sections A binary plist file has four sections: -1. The first 8 bytes are an identifier and always equal to 'bplist00'. +1. The first 8 bytes are an identifier, equal to 'bplistXX' where XX is two digits. 'bplist00' and 'bplist01' are known, I don't know the differences. 2. Second is all of the elements in the plist, encoded and concatenated. @@ -49,7 +49,7 @@ The final 32 bytes of a binary plist have the following format: 3. a 1 byte integer which is the number of bytes for an object reference number. Valid values are 1 or 2. Reference numbers are encoded as - unsigned, bug endian integers. + unsigned, big endian integers. 4. 4 bytes of \x00 padding diff --git a/bplistlib/classes.py b/bplistlib/classes.py index d4f25d9..295c1af 100644 --- a/bplistlib/classes.py +++ b/bplistlib/classes.py @@ -265,7 +265,7 @@ def encode_body(self, array, object_length): def decode_body(self, raw, object_length): """Decode the reference list into a flattened array.""" - format_ = self.format * object_length + format_ = self.endian + self.format * object_length array = unpack(format_, raw) return list(array)