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 


Collect used stack/register values used by a function?

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

Joined: 30 Nov 2025
Posts: 2
Location: Budapest

PostPosted: Sun Nov 30, 2025 4:09 am    Post subject: Collect used stack/register values used by a function? Reply with quote

Hello,

I have great success with cheat engine and now i wanted to call code not just read/write values.

My problem is that i would like to go fast. And dont see any quick way how to do it. I have the address of a method that selects the target. I would like to call this method, but i see a lot of stack values and register values when stopping with a breakpoint on the first line.

I haven't tried it but im going to do a AOB injection on an empty code cave then start a new thread and give the code cave location as the start address. But obviously i need to set all the register and stack values before calling the method. Is this the good approach? Or maybe im missing something?
Back to top
View user's profile Send private message
ParkourPenguin
I post too much
Reputation: 152

Joined: 06 Jul 2014
Posts: 4715

PostPosted: Sun Nov 30, 2025 2:45 pm    Post subject: Reply with quote

You only need to set the relevant registers and stack values. If you don't know which ones are relevant, you probably shouldn't be calling the function.

Learn windows ABI first.
https://learn.microsoft.com/en-us/cpp/build/x64-calling-convention

If it's 32-bit code, there are many other calling conventions that could be in use.

Look at the function you want to call. Figure out how many parameters it takes as well as the semantics of each parameter (at least their type). If it gets passed any pointers, you'll need to find reliable pointers to those objects as well.

The function might also rely on some global or thread-local state that you need to account for.
Certain engines, e.g. Unity, need to do something to initialize the thread. I forget what exactly you need to do in CE, but the information is in these forums somewhere. In such games where mono features are available, it's probably easier to use the Lua functions in autorun/monoscript.lua to call functions.

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

Joined: 30 Nov 2025
Posts: 2
Location: Budapest

PostPosted: Mon Dec 01, 2025 8:55 pm    Post subject: Reply with quote

Thanks ParkourPenguin, That was quite helpful.
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