现在的位置: 首页 > 综合 > 正文

破解入门–提高汇编语言阅读能力

2018年02月11日 ⁄ 综合 ⁄ 共 2854字 ⁄ 字号 评论关闭

   作为一个初学破解的菜鸟,谁不想快速提高自己破解水平。每每看大虾们发的文章,试图跟着学习,但一看到文章中大量的汇编代码我就头晕了,什么PUSH,MOV呀虽然知道这些指令的含义,但这些指令组成的代码是什么意思却一窍不通,看的模糊的很。学了半天破解也就知道几招简单方法---查找关键跳 改JMP 为 NOP呀,JGE 改为 JLE呀等等初浅的功夫。注册码也只能在内存中跟踪得到。要写注册机,嘿嘿,真是难呀---汇编的注册算法望而生畏。提高汇编能力是忍无可忍的事了。

      几经周则,我终于发现一个学习汇编的好方法,愿与广大菜鸟共享。那就是利用VC在调试过程中有一反汇编功能,既有高级语言代码,又有对应汇编代码,真为我等学习的好工具也。如下所示:

自己写的源代码/

/ crarcktest1.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"

#define PASSWORD "ABCD"

int main()
{
   int count=0;
   char buffer[100];
   for(count=0;count<3;count++)
   {
     printf("Enter password:");
     scanf("%s" ,buffer);
     if (strcmp(buffer,PASSWORD))
      printf("wrong password/n");
     else
 break;
   }
   if (count<3)printf("Password ok/n");
   return 0;
 }

经过VC反汇编后

// crarcktest1.cpp : 定义控制台应用程序的入口点。
//

#include "stdafx.h"

#define PASSWORD "ABCD"

int main()
{
00411B20  push        ebp 
00411B21  mov         ebp,esp
00411B23  sub         esp,138h
00411B29  push        ebx 
00411B2A  push        esi 
00411B2B  push        edi 
00411B2C  lea         edi,[ebp-138h]
00411B32  mov         ecx,4Eh
00411B37  mov         eax,0CCCCCCCCh
00411B3C  rep stos    dword ptr [edi]
   int count=0;
00411B3E  mov         dword ptr [count],0
   char buffer[100];
   for(count=0;count<3;count++)
00411B45  mov         dword ptr [count],0
00411B4C  jmp         main+37h (411B57h)
00411B4E  mov         eax,dword ptr [count]
00411B51  add         eax,1
00411B54  mov         dword ptr [count],eax
00411B57  cmp         dword ptr [count],3
00411B5B  jge         main+83h (411BA3h)
   {
     printf("Enter password:");
00411B5D  push        offset string "Enter password:" (42704Ch)
00411B62  call        @ILT+1285(_printf) (41150Ah)
00411B67  add         esp,4
     scanf("%s" ,buffer);
00411B6A  lea         eax,[buffer]
00411B6D  push        eax 
00411B6E  push        offset string "%s" (427048h)
00411B73  call        @ILT+990(_scanf) (4113E3h)
00411B78  add         esp,8
     if (strcmp(buffer,PASSWORD))
00411B7B  push        offset string "ABCD" (427040h)
00411B80  lea         eax,[buffer]
00411B83  push        eax 
00411B84  call        @ILT+560(_strcmp) (411235h)
00411B89  add         esp,8
00411B8C  test        eax,eax
00411B8E  je          main+7Fh (411B9Fh)
      printf("wrong password/n");
00411B90  push        offset string "wrong password/n" (42702Ch)
00411B95  call        @ILT+1285(_printf) (41150Ah)
00411B9A  add         esp,4
     else
00411B9D  jmp         main+81h (411BA1h)
 break;
00411B9F  jmp         main+83h (411BA3h)
   }
00411BA1  jmp         main+2Eh (411B4Eh)
   if (count<3)printf("Password ok/n");
00411BA3  cmp         dword ptr [count],3
00411BA7  jge         main+96h (411BB6h)
00411BA9  push        offset string "Password ok/n" (42701Ch)
00411BAE  call        @ILT+1285(_printf) (41150Ah)
00411BB3  add         esp,4
   return 0;
00411BB6  xor         eax,eax
 }

比较阅读,就能立即理解这些汇编代码的意思了。

一个不错的方法哟。我要加紧学习了。

                                                                                                                          薯条

                                                                                                                             2005-9-28

抱歉!评论已关闭.