首页
社区
课程
招聘
[原创]Image To PDF 2.5算法分析
2005-3-13 00:55 8251

[原创]Image To PDF 2.5算法分析

2005-3-13 00:55
8251
【破解作者】 zmw1224[CZG][DFCG]
【作者邮箱】 zmw1224@yahoo.com.cn
【使用工具】 OD,AspackDie
【破解平台】 Win9x/NT/2000/XP
【软件名称】 Image To PDF 2.5
【下载地址】 http://nj.onlinedown.net/soft/23327.htm
【软件简介】 批量TIF, JPG, GIF, PNG, BMP, PSD, WMF, EMF, PDF, PCX, PIC等格式图片转换成PDF格式文件的工具。
【软件大小】 2065KB

【加壳方式】 ASPack 2.12
【破解声明】 本笔记只用于学习交流, 初学Crack,只是感兴趣技术,没有其他目的, 如有不妥之处, 希望作者谅解
--------------------------------------------------------------------------------
【破解内容】

先查壳,ASPack 2.12的壳,用工具脱了,Borland C++ 1999,字符串查找,找到些不疼不痒的东西,只好让DEDE出马了,DEDE找到事件入口40D789,然后在40D789下断,运行程序,输入相关信息:

E-mail:zmw1224@yahoo.com.cn
Serial number:1234567890

确定后,马上被断在下面:

0040D780   /.  55          push ebp                                     ;  被断在这。
0040D781   |.  8BEC        mov ebp,esp
0040D783   |.  83C4 B4     add esp,-4C
0040D786   |.  53          push ebx
0040D787   |.  56          push esi
0040D788   |.  57          push edi
0040D789   |.  8BD8        mov ebx,eax
0040D78B   |.  BE 07D84D00 mov esi,Unpacked.004DD807
0040D790   |.  8D7D C8     lea edi,dword ptr ss:[ebp-38]
0040D793   |.  B8 64DA4D00 mov eax,Unpacked.004DDA64
0040D798   |.  E8 A3DC0B00 call Unpacked.004CB440
0040D79D   |.  66:C747 10 >mov word ptr ds:[edi+10],14
0040D7A3   |.  33D2        xor edx,edx
0040D7A5   |.  8955 FC     mov dword ptr ss:[ebp-4],edx
0040D7A8   |.  8D55 FC     lea edx,dword ptr ss:[ebp-4]
0040D7AB   |.  FF47 1C     inc dword ptr ds:[edi+1C]
0040D7AE   |.  8B83 280500>mov eax,dword ptr ds:[ebx+528]
0040D7B4   |.  E8 B3530600 call Unpacked.00472B6C                       ;  获取假注册码
0040D7B9   |.  66:C747 10 >mov word ptr ds:[edi+10],8
0040D7BF   |.  66:C747 10 >mov word ptr ds:[edi+10],20
0040D7C5   |.  33C9        xor ecx,ecx
0040D7C7   |.  894D F8     mov dword ptr ss:[ebp-8],ecx
0040D7CA   |.  8D55 F8     lea edx,dword ptr ss:[ebp-8]
0040D7CD   |.  FF47 1C     inc dword ptr ds:[edi+1C]
0040D7D0   |.  8B83 080500>mov eax,dword ptr ds:[ebx+508]
0040D7D6   |.  E8 91530600 call Unpacked.00472B6C                       ;  获取E-mail
0040D7DB   |.  66:C747 10 >mov word ptr ds:[edi+10],8
0040D7E1   |.  837D FC 00  cmp dword ptr ss:[ebp-4],0                   ;  判断是否为空?不是就往下走。
0040D7E5   |.  8D4D B4     lea ecx,dword ptr ss:[ebp-4C]
0040D7E8   |.  74 05       je short Unpacked.0040D7EF
0040D7EA   |.  8B55 FC     mov edx,dword ptr ss:[ebp-4]                 ;  把zmw1224@yahoo.com.cn送到EDX里
0040D7ED   |.  EB 03       jmp short Unpacked.0040D7F2
0040D7EF   |>  8D56 1C     lea edx,dword ptr ds:[esi+1C]
0040D7F2   |>  8BC3        mov eax,ebx
0040D7F4   |.  E8 DF030000 call Unpacked.0040DBD8                       ;  关键算法跟进
0040D7F9   |.  837D F8 00  cmp dword ptr ss:[ebp-8],0                   ;  判断假注册码是否为空?
0040D7FD   |.  74 05       je short Unpacked.0040D804
0040D7FF   |.  8B55 F8     mov edx,dword ptr ss:[ebp-8]
0040D802   |.  EB 03       jmp short Unpacked.0040D807
0040D804   |>  8D56 1D     lea edx,dword ptr ds:[esi+1D]
0040D807   |>  8BC3        mov eax,ebx
0040D809   |.  E8 AA060000 call Unpacked.0040DEB8
0040D80E   |.  84C0        test al,al
0040D810   |.  0F85 970000>jnz Unpacked.0040D8AD
0040D816   |.  6A 10       push 10
0040D818   |.  837D F8 00  cmp dword ptr ss:[ebp-8],0
0040D81C   |.  74 05       je short Unpacked.0040D823
0040D81E   |.  8B4D F8     mov ecx,dword ptr ss:[ebp-8]
0040D821   |.  EB 03       jmp short Unpacked.0040D826
0040D823   |>  8D4E 1E     lea ecx,dword ptr ds:[esi+1E]
0040D826   |>  51          push ecx                                     ; |Arg2
0040D827   |.  8D45 B4     lea eax,dword ptr ss:[ebp-4C]                ; |
0040D82A   |.  50          push eax                                     ; |Arg1
0040D82B   |.  E8 C4DA0B00 call Unpacked.004CB2F4                       ; \真假码比较,不对就OVER了。
0040D830   |.  83C4 0C     add esp,0C
0040D833   |.  85C0        test eax,eax
0040D835   |.  74 76       je short Unpacked.0040D8AD
0040D837   |.  66:C747 10 >mov word ptr ds:[edi+10],2C
0040D83D   |.  8D56 1F     lea edx,dword ptr ds:[esi+1F]
0040D840   |.  8D45 F4     lea eax,dword ptr ss:[ebp-C]
0040D843   |.  E8 988E0C00 call Unpacked.004D66E0

关键算法:
0040DBD8   /$  53          push ebx
0040DBD9   |.  56          push esi
0040DBDA   |.  57          push edi
0040DBDB   |.  55          push ebp
0040DBDC   |.  81C4 68FFFF>add esp,-98
0040DBE2   |.  8BE9        mov ebp,ecx
0040DBE4   |.  8BDA        mov ebx,edx
0040DBE6   |.  85DB        test ebx,ebx
0040DBE8   |.  0F84 A30000>je Unpacked.0040DC91
0040DBEE   |.  85ED        test ebp,ebp
0040DBF0   |.  0F84 9B0000>je Unpacked.0040DC91
0040DBF6   |.  6A 11       push 11                                      ; /Arg3 = 00000011
0040DBF8   |.  6A 00       push 0                                       ; |Arg2 = 00000000
0040DBFA   |.  8D8424 8C00>lea eax,dword ptr ss:[esp+8C]                ; |
0040DC01   |.  50          push eax                                     ; |Arg1
0040DC02   |.  E8 B1D30B00 call Unpacked.004CAFB8                       ; \Unpacked.004CAFB8
0040DC07   |.  83C4 0C     add esp,0C
0040DC0A   |.  BE E3D74D00 mov esi,Unpacked.004DD7E3                    ;  ASCII "PX4VUTE8Q1YONML6GIHJZFSDCBA9R7K5W32"
0040DC0F   |.  8D7C24 08   lea edi,dword ptr ss:[esp+8]                 ;  上面一串字符串未知,以后才知道是查表用的。
0040DC13   |.  B9 09000000 mov ecx,9
0040DC18   |.  F3:A5       rep movs dword ptr es:[edi],dword ptr ds:[es>
0040DC1A   |.  8D4424 2C   lea eax,dword ptr ss:[esp+2C]
0040DC1E   |.  50          push eax                                     ; /Arg1
0040DC1F   |.  E8 C80D0000 call Unpacked.0040E9EC                       ; \跟进。
0040DC24   |.  59          pop ecx
0040DC25   |.  53          push ebx
0040DC26   |.  E8 C1D40B00 call Unpacked.004CB0EC

跟进后:
0040E9EC   /$  55                 push ebp                                     ;  一进这个CALL吓一跳,晕啊,一看见这几个常数,就知道是MD5算法。
0040E9ED   |.  8BEC               mov ebp,esp
0040E9EF   |.  8B45 08            mov eax,dword ptr ss:[ebp+8]
0040E9F2   |.  33D2               xor edx,edx
0040E9F4   |.  8950 14            mov dword ptr ds:[eax+14],edx
0040E9F7   |.  8950 10            mov dword ptr ds:[eax+10],edx
0040E9FA   |.  C700 01234567      mov dword ptr ds:[eax],67452301
0040EA00   |.  C740 04 89ABCDEF   mov dword ptr ds:[eax+4],EFCDAB89
0040EA07   |.  C740 08 FEDCBA98   mov dword ptr ds:[eax+8],98BADCFE
0040EA0E   |.  C740 0C 76543210   mov dword ptr ds:[eax+C],10325476
0040EA15   |.  5D                 pop ebp
0040EA16   \.  C3                 retn

继续往下走:
0040DC1F   |.  E8 C80D0000        call Unpacked.0040E9EC                       ;
0040DC24   |.  59                 pop ecx
0040DC25   |.  53                 push ebx
0040DC26   |.  E8 C1D40B00        call Unpacked.004CB0EC
0040DC2B   |.  59                 pop ecx
0040DC2C   |.  50                 push eax                                     ; /Arg3
0040DC2D   |.  53                 push ebx                                     ; |Arg2
0040DC2E   |.  8D5424 34          lea edx,dword ptr ss:[esp+34]                ; |
0040DC32   |.  52                 push edx                                     ; |Arg1
0040DC33   |.  E8 E00D0000        call Unpacked.0040EA18                       ; \Unpacked.0040EA18
0040DC38   |.  83C4 0C            add esp,0C
0040DC3B   |.  8D4C24 2C          lea ecx,dword ptr ss:[esp+2C]
0040DC3F   |.  51                 push ecx                                     ; /Arg2
0040DC40   |.  8D8424 88000000    lea eax,dword ptr ss:[esp+88]                ; |
0040DC47   |.  50                 push eax                                     ; |Arg1
0040DC48   |.  E8 630E0000        call Unpacked.0040EAB0                       ; \Unpacked.0040EAB0
0040DC4D   |.  83C4 08            add esp,8                                    ;  上面几个CALL是用MD5把“zmw1224@yahoo.com.cn”进行转化。
0040DC50   |.  33FF               xor edi,edi                                  ;  转化后的数值为:FD393F196BB60EABD610AC80972539C0
0040DC52   |.  8BF5               mov esi,ebp                                  ;  下面开始用MD5转化后的数值进行运算了。
0040DC54   |.  8D9C24 84000000    lea ebx,dword ptr ss:[esp+84]                ;  这里是数据区里的数值:0012EF20  FD 39 3F 19 6B B6 0E AB D6 10 AC 80 97 25 39 C0  ??k????9
0040DC5B   |>  33C0               /xor eax,eax
0040DC5D   |.  8A03               |mov al,byte ptr ds:[ebx]                    ;  取FD送到AL里
0040DC5F   |.  B9 23000000        |mov ecx,23                                  ;  把0x23送到ECX里
0040DC64   |.  99                 |cdq
0040DC65   |.  F7F9               |idiv ecx                                    ;  s[i]%=0x23;对0x23取余,余数在EDX,EDX=8里。
0040DC67   |.  33C0               |xor eax,eax                                 ;  EAX清0
0040DC69   |.  8A4414 08          |mov al,byte ptr ss:[esp+edx+8]              ;  根据上面提到的字符串,用余数查表。
0040DC6D   |.  50                 |push eax                                    ; /<%c>
0040DC6E   |.  68 7ED94D00        |push Unpacked.004DD97E                      ; |Format = "%c"
0040DC73   |.  8D5424 08          |lea edx,dword ptr ss:[esp+8]                ; |
0040DC77   |.  52                 |push edx                                    ; |s
0040DC78   |.  E8 B59E0C00        |call <jmp.&USER32.wsprintfA>                ; \然后转化成相应字符。得到'Q'.
0040DC7D   |.  83C4 0C            |add esp,0C
0040DC80   |.  8A0C24             |mov cl,byte ptr ss:[esp]
0040DC83   |.  880E               |mov byte ptr ds:[esi],cl                    ;  把得到的字符存起来。
0040DC85   |.  47                 |inc edi
0040DC86   |.  46                 |inc esi                                     ;  后面就是循环,取数直到取完16个数为止。
0040DC87   |.  43                 |inc ebx
0040DC88   |.  83FF 10            |cmp edi,10
0040DC8B   |.^ 7C CE              \jl short Unpacked.0040DC5B
0040DC8D   |.  C645 11 00         mov byte ptr ss:[ebp+11],0
0040DC91   |>  81C4 98000000      add esp,98
0040DC97   |.  5D                 pop ebp                                      ;  这里,入栈的时候出现真码了"QSRB48L5UGWDO4SI"
0040DC98   |.  5F                 pop edi
0040DC99   |.  5E                 pop esi
0040DC9A   |.  5B                 pop ebx
0040DC9B   \.  C3                 retn

出CALL后:
0040D7F9   |.  837D F8 00         cmp dword ptr ss:[ebp-8],0                   ;  判断假注册码是否为空?
0040D7FD   |.  74 05              je short Unpacked.0040D804
0040D7FF   |.  8B55 F8            mov edx,dword ptr ss:[ebp-8]
0040D802   |.  EB 03              jmp short Unpacked.0040D807
0040D804   |>  8D56 1D            lea edx,dword ptr ds:[esi+1D]
0040D807   |>  8BC3               mov eax,ebx
0040D809   |.  E8 AA060000        call Unpacked.0040DEB8
0040D80E   |.  84C0               test al,al
0040D810   |.  0F85 97000000      jnz Unpacked.0040D8AD
0040D816   |.  6A 10              push 10
0040D818   |.  837D F8 00         cmp dword ptr ss:[ebp-8],0
0040D81C   |.  74 05              je short Unpacked.0040D823
0040D81E   |.  8B4D F8            mov ecx,dword ptr ss:[ebp-8]
0040D821   |.  EB 03              jmp short Unpacked.0040D826
0040D823   |>  8D4E 1E            lea ecx,dword ptr ds:[esi+1E]
0040D826   |>  51                 push ecx                                     ; |Arg2
0040D827   |.  8D45 B4            lea eax,dword ptr ss:[ebp-4C]                ; |
0040D82A   |.  50                 push eax                                     ; |这出现真码了,可做内存注册机了。
0040D82B   |.  E8 C4DA0B00        call Unpacked.004CB2F4                       ; \真假码比较,不对就OVER了。
0040D830   |.  83C4 0C            add esp,0C
0040D833   |.  85C0               test eax,eax
0040D835   |.  74 76              je short Unpacked.0040D8AD
0040D837   |.  66:C747 10 2C00    mov word ptr ds:[edi+10],2C
0040D83D   |.  8D56 1F            lea edx,dword ptr ds:[esi+1F]
0040D840   |.  8D45 F4            lea eax,dword ptr ss:[ebp-C]
0040D843   |.  E8 988E0C00        call Unpacked.004D66E0

--------------------------------------------------------------------------------
【算法注册机】

注册机里没贴MD5源码,贴的话,一大堆只有MD5转化后的数值!
#include <stdio.h>
main()

{
    char CODE[255]={"PX4VUTE8Q1YONML6GIHJZFSDCBA9R7K5W32"};
    int s[255]={
                 0xFD,0x39,0x3F,0x19,0x6B,0xB6,0x0E,0xAB,
                 0xD6,0x10,0xAC,0x80,0x97,0x25,0x39,0xC0,
                 };
    int i,n,j;
   

printf("Crack by zmw1224[CZG][DFCG]\n");
printf("___________________________\n");
printf("你的注册码是:");
           for(i=0;i<16;i++)
              {
                s[i]%=0x23;
                j=s[i];
                printf("%c",CODE[j]);
               }

}
--------------------------------------------------------------------------------
【内存注册机】

中断地址:40D82A
中断次数:1
第一字节:50
寄存器:EAX
长度:1
--------------------------------------------------------------------------------
【用户名、密码】

用户名:zmw1224@yahoo.com.cn
注册码:QSRB48L5UGWDO4SI
--------------------------------------------------------------------------------
【版权声明】 本文纯属技术交流, 转载请注明作者并保持文章的完整, 谢谢!

[CTF入门培训]顶尖高校博士及硕士团队亲授《30小时教你玩转CTF》,视频+靶场+题目!助力进入CTF世界

收藏
点赞7
打赏
分享
最新回复 (6)
雪    币: 389
活跃值: (912)
能力值: ( LV9,RANK:770 )
在线值:
发帖
回帖
粉丝
kyc 19 2005-3-13 01:00
2
0
支持支持
雪    币: 207
活跃值: (55)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
游上岸的鱼 1 2005-3-13 01:11
3
0
好 顶一下
雪    币: 238
活跃值: (250)
能力值: ( LV9,RANK:170 )
在线值:
发帖
回帖
粉丝
fchker 4 2005-3-13 08:15
4
0
支持!!
雪    币: 29412
活跃值: (18675)
能力值: (RANK:350 )
在线值:
发帖
回帖
粉丝
kanxue 8 2005-3-13 08:29
5
0
这段代码着色的颜色处理不错,看的清爽。
雪    币: 201
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
hyd009 2005-3-13 08:58
6
0
--------------------------------------------------------------------------------
这段代码着色的颜色处理不错,看的清爽
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
wyuu 2005-3-13 14:20
7
0
看雪老师都说好 一定支持!!!
游客
登录 | 注册 方可回帖
返回