How can I set a breakpoint for a button click using ollydbg?
i am trying to disable a button click on game client, so i want to set break point to catch the button click event. is that possible to happen with ollydbg?
let application make window and buttons then pause it.
in ollyDBG 1 :
view > windows
Message breakpoint on ClassProc
Messages:
select 202 WM LBUTTONUP
Break on all windows with same title
Pause program: On message
Log WinProc arguments: Never
in ollyDBG 1 or 2 :
view > windows
Conditional breakpoint... Shift+F2
[ESP+8]==WM_LBUTTONUP
as your condition and run programwell, depends, if this program does not have any kind of protection against listing the names of the libraries functions and is not java, it's actually pretty simple.
Method A (Better Approach)
1º Start debugging the process and let it load
2º Find out looking in the program imports if it uses User32.dll (probably does maybe not direcly)
3º Go to OllyDbg and go to Names using Ctrol+N (use this for guide http://www.ollydbg.de/quickst.htm)
4º Sort by name and type RegisterClass** (it will be a export)
5º put a breakpoint on all these names using F2
6º Click on the button
7º You'll break on the message handling, you will need to step foward a bit
thats it
Method B (Lazy Method and less chance of success)
1º Start debbuging the program and let it run normally clicking F9
2º let the program and olly maxized and in front
3º pause the program then click ALT+F9 or CTROL+F9
4º Click the button and hope for a break
5º The program will (may)break on the Return of the button function, you probably will have to trace back to get on the code
Have fun!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With