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 


Pointers and Base Address (+Java Programming)

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

Joined: 30 Mar 2017
Posts: 4

PostPosted: Thu Mar 30, 2017 12:14 pm    Post subject: Pointers and Base Address (+Java Programming) Reply with quote

To preface everything, I am attempting to find the base address of the game (as it will change every time you reopen it), then I believe I should be able to add the offsets I am finding in Cheat Engine, and then I get the address of which I need to modify. For example, Cheat Engine provides me with the pointer "Game.exe"+0170AFC0 and an offset of 49C. My understanding is that if I obtain the base address of Game.exe through my program, I can then add 0170AFC0 & 49C to that base address, leaving me with the address I am looking to modify (at least, this is my understanding).

The problem is that when I follow the aforementioned logic, my addresses do not match up to those I am looking for when I compare it to Cheat Engine directly. Ex: I find the base address of 1bb5310 with my program, add my offsets 0170AFC0 & 49C, and get the address 32C076C. However, Cheat Engine is telling me "Game.exe"+0170AFC0 -> 18F8CA1C and then after adding the offset 49C -> 18F8CEB8

First, am I correct in thinking that the "Game.exe" part of "Game.exe"+0170AFC0 would represent the base address? Secondly, am I right in my logic on how I would go from my base address to the appropriate address I want to modify? I am effectively trying to figure out if it is a problem with my logic or a problem with my existing program

If you want to have a look at my program, here is the github (main class is Editor/MemEdit.java): github . com/roguexx117/Help
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Thu Mar 30, 2017 12:19 pm    Post subject: Reply with quote

http://forum.cheatengine.org/viewtopic.php?t=422516
_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
roguexx117
How do I cheat?
Reputation: 0

Joined: 30 Mar 2017
Posts: 4

PostPosted: Thu Mar 30, 2017 12:26 pm    Post subject: Reply with quote

I appreciate the link, I hadn't seen that. But for a little bit of clarification, it should be the games base address + the 4 byte result of reading 0170AFC0 (from my example in the post) + 49C?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Thu Mar 30, 2017 12:57 pm    Post subject: Reply with quote

My apologies, but this question has been asked so many times I've become apathetic to it.

In your case, the base address is some address in a module: more specifically, "Game.exe"+0170AFC0. "Game.exe" represents the base address of the module, and +0170AFC0 is the offset into the module where the base address of the pointer is at. Read the value stored at that address (e.g. 18F8CA1C) and add the first offset (i.e. 49C) to that value to get the next address (e.g. 18F8CEB8). If there is only one offset, then you're done: you've arrived at the address of the value being pointed to. If it's a multilevel pointer and there's more than one offset, keep on reading the value at that address and adding the next offset to that value until you reach the end of the pointer chain.

When CE says "Game.exe"+0170AFC0 -> 18F8CA1C, that means the value stored at the address "Game.exe"+0170AFC0 is 18F8CA1C.

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
roguexx117
How do I cheat?
Reputation: 0

Joined: 30 Mar 2017
Posts: 4

PostPosted: Thu Mar 30, 2017 1:35 pm    Post subject: Reply with quote

ParkourPenguin wrote:
My apologies, but this question has been asked so many times I've become apathetic to it.

In your case, the base address is some address in a module: more specifically, "Game.exe"+0170AFC0. "Game.exe" represents the base address of the module, and +0170AFC0 is the offset into the module where the base address of the pointer is at. Read the value stored at that address (e.g. 18F8CA1C) and add the first offset (i.e. 49C) to that value to get the next address (e.g. 18F8CEB8). If there is only one offset, then you're done: you've arrived at the address of the value being pointed to. If it's a multilevel pointer and there's more than one offset, keep on reading the value at that address and adding the next offset to that value until you reach the end of the pointer chain.

When CE says "Game.exe"+0170AFC0 -> 18F8CA1C, that means the value stored at the address "Game.exe"+0170AFC0 is 18F8CA1C.


Alright, so I am currently obtaining the base address from my program. I then read the memory at 0170AFC0 as a 4byte number. I then add the base address and the result of reading from 0170AFC0, which should total to 18F8CA1C.

If that is correct, there must be an error in my program in finding the base address, because I am not coming to that solution.


Last edited by roguexx117 on Thu Mar 30, 2017 1:38 pm; edited 1 time in total
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 138

Joined: 06 Jul 2014
Posts: 4275

PostPosted: Thu Mar 30, 2017 1:38 pm    Post subject: Reply with quote

No. I'll spell it out for you:
  1. Find the address of game.exe
  2. Add 0170AFC0 to that address
  3. Read the 4-byte value at the resulting address (8-byte for a 64-bit program)
  4. Add 49C to that value
  5. You are now at the address of the value pointed to

_________________
I don't know where I'm going, but I'll figure it out when I get there.
Back to top
View user's profile Send private message
roguexx117
How do I cheat?
Reputation: 0

Joined: 30 Mar 2017
Posts: 4

PostPosted: Thu Mar 30, 2017 2:05 pm    Post subject: Reply with quote

ParkourPenguin wrote:
No. I'll spell it out for you:
  1. Find the address of game.exe
  2. Add 0170AFC0 to that address
  3. Read the 4-byte value at the resulting address (8-byte for a 64-bit program)
  4. Add 49C to that value
  5. You are now at the address of the value pointed to


Thank you so much for your help! I was able to figure it out, it was indeed a problem with my code. I have been stuck on this program for nearly a week so seriously, I appreciate you explaining it to me.

For anyone else looking for how this is to be implemented in java, my Github will be updated shortly.
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