Solved
Dll Now Looks Like This (this changes recoil in The Division)
Code:
#include <windows.h>
#include <iostream>
using namespace std;
void FunProc()
{
HWND hGame = ::FindWindowW(L"Tom Clancy's The DivisionClass", L"Tom Clancy's The Division");
int newValue = 0;
DWORD pID;
GetWindowThreadProcessId(hGame, &pID);
HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pID);
if (hGame == 0) {
MessageBoxA(0, "Cant Find The Window", 0, 0);
FreeLibraryAndExitThread(GetModuleHandle(L"TheDivisionDLL"), 0);
}
else {
if (WriteProcessMemory(hProc, (LPVOID)0x7FF69A6C2450, &newValue, (DWORD)sizeof(newValue), NULL)) {
MessageBoxA(0, "Wrote To Memory!!!", 0, 0);
FreeLibraryAndExitThread(GetModuleHandle(L"TheDivisionDLL"), 0);
}
else {
MessageBoxA(0, "Failed To Write To Memory", 0, 0);
FreeLibraryAndExitThread(GetModuleHandle(L"TheDivisionDLL"), 0);
}
}
FreeLibraryAndExitThread(GetModuleHandle(L"TheDivisionDLL"), 0);
}
BOOL __stdcall DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
if (fdwReason == DLL_PROCESS_ATTACH)
{
CreateThread(NULL, NULL, (LPTHREAD_START_ROUTINE)FunProc, NULL, NULL, NULL);
MessageBoxA(0, "Dll Injected!!!", 0, 0);
}
else if (fdwReason == DLL_PROCESS_DETACH) {
MessageBoxA(0, "Dll Removed!!!", 0, 0);
}
return 1;
}