home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Quantico / km / ucf_actx.asm.txt < prev    next >
Encoding:
Text File  |  2000-05-25  |  9.0 KB  |  310 lines

  1. .model  tiny
  2.  
  3. .386
  4.  
  5.         org 100h
  6.  
  7. .data
  8.  
  9. GroupLogo       db 13,10
  10.                 db '            ▄▄▄▄▄ ',13,10
  11.                 db '            █ ▄ █  ',13,10
  12.                 db '    █▀▀▀▀▀▀▀▀ ▄ ▀▀▀▀▀ ▀ ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀█  █▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀ ▀ ▀▀▀▀█ ',13,10
  13.                 db '    █ │░███████  │▓███████▀ │░███▀█▀▀▀▀▀▀▀ ▀ ▀▀▀▀ │░███▀█▀▀▀▀▀▓████▓▄  █ ',13,10
  14.                 db '    █ │▒███████  │▓███████  │▒███████  │▓███████▀ │▒███████  │▓███████ █ ',13,10
  15.                 db '    █ │▓███████  │▓███████  │▓███████  │▓███████  │▓███████  │▓███████ █ ',13,10
  16.                 db '    ▀ │▓███████  │▓███████  │▓███████  │▓███████  │▓███████  │▓███████ █▄▄▄ ',13,10
  17.                 db '    ▀ │▓███████  │▓███████  │▓███████  │▓███████  │▓███████  │▓███████▄ ▄ █ ',13,10
  18.                 db '    █ │▓███████  │▓███████  │▓███████  │▓███████  │▓███████               █ ',13,10
  19.                 db '    █ │▓███████▄▄▄▄▄█▄█▓▀   │▓███████▄▄▄▄▄█▄████  │▓███████▀▀ ▀    ▀      █ ',13,10
  20.                 db '    █▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▀ █▀▀▀▀▀▀▀▀▀ ▀ ▀▀ ',13,10
  21.                 db '    .::[ u n i t e d · c r æ c k i n g · f o r c e ]::. █ ▀ █ Antibody<SAC> ',13,10
  22.                 db '    █▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▄ ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ ▀ █▀▀▀▀▀▀▀▀▀ ▀ ▀▀ ',13,10
  23.                 db '                                -----=====-----                             ',13,10
  24.                 db '        [■]   ActiveX Manager v1.3 - Key Generator by Quantico   [■]        ',13,10
  25.                 db '                                -----=====-----                             ',13,10
  26.                 db '                                 ',13,10,'$'
  27.  
  28.  
  29.  
  30. IntroMsgOne     db 13,10,'Enter a name please    : ','$'
  31.            
  32.  
  33. ErrorMsg        db 13,10,'Need 8-20 digits, try again...',13,10,'$'
  34.  
  35. ShowCodeMsg     db 13,10,'Registration number    : 6577-'
  36.  
  37. oneletter       db 0
  38.  
  39. CodeBuffer      db 20 dup(0),13,10,'$'
  40.  
  41. NameBuffer      db 18h, 19h dup(0)
  42.  
  43. Convert_Digs     db '0123456789ABCDEF'
  44.  
  45. namelength      db 0
  46.  
  47. temp            db 0
  48.  
  49. temp2           db 0
  50.  
  51. datatable1     db '87ae2401my69'
  52.  
  53. .code
  54.  
  55. .startup
  56.  
  57. main    proc    near
  58.         mov     ah, 09h                       ;
  59.         lea     edx, GroupLogo                ;
  60.         int     21h                           ; show group logo
  61.  
  62.         mov     ah, 09h                       ;
  63.         lea     edx, IntroMsgOne              ;
  64.         int     21h                           ; show intro and ask for input 
  65.  
  66.         mov     bx, 1408h                     ; limits for string input
  67.         lea     edi, NameBuffer               ;
  68.         call    getstr                        ; read user input
  69.         jc      @error                        ;
  70.         xor     eax, eax                      ; clear eax
  71.         call    keygen                        ; create serial number
  72.  
  73.         mov     ah, 09h                       ;
  74.         lea     dx, ShowCodeMsg               ;
  75.         int     21h                           ; print serial number
  76.         jmp     @exit                         ; finished, quit
  77. @error:
  78.         mov     ah, 09h
  79.         lea     dx, ErrorMsg
  80.         int     21h        
  81. @exit:
  82.         mov     al, 00h                       ;
  83.         mov     ah, 4Ch                       ;
  84.         int     21h                           ; terminate program
  85. main    endp
  86.  
  87.  
  88. keygen  proc    near
  89.  
  90.         xor     edx, edx
  91.         movzx   eax, byte ptr [namelength]
  92.         mov     ecx, 05
  93.         div     ecx
  94.         mov     eax, offset datatable1
  95.         mov     al, byte ptr [eax+edx]
  96.         mov     byte ptr [oneletter], al
  97.         xor     eax, eax
  98.         xor     edx, edx
  99.  
  100. to_start:
  101.         mov     ecx, 03
  102.         movzx   eax, byte ptr [temp]
  103.         xor     edx, edx
  104.         div     ecx
  105.         test    edx, edx
  106.         jne     @00401742
  107.         movzx   eax, byte ptr [temp]
  108.         mov     al, byte ptr [NameBuffer+eax+2]
  109.  
  110.         cbw
  111.         mov     cl, 02
  112.         idiv    cl
  113.         add     al, 20h
  114.         cmp     al, 5Ah
  115.         jle     @00401714
  116.         cmp     al, 61h
  117.         jge     @00401714
  118.         add     al, 06
  119. @00401714:
  120.         cmp     al, 39h
  121.         jle     @0040171E
  122.         cmp     al, 41h
  123.         jge     @0040171E
  124.         add     al, 08
  125. @0040171E:
  126.         movzx   edx, byte ptr [temp2]
  127.         inc     byte ptr [temp2]
  128.         mov     esi, offset CodeBuffer
  129.         add     esi, edx
  130.         mov     byte ptr [esi], al
  131.                 
  132.  
  133.         
  134. @00401742:
  135.         mov     ecx, 0Dh
  136.         movzx   eax, byte ptr [temp]
  137.         xor     edx, edx
  138.         div     ecx
  139.         test    edx, edx
  140.         jne     @0040177A
  141.  
  142.         mov     esi, offset CodeBuffer
  143.         mov     al, 00h
  144.         call    strlngth
  145.         dec     ecx
  146.         mov     byte ptr [CodeBuffer+ecx], 'x'
  147.         inc     byte ptr [temp2]
  148.  
  149. @0040177A:
  150.         inc     byte ptr [temp]
  151.         push    eax
  152.         movzx   eax, byte ptr [namelength]
  153.         cmp     al,  byte ptr [temp]
  154.         pop     eax
  155.         ja      to_start
  156.  
  157.         mov     esi, offset CodeBuffer
  158.         mov     al, 00h
  159.         call    strlngth
  160.         dec     ecx
  161.         mov     byte ptr [CodeBuffer+ecx], 'z'
  162.  
  163.  
  164. ;        xor    edx, edx
  165. ;    mov    ecx, 0000000Ah        
  166. ;    lea    edi, CodeBuffer
  167. ;    call    convert_num
  168.     ret
  169. keygen    endp
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176. ; get string from user
  177. ; input :
  178. ;       edi = pointer to buffer
  179. ;       bl  = min length
  180. ;       bh  = max length
  181. ; output :
  182. ;    CF error, cx number of bytes read
  183. getstr  proc    near
  184.         push    dx                            ; save dx
  185.         mov     dx, di                        ;
  186.         mov     ah, 0Ah                       ;
  187.         int     021h                          ; get user input
  188.  
  189.         movsx   ecx, byte ptr [edi + 1]       ; get number of digits
  190.  
  191.         mov     byte ptr [edi + ecx + 2], 00h
  192.  
  193.         cmp     cl, bh                        ; check maximum
  194.         jg      @@0
  195.         cmp     cl, bl                        ; check minimum
  196.         jl      @@0
  197.         mov     [namelength], cl              ; store length
  198.     xor    ch, ch
  199.         clc                                   ; clear CF
  200.         jmp     @@1
  201. @@0:
  202.         stc                                   ; set CF (carry flag)        
  203. @@1:
  204.         pop     dx                            ; restore dx
  205.     ret
  206. getstr  endp
  207.  
  208. Convert_Num proc near
  209.         pushf
  210.     pushAD
  211.  
  212.         sub     esp, 4
  213.         mov     ebp,esp
  214.  
  215.         cld
  216.         mov     esi, edi
  217.         push    esi
  218.  
  219. ;--- loop for each digit
  220.  
  221.         sub     bh, bh
  222.         mov     dword ptr [ebp], eax               ;save low word
  223.         mov     dword ptr [ebp+4], edx             ;save high word
  224.         sub     esi, esi                          ;count digits
  225.  
  226. Connum1:
  227.         inc     esi
  228.         mov     eax, dword ptr [ebp+4]             ;high word of value
  229.         sub     edx, edx                          ;clear for divide
  230.         sub    ebx, ebx
  231.         div     ecx                              ;divide, DX gets remainder
  232.         mov     dword ptr [ebp+4],eax             ;save quotient (new high word)
  233.  
  234.         mov     eax, dword ptr [ebp]               ;low word of value
  235.         div     ecx                              ;divide, DX gets remainder
  236.                                                 ;  (the digit)
  237.         mov     dword ptr [ebp], eax               ;save quotient (new low word)
  238.  
  239.         mov     bl, dl
  240.         mov     al, byte ptr [Convert_Digs+ebx]  ;get the digit
  241.         stosb                                   ;store
  242.  
  243.         cmp     dword ptr [ebp], 0                ;check if low word zero
  244.         jne     Connum1                         ;jump if not
  245.         cmp     dword ptr [ebp+4], 0              ;check if high word zero
  246.         jne     Connum1                         ;jump if not
  247.  
  248.         sub     al, al
  249.         stosb                                   ;store the terminator
  250.  
  251. ;--- reverse digits
  252.  
  253.         pop     ecx                              ;restore start of string
  254.         xchg    ecx, esi
  255.         shr     ecx, 1                           ;number of reverses
  256.         jz      Connum3                         ;jump if none
  257.  
  258.         xchg    edi, esi
  259.         sub     esi, 2                           ;point to last digit
  260.  
  261. Connum2 :
  262.         mov     al, byte ptr [edi]               ;load front character
  263.         xchg    al, byte ptr [esi]               ;swap with end character
  264.         stosb                                   ;store new front character
  265.         dec     esi                              ;back up
  266.         loopd   Connum2                         ;loop back for each digit
  267.  
  268. ;--- finished
  269.  
  270. Connum3  :
  271.         add     esp, 4
  272.  
  273.     popad
  274.         popf
  275.         ret
  276.  endp           ;Convert_Num
  277.  
  278. ; returns ECX= length of String in DS:ESI - terminated by CHAR in AL
  279. ; registers changed: ECX
  280. ; Assumes ES=DS
  281.  
  282. strlngth  PROC
  283.     pushf
  284.     push edi
  285.     push esi
  286.     push edx
  287.  
  288.     mov edi,esi
  289.     xor ecx,ecx
  290.     dec ecx
  291.     cld
  292.     repnz scasb
  293.     xor edx,edx
  294.     sub edx,ecx
  295.     dec edx
  296.     mov ecx,edx
  297.  
  298.     pop edx
  299.     pop esi
  300.     pop edi
  301.  
  302.     popf
  303.     Ret
  304.  
  305. strlngth endp
  306.  
  307.  
  308.  
  309.  
  310. end    main