Bitcoin Forum
November 06, 2024, 05:24:05 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: PYWallet Help? Trying To Recover 17 LiteCoin. Getting An Error. ty  (Read 155 times)
ENRKyle25 (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
March 10, 2018, 12:16:22 AM
 #1

So I made a mistake when I was new to Crypto. I used a Desktop Core wallet to store litecoin (17 of them). I somehow removed the program and deleted the wallet.dat file. The second I noticed I took the hard drive(s) out of the computer and reloaded windows on a new drive. I then made a sector for sector copy as a backup before attempting recovery. The main drive was a SSD and I had Windows 10 File History setup to back up to a HDD. After learning the basics of Python and figuring out the basics of PyWallet I was able to finally locate nearly 500 possible encrypted keys (I did not forget the password, I know for sure I have the correct password). I did try to simply replace the wallet.dat file with one of the recovered wallets (in appdata/roaming/litecoin folder) but none that I tried worked – Litecoin core would not open. Anyway. I ended up with about 550 wallet files from the recovery process (because file history saved a new version each day). So I did a full (non quick) format on a small 2GB jump drive and transfer all recovered wallet files (.dat) onto that jump drive with the assigned drive letter “L”. I create a folder on my C drive named “LCWALLET” I then run this in pywallet:

"pywallet.py --otherversion 48 --recover --recov_size=2Gio –-recov_device=L: --recov_outputdir=C:\LCWALLET"

I enter a password for the new wallet as prompted, and type the password for the recovered wallets. When I run this with all the wallet files on the jump drive it takes about 3 mins always results in this (ERROR): “Read 2.0 Go in 3.2 minutes Found 0 possible wallets Found 474 possible encrypted keys Found 0 possible unencrypted keys Traceback (most recent call last): File "C:\Python27\pywallet.py", line 4870, in recoveredKeys=recov(device, passes, size, 10240, options.recov_outputdir) File "C:\Python27\pywallet.py", line 1532, in recov list_of_possible_keys_per_master_key[tl[0][2]].append(ck) IndexError: list index out of range”

I know what this first step is only recording where to locate these keys but it does not extract or dump them – it does create a pywallet_partial_recovery_XXXDateTimeXXXX.dat file (this file too does not open in LC core). The next step if I did not get the python error would be to dump the keys. To do that I ATTEMPT to run this: pywallet.py --otherversion 48 --datadir=C:\LCWALLET --wallet=pywallet_partial_recovery_XXdatetime.dat --dumpwallet --passphrase=XXXMyPasswordXXX

I have run this with test wallets and it works so long as I don’t get the error on the first step, BUT with the error it does not work, here is what it returns: “ERROR:root:Couldn't open wallet.dat/main. Try quitting Bitcoin and running this again.” I am positive the permissions are set to 777 (everyone). I have tried renaming the partially recovered wallet, moving it to other locations and editing the command- NOTHING I do gets it past this. Next I try this whole thing again on a fresh full format jump drive (if I only do quick format then pywallet still finds the deleted wallets on the jump drive) so this time I only put 10 of the original recovered wallet.dat files. That returns zero wallets, and zero keys but no error. I can then move on to step 2 but there is no point since there is no private keys in that lot. Any of them that return possible encrypted keys toss up that error and won’t let me move on to step to.

Any help would be GREAYLY appreciated.

Screenshot: https://drive.google.com/file/d/1Yq0cF1w0apW8YI2eFvHtmAid0CYjQTHP/view?usp=sharing
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4361

<insert witty quote here>


View Profile
March 11, 2018, 04:34:24 AM
 #2

Honestly not sure why you're getting that first "list index out of range" error... possibly just a bug that was not discovered before development halted. I've looked at the code and it seems to be trying to identify keys relating to a master key...
Code:
	list_of_possible_keys_per_master_key=dict(map(lambda x:[x[1],[]], mkeys))
for cko,ck in ckeys:
tl=map(lambda x:[abs(x[0]-cko)]+x, mkeys)
tl=sorted(tl, key=lambda x:x[0])
list_of_possible_keys_per_master_key[tl[0][2]].append(ck)

It's crashing on that last line...  Maybe try the PyWallet thread for assistance: https://bitcointalk.org/index.php?topic=34028.620

As for the 2nd error, it's because the "partial_recovery" file is NOT a properly constructed/formatted wallet.dat file... so the script is unable to parse it properly... it can't find the "main" structure, so it outputs the error and stops.

You'll get the same error if you attempt to "dumpwallet" any non-wallet.dat file.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
imjustagirl
Member
**
Offline Offline

Activity: 118
Merit: 11


View Profile
March 11, 2018, 09:26:28 AM
 #3

I would also recommend you to view and dissect the files in hex editor and see what is actually inside them.
Here are threads which have information on how to do that:
https://bitcointalk.org/index.php?topic=2012533.0
https://bitcointalk.org/index.php?topic=2857580.0

Maybe try to insert data from the non-recovering wallets into a working wallet and try to recover the keys from that.
This is just a thought. It would give the wallet file the missing structure, which the recovery software is looking for. Code the working wallet with the same passphrase you have on your old ones, it should work (in theory).

1JPnqMd1Q43L3KbZ7SoTSdRCD2aLj2sikF Tip Me!
ENRKyle25 (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
March 12, 2018, 07:32:17 PM
 #4

Both are great tips and your input is appreciated. I am going to start with the easier of the two options - running pywallet from linux. If that results in the same error I will investigate deeper and try the second suggestion with a hex editor. Thanks again. I will report back with my results!
ENRKyle25 (OP)
Newbie
*
Offline Offline

Activity: 3
Merit: 0


View Profile
March 14, 2018, 03:11:52 AM
 #5

I got a linux (ubuntu) setup using VMWare. I created a boot disk and a 2GB drive to put all the wallets on (/dev/sda)
Took a crash course in Linux / Python
Got PyWallet and the dependencies loaded and came up with this string:

root@ubuntu:~# sudo python2 ./pywallet.py --recover --recov_size=2Gio --recov_device=/dev/sda --recov_outputdir=~/Desktop

All is well so far, it prompted for the password on the new wallet, and the password on the encrypted wallets. I enter both......
but here is what I come up with:

Starting recovery.
0.10 Go read
.......
2.10 Go read

Read 2.1 Go in 0.1 minutes

Found 0 possible wallets
Found 475 possible encrypted keys
Found 0 possible unencrypted keys
Traceback (most recent call last):
  File "./pywallet.py", line 4870, in <module>
    recoveredKeys=recov(device, passes, size, 10240, options.recov_outputdir)
  File "./pywallet.py", line 1532, in recov
    list_of_possible_keys_per_master_key[tl[0][2]].append(ck)
IndexError: list index out of range




So this is not the same error, that is something!
Any ideas on this one?
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!