Is there any good approach to find a function that is associated with a button?

12/19/2018 17:18 jokalokadsd#1
Usually I find an entity of the function i want to call for example (healthAddress) press "Find what Accesses This Address" and then i have found the associated function for it.
Is there any good approach to find functions that are associated with a buttons

I think this is a pretty spot on explaination for my problem(even if it is short). But if i missed any informations you may need pls ask^^
12/22/2018 09:17 florian0#2
There is no generic way. There are many ways to call a function for a button.
The easiest to find one should be to start off with cheat engine. If the button has direct effect to something (like showing a window) you can find the windows visibility value with cheat engine. The address that writes to this value might be inside the handler of the button. Now switch over to a debugger, go to the address and make a breakpoint on the start of the function (first instruction). Now click the button ingame. If the breakpoint hits, this code still belongs to the button. Write down the return address on the stack. Now click a different button, if the breakpoint does not hit, go to the return address from before an repeat this process until the breakpoint hits on other buttons or other unrelated game events. Once you have that location, you know where the handler starts.
12/22/2018 13:15 warfley#3
If the game has no debugger blocking mechanism you could also break in the frameworks message scheduling function using a conditional breakpoint for only targeting click messages
Than just step to the program and search for the beginning of the desired function