Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR parsing wallet.dat, type setting #27

Closed
andreashb2 opened this issue Feb 20, 2021 · 10 comments
Closed

ERROR parsing wallet.dat, type setting #27

andreashb2 opened this issue Feb 20, 2021 · 10 comments

Comments

@andreashb2
Copy link

This is the command I run:
python pywallet.py --wallet=/home/user/Desktop/wallet.dat --dumpwallet

This is the error I get:
Traceback (most recent call last):
File "pywallet.py", line 2273, in parse_wallet
d['value'] = parse_setting(d['setting'], vds)
File "pywallet.py", line 1489, in parse_setting
return deserialize_CAddress(d)
File "pywallet.py", line 1471, in deserialize_CAddress
return d['ip']+":"+str(d['port'])
File "pywallet.py", line 109, in getitem
return super(Bdict, self).getitem(bytes_to_str(k))
KeyError: u'ip'
ERROR parsing wallet.dat, type setting
key data: setting
addrIncoming
key data in hex: XX (censored)
value data in hex: XX (censored)

3 files are made on my desktop:
__db.001 __db.002 __db.003
None can be opened.

wallet.dat is a Litecoin wallet backup (probably from litecoin-qt) from 2013 with a size of 88kb.
I have python version 2.7.17. My goal is to extract the private keys

@jake01-dev
Copy link

I believe I'm running into the exact same issue. I am trying to dump a bitcoin wallet from 2013.

'ecdsa' package is not installed, pywallet won't be able to sign/verify messages
Traceback (most recent call last):
File "/Users/jtroy/Documents/BTC Data/pywallet-master/pywallet.py", line 2273, in parse_wallet
d['value'] = parse_setting(d['setting'], vds)
File "/Users/jtroy/Documents/BTC Data/pywallet-master/pywallet.py", line 1489, in parse_setting
return deserialize_CAddress(d)
File "/Users/jtroy/Documents/BTC Data/pywallet-master/pywallet.py", line 1471, in deserialize_CAddress
return d['ip']+":"+str(d['port'])
File "/Users/jtroy/Documents/BTC Data/pywallet-master/pywallet.py", line 109, in getitem
return super(Bdict, self).getitem(bytes_to_str(k))
KeyError: u'ip'
ERROR parsing wallet.dat, type setting
key data: setting
addrIncoming
key data in hex: XXXX
value data in hex: XXXX

Anyone have any luck with this?
Jake

@banzo
Copy link

banzo commented Mar 5, 2021

Commenting line 1464 and returning "0.0.0.0:0" at line 1471 removes the error
https://github.com/jackjack-jj/pywallet/blob/master/pywallet.py#L1464-L1471

Now I got "error code: 1015" in the json output balance fields, which seems to indicate rate limiting issues but might be caused by the hack above.

@llamasoft
Copy link

I found a lazier fix that won't cause errors: just don't parse the settings.
Add a "continue" as the first line of the elif type == b"setting": block here:

elif type == b"setting":

@jake01-dev
Copy link

@llamasoft - thank you, this solution worked for me.

@Fredisaurus
Copy link

Hi there

I believe I'm running into the exact same issue. I am trying to dump a bitcoin wallet from 2013.

'ecdsa' package is not installed, pywallet won't be able to sign/verify messages
Traceback (most recent call last):
File "/Users/jtroy/Documents/BTC Data/pywallet-master/pywallet.py", line 2273, in parse_wallet
d['value'] = parse_setting(d['setting'], vds)
File "/Users/jtroy/Documents/BTC Data/pywallet-master/pywallet.py", line 1489, in parse_setting
return deserialize_CAddress(d)
File "/Users/jtroy/Documents/BTC Data/pywallet-master/pywallet.py", line 1471, in deserialize_CAddress
return d['ip']+":"+str(d['port'])
File "/Users/jtroy/Documents/BTC Data/pywallet-master/pywallet.py", line 109, in getitem
return super(Bdict, self).getitem(bytes_to_str(k))
KeyError: u'ip'
ERROR parsing wallet.dat, type setting
key data: setting
addrIncoming
key data in hex: XXXX
value data in hex: XXXX

Anyone have any luck with this?
Jake

Hi there!

I have the exact same issue here. I have spent 3 days doing my own research online trying to figure out how to decrypt this statement alone:

"Add a "continue" as the first line of the elif type == b"setting": block here:" located at Line 2271"

I have watched countless of YouTube videos on how to use 'continue'.
Also tried out using the process of elimination by relocating the position of the word 'continue'. (Like placing at the top, bottom, beside it, to the left, to the right... You get the point.)
Just so I don't look like a sore thumb asking for the same help when the formula was already given and approved with like 2 Thumbs Up?
But man, I am truly sorry. I could not to understand.
I have zero knowledge on coding.

Can someone help me out with an easier step-by-step guide/walkthrough?

Appreciated.

@llamasoft @jake01-dev @nicocesar @banzo @andreashb2

@nicocesar
Copy link

nicocesar commented Apr 20, 2021

@Fredisaurus what a good time to be alive! this is my diff:

diff --git a/pywallet.py b/pywallet.py
old mode 100644
new mode 100755
index cf24ea0..7d021d8
--- a/pywallet.py
+++ b/pywallet.py
@@ -2269,8 +2269,9 @@ def parse_wallet(db, item_callback):
                        elif type == b"minversion":
                                d['minversion'] = vds.read_uint32()
                        elif type == b"setting":
-                               d['setting'] = kds.read_string()
-                               d['value'] = parse_setting(d['setting'], vds)
+                               continue
+                               #d['setting'] = kds.read_string()
+                               #d['value'] = parse_setting(d['setting'], vds)
                        elif type == b"key":
                                d['public_key'] = kds.read_bytes(kds.read_compact_size())
                                d['private_key'] = vds.read_bytes(vds.read_compact_size())

If it works and you want to try out that the transfers work correctly here is an destination address you can use: 3N9GTTtD4jWGrimTg7gujNHS1f146W7Qxv

Cheers!

@wschoot
Copy link

wschoot commented May 1, 2021

I found a lazier fix that won't cause errors: just don't parse the settings.
Add a "continue" as the first line of the elif type == b"setting": block here:

elif type == b"setting":

Thanks, this helped!

@erm3nda
Copy link

erm3nda commented Jul 17, 2021

Commenting line 1464 and returning "0.0.0.0:0" at line 1471 removes the error
https://github.com/jackjack-jj/pywallet/blob/master/pywallet.py#L1464-L1471

Now I got "error code: 1015" in the json output balance fields, which seems to indicate rate limiting issues but might be caused by the hack above.

I've tried with sample wallet.dat with several addresss, and totally seems rate limit, because first addresses got solved, but stopped at the 5th/6th address.

@jackjack-jj
Copy link
Owner

99316a1 should fix that

@tepan024
Copy link

I found a lazier fix that won't cause errors: just don't parse the settings. Add a "continue" as the first line of the elif type == b"setting": block here:

elif type == b"setting":

how ? i'm numb with this error, pls help :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants