import plistlib plistlib._BinaryPlistParser._unpatched_read_object = plistlib._BinaryPlistParser._read_object def patched_read_object(self, offset): self._fp.seek(offset) token = self._fp.read(1)[0] tokenH, tokenL = token & 0xF0, token & 0x0F if token == 0x80: return int.from_bytes(self._fp.read(1 << tokenL), 'big') else: return self._unpatched_read_object(offset) plistlib._BinaryPlistParser._read_object = patched_read_object