diff --git a/CubeModLauncher/Process.cpp b/CubeModLauncher/Process.cpp index 1dd0b57..06099cf 100644 --- a/CubeModLauncher/Process.cpp +++ b/CubeModLauncher/Process.cpp @@ -20,7 +20,7 @@ bool Process::InjectDLL(string dllName) { LPVOID load_library = (LPVOID) GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "LoadLibraryA"); LPVOID remote_string = (LPVOID) VirtualAllocEx(pi.hProcess, NULL, strlen(dllName.c_str()) + 1, MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE); WriteProcessMemory(pi.hProcess, remote_string, dllName.c_str(), strlen(dllName.c_str()) + 1, NULL); - HANDLE thread = CreateRemoteThread(pi.hProcess, NULL, NULL, (LPTHREAD_START_ROUTINE) load_library, remote_string, CREATE_SUSPENDED, NULL); + HANDLE thread = CreateRemoteThread(pi.hProcess, NULL, 0, (LPTHREAD_START_ROUTINE) load_library, remote_string, CREATE_SUSPENDED, NULL); ResumeThread(thread); return true; } diff --git a/CubeModLauncher/main.cpp b/CubeModLauncher/main.cpp index bcd0c68..9197f9b 100644 --- a/CubeModLauncher/main.cpp +++ b/CubeModLauncher/main.cpp @@ -11,7 +11,7 @@ #define MODLOADER_CRC 0x39D18E98 -#define CUBE_EXECUTABLE "cubeworld.exe" +const char* CUBE_EXECUTABLE = "cubeworld.exe"; using namespace std; @@ -31,6 +31,9 @@ int main(int argc, char** argv) { if (argc >= 2 && !strcmp(argv[1], "test")) { testMode = true; printf("Test mode enabled. CRC checks will be bypassed.\n"); + if (argc >= 3) { + CUBE_EXECUTABLE = argv[2]; + } } //Cube world is obviously required diff --git a/CubeModLoader/DLL.cpp b/CubeModLoader/DLL.cpp index fcfa6d1..ebcd1ac 100644 --- a/CubeModLoader/DLL.cpp +++ b/CubeModLoader/DLL.cpp @@ -9,7 +9,7 @@ DLL::DLL(std::string fileName) { HMODULE DLL::Load() { this->handle = LoadLibraryA(this->fileName.c_str()); if (!this->handle) { - printf("Could not load %s: %d\n", this->fileName.c_str(), GetLastError()); + printf("Could not load %s: %ld\n", this->fileName.c_str(), GetLastError()); exit(1); } return this->handle; diff --git a/CubeModLoader/main.cpp b/CubeModLoader/main.cpp index aaff897..498428b 100644 --- a/CubeModLoader/main.cpp +++ b/CubeModLoader/main.cpp @@ -57,7 +57,7 @@ void SetupHandlers() { SetupP2PRequestHandler(); } -void Popup(char* title, char* msg ){ +void Popup(const char* title, char* msg ){ MessageBoxA(0, msg, title, MB_OK | MB_ICONINFORMATION); }