alilograpi How do I cheat?
Reputation: 0
Joined: 27 Aug 2013 Posts: 1
|
Posted: Tue Aug 27, 2013 5:58 pm Post subject: Game Trainer Question. |
|
|
Hello , I found a trainer source code and it look like this | Code: | #include <iostream>
#include <windows.h>
// FindWindow();
// GetWindowThreadProcessId();
// OpenProcess();
// WriteProcessMemory();
// CloseHandle();
using namespace std;
int main()
{
int newValue = 500;
HWND hWnd = FindWindow(0, "Saints Row IV");
if (hWnd == 0) {
cerr << "Cannot find window." << endl;
} else {
DWORD pId;
GetWindowThreadProcessId(hWnd, &pId);
HANDLE hProc = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pId);
if (!hProc) {
cerr << "Cannot open process." << endl;
} else {
int isSuccessful = WriteProcessMemory(hProc, (LPVOID)0x16D508AC, &newValue, (DWORD)sizeof(newValue), NULL);
if (isSuccessful > 0) {
clog << "Process memory written." << endl;
} else {
cerr << "Cannot write process memory." << endl;
}
CloseHandle(hProc);
}
}
return 0;
}
|
But what this trainer does is just simply take an "address" and changes its variable to 500 but the problem is that it does not support offsets and its not actually real to add a static address from a game without doing the "pointer" method which requires the offsets but I can't understand how to add an offset variable in this code ... Yes I am a newbie and I really want to understand how this system works so please help me out guys ! Thank you for your time and btw this is c++.
|
|