skw4y / iTunesBackupFileExtractor

Simple app that extract media files contained in iTunes backup.
38 stars 7 forks source link

System Overflow #1

Open azib4213 opened 10 years ago

azib4213 commented 10 years ago

Hello,

Attached is the screenshot of the technical problem I faced. Don't really know what to do to correct it. Thank you. capture

skw4y commented 10 years ago

Hello azib and thank you for your interest.

Can you tell me when this exception happens? Is it after or before the launch of the extraction?

azib4213 commented 10 years ago

Hello,

It happens after the launch of the extraction.

On Wednesday, September 3, 2014 6:35 AM, skw4y notifications@github.com wrote:

Hello azib and thank you for your interest. Can you tell me when this exception happens? Is it after or before the launch of the extraction? — Reply to this email directly or view it on GitHub.

skw4y commented 10 years ago

Ok. Do you know if the extraction continues after the exception? Are there any files present in the output folder?

It's weird, I've never experienced this exception. Maybe you can try to copy a part of your iTunes backup files in a new directory (+ the Manifest.mbdb file), select the new directory as your iTunes backup folder and launch the extraction again.

tredontho commented 9 years ago

I know this issue is forever old, but I ran this just today and had the same issue. It seems like the extraction does not continue, and it's occurring because the GetLength method in MbdbExtract.cs returns a negative number for a stream that is processes. I pretty much just changed it to return 0 in the case that either of firstBye or secByte are negative. I don't know that this is correct, but it was just a workaround. After that, I was still getting an issue with one of the FilePath's containing a null byte '\0' in the code that was filtering down the files to extract based on extension.

Even fixing that, I wasn't able to get it to work, but hopefully (if this is still maintained/used) that sheds a little light on things?

skw4y commented 9 years ago

Hello Trevor,

Thanks for your interest and the additional informations. This project is still maintained but unfortunately I recently switched to Android and I don't have iTunes backups anymore. :(

The purpose of the class MbdbExtract is to extract the name of the saved files contained in the file Manifest.mbdb. If your stream is empty you will not manage to extract the filenames even if you change the value of the first two bytes. ;) If you reach this point I suppose that the mbdb file is present in your iTunes backup and contains something. But maybe the file is corrupted ?

I tested this project with IOS 5 & IOS6 backups but the structure of the Manifest.mbdb file may have changed... Which IOS version are you using ?

If you can send me this file I could maybe look at it and see if I can reproduce this issue.

Khaddar commented 8 years ago

I've spent a bit of time trying to get this working today and think the negative buffer lengths are a red herring - for me they occur because the stream pointer gets pushed beyond the end of the manifest file due to getting out of step with the record length bytes.

In particular this seems to be caused by some additional attributes in the manifest, which may be new since IOS6, relating to encoding changes and image attributes. These get added as either prefix or additional suffix entries for file records and don't have the same suffix structure as the files themselves, so NextFile() leaves the pointer in the wrong place.

I have a modified version of MbdbExtract.cs which I'll upload as soon as I figure out how to. This isn't necessarily either a comprehensive or ideal fix, but has allowed me to process IOS8 manifests successfully.

Khaddar commented 8 years ago

Not sure I've done this right, but I've created a fork, committed my changes to that fork and created a pull request (hopefully) back to your master. And yes, I appreciate this is an old issue and you're potentially not interested in updating it, but hopefully it will help someone else as your original helped me greatly today. Merci bien skw4y.