星与酸咪咪

十年树木,百年树袋熊

  C++博客 :: 首页 :: 联系 :: 聚合  :: 管理
  14 Posts :: 15 Stories :: 5 Comments :: 0 Trackbacks

常用链接

留言簿(22)

我参与的团队

最新随笔

搜索

  •  

积分与排名

  • 积分 - 6334
  • 排名 - 1418

最新评论

阅读排行榜

评论排行榜

直接看算法函数!

.text:004010C9

.text:004010C9 ; =============== S U B R O U T I N E =======================================

.text:004010C9

.text:004010C9

.text:004010C9 sub_4010C9      proc near               ; CODE XREF: DialogFunc+6Fp

.text:004010C9                 push    esi

.text:004010CA                 push    edi

.text:004010CB                 push    ecx

.text:004010CC                 xor     esi, esi

.text:004010CE                 xor     edi, edi

.text:004010D0                 mov     ecx, 8

.text:004010D5                 mov     esi, offset String

.text:004010DA

.text:004010DA loc_4010DA:                             ; CODE XREF: sub_4010C9+15j

.text:004010DA                 xor     byte ptr [esi], 32h ; 前8个字符与32h异或

.text:004010DD                 inc     esi

.text:004010DE                 loop    loc_4010DA      ; 前8个字符与32h异或

.text:004010E0                 mov     esi, offset String

.text:004010E5                 mov     ecx, 4

.text:004010EA

.text:004010EA loc_4010EA:                             ; CODE XREF: sub_4010C9+32j

.text:004010EA                 mov     al, [esi]       ; 每次取俩字符,

.text:004010EA                                         ; 前个被后个异或存到edi指向的4字节串

.text:004010EC                 mov     bl, [esi+1]

.text:004010EF                 xor     al, bl

.text:004010F1                 mov     byte_40304C[edi], al

.text:004010F7                 add     esi, 2

.text:004010FA                 inc     edi

.text:004010FB                 loop    loc_4010EA      ; 每次取俩字符,

.text:004010FB                                         ; 前个被后个异或存到edi指向的4字节串

.text:004010FD                 mov     esi, offset byte_40304C ; 同上。

.text:004010FD                                         ; 4字节到2,

.text:004010FD                                         ; 2到1存入al

.text:00401102                 mov     al, [esi]

.text:00401104                 mov     bl, [esi+1]

.text:00401107                 xor     al, bl

.text:00401109                 mov     bl, [esi+2]

.text:0040110C                 mov     cl, [esi+3]

.text:0040110F                 xor     bl, cl

.text:00401111                 xor     al, bl

.text:00401113                 mov     ecx, 8

.text:00401118                 mov     esi, offset String

.text:0040111D

.text:0040111D loc_40111D:                             ; CODE XREF: sub_4010C9+57j

.text:0040111D                 xor     [esi], al       ; 前8个字符再与al异或

.text:0040111F                 inc     esi

.text:00401120                 loop    loc_40111D      ; 前8个字符再与al异或

.text:00401122                 mov     ecx, 8

.text:00401127                 mov     esi, offset String

.text:0040112C                 mov     edi, offset unk_403008

.text:00401131

.text:00401131 loc_401131:                             ; CODE XREF: sub_4010C9+70j

.text:00401131                 mov     al, [esi]       ; 比较前八字符(看来全是对八字符操作)

.text:00401131                                         ; 与edi的古怪字串

.text:00401131                                         ; db  71h ; q

.text:00401131                                         ; db  18h

.text:00401131                                         ; db  59h ; Y

.text:00401131                                         ; db  1Bh

.text:00401131                                         ; db  79h ; y

.text:00401131                                         ; db  42h ; B

.text:00401131                                         ; db  45h ; E

.text:00401131                                         ; db  4Ch ; L

.text:00401131                                         ;

.text:00401133                 cmp     al, [edi]

.text:00401135                 jnz     short loc_401154

.text:00401137                 inc     esi

.text:00401138                 inc     edi

.text:00401139                 loop    loc_401131      ; 比较前八字符(看来全是对八字符操作)

.text:00401139                                         ; 与edi的古怪字串

.text:00401139                                         ; db  71h ; q

.text:00401139                                         ; db  18h

.text:00401139                                         ; db  59h ; Y

.text:00401139                                         ; db  1Bh

.text:00401139                                         ; db  79h ; y

.text:00401139                                         ; db  42h ; B

.text:00401139                                         ; db  45h ; E

.text:00401139                                         ; db  4Ch ; L

.text:00401139                                         ;

.text:0040113B                 push    40h             ; uType

.text:0040113D                 push    offset Caption  ; "Crackme 1.0"

.text:00401142                 push    offset Text     ; "Good Work Cracker"

.text:00401147                 push    hDlg            ; hWnd

.text:0040114D                 call    MessageBoxA

.text:00401152                 jmp     short loc_40116B

.text:00401154 ; ---------------------------------------------------------------------------

.text:00401154

.text:00401154 loc_401154:                             ; CODE XREF: sub_4010C9+6Cj

.text:00401154                 push    30h             ; uType

.text:00401156                 push    offset Caption  ; "Crackme 1.0"

.text:0040115B                 push    offset aBadSerialSorry ; "Bad Serial, Sorry!"

.text:00401160                 push    hDlg            ; hWnd

.text:00401166                 call    MessageBoxA

.text:0040116B

.text:0040116B loc_40116B:                             ; CODE XREF: sub_4010C9+89j

.text:0040116B                 pop     edi

.text:0040116C                 pop     esi

.text:0040116D                 pop     ecx

.text:0040116E                 retn

.text:0040116E sub_4010C9      endp

.text:0040116E

.text:0040116E ; ---------------------------------------------------------------------------

 简单解说
      1.对输入的8字节与分别32h异或
      2.用1中异或得到的8字节 进行两两异或变4字节,再两两异或,再两两异或,变1字节,这是key
      3.用1中异或得到的8字节 与key异或 得到静态序列号(edi指向)


解算
1可以忽略不计
2是有损算法
3拿key异或的值已知
有什么算法,快点想!给你两分钟。
哦,穷举吧。哎,想和没想一样。可是你要注意啦,你可别拿输入的8字节穷举哦
看程序

#include <stdio.h>
unsigned char value[8]={0x71,0x18,0x59,0x1b,0x79,0x42,0x45,0x4c};
int main()
{
 unsigned char tmp[8];
 unsigned char key=0;
 int i;
 do{
  for(i=0;i<8;++i)
   tmp[i]=value[i]^key;
  if(key==(((tmp[0]^tmp[1])^(tmp[2]^tmp[3]))
   ^((tmp[4]^tmp[5])^(tmp[6]^tmp[7]))))
  {
   for(i=0;i<8;++i)
    tmp[i]^=0x32;
   tmp[8]=0;//越界清0,我故意的
   printf("Find Key:%02x\nThe Serial is:%s\n",key,tmp);
   return 1;
  }
  ++key;
 }while(key!=0);
 printf("Can't find key.");
 return 0;
}

好玩吧。算出来的答案是...你自己编译运行吧
还是那句话  请尊重别人的劳动成果。转载请注明出处
posted on 2008-02-15 03:57 0down274 阅读(109) 评论(0)  编辑 收藏 引用

只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理