问题
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?
回答1:
let application make window and buttons then pause it.
in ollyDBG 1 :
- go to
view > windows
- select your button.
- right click and select
Message breakpoint on ClassProc
- in
Messages:
select202 WM LBUTTONUP
- select
Break on all windows with same title
- select
Pause program: On message
- select
Log WinProc arguments: Never
in ollyDBG 1 or 2 :
- go to
view > windows
- select your button.
- right click and select
Conditional breakpoint... Shift+F2
- type
[ESP+8]==WM_LBUTTONUP
as your condition and run program
回答2:
well, 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!
来源:https://stackoverflow.com/questions/24138087/how-can-i-set-a-breakpoint-for-a-button-click-using-ollydbg