Hello everyone you guys may have seen that i have posted earlier in this forum but i am still running into problems. This will be the last time i post here for help if this go around does not work. I am having troubles with the FindWindow function as it seems that my program cannot find the black ops 3 window for some reason. any help?
code:
Code:
#include <iostream>
#include <windows.h>
#include<TlHelp32.h>
#include<string>
using namespace std;
HANDLE hProcess;
void WriteProcessMemory()
{
DWORD pid;
HWND hWindow = FindWindow(0, L"BlackOps3");
GetWindowThreadProcessId(hWindow, &pid);
hProcess = OpenProcess(PROCESS_ALL_ACCESS, 0, pid);
if (hWindow == 0)
{
cout << "Cannot find Black Ops, Exiting..." << endl;
Sleep(5000);
exit(1);
}
}
void appTitle()
{
system("title Black Cocks Trainer");
WriteProcessMemory();
}
void appFeatures()
{
system("color a");
cout << "Created by : FLUFFYBANANAS21" << endl;
cout << "----------------------------" << endl << endl << endl;
cout << "NUMPAD 1 = UNLIMITED AMMO" << endl;
cout << "NUMPAD 2 = UNLIMITED POINTS(1000000)" << endl;
cout << "NUMPAD 3 = GODMODE" << endl;
}
void appHotkeys()
{
int iAmmo = 50;
int iPoints = 1000000;
int iGodmode = 1000000;
WriteProcessMemory();
while (true)
{
if (GetAsyncKeyState(VK_ESCAPE))
{
cout << "Closing and freeing memory..." << endl;
Sleep(5000);
exit(1);
}
if (GetAsyncKeyState(VK_NUMPAD1))
{
Sleep(1000);
//hacks under here... (writeprocess)
WriteProcessMemory(hProcess, (LPVOID)0x0147B7FB98, &iAmmo, (DWORD)sizeof(iAmmo), NULL); //primary clip
}
if (GetAsyncKeyState(VK_NUMPAD2))
{
Sleep(1000);
//hacks under here... (writeprocess)
WriteProcessMemory(hProcess, (LPVOID)0x0147B96374, &iPoints, (DWORD)sizeof(iAmmo), NULL); //zombie points
}
if (GetAsyncKeyState(VK_NUMPAD3))
{
WriteProcessMemory(hProcess, (LPVOID)0x0147621428, &iGodmode, (DWORD)sizeof(iGodmode), NULL);//player health
}
}
}
int main()
{
appTitle();
appFeatures();
appHotkeys();
}