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 


Understanding Base-Pointers

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

Joined: 13 Jun 2010
Posts: 5

PostPosted: Sun Jun 13, 2010 4:53 pm    Post subject: Understanding Base-Pointers Reply with quote

Hey guys,

I got this one problem I've been struggling with for a while now, and I was hoping someone here would be able to clarify something for me.

In Cheat Engine when locating base pointers (Either manually tracking the address/offsets or using the scanner)

Often you end up with an address that looks similar to this:

processName + 12345

And not just a pure numeric value for address.

However if you inside the "Add Address" window keep an eye on whatever address it points to, and then browse the process's memory, in that area, you are able to tell that "processName + 12345" might be equivalent to "12345678"


Inside Cheat Engine both addresses will work just fine ("processName+1234" or "12345678")

However if you want to grab that address, and use it somewhere else in a different memory reader (your own advanced trainer / program for instance) then only the purely numeric representation of the base address will work.


So the big question, how does Cheat Engine translate "processName+12345" in to a valid address?

I tried going through the Cheat Engine source code, but i was unable to find the answer there.

Thank you for your time.
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Sun Jun 13, 2010 5:19 pm    Post subject: Reply with quote

Code:
GetModuleHandle( _T( "ModuleName.dll" ) ) + offset;
Back to top
View user's profile Send private message
Deltron Z
Expert Cheater
Reputation: 1

Joined: 14 Jun 2009
Posts: 164

PostPosted: Sun Jun 13, 2010 5:22 pm    Post subject: Reply with quote

Image Base + Relative Virtual Address.
Image Base for PE32 Executables are usually 0x00400000.
Back to top
View user's profile Send private message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Sun Jun 13, 2010 8:00 pm    Post subject: Reply with quote

@Deltron Z when you say that you confuse noobs.

Look, what you need to do is obtain the base address of the module then adding the offset giving you your final address which you read / write from. Like so:

Code:

// Example
// gdi32.dll + 1234A

DWORD Base = (DWORD) GetModuleHandleA("gdi32.dll");
DWORD Address = Base + 0x1234A;
Back to top
View user's profile Send private message MSN Messenger
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Sun Jun 13, 2010 8:39 pm    Post subject: Reply with quote

Are you very confused, iPromise ? lmfao. Thanks for packaging up my code and repeating it though.
Deltron Z wrote:
Image Base for PE32 Executables are usually 0x00400000.

That is only the case for the main module.
Back to top
View user's profile Send private message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Sun Jun 13, 2010 9:46 pm    Post subject: Reply with quote

@Slugsnack

Are you illiterate?

I wrote:

Quote:

when you say that you confuse noobs.


And no i'm not a noob, I know how to use C++ so grow up and fuck off.

Alright, heres 2 other ways to do it since Asssnack wants to bitch about copying his code:

Code:

// Example
// gdi32.dll + 1234A

DWORD Base;

MODULEENTRY32 ME;

ME.dwSize = sizeof(MODULEENTRY32);

HANDLE Snapshot = CreateToolhelpSnapshot32(TH32CS_SNAPALL, 0);

if (Module32First(Snapshot, &ME))
{
   while (Module32Next(Snapshot, &ME))
   {
      if (!strcmp(ME.szModule, "gdi32.dll"))
      {
          Base = (DWORD) ME.modBaseAddr;
      }
   }
}

DWORD Address = Base + 0x1234A;


Code:

DWORD Base = (DWORD) LoadLibraryA("gdi32.dll"); // depends

DWORD Address = Base + 0x1234A;


Also, he meant to grab the images base address and add it with the offset.
Back to top
View user's profile Send private message MSN Messenger
Gig
How do I cheat?
Reputation: 0

Joined: 13 Jun 2010
Posts: 5

PostPosted: Mon Jun 14, 2010 2:07 am    Post subject: Reply with quote

Thank you very much, it was all very helpful to me.

Thank you.
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 programming 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