Post
Topic
Board Development & Technical Discussion
Re: wallet.dat corrupt. help! bounty 100$
by
HCP
on 02/07/2018, 03:03:45 UTC
Hey everyone!

I just deleted wallet.dat file from PC. And recovered several old wallet.dat files. I'm trying to dump/access by pywallet by --dumpwallet and --recover (i already install pip, twisted, zope, bsddb). Useless unfotunately.

If i use --dumpwallet (code: python --passphrase='pass' --otherversion=48 [LTC wallet] --datadir=C:\pathtowallet --dumpwallet), everytime i get error:

ERROR:root:Couldn't open wallet.dat/main. Try quitting Bitcoin and running this
again.

The error you are getting (Couldn't open wallet.dat/main) indicates that PyWallet is unable to parse your "wallet.dat" file as a wallet file. It's possible the file is corrupted beyond PyWallet's ability to simply read/parse it as a wallet.dat file. This is not uncommon in the case of recovered files that may have had parts of them overwritten.



Quote
If i use --recover (code: python --recover --recov_device=C:\Path\wallet.dat --otherversion=48 --recov_size 10Gio --passphrase='pass' --recov_outputdir C:\Path\foundkeys):

Read 0.0 Go in 0.0 minutes

Found 0 possible wallets
Found 0 possible encrypted keys
Found 0 possible unencrypted keys

Again, it seems like the wallet.dat file you are attempting to recover is damaged beyond PyWallets ability to recover the keys from it. I've run this on a known "good" wallet.dat and get:

Code:
Starting recovery.

Read 0.0 Go in 0.0 minutes

Found 1 possible wallets
Found 312 possible encrypted keys
Found 0 possible unencrypted keys

If I try and damage the file (deleted last half of the file), it still works... even randomly replacing large chunks of data with random text still works:
Code:
Starting recovery.

Read 0.0 Go in 0.0 minutes

Found 1 possible wallets
Found 234 possible encrypted keys
Found 0 possible unencrypted keys

Note how the number of possible encrypted keys is different (looks like I deleted a few! Tongue)... I was even able to delete the file and PyWallet was still able to "recover" it from the usb stick:
Code:
Starting recovery.
0.10 Go read
0.20 Go read
0.30 Go read
0.40 Go read
0.50 Go read
0.60 Go read
0.70 Go read
0.80 Go read
0.90 Go read
1.00 Go read

Read 1.0 Go in 1.3 minutes

Found 1 possible wallets
Found 235 possible encrypted keys
Found 0 possible unencrypted keys

Possible wallet #1
    with passphrase #1  .......................

So, if it isn't working, then either your recovered "wallet.dat" isn't actually a wallet.dat or it is really corrupted. Undecided

Also, how "new" were the wallet.dat files? Pywallet can sometimes have issues with newer wallets due to wallet file format updates in more recent versions of "Core".