MaxiHuHe04 / iTunes-Backup-Explorer

A graphical tool that can extract and replace files from encrypted and non-encrypted iOS backups
MIT License
457 stars 37 forks source link

Unable to access SMS db (malformed) #17

Closed zzph closed 1 year ago

zzph commented 1 year ago

Hi,

Awesome work on this project- thank you.

When I try to open /HomeDomain/Library/SMS/sms.db, it tells me "database disk image is malformed".

So I tried: sqlite3 sms.db > .tables > ERROR: database disk image is malformed

I tried to take a dump to remove any issues- sqlite3 sms.db ".dump" | sqlite3 new.db but kept getting no such table errors such as main.chat_handle_join.

Any ideas on how to fix this issue?

MaxiHuHe04 commented 1 year ago

Hi! It seems like the sms.db file often makes problems. I don't know why. In my backups, they work just fine and I haven't found any other corrupted files yet. That makes it hard to debug. I could imagine that the database wasn't saved in a consistent state before the backup. Have you tried the .recover command instead of .dump like recommended in #1? Apparently, .clone has also worked for others: https://github.com/mvt-project/mvt/issues/25#issuecomment-883991015.

zzph commented 1 year ago

Brilliant- that's the solve, using .recover.

So that's:

sqlite3 sms.db ".recover" | sqlite3 new.db

Again, thanks so much for the great work on this project