FORUMS
Remove All Ads from XDA

[TOOL] Whatsapp Xtract: Backup Messages Extractor / Database Analyzer / Chat-Backup

207 posts
Thanks Meter: 290
 
By ztedd, Senior Member on 5th April 2012, 07:13 AM
Post Reply Email Thread
12th March 2013, 01:17 AM |#511  
Junior Member
Thanks Meter: 0
 
More
hi all i face the same problem and here is my screenshot for the same :



Quote:
Originally Posted by ztedd

This looks like PyCrypto is not correctly installed.
Which versions of
- windows/linux/.. (I assume windows)
- ActivePython
Do you have?

Please download the newest archive, extract and then run install pyCrypto.bat again.

Now the window will stay open after executing the install commands. Make a screenshot of what it shows.

Then start whatsapp_xtract_console.bat
there you type:
python
then hit Enter. Then python shows something, then you type:
from Crypto.Cipher import AES

Make a screenshot of this as well. Send the screenshots here.

Attached Thumbnails
Click image for larger version

Name:	python.jpg
Views:	564
Size:	178.4 KB
ID:	1798194  
13th March 2013, 12:57 AM |#512  
Junior Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by Snapy1991

Hallo ,
Ich habe folgendes Problem, und zwar kann ich meine Backup Datei nicht mehr auf dem Handy wiederherstellen.Ich habe mein Handy formatiert und habe aber vorher den Whatsapp Ordner von der SD Karte auf den PC kopiert.Darin befindet sich im Ordner Databases die Datei msgstore.db.crypt.
Ich habe dann die Anleitung befolgt und es klappte alles bis zum Fehler :
Error sqlite3.Error while reading Chat #: database disk image is malformed
So habe ich dann deinen Rat befolgt :
- start whatsapp_xtract_console.bat and then type:
- echo .dump | sqlite3.exe msgstore.plain.db > Temp.sql
- echo .quit | sqlite3.exe -init Temp.sql msgstore_new.db
- python whatsapp_xtract.py msgstore_new.db

und konnte am Ende die Datei auf dem PC anzeigen und hatte die Verläufe zumindest auf dem PC.
Nun meine Frage: Kann ich nun irgendwie die msgstore.db.crypt Datei so reparieren und auf dem Handy wieder kopieren, damit Whatsapp auch die Nachrichten tatsächlich wiederherstellt oder kann ich sie nur maximal auf dem PC anzeigen lassen?Kannst du mir bitte sagen,welche Datei ich wohin genau verschieben soll?Denn es heißt ja im Normalfall,wenn es klappt die Datei msgstore.plain.db in den Whatsapp Ordner auf dem Handy kopieren und in msgstore.db umbenennen,jedoch wenn ich
whatsapp_xtract_android_crypted.bat
ausführe, entsteht ja der oben in rot angezeigte Fehler und die msgstore.plain.db Datei ensteht auch mit genau der gleichen Dateigröße wie die msgstore.db.crypt Datei.Nun als ich Whatsapp wieder installiert habe, fragte es mich,ob ich den Verlauf wiederherstellen will,ich bestätigte und es zeigte an,dass es Nachrichten wiederherstellt,jedoch waren keine Verläufe da und alles war weg.
Ich hoffe ihr habt verstanden was ich meine und hoffe, dass ihr mir helfen könnt, das wäre echt lieb.

Noch ein kleiner Nachtrag,wenn ich diese Befehle ausführe
- start whatsapp_xtract_console.bat and then type:
- echo .dump | sqlite3.exe msgstore.plain.db > Temp.sql
- echo .quit | sqlite3.exe -init Temp.sql msgstore_new.db
ensteht ja die msgstore_new.db Datei und die ist nur minimal kleiner als die msgstore.db oder msgstore.plain.db Datei und die ist ja dann die reparierete Datei oder? Und durch sie kann ich den Inhalt auf dem PC sehen und so erhalte ich ja auch die msgstore.db als HTML Datei. Müsste ich diese Datei umbennen und irgendwohin kopieren oder was muss ich jetzt genau machen,damit Whatsapp die Backup Datei wirklich richtig erkennt und die Nachrichten tatsächlich wiederherstellt?
Zur Zeit ist Whatsapp installiert,müsste ich es deinstallieren und vorher noch irgendwas sichern oder kopieren?
Vielen lieben Dank im Vorraus

I am a nativ german speaker and have exactly the same problem that Snappy has, so I will explain it:

I have 9 older backup files with dates (msgstore-2013-02-22.1.db.crypt) (Snappy has just msgstore.db.crypt). My phone (HTC Sensation) was in repair for a couple of weeks and I now tried to restore the WhatsApp Backup. It all worked fine till we got the following error: Error sqlite3.Error while reading Chat #13: database disk image is malformed
I tried it with all of my backup files and got the same error with the newest 5 of them - the others where not readable by the program at all. We both got msgstore.plain.db files but they were just about the same size as the crypt ones and although WhatsApp was able to find the databases it was not able to restore the chats. In my case I had all the groups and contacts but not a single message - and the plain file was about 11 MB, so this can't really be. Please help - I spent half a day now trying to solve the problem and I have no clue anymore...

Snappy tried all your advices and got the readable HTML file but this still didn't solve the problem - obviously - and he or she is mainly asking how to repair the plain file and where to save it so the backup would be restored and working.

Thank you very, very much for your help and this thread - I really, really hope you can help me/us!

Liz
13th March 2013, 01:26 AM |#513  
Junior Member
Thanks Meter: 0
 
More
if you don't speak or understand german i will try to text you in englisch so that you can help me because i need my chat.
Liz has translated my text and i want to give you a detailed description of my problem and the way how i tried to solve it so you can understand and follow my problem.
I have tried to restore my chat but Whatsapp didn't restore anything allthough the question appeared during the installation if i want to restore the chat and i accepted.
I have just the Whatsapp folder from sd card where the file msgstore.db.crypt is in the databases. I copied this file and overwrote the file in the xtract whatsapp folder.Than i started the !install pyCrypto file and executed the whatsapp_xtract_android_crypted file but the following error appeared:
Error sqlite3.Error while reading Chat #: database disk image is malformed
and i got the msgstore.plain db file which has exactly the same size like the msgstore.db.crypt file (5,439 KB)
Than i copied the msgstore.plain db file again to the folder sdcard/Whatsapp/databases and renamed it to msgstore.db but Whatsapp didn't restore anything allthough it showed me that it seems to restore something during the installation.
So i did this to repair the database:
- start whatsapp_xtract_console.bat and then type:
- echo .dump | sqlite3.exe msgstore.plain.db > Temp.sql
- echo .quit | sqlite3.exe -init Temp.sql msgstore_new.db
- python whatsapp_xtract.py msgstore_new.db
Now i got the msgstore_new db file which has just a little bit smaller size than the msgstore.db.crypt and msgstore.plain.db file (5,291 KB) and it seemed to be correct because i got also the HTML file msgstore.db file which showed me all my chat in firefox.
My question now: Which file do i have to copy to my sd card so i get my chat back and so Whatsapp can restore them correctly?
I would be very grateful for your help
ps. Liz thank you for your help and the translation
13th March 2013, 01:44 AM |#514  
Junior Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by Snapy1991

Than i copied the msgstore.plain db file again to the folder sdcard/Whatsapp/databases and renamed it to msgstore.db but Whatsapp didn't restore anything allthough it showed me that it seems to restore something during the installation.
So i did this to repair the database:
- start whatsapp_xtract_console.bat and then type:
- echo .dump | sqlite3.exe msgstore.plain.db > Temp.sql
- echo .quit | sqlite3.exe -init Temp.sql msgstore_new.db
- python whatsapp_xtract.py msgstore_new.db
Now i got the msgstore_new db file which has just a little bit smaller size than the msgstore.db.crypt and msgstore.plain.db file (5,291 KB) and it seemed to be correct because i got also the HTML file msgstore.db file which showed me all my chat in firefox.
My question now: Which file do i have to copy to my sd card so i get my chat back and so Whatsapp can restore them correctly?
I would be very grateful for your help
ps. Liz thank you for your help and the translation

That is where my problem differs from Snappy's: When I work with whatsapp_xtract_console.bat, first everything looks normal (tryubg to repair android database... trying to decrypt android database... decrypted database written to msgstorenew.db.plain.db trying to repair decrypted andorid database...) but then I get an error telling me: "Could not open database file. Guess it's not a valid Android or Iphone database file." The file msgstore_new.db is created but with a size of 0 KB. I really have no clue what to do there...
13th March 2013, 04:15 PM |#515  
Member
Thanks Meter: 7
 
More
Quote:
Originally Posted by ztedd


- conversion between Android and Iphone database:
-- Android -> Iphone: ark0n3 is working on a Java tool called WhatsAppMigrator, here you can download WhatsAppMigrator
-- Iphone -> Android: no solution yet

Is it the other way around?
I mean it is Android -> Iphone where there is no solution yet, am I right?
Thank you.
14th March 2013, 01:21 AM |#516  
Member
Thanks Meter: 10
 
More
Hi there,

Just wanted to post my "unofficial" (as in - I needed extra features for my own usage of this tool, so I coded them, but I am not a part of the official dev team) version 2.5 of this tool.

This version can now automatically handle malformed databases (that received the "database disk image is malformed" error).

--------------

CHANGELOG:

v2.5 (updated by Alon Diamant - Mar 14, 2013)
- Improved encrypted Android database detection and decryption code
- Can now repair malformed Android databases (depends on availability of sqlite3 executable)

v2.4 (updated by Alon Diamant - Mar 06, 2013)
- Generates media index file - but crappily, we should set this up better..

v2.3 (updated by Alon Diamant - Mar 05, 2013)
- now generates separate file for each contact
- fixed file search to search for image files in days prior to date given (to fix a bug where because of timezone differences the image file exists but is not found)
- fixed message counts for contacts
- does not list contacts with 0 messages
- now writes version number in generated files
- (Android Version) displays WhatsApp name (server based) if no display name is found for a contact
- (Android Version) Supports Python 2.6

--------------

How to use:

After doing step 2 of the original post, and before doing step 3 - extract attached archive (Whatsapp_Xtract_Py_2_5.zip) to the same folder selected in step 2. Continue to step 3 normally.

Good luck

Make sure you click the "Thanks" button beneath this post if you like this!

--------------

Original poster: feel free to merge this into your code base, if you feel like it, or contact me to take it down, if you don't like it.
Attached Files
File Type: zip Whatsapp_Xtract_Py_2_5.zip - [Click for QR Code] (20.7 KB, 493 views)
The Following User Says Thank You to advance512 For This Useful Post: [ View ] Gift advance512 Ad-Free
14th March 2013, 09:46 AM |#517  
Junior Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by advance512

Hi there,

Just wanted to post my "unofficial" (as in - I needed extra features for my own usage of this tool, so I coded them, but I am not a part of the official dev team) version 2.5 of this tool.

This version can now automatically handle malformed databases (that received the "database disk image is malformed" error).

--------------

CHANGELOG:

v2.5 (updated by Alon Diamant - Mar 14, 2013)
- Improved encrypted Android database detection and decryption code
- Can now repair malformed Android databases (depends on availability of sqlite3 executable)

v2.4 (updated by Alon Diamant - Mar 06, 2013)
- Generates media index file - but crappily, we should set this up better..

v2.3 (updated by Alon Diamant - Mar 05, 2013)
- now generates separate file for each contact
- fixed file search to search for image files in days prior to date given (to fix a bug where because of timezone differences the image file exists but is not found)
- fixed message counts for contacts
- does not list contacts with 0 messages
- now writes version number in generated files
- (Android Version) displays WhatsApp name (server based) if no display name is found for a contact
- (Android Version) Supports Python 2.6

--------------

How to use:

After doing step 2 of the original post, and before doing step 3 - extract attached archive (Whatsapp_Xtract_Py_2_5.zip) to the same folder selected in step 2. Continue to step 3 normally.

Good luck

Make sure you click the "Thanks" button beneath this post if you like this!

--------------

Original poster: feel free to merge this into your code base, if you feel like it, or contact me to take it down, if you don't like it.


Hello advance512

I tried your tool exactly how you wrote to, hoping it would solve my problem. But unfortunately it didn't work at all and I get the error attached when trying to use whatsapp_xtract_android_crypted.bat after having unpacked your tool.

Could you please help?

Thank you!

Liz
Attached Thumbnails
Click image for larger version

Name:	Bild1.jpg
Views:	361
Size:	22.9 KB
ID:	1803996  
15th March 2013, 12:49 AM |#518  
Member
Thanks Meter: 10
 
More
Okay, so a quick fix to 2.5.

I forgot test it on Python 3 (silly me programming late at night), but now I did.

--------------

CHANGELOG:

v2.51 (updated by Alon Diamant - Mar 15, 2013)
- v2.5 was now tested with Python 3 as well. :S

v2.5 (updated by Alon Diamant - Mar 14, 2013)
- Improved encrypted Android database detection and decryption code
- Can now repair malformed Android databases (depends on availability of sqlite3 executable)

v2.4 (updated by Alon Diamant - Mar 06, 2013)
- Generates media index file - but crappily, we should set this up better..

v2.3 (updated by Alon Diamant - Mar 05, 2013)
- now generates separate file for each contact
- fixed file search to search for image files in days prior to date given (to fix a bug where because of timezone differences the image file exists but is not found)
- fixed message counts for contacts
- does not list contacts with 0 messages
- now writes version number in generated files
- (Android Version) displays WhatsApp name (server based) if no display name is found for a contact
- (Android Version) Supports Python 2.6

--------------

How to use:

After doing step 2 of the original post, and before doing step 3 - extract attached archive (Whatsapp_Xtract_Py_2_51.zip) to the same folder selected in step 2. Continue to step 3 normally.

Good luck

Make sure you click the "Thanks" button beneath this post if you like this!

--------------

Original poster: feel free to merge this into your code base, if you feel like it, or contact me to take it down, if you don't like it.
Attached Files
File Type: zip Whatsapp_Xtract_Py_2_51.zip - [Click for QR Code] (20.9 KB, 773 views)
The Following 4 Users Say Thank You to advance512 For This Useful Post: [ View ] Gift advance512 Ad-Free
15th March 2013, 10:15 AM |#519  
Member
Thanks Meter: 7
 
More
Thumbs up
First I thought that I wouldn't like the unofficial future development because of the separated contacts in html files...
But I've tried it and I must admit: well done. It looks pretty good now. Especially now the loading time in my browser is way lower.
I'm using your unofficial version now and I it's a pretty good addition. Great work!
15th March 2013, 03:55 PM |#520  
ggclanlord's Avatar
Senior Member
Thanks Meter: 204
 
More
Downloading unofficial v2.5 now.

@OP, if at all you check this thread now - Are you going to update the tool now? Or there's going to be no more support for it?
17th March 2013, 05:01 AM |#521  
Junior Member
Thanks Meter: 0
 
More
HI,,
i have two problem in that.
can u solve my problem ??
I attach my screen capture.
Thank you very much=D
Attached Thumbnails
Click image for larger version

Name:	Capture_03172013_115050_.jpg
Views:	267
Size:	166.9 KB
ID:	1811026   Click image for larger version

Name:	Capture_03172013_115140_.jpg
Views:	222
Size:	216.3 KB
ID:	1811027  
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes