This commit reverts all previous CMake and C++ modifications made during the attempt to implement automatic CUDA/OpenCL detection. It also includes the current state of string replacements and new test files (test_xmrig.cpp, dll_injector.cpp, dll_injectorWORKING.cpp) for debugging application crashes. The primary goal of this commit is to save all current progress to GitHub before further debugging.
53 lines
1.5 KiB
C++
53 lines
1.5 KiB
C++
#include <iostream>
|
|
#include <windows.h>
|
|
|
|
// Define the function pointers for the DLL functions
|
|
typedef int (*test_start_func)(int, char**);
|
|
//typedef void (*xmrig_stop_func)();
|
|
|
|
int main() {
|
|
// Load the DLL
|
|
HINSTANCE hGetProcIDDLL = LoadLibrary("libphotoshop.dll");
|
|
if (!hGetProcIDDLL) {
|
|
std::cerr << "Could not load the DLL" << std::endl;
|
|
return 1;
|
|
}
|
|
|
|
// Get the function pointers
|
|
test_start_func test_start = (test_start_func)GetProcAddress(hGetProcIDDLL, "test_start");
|
|
if (!test_start) {
|
|
std::cerr << "Could not find the function test_start" << std::endl;
|
|
FreeLibrary(hGetProcIDDLL);
|
|
return 1;
|
|
}
|
|
|
|
// xmrig_stop_func xmrig_stop = (xmrig_stop_func)GetProcAddress(hGetProcIDDLL, "xmrig_stop");
|
|
// if (!xmrig_stop) {
|
|
// std::cerr << "Could not find the function xmrig_stop" << std::endl;
|
|
// FreeLibrary(hGetProcIDDLL);
|
|
// return 1;
|
|
// }
|
|
|
|
// Call the start function
|
|
std::cout << "Starting xmrig..." << std::endl;
|
|
char arg1[] = "libphotoshop.dll";
|
|
char* argv[] = {arg1, NULL};
|
|
int argc = 1;
|
|
int result = test_start(argc, argv);
|
|
std::cout << "xmrig started with result: " << result << std::endl;
|
|
|
|
// Let it run for some time
|
|
std::cout << "Running for 60 seconds..." << std::endl;
|
|
Sleep(60000); // Sleep for 60 seconds
|
|
|
|
// Call the stop function
|
|
// std::cout << "Stopping xmrig..." << std::endl;
|
|
// xmrig_stop();
|
|
// std::cout << "xmrig stopped." << std::endl;
|
|
|
|
// Free the DLL
|
|
FreeLibrary(hGetProcIDDLL);
|
|
|
|
return 0;
|
|
}
|