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 to get offsets (add value) from pointer to pointer

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

Joined: 08 Mar 2022
Posts: 4

PostPosted: Tue Mar 08, 2022 5:31 am    Post subject: How to get offsets (add value) from pointer to pointer Reply with quote

I'm having this game that i want to get the current map that the user has selected.

I do have a static pointer that points to another pointer, and does this even after restarting the game, which points to another pointer.
But the offset 1 to 6 (that Cheat Engine shows at pointer settings) do change with every restart of game.

With CheatEngine i do get to see the Offsets that i have to add
(this picture is a sample only, not for my purpose, my pointer has 5 levels)

I KNOW how to predict the next pointer by using Cheat Engine because i can see the offset values 1 to 6 with Cheat Engine Pointer Scan tool that i have to add to my pointer to follow to the next pointer.

But where do i get this offsets information?, because each time my static pointer points to another pointer, but the value of the offset that i first have to add also chances with a reboot, the static first pointer remains the same and points to the next pointer if i use the add value that Cheat Engine shows me.
Sometimes i have to start with D4, then 0, and E1, etcetc after a restart.
Its for a old game, not something fancy with AC patches and stuff.
The base address is fixed and does not change, its at &H400000.

Where do i read (ReadProcessMemory) this 1 to 6 offset bytes that cheat Engine shows me at its Pointer Scan subitems?

Do i read a pointer, then i have to read another couple bytes to know what value to add first to get to the next pointer?


To make it easy to understand, look at the picture. You see this 'A8' at the second textbox below ''Pointer''.
How do you get this 'A8' value with ReadProcessMemory, because the next time i start the game this A8 will be something else.
Cheat Engine shows me the updated values that i have to add first, so it can be done. But what to do by using ReadProcessMemory?
The starting pointer at the bottom is always the same in my case, and if i would follow the path with the add values (A8 and stuff) i get to my destination.

I need the best for this. If you are not this, please dont answer just for the sake of it with information i already found with Google.



3754c69a824197307082474c4e34ed12.png
 Description:
 Filesize:  9.19 KB
 Viewed:  10118 Time(s)

3754c69a824197307082474c4e34ed12.png


Back to top
View user's profile Send private message
cooleko
Grandmaster Cheater
Reputation: 11

Joined: 04 May 2016
Posts: 717

PostPosted: Tue Mar 08, 2022 11:11 am    Post subject: Reply with quote

MrBitLover wrote:
I do have a static pointer that points to another pointer, and does this even after restarting the game, which points to another pointer.
But the offset 1 to 6 (that Cheat Engine shows at pointer settings) do change with every restart of game.

By virtue of being a static pointer, the offsets themselves will always be… static.
If the offsets are changing then you have not found a static pointer and should reconsider your pointer.

MrBitLover wrote:
With CheatEngine i do get to see the Offsets that i have to add
(this picture is a sample only, not for my purpose, my pointer has 5 levels)

Are you running pointer scanner to get this each time? If so, you need to generate a significantly deeper and wider pointermap across multiple instances of the game (reboot inbetween each one, don’t open the game first, open other processes, vary the processes, too) and see if you can find a better pointer that is static between games.

MrBitLover wrote:
I KNOW how to predict the next pointer by using Cheat Engine because i can see the offset values 1 to 6 with Cheat Engine Pointer Scan tool that i have to add to my pointer to follow to the next pointer.

Just because the pointerscanner provides results doesn’t mean you know anything. CE is guessing, you have to come in and apply what you know to narrow down to a true static pointer.

MrBitLover wrote:
But where do i get this offsets information?, because each time my static pointer points to another pointer, but the value of the offset that i first have to add also chances with a reboot, the static first pointer remains the same and points to the next pointer if i use the add value that Cheat Engine shows me.
Sometimes i have to start with D4, then 0, and E1, etcetc after a restart.
Its for a old game, not something fancy with AC patches and stuff.
The base address is fixed and does not change, its at &H400000.

If you can’t find a static pointer but you know that the offsets 2-6 always remain the same, then you can just guess 1 with a loop and check the end conditions for success. If all offsets are changing then you need to find another approach.
The pointerscanner gets this by brute forcing every combination within the read depth and width that arrives at your pointer. If it is as simple as reading memory somewhere to get the offsets (which it can be if you take the time to track the addresses that write/access your end goal) then you can read memory yourself to get there.

MrBitLover wrote:
Where do i read (ReadProcessMemory) this 1 to 6 offset bytes that cheat Engine shows me at its Pointer Scan subitems?

Are you asking if you can automatically read from CE after it runs pointerscanner? The pointers it finds are not guaranteed to be accurate, even for the current instance of the game it ran in.

MrBitLover wrote:
Do i read a pointer, then i have to read another couple bytes to know what value to add first to get to the next pointer?

This is not usually the case. I’m sure there is a game out there that stores offsets in memory in this fashion, but this is not the norm. You can extract it from an Opcode if you know that an instruction will always be there, but if you had this level of understanding I don’t think you would be asking these questions. You just perform a read memory option from an AOB scan to get the bytes of the opcode. See the solutions provided here if that is the case: https://www.cheatengine.org/forum/viewtopic.php?p=5745013&sid=0678c47567f55a17c708b38485bd6d8d

MrBitLover wrote:
To make it easy to understand, look at the picture. You see this 'A8' at the second textbox below ''Pointer''.
How do you get this 'A8' value with ReadProcessMemory, because the next time i start the game this A8 will be something else.
Cheat Engine shows me the updated values that i have to add first, so it can be done. But what to do by using ReadProcessMemory?
The starting pointer at the bottom is always the same in my case, and if i would follow the path with the add values (A8 and stuff) i get to my destination.

If the offsets truly are static, you don’t read the A8 from anything, instead you read [[[“game.exe”+00B8C83C]+0]+A8]+3FC
This can be manually performed in assembly, lua, or whatever programming language you are using for your code outside of CE. You will need to loop through the different reads for each address and at that time offsets are just arithmetic.

MrBitLover wrote:
I need the best for this. If you are not this, please dont answer just for the sake of it with information i already found with Google.

You need to go back to the drawing board on this one and either:
1) Find a static pointer. This is easiest done with using pointermaps across multiple game instances via pointerscanner.
2) Learn how to find the offsets yourself. If know your map address location, see what writes it when it changes. That instruction will have a static offset to it. If that offsets changes every game, that instruction will instead have an AOB match that can be built, custom, by you to extract the true offset. Do this for every instruction that accesses each successively deeper address until you have your true offsets.
3) Skip all of the offsets nonsense and use the AOB scanner for the single instruction that provides the answer to the question you have. If implementing outside of cheatengine, then you need to learn how to use breakpoints in your respective programming language. If inside of cheatengine then use the autoassembly feature to build the script for you.

No matter what you do, expecting to need the best is offensive, reeks of entitlement, and generally makes no one want to help you.Tthe way to get the best to answer you is simply ask a question clearly enough that they can answer. They love to help people learn and have been responding for decades. The way you phrase your problem makes it appear as if you don't know what you are doing yourself and the best advice anyone can offer to you is to make sense of what you need so your googling will provide reliable results.

As best I can tell, you meant to state "Pointerscanner isn't providing static results that I can reuse each time, what should I do from here?" To which even relatively novice people would be able to assist you with. What you might have asked "How do I run pointerscanner and extract the results from CE each time since they are different?" while a valid ordering of words is not a valid question. That just isn't how to accomplish your goal! In response to both I have provided my advice above.
Back to top
View user's profile Send private message
MrBitLover
How do I cheat?
Reputation: 0

Joined: 08 Mar 2022
Posts: 4

PostPosted: Tue Mar 08, 2022 2:36 pm    Post subject: Reply with quote

Look, the game has a offset that i can use with ReadProcessMemory.
But THIS pointer that CE shows me is changing each time i restart the game.

So i run the game, make sure the address gets found again,
And then i do a pointer scan on it.

I see the SAME address each time is changing the offset with the CE Pointer Scanner.
But also that the offsets that i have to add to the long change like in my above screenshot with A8.

I want to use the fixed address, and follow the pointer until i get to my destination which is a random address in memory.
If i had knew how to get to this A8 (offsets) values, i can follow the address, but where do i get this A8 value.


How does Pointer Scanner finds the addresses and knows that it has to add A8 and stuff?
Because if i knew how, i can get to my random address in game by using the fixed address that points to where i want to go.

Is the pointer scanner using something else as ReadProcessMemory to find all the pointer addresses?. How does it know its a pointer, and how does it know the Offsets 1 to 6 (you know what im talking about)

---------------------------------------------------------------------

Look.

CE found a 'Address' in main window:

address: 05D8F968
value: BT03 African Village

When i change the map in game, i see in mainwindow of CE that the 'value' changed too of this address. so i know its the right address.
But if i restart my game, the value 05D8F968 is something totally different.

So when CE found my offset, i do a pointer scan at the address.
And it finds "Game.exe" + 00417EB4, which points to 05D8F968 according CE.
This 00417EB4 does not change, CE always shows me this fixed address where i can get a long value.


So if i read address "Game.exe" + 00417EB4, i do get a 4 byte long value.
And this value is exactly how CE shows it too.
But now i want to go to the destination, CE shows me that i have to first add 'F68' to my found pointer to get to the next.
But how can i find this 'F68' offset, how does CE knows that it is 'F68'.

Because when i restart my game, and i go to 00417EB4 address, i get my long again, but not what i have to add extra, (and it will not be F68 again if i recheck with CE), to it to goto the next pointer.


Last edited by MrBitLover on Tue Mar 08, 2022 2:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4699

PostPosted: Tue Mar 08, 2022 2:57 pm    Post subject: Reply with quote

The offsets are a part of the pointer. "Game.exe"+00417EB4 doesn't point to 05D8F968- the pointer path ["Game.exe"+00417EB4]+F68 points to 05D8F968. If any of the offsets (i.e. F68) changes, it's a different pointer path.

The pointer scanner uses a brute force algorithm to find every possible pointer path to an address (or value). This includes paths that just happen to exist by random chance. In the next instance of the game, such paths will break.

You should be using multiple pointer maps with the pointer scan that are generated across multiple instances of the game. See this video for more information:
https://www.youtube.com/watch?v=3dyIrcx8Z8g

_________________
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
MrBitLover
How do I cheat?
Reputation: 0

Joined: 08 Mar 2022
Posts: 4

PostPosted: Tue Mar 08, 2022 3:02 pm    Post subject: Reply with quote

there must be a way to get the offsets to goto a pointer from another pointer.
To get this A8 value by readprocessmemory,

How can CE Pointer Scanner get this that quickly?
Does it hook the game for it? - Or can it be done with brute force with only ReadProcessMemory to get this offsets somewhere

Dammit, i wish this was easier
Back to top
View user's profile Send private message
cooleko
Grandmaster Cheater
Reputation: 11

Joined: 04 May 2016
Posts: 717

PostPosted: Tue Mar 08, 2022 3:29 pm    Post subject: Reply with quote

MrBitLover wrote:
there must be a way to get the offsets to goto a pointer from another pointer.
To get this A8 value by readprocessmemory,


Most likely, no. There is not a way to read the value A8 unless you know for sure it is hidden in an opcode and extract it. I provided a link to this in the first response.

MrBitLover wrote:
How can CE Pointer Scanner get this that quickly?
Does it hook the game for it? - Or can it be done with brute force with only ReadProcessMemory to get this offsets somewhere

Dammit, i wish this was easier


Your computer is very fast and DarkeByte made an exceptional tool with CE.

Just reread the responses to your post and google the terms we use for a better understanding. Once you know what the terms and phrases that are being repeated to you mean you will solve the problem! It really is quite easy for most games once you get a little experience.

Good luck though, you are almost there!
Back to top
View user's profile Send private message
MrBitLover
How do I cheat?
Reputation: 0

Joined: 08 Mar 2022
Posts: 4

PostPosted: Tue Mar 08, 2022 5:51 pm    Post subject: Reply with quote

thx for your info, in this case google wasnt my friend, but YouTube did.

I knew that i had to scan the game a few times in order to get the right address in main window.

And i thought i could programmatically find this A8 values and stuff, but this is where i was wrong.

I was looking for the static address pointing to a random address, but i said this A8 was changing all the time.

It's the first time i use Cheat Engine, but its great software.
What I forget is i had to add the found addresses with Pointer Scan to my main window by double clicking the records.
Then restart the game, and look at main window its bottom view what values returned to the right ones after a restart of game and hooking it again.
After doing that i few times i found a static address that always points to the random address with the information i need. With the fixed offsets that CE showed me that never change truout restarts of game.

A8 changing and stuff as i asked, only did when I found a non static address with CE Pointer Scan that i believed was static, my bad.
And thx for helping me out, was almost giving up, but i never do. hahahaha

PS (edited):
I've got it working thanks god. As a little boy in a candyshop i feel, that after 3 days of sitting in the dark looking into this i can finally say i got what i need.

Kindly regards
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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