Results 1 to 3 of 3
  1. #1
    Matrix_NEO006's Avatar
    Join Date
    Feb 2008
    Gender
    male
    Posts
    240
    Reputation
    12
    Thanks
    33
    My Mood
    Lonely

    C++ Trainer not working

    dont know what to use to store the address is it DWORD or different thing
    Code:
    #include <windows.h>
    #include <conio.h>
    #include <dos.h>
    #include <tlhelp32.h>
    #include <stdio.h>
    
    
    int ammo=99;
    
    bool freezAmmo = false;	
    
    PDWORD bAddress = 0;//base address Do i use the right thing ??
    DWORD fAddress =0;	//final address
    
    void screen()	
    {
    	system("cls");	
    	printf("Operation Flashpoint 2 !  \n\n");
    	printf("M.A.T.R.I.X \n\n");
    
    	
    	if(freezAmmo) printf("[NUMPAD 1] - freeze ammo [ENABLED]\n");
    	else printf("[NUMPAD 1] - freeze ammo [DISABLED]\n");		
    }
    
    int main(int argc, char* argv[])
    {	
    	HANDLE hProcessSnap;	
    	HANDLE hProcess = NULL;	
    	PROCESSENTRY32 pe32;	
    	
    	hProcessSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 );	
    
    	pe32.dwSize = sizeof( PROCESSENTRY32 );		
    
    	Process32First(hProcessSnap, &pe32);	
    
    	do	
    	{		
    		if(strcmp(pe32.szExeFile, "OFDR.exe") == 0)	
    		{
    			hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pe32.th32ProcessID);	
    			break;	
    		}
    	}
    	while(Process32Next(hProcessSnap, &pe32));	
    
    	CloseHandle( hProcessSnap );	
    
    	if(hProcess == NULL)
    	{
    		printf("OP2 not found\n\n");
    		getch();
    	}
    	else
    	{
    		screen();	
    		
    		char key = ' ';	
    		
    		while(key != VK_ESCAPE)	
    		{
    			
    			if(kbhit())		
    			{
    				key = getch();	
    
    				switch(key)		
    				{				
    				case '1':
    					freezAmmo = !freezAmmo;
    					ReadProcessMemory(hProcess, (void*)(0x1C8FE6D4), (void*)&bAddress, 4, NULL);
    					ReadProcessMemory(hProcess,(void*)(bAddress+0x44),(void*)&bAddress, 4, NULL);
    					ReadProcessMemory(hProcess,(void*)(bAddress+0x60),(void*)&bAddress, 4, NULL);
    					ReadProcessMemory(hProcess,(void*)(bAddress+0xC4),(void*)&bAddress, 4, NULL);
    					ReadProcessMemory(hProcess,(void*)(bAddress+0x20),(void*)&bAddress, 4, NULL);
    					ReadProcessMemory(hProcess,(void*)(bAddress+0x54), &ammo, 4, NULL);			
    					ReadProcessMemory(hProcess, (void*)fAddress, &ammo, 4, NULL);
    
    
    					break;			
    				}
    
    				screen();
    
    			}
    
    			if(freezAmmo)	
    				WriteProcessMemory(hProcess, (void*)fAddress, &ammo, 4, NULL);	
    		}
    
    		CloseHandle(hProcess);	
    		
    	}
    
    	return 0;	
    }

  2. #2
    why06's Avatar
    Join Date
    Jul 2009
    Gender
    male
    Location
    IBM
    Posts
    4,304
    Reputation
    170
    Thanks
    2,203
    My Mood
    Flirty
    I'm not a completely sure on this, but I looked in my reversing book and it looks like the memory addresses are set up to be DWORD. At least that's my guess... since adresses are usually 8 hex digits and that = 4 bytes.. =/


    Oh lookie what I found: https://www.intellectualheaven.com/Articles/WinMM.pdf
    Last edited by why06; 10-11-2009 at 09:34 PM.

    "Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."
    - Dwight D. Eisenhower

  3. #3
    Matrix_NEO006's Avatar
    Join Date
    Feb 2008
    Gender
    male
    Posts
    240
    Reputation
    12
    Thanks
    33
    My Mood
    Lonely
    it think its the pointer and address + i would use code injection with C++ if i knew how to write it. i know some parts but i cant write it completely

Similar Threads

  1. trainer not working
    By zeekond in forum Vindictus Discussions
    Replies: 10
    Last Post: 02-21-2011, 06:51 PM
  2. Trainers WONT work anymore
    By System79 in forum WarRock - International Hacks
    Replies: 8
    Last Post: 06-02-2007, 04:42 AM
  3. why warrock not working now??
    By tolik13 in forum WarRock - International Hacks
    Replies: 4
    Last Post: 07-09-2006, 03:27 PM
  4. WPE not work
    By trekpik in forum WarRock - International Hacks
    Replies: 3
    Last Post: 07-09-2006, 10:09 AM

Tags for this Thread