|
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.
|