home *** CD-ROM | disk | FTP | other *** search
/ KeyGen Studio 2002 / KeyGen_Studio_2002.iso / Tutorials / Dos CrackMes / com / SCCRKME2.ZIP / CRKME2.ASM next >
Encoding:
Assembly Source File  |  1998-09-10  |  990 b   |  62 lines

  1.  
  2. ; crackme2 - small
  3. ;
  4. ; by scut / blizzard
  5.  
  6. .model tiny
  7. .486
  8.  
  9. codeseg
  10. org 100h
  11.  
  12. start:    mov    si,(offset msg-1)
  13.     std
  14.     mov    cl,(offset msg-82h)
  15. sl0:    lodsb
  16.     adc    bl,al
  17.     rol    ebx,5
  18.     dec    cl
  19.     jnz    sl0
  20.  
  21.         comment ⌡
  22.         high speed g-lfsr implementation for intel cpus
  23.         will assemble to 22 bytes.
  24.  
  25.         b920000000.0facd801.d1eb.7306.81f3570000c0.49.75ef
  26.         (c) scut 1998
  27.         ⌡
  28.  
  29.     ; modified for use with crackme2 :)
  30.     ; galois linear feedback shift register
  31.  
  32.     cld
  33.     mov    si,offset msg
  34.     mov    di,si
  35.     mov    ch,7
  36. glls:    mov    cl,8            ; 32 bits to fill
  37. gll0:    shrd    edx,ebx,1        ; edx    = >>output, ebx = |lfsr|
  38.     shr    ebx,1            ; cf    = lfsr[0]
  39.  
  40. ;    jnc    gll2            ;    == 1 ?
  41.     db    73h, 07h
  42.  
  43.     xor    ebx,11000000000000000000000001010111b    ; ^ tap sequence
  44. gll2:    dec    cl            ; 8bits ?
  45.     jnz    gll0            ; no -> --^
  46.     shr    edx,32-8
  47.     lodsb
  48.     xor    al,dl
  49.     stosb
  50.     dec    ch
  51.     jnz    glls
  52.  
  53.     mov    ah,09h
  54.     mov    dx,offset msg
  55.     int    21h
  56.     ret
  57.  
  58. msg    db 06Dh,28h,05h,0F3h,0C5h,0Ch,3Dh,'$'
  59.  
  60. ;msg    db    'valid',13,10,'$'
  61. end     start
  62.