home *** CD-ROM | disk | FTP | other *** search
/ KeyGen Studio 2002 / KeyGen_Studio_2002.iso / Tutorials / CrackMesCbjNet / nh-kgme.ZIP / nh-kgme.txt < prev   
Encoding:
Text File  |  2001-03-04  |  6.7 KB  |  256 lines

  1. CoDe_InSiDe's KeygenMe Crackme Keygenning tutorial by nh
  2.  
  3. E-mail: nh666@mail.ru
  4. Used tools: SoftIce v4.01, Tasm v5.00
  5.  
  6. Run the crackme, fill the text-fields & set breakpoint to GetDlgItemTextA,
  7. then clock "Check 1" button, press F12, until u see such code:
  8.  
  9.  push      ebp
  10.  mov       ebp,esp
  11.  push      010
  12.  push      000401E30 ;" @0"
  13.  push      000000122 ;"  ""
  14.  push      d,[ebp][00008]
  15.  call      GetDlgItemTextA ;USER32.DLL    ; get name from editbox
  16.  mov       [000401E20],eax
  17.  cmp       al,003 ;""            ; length of name must be greater then 4
  18.  ja       .0004010D4   -------- (1)
  19.  pop       ebp
  20.  push      010
  21.  push      000401C00 ;" @ "
  22.  push      000401B9E ;" @▐"
  23.  push      000
  24.  jmp      .000401CF0   -------- (2)
  25.  pop       ebp
  26.  push      ebp
  27.  mov       ebp,esp
  28.  push      010
  29.  push      000401E70 ;" @p"
  30.  push      000000222 ;"  ""
  31.  push      d,[ebp][00008]
  32.  call      GetDlgItemTextA ;USER32.DLL    ; get serial from editbox
  33.  mov       [000401E60],eax
  34.  cmp       al,000 ;" "
  35.  jne      .00040110A   -------- (1)
  36.  pop       ebp
  37.  push      010
  38.  push      000401C00 ;" @ "
  39.  push      000401C38 ;" @8"
  40.  push      000
  41.  jmp      .000401CF0   -------- (2)
  42.  pop       ebp
  43.  xor       eax,eax
  44.  xor       edx,edx
  45.  mov       ecx,000401E20 ;" @ "    ; get length of name
  46.  mov       ecx,[ecx]
  47.  mov       edi,000401E30 ;" @0"
  48.  mov       al,[edi]
  49.  cmp       al,000 ;" "
  50.  je       .00040112B   -------- (3)
  51.  imul      eax,ecx            ; each char of name multiplied by length
  52.  add       edx,eax            ; and add to edx
  53.  inc       edi
  54.  xor       eax,eax
  55.  jmps     .00040111B   -------- (1)
  56.  push      edx
  57.  xor       eax,eax
  58.  xor       edx,edx
  59.  mov       edi,000401E30 ;" @0"
  60.  mov       al,[edi]
  61.  cmp       al,000 ;" "
  62.  je       .000401144   -------- (2)
  63.  xor       eax,ecx            
  64.  add       edx,eax            ; summ all chars xored with length
  65.  inc       edi
  66.  xor       eax,eax
  67.  jmps     .000401135   -------- (3)
  68.  pop       esi
  69.  add       esi,edx
  70.  push      esi
  71.  xor       eax,eax
  72.  xor       edx,edx
  73.  xor       esi,esi
  74.  xor       ebx,ebx
  75.  mov       edi,000401E30 ;" @0"
  76.  mov       esi,000401E30 ;" @0"
  77.  mov       al,[edi]
  78.  cmp       al,000 ;" "
  79.  je       .00040117B   -------- (1)
  80.  mov       cl,[esi]
  81.  cmp       ecx,000 ;" "
  82.  je       .000401171   -------- (2)
  83.  imul      eax,ecx            ; summ of chars multiplied by summ of chars
  84.  add       edx,eax
  85.  inc       esi
  86.  xor       eax,eax
  87.  jmps     .00040115A   -------- (3)
  88.  inc       edi
  89.  xor       eax,eax
  90.  mov       esi,000401E30 ;" @0"
  91.  jmps     .00040115A   -------- (4)
  92.  pop       esi
  93.  add       esi,edx            ; and summ all numbers to esi
  94.  push      esi
  95.  xor       eax,eax
  96.  xor       ecx,ecx
  97.  xor       edx,edx
  98.  xor       esi,esi
  99.  xor       edi,edi
  100.  pop       eax
  101.  mov       edi,000401C60 ;" @`"    ; simple routine for converting number
  102.  test      eax,eax            ; to string
  103.  je       .0004011B7   -------- (1)
  104.  rol       eax,004 ;""
  105.  mov       dl,al
  106.  ror       edx,004 ;""
  107.  cmp       dl,009 ;"    "
  108.  ja       .0004011AD   -------- (2)
  109.  add       dl,030 ;"0"
  110.  mov       [edi],dl
  111.  inc       edi
  112.  mov       al,000 ;" "
  113.  ror       eax,008 ;""
  114.  jmps     .00040118F   -------- (3)
  115.  sub       dl,004 ;""
  116.  cmp       dl,009 ;"    "
  117.  ja       .0004011AD   -------- (4)
  118.  jmps     .0004011A0   -------- (5)
  119.  mov       [edi],cl
  120.  mov       edi,000401C60 ;" @`"
  121.  mov       al,[edi]
  122.  cmp       al,000 ;" "
  123.  je       .0004011C8   -------- (6)
  124.  inc       ecx
  125.  inc       edi
  126.  jmps     .0004011BE   -------- (1)
  127.  mov       edi,000401E60 ;" @`"
  128.  cmp       [edi],cl
  129.  je       .0004011E4   -------- (2)
  130.  push      010
  131.  push      000401C49 ;" @I"
  132.  push      000401BED ;" @²"
  133.  push      000
  134.  jmp      .000401CF0   -------- (3)
  135.  mov       edi,000401E70 ;" @p"
  136.  mov       esi,000401C60 ;" @`"    ; compare our & gen.serial
  137.  mov       al,[edi]
  138.  cmp       al,000 ;" "
  139.  je       .000401200   -------- (4)
  140.  mov       cl,[esi]
  141.  cmp       eax,ecx
  142.  jne      .0004011FE   -------- (5)
  143.  inc       esi
  144.  inc       edi
  145.  jmps     .0004011EE   -------- (6)
  146.  jmps     .0004011D1   -------- (7)
  147.  push      020
  148.  push      000401BD0 ;" @-"
  149.  push      000401BD6 ;" @+"
  150.  push      000
  151.  call      MessageBoxA ;USER32.DLL
  152.  mov       b,[000401FFF],001 ;""
  153.  retn
  154.  
  155.  
  156.  push      ebp
  157.  mov       ebp,esp
  158.  push      015
  159.  push      000401F00 ;" @ "
  160.  push      000000322 ;"  ""
  161.  push      d,[ebp][00008]
  162.  call      GetDlgItemTextA ;USER32.DLL
  163.  pop       ebp
  164.  cmp       al,000 ;" "
  165.  jne      .00040124E   -------- (1)
  166.  push      010
  167.  push      000401C00 ;" @ "
  168.  push      000401BBE ;" @+"
  169.  push      000
  170.  call      MessageBoxA ;USER32.DLL
  171.  retn
  172.  xor       eax,eax
  173.  xor       ecx,ecx
  174.  xor       edx,edx
  175.  mov       cl,004 ;""
  176.  mov       dl,02D ;"-"
  177.  mov       edi,000401CA0 ;" @α"
  178.  mov       esi,000401E30 ;" @0"    ; get 4 chars from name
  179.  mov       al,[esi]
  180.  mov       [edi],al
  181.  inc       esi
  182.  inc       edi
  183.  dec       ecx
  184.  jne      .000401262   -------- (1)
  185.  mov       [edi],dl            ; then '-'
  186.  inc       edi
  187.  mov       esi,000401C60 ;" @`"    ; get serial
  188.  mov       al,[esi]
  189.  cmp       al,000 ;" "
  190.  je       .00040127F   -------- (2)
  191.  mov       [edi],al
  192.  inc       edi
  193.  inc       esi
  194.  jmps     .000401273   -------- (3)
  195.  mov       [edi],dl            ; then '-'
  196.  inc       edi
  197.  push      edi
  198.  mov       edi,000401C60 ;" @`"
  199.  xor       esi,esi
  200.  mov       al,[edi]
  201.  cmp       al,000 ;" "
  202.  je       .00040129A   -------- (1)
  203.  imul      eax,edx            ; each char of serial multiplied by
  204.  add       esi,eax            ; 2dh
  205.  xor       eax,eax
  206.  inc       edi
  207.  jmps     .00040128A   -------- (2)
  208.  pop       edi
  209.  mov       eax,esi
  210.  xor       esi,esi
  211.  xor       ecx,ecx            ; and simple routine for converting
  212.  test      eax,eax            ; number to string
  213.  je       .0004012CA   -------- (3)
  214.  rol       eax,004 ;""
  215.  mov       cl,al
  216.  ror       ecx,004 ;""
  217.  cmp       cl,009 ;"    "
  218.  ja       .0004012C0   -------- (1)
  219.  add       cl,030 ;"0"
  220.  push      ecx
  221.  inc       esi
  222.  mov       al,000 ;" "
  223.  xor       ecx,ecx
  224.  ror       eax,008 ;""
  225.  jmps     .0004012A1   -------- (2)
  226.  sub       cl,004 ;""
  227.  cmp       cl,009 ;"    "
  228.  ja       .0004012C0   -------- (3)
  229.  jmps     .0004012B2   -------- (4)
  230.  pop       d,[edi]
  231.  inc       edi
  232.  dec       esi
  233.  jne      .0004012CA   -------- (5)
  234.  mov       [edi],dl            ; then add '-X'
  235.  inc       edi
  236.  mov       dl,058 ;"X"
  237.  mov       [edi],edx
  238.  xor       eax,eax
  239.  xor       ecx,ecx
  240.  xor       edx,edx
  241.  xor       esi,esi
  242.  xor       edi,edi
  243.  mov       edi,000401F00 ;" @ "    ; and compare two strings
  244.  mov       esi,000401CA0 ;" @α"
  245.  mov       al,[edi]
  246.  cmp       al,000 ;" "
  247.  je       .000401310   -------- (1)
  248.  mov       cl,[esi]
  249.  cmp       eax,ecx
  250. [...skipped...]
  251.  
  252. so, algo is easy.
  253. keygen source is in nh-kgme.asm
  254.  
  255. That's all...
  256.