好友
阅读权限10
听众
最后登录1970-1-1
|
我是人民币
发表于 2015-7-26 13:09
本帖最后由 我是人民币 于 2015-7-26 13:10 编辑
这类分析应该很多了吧?
一个小小的CM竟然有5到关卡,让我们来一步一步过关斩将,打怪升级。
peid 探测结果 Microsoft Visual C++ 5.0 显示无壳。
每一关的关键字符串都分析出来了。
我们先进入第一关看看。
[Asm] 纯文本查看 复制代码 004019E5 . 52 push edx ; /String2 = "qJT62aWfviq0P57JGs2FelQkX"
004019E6 . 50 push eax ; |String1 = "32321210"
004019E7 . FF15 08404000 call dword ptr ds:[<&KERNEL32.lstrcmpA>] ; \lstrcmpA
004019ED . 85C0 test eax,eax
004019EF . 75 5A jnz short nullz1.00401A4B
004019F1 . 68 70434000 push nullz1.00404370 ; Registration Key Successfully Hacked!
004019F6 . 8D4C24 10 lea ecx,dword ptr ss:[esp+0x10]
004019FA . E8 D9110000 call <jmp.&MFC42.#537>
004019FF . 68 60504000 push nullz1.00405060 ; \nThat was just a warm up. You are now ready for LEVEL-2!
00401A04 . 8D4C24 10 lea ecx,dword ptr ss:[esp+0x10]
00401A08 . C74424 58 000>mov dword ptr ss:[esp+0x58],0x0
00401A10 . E8 BD110000 call <jmp.&MFC42.#941>
00401A15 . 8B4C24 0C mov ecx,dword ptr ss:[esp+0xC]
00401A19 . 6A 00 push 0x0
00401A1B . 68 50504000 push nullz1.00405050 ; Congratulation!
00401A20 . 51 push ecx ; user32.75C36F42
00401A21 . 8BCB mov ecx,ebx
00401A23 . E8 A4110000 call <jmp.&MFC42.#4224>
00401A28 . 8D4C24 0C lea ecx,dword ptr ss:[esp+0xC]
00401A2C . C74424 54 FFF>mov dword ptr ss:[esp+0x54],-0x1
00401A34 . E8 67100000 call <jmp.&MFC42.#800>
00401A39 . 8B4C24 4C mov ecx,dword ptr ss:[esp+0x4C]
第一关主要是通过strcmp来比较注册码。 在这里下一个断点,可以得到第一关的注册码为qJT62aWfviq0P57JGs2FelQkX
要爆破的话修改strcm后面的jnz为nop即可。
来看看第2关:
[Asm] 纯文本查看 复制代码 00401B64 . 52 push edx ; /String2 = "6868686868"
00401B65 . 50 push eax ; |String1 = "121212"
00401B66 . FF15 08404000 call dword ptr ds:[<&KERNEL32.lstrcmpA>] ; \lstrcmpA
00401B6C . 85C0 test eax,eax
00401B6E . 75 50 jnz short nullz1.00401BC0
00401B70 . 68 70434000 push nullz1.00404370 ; Registration Key Successfully Hacked!
00401B75 . 8D4C24 14 lea ecx,dword ptr ss:[esp+0x14]
00401B79 . E8 5A100000 call <jmp.&MFC42.#537>
00401B7E . 68 B8504000 push nullz1.004050B8 ; \nDifficulty LEVEL-2 Completed!
00401B83 . 8D4C24 14 lea ecx,dword ptr ss:[esp+0x14]
00401B87 . C78424 BC0000>mov dword ptr ss:[esp+0xBC],0x0
00401B92 . E8 3B100000 call <jmp.&MFC42.#941>
00401B97 . 8B4C24 10 mov ecx,dword ptr ss:[esp+0x10]
00401B9B . 6A 40 push 0x40
00401B9D . 68 50504000 push nullz1.00405050 ; Congratulation!
00401BA2 . 51 push ecx
00401BA3 . 8BCB mov ecx,ebx
00401BA5 . E8 22100000 call <jmp.&MFC42.#4224>
00401BAA . 8D4C24 10 lea ecx,dword ptr ss:[esp+0x10]
00401BAE . C78424 B80000>mov dword ptr ss:[esp+0xB8],-0x1
00401BB9 . E8 E20E0000 call <jmp.&MFC42.#800>
第二关也是通过strcmp来对比注册码。但是不同的是第二关的注册码是根据UserName生成的,具体算法就不分析了。 破解方法与前面一样,把stcmp后面的jnz改为nop。
第三关 略.... 也是同一样的方法 大家自己分析。
第四关 同上......
主要讲讲第五关。第五关的关键分支比较多。 这一关推荐对MessageBoxA 下断点。
共需要nop4个跳转。
我先根据经验找到所有分支的结束的地方 00402848 这里调用MessageBeep。
在根据分析,失败都会跳到这里。
注册成功则是顺序执行到这里。
所以我们要nop掉所有往00402848 这一块地址跳的指令。
看下面代码注释:
0040272D |. 8B5C24 18 mov ebx,dword ptr ss:[esp+0x18]
00402731 |> 85ED test ebp,ebp
00402733 |. 0F84 0F010000 je nullz1.00402848 ; nop掉
00402739 |. 8B4C24 10 mov ecx,dword ptr ss:[esp+0x10]
0040273D |. 8B41 F8 mov eax,dword ptr ds:[ecx-0x8]
00402740 |. 85C0 test eax,eax
00402742 |. 0F84 00010000 je nullz1.00402848 ; nop掉
00402748 |. 8B5424 14 mov edx,dword ptr ss:[esp+0x14] ; mfc42.6EC4A7E4
0040274C |. 8B4A F8 mov ecx,dword ptr ds:[edx-0x8]
0040274F |. 85C9 test ecx,ecx
00402751 |. 0F84 F1000000 je nullz1.00402848 ; nop掉
00402757 |. 83F8 09 cmp eax,0x9
0040275A |. 7C 2D jl short nullz1.00402789
0040275C |. 8D4424 2C lea eax,dword ptr ss:[esp+0x2C]
00402760 |. 6A 09 push 0x9
00402762 |. 50 push eax
00402763 |. 8D4C24 18 lea ecx,dword ptr ss:[esp+0x18]
00402767 |. E8 D8040000 call <jmp.&MFC42.#4129>
0040276C |. 50 push eax
0040276D |. 8D4C24 14 lea ecx,dword ptr ss:[esp+0x14]
00402771 |. C64424 28 02 mov byte ptr ss:[esp+0x28],0x2
00402776 |. E8 7B040000 call <jmp.&MFC42.#858>
0040277B |. 8D4C24 2C lea ecx,dword ptr ss:[esp+0x2C]
0040277F |. C64424 24 01 mov byte ptr ss:[esp+0x24],0x1
00402784 |. E8 17030000 call <jmp.&MFC42.#800>
00402789 |> 8B4C24 14 mov ecx,dword ptr ss:[esp+0x14] ; mfc42.6EC4A7E4
0040278D |. 8379 F8 08 cmp dword ptr ds:[ecx-0x8],0x8
00402791 |. 7C 2D jl short nullz1.004027C0
00402793 |. 8D5424 2C lea edx,dword ptr ss:[esp+0x2C]
00402797 |. 6A 08 push 0x8
00402799 |. 52 push edx
0040279A |. 8D4C24 1C lea ecx,dword ptr ss:[esp+0x1C]
0040279E |. E8 A1040000 call <jmp.&MFC42.#4129>
004027A3 |. 50 push eax
004027A4 |. 8D4C24 18 lea ecx,dword ptr ss:[esp+0x18]
004027A8 |. C64424 28 03 mov byte ptr ss:[esp+0x28],0x3
004027AD |. E8 44040000 call <jmp.&MFC42.#858>
004027B2 |. 8D4C24 2C lea ecx,dword ptr ss:[esp+0x2C]
004027B6 |. C64424 24 01 mov byte ptr ss:[esp+0x24],0x1
004027BB |. E8 E0020000 call <jmp.&MFC42.#800>
004027C0 |> 8B4424 10 mov eax,dword ptr ss:[esp+0x10]
004027C4 |. 8B35 34424000 mov esi,dword ptr ds:[<&MSVCRT.strtoul>] ; msvcrt.strtoul
004027CA |. 6A 08 push 0x8 ; /radix = 0x8
004027CC |. 6A 00 push 0x0 ; |endptr = NULL
004027CE |. 50 push eax ; |s = 00000001 ???
004027CF |. FFD6 call esi ; \strtoul
004027D1 |. 8B4C24 20 mov ecx,dword ptr ss:[esp+0x20] ; nullz1.004031D0
004027D5 |. 83C4 0C add esp,0xC
004027D8 |. 8BF8 mov edi,eax
004027DA |. 6A 10 push 0x10
004027DC |. 6A 00 push 0x0
004027DE |. 51 push ecx
004027DF |. FFD6 call esi
004027E1 |. 8B4C24 44 mov ecx,dword ptr ss:[esp+0x44]
004027E5 |. 8D1438 lea edx,dword ptr ds:[eax+edi]
004027E8 |. 8B7C24 3C mov edi,dword ptr ss:[esp+0x3C]
004027EC |. 8B4424 40 mov eax,dword ptr ss:[esp+0x40]
004027F0 |. 33CF xor ecx,edi
004027F2 |. 33D0 xor edx,eax
004027F4 |. 03C8 add ecx,eax
004027F6 |. 83C4 0C add esp,0xC
004027F9 |. 3BD1 cmp edx,ecx
004027FB |. 75 4B jnz short nullz1.00402848 ; nop掉
004027FD |. 68 40524000 push nullz1.00405240 ; Difficulty LEVEL-5 Completed!\n
00402802 |. 8D4C24 14 lea ecx,dword ptr ss:[esp+0x14] ;准备成功信息。。
00402806 |. E8 61030000 call <jmp.&MFC42.#860>
0040280B |. 68 70434000 push nullz1.00404370 ; Registration Key Successfully Hacked!
00402810 |. 8D4C24 14 lea ecx,dword ptr ss:[esp+0x14]
00402814 |. E8 B9030000 call <jmp.&MFC42.#941>
00402819 |. 68 10524000 push nullz1.00405210 ; \n\n"Sorry, Level-6 is currently unavailable!"
0040281E |. 8D4C24 14 lea ecx,dword ptr ss:[esp+0x14]
00402822 |. E8 AB030000 call <jmp.&MFC42.#941>
00402827 |. 8B5424 10 mov edx,dword ptr ss:[esp+0x10]
0040282B |. 6A 40 push 0x40
0040282D |. 68 50504000 push nullz1.00405050 ; Congratulation!
00402832 |. 52 push edx
00402833 |. 8BCB mov ecx,ebx
00402835 |. E8 92030000 call <jmp.&MFC42.#4224>
0040283A |. 6A 40 push 0x40
0040283C |. 68 08524000 push nullz1.00405208 ; Notice:
00402841 |. 68 E0514000 push nullz1.004051E0 ; Please contact the author. Thank you!
00402846 |. EB 14 jmp short nullz1.0040285C
00402848 |> 6A FF push -0x1 ; /这一句是所有分支的交汇点|跳转过来的都是失败的
0040284A |. FF15 58424000 call dword ptr ds:[<&USER32.MessageBeep>] ; \MessageBeep
00402850 |. 6A 10 push 0x10
00402852 |. 68 B8434000 push nullz1.004043B8 ; Please try again!
00402857 |. 68 98434000 push nullz1.00404398 ; Invalid Registration Key!
0040285C |> 8BCB mov ecx,ebx
0040285E |. E8 69030000 call <jmp.&MFC42.#4224> ; MessageBoxA
哪里是第6关,呵呵,第6关实际是不存在的。 蘑菇点点的表情真的很萌~
|
免费评分
-
查看全部评分
|