方法2在密码输入函数上设置断点解释 ■使用ida运行上面程序并输入kpnc+后跟踪程序(反 汇编器能识别系统函数) GetWindow Text text:77E1A4E2 push ebp text:77E1A4E3 mov ebp,esp text:77E1A4E5 push ff text:77E1A4E7 push 77E1A570 text:77E1A4EC ■注意GetWindowText的参数压栈顺序, 显示ebp+8内容: 2022/11/8 Chen Kaiming Copyright 2007 11
2022/11/8 Chen Kaiming Copyright 2007 11 ■使用 ida 运行 上面程序并输入 kpnc++后跟踪程序(反 汇编器能识别系统函数) GetWindowText text:77E1A4E2 push ebp text:77E1A4E3 mov ebp, esp text:77E1A4E5 push ff text:77E1A4E7 push 77E1A570 text:77E1A4EC ………… ■注意GetWindowText 的参数压栈顺序, 显示 ebp+8 内容: 方法2 在密码输入函数上设置断点解释
0023:0012F9FC 0023:0012FA0C 0023:0012FA1C GetWindowText( HWND hwnd; /六文本窗口或者控件句柄*/ LPTSTR IpString; /*文本缓冲区地址*/ int nMaxCount:/*欲拷贝的最大字符数*/ ): 解释ebp+8的意义, 2022/11/8 Chen Kaiming Copyright 2007 12
2022/11/8 Chen Kaiming Copyright 2007 12 0023:0012F9FC ………………………………………. 0023:0012FA0C ………………………………………. 0023:0012FA1C ………………………………………. GetWindowText ( HWND hwnd; /*文本窗口或者控件句柄*/ LPTSTR lpString; /*文本缓冲区地址 */ int nMaxCount; /*欲拷贝的最大字符数 */ ); 解释 ebp+8 的意义
子程序 自由空间 mov ebp,esp ebp 返回地址 栈顶指针 ebp+4 hWnd ebp+8 IpString 字符串缓冲区 ebp+Oc nMaxCount ebp+10 父函数堆栈 2022/11/8 Chen Kaiming Copyright 2007 13
2022/11/8 Chen Kaiming Copyright 2007 13 自由空间 返回地址 hWnd lpString nMaxCount 父函数堆栈 字符串缓冲区 ebp 栈顶指针 ebp+4 ebp+8 ebp+0c ebp+10 子程序 mov ebp,esp
■推出函数接受输入的函数: (ebp+8)=0012F9FC 0023:0012F9 FC kpnc+ ■在此处设置断点,再从头执行,就可以到你要去的程序 代码段 2022/11/8 Chen Kaiming Copyright 2007 14
2022/11/8 Chen Kaiming Copyright 2007 14 ■推出函数接受输入的函数: (ebp+8) = 0012F9FC 0023:0012F9FC kpnc++ ……………………………………………. ■在此处设置断点, 再从头执行, 就可以到你要去的程序 代码段
方法3针对消息没置代码段 ■利用消息获取编辑窗口文本, ■代替GetWindowText()的 SendMessageA(hWnd,WM_GETTEXT,(LPARAM)&buff[O]) 将使GetWindowTextA(GetDlgItemTextA)函数处的断点失效。 ■在NM GETTEXT消息处设置断点 2022/11/8 Chen Kaiming Copyright 2007 15
2022/11/8 Chen Kaiming Copyright 2007 15 方法3 针对消息设置代码段 ■利用消息获取编辑窗口文本. ■代替 GetWindowText() 的 SendMessageA(hWnd, WM_GETTEXT,(LPARAM)&buff[0]) 将使 GetWindowTextA(GetDlgItemTextA)函数处的断点失效。 ■在 WM_GETTEXT消息处设置断点