Jump to content
Tuts 4 You

How to locate key&mouse events handler functions in olly?


blueflycn

Recommended Posts

Actually I am doing with an old game. What I am trying to do is to locate the key & mouse event shandling routines. For example, I want to find the complete routine when 'F1' key is pressed. I tried to trace but seems there are many functions in loop and I don't know where to set BP.


 


Are idea or advices?


Link to comment

If the key is being handled via GetAsyncKeyState, you could set a breakpoint on that then look at the stack to find the calling function.


 


If the key is being handled from RegisterHotKey, you could search for:


 - GetMessage


 - PeekMessage


 - CallWindowProc


 - DefWindowProc


 


And locate the WM_HOTKEY switch (if it exists.)


 


If the key is being handled by WM_CHAR or WM_KEYDOWN etc. you can do the same as above and look for those cases in the switch if they exist.


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...