forked from lmajowka/btc-finder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
84 lines (67 loc) · 3.82 KB
/
main.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
77
78
79
80
81
82
83
84
import ranges from './ranges.js'
import encontrarBitcoins from './bitcoin-find.js'
import readline from 'readline'
import chalk from 'chalk'
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
let key = 0;
let min, max = 0;
console.clear();
console.log("\x1b[38;2;250;128;114m" + "╔════════════════════════════════════════════════════════╗\n" +
"║" + "\x1b[0m" + "\x1b[36m" + " ____ _____ ____ _____ ___ _ _ ____ _____ ____ " + "\x1b[0m" + "\x1b[38;2;250;128;114m" + "║\n" +
"║" + "\x1b[0m" + "\x1b[36m" + " | __ )_ _/ ___| | ___|_ _| \\ | | _ \\| ____| _ \\ " + "\x1b[0m" + "\x1b[38;2;250;128;114m" + "║\n" +
"║" + "\x1b[0m" + "\x1b[36m" + " | _ \\ | || | | |_ | || \\| | | | | _| | |_) | " + "\x1b[0m" + "\x1b[38;2;250;128;114m" + "║\n" +
"║" + "\x1b[0m" + "\x1b[36m" + " | |_) || || |___ | _| | || |\\ | |_| | |___| _ < " + "\x1b[0m" + "\x1b[38;2;250;128;114m" + "║\n" +
"║" + "\x1b[0m" + "\x1b[36m" + " |____/ |_| \\____| |_| |___|_| \\_|____/|_____|_| \\_\\ " + "\x1b[0m" + "\x1b[38;2;250;128;114m" + "║\n" +
"║" + "\x1b[0m" + "\x1b[36m" + " " + "\x1b[0m" + "\x1b[38;2;250;128;114m" + "║\n" +
"╚══════════════════════\x1b[32m" + "Investidor Internacional - v0.3" + "\x1b[0m\x1b[38;2;250;128;114m═══╝" + "\x1b[0m");
rl.question(`Escolha uma carteira puzzle( ${chalk.cyan(1)} - ${chalk.cyan(160)}): `, (answer) => {
if (parseInt(answer) < 1 || parseInt(answer) > 160) {
console.log(chalk.bgRed('Erro: voce precisa escolher um numero entre 1 e 160'))
}
min = ranges[answer-1].min
max = ranges[answer-1].max
console.log('Carteira escolhida: ', chalk.cyan(answer), ' Min: ', chalk.yellow(min), ' Max: ', chalk.yellow(max) )
console.log('Numero possivel de chaves:', chalk.yellow(parseInt(BigInt(max) - BigInt(min)).toLocaleString('pt-BR')))
key = BigInt(min)
rl.question(`Escolha uma opcao (${chalk.cyan(1)} - Comecar do inicio, ${chalk.cyan(2)} - Escolher uma porcentagem, ${chalk.cyan(3)} - Escolher minimo): `, (answer2) => {
if (answer2 == '2'){
rl.question('Escolha um numero entre 0 e 1: ', (answer3) => {
if (parseFloat(answer3) > 1 || parseFloat(answer3) < 0) {
console.log(chalk.bgRed('Erro: voce precisa escolher um numero entre 0 e 1'))
throw 'Numero invalido'
}
const range = BigInt(max) - BigInt(min);
const percentualRange = range * BigInt(Math.floor(parseFloat(answer3) * 1e18)) / BigInt(1e18);
min = BigInt(min) + BigInt(percentualRange);
console.log('Comecando em: ', chalk.yellow('0x'+min.toString(16)));
key = BigInt(min)
encontrarBitcoins(key, min, max)
rl.close();
});
} else if (answer2 == '3'){
rl.question('Entre o minimo: ', (answer3) => {
min = BigInt(answer3)
key = BigInt(min)
encontrarBitcoins(key, min, max)
rl.close();
});
} else {
min = BigInt(min)
encontrarBitcoins(key, min, max)
rl.close();
}
})
});
rl.on('SIGINT', () => {
rl.close();
process.exit();
});
// Handle SIGINT (Ctrl+C)
process.on('SIGINT', () => {
console.log(chalk.yellow('\nGracefully shutting down from SIGINT (Ctrl+C)'));
rl.close();
process.exit();
});