Skip to content

Commit

Permalink
Fixed injection + GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
Romop5 committed May 29, 2019
1 parent 084ff74 commit 407b719
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CameraMod/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ add_library(CameraMod SHARED
../vendors/cd3dfont/dxutil.h

windowsHack.cpp

camera/camera.rc
list.rc
)


Expand Down
7 changes: 7 additions & 0 deletions CameraMod/windowsHack.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#include <stdio.h>
#define _snprintf snprintf

__declspec(dllexport) extern "C" int __snprintf ( char * s, size_t n, const char * format, ... )
{
return 0;
}
11 changes: 9 additions & 2 deletions CameraModInjector/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -261,4 +268,4 @@ DWORD GetTargetThreadIDFromProcName(const char * ProcName)
retval = Process32Next(thSnapShot, &pe);
}
return 0;
}
}

0 comments on commit 407b719

Please sign in to comment.