Posted: Mon Nov 20, 2023 4:48 am Post subject: Dealing with Rapidly Changing Function Parameters
Hi everyone,
I need some advice regarding handling a situation where a function's parameter value changes rapidly. For instance, when I press the sprint button in a game, the associated pointer shifts to a different structure in memory. This pointer is stack-stored, which I believe is the reason for its frequent changes. By setting a breakpoint on the function and activating the sprint button, I can trace where the stack value leads, and it consistently brings me to the correct structure when my mouse cursor is hovering the sprint symbol.
However, my game crashes as it seems to pick up a random pointer from the stack since my mouse cursor isnt over the sprint symbol when i call the function using a function pointer. Would the most effective solution be to create my own struct with the necessary values at specific offsets and then use this for my function pointer?
For instance, when I press the sprint button in a game, the associated pointer shifts to a different structure in memory.
Sounds like that isn't a good pointer. Sprint, pause the game (Edit -> Settings -> Hotkeys -> Pause the selected process), generate a pointermap, and use that for a pointer scan.
wulfcare wrote:
Would the most effective solution be to create my own struct with the necessary values at specific offsets and then use this for my function pointer?
Technically yes, this is possible; however, it's likely to be far more work than you think. What are the "correct" values? At which offsets? For all pointer values, you'll have to do the same thing recursively. Not to mention any mutable global state...
You'd have to reverse engineer the function and all the calls it makes recursively to figure this information out. At that point, there would be no need to create your own struct since you'd understand how the function gets the sprint value and could copy that.
Another alternative is code injection (search "injection copy"). _________________
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