[C++] Minesweeper Trainer - Source Code - Printable Version +- howtothings.co.uk (https://www.howtothings.co.uk) +-- Forum: Computing (https://www.howtothings.co.uk/forumdisplay.php?fid=4) +--- Forum: Programming Support, Graphic Design and Tutorials (https://www.howtothings.co.uk/forumdisplay.php?fid=14) +--- Thread: [C++] Minesweeper Trainer - Source Code (/showthread.php?tid=1132) |
[C++] Minesweeper Trainer - Source Code - Clones - 13-11-2011 (NOTE: This was for Windows XP, I am currently running Windows 7 and obviously the addresses in the code have changed. The source code does still provide beginners an easy layout to create small trainers for small games, so have fun with it. Also, don't mind the xbpm07x name in the code, that is another name I go by) Hello, This trainer is for Window's Minesweeper game. It was developed with Dev-C++. If you obtain the correct addresses for MineSweeper, and update the source code with them, you can create your own trainer. This is for anyone learning C++ wanting to put a little bit of experience under their belt My trainer is a simple one, all it does is NOP the 2 addresses that increase the timer. You can also use OllyDbg to modify the original .exe so the timer does not increase, replace it with your old .exe, and never worry about time again! Try to learn something from it, eh? Trainer source: [code=cpp]//Include everything needed #include <iostream> #include <windows.h> #include <tlhelp32.h> #include <conio.h> using namespace std; //Declare NopAddress bool NopAddress(const char * ProcessName, LPVOID MemAddress, int NewVal, int size); int main () { //Set the window title SetConsoleTitle("Minesweeper Timer v0.1 - xBPM07x"); //Create the introduction screen cout << "" <<endl ; cout << " +++++++++++++++++++++++++++++++++++++++++++++" <<endl ; cout << " + Application Type: Trainer +" <<endl ; cout << " + Target Game: Minesweeper +" <<endl ; cout << " + Programmer: xBPM07x +" <<endl ; cout << " +++++++++++++++++++++++++++++++++++++++++++++" <<endl ; cout << "\n" <<endl ; if(NopAddress("winmine.exe", (VOID*) 0x1003830, 0x90, 1)) { NopAddress("winmine.exe", (VOID*) 0x1002ff5, 0x90, 1); cout << " Minesweeper detected, hack success! You can now close this window.\n"; getchar(); } else { cout << " Minesweeper was not detected Press enter to exit...\n\n"; getchar(); return 0; } } //Define NopAddress bool NopAddress(const char * ProcessName, LPVOID MemAddress, int NewVal, int size) { HANDLE hProcessSnap; HANDLE hProcess = NULL; PROCESSENTRY32 pe32; hProcessSnap = CreateToolhelp32Snapshot( TH32CS_SNAPPROCESS, 0 ); pe32.dwSize = sizeof( PROCESSENTRY32 ); Process32First(hProcessSnap, &pe32); do { if(!strcmp(pe32.szExeFile, ProcessName)) { hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pe32.th32ProcessID); break; } } while(Process32Next(hProcessSnap, &pe32)); CloseHandle( hProcessSnap ); if(hProcess != NULL) { WriteProcessMemory(hProcess, MemAddress, &NewVal, size, NULL); CloseHandle(hProcess); return true; } return false; }[/code] |