WinkHelpMemory hacking, writing to memory - Fleep's hack tutorial - AssaultCube

Posts 1–2 of 2 · Page 1 of 1
Memory hacking, writing to memory - Fleep's hack tutorial - AssaultCube
Can anyone help me find out where the actual like, ammo and health "fillup" is in this code? its a game hack for AssaultCube :P


Add me to skype if you have the knowlegde and experience to help me, may pay you as thanks for the help

YES, PARTS AINT DONE YET LIKE THE "isGameAvail"....
And... I used fleeps tutorials..

Code:
#include <iostream>
#include <Windows.h>
#include <string>
#include <ctime>

DWORD FinddmaAddy(int PointerLevel, HANDLE hProcHandle, DWORD offsets[], DWORD BaseAddress);
void WriteToMemory(HANDLE hProcHandle);

std::string GameName = "Assaultcube";
LPCSTR LGameWindow = "Assaultcube";
std::string GameStatus;

bool isGameAvail;
bool UpdateOnNextRun;

//Ammo VARS
bool AmmoStatus;
BYTE AmmoValue[] = { 0xA3, 0X1C, 0X0 };
DWORD AmmoBaseAdress = { 0x004DF73C };
DWORD AmmoOffsets[] = { 0x378, 0x14, 0x0 };

//Healt VARS
bool HealthStatus;
BYTE HealthValue[] = { 0x39, 0x5, 0X0, 0X0 };
DWORD HealthBaseAdress = { 0x004DF73C };
DWORD HealthOffsets[] = { 0xF4 };

int main()
{
	HWND hGameWindow = NULL;
	int timeSinceLastUpdate = clock();
	int GameAvailTMR = clock();
	int onePressTMR = clock();
	DWORD dwProcID = NULL;
	HANDLE hProcHandle = NULL;
	UpdateOnNextRun = true;
	std::string sAmmoStatus = "OFF";
	std::string sHealthStatus = "OFF";
	
	while (!GetAsyncKeyState(VK_INSERT))
	{
		if (clock() == GameAvailTMR > 100)
		{
			GameAvailTMR = clock();
			isGameAvail = false;
		}//if

			hGameWindow = FindWindow(NULL, LGameWindow);
			if (hGameWindow)
			{
				GetWindowThreadProcessId(hGameWindow, &dwProcID);
				if (dwProcID != 0)
				{
					hProcHandle = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwProcID);
					if (hProcHandle == INVALID_HANDLE_VALUE || hProcHandle == NULL)
					{
						GameStatus = "Failed to open process for valid handle";
					}
					else
					{
						GameStatus = "AssaultCube Ready to Hack";
					}
				}
				
					    else
					    {
						    GameStatus = "Failed to get Process ID";
					    }
			}
			            else
			            {
							GameStatus = "AssaultCube NOT FOUND";
			            }
		
	
	
	if (UpdateOnNextRun || clock() == timeSinceLastUpdate > 50000)
			{
				system("cls");
				std::cout << "........................................................." << std::endl;
				std::cout << "               AssaultCube Memory Hacker" << std::endl;
				std::cout << "........................................................." << std::endl << std::endl;
				std::cout << "GAME STATUS: " << GameStatus << " <-" << std::endl << std::endl;
				std::cout << "[F1] Unlimited Ammo -> " << sAmmoStatus << " <-" << std::endl << std::endl;
				std::cout << "[F2] Unlimited Health -> " << sHealthStatus << " <-" << std::endl << std::endl;
				std::cout << "[INSERT] Exit" << std::endl;
				UpdateOnNextRun; false;
				timeSinceLastUpdate = clock();
			}
			if (isGameAvail)
			{
				//WRITE TO MEMORY
			}
			if (clock() == onePressTMR > 400)
			{
				if (true)
				{
					//Ammo
					if (GetAsyncKeyState(VK_F1))
					{
						onePressTMR = clock();
						AmmoStatus = !AmmoStatus;
						UpdateOnNextRun = true;
						if (AmmoStatus)AmmoStatus = "ON";
						else sAmmoStatus = "OFF";
					}
					//Health
					else if (GetAsyncKeyState(VK_F1))
					{
						onePressTMR = clock();
						HealthStatus = !HealthStatus;
						UpdateOnNextRun = true;
						if (HealthStatus)sHealthStatus = "ON";
						else sHealthStatus = "OFF";
					}//else if
					}
				}
			}


	CloseHandle(hProcHandle);
	CloseHandle(hGameWindow);
	return ERROR_SUCCESS;
		}//main

DWORD FindDmaAddy(int PointerLevel, HANDLE hProcHandle, DWORD offsets[], DWORD BaseAddress)
{
	DWORD pointer = BaseAddress;
	DWORD pTemp;
	DWORD pointerAddr;
	for (int c = 0; c < PointerLevel; c++)
	{
		if (c == 0)
		{
			ReadProcessMemory(hProcHandle, (LPCVOID)pointer, &pTemp, sizeof(pTemp), NULL);
		}

		pointerAddr = pTemp + offsets[c];
		ReadProcessMemory(hProcHandle, (LPCVOID)pointerAddr, &pTemp, sizeof(pTemp), NULL);
	}
	return pointerAddr;
}


void WriteToMemory(HANDLE hProcHandle)
{
	DWORD AddressToWrite;
	if (AmmoStatus)
	{
		AddressToWrite = FindDmaAddy(3, hProcHandle, AmmoOffsets, AmmoBaseAdress);
		 WriteProcessMemory(hProcHandle, (BYTE*)AddressToWrite, &AmmoValue, sizeof(AmmoValue), NULL);
	}
	if (HealthStatus)
	{
		AddressToWrite = FindDmaAddy(3, hProcHandle, HealthOffsets, HealthBaseAdress);
		WriteProcessMemory(hProcHandle, (BYTE*)AddressToWrite, &HealthValue, sizeof(HealthValue), NULL);
	}
}
Dat fleep doe!! I don't like how he coded this. Either way, it's in the writetomemory function(all the way in the bottom). Where it says writeprocessmemory 3rd argument &ammoValue. That's the value that's being written. And in case u don't know where ammovalue is, it's a global variable up top. Not really sure why he uses an array of bytes tho..?
Posts 1–2 of 2 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Talk with us