hackappcom / iloot

OpenSource tool for iCloud backup extraction
https://hackapp.com/
637 stars 201 forks source link

WindowsError (decryption problem ?) #24

Closed jetXS closed 9 years ago

jetXS commented 9 years ago

I got 2 iClouds account, this error is happening with one of them.

While downloading files:

Traceback (most recent call last): File "C:\Users\XXXX\Desktop\iloot-master\iloot.py", line 610, in <mod ule> download_backup(args.apple_id, args.password, args.output, args.item_types, args.snapshot, args.combined, args.itunes_style, args.domain) File "C:\Users\XXXX\Desktop\iloot-master\iloot.py", line 572, in down load_backup client.download(UDID, types) File "C:\Users\XXXX\Desktop\iloot-master\iloot.py", line 450, in down load self.authorize_get(authTokens, snapshot) File "C:\Users\XXXX\Desktop\iloot-master\iloot.py", line 261, in auth orize_get self.write_file(file, decrypted_chunks, snapshot) File "C:\Users\XXXX\Desktop\iloot-master\iloot.py", line 346, in writ e_file self.decrypt_protected_file(path, filekey, file.Attributes.DecryptedSize) File "C:\Users\XXXX\Desktop\iloot-master\iloot.py", line 380, in decr ypt_protected_file os.remove(oldpath) # Delete the encrypted file WindowsError: [Error 32] The process cannot access the file because it is being used by another process: u'output\xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\sna pshot_1/AppDomain-com.yourcompany.PPClient\Documents/transactionData_WithdrawFu ndxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.encrypted'

dfirfpi commented 9 years ago

In iloot.py, line 385, the code is not correcly indented. The line "os.remove(oldpath) # Delete the encrypted file" should be moved backward, aligned with "open(oldpath, "rb") as old_file:" otherwise, on Windows, the encrypted file handle is still opened and you can't remove the file.