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 


Value I *know* is being used doesn't show up in scan

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

Joined: 04 Jul 2020
Posts: 1

PostPosted: Sat Jul 04, 2020 8:58 pm    Post subject: Value I *know* is being used doesn't show up in scan Reply with quote

I'm currently playing a game that lowers a player's crosshair a bit below the centre, and I'm trying to find the exact pixel position in memory that it draws it to. But so far, I've had no luck, even in cases where I know what the value should be.

The crosshair's Y position is (I'm playing on a 1920x1080 monitor), according to my best guess from zooming in on a screencap with paint.net, ~663-664 pixels under normal circumstances, as opposed to the centred 539-540. Luckily, you can shift this position by editing a value in memory, so what I do is search for float values between 660-666 (giving a bit of wiggle room), switch the crosshair to being centred, then search again for values between 537-545 (again, providing a bit of wiggle room). I'll keep repeating back and forth until I narrow it down to the position of the crosshair.

And then here's the problem - I get literally nothing, in the end. The value that matches the crosshair's pixel position is nowhere to be found anywhere, even though I know for a fact it exists *somewhere* in memory. I'll try making the scan not care whether it's checking copy-on-write memory, writable memory, executable memory, etc., and I still get nothing. Not even searching for short ints that are more sensible for positioning HUD elements (even though a check of the game's internals showed me that they use floats for doing so, and alias screen elements to account for being placed between pixel positions like 220.85 or such) yielded me any results.

At first I figured that this game might just use a different positioning system for its HUD elements - after all, the "top of screen = 0 y position" convention isn't universal to my knowledge. I also found out through some painstaking disassembly that the game seems to round your screen height to a nearest preset default (in my case it used 1280x720) when positiong the HUD, but even more disassembly also showed that they seem to convert these values back to your real resolution, so that's probably not a path that will lead anywhere.

With all of this learned, I did extra searches, took into account the various other positioning systems it could use (i.e. perhaps a fraction of the screen, like 0.5 if the crosshair is at the centre, along with the aforementioned others), and... still found nothing. At this point I was pretty much sure that the value in memory was probably part of some function's return value (like the devs just call a GetCrosshairPosition(); function or something), and I have no idea how to track values like that, unfortunately.

Where should I start and how should I solve this? I can provide more context if need be; any extra information I'll gladly provide.

(P.S., I'm using the most recent version of Cheat Engine)
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4730

PostPosted: Sat Jul 04, 2020 9:38 pm    Post subject: Reply with quote

You're making a lot of assumptions about how the game works.
The "correct" way of going about this would be to look at the code that accesses the value you edit to shift the crosshair. Figure out why changes in that value affect the crosshair's position.
MrBigGuy wrote:
...even though I know for a fact it exists *somewhere* in memory.
The lifetime of that value you speak of is almost certainly ephemeral. It gets derived from something else, used in some other calculation or I/O, dies, and vanishes without a trace when some other value overwrites the same memory. It might not even be stored in memory if the cpu has enough free registers over the course of the value's lifetime.
_________________
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
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