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 


How do you get the base address?

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

Joined: 27 Oct 2012
Posts: 3

PostPosted: Mon Nov 19, 2012 11:41 am    Post subject: How do you get the base address? Reply with quote

Hi, how do you get the base address of a variable/value within a process?
Say I want to find the address where the timer value is stored in minesweeper, how do I do that?
Do I scan minesweeper's memory from beginning to end? I'm not really sure if memory is allocated contiguously for a process...

I've been trying to modify the value of a variable in another process for about a year(well, not for the whole time) without success. I only managed to do it with a program that I wrote and which its address is known to me.


Thanks
Back to top
View user's profile Send private message
Gniarf
Grandmaster Cheater Supreme
Reputation: 43

Joined: 12 Mar 2012
Posts: 1285

PostPosted: Mon Nov 19, 2012 1:25 pm    Post subject: Re: How do you get the base address? Reply with quote

Tanqueray#10 wrote:
Hi, how do you get the base address of a variable/value within a process?
Please define what YOU call the "base address" because the term "base address" only applies to a pointer (and a few other things that are unrelated to your request). In this example (written in C):
int a=10;
int* b=&a;
int** c=&b;
&c is the base address of the pointer to a.
Tanqueray#10 wrote:
Say I want to find the address where the timer value is stored in minesweeper, how do I do that?
Timers are not the utmost easiest thing to hack (it's not hard either, far from that) but I suggest you start with something easier, like cheat engine's tutorial (Help->Cheat Engine Tutorial), or the score in spider solitaire, just to get a bit used to the tools.

Anyway this video ( http://www.youtube.com/watch?v=GPDlXVzgfvw ) shows how to find the address of the minesweeper timer (it's a prerequisite to make the timer count backward). Only the first 3 minutes concern what you want.
tip: in cheat engine's settings, set a hokey to pause/resume a process, that will allow you to freeze all threads of your target process, and do the timer scan while it does not change.
Tanqueray#10 wrote:
Do I scan minesweeper's memory from beginning to end? I'm not really sure if memory is allocated contiguously for a process...
Memory is not contiguously allocated for a process, but you don't have to bother with it. Even 10 year old scan tools handle that for you. Of course it's a whole different story if you write your own scan tool, but I don't see why you would need to do that.
Back to top
View user's profile Send private message
Tanqueray#10
How do I cheat?
Reputation: 0

Joined: 27 Oct 2012
Posts: 3

PostPosted: Tue Nov 20, 2012 7:57 am    Post subject: Reply with quote

What I mean by "base address" is the address of a variable. That would be the address of any of a,b or c(&a, &b and &c) in your C example.

Minesweeper's timer was just an example, I don't really want that. I'm more interested in addresses of scores, health or ammunition, ut I really don't want to use Cheat Engine to get the base address, I know how to do that.
What I want to know is how CE gets those addresses.

So basically, I want to write a program that is able to find the address where the score is stored for example.
Back to top
View user's profile Send private message
Gniarf
Grandmaster Cheater Supreme
Reputation: 43

Joined: 12 Mar 2012
Posts: 1285

PostPosted: Tue Nov 20, 2012 8:45 am    Post subject: Reply with quote

Ah, so you want to write a scan tool. In this case you can look at cheat engine's source (it IS open source after all) or you can also google for "memory scanner source".
Though I haven't watched the complete 8 videos this tutorial should contain the answers to your questions: http://www.securitytube.net/video/1080
(too bad the C source was hosted on megaupload...)
Back to top
View user's profile Send private message
Tanqueray#10
How do I cheat?
Reputation: 0

Joined: 27 Oct 2012
Posts: 3

PostPosted: Sun Nov 25, 2012 12:55 am    Post subject: Reply with quote

I forgot about this thread. Thanks, I'll search for that.
I have CE's source but I'm not really sure where to look.
Back to top
View user's profile Send private message
Gniarf
Grandmaster Cheater Supreme
Reputation: 43

Joined: 12 Mar 2012
Posts: 1285

PostPosted: Sun Nov 25, 2012 2:16 am    Post subject: Reply with quote

Try memscan.pas, function TScanController.firstScan.
Back to top
View user's profile Send private message
n0 m3rcY
Cheater
Reputation: 0

Joined: 18 Jun 2012
Posts: 42

PostPosted: Tue Nov 27, 2012 8:20 pm    Post subject: Reply with quote

Tanqueray#10 wrote:
I forgot about this thread. Thanks, I'll search for that.
I have CE's source but I'm not really sure where to look.

As of windows 7 most processes use ASLR, so they processes will have a random base address, however you can still use offsets ie a value you find at "minesweeper.exe+0x1234" in cheatengine will still be the base address of minesweeper.exe + 0x1234 in memory.

You can get the base address of a module by using Module32First() and a loop of Module32Next() of a CreateToolhelp32Snapshot() snapshot made the the processes pid. The moduleentry32::modbaseaddr member contains the base address of the module.
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