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 


Pointer offsets randomize on screen change

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

Joined: 02 Sep 2020
Posts: 3

PostPosted: Wed Sep 02, 2020 7:37 am    Post subject: Pointer offsets randomize on screen change Reply with quote

I've been trying to make a working cheat table for a game for days, and it keeps stumping me. Usually in the past I didn't have as much trouble, and have mastered some of the basic techniques, like finding (multi-level) pointers and such. For this game, that's exactly what I ended up doing, and I made a cheat table with quite a few values.

On game and computer restart, this table works. All the pointers are correct and reference the proper values, allowing me to change or freeze them. The problem occurs when the game changes screens, usually going into a battle or a separate menu that is preceded by a brief loading screen. When this happens, it messes up all my pointers.

At first I thought this was completely random, but by changing these screens repeatedly and finding the same variable each time, I found out that the address stays the same, it's just the offset that changes, apparently to a random value. And that's not all, apparently there's a pattern to it. I kept the 5 pointers I made to test the offsets, and when I restarted the game the first pointer was correct again. Encounter a loading screen, and the second pointer becomes correct, then the third, etc. I haven't found a point where it loops back to the first yet, but it might take a while to do so. Either way, this means the changing offset isn't random but follows some kind of calculation or preset list of values.

My question is, how do I make a table that keeps working across these loading screens? The pointers I found were static (green) addresses, and unless I encounter a loading screen, work across restarts of the game and computer.

PS: all the offsets for the pointers I found are in the following format, each time multiplying some register by 8 for the offset (although which one seems to change between pointers for different variables):
Code:
0046587E - 89 04 CA   - mov [edx+ecx*8],eax
Back to top
View user's profile Send private message
Csimbi
I post too much
Reputation: 97

Joined: 14 Jul 2007
Posts: 3330

PostPosted: Wed Sep 02, 2020 1:48 pm    Post subject: Reply with quote

Seems to me you did not find the real pointers.
What you found are pointers that are valid for one particular screen.
When you move away from that screen, they become invalid.

Write a code for each screen that gets you edx and ecx and keep storing them into the same place.
When you activate all these scripts, the edx and ecx will always be correct, no matter what screen you are on.
Takes a bit of legwork, but it should work.
Any while doing the legwork, you might actually find the real base for all these pointers.
Back to top
View user's profile Send private message
ThisNameIsntTakenYet
How do I cheat?
Reputation: 0

Joined: 02 Sep 2020
Posts: 3

PostPosted: Wed Sep 02, 2020 3:27 pm    Post subject: Reply with quote

Thanks for the reply. I'm a little confused though. What do you mean, write a script? I haven't used code injection yet, if that's what you're talking about. If not, can you link a tutorial or explanation for what you meant?

Also not sure if it was clear, but the pointers aren't quite tied to the specific screens. As in, I kept changing back and forth between the same two to test, and the offsets kept changing, despite returning to the same screens repeatedly. So it's not as simple as "screen A has pointer X, and screen B has pointer Y". For some reason it does change to the same offsets in succession each time though, following a set pattern, but I have no idea how long that pattern is.

Any ideas on how to find those real base addresses? The ones I found and used where green, and checking what accesses those just gives me very fast repeating reads, which I assume are for printing the values to the screen or something similar, but no writes or anything that I could link to me changing the value in the game. I tried pointer maps as well, but for some reason those didn't come up with anything either for this game.
Back to top
View user's profile Send private message
Csimbi
I post too much
Reputation: 97

Joined: 14 Jul 2007
Posts: 3330

PostPosted: Thu Sep 03, 2020 1:52 am    Post subject: Reply with quote

There are all sorts of tutorials.
You should choose between ASM or LUA.
I myself prefer ASM for everything I can, and use as little as LUA as I need.
In the AA there are templates even, so you just need to make some minor tweaks.

See if those "very fast repeating reads" access any other value.
If not, bingo.
Inject at that instruction to get the address you need and take a copy or change the value right there, on the spot.
That way, you don't even have to worry about pointers anymore.

If they do access other values, try to find one that accesses only the one you need.
If you can't find one, the you will need to do implement some filtering code to get the right address.
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