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 


Need help nailing down a changing address for a variable
Goto page 1, 2  Next
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Senort11
Newbie cheater
Reputation: 0

Joined: 26 Oct 2015
Posts: 12

PostPosted: Mon Oct 26, 2015 4:21 pm    Post subject: Need help nailing down a changing address for a variable Reply with quote

The game in question is Nom Nom Galaxy but I've seen this behavior in other games as well.

In this game, there are multiple levels and each time you start a level the address for money, resources, etc changes each time a level is started, including restarting a level.

How do I nail this down in my table so that I don't have to search for the new address each time a level is changed? Is this even possible?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4719

PostPosted: Mon Oct 26, 2015 4:32 pm    Post subject: Reply with quote

Pointers. If you're wondering what they are, this topic describes them pretty well.

If you're wondering how to find them, check out the CE tutorial located under the help menu of CE. You can also use the pointer scanner if you want (tutorial here).

If you don't want to use pointers, then the instructions that write to the values might not change between levels, in which case you could do an AoB injection on them (tutorial here), but you'll need to have a basic comprehension of assembly (tutorial here).

_________________
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
Senort11
Newbie cheater
Reputation: 0

Joined: 26 Oct 2015
Posts: 12

PostPosted: Mon Oct 26, 2015 4:41 pm    Post subject: Reply with quote

I've used pointer scans to keep addresses up to date between game loads, don't know why I didn't think that would work between level loads. Lol

Thanks! I will try that out and see what I can do.
Back to top
View user's profile Send private message
Senort11
Newbie cheater
Reputation: 0

Joined: 26 Oct 2015
Posts: 12

PostPosted: Wed Oct 28, 2015 7:03 pm    Post subject: Reply with quote

Well so far I've had very little luck finding a pointer that works. I did manage to find one that held the value of money between loading levels, but upon restarting the game the pointer no longer pointed to anything valid and none of the other pointers in the scan it came from pointed to the correct address.

Is it possible that all these values are calculated randomly at runtime and I'll never find a pointer that always works?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4719

PostPosted: Wed Oct 28, 2015 8:03 pm    Post subject: Reply with quote

I doubt that. You could try expanding your search settings:
  • Increase the max offset size of your pointers
  • Search for higher level pointers
  • Make sure you're allowing the stack addresses of the first few threads to be handled as static
  • Increase the number of threads you're searching through
  • Increase the max stack offset

Of course, doing so will make the pointer scan take longer and use up more disk space. You can ignore looping pointers to save disk space (but this might make it take longer), and you can set the end offset(s) yourself to make it faster and use up less disk space (but you might miss valid pointers).

Again, alternatively, you could just find out what instructions access whatever values you're trying to find a pointer to, and chances are you'll find one that's a good target for an AoB injection (which should be fine even between game restarts).

_________________
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
Rydian
Grandmaster Cheater Supreme
Reputation: 31

Joined: 17 Sep 2012
Posts: 1358

PostPosted: Thu Oct 29, 2015 3:44 am    Post subject: Reply with quote

If pointer scans are taking too long or being too annoying, you could try one of the other methods. Code editing and stuff can get things working in 30 seconds if the game is cooperative.
_________________
Back to top
View user's profile Send private message
Senort11
Newbie cheater
Reputation: 0

Joined: 26 Oct 2015
Posts: 12

PostPosted: Thu Oct 29, 2015 12:52 pm    Post subject: Reply with quote

I tried the injection copy method but when I got to the step that said to make sure the instruction only accessed the address for the value I needed, both instructions that accessed the address also accessed about 100 more.

When I tried the AoB injection method, I got to the part where that said try introducing nops, and the game just went black. There were still sounds but no way to interact with the game any longer. This leads me to think that the game might have some kind of protection against this kind of tampering.

I haven't tried the AoB to data method in the pointer tutorial, I will be doing that later today. Hopefully, I can make some progress with it.
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4719

PostPosted: Thu Oct 29, 2015 1:12 pm    Post subject: Reply with quote

If an instruction accesses lots of addresses quite often and you NOP it, I'd be surprised if it didn't mess up your game.

What you could do is combine the two methods (pointers and code injection) by finding a pointer to your value that's persistent between levels (it doesn't have to be static!). Instructions that access that pointer might not access other addresses, making it a good target for code injection, so long as you can find a good signature for that AoB.

I did this a while ago on a flash game called fantastic contraption. I gave a pretty brief explanation of what I did here:
http://forum.cheatengine.org/viewtopic.php?p=5597167#5597167

_________________
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
Rydian
Grandmaster Cheater Supreme
Reputation: 31

Joined: 17 Sep 2012
Posts: 1358

PostPosted: Thu Oct 29, 2015 2:00 pm    Post subject: Reply with quote

Yeah, if the instruction accesses a bunch of other things than messing with in any way is going to cause issues.

http://forum.cheatengine.org/viewtopic.php?t=583376
This has some things to do in that case.

_________________
Back to top
View user's profile Send private message
Senort11
Newbie cheater
Reputation: 0

Joined: 26 Oct 2015
Posts: 12

PostPosted: Thu Oct 29, 2015 4:00 pm    Post subject: Reply with quote

ParkourPenguin wrote:
If an instruction accesses lots of addresses quite often and you NOP it, I'd be surprised if it didn't mess up your game.

What you could do is combine the two methods (pointers and code injection) by finding a pointer to your value that's persistent between levels (it doesn't have to be static!). Instructions that access that pointer might not access other addresses, making it a good target for code injection, so long as you can find a good signature for that AoB.

I did this a while ago on a flash game called fantastic contraption. I gave a pretty brief explanation of what I did here:
(link)


I went through the process of finding a pointer that worked between loads and got a ton (1000+) of level 5 pointers that pointed to the correct address, and were still correct between level loads. But I noticed they all had the the same last 2 offsets so I restarted but with level 4 and a specific offsets and got to 4 pointers that were correct between loads. I checked to see what accesses or writes each pointer and for all 4 I got no hits. I tried again with 10 or so level 5 pointers and got the same result.

Rydian wrote:
Yeah, if the instruction accesses a bunch of other things than messing with in any way is going to cause issues.
(
link)
This has some things to do in that case.


So targeting a unique read didn't work. It seems only two instructions ever touch the value I'm looking for. One is running constantly, and the other is only run when I spend or acquire the material I'm looking for. But I've already checked both these instructions and they both access a few hundred things.

The second method doesn't seem like it would apply, because I'm simply trying to find what amounts to a building materials variable. The only way it's used is when you acquire it digging or spend it building. It might be my lack of creativity (and experience lol) but I can't think of a secondary mechanic to try and alter.

And the third one also seems like it wouldn't work because there are no enemies or similar entities in the game. It's just the player who has building materials.

Side note, I want to thank you guys for taking the time to help out a noob like me. It's really appreciated! Smile

EDIT: Just tried using the process of using AoB scans to get the starting address of whatever structure holds the player data but it doesn't work. The scan always gives me the wrong address by quite a bit. I ran the game 16 times, copy and pasting 5 lines from the RAM each time and then ran a diff to find out where to put wildcards. Still gives me the wrong address.

This is a very non cooperative game haha
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4719

PostPosted: Thu Oct 29, 2015 8:43 pm    Post subject: Reply with quote

Did you uncheck the box "Only find paths with a static address"? When you include dynamically allocated base pointers, you should be getting tons more. After changing levels (but not restarting the process itself) a few times and rescanning your pointer list every time, you should generally find over a hundred pointers (most being dynamic) that point to your address, even at a max pointer level as low as 3. At that point, it's just a tedious guessing game. One of those pointers has to be accessed at least once when you change levels.

If you don't want to play that guessing game, I can think of another way that's similar to the third method Rydian linked to; however, unless you plan on spending hours gathering and looking through data to maybe get a result that might work after relaunching the game, I really wouldn't recommend it.

_________________
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
Senort11
Newbie cheater
Reputation: 0

Joined: 26 Oct 2015
Posts: 12

PostPosted: Sat Oct 31, 2015 8:22 pm    Post subject: Reply with quote

I didn't have that unchecked so I retried with that deselected.

It came up with about 130 results and I went through each one trying to find an instruction that only accessed that pointer but each instruction accessed multitudes of other addresses.

This game really has me scratching my head wondering why it's so strangely hard compared to others.
Back to top
View user's profile Send private message
Rydian
Grandmaster Cheater Supreme
Reputation: 31

Joined: 17 Sep 2012
Posts: 1358

PostPosted: Sat Oct 31, 2015 9:34 pm    Post subject: Reply with quote

Some games use lots of shared code, in these cases it will take more work to filter the results.

Do the instructions access the same data, but for other objects? Like if it's health do the instructions access everybody's health? If so you can use comparisons to filter the cheats down to just your unit.

However if it's instructions that modify damned-near-everything, then chances are the game is actually scripted internally using some game creation engine and there might be tutorials on script modding out there.

_________________
Back to top
View user's profile Send private message
Senort11
Newbie cheater
Reputation: 0

Joined: 26 Oct 2015
Posts: 12

PostPosted: Sun Nov 01, 2015 1:37 pm    Post subject: Reply with quote

I shying away from doing stuff that multiple entities might have like health or ammo. I figured it would be easier that way.

From what I understand of the game, only the player has materials and gold but both of those have the same difficulties of the instruction access many different things.

It would appear that this game is well beyond my ability at this point but the things I've learned trying to get a cheat working will definitely help me in the future. Thanks for all the tutorial links and help. It was really interesting stuff.
Back to top
View user's profile Send private message
Rydian
Grandmaster Cheater Supreme
Reputation: 31

Joined: 17 Sep 2012
Posts: 1358

PostPosted: Sun Nov 01, 2015 4:38 pm    Post subject: Reply with quote

Could you show us one of the instructions?
_________________
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
Goto page 1, 2  Next
Page 1 of 2

 
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