diff --git a/AddrGen/AddrGen.vcxproj b/AddrGen/AddrGen.vcxproj index fe2fd05..3fa373b 100644 --- a/AddrGen/AddrGen.vcxproj +++ b/AddrGen/AddrGen.vcxproj @@ -58,15 +58,19 @@ + + + + @@ -108,7 +112,7 @@ Console true - BCrypt.lib;%(AdditionalDependencies) + BCrypt.lib;Shlwapi.lib;%(AdditionalDependencies) @@ -146,7 +150,7 @@ true true true - BCrypt.lib;%(AdditionalDependencies) + BCrypt.lib;Shlwapi.lib;%(AdditionalDependencies) diff --git a/AddressUtil/AddressUtil.vcxproj b/AddressUtil/AddressUtil.vcxproj index 0f97de7..80e6571 100644 --- a/AddressUtil/AddressUtil.vcxproj +++ b/AddressUtil/AddressUtil.vcxproj @@ -73,15 +73,19 @@ + + + + diff --git a/BitCrack.props b/BitCrack.props new file mode 100644 index 0000000..c5dae0a --- /dev/null +++ b/BitCrack.props @@ -0,0 +1,20 @@ + + + + + C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include + C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\lib\x64 + + + + + + $(OPENCL_INCLUDE) + true + + + $(OPENCL_LIB) + true + + + \ No newline at end of file diff --git a/CLKeySearchDevice/CLKeySearchDevice.cpp b/CLKeySearchDevice/CLKeySearchDevice.cpp index ffb5ee0..2ca7346 100644 --- a/CLKeySearchDevice/CLKeySearchDevice.cpp +++ b/CLKeySearchDevice/CLKeySearchDevice.cpp @@ -49,7 +49,7 @@ CLKeySearchDevice::CLKeySearchDevice(uint64_t device, int threads, int pointsPer // Create the context _clContext = new cl::CLContext(_device); Logger::log(LogLevel::Info, "Compiling 'KeySearch.cl'..."); - _clProgram = new cl::CLProgram(*_clContext, "KeySearch.cl"); + _clProgram = new cl::CLProgram(*_clContext, util::getExeDirectory() + "KeySearch.cl"); // Load the kernels _initKeysKernel = new cl::CLKernel(*_clProgram, "multiplyStepKernel"); diff --git a/CLKeySearchDevice/CLKeySearchDevice.vcxproj b/CLKeySearchDevice/CLKeySearchDevice.vcxproj index fcef466..1b40e78 100644 --- a/CLKeySearchDevice/CLKeySearchDevice.vcxproj +++ b/CLKeySearchDevice/CLKeySearchDevice.vcxproj @@ -58,15 +58,19 @@ + + + + @@ -78,7 +82,7 @@ true true true - $(SolutionDir)\KeyFinderLib;$(SolutionDir)\clUtil;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include;$(SolutionDir)\secp256k1lib;$(SolutionDir)\Logger;$(SolutionDir)\util;%(AdditionalIncludeDirectories) + $(SolutionDir)\KeyFinderLib;$(SolutionDir)\clUtil;$(OPENCL_INCLUDE);$(SolutionDir)\secp256k1lib;$(SolutionDir)\Logger;$(SolutionDir)\util;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) @@ -102,7 +106,7 @@ Disabled true true - $(SolutionDir)\KeyFinderLib;$(SolutionDir)\clUtil;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include;$(SolutionDir)\secp256k1lib;$(SolutionDir)\Logger;$(SolutionDir)\util;%(AdditionalIncludeDirectories) + $(SolutionDir)\KeyFinderLib;$(SolutionDir)\clUtil;$(OPENCL_INCLUDE);$(SolutionDir)\secp256k1lib;$(SolutionDir)\Logger;$(SolutionDir)\util;%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions) diff --git a/CmdParse/CmdParse.vcxproj b/CmdParse/CmdParse.vcxproj index 86f0253..b03fa53 100644 --- a/CmdParse/CmdParse.vcxproj +++ b/CmdParse/CmdParse.vcxproj @@ -64,15 +64,19 @@ + + + + diff --git a/CryptoUtil/CryptoUtil.vcxproj b/CryptoUtil/CryptoUtil.vcxproj index 4821f6d..5735fb3 100644 --- a/CryptoUtil/CryptoUtil.vcxproj +++ b/CryptoUtil/CryptoUtil.vcxproj @@ -67,15 +67,19 @@ + + + + diff --git a/CudaKeySearchDevice/CudaKeySearchDevice.vcxproj b/CudaKeySearchDevice/CudaKeySearchDevice.vcxproj index 80ba4ef..762ca11 100644 --- a/CudaKeySearchDevice/CudaKeySearchDevice.vcxproj +++ b/CudaKeySearchDevice/CudaKeySearchDevice.vcxproj @@ -74,7 +74,7 @@ Disabled WIN32;WIN64;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) %(AdditionalUsingDirectories) - $(SolutionDir)\secp256k1lib;$(SolutionDir)\KeyFinderLib;$(SolutionDir)\Logger;$(SolutionDir)\Util;$(SolutionDir)\CudaMath;$(SolutionDir)\cudaUtil;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include;$(SolutionDir)\AddressUtil + $(SolutionDir)\secp256k1lib;$(SolutionDir)\KeyFinderLib;$(SolutionDir)\Logger;$(SolutionDir)\Util;$(SolutionDir)\CudaMath;$(SolutionDir)\cudaUtil;$(SolutionDir)\AddressUtil;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include true @@ -95,7 +95,7 @@ true WIN32;WIN64;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) %(AdditionalUsingDirectories) - $(SolutionDir)\secp256k1lib;$(SolutionDir)\KeyFinderLib;$(SolutionDir)\Logger;$(SolutionDir)\Util;$(SolutionDir)\CudaMath;$(SolutionDir)\cudaUtil;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include;$(SolutionDir)\AddressUtil + $(SolutionDir)\secp256k1lib;$(SolutionDir)\KeyFinderLib;$(SolutionDir)\Logger;$(SolutionDir)\Util;$(SolutionDir)\CudaMath;$(SolutionDir)\cudaUtil;$(SolutionDir)\AddressUtil;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include true diff --git a/KeyFinder/KeyFinder.vcxproj b/KeyFinder/KeyFinder.vcxproj index d0d16ee..73de49e 100644 --- a/KeyFinder/KeyFinder.vcxproj +++ b/KeyFinder/KeyFinder.vcxproj @@ -59,15 +59,19 @@ + + + + @@ -109,13 +113,13 @@ Level3 Disabled _CRT_SECURE_NO_WARNINGS;BUILD_CUDA;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - $(SolutionDir)\KeyFinderLib;$(SolutionDir)\util;$(SolutionDir)\AddressUtil;$(SolutionDir)\secp256k1lib;$(SolutionDir)\CmdParse;$(SolutionDir)\cudaDeviceContext;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include;$(SolutionDir)\cudaUtil;$(SolutionDir)\Logger;$(SolutionDir)\CudaKeySearchDevice + $(SolutionDir)\KeyFinderLib;$(SolutionDir)\util;$(SolutionDir)\AddressUtil;$(SolutionDir)\secp256k1lib;$(SolutionDir)\CmdParse;$(SolutionDir)\cudaDeviceContext;$(CUDA_INCLUDE);$(SolutionDir)\cudaUtil;$(SolutionDir)\Logger;$(SolutionDir)\CudaKeySearchDevice;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include Console true C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\lib\x64;%(AdditionalLibraryDirectories) - cuda.lib;cudart.lib;BCrypt.lib;%(AdditionalDependencies) + cuda.lib;cudart.lib;Shlwapi.lib;BCrypt.lib;%(AdditionalDependencies) @@ -147,7 +151,7 @@ true true _CRT_SECURE_NO_WARNINGS;BUILD_CUDA;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - $(SolutionDir)\KeyFinderLib;$(SolutionDir)\util;$(SolutionDir)\AddressUtil;$(SolutionDir)\secp256k1lib;$(SolutionDir)\CmdParse;$(SolutionDir)\cudaDeviceContext;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include;$(SolutionDir)\cudaUtil;$(SolutionDir)\Logger;$(SolutionDir)\CudaKeySearchDevice + $(SolutionDir)\KeyFinderLib;$(SolutionDir)\util;$(SolutionDir)\AddressUtil;$(SolutionDir)\secp256k1lib;$(SolutionDir)\CmdParse;$(SolutionDir)\cudaDeviceContext;$(CUDA_INCLUDE);$(SolutionDir)\cudaUtil;$(SolutionDir)\Logger;$(SolutionDir)\CudaKeySearchDevice;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include Console @@ -155,7 +159,7 @@ true true C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\lib\x64;%(AdditionalLibraryDirectories) - cuda.lib;cudart.lib;BCrypt.lib;%(AdditionalDependencies) + cuda.lib;cudart.lib;Shlwapi.lib;BCrypt.lib;%(AdditionalDependencies) diff --git a/KeyFinderLib/KeyFinderLib.vcxproj b/KeyFinderLib/KeyFinderLib.vcxproj index 102428d..3f7da24 100644 --- a/KeyFinderLib/KeyFinderLib.vcxproj +++ b/KeyFinderLib/KeyFinderLib.vcxproj @@ -35,9 +35,11 @@ + + diff --git a/Logger/Logger.vcxproj b/Logger/Logger.vcxproj index 5b35ef1..cbbb9a9 100644 --- a/Logger/Logger.vcxproj +++ b/Logger/Logger.vcxproj @@ -69,15 +69,19 @@ + + + + diff --git a/clKeyFinder/clKeyFinder.vcxproj b/clKeyFinder/clKeyFinder.vcxproj index 905bbeb..c0a6161 100644 --- a/clKeyFinder/clKeyFinder.vcxproj +++ b/clKeyFinder/clKeyFinder.vcxproj @@ -58,15 +58,19 @@ + + + + @@ -83,12 +87,12 @@ Disabled true true - $(SolutionDir)\KeyFinderLib;$(SolutionDir)\AddressUtil;$(SolutionDir)\Logger;$(SolutionDir)\CmdParse;$(SolutionDir)\CLKeySearchDevice;$(SolutionDir)\secp256k1lib;$(SolutionDir)\util;$(SolutionDir)\clUtil;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include;%(AdditionalIncludeDirectories) + $(SolutionDir)\KeyFinderLib;$(SolutionDir)\AddressUtil;$(SolutionDir)\Logger;$(SolutionDir)\CmdParse;$(SolutionDir)\CLKeySearchDevice;$(SolutionDir)\secp256k1lib;$(SolutionDir)\util;$(SolutionDir)\clUtil;$(OPENCL_INCLUDE);%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;BUILD_OPENCL;%(PreprocessorDefinitions) - OpenCL.lib;BCrypt.lib;%(AdditionalDependencies) - C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\lib\x64;%(AdditionalLibraryDirectories) + OpenCL.lib;Shlwapi.lib;BCrypt.lib;%(AdditionalDependencies) + $(OPENCL_LIB);%(AdditionalLibraryDirectories) @@ -138,14 +142,14 @@ true true true - $(SolutionDir)\KeyFinderLib;$(SolutionDir)\AddressUtil;$(SolutionDir)\Logger;$(SolutionDir)\CmdParse;$(SolutionDir)\CLKeySearchDevice;$(SolutionDir)\secp256k1lib;$(SolutionDir)\util;$(SolutionDir)\clUtil;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include;%(AdditionalIncludeDirectories) + $(SolutionDir)\KeyFinderLib;$(SolutionDir)\AddressUtil;$(SolutionDir)\Logger;$(SolutionDir)\CmdParse;$(SolutionDir)\CLKeySearchDevice;$(SolutionDir)\secp256k1lib;$(SolutionDir)\util;$(SolutionDir)\clUtil;$(OPENCL_INCLUDE);%(AdditionalIncludeDirectories) _CRT_SECURE_NO_WARNINGS;BUILD_OPENCL;%(PreprocessorDefinitions) true true - OpenCL.lib;BCrypt.lib;%(AdditionalDependencies) - C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\lib\x64;%(AdditionalLibraryDirectories) + OpenCL.lib;Shlwapi.lib;BCrypt.lib;%(AdditionalDependencies) + $(OPENCL_LIB);%(AdditionalLibraryDirectories) diff --git a/clUtil/clUtil.vcxproj b/clUtil/clUtil.vcxproj index 43c7832..3afef09 100644 --- a/clUtil/clUtil.vcxproj +++ b/clUtil/clUtil.vcxproj @@ -58,15 +58,19 @@ + + + + @@ -78,7 +82,7 @@ true true true - C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include;%(AdditionalIncludeDirectories) + $(OPENCL_INCLUDE);%(AdditionalIncludeDirectories) true @@ -100,7 +104,7 @@ Disabled true true - C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.2\include;%(AdditionalIncludeDirectories) + $(OPENCL_INCLUDE);%(AdditionalIncludeDirectories) diff --git a/secp256k1lib/secp256k1lib.vcxproj b/secp256k1lib/secp256k1lib.vcxproj index 1665127..9e1d6a7 100644 --- a/secp256k1lib/secp256k1lib.vcxproj +++ b/secp256k1lib/secp256k1lib.vcxproj @@ -69,15 +69,19 @@ + + + + diff --git a/util/util.cpp b/util/util.cpp index 641fc8a..22914b2 100644 --- a/util/util.cpp +++ b/util/util.cpp @@ -8,10 +8,12 @@ #ifdef _WIN32 #include +#include #else #include #include #include +#include #endif namespace util { @@ -277,4 +279,25 @@ namespace util { { return (x << 24) | ((x << 8) & 0x00ff0000) | ((x >> 8) & 0x0000ff00) | (x >> 24); } + +#ifdef _WIN32 + std::string getExeDirectory() + { + char dir[512] = {0}; + + GetModuleFileNameA(GetModuleHandle(NULL), dir, sizeof(dir)); + PathRemoveFileSpecA(dir); + + return std::string(dir) + "\\"; + } +#else + std::string getExeDirectory() + { + char buf[512] = {0}; + + readlink("/proc/self/exe", buf, sizeof(buf)); + + return std::string(dirname(buf)) + "/"; + } +#endif } \ No newline at end of file diff --git a/util/util.h b/util/util.h index 3f05875..897b3c5 100644 --- a/util/util.h +++ b/util/util.h @@ -37,6 +37,8 @@ std::string format(uint64_t value); std::string format(int value); void removeNewline(std::string &s); unsigned int endian(unsigned int x); + +std::string getExeDirectory(); } #endif \ No newline at end of file diff --git a/util/util.vcxproj b/util/util.vcxproj index 229a11c..101cc10 100644 --- a/util/util.vcxproj +++ b/util/util.vcxproj @@ -64,15 +64,19 @@ + + + +