Code:
#include <windows.h>
#include <stdio.h>
bool writemem(unsigned int addr, const char* data, unsigned int size)
{
bool ret = false;
if (HWND hwnd = FindWindowA(NULL, "Crysis 2 (TM)"))
{
DWORD procid;
if (GetWindowThreadProcessId(hwnd, &procid))
{
if (HANDLE hproc = OpenProcess(PROCESS_VM_OPERATION | PROCESS_VM_WRITE, FALSE, procid))
{
if (WriteProcessMemory(hproc, (void*)addr, data, size, NULL))
ret = true;
CloseHandle(hproc);
}
}
}
return ret;
}
void main(void)
{
bool ammo = false, energy = false, nametags = false;
SetConsoleTitleA("crysis 2 mp trainer 1.1");
printf("crysis 2 mp trainer 1.1\n\nby batfitch - www.*********.com\n\n");
printf("F1 - toggle unlimited ammo / no reload\nF2 - toggle unlimited energy\nF3 - toggle nametags\n\n");
while (true)
{
if (GetAsyncKeyState(VK_F1))
{
Beep(512, 100);
printf("%s", writemem(0x01139BC6, ammo ? "\x74" : "\xEB", 1) ? "ammo toggled\n" : "something went wrong. game running?\n");
ammo = !ammo;
}
else if(GetAsyncKeyState(VK_F2))
{
Beep(512, 100);
printf("%s", writemem(0x0115CBF9, energy ? "\x75" : "\xEB", 1) ? "energy toggled\n" : "something went wrong. game running?\n");
energy = !energy;
}
else if (GetAsyncKeyState(VK_F3))
{
Beep(512, 100);
printf("%s", writemem(0x01317476, nametags ? "\x8A\xD8" : "\xB3\x01", 2) ? "nametags toggled\n" : "something went wrong. game running?\n");
nametags = !nametags;
}
Sleep(100);
}
}
found this on google it was made by by batfitch Tested and it work if you wanna compile it for yourself while we wait for this one to be approved