Krucifyr / iphone-dataprotection

Automatically exported from code.google.com/p/iphone-dataprotection
0 stars 0 forks source link

iOS 3 backups : exception error: bad magic #100

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
running backup_tool.py gives a "bad magic" exception error. is there a way to 
fix this, is it due to a corrupted backup or can it be fixed ?

Product Type : iPhone1,2 Product Version : 3.0.1 iTunes Version : 8.2.1 Extract 
backup to ../../840082f3b7523b50458ad0a5703308d8288b9ae9_extract ? (y/n) y 
Backup is encrypted Enter backup password : No BackupKeyBag? in manifest, 
assuming iOS 3.x backup Passphrase seems OK Traceback (most recent call last):

File "backup_tool.py", line 78, in <module>
main()
File "backup_tool.py", line 75, in main
extract_backup(backup_path, output_path)
File "backup_tool.py", line 34, in extract_backup
decrypt_backup3(backup_path, output_path, password)
File 
"/home/julien/Téléchargements/iphone_recover/iphone-dataprotection/python_scri
pts/backups/backup3.py", line 57, in decrypt_backup3
metadata = BPlistReader.plistWithString(metadata)
File 
"/home/julien/Téléchargements/iphone_recover/iphone-dataprotection/python_scri
pts/util/bplist.py", line 244, in plistWithString
return parser.parse()
File 
"/home/julien/Téléchargements/iphone_recover/iphone-dataprotection/python_scri
pts/util/bplist.py", line 209, in parse
raise Exception('Bad magic')
Exception: Bad magic

__________
Note: this version of backup_tool.py has been modified to fix a previous error:
File "backup_tool.py", line 78, in <module>
main()
File "backup_tool.py", line 75, in main
extract_backup(backup_path, output_path)
File "backup_tool.py", line 34, in extract_backup
decrypt_backup3(backup_path, output_path, password)
File 
"/home/julien/Téléchargements/iphone_recover/iphone-dataprotection/python_scri
pts/backups/backup3.py", line 56, in decrypt_backup3
metadata = decrypt_blob(mdinfo["Metadata"], auth_key)
File 
"/home/julien/Téléchargements/iphone_recover/iphone-dataprotection/python_scri
pts/backups/backup3.py", line 16, in decrypt_blob
len = struct.unpack(">H", blob[0:2])0?
AttributeError?: Data instance has no attribute 'getitem'

then on advice of Jean I changed  line 56 in python_scripts/backups/backup3.py 
to metadata = decrypt_blob(metadata, auth_key)

this fixed the "Data instance has no attribute 'getitem' " error but now gives 
a "bad magic" exception.

Original issue reported on code.google.com by david.is...@gmail.com on 22 Mar 2013 at 12:57

GoogleCodeExporter commented 8 years ago
Hi,
Try the attached patch, it should fix the error.
Thanks.

Original comment by jean.sig...@gmail.com on 22 Mar 2013 at 8:35

Attachments:

GoogleCodeExporter commented 8 years ago
This issue was closed by revision d67884c68fec.

Original comment by jean.sig...@gmail.com on 25 Mar 2013 at 10:00

GoogleCodeExporter commented 8 years ago
Issue 101 has been merged into this issue.

Original comment by jean.sig...@gmail.com on 25 Mar 2013 at 10:01