Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error trying to read bplist from iPhone backup database #10

Open
unformatt opened this issue Nov 17, 2020 · 1 comment
Open

Error trying to read bplist from iPhone backup database #10

unformatt opened this issue Nov 17, 2020 · 1 comment

Comments

@unformatt
Copy link
Contributor

unformatt commented Nov 17, 2020

I've extracted bplist data from a sqlite row of data from iTunes backup. When I try to parse it like this: BPListReader.plistWithString(bplist_str)

I get this error:

python2.7/site-packages/bplist/bplist.py", line 147, in __unpackItem
    obj_type, obj_info = (obj_header & 0xF0), (obj_header & 0x0F)
TypeError: unsupported operand type(s) for &: 'str' and 'int'

Did a little inspecting in pdb:

(Pdb) !type(obj_header)
<type 'str'>
(Pdb) !len(obj_header)
1
(Pdb) !obj_header
'\xd4'
(Pdb) !obj_type, obj_info = (obj_header & 0xF0), (obj_header & 0x0F)
*** TypeError: unsupported operand type(s) for &: 'str' and 'int'

I rather not share the bplist data since I don't what personal data is in it but If I save the bplist data to a file and preview in finder, it's able to parse the data:

with open('/temp/blist-test.plist', 'w') as f:
            f.write(bplist_str)

image

@farcaller
Copy link
Owner

I wonder if it's because some python typing changes – I last touched this code about 10 years ago and it seemed pretty stable.

I don't have a mac at hand to verify this right now but I wonder if

obj_header = self.data[offset]

should say

obj_header = ord(self.data[offset])

unformatt added a commit to unformatt/bplist-python that referenced this issue Nov 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants