首页
社区
课程
招聘
[原创]Happytown 第五个CrackMe
2007-5-18 00:16 5135

[原创]Happytown 第五个CrackMe

2007-5-18 00:16
5135
【文章标题】: [HappyTown]第五个CrackMe
【文章作者】: qianyicy
【作者邮箱】: qgnck1999@163.com
【下载地址】: 置顶贴中有
【使用工具】: ollydbg
【作者声明】: 只是感兴趣,没有其他目的。失误之处敬请诸位大侠赐教!
--------------------------------------------------------------------------------
【详细过程】
      老规矩,我们先看看有没有可用的字符串,还好,happytown这次又给我们开了一条捷径:),双击Congratulations,我们来
  到以下地址:
  004501AA  |.  68 20024500      push KeyGenMe.00450220              ; |Title = "Congratulations"
  004501AF  |.  68 30024500      push KeyGenMe.00450230              ; |Text = "Good job,man!"
  004501B4  |.  6A 00            push 0                              ; |hOwner = NULL
  004501B6  |.  E8 E562FBFF      call <jmp.&user32.MessageBoxA>      ; \MessageBoxA
  
  向上走几格来到:
  004501A6  |. /75 13            jnz short KeyGenMe.004501BB
  
  如果想爆破的话,把此跳转nop掉即可,
  
  接着向上走,一至到:
  0045007D  |.  BA F8014500      mov edx,KeyGenMe.004501F8           ;  ASCII "~!@#$%^&*()_+|\=-/?.,><;:`"
  00450082  |.  E8 213EFBFF      call KeyGenMe.00403EA8
  00450087  |.  8D45 EC          lea eax,dword ptr ss:[ebp-14]
  
  各位看见那串字符了吗?那可不是Happytown无聊写进去玩的,那可是串好东东哦,注册码就靠他们了,:)
  我们在此按F2设断点,F9运行程序,填入注册名,注册码,然后单击check,好了,程序被断下来了,我们接着分析:
  0045009B  |.  E8 B8F2FDFF      call KeyGenMe.0042F358              ;  计算注册名位数
  004500A0  |.  8B45 F8          mov eax,dword ptr ss:[ebp-8]
  004500A3  |.  E8 2840FBFF      call KeyGenMe.004040D0
  004500A8  |.  8945 E8          mov dword ptr ss:[ebp-18],eax       ;  位数送EBP-18
  004500AB  |.  837D E8 04       cmp dword ptr ss:[ebp-18],4         ;  位数必须于4比较
  004500AF  |.  0F8C 06010000    jl KeyGenMe.004501BB                ;  <4就跳,必须>=4
  004500B5  |.  8D55 F4          lea edx,dword ptr ss:[ebp-C]
  004500B8  |.  8B45 FC          mov eax,dword ptr ss:[ebp-4]
  004500BB  |.  8B80 08030000    mov eax,dword ptr ds:[eax+308]
  004500C1  |.  E8 92F2FDFF      call KeyGenMe.0042F358              ;  计算注册码位数
  004500C6  |.  8B45 F4          mov eax,dword ptr ss:[ebp-C]
  004500C9  |.  E8 0240FBFF      call KeyGenMe.004040D0
  004500CE  |.  8945 E4          mov dword ptr ss:[ebp-1C],eax       ;  位数送EBP-1C
  004500D1  |.  837D E4 00       cmp dword ptr ss:[ebp-1C],0         ;  位数必须>0
  004500D5  |.  0F84 E0000000    je KeyGenMe.004501BB
  004500DB  |.  8B45 E8          mov eax,dword ptr ss:[ebp-18]       ;  取得注册名位数
  004500DE  |.  25 01000080      and eax,80000001                    ;  下面几句为判断注册名位数是奇还是偶;
  004500E3  |.  79 05            jns short KeyGenMe.004500EA
  004500E5  |.  48               dec eax
  004500E6  |.  83C8 FE          or eax,FFFFFFFE
  004500E9  |.  40               inc eax
  004500EA  |>  85C0             test eax,eax
  004500EC  |.  74 0D            je short KeyGenMe.004500FB
  004500EE  |.  8D45 F8          lea eax,dword ptr ss:[ebp-8]
  004500F1  |.  BA 1C024500      mov edx,KeyGenMe.0045021C           ;  得到一个*
  004500F6  |.  E8 DD3FFBFF      call KeyGenMe.004040D8              ;  把*连接到注册名后面,使注册名为偶数
  004500FB  |>  8B45 F8          mov eax,dword ptr ss:[ebp-8]
  004500FE  |.  E8 CD3FFBFF      call KeyGenMe.004040D0
  00450103  |.  8945 E8          mov dword ptr ss:[ebp-18],eax
  00450106  |.  8B45 E8          mov eax,dword ptr ss:[ebp-18]
  00450109  |.  D1E8             shr eax,1                           ;  eax/2
  0045010B  |.  8945 D8          mov dword ptr ss:[ebp-28],eax       ;  获得循环次数?
  0045010E  |.  8B45 D8          mov eax,dword ptr ss:[ebp-28]
  00450111  |.  85C0             test eax,eax                        ;  注册码>1?
  00450113  |.  0F8E 82000000    jle KeyGenMe.0045019B
  00450119  |.  8945 D4          mov dword ptr ss:[ebp-2C],eax
  0045011C  |.  C745 E0 01000000 mov dword ptr ss:[ebp-20],1
  00450123  |>  33C0             /xor eax,eax                        ;  循环开始
  00450125  |.  8945 DC          |mov dword ptr ss:[ebp-24],eax
  00450128  |.  8B45 F8          |mov eax,dword ptr ss:[ebp-8]
  0045012B  |.  8B55 E0          |mov edx,dword ptr ss:[ebp-20]
  0045012E  |.  0FB64410 FF      |movzx eax,byte ptr ds:[eax+edx-1]  ;  注册名第一位送eax
  00450133  |.  C1E0 02          |shl eax,2                          ;  eax*4
  00450136  |.  B9 1A000000      |mov ecx,1A                         ;  ECX=1A
  0045013B  |.  33D2             |xor edx,edx                        ;  EDX清0
  0045013D  |.  F7F1             |div ecx                            ;  EAX/EDX
  0045013F  |.  8955 DC          |mov dword ptr ss:[ebp-24],edx      ;  余数送ebp-24
  00450142  |.  8D45 CC          |lea eax,dword ptr ss:[ebp-34]
  00450145  |.  8B55 F0          |mov edx,dword ptr ss:[ebp-10]      ;  字符串送edx
  00450148  |.  8B4D DC          |mov ecx,dword ptr ss:[ebp-24]      ;  余数送ecx
  0045014B  |.  8A140A           |mov dl,byte ptr ds:[edx+ecx]       ;  根据余数数值按位取字符串字符
  0045014E  |.  E8 A53EFBFF      |call KeyGenMe.00403FF8             ;  存取得到的字符串
  00450153  |.  8B55 CC          |mov edx,dword ptr ss:[ebp-34]
  00450156  |.  8D45 EC          |lea eax,dword ptr ss:[ebp-14]
  00450159  |.  E8 7A3FFBFF      |call KeyGenMe.004040D8             ;  把字符串的地址存入EBP-14
  0045015E  |.  8B45 F8          |mov eax,dword ptr ss:[ebp-8]
  00450161  |.  8B55 E0          |mov edx,dword ptr ss:[ebp-20]
  00450164  |.  0FB60410         |movzx eax,byte ptr ds:[eax+edx]    ;  注册码第二位送eax
  00450168  |.  8D0440           |lea eax,dword ptr ds:[eax+eax*2]   ;  EAX*3
  0045016B  |.  B9 1A000000      |mov ecx,1A                         ;  ecx=1A
  00450170  |.  33D2             |xor edx,edx
  00450172  |.  F7F1             |div ecx                            ;  以下功能和上面相同
  00450174  |.  8955 DC          |mov dword ptr ss:[ebp-24],edx
  00450177  |.  8D45 C8          |lea eax,dword ptr ss:[ebp-38]
  0045017A  |.  8B55 F0          |mov edx,dword ptr ss:[ebp-10]
  0045017D  |.  8B4D DC          |mov ecx,dword ptr ss:[ebp-24]
  00450180  |.  8A140A           |mov dl,byte ptr ds:[edx+ecx]
  00450183  |.  E8 703EFBFF      |call KeyGenMe.00403FF8
  00450188  |.  8B55 C8          |mov edx,dword ptr ss:[ebp-38]
  0045018B  |.  8D45 EC          |lea eax,dword ptr ss:[ebp-14]
  0045018E  |.  E8 453FFBFF      |call KeyGenMe.004040D8
  00450193  |.  FF45 E0          |inc dword ptr ss:[ebp-20]
  00450196  |.  FF4D D4          |dec dword ptr ss:[ebp-2C]          ;  计数器自减
  00450199  |.^ 75 88            \jnz short KeyGenMe.00450123
  0045019B  |>  8B45 EC          mov eax,dword ptr ss:[ebp-14]       ;  ASCII")#$%:?:`"
  0045019E  |.  8B55 F4          mov edx,dword ptr ss:[ebp-C]        ;  我们输入的假码
  004501A1  |.  E8 7640FBFF      call KeyGenMe.0040421C
  
  
--------------------------------------------------------------------------------
【版权声明】: 本文原创于看雪技术论坛, 转载请注明作者并保持文章的完整, 谢谢!

                                                       2007年05月18日 0:11:50

[培训]科锐软件逆向50期预科班报名即将截止,速来!!! 50期正式班报名火爆招生中!!!

收藏
免费 0
打赏
分享
最新回复 (6)
雪    币: 228
活跃值: (10)
能力值: ( LV8,RANK:130 )
在线值:
发帖
回帖
粉丝
qianyicy 3 2007-5-18 00:19
2
0
没时间了,睡觉了,呵呵,注册机明天写了发上来
雪    币: 228
活跃值: (10)
能力值: ( LV8,RANK:130 )
在线值:
发帖
回帖
粉丝
qianyicy 3 2007-5-19 16:39
3
0
附上C语言注册机原码:

main()
{
    int i=0,j=0,k,l,a,b;
    char c[]={"~!@#$%^&*()_+|\\=-/?.,><;:`"};
    char name[100];
    char code[100];
    s1:
    printf("please input your name:\n");
    gets(name);
    while (1){
        if (name[i] == '\0')
            break;
        i++;
        }
    if (i < 4) {
        printf("The Character of name must >= 4,Press any key to input again:");
        getch();
        clrscr();
        goto s1;
        }
    a=(i+1)/2;
    i=0;
    for(b=1; b<=a; b++){
        k=name[i]*4%26;
        code[j]=c[k];
        l=name[i+1]*3%26;
        code[j+1]=c[l];
        j=j+2;
        i=i+1;
        }
    code[j]='\0';
    clrscr();
    printf("Your name is:\t\t\t");
    puts(name);
    printf("\n");
    printf("The Registration code is:\t");
    puts(code);
    getch();
}
雪    币: 228
活跃值: (10)
能力值: ( LV8,RANK:130 )
在线值:
发帖
回帖
粉丝
qianyicy 3 2007-5-19 16:50
4
0
这个CrackMe有一定的bug(PS:不知道这算不算bug,呵呵)

就是用户名只有一半+1的字符为有效字符,就比如:

我的名字:qianyicy,就只有qiany是有效字符,后三个字符可以随便打什么,

用)#$%:?:`这个注册码都能注册成功.
雪    币: 1844
活跃值: (35)
能力值: ( LV3,RANK:30 )
在线值:
发帖
回帖
粉丝
yingyue 2007-5-19 18:04
5
0
那是作者故意的,我上次那个 CM 只是使用了用户名的第 3 位和 第 5 位,这个同理
下面是其中一段

for(i=0;i<len*101;i++)       //输入了 8 个字符后,这里输出了 24
    {
        a=i;          // a 取得当前 i 的值
        sn*=2;
        sn=i-3;
        sn=ZHEN(a);                 //整个循环里就只有这个有用的
        w=sn*4;
        j=w*2+33;
        p[i]=i*3/2;               // 骗人的
    }
    cout<<endl<<endl;
    delete [] p;      //释放动态数组
    if(a<783)     //这里变相要你的用户名不能小于8位
    return 0;
    sn=sn+name[2]+name[4];  //这里把注册码和用户名勾挂
    a=SUM(code,sn,len);   // 把上面流水循环最后的结果流到这个函数继续工作
雪    币: 721
活跃值: (350)
能力值: ( LV9,RANK:1250 )
在线值:
发帖
回帖
粉丝
happytown 31 2007-5-21 09:19
6
0
LZ标题不对吧?呵呵
雪    币: 228
活跃值: (10)
能力值: ( LV8,RANK:130 )
在线值:
发帖
回帖
粉丝
qianyicy 3 2007-5-21 21:30
7
0
少了分析两个字?
游客
登录 | 注册 方可回帖
返回