zoukankan      html  css  js  c++  java
  • [反汇编练习] 160个CrackMe之027

    [反汇编练习] 160个CrackMe之027.

    本系列文章的目的是从一个没有任何经验的新手的角度(其实就是我自己),一步步尝试将160个CrackMe全部破解,如果可以,通过任何方式写出一个类似于注册机的东西。

    其中,文章中按照如下逻辑编排(解决如下问题):

    1、使用什么环境和工具

    2、程序分析

    3、思路分析和破解流程

    4、注册机的探索

    ----------------------------------

    提醒各位看客: 如果文章中的逻辑看不明白,那你一定是没有亲手操刀!OD中的跳转提示很强大,只要你跟踪了,不用怎么看代码就理解了!

    ----------------------------------

    1、工具和环境:

    WinXP SP3 + 52Pojie六周年纪念版OD + PEID + 汇编金手指。

    160个CrackMe的打包文件。

    下载地址: http://pan.baidu.com/s/1xUWOY 密码: jbnq

    注:

    1、Win7系统对于模块和程序开启了随机初始地址的功能,会给分析带来很大的负担,所以不建议使用Win7进行分析。

    2、以上工具都是在52PoJie论坛下的原版程序,NOD32不报毒,个人承诺绝对不会进行任何和木马病毒相关内容。

    wps_clip_image-880

    2、程序分析:

    想要破解一个程序,必须先了解这个程序。所以,在破解过程中,对最初程序的分析很重要,他可以帮助我们理解作者的目的和意图,特别是对于注册码的处理细节,从而方便我们反向跟踪和推导。

    和上一节一样,打开CHM,选择第26个Colormaster.exe,保存下来。运行程序,程序界面如下:

    1

    点击上面的那个按钮, 信息框提示 You lost。

    PEID:Microsoft Visual C++ 6.0

    哈哈,没有加壳的C++程序,太好了!

    3、思路分析和破解流程

    1、打开OD,将exe拖到OD窗口中,等程序暂停后,直接点击运行按钮(F9),不用理会。

    2、点击【Check for CD】按钮,弹出信息框,不要关闭,回到OD中,点击暂停按钮。

    3、Ctrl+K,查看堆栈窗口,信息如下:

    0

    哈哈,一下子就找到了MessageBoxA的位置,它的下面的调用函数,右键->Show call。

    VC的API简单明了,直接给出分析结果算了:

    0040121A   .  68 9C304000   push 0040309C                            ;  ASCII "C:"
    0040121F   .  8D4D A4       lea ecx,dword ptr ss:[ebp-0x5C]
    00401222   .  E8 79040000   call <jmp.&MFC42.#537>
    00401227   .  33DB          xor ebx,ebx
    00401229   .  68 98304000   push 00403098                            ;  ASCII "D:"
    0040122E   .  8D4D A8       lea ecx,dword ptr ss:[ebp-0x58]
    00401231   .  895D FC       mov dword ptr ss:[ebp-0x4],ebx
    00401234   .  E8 67040000   call <jmp.&MFC42.#537>
    00401239   .  68 94304000   push 00403094                            ;  ASCII "E:"
    0040123E   .  8D4D AC       lea ecx,dword ptr ss:[ebp-0x54]
    00401241   .  C645 FC 01    mov byte ptr ss:[ebp-0x4],0x1
    00401245   .  E8 56040000   call <jmp.&MFC42.#537>
    0040124A   .  68 90304000   push 00403090                            ;  ASCII "F:"
    0040124F   .  8D4D B0       lea ecx,dword ptr ss:[ebp-0x50]
    00401252   .  C645 FC 02    mov byte ptr ss:[ebp-0x4],0x2
    00401256   .  E8 45040000   call <jmp.&MFC42.#537>
    0040125B   .  68 8C304000   push 0040308C                            ;  ASCII "G:"
    00401260   .  8D4D B4       lea ecx,dword ptr ss:[ebp-0x4C]
    00401263   .  C645 FC 03    mov byte ptr ss:[ebp-0x4],0x3
    00401267   .  E8 34040000   call <jmp.&MFC42.#537>
    0040126C   .  68 88304000   push 00403088                            ;  ASCII "H:"
    00401271   .  8D4D B8       lea ecx,dword ptr ss:[ebp-0x48]
    00401274   .  C645 FC 04    mov byte ptr ss:[ebp-0x4],0x4
    00401278   .  E8 23040000   call <jmp.&MFC42.#537>
    0040127D   .  68 84304000   push 00403084                            ;  ASCII "I:"
    00401282   .  8D4D BC       lea ecx,dword ptr ss:[ebp-0x44]
    00401285   .  C645 FC 05    mov byte ptr ss:[ebp-0x4],0x5
    00401289   .  E8 12040000   call <jmp.&MFC42.#537>
    0040128E   .  68 80304000   push 00403080                            ;  ASCII "J:"
    00401293   .  8D4D C0       lea ecx,dword ptr ss:[ebp-0x40]
    00401296   .  C645 FC 06    mov byte ptr ss:[ebp-0x4],0x6
    0040129A   .  E8 01040000   call <jmp.&MFC42.#537>
    0040129F   .  68 7C304000   push 0040307C                            ;  ASCII "K:"
    004012A4   .  8D4D C4       lea ecx,dword ptr ss:[ebp-0x3C]
    004012A7   .  C645 FC 07    mov byte ptr ss:[ebp-0x4],0x7
    004012AB   .  E8 F0030000   call <jmp.&MFC42.#537>
    004012B0   .  68 78304000   push 00403078                            ;  ASCII "L:"
    004012B5   .  8D4D C8       lea ecx,dword ptr ss:[ebp-0x38]
    004012B8   .  C645 FC 08    mov byte ptr ss:[ebp-0x4],0x8
    004012BC   .  E8 DF030000   call <jmp.&MFC42.#537>
    004012C1   .  68 74304000   push 00403074                            ;  ASCII "M:"
    004012C6   .  8D4D CC       lea ecx,dword ptr ss:[ebp-0x34]
    004012C9   .  C645 FC 09    mov byte ptr ss:[ebp-0x4],0x9
    004012CD   .  E8 CE030000   call <jmp.&MFC42.#537>
    004012D2   .  68 70304000   push 00403070                            ;  ASCII "N:"
    004012D7   .  8D4D D0       lea ecx,dword ptr ss:[ebp-0x30]
    004012DA   .  C645 FC 0A    mov byte ptr ss:[ebp-0x4],0xA
    004012DE   .  E8 BD030000   call <jmp.&MFC42.#537>
    004012E3   .  68 6C304000   push 0040306C                            ;  ASCII "O:"
    004012E8   .  8D4D D4       lea ecx,dword ptr ss:[ebp-0x2C]
    004012EB   .  C645 FC 0B    mov byte ptr ss:[ebp-0x4],0xB
    004012EF   .  E8 AC030000   call <jmp.&MFC42.#537>
    004012F4   .  68 68304000   push 00403068                            ;  ASCII "P:"
    004012F9   .  8D4D D8       lea ecx,dword ptr ss:[ebp-0x28]
    004012FC   .  C645 FC 0C    mov byte ptr ss:[ebp-0x4],0xC
    00401300   .  E8 9B030000   call <jmp.&MFC42.#537>
    00401305   .  BE 9A164000   mov esi,<jmp.&MFC42.#800>                ;  Entry address
    0040130A   .  33C0          xor eax,eax
    0040130C   .  8D7D DC       lea edi,dword ptr ss:[ebp-0x24]
    0040130F   .  56            push esi
    00401310   .  C645 FC 0D    mov byte ptr ss:[ebp-0x4],0xD
    00401314   .  68 94164000   push <jmp.&MFC42.#540>                   ;  Entry address
    00401319   .  AB            stos dword ptr es:[edi]
    0040131A   .  6A 01         push 0x1
    0040131C   .  8D45 DC       lea eax,dword ptr ss:[ebp-0x24]
    0040131F   .  6A 04         push 0x4
    00401321   .  50            push eax
    00401322   .  E8 C3040000   call 004017EA
    00401327   .  8D4D E8       lea ecx,dword ptr ss:[ebp-0x18]
    0040132A   .  C645 FC 0E    mov byte ptr ss:[ebp-0x4],0xE
    0040132E   .  E8 61030000   call <jmp.&MFC42.#540>
    00401333   .  C645 FC 0F    mov byte ptr ss:[ebp-0x4],0xF
    00401337   .  895D EC       mov dword ptr ss:[ebp-0x14],ebx
    0040133A   .  8D7D A4       lea edi,dword ptr ss:[ebp-0x5C]
    0040133D   >  57            push edi
    0040133E   .  8D4D E8       lea ecx,dword ptr ss:[ebp-0x18]
    00401341   .  E8 48030000   call <jmp.&MFC42.#858>
    00401346   .  FF75 E8       push dword ptr ss:[ebp-0x18]             ; /RootPathName
    00401349   .  FF15 04204000 call dword ptr ds:[<&KERNEL32.GetDriveTy>; GetDriveTypeA
    0040134F   .  83F8 03       cmp eax,0x3
    00401352   .  74 3E         je short 00401392
    00401354   .  8D45 E8       lea eax,dword ptr ss:[ebp-0x18]
    00401357   .  68 58304000   push 00403058                            ;  ASCII "CD_CHECK.DAT"
    0040135C   .  50            push eax
    0040135D   .  8D45 E0       lea eax,dword ptr ss:[ebp-0x20]
    00401360   .  50            push eax
    00401361   .  E8 22030000   call <jmp.&MFC42.#924>
    00401366   .  8B00          mov eax,dword ptr ds:[eax]
    00401368   .  53            push ebx                                 ; /hTemplateFile
    00401369   .  53            push ebx                                 ; |Attributes
    0040136A   .  53            push ebx                                 ; |Mode
    0040136B   .  53            push ebx                                 ; |pSecurity
    0040136C   .  6A 01         push 0x1                                 ; |ShareMode = FILE_SHARE_READ
    0040136E   .  68 00000080   push 0x80000000                          ; |Access = GENERIC_READ
    00401373   .  50            push eax                                 ; |FileName
    00401374   .  FF15 00204000 call dword ptr ds:[<&KERNEL32.CreateFile>; CreateFileA
    0040137A   .  83F8 FF       cmp eax,-0x1
    0040137D   .  8D4D E0       lea ecx,dword ptr ss:[ebp-0x20]
    00401380   .  0F9445 F3     sete byte ptr ss:[ebp-0xD]
    00401384   .  E8 11030000   call <jmp.&MFC42.#800>
    00401389   .  385D F3       cmp byte ptr ss:[ebp-0xD],bl
    0040138C   . /0F84 F3000000 je 00401485                              ;  // 发现这个跳转跳到了正确信息位置
    00401392   >  FF45 EC       inc dword ptr ss:[ebp-0x14]
    00401395   .  83C7 04       add edi,0x4
    00401398   .  837D EC 07    cmp dword ptr ss:[ebp-0x14],0x7
    0040139C   .^ 75 9F         jnz short 0040133D
    0040139E   .  53            push ebx
    0040139F   .  68 4C304000   push 0040304C                            ;  ASCII "Try again"
    004013A4   .  68 40304000   push 00403040                            ;  ASCII "You lost"
    004013A9   >  8B4D E4       mov ecx,dword ptr ss:[ebp-0x1C]
    004013AC   .  E8 D1020000   call <jmp.&MFC42.#4224>                  ;  //  返回到这里
    
    正确信息的位置:
    
    00401485   > 53            push ebx
    00401486   .  68 34304000   push 00403034                            ;  ASCII "You did it"
    0040148B   .  68 20304000   push 00403020                            ;  ASCII "Well done, Cracker"
    00401490   .^ E9 14FFFFFF   jmp 004013A9
    00401495   .  6A 00         push 0x0                                 ; /Enable = FALSE
    00401497   .  FF71 20       push dword ptr ds:[ecx+0x20]             ; |hWnd
    0040149A   .  FF15 D0214000 call dword ptr ds:[<&USER32.EnableWindow>; EnableWindow
    004014A0   .  C3            retn
    004014A1   .  6A 01         push 0x1                                 ; /Enable = TRUE
    004014A3   .  FF71 20       push dword ptr ds:[ecx+0x20]             ; |hWnd
    004014A6   .  FF15 D0214000 call dword ptr ds:[<&USER32.EnableWindow>; EnableWindow

    整个流程是这样的:通过CreateFileA函数遍历C-P盘,查看是否存在一个叫做CD_CHECK.dat的文件,如果存在则认为能够找到CD,否则失败!

    je 00401485 为关键跳转,爆破只需要改为jmp 00401485就可以了!

    2

     

    4、注册机的探索

    这个没有注册码,但是在不破解程序的原则上,我们可以在C-P硬盘的随意一个根目录下,新建一个叫做CD_CHECK.dat的文件,然后也可以验证通过!

     

    BY  笨笨D幸福

  • 相关阅读:
    C语言入门(16)——C语言的数组
    快速插入一百万行数据储存过程
    如何将两个表名对调
    MySQL规范
    MySQL运行环境部署规范
    mysql查看存储过程
    批量杀死MySQL连接的几种方法
    查看堵塞的SQL
    mysqldump备份脚本
    查看当前的数据和索引的总大小
  • 原文地址:https://www.cnblogs.com/bbdxf/p/3825697.html
Copyright © 2011-2022 走看看