Ollydbg
OllyDbg
基本操作
配置文件路径: Options->Appearance->Directories
调试设置,全打开: Options->Debugging options->Exceptions
加载库文件: Debug->Select import libraries
关联右键菜单: Options->Add to Explorer
step into: F7
step over: F8,循环和call会跳过
连续step into,Esc可暂停: Ctrl+F7
连续step over,Esc可暂停: Ctrl+F8
加断点: F2
设置中断入口点,一般设置成winmain: Options->Debugging options->Event
EIP设置下一条指令: 某条指令右键->new origin here
回到上一句单步调试指令: -
回到当前EIP: 点图标C,或者双击EIP
执行到ret: Ctrl+F9
从其他DLL跳回来: Alt+F9
暂停: F12
重新载入: Ctrl+F2
运行: F9
查看断点: Alt+B
断点界面,设置断点可用: 空格
断点设置在程序外,关闭时会警告,关闭警告: Options->Debugging options->security->warn when breakpoint is outside the code section
调试方法
定位关键代码,获取文本框字符的函数有
16位 | 32位(ANSI) | 32位(Unicode) |
---|---|---|
GetDlgItemText | GetDlgItemTextA | GetDlgItemTextW |
GetWindowText | GetWindowTextA | GetWindowTextW |
Ctrl+G打开表达式窗口,跳到对应方法,在函数入口点加断点。另一种查询函数的方法是使用Ctrl+N,会打开所有调用的函数,直接输入搜索的函数名,找到后回车可以看到在哪里调用了。
加了断点后就跟踪分析每个指令的含义。