| View previous topic :: View next topic |
| Author |
Message |
nerozero How do I cheat?
Reputation: 0
Joined: 05 Sep 2012 Posts: 9
|
Posted: Wed Sep 05, 2012 4:03 pm Post subject: Base address of minesweeper |
|
|
Hi all,
I have been trying to hack the time in minesweeper for windows 7. I have followed the pointers through using cheat engine and have arrived at minesweeper.exe + AAA38 which seems to be the static pointer for the time address.
My question is how to I go about finding the base address of minesweeper.exe so I can put this hack into code?
Cheers,
Loz.
|
|
| Back to top |
|
 |
n0 m3rcY Cheater
Reputation: 0
Joined: 18 Jun 2012 Posts: 42
|
Posted: Wed Sep 05, 2012 9:22 pm Post subject: |
|
|
I'm hoping you'll actually read the description behind the code and not just c+p it, but here goes: (sorry it's in my class format so you'll have to fix that).
You'll need to have CreateToolhelp32Snapshot to get the current processes. Then, you'll create a module snapshot of the process and look for your process name. You can skip the search of the snapshot and just use Process32Next() after Process32First() if you already know the PID from your trainer but doing it this way will let you also get .dlls (ie xlive.dll). You then just loop through and compare the modulenames to your name. The MODULEENTRY32 struct you fill will contain the base address of the module (your game) and you can use that. It also contains a lot of useful things like allocated size, zero terminated string path to file, and a couple other stuff. Look at it
| Code: | /*
Function: GetMod64BaseAddress()
Input: Window name, process name
Description: Gets the base address of an x64 process
*/
DWORD_PTR tAZTRAINER::GetMod64BaseAddress(const wchar_t *ProcessName)
{
HANDLE hSnap;
PROCESSENTRY32 pe = {0};
MODULEENTRY32 me = {0};
HANDLE hMod;
hSnap=CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
if (hSnap==INVALID_HANDLE_VALUE)
return 1;
pe.dwSize=sizeof(pe);
if (Process32First(hSnap, &pe))
do {
hMod=CreateToolhelp32Snapshot(TH32CS_SNAPMODULE|TH32CS_SNAPMODULE32, pe.th32ProcessID);
me.dwSize = sizeof(me);
if (Module32First(hMod, &me))
do{
if(_wcsicmp(me.szModule, ProcessName) == 0)
{
CloseHandle(hMod);
CloseHandle(hSnap);
return (DWORD_PTR)me.modBaseAddr;
}
} while (Module32Next(hMod, &me));
} while (Process32Next(hSnap,&pe));
if(hSnap != INVALID_HANDLE_VALUE)
CloseHandle(hSnap);
if(hMod != INVALID_HANDLE_VALUE)
CloseHandle(hMod);
} |
|
|
| Back to top |
|
 |
nerozero How do I cheat?
Reputation: 0
Joined: 05 Sep 2012 Posts: 9
|
Posted: Wed Sep 05, 2012 10:39 pm Post subject: |
|
|
| thanks for this, I will have a play later!
|
|
| Back to top |
|
 |
dabura667 Advanced Cheater
Reputation: 0
Joined: 28 Aug 2012 Posts: 72
|
Posted: Fri Sep 07, 2012 12:26 am Post subject: |
|
|
| How would I go about controlling which squares are mines... I want to draw pictures with the mine flags and have it be correct.
|
|
| Back to top |
|
 |
nerozero How do I cheat?
Reputation: 0
Joined: 05 Sep 2012 Posts: 9
|
Posted: Mon Sep 10, 2012 4:27 am Post subject: |
|
|
cheers for the above I ended up coding it in C# as you can do the above in 2 lines and I wanted a pretty GUI
|
|
| Back to top |
|
 |
|