这次在破解TraceMe的时候,我有看过别人的视频。但是我并没有按照别人思路走,而是完全安全自己的思路试了一次。结果破解成功。新手学破解,如果有不对的地方,还请指出来。

004013A0 crackmes.<ModuleEntryPoint>        /$                                   push    ebp ; EP入口
004013A1 |. 8BEC mov ebp, esp ;保护数据,入栈。方便程序结束后返回
004013A3 |. 6A FF push -
004013A5 |. D0404000 push 004040D0
004013AA |. D41E4000 push 00401ED4 ; SE handler installation
004013AF |. :A1 mov eax, dword ptr fs:[]
004013B5 |. push eax
004013B6 |. : mov dword ptr fs:[], esp
004013BD |. 83EC sub esp,
004013C0 |. push ebx ;将参数压入桟
004013C1 |. push esi ;将参数压入桟
004013C2 |. push edi ;将参数压入桟
004013C3 |. E8 mov dword ptr ss:[ebp-], esp ;将当前桟数据取出保存地址
004013C6 |. FF15 call near dword ptr ds:[<&KERNEL32.Ge>; kernel32.GetVersion ;调用
004013CC |. 33D2 xor edx, edx ;Edx清0
004013CE |. 8AD4 mov dl, ah
004013D0 |. mov dword ptr ds:[], edx
004013D6 |. 8BC8 mov ecx, eax
004013D8 |. 81E1 FF000000 and ecx, 0FF
004013DE |. 890D mov dword ptr ds:[], ecx
004013E4 |. C1E1 shl ecx,
004013E7 |. 03CA add ecx, edx
004013E9 |. 890D mov dword ptr ds:[], ecx
004013EF |. C1E8 shr eax,
004013F2 |. A3 1C554000 mov dword ptr ds:[40551C], eax
004013F7 |. 33F6 xor esi, esi ;清0
004013F9 |. push esi ;将输入压桟
004013FA |. E8 A1090000 call 00401DA0 ;跟进去以后发现是heapcreate函数。创建辅助堆栈
004013FF |. pop ecx ;将ECX值取出
|. 85C0 test eax, eax ;比较EAX值,这个时候值永远是成立的。 垃圾指令,跳过
|. jnz short 0040140C ;EIP指向: 0040140C
|. 6A 1C push 1C
|. E8 B0000000 call 004014BB
0040140B |. pop ecx
0040140C |> FC mov dword ptr ss:[ebp-], esi
0040140F |. E8 E1070000 call 00401BF5
|. FF15 call near dword ptr ds:[<&KERNEL32.Ge>; [GetCommandLineA ;调用API
0040141A |. A3 185A4000 mov dword ptr ds:[405A18], eax
0040141F |. E8 9F060000 call 00401AC3
|. A3 mov dword ptr ds:[], eax
|. E8 call ;CALL没一个一个跟了,直接单步补过
0040142E |. E8 8A030000 call 004017BD
|. E8 A7000000 call 004014DF ;CALL没一个一个跟了,直接单步补过
|. D0 mov dword ptr ss:[ebp-], esi
0040143B |. 8D45 A4 lea eax, dword ptr ss:[ebp-5C] ;数据入栈,然后调用API
0040143E |. push eax ; /pStartupinfo
0040143F |. FF15 3C404000 call near dword ptr ds:[<&KERNEL32.Ge>; \GetStartupInfoA
|. E8 1B030000 call
0040144A |. 9C mov dword ptr ss:[ebp-], eax
0040144D |. F645 D0 test byte ptr ss:[ebp-],
|. je short
|. 0FB745 D4 movzx eax, word ptr ss:[ebp-2C]
|. EB jmp short 0040145C
|> 6A 0A push 0A 数据入栈,然后调用API
0040145B |. pop eax
0040145C |> push eax
0040145D |. FF75 9C push dword ptr ss:[ebp-]
|. push esi
|. push esi ; /pModule
|. FF15 call near dword ptr ds:[<&KERNEL32.Ge>; \GetModuleHandleA 数据入栈,然后调用API
|. push eax
|. E8 92FBFFFF call ;当运行到 程序弹出。

7E46B05E USER32.GetDlgItemTextA                 8BFF                               mov     edi, edi                         ;  USER32.GetDlgItemTextA  API地址
7E46B060 /. push ebp ;保存地址
7E46B061 |. 8BEC mov ebp, esp
7E46B063 |. FF75 0C push dword ptr ss:[ebp+C] ; /ControlID 参数入栈, ControlID
7E46B066 |. FF75 push dword ptr ss:[ebp+] ; |hWnd 参数入栈,hWnd
7E46B069 |. E8 0093FBFF call GetDlgItem ; \GetDlgItem 调用API,GetDlgItem。返回窗口中指定参数ID的子元素的句柄
7E46B06E |. 85C0 test eax, eax ;通过比较,判断以上是否正常,
7E46B070 |. 0E je short 7E46B080 ;标志位没改变。跳转没实现 继续走
7E46B072 |. FF75 push dword ptr ss:[ebp+] ; /Count 参数入栈
7E46B075 |. FF75 push dword ptr ss:[ebp+] ; |Buffer 参数入栈
7E46B078 |. push eax ; |hWnd 参数入栈
7E46B079 |. E8 ED70FCFF call GetWindowTextA ; \GetWindowTextA ;函数原形为:GetDlgItem(控件ID)->GetWindowText(eax); 7E46B07E |. EB 0E jmp short 7E46B08E ;段间短跳转。无条件跳到7E46B08E
7E46B080 |> 837D cmp dword ptr ss:[ebp+],
7E46B084 |. je short 7E46B08C
7E46B086 |. 8B45 mov eax, dword ptr ss:[ebp+]
7E46B089 |. C600 mov byte ptr ds:[eax],
7E46B08C |> 33C0 xor eax, eax
7E46B08E |> 5D pop ebp 将bp基址指针取出。
7E46B08F \. C2 retn RETURN to crackmes.004011B6

004011B6                                     .  8D8C24 9C000000                    lea     ecx, dword ptr ss:[esp+9C]
004011BD . 6A push ; /Count = (.) 将参数入栈
004011BF . push ecx ; |Buffer
004011C0 . E8030000 push 3E8 ; |ControlID = 3E8 (.)
004011C5 . push esi ; |hWnd
004011C6 . 8BD8 mov ebx, eax ; |
004011C8 . FFD7 call near edi ; \GetDlgItemTextA 返回到 GetDlgItemTextA 地址

//又进入了7E46B05E这个地址了。

7E46B05E USER32.GetDlgItemTextA                 8BFF                               mov     edi, edi
7E46B060 /. push ebp
7E46B061 |. 8BEC mov ebp, esp
7E46B063 |. FF75 0C push dword ptr ss:[ebp+C] ; /ControlID
7E46B066 |. FF75 push dword ptr ss:[ebp+] ; |hWnd
7E46B069                                    |.  E8 0093FBFF                        call    GetDlgItem                       ; \GetDlgItem
7E46B06E |. 85C0 test eax, eax
7E46B070 |. 0E je short 7E46B080
7E46B072 |. FF75 push dword ptr ss:[ebp+] ; /Count
7E46B075 |. FF75 push dword ptr ss:[ebp+] ; |Buffer
7E46B078 |. push eax ; |hWnd
7E46B079 |. E8 ED70FCFF call GetWindowTextA ; \GetWindowTextA
7E46B07E |. EB 0E jmp short 7E46B08E
7E46B080  |> 837D cmp dword ptr ss:[ebp+],
7E46B084                                    |.                                 je      short 7E46B08C
7E46B086 |. 8B45 mov eax, dword ptr ss:[ebp+]
7E46B089 |. C600 mov byte ptr ds:[eax],
7E46B08C |> 33C0 xor eax, eax
7E46B08E |> 5D pop ebp 改变基址指针
7E46B08F \. C2 retn ; 返回到 004011CA

004011CA                                     .  8A4424 4C                          mov     al, byte ptr ss:[esp+4C]
004011CE . 84C0 test al, al ;比较AL值
004011D0 . je short
004011D2 . 83FB cmp ebx, ;比较偏移地址值。应该就是我们输入的admin长度的值?
004011D5 . 7C jl short ; 我们来让他进行跳转,更改标志位
004011D7 . 8D5424 4C lea edx, dword ptr ss:[esp+4C] ;桟中取数据。
004011DB . push ebx ;将数据依次取出在压入桟。
004011DC . 8D8424 A0000000 lea eax, dword ptr ss:[esp+A0]
004011E3 . push edx;
这儿其实就相当于:
fucntion: xxxoo Cstring username = GetDlgItemTextA(idc1);
Cstring password = GetDlgItemTextA(idc2); if(lstrlen(username) > || lstrlen(password) > )
{
xxoo(username,password)
}
004011E4                                     .                                   push    eax  将数据依次取出在压入桟。
004011E5 . E8 call ;这儿是个WSprintfW调用。将用户写入到了另外一个变量里
004011EA . 8B3D BC404000 mov edi, dword ptr ds:[<&USER32.GetD>; USER32.GetDlgItem ;调用API
004011F0 . 83C4 0C add esp, 0C ;将桟大小抬高。
004011F3 . 85C0 test eax, eax ;比较返回值,跳转成立,标志位改变、。
004011F5 . je short 0040122E ;条件跳转。 该标志位,继续往下走。
004011F7 . 8D4C24 0C lea ecx, dword ptr ss:[esp+C]
004011FB . push ecx ; /String2
004011FC . E4544000 push 004054E4 ; |String1 = crackmes.004054E4;开辟空间
. FF15 call near dword ptr ds:[<&KERNEL32.ls>; \lstrcpyA ;拷贝字符串。
. 6A push ; /Enable = FALSE
. 6A 6E push 6E ; |/ControlID = 6E (.)
0040120B . push esi ; ||hWnd
0040120C . FFD7 call near edi ; |\GetDlgItem API参数,这儿做的应该就是将我们控件获取的字符串复制给了其他的变量了。
0040120E . 8B1D A4404000 mov ebx, dword ptr ds:[<&USER32.Enab>; |USER32.EnableWindow
. push eax ; |hWnd
. FFD3 call near ebx ; \EnableWindow
. 6A push ; /Enable = FALSE
. E8030000 push 3E8 ; |/ControlID = 3E8 (.)
0040121E . push esi ; ||hWnd
0040121F . FFD7 call near edi ; |\GetDlgItem
. push eax ; |hWnd
. FFD3 call near ebx ; \EnableWindow
. E8030000 push 3E8 ; /ControlID = 3E8 (.)
. push esi ; |hWnd
0040122A . FFD7 call near edi ; \GetDlgItem
0040122C . EB jmp short ;字符串拷贝完毕,准备跳转。

                                     >                                   push    eax                              ; /hWnd
. FF15 A8404000 call near dword ptr ds:[<&USER32.SetF>; \SetFocus
. 6A push ; /BeepType = MB_OK
0040126A . FF15 AC404000 call near dword ptr ds:[<&USER32.Mess>; \MessageBeep
. 8B0D E0544000 mov ecx, dword ptr ds:[4054E0] ; crackmes.
. 6A push ; /lParam = NULL
. push ; |DlgProc = crackmes.
0040127D . push esi ; |hOwner
0040127E . 6A push ; |pTemplate =
. push ecx ; |hInst =>
. FF15 C8404000 call near dword ptr ds:[<&USER32.Dial>; \DialogBoxParamA 继续调用API,成功破解完毕。

最新文章

  1. [转]使用 Xcode 5 和 Interface Builder创建 Hello World App
  2. 利用HttpURLConnection发送请求
  3. html5实现摇一摇功能
  4. MFC中文件的查找、创建、打开、读写等
  5. NHibernate系列文章二十六:NHibernate查询之SQL Query查询(附程序下载)
  6. linux 下如何安装Telnet ?
  7. Linux常用命令(持续更新中)
  8. C++11 std::function用法
  9. TC HTB r2q
  10. Java字符串的最大长度
  11. javascript面向对象——继承
  12. 本地缓存FMDB的使用(iOS)
  13. Nytro MegaRaid
  14. 文件夹的创建(cmd利用)
  15. HDU 5912 Fraction(模拟——分子式化简求解)
  16. Unity配置安卓开发环境
  17. 一、纯css实现顶部进度条随滚动条滚动
  18. 高手进阶,终极内存技术指南——完整/进阶版 II (转)【转】
  19. Centos 安装 python2.7.10以及pip
  20. Android 友盟SDK 终极解决报错:SocialSDK_QQZone_2.jar contains native libraries that

热门文章

  1. Native VLAN打上标记
  2. jwPlayer读取本地视频及相关配置(Tomcat配置虚拟目录)
  3. ZOJ 2059 The Twin Towers(双塔DP)
  4. Exploiting second-order SQL injection 利用二阶注入获取数据库版本信息 SQL Injection Attacks and Defense Second Edition
  5. 任务04——对四则运算小程序的进一步改进,并学习 Git 中 Branch 的用法
  6. DevExpress控件-lookupedit的使用方法详解(图文)转http://blog.csdn.net/qq395537505/article/details/50920508
  7. python的文件处理学习笔记
  8. Java中的异常和处理详解(转发:https://www.cnblogs.com/lulipro/p/7504267.html)
  9. 4.6 基于STM32+MC20地图显示路径功能
  10. iOS警告框和操作表