diff --git a/CameraMod/CMakeLists.txt b/CameraMod/CMakeLists.txt index 48545e3..78f5696 100644 --- a/CameraMod/CMakeLists.txt +++ b/CameraMod/CMakeLists.txt @@ -28,6 +28,9 @@ add_library(CameraMod SHARED ../vendors/cd3dfont/dxutil.h windowsHack.cpp + + camera/camera.rc + list.rc ) diff --git a/CameraMod/windowsHack.cpp b/CameraMod/windowsHack.cpp new file mode 100644 index 0000000..f2151dc --- /dev/null +++ b/CameraMod/windowsHack.cpp @@ -0,0 +1,7 @@ +#include +#define _snprintf snprintf + + __declspec(dllexport) extern "C" int __snprintf ( char * s, size_t n, const char * format, ... ) +{ + return 0; +} diff --git a/CameraModInjector/Main.cpp b/CameraModInjector/Main.cpp index 79f8801..c97228f 100644 --- a/CameraModInjector/Main.cpp +++ b/CameraModInjector/Main.cpp @@ -91,9 +91,16 @@ bool IsGameRunning() HMODULE InjectDLL(DWORD ProcessID, char* dllName) { + char buf[50] = { 0 }; + HMODULE result = LoadLibrary(dllname); + if(result == NULL) + { + sprintf_s(buf, "Failed to load library: %d", GetLastError()); + MessageBoxA(NULL, buf, "Loader", NULL); + return false; + } HANDLE Proc; HANDLE Thread; - char buf[50] = { 0 }; LPVOID RemoteString, LoadLibAddy; HMODULE hModule = NULL; DWORD dwOut; @@ -261,4 +268,4 @@ DWORD GetTargetThreadIDFromProcName(const char * ProcName) retval = Process32Next(thSnapShot, &pe); } return 0; -} \ No newline at end of file +}