Results 1 to 2 of 2
  1. #1
    Preventedflux's Avatar
    Join Date
    Dec 2014
    Gender
    male
    Posts
    2
    Reputation
    10
    Thanks
    0

    Wink 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);
    	}
    }

  2. #2
    Cosmo_'s Avatar
    Join Date
    Oct 2014
    Gender
    male
    Location
    Los Angeles
    Posts
    126
    Reputation
    13
    Thanks
    19
    My Mood
    Sleepy
    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..?

Similar Threads

  1. Hacks writing to game memory.
    By dafier in forum Counter-Strike 2 Discussions
    Replies: 5
    Last Post: 12-15-2014, 04:11 PM
  2. Hack gets abnormal memory access
    By _corn_ in forum Crossfire Coding Help & Discussion
    Replies: 12
    Last Post: 01-01-2013, 12:15 PM
  3. [Patched] Lightning's D3D Menu Hack v10 |l MEMORY FEATURES l|
    By Lightning in forum CrossFire Hacks & Cheats
    Replies: 32
    Last Post: 09-14-2012, 09:44 AM
  4. [Patched] #Sa3eDing D3D Menu Hack With some Memory Hacks NoSpread/LessRecoil - NoNadeDmg +++etc
    By [S]aeed in forum CrossFire Hacks & Cheats
    Replies: 106
    Last Post: 09-11-2012, 01:25 PM
  5. pb Kick corrupt file/memory (81353) for cod4 V1.7 with hacks.
    By benna696 in forum Call of Duty 4 - Modern Warfare (MW) Hacks
    Replies: 4
    Last Post: 05-12-2009, 01:09 PM