#include <Windows.h>
#define ADR_HP ADDRESS
void WriteMemory(DWORD address, DWORD value)
{
DWORD dwOldProt;
VirtualProtect((LPVOID)address, 4, PAGE_READWRITE, &dwOldProt);
*(DWORD *)address = value;
VirtualProtect((LPVOID)address, 4, dwOldProt, &dwOldProt);
}
int __stdcall DllMain(HMODULE hModule, DWORD dwReasons, LPVOID lpReserved)
{
if(GetAsyncKeyState(VK_F1))
{
WriteMemory(ADR_HP, 0);
}
}
#include <Windows.h>
#include <process.h>
//Variables
INT Hack[100];
//Address
#define ADR_HP 0x000000
#define ADR_Ammo 0x000000
VOID WriteMemory(DWORD Address, DWORD Value)
{
DWORD dwOldProt;
VirtualProtect((LPVOID)Address, 4, PAGE_READWRITE, &dwOldProt);
*(DWORD *)Address = Value;
VirtualProtect((LPVOID)Address, 4, dwOldProt, &dwOldProt);
}
VOID Cheats()
{
if(GetAsyncKeyState(VK_F1)&1) Hack[0] =! Hack[0];
if(GetAsyncKeyState(VK_F2)&1) Hack[1] =! Hack[1];
if(Hack[0])
{
WriteMemory(ADR_HP, 100);
}
if(Hack[1])
{
WriteMemory(ADR_Ammo, 999);
}
}
UINT WINAPI Main(VOID *)
{
while(!(DWORD)GetModuleHandleA("GameProcess.exe"))
Sleep(100);
__asm
{
CALL [Cheats]
}
return FALSE;
}
BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
{
DisableThreadLibraryCalls(hModule);
if(dwReason == DLL_PROCESS_ATTACH)
{
_beginthreadex(NULL, NULL, &Main, NULL, NULL, NULL);
}
return TRUE;
}