Browse Source

multiple search addresses

pull/90/head
wipedlifepotato 10 months ago
parent
commit
3acfdccac3
  1. 45
      vain.cpp
  2. 21
      vanity.hpp

45
vain.cpp

@ -3,24 +3,10 @@ @@ -3,24 +3,10 @@
#include<getopt.h>
#include<string>
#include<boost/filesystem.hpp>
//#include<boost/algorithm/string/predicate.hpp>
//#include<format> // is not supports for me
/// Crypto InitCrypto. TODO: to makefile/another place get the macro
#ifndef PRECOMPUTATION_CRYPTO
#define PRECOMPUTATION_CRYPTO false
#endif
#ifndef AESNI_CRYPTO
#define AESNI_CRYPTO false
#endif
#ifndef AVX_CRYPTO
#define AVX_CRYPTO false
#endif
#ifndef FORCE_CRYPTO
#define FORCE_CRYPTO false
#endif
#define DEF_OUT_FILE "private.dat"
// some global vars in vanitygen.hpp
static struct{
bool reg=false;
int threads=-1;
@ -240,6 +226,7 @@ void usage(void){ @@ -240,6 +226,7 @@ void usage(void){
"-o --output output file(default " DEF_OUT_FILE ")\n"
//"--usage usage\n"
//"--prefix -p\n"
"--multiplymode -m - multiple addresses search"
"";
puts(help);
}
@ -253,18 +240,22 @@ void parsing(int argc, char ** args){ @@ -253,18 +240,22 @@ void parsing(int argc, char ** args){
{"threads", required_argument, 0, 't'},
{"signature", required_argument,0,'s'},
{"output", required_argument,0,'o'},
{"multiplymode", no_argument, 0, 'm'},
//{"usage", no_argument,0,0},
{0,0,0,0}
};
int c;
while( (c=getopt_long(argc,args, "hrt:s:o:", long_options, &option_index))!=-1){
while( (c=getopt_long(argc,args, "hrt:s:o:m", long_options, &option_index))!=-1){
switch(c){
//case 0:
// if ( std::string(long_options[option_index].name) == std::string("usage") ){
// usage();
// exit(1);
// }
case 'm':
multipleSearchMode=true;
break;
case 'h':
usage();
exit(0);
@ -357,6 +348,10 @@ int main (int argc, char * argv[]) @@ -357,6 +348,10 @@ int main (int argc, char * argv[])
if ( !std::regex_match( std::string(argv[1]), std::regex("[a-zA-Z0-9\\.]{1,}")) ) {
std::cerr << "Please, change the outputfile name" << std::endl;
}
//
if ( options . outputpath . empty () ) options . outputpath . assign ( DEF_OUT_FILE ) ;
static std::string outPutFileName = options.outputpath;
auto doSearch = [argc,argv] () {
auto keys = i2p::data::PrivateKeys::CreateRandomKeys (options.signature);
// IDK type, and don't want to check. so...
auto createDumpFile = [/*keys*/](std::string outFile, i2p::data::PrivateKeys keys){
@ -460,7 +455,10 @@ int main (int argc, char * argv[]) @@ -460,7 +455,10 @@ int main (int argc, char * argv[])
// IDK. what for acetone change this line to if (options.output...empty() ... assign
// cplusplus.com/reference/string/string/assign yes we can. but I would don't change this
//if(options.outputpath.size() == 0) options.outputpath = DEF_OUT_FILE;
if ( options . outputpath . empty () ) options . outputpath . assign ( DEF_OUT_FILE ) ;
options.outputpath = options.outputpath + std::to_string(foundKeys) + std::string(".dat");
//if ( ! boost::algorithm::ends_with(options.outputpath, ".dat") )
// options.outputpath = options.outputpath + ".dat";
// there we generate a key, like as in keygen.cpp
// before a mining we would to create a dump file
@ -477,8 +475,17 @@ int main (int argc, char * argv[]) @@ -477,8 +475,17 @@ int main (int argc, char * argv[])
else
std::cout << "Can't create file " << options.outputpath << std::endl;
i2p::crypto::TerminateCrypto ();
}; // void doSearch lamda
do {
doSearch();
foundKeys++;
options.outputpath.assign(outPutFileName);
found = false;
FoundNonce = 0;
} while(multipleSearchMode);
i2p::crypto::TerminateCrypto ();
return 0;
}

21
vanity.hpp

@ -41,8 +41,27 @@ @@ -41,8 +41,27 @@
//static i2p::data::SigningKeyType type;
//static i2p::data::PrivateKeys keys;
static bool found=false;
// for InitCrypto. TODO: to makefile/another place get the macro
#ifndef PRECOMPUTATION_CRYPTO
#define PRECOMPUTATION_CRYPTO false
#endif
#ifndef AESNI_CRYPTO
#define AESNI_CRYPTO false
#endif
#ifndef AVX_CRYPTO
#define AVX_CRYPTO false
#endif
#ifndef FORCE_CRYPTO
#define FORCE_CRYPTO false
#endif
// def out file name
#define DEF_OUT_FILE "private"
// Global vars
static bool found=false;
static bool multipleSearchMode = false;
static unsigned int foundKeys = 0;
static size_t MutateByte;
static uint32_t FoundNonce=0;

Loading…
Cancel
Save