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 


Finding HUD data in memory

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

Joined: 03 Mar 2022
Posts: 9

PostPosted: Thu Aug 18, 2022 1:07 pm    Post subject: Finding HUD data in memory Reply with quote

Hey, today I've been trying to find the sims 3 hud data in memory but couldn't figure anything out yet.

The problem is the hud always renders at a fixed size, and when playing in 4K screen at 4k resolution, the hud looks tiny.

There's one possible fix which is to play the game at 1080p fullscreen, then the hud will stretch and look bigger but everything else will look blurry, so that's why I'm trying to hack the hud.

There's an option to toggle the HUD pressing F10 ingame so I started scanning changed/unchanged toggling the HUD and found a bunch of values, most of them useless or making the game crash. I found one that would change when the hud was toggled, but if I changed it via CE, the hud wouldn't toggle ingame, so it was kinda useless as well.

I've also tried to use d3dhook snapshot function, I created some snapshots of the hud and looked at the stack, when I look the memory address all the bytes are rapidly changing, and now I'm just stuck.

I've also tried to search for hud related strings in the .exe in ghidra, there are many but none related to ui scale or size.

My guess is I'll have to directly find the function that renders the hud and make it draw it bigger, but I'm not sure how to find it. Either that or finding some global modifier for hud size which I doubt it exists in this game.

I appreciate any help, thanks.
Back to top
View user's profile Send private message
cooleko
Grandmaster Cheater
Reputation: 11

Joined: 04 May 2016
Posts: 717

PostPosted: Thu Aug 18, 2022 6:57 pm    Post subject: Reply with quote

My initial thought is that the game doesn't have a dynamic hud. There is likely a game file somewhere with a picture of what it looks like and it is just rendered as is. The stretching likely uses the same rendering in that one instance. So you wont be finding anything easily. I'm intrigued to see if you can get results using cheat engine.

For anything that is rendered, I try to use modding tools which are specialized to that purpose. A quick google shows there is modding support for the sims 3 so that is likely a good place to start.
Back to top
View user's profile Send private message
insus100
How do I cheat?
Reputation: 0

Joined: 03 Mar 2022
Posts: 9

PostPosted: Fri Aug 19, 2022 4:52 am    Post subject: Reply with quote

cooleko wrote:
My initial thought is that the game doesn't have a dynamic hud. There is likely a game file somewhere with a picture of what it looks like and it is just rendered as is. The stretching likely uses the same rendering in that one instance. So you wont be finding anything easily. I'm intrigued to see if you can get results using cheat engine.

For anything that is rendered, I try to use modding tools which are specialized to that purpose. A quick google shows there is modding support for the sims 3 so that is likely a good place to start.


Yes that's correct, the hud is just images loaded from a .package file and then rendered, I could extract those images from the package and increase their resolution one by one and repack them but there are thousands of hud components (without counting for each ingame item render for the shops, etc...) and it would take a massive amount of time. Also if you google for this specific problem, you'll find nobody who has even attempted this or managed to find a good solution rather than playing on a lower resolution.

There must be a way but I'm not experienced enough in reversing yet.
Back to top
View user's profile Send private message
cooleko
Grandmaster Cheater
Reputation: 11

Joined: 04 May 2016
Posts: 717

PostPosted: Fri Aug 19, 2022 5:49 am    Post subject: Reply with quote

If they are identified in any structured format, perhaps a script is the way to go. Otherwise, does the game use directx? You can hook common functions there and change renders that way.

Similarly, you can use ultimap and see what functions are rendering the hud when you toggle it on and off, that will help narrow down what you are looking for.

Lastly, search the game for float 1.0 and try changing them in batches of 20‰ of their total number of results to 1.5 then toggle the hud. If they have in game scaling you will eventually find it when things increase in size there.
Back to top
View user's profile Send private message
insus100
How do I cheat?
Reputation: 0

Joined: 03 Mar 2022
Posts: 9

PostPosted: Fri Aug 19, 2022 7:33 am    Post subject: Reply with quote

cooleko wrote:
If they are identified in any structured format, perhaps a script is the way to go. Otherwise, does the game use directx? You can hook common functions there and change renders that way.

Similarly, you can use ultimap and see what functions are rendering the hud when you toggle it on and off, that will help narrow down what you are looking for.

Lastly, search the game for float 1.0 and try changing them in batches of 20‰ of their total number of results to 1.5 then toggle the hud. If they have in game scaling you will eventually find it when things increase in size there.


The image files are just in a file among thousands of other different files like a pool. So selecting which are valid hud ones and which aren't is a bit of a pain.

Yes, the game uses directx 9 and found with CE snapshot that it uses DrawIndexedPrimitive method to draw hud component (docs.microsoft . com/en-us/windows/win32/api/d3d9/nf-d3d9-idirect3ddevice9-drawindexedprimitive). I could hook this function but wouldn't know which argument or what to change it to to make it work.

I'll try ultimap since i haven't tested it yet.
Back to top
View user's profile Send private message
cooleko
Grandmaster Cheater
Reputation: 11

Joined: 04 May 2016
Posts: 717

PostPosted: Fri Aug 19, 2022 1:14 pm    Post subject: Reply with quote

This is where solving your problem requires legwork. You can try break and tracing the render function and editing them one at a time until you get success. Then seeing if multiple successful edits had some kind of pattern to them you could detect in an AA script for the edits or you can brute force it and change everything just to see what happens.
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