Posted: Sun Nov 30, 2025 4:09 am Post subject: Collect used stack/register values used by a function?
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?
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.
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.
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