Recovering Wallet.dat from Formatted HDD

13 replies 222 views
calmbullMember
Posts: 6 · Reputation: 40
#1Dec 2, 2023, 08:38 PM
Hey guys, Just found an old HDD where I was mining Bitcoin ages ago. The thing is, it got formatted after a fresh OS install. What would be the best tool for trying to recover my wallet.dat? Is R-Studio Pro worth it?
4 Reply Quote Share
0xChadNewbie
Posts: 513 · Reputation: 3
#2Dec 2, 2023, 10:57 PM
Important tip: make a byte-by-byte clone of your HDD first, trust me on this. R-Studio could help but since you formatted it, the chances are high that your wallet is corrupted now. Still, give it a shot after backing up. And yeah, look for those "magic bytes" followed by a 64-byte private key. Plenty of guides here, just hit the search bar.
2 Reply Quote Share
gang2015Member
Posts: 682 · Reputation: 62
#3Dec 3, 2023, 01:02 AM
Formatting usually does a quick job, not a random/zero fill, so that’s something. But reinstalling an OS writes a lot of data too. Pywallet could be useful, it scans the whole HDD and an image of it.
4 Reply Quote Share
calmbullMember
Posts: 6 · Reputation: 40
#4Dec 3, 2023, 01:55 AM
Is Pywallet better than R-Studio? I get that formatting changes data to zero, making it look like free space. So, if I want to recover, I guess I’d need to use R-Studio's Hex Signature search with the known file type.
4 Reply Quote Share
gang2015Member
Posts: 682 · Reputation: 62
#5Dec 3, 2023, 03:06 AM
Not sure about R-Studio, I don’t use it. But it’s often suggested for finding hidden or deleted wallet.dat files. From what I've seen, just install Python and learn some command line basics for using Pywallet.
2 Reply Quote Share
Posts: 7 · Reputation: 230
#6Dec 3, 2023, 05:55 AM
Been using X-ways Forensics since 2011, it's solid for regex searches in unallocated disk space. I’d scan for wallet.dat headers there: 2009-2012 header: \x00\x05\x31\x62\x00\x00\x00\x02 2017 change: \x00\x05\x31\x62\x00\x00\x00\x03.
4 Reply Quote Share
calmbullMember
Posts: 6 · Reputation: 40
#7Dec 3, 2023, 07:21 AM
R-Studio is said to be the most advanced forensic tool out there, but I dunno about that. If your wallet's from 2009, that header should be valid. But can I use it to create a known file type for hex search?
4 Reply Quote Share
Posts: 7 · Reputation: 230
#8Dec 3, 2023, 07:41 AM
X-ways is actually more advanced than R-Studio. I’ve only tried R-Studio once years ago. Maybe you should give that open-source option a try? Their regex may work differently, but it could still be effective.
5 Reply Quote Share
calmbullMember
Posts: 6 · Reputation: 40
#9Dec 3, 2023, 09:13 AM
You mean Pywallet when you say open-source? Gonna download X-ways today and see if I can find the files you mentioned.
4 Reply Quote Share
Posts: 7 · Reputation: 230
#10Dec 3, 2023, 09:23 AM
Just a heads up, you should check the new wallet.dat in a hex viewer. That’s easier than all the steps you were planning. And yeah, the XML is for R-Studio, so good luck with that.
0 Reply Quote Share
calmbullMember
Posts: 6 · Reputation: 40
#11Dec 4, 2023, 11:30 PM
I compared R-Studio and X-ways. Yeah, X-ways is super advanced, but I only need regex features. If I find a corrupted file, could you help me fix it?
0 Reply Quote Share
Posts: 7 · Reputation: 230
#12Dec 6, 2023, 08:17 PM
If you're looking in unallocated space, be aware there's a chance the file's fragmented. The old file details might be gone, and you might need more advanced tools like X-ways. Even then, recovering a fragmented file isn't guaranteed.
1 Reply Quote Share
calmbullMember
Posts: 6 · Reputation: 40
#13Dec 7, 2023, 01:00 AM
I’m just focusing on R-Studio since I’ve got a license for a bit longer. I’ll spend time learning regex in it. I remember the tech did copy the C drive when formatting D, so here’s hoping.
4 Reply Quote Share
0xChadNewbie
Posts: 513 · Reputation: 3
#14Dec 7, 2023, 06:22 AM
Only if you didn’t delete the D partition when formatting. If it’s intact, you might still have a shot. If the wallet.dat was on D:/, you’re in a better spot. If it’s corrupted, try copying it and see if you can use it.
4 Reply Quote Share

Related topics