Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: MrTR3 on August 01, 2018, 12:15:14 AM



Title: assistance to repair corrupt wallet.dat ?
Post by: MrTR3 on August 01, 2018, 12:15:14 AM
Hi , briefly in 2012 I zipped a wallet.dat and renamed it to <name>.jpg ,

the drive had been formatted to NTFS.

the recovery software has brought the .jpg home but it is not able to return to .zip

without headers lost in recovery?>
these are start of a wallet.dat > wallet.zip ...here.

PK.........€ÿL:¨ëa—È...@......wallet - Copy.datì].8”í.žo0Ö².}ß—ìk‰,I–Ê^...%k’.²FÙ³.¬E.J¤E$ûRD²•]RÙ..çûtüÍä?g8×uÎå\×<×ÿþ5ÏÜï}¿ïý|ëûÍL00.د°.'€.C.a..ñ¯Ü.ØïX.kD.ú..Œ.u„.ý=ø:f...¸À..p..\à..¸À..p..\à..¸À..p..\à..¸À..p..\ü/.øgûý..Š. Xd›b.ó¸çÿ¸À..p..\à..¸À..p..\à..¸À..p..\à..¸À..p..\l»À_{2.‡þt8iw.JýÊü‹ïÿÃÿÃçÿx0\ü?..Øî .?pÙîŒkÐÈ:.zDWá«J›ë-Ëàµ÷ùÄðÐp.EÈ.„Ž›'\Ðmq?rm\ô‹u#ß/œ.Ñ/..ØÜï .n§..½x3£¡ACL^´.Nmýr5$.|¯...ŽË§•|<óíè%_öàÁš.Å.†Î0Ž5ÜKYt][±÷S—93TvÜ.›ßíz½—Ž¶ö—n.'1:.{í.Rï'

and the end of the zip file ... here.

.uö.€;.¾.Póum4.éæp±òÞÙl«•â=J¼òÄG.L¯GQx…º0é*=.™I—.Pý‡Œ.¬.Ž(‡šÝ._Ù.S{E.¾ºxõQò.æ)..nŽ8 M.@ÅG.Õ«œ#2…`rG{dY¡êP59ÖÎé2‘°ÞÆeCú”ñ~`.¨øàbÝþ0°.¬L³eº.Ès‘›Ù„·ß–•yÁRö”X¿œÖ.˜ñÏã.¼W 0.T|<›OãÈåg\.Ü.Á9¼Wˆ‹$‡=‰.Ü`]²NÂÒÁIÏ.Ð.¹dü->þ.PK..?........€ÿL:¨ëa—È...@....$....... .......wallet - Copy.dat.. .........®o^¸“(Ô.•ý.á“(Ô.•ý.á“(Ô.PK..........c...ÆÈ....


with lots in between , any idea where i can cut the data and replace mine in and restore the zip file ? is it able ? im a novice

next two strings are the beginning and ending of my file .....

¢ñÙb`ýmÔmW¿¾q‘uvÇŸ™[œ.pie‘äm.Š¬m.Ú.L4Ö” ®o:. êm5d,â>ÁXç}*¡.&œFø.2h»>K§F½x°.÷È.ò-¿¢9„J@å...ë6GÓf(¶±í¨).Eí}ÕÊÿŸ.%".–¡C.ÍÜ.ò!¯Ð[ÄVµM.%Îië‘••>`\V6™.ûqL.¶œ.æB…èÌ&..{|ªXœ...Nÿ.üó²ðnæy.ùÿ.1™®qäÍsýÔ.wAiõ*.¯Rñó4

and ends in


.€ÂÎÙùÕÂùk€¸ßôh¨:Ö/ê]˜‘TS.¿üLçw/©$E7.é.¾Ôª/i®..h#?»7l;zIe`T,,ÅJhìžï¡ìf.‘à@‚ñõ.¨._Å{§FÓÞM^ºÒò}=x!YwZÖ.©.^ºJçÛ.yg:.=_ÂÐÖZ%Lúå.@ò;J£._8YÀ.Æ|A.ë?‚¦í ”Új°‰£Ë_HÕ.^qðR§†ÐpKòÿ.ge‹‘½)ž=S)ÅWÔÄ.r+


thanks any help appreiciated !!
have a good day !!


(edit ) the wallet ive zipped and shown here is empty wallet.dat from core 16

 the data is from wallet ver 0.4 ....


Title: Re: assistance to repair corrupt wallet.dat ?
Post by: achow101 on August 01, 2018, 03:50:59 AM
Those characters are completely meaningless, the file is a binary, not human readable text. You should instead post the hex representing the bytes of the file.

The file is most certainly corrupted, either from the formatting or from the recovery itself. If the recovery software was expecting a jpg file, then what it recovered will most certainly not have the correct file headers to be a zip. Just because you change the extension of a file does not mean that its contents magically become that file type (in case you didn't know, the file type is determined by the contents, not the file extension).


Title: Re: assistance to repair corrupt wallet.dat ?
Post by: NeuroticFish on August 01, 2018, 06:25:37 AM
PK.........

Since it starts with PK, it could be indeed a zip file. If you've changed the extension to .zip and it didn't work, you may have a tiny chance with programs that may recover something from broken zip files (https://www.google.com/search?hl=en&q=recover+broken+zip).

But since the content of the zip is corrupted, the biggest chance is that wallet.dat is also heavily corrupted or lost. Of course, this doesn't rule out the (tiny) chances to recover your private key.


Title: Re: assistance to repair corrupt wallet.dat ?
Post by: bob123 on August 01, 2018, 07:00:24 AM
Hi , briefly in 2012 I zipped a wallet.dat and renamed it to <name>.jpg ,

the drive had been formatted to NTFS.

the recovery software has brought the .jpg home but it is not able to return to .zip

Just to make sure, you did rename the file to <>.zip, right?
Because in case you did, the chances are high that your file is corrupted.

Which recovery software has been used? And do you still have an untouched copy/image of your old drive?
If you are simply formatting a drive most of the data will stay intact. The probability of a small .zip file to be corrupted are relatively small. It might have been the recovery software which didn't recover the file as it should (maybe uses different techniques for .jpg).
Another image of the drive could be useful for analysis with other (better) tools.

If you do not have such an image left, you probably have to follow NeuroticFish's advise and try out a zip-recovery tool.



Title: Re: assistance to repair corrupt wallet.dat ?
Post by: boulderchain on August 01, 2018, 07:00:51 PM
Don't touch your old hdd, start from a live os instead and mount the drive readonly. You don't want to overwrite any data.

I would use a linux distribution (ubuntu has s large community) and try to restore the file with "testdisk" again. You can install it with 'sudo apt install testdisk'. I had by far the best results with this program.


Title: Re: assistance to repair corrupt wallet.dat ?
Post by: HCP on August 05, 2018, 06:08:31 AM
I think you guys missed the point that the OP has tested what happens when he takes a wallet_copy.dat and then zips it up...

This "undamaged" file starts with "PK" (as most zip files do)... whereas his "broken" zip file does not.

The OPs idea is that he is hoping he can copy/paste file header information from a "uncorrupted" zipped/renamed file into the "broken" file he has recovered using the data recovery software in an attempt to fix it and make it into a zip file he can unzip and retrieve his original wallet.dat file.

I don't believe this approach is possible or will work... as regardless of the headers, I believe the rest of the contents of the file itself is most likely damaged beyond repair.


Title: Re: assistance to repair corrupt wallet.dat ?
Post by: boulderchain on August 05, 2018, 03:11:20 PM
@HCP

I also think that it will be not possible to just use the header from another file. Afaik the contain themost important information of the file.

A while ago I researched about the recovery of image files and you can nearly restore the exact image when you repair the header file only.

https://warehouse-camo.cmh1.psfhosted.org/2fe221c61a6abb5671a0ba5d380e840f9009308d/68747470733a2f2f7261772e67697468756275736572636f6e74656e742e636f6d2f6c7271333030302f707946696c654669786974792f6d61737465722f7475782d6578616d706c652e6a7067


Title: Re: assistance to repair corrupt wallet.dat ?
Post by: ePesoInitiative on August 06, 2018, 05:28:14 PM
Thus the importance of paper wallet backups. It's electronic damage proof. If you can manage it, memorize the private key.  ;D I for one, placed backups in two different locations and only require QR reader or eyes.


Title: Re: assistance to repair corrupt wallet.dat ?
Post by: boulderchain on August 06, 2018, 08:11:06 PM
The question remains even if the corrupted file is nearly repaired would the wallet be able to load the wallet.dat

There are dedicated tools like pywallet to extract private keys from corrupted wallets.


Title: Re: assistance to repair corrupt wallet.dat ?
Post by: HCP on August 06, 2018, 10:24:32 PM
The question remains even if the corrupted file is nearly repaired would the wallet be able to load the wallet.dat
There are dedicated tools like pywallet to extract private keys from corrupted wallets.
Unfortunately for the OP, they don't have a corrupted wallet... they have a corrupted ZIP file that contains a wallet.dat... that is a completely different kettle of fish, and PyWallet is of no use in this instance.

If the OP had simply renamed the wallet file... then there would be a possibility that PyWallet would be able to read (some) of it, assuming it could be "recovered" by the data recovery software... however, when you "zip" (aka compress) a file, that file no longer exists in it's original form and the data is changed until that file is then unzipped/decompressed.