Help with the code :/
Hey guys, I'm learning how to make a basic trainer for Assault Cube. It's a free game. I got a sourcecode from: http://www.mpgh.net/forum/31-c-c-pro...hack-tool.html
I changed it a bit. I got address for HP: 02A7A3D8, I guess I should add 0x before the code? Sorry for the noobie question :/.
When I run it with the game and I want to change HP, the trainer doesn't do this.
Help please.
I changed it a bit. I got address for HP: 02A7A3D8, I guess I should add 0x before the code? Sorry for the noobie question :/.
When I run it with the game and I want to change HP, the trainer doesn't do this.
Code:
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;
}

