Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Game Trainer Question.

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
alilograpi
How do I cheat?
Reputation: 0

Joined: 27 Aug 2013
Posts: 1

PostPosted: Tue Aug 27, 2013 5:58 pm    Post subject: Game Trainer Question. Reply with quote

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++.
Back to top
View user's profile Send private message
661089799107
Expert Cheater
Reputation: 3

Joined: 25 Jan 2009
Posts: 186

PostPosted: Tue Aug 27, 2013 8:15 pm    Post subject: Reply with quote

You'll need to loop through all the modules in a process, and get the address that it's loaded at.

- CreateToolhelp32Snapshot
- Module32First
- Module32Next

After that you can add the offset, and read the value.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites