Created
August 9, 2017 06:13
-
-
Save kendricktan/1e62495150ad236b38616d733aac4eb9 to your computer and use it in GitHub Desktop.
Load bitcoin /zencash wallet.dat file in javascript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fs = require('fs') | |
fs.readFile('/home/kendrick/.zen/wallet.dat', function (err, data) { | |
var re = /\x30\x81\xD3\x02\x01\x01\x04\x20(.{32})/gm | |
var dataHexStr = data.toString('latin1') | |
var privateKeys = dataHexStr.match(re) | |
privateKeys = privateKeys.map(x => x.replace('\x30\x81\xD3\x02\x01\x01\x04\x20', '')) | |
privateKeys.map(x => console.log(Buffer.from(x, 'latin1').toString('hex'))) | |
console.log('Found ' + privateKeys.length + ' keys') | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment