C++ Trainer not working

Posts 1–3 of 3 · Page 1 of 1
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;	
}
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: http://www.intellectualheaven.com/Articles/WinMM.pdf
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
Posts 1–3 of 3 · Page 1 of 1
This thread is closed for replies.

Similar Threads

Tags for this Thread

Need help?