Hey guys, i have been learn c++ for about 3 weeks, and decided to make a quick ammo trainer for SP.
#include <iostream>
#include <Windows.h>
#include <string>
using namespace std;
DWORD pid;
DWORD ammo = 0x0F820A0;
int myammo = 900;
int main()
{
HWND hWnd = FindWindowA(0, ("iw5sp"));
GetWindowThreadProcessId(hWnd, &pid);
HANDLE pHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);
WriteProcessMemory(pHandle, (LPVOID)ammo, &myammo, sizeof(myammo), 0);
system("pause");
}
That's my code, but when i execute it nothing happens in my game :|
Where did i go wrong? Thanks
- - - Updated - - -
Disregard this, solved it
i had the wrong address and window name
