forked from justNoOneHere/Re.BTC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
76 lines (71 loc) · 4.26 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
const argv = require('minimist')(process.argv.slice(2));
const BigNumber = require("bignumber.js");
const bip39 = require('bip39');
const generateCombinations = require('./func/BTC_generateCombinations');
const infoGenerator = require('./func/BTC_infoGenerator');
const mnemonic = require('./func/BTC_mnemonic');
let numChars;
let privateKey;
let userMnemonics;
let userAdress;
function main() {
if(argv.hasOwnProperty('Brainwallet') && argv.hasOwnProperty('numChars') && argv.hasOwnProperty('userAdress')) {
numChars = argv.numChars;
userAdress = argv.userAdress;
generateCombinations('', numChars, userAdress, argv);
}
else if (argv.hasOwnProperty('Directory') && argv.hasOwnProperty('privateKey') && argv.hasOwnProperty('userAdress')){
privateKey = argv.privateKey;
userAdress = argv.userAdress;
let bigInt = new BigNumber(privateKey, 16);
let max = new BigNumber("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140", 16);
for (let i = bigInt; i.isLessThanOrEqualTo(max); i = i.plus(1)) {
let privateKey = i.toString(16);
while (privateKey.length < 64) {
privateKey = "0" + privateKey;
}
infoGenerator(privateKey, userAdress, argv);
}
}
else if (argv.hasOwnProperty('Mnemonic') && argv.hasOwnProperty("Bip39") && argv.hasOwnProperty('userAdress')) {
userMnemonics = String(argv.Bip39).split(' ');
userAdress = argv.userAdress;
let validMnemonics = userMnemonics.filter(word => bip39.wordlists.english.indexOf(word) !== -1);
mnemonic(validMnemonics, userAdress);
}
else {
console.log(
`
+---------------------------------------------------+---------------------------------------------+
| Re.BTC | Usage |
+===================================================+=============================================+
| - Generating combinations based on a brainwallet | --numChars [] --userAdress [] --Brainwallet |
| and a number of characters. | |
| - Generating information about addresses and | --privateKey [] --userAdress [] --Directory |
| private keys using a directory and a private key. | |
| - Generating information using mnemonics and | --Bip39 [] --userAdress [] --Mnemonic |
| bip39 and a user's address. | |
+---------------------------------------------------+---------------------------------------------+
[+] - Usage :
- Brainwallet : node index.js --numChars 5 --userAdress "1JRW4d8vHZseMEtYbgJ7MwPG1TasHUUVNq" --Brainwallet
- Private Key : node index.js --privateKey "0000000000000000000000000000000000000000000000000000000000000001"
--userAdress "1JRW4d8vHZseMEtYbgJ7MwPG1TasHUUVNq" --Directory
- Mnemonic : node index.js --Bip39 "fury crime input spirit" --userAdress "1JRW4d8vHZseMEtYbgJ7MwPG1TasHUUVNq"
--Mnemonic
[+] - For more options on how to use the script, visit https://github.com/justNoOneHere/Re.BTC
`
);
}
}
console.clear();
console.log(
`
██▀███ ▓█████ ▄▄▄▄ ▄▄▄█████▓ ▄████▄
▓██ ▒ ██▒▓█ ▀ ▓█████▄ ▓ ██▒ ▓▒▒██▀ ▀█
▓██ ░▄█ ▒▒███ ▒██▒ ▄██▒ ▓██░ ▒░▒▓█ ▄
▒██▀▀█▄ ▒▓█ ▄ ▒██░█▀ ░ ▓██▓ ░ ▒▓▓▄ ▄██▒
░██▓ ▒██▒░▒████▒ ██▓ ░▓█ ▀█▓ ▒██▒ ░ ▒ ▓███▀ ░
░ ▒▓ ░▒▓░░░ ▒░ ░ ▒▓▒ ░▒▓███▀▒ ▒ ░░ ░ ░▒ ▒ ░
`
)
main();