Author

Topic: Corrupted old wallet help!! (Read 309 times)

HCP
legendary
Activity: 2086
Merit: 4361
August 05, 2020, 03:58:05 PM
#16
Thanks for your script; it is working for uncrypted wallet.dat file. Could you please advice how to recover encrypted wallet.dat file.
I don't know how many times or ways to try and explain to you... you CAN NOT recover data from an encrypted wallet.dat file unless you have the password.

The data is, after all, encrypted... so you need to recover the password first. Your options are:

btcrecover: https://github.com/gurnec/btcrecover
hashcat: https://hashcat.net/hashcat/
or
a (trusted) wallet password recovery service like: https://www.walletrecoveryservices.com/

NONE of the private key extraction scripts on this forum will be of use to you, unless you have the password
full member
Activity: 157
Merit: 113
December 21, 2017, 11:26:55 AM
#15
And the zope.interface-3.6.4-py2.7-win-amd64.egg?

nope Sad

Anyway, that was racquemis' method.
Mine is a little bit different.

Did you see the Python script I posted above?
Copy it into Notepad and save it in C:\Python27 as dumpwallet.py (make sure it's not .txt!), and then open the command prompt.

Enter the following:
Code:
cd C:\Python27
python.exe dumpwallet.py %AppData%\Bitcoin\wallet.dat > private_keys.txt

The private_keys.txt file in C:\Python27 will contain a list of WIF private keys extracted from your wallet.
You can import them into Electrum later, if you succeed.

Make sure that your PC is not connected to the internet while running the commands for extra security.
member
Activity: 91
Merit: 10
December 20, 2017, 11:55:18 AM
#14
And the zope.interface-3.6.4-py2.7-win-amd64.egg?

nope Sad
full member
Activity: 157
Merit: 113
December 20, 2017, 10:37:59 AM
#13
And the zope.interface-3.6.4-py2.7-win-amd64.egg?
member
Activity: 91
Merit: 10
December 20, 2017, 09:01:39 AM
#12
thanks for your answer but I'm totally newbie on that... you will need to explain me a bit better :S

the first problem I see is that the links you posted above are both the same and why u call them egg files?? they are not egg files :S

the first one is: setuptools-38.2.4-py2.py3-none-any.whl, not ".egg"

and the second one is a zip file, which does not contains any "ez_setup.py"


Do you have easy_install.exe in the C:\Python27\Scripts folder?


yes!!
full member
Activity: 157
Merit: 113
December 20, 2017, 08:05:41 AM
#11
thanks for your answer but I'm totally newbie on that... you will need to explain me a bit better :S

the first problem I see is that the links you posted above are both the same and why u call them egg files?? they are not egg files :S

the first one is: setuptools-38.2.4-py2.py3-none-any.whl, not ".egg"

and the second one is a zip file, which does not contains any "ez_setup.py"


Do you have easy_install.exe in the C:\Python27\Scripts folder?
full member
Activity: 174
Merit: 100
December 20, 2017, 08:03:29 AM
#10
Thanks for your help but I don't understand nothing of these commands and don't know even how to rule python

I'm not a computer engineer nor a programmer :S

Well you will quickly have to learn because as far as i know trying to recover the private key with pywallet is the only option you have so far :-)
member
Activity: 91
Merit: 10
December 20, 2017, 08:01:54 AM
#9
Thanks for your help but I don't understand nothing of these commands and don't know even how to rule python

I'm not a computer engineer nor a programmer :S
member
Activity: 91
Merit: 10
December 20, 2017, 07:59:25 AM
#8
thanks for your answer but I'm totally newbie on that... you will need to explain me a bit better :S

the first problem I see is that the links you posted above are both the same and why u call them egg files?? they are not egg files :S

the first one is: setuptools-38.2.4-py2.py3-none-any.whl, not ".egg"

and the second one is a zip file, which does not contains any "ez_setup.py"

full member
Activity: 157
Merit: 113
December 20, 2017, 07:46:46 AM
#7
You can also try using my Python 2 script for dumping the wallet (it's loosely based on pywallet, and might work better with some corrupted wallets)

Code:
import sys
import struct
from bsddb.db import *
from hashlib import sha256

# Dumps the private keys from a wallet.dat file.
# Inspired by pywallet.

B58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"

if not len(sys.argv) == 2:
    print("Usage: %s " % sys.argv[2])
    sys.exit(1)

def read_size(buffer, offset):
    size = ord(buffer[offset])
    offset += 1

    if size == 0xfd:
        size = struct.unpack_from("        offset += 2
    if size == 0xfe:
        size = struct.unpack_from("        offset += 4
    if size == 0xff:
        size = struct.unpack_from("        offset += 8

    return offset, size

def read_string(buffer, offset):
    offset, string_len = read_size(buffer, offset)
    return offset + string_len, buffer[offset: offset + string_len]

def b58_encode(d):
    out = ""
    p = 0
    x = 0

    while ord(d[0]) == 0:
        out += "1"
        d = d[1:]

    for i, v in enumerate(d[::-1]):
        x += ord(v)*(256**i)

    while x > 58**(p+1):
        p += 1

    while p >= 0:
        a, x = divmod(x, 58**p)
        out += B58[a]
        p -= 1

    return out

def b58check_encode(d):
    checksum = sha256(sha256(d).digest()).digest()[:4]
    return b58_encode(d + checksum)


db = DB()
db.open(sys.argv[1], "main", DB_BTREE, DB_RDONLY)

items = db.items()

for item in items:
    k, v = item
    koff, voff = 0, 0
    koff, item_type = read_string(k, koff)

    if item_type == "key":
        koff, pubkey = read_string(k, koff)
        voff, privkey = read_string(v, voff)

        if len(privkey) == 279:
            secret = privkey[9:9+32]
        else:
            secret = privkey[8:8+32]

        if pubkey[0] != "\x04":
            secret += "\x01"

        print(b58check_encode("\x80" + secret))
        print(secret.encode("hex"))
db.close()
full member
Activity: 174
Merit: 100
December 20, 2017, 07:38:34 AM
#6
Did you install python?

I said that on previous post. I've installed python 2.7.

Ok do these steps:

Download the egg files:

(32bit). http://pypi.python.org/pypi/setuptools#downloads to install setuptools
(64bit). http://pypi.python.org/pypi/setuptools#windows to download, then run ez_setup.py

 4. Go to C:\Python27\Scripts
 5. Run easy_install.exe zope.interface-3.6.4-py2.7-win-amd64.egg
member
Activity: 91
Merit: 10
December 20, 2017, 07:36:15 AM
#5
Did you install python?

I said that on previous post. I've installed python 2.7.
full member
Activity: 174
Merit: 100
December 20, 2017, 07:29:24 AM
#4
Did you install python?
member
Activity: 91
Merit: 10
December 20, 2017, 07:21:17 AM
#3
What do you recommend me to do?

The first thing you should do is to create several backups.
Do not try any recovery on the original file. Use copies for that.

You can try to extract your private keys out of your wallet.dat using any recovery tool.
You can use pywallet (https://github.com/jackjack-jj/pywallet) for example.
The command needed to be run is ./pywallet --wallet=wallet.dat --datadir=/path/to/folder_with_wallet.dat --dumpwallet
For more detailed instructions visit the github repository (link posted above).




thanks but where should I run this? opening command prompt? or how?

I've read github and installed python 2.7 and installed twisted but dont know how to apply step 3:


"3. Untested, proposed by TeaRex: install Zope.Interface from: http://www.lfd.uci.edu/~gohlke/pythonlibs"

I've navigated there but don't know now which of these files should I download and then how to install that :S

zope.interface‑4.4.3‑cp27‑cp27m‑win32.whl
zope.interface‑4.4.3‑cp27‑cp27m‑win_amd64.whl

legendary
Activity: 1624
Merit: 2481
December 20, 2017, 07:02:06 AM
#2
What do you recommend me to do?

The first thing you should do is to create several backups.
Do not try any recovery on the original file. Use copies for that.

You can try to extract your private keys out of your wallet.dat using any recovery tool.
You can use pywallet (https://github.com/jackjack-jj/pywallet) for example.
The command needed to be run is ./pywallet --wallet=wallet.dat --datadir=/path/to/folder_with_wallet.dat --dumpwallet
For more detailed instructions visit the github repository (link posted above).

member
Activity: 91
Merit: 10
December 20, 2017, 05:10:35 AM
#1
Hello mates,

I need some help to recover my bitcoin wallet. I have read several posts here about that and made some research on google, but I couldn't find how to recover it easily using only windows 10/7 because I've never used linux before...

The wallet is from around 2012 and don't know if password protected, think not. File sizes less than 1 mb.

I have tried to install bitcoin core and put the file on directory, but the message shown is the following:
"wallet.dat corrupt, salvage failed"

What do you recommend me to do?

P.D: I don't offer initially any reward for helping, but if finally I achieve to recover the lost funds, for sure I will be grateful with the person who helped me.
Jump to: