using namespace std;
int main()
{
system("color 0A");
cout << "Waiting for the Assault Cube..." << endl;
system("Pause");
LPCWSTR Dupa = L"AssaultCube";
HWND hwnd = FindWindow(0, Dupa);
if (hwnd == 0)
{
cout << "The game has not been found... please open it before opening the tool next time..." << endl;
system("Pause");
}
else
{
DWORD proces;
GetWindowThreadProcessId(hwnd, &proces);
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, proces);
cout << "Game was found...Enjoy it!" << endl;
system("Pause");
cout << "Type 1 for HP" << endl;
cout << "Type : ";
int Option;
cin >> Option;
if (Option > 1)
{
cout << "There is no option higher than 1..." << endl;
system("Pause");
}
if (Option == 1)
{
cout << "What do you want to set your HP as?" << endl;
cout << "Type : ";
int HP;
cin >> HP;
DWORD nowa = sizeof(HP);
if (WriteProcessMemory(hProcess, (LPVOID)0x02A7A3D8, &HP, nowa, NULL))
{
cout << "The HP has been written sucessfully!!" << endl;
system("Pause");
}
else
{
cout << "There was an error writing the HP..." << endl;
system("Pause");
}
}
CloseHandle(hProcess);
}
main();
return 0;
}

printf("Error: 0x%X", GetLastError())