星与酸咪咪

十年树木,百年树袋熊

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

常用链接

留言簿(22)

我参与的团队

最新随笔

搜索

  •  

积分与排名

  • 积分 - 6335
  • 排名 - 1418

最新评论

阅读排行榜

评论排行榜

看算法程序,虽然这个程序有很多解。还好最简单的解都是可打印字符


CODE:0040120B
; Attributes: bp-based frame

CODE:0040120B

CODE:0040120B sub_40120B      proc near               ; CODE XREF: sub_401159+50p

CODE:0040120B                 enter   0, 0

CODE:0040120F                 push    ebx

CODE:00401210                 push    edx

CODE:00401211                 xor     eax, eax

CODE:00401213                 mov     eax, offset String

CODE:00401218                 cmp     byte ptr [eax], 0

CODE:0040121B                 jz      short loc_40127D

CODE:0040121D                 xor     ebx, ebx

CODE:0040121F                 xor     edx, edx

CODE:00401221

CODE:00401221 loc_401221:                             ; CODE XREF: sub_40120B+21j

CODE:00401221                 mov     bl, [eax]       ; 0010+  每加一个字符

CODE:00401221                                         ; 0120+  (循环)左移

CODE:00401221                                         ; 1230+  到ebx

CODE:00401221                                         ; 2341+

CODE:00401221                                         ; 3452+  再累加到edx

CODE:00401221                                         ; ...

CODE:00401223                 rol     ebx, 8

CODE:00401226                 add     edx, ebx

CODE:00401228                 inc     eax

CODE:00401229                 cmp     byte ptr [eax], 0

CODE:0040122C                 jnz     short loc_401221 ; 0010+  每加一个字符

CODE:0040122C                                         ; 0120+  (循环)左移

CODE:0040122C                                         ; 1230+  到ebx

CODE:0040122C                                         ; 2341+

CODE:0040122C                                         ; 3452+  再累加到edx

CODE:0040122C                                         ; ...

CODE:0040122E                 push    edx

CODE:0040122F                 push    offset aLx      ; "%lX"

CODE:00401234                 push    offset byte_4020BF ; LPSTR

CODE:00401239                 call    wsprintfA

CODE:0040123E                 mov     ebx, offset byte_4020BF

CODE:00401243                 cmp     byte ptr [ebx], 38h ; 以下各值的ASCII码是

CODE:00401243                                         ; 8DCAF368

CODE:00401243                                         ; 最简单的解是4个字符

CODE:00401243                                         ; 也就是加到2341

CODE:00401243                                         ; 解为68 25 3d 29

CODE:00401243                                         ; ASCII:h%=)

CODE:00401246                 jnz     short loc_40127D

CODE:00401248                 cmp     byte ptr [ebx+1], 44h

CODE:0040124C                 jnz     short loc_40127D

CODE:0040124E                 cmp     byte ptr [ebx+2], 43h

CODE:00401252                 jnz     short loc_40127D

CODE:00401254                 cmp     byte ptr [ebx+3], 41h

CODE:00401258                 jnz     short loc_40127D

CODE:0040125A                 cmp     byte ptr [ebx+4], 46h

CODE:0040125E                 jnz     short loc_40127D

CODE:00401260                 cmp     byte ptr [ebx+5], 33h

CODE:00401264                 jnz     short loc_40127D

CODE:00401266                 cmp     byte ptr [ebx+6], 36h

CODE:0040126A                 jnz     short loc_40127D

CODE:0040126C                 cmp     byte ptr [ebx+7], 38h

CODE:00401270                 jnz     short loc_40127D

CODE:00401272                 mov     eax, 1

CODE:00401277                 pop     edx

CODE:00401278                 pop     ebx

CODE:00401279                 leave

CODE:0040127A                 retn    4

 

posted on 2008-02-15 04:00 0down274 阅读(78) 评论(0)  编辑 收藏 引用

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