<p>Found out that <a href="https://github.com/jackjack-jj/pywallet" rel="nofollow">pywallet</a> has recovery feature, and it worked:</p>

<p>Created 1GB FAT32 partition on flash drive(/dev/sdb1 in my case), copied corrupted wallet.dat on it and run:</p>

<p><code>
nyaa@ubuntu:~/github/pywallet$ sudo ./pywallet.py --recover --recov_device /dev/sdb1 --recov_size 1Gio --recov_outputdir /home/nyaa/
...
All the found encrypted private keys have been decrypted.
The wallet is encrypted and the passphrase is correct
</code></p>

<p>One of change addresses with all bitcoins on it was there!</p>

CC BY-SA 3.0
2017-12-01T10:37:30.250Z
Do you know if this can be run on an entire 120 Gigabyte drive using --recov_size 120Gio. Alternatively, could one also possibly cut and paste all relevant parts found by a hex editor from the drive into a new file and run pywallet, or would the file need to be at a certain level of "completeness" to start? Also, you mentioned formatting drive to fat32, is that necessary or can it be ext3 or ext4? Any help appreciated.
jalalideen
CC BY-SA 3.0
2017-12-22T17:46:03.220Z
What would be the equivalent on windows if my drive is F:  ? I entered the command but I get "You must provide the device, the number of bytes to read and the output directory".
Adamantus
CC BY-SA 3.0
2016-03-20T10:58:25.503Z
2016-03-20T10:58:25.503Z
nyaa
<p>My only one backup of encrypted wallet is corrupted (last time when backed it up i probably didn't shutdown bitcoin-qt), with hex editor i found in it:</p>

<ul>
<li>mkey</li>
<li>ckey (117 that looks fine)</li>
</ul>

<p>Does this enough for recovering my private keys? at least 117 of them?</p>

<p>How can i do this?</p>

<p><strong>PS</strong>
Already tried pywallet without success:
<code>ERROR:root:Couldn't open wallet.dat/main</code>
Bitcoin-qt: <code>wallet.dat corrupt, salvage failed</code></p>

<bitcoin-core><wallet.dat><encryption>
How can I fix corrupted encrypted wallet.dat?
nyaa
# How can I fix corrupted encrypted wallet.dat?

(Asked by: username_0 on 2016-03-19)

My only one backup of encrypted wallet is corrupted (last time when backed it up i probably didn't shutdown bitcoin-qt), with hex editor i found in it:

* mkey
* ckey (117 that looks fine)

Does this enough for recovering my private keys? at least 117 of them?

How can i do this?

**PS**
Already tried pywallet without success:
`ERROR:root:Couldn't open wallet.dat/main`
Bitcoin-qt: `wallet.dat corrupt, salvage failed`

**Tags:** bitcoin-core, wallet.dat, encryption


---

## 1 answers

### Answer by username_0 on 2016-03-20. Score: 4

Found out that [pywallet](https://github.com/jackjack-jj/pywallet) has recovery feature, and it worked:

Created 1GB FAT32 partition on flash drive(/dev/sdb1 in my case), copied corrupted wallet.dat on it and run:

`username_0@ubuntu:~/github/pywallet$ sudo ./pywallet.py --recover --recov_device /dev/sdb1 --recov_size 1Gio --recov_outputdir /home/username_0/
...
All the found encrypted private keys have been decrypted.
The wallet is encrypted and the passphrase is correct`

One of change addresses with all bitcoins on it was there!

> **Comments:**
> **username_1**: Do you know if this can be run on an entire 120 Gigabyte drive using --recov_size 120Gio. Alternatively, could one also possibly cut and paste all relevant parts found by a hex editor from the drive into a new file and run pywallet, or would the file need to be at a certain level of "completeness" to start? Also, you mentioned formatting drive to fat32, is that necessary or can it be ext3 or ext4? Any help appreciated.  
> **username_2**: What would be the equivalent on windows if my drive is F:  ? I entered the command but I get "You must provide the device, the number of bytes to read and the output directory".  

---

