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

  1. .386 ;v3.2
  2.  
  3. _STACK SEGMENT STACK
  4. dw 100h dup (?)
  5. _STACK ENDS
  6.  
  7. _DATA SEGMENT
  8. DATACOUNT db 0
  9. NUMDISPLAY db 50 dup (0)
  10. ALSO_MSG db 'Run ZTW_REG and type in the number given',0
  11. LINE1 equ 0B878h
  12. REGMEMNAMECNTR dw 0
  13. ACTUAL_LETTERS dw 0
  14. RED db 0
  15. GREEN db 0
  16. BLUE db 0
  17. COLOR db 63
  18. ISTHEREANERROR db 0
  19. INIT equ 1Fh
  20. INIT_COLOR equ 01F7Eh
  21. NAME_COLOR equ 1Fh
  22. NUM_COLOR equ 1Fh
  23. PRINT_NUM_CNT dw 22 ;and video address
  24. ERROR_MSG_COLOR equ 0Ch
  25. ERROR db 'Sorry bud, please read the instructions',0
  26. LOGO db 1 dup (0dh,0ah)
  27. UCF       DB '─────────────────────────────────────────',10,13
  28.           DB '  ▄▄▄   ▄▄▄    ▄▄▄▄▄▄▄▄▄    ▄▄▄▄▄▄▄▄▄   ',10,13
  29.           DB '  ███   ███    ███          ███▄▄▄      ',10,13
  30.           DB '  ███▄  ███    ███▄         ███         ',10,13
  31.           DB '  ▀▀▀▀▀▀▀▀▀    ▀▀▀▀▀▀▀▀▀    ▀▀▀         ',10,13
  32.           DB '─────────────────────────────────────────',10,13
  33.           DB ' u N I T E D  c R Æ C K I N G  f O R C E ',10,13
  34.           DB '─────────────────────────────────────────',10,13
  35.           DB ' ZTWin 1.20 and 1.21 Beta Keymaker - 3 char min -',10,13
  36.           DB ' By IllumiTIE[UCF] - Thanks to xOANON[UCF]',10,13,10,13
  37.           db '      Name:$'
  38. SERIAL db 0dh,0ah,'    Serial:$'
  39. NAMENOVMEM db 29 dup (0)
  40. _DATA ENDS
  41.  
  42. _TEXT SEGMENT use16
  43.   Assume CS:_TEXT, DS:_DATA, ES:_DATA, SS:_STACK
  44. INTRO:
  45.   call FADEOUT
  46.   mov ax,0003h
  47.   int 10h
  48.   mov ax,_DATA
  49.   mov ds,ax
  50.   mov ax,1015h
  51.   mov bx,0007h
  52.   int 10h
  53.   mov GREEN,ch
  54.   mov BLUE,cl
  55.   mov RED,dh
  56.   lea dx,LOGO
  57.   mov ah,9
  58.   int 21h
  59.   call CLASS
  60.   cld
  61.   sub di,58 ;numbe of char *2
  62.   jmp DISPLAY_TEXT
  63.  
  64. ERROR_1:
  65.   call ERROR_MSG
  66. DISPLAY_TEXT:
  67.   call ASK
  68.   cmp ISTHEREANERROR,1
  69.   jz ERROR_1
  70.   call ENKRYPT
  71. QUIT:
  72.   call WRI_HEX_DIG
  73.   call RESET_PAL
  74.   call ALSO
  75.   mov ax,4c00h
  76.   int 21h
  77.  
  78. WRI_HEX_DIG Proc
  79.   push di
  80.   push ax
  81.   push dx
  82.   cld
  83.   mov di,LINE1+10
  84.   mov es,di
  85.   mov di,PRINT_NUM_CNT
  86.   lea si,NUMDISPLAY
  87. L00PWRITE:
  88.   lodsb
  89.   mov ah,NUM_COLOR
  90.   stosw
  91.   or al,al
  92.   jnz L00PWRITE
  93.   pop dx
  94.   pop ax
  95.   pop di
  96.   ret
  97. WRI_HEX_DIG EndP
  98. CLASS Proc
  99.   mov bx,LINE1
  100.   mov es,bx
  101.   mov di,22
  102.   mov ax,INIT_COLOR
  103.   mov cx,29
  104.   rep stosw
  105.   mov ax,1000h
  106.   xor bx,bx
  107.   mov dx,1000h
  108.   int 10h
  109.   ret
  110. CLASS EndP
  111. DEL_ERR_MSG Proc
  112.   push cx
  113.   push ax
  114.   push si
  115.   push di
  116.   push es
  117.   mov di,LINE1-10
  118.   mov es,di
  119.   mov di,0
  120.   xor ax,ax
  121.   mov cx,40
  122.   rep stosw
  123.   pop es
  124.   pop di
  125.   pop si
  126.   pop ax
  127.   pop cx
  128.   ret
  129. DEL_ERR_MSG EndP
  130. ERROR_MSG Proc
  131.   push ax
  132.   push esi
  133.   push es
  134.   push di
  135.   dec ISTHEREANERROR
  136.   mov di,LINE1-10
  137.   mov es,di
  138.   mov di,0
  139.   mov esi,offset ERROR
  140.   cld
  141. ERROR_1_1:
  142.   lodsb
  143.   mov ah,ERROR_MSG_COLOR
  144.   stosw
  145.   cmp al,0
  146.   jne ERROR_1_1
  147.   pop di
  148.   pop es
  149.   pop esi
  150.   pop ax
  151.   ret
  152. ERROR_MSG EndP
  153. ASK Proc
  154. STOP_1:
  155.   call FLASHNOW
  156.   xor ax,ax
  157.   mov ah,01
  158.   ;xor ah,ah
  159.   int 16h
  160.   jz STOP_1
  161.   xor ah,ah
  162.   int 16h
  163.   call DEL_ERR_MSG
  164.   cmp al,0dh
  165.   jz DONE
  166.   cmp al,08h
  167.   jz NO_SAVE
  168.   cmp ACTUAL_LETTERS,3
  169.   jz ERROR_DONE
  170. IS_IT_NUM:
  171.   cmp al,39h
  172.   jle SAVE
  173. ;  and al,05fh
  174.   jmp short SAVE
  175. NO_SAVE:
  176.   cmp ACTUAL_LETTERS,0
  177.   jz ERROR_DONE
  178.   std
  179.   push ax
  180.   dec di
  181.   dec di
  182.   mov ax,INIT_COLOR
  183.   stosw
  184.   inc di
  185.   inc di
  186.   pop ax
  187.   cld
  188.   dec ACTUAL_LETTERS
  189.   dec ACTUAL_LETTERS
  190.   dec REGMEMNAMECNTR
  191.   jmp short BLAH
  192. SAVE:
  193.   mov ah,NAME_COLOR
  194.   stosw
  195.   call SAVEINREGMEM
  196. BLAH:
  197.   inc ACTUAL_LETTERS
  198.   jmp STOP_1
  199. ERROR_DONE:
  200.   mov ISTHEREANERROR,1
  201.   ret
  202. DONE:
  203.   cmp ACTUAL_LETTERS,3
  204.   jl ERROR_DONE
  205.   ret
  206. ASK EndP
  207. FLASHNOW Proc
  208.   push ax
  209.   push bx
  210.   push cx
  211.   push dx
  212.   mov ax,1010h
  213.   xor bh,bh
  214.   mov bl,7
  215.   mov cl,COLOR
  216.   mov dh,COLOR
  217.   mov ch,COLOR
  218.  REDO:
  219.   mov ax,1010h
  220.   mov cl,COLOR
  221.   mov ch,COLOR
  222.   mov dh,COLOR
  223.   int 10h
  224.   dec COLOR
  225.   or cl,cl
  226.   jnz QUIT_COLOR
  227.   mov COLOR,63
  228.  QUIT_COLOR:
  229.   pop dx
  230.   pop cx
  231.   pop bx
  232.   pop ax
  233.   ret
  234. FLASHNOW EndP
  235. RESET_PAL Proc
  236.   mov ax,1010h
  237.   xor bh,bh
  238.   mov bl,7
  239.   mov ch,GREEN
  240.   mov cl,BLUE
  241.   mov dh,RED
  242.   int 10h
  243.   ret
  244. RESET_PAL EndP
  245. SAVEINREGMEM Proc
  246.   push es
  247.   push ax
  248.   push di
  249.   push ds
  250.   pop es
  251.   mov edi,offset NAMENOVMEM
  252.   add di,REGMEMNAMECNTR
  253.   stosb
  254.   inc REGMEMNAMECNTR
  255.   pop di
  256.   pop ax
  257.   pop es
  258.   ret
  259. SAVEINREGMEM EndP
  260. ENKRYPT Proc
  261.   push ax
  262.   mov ah,09
  263.   push dx
  264.   lea dx,SERIAL
  265.   int 21h
  266.   pop dx
  267.   pop ax
  268.   push si
  269.   push di
  270.   lea si,NAMENOVMEM
  271.   lea di,NUMDISPLAY
  272.   mov ax,ACTUAL_LETTERS
  273.   mov ah,al
  274.   add al,ah
  275.   dec al
  276.   mov DATACOUNT,al
  277.   xor ah,ah
  278.   cld
  279.   lodsb
  280.   mov bp,ax
  281.   shl ax,4 ;It's a #
  282.   shr al,4
  283.   cmp al,0Ah
  284.   jb SAFE
  285.   call ITS_A_LETTER
  286.   jmp ALMSAFE
  287. SAFE:  
  288.   add al,30h
  289. ALMSAFE:
  290.   xchg ah,al
  291.   cmp al,0Ah
  292.   jb SAFEENOUGH
  293.   call ITS_A_LETTER
  294.   jmp ALMSAFEENOUGH
  295. SAFEENOUGH:
  296.   add al,30h
  297. ALMSAFEENOUGH:
  298.   lea di,NUMDISPLAY
  299.   add di,word ptr[DATACOUNT]
  300.   mov [di],al
  301.   dec DATACOUNT
  302.   xchg ah,al
  303.   lea di,NUMDISPLAY
  304.   add di,word ptr[DATACOUNT]
  305.   mov [di],al
  306.   dec DATACOUNT
  307.   mov cx,ACTUAL_LETTERS
  308.  NEXT_SECT:
  309.   mov bx,001bh
  310.   sub bx,bp
  311.   xor bh,bh
  312.  @L00P:
  313.   cld
  314.   xor ah,ah
  315.   lodsb
  316.   sub al,bl
  317.  
  318.   shl ax,4 ;It's a #
  319.   shr al,4
  320.   cmp al,0Ah
  321.   jb XSAFE
  322.   call ITS_A_LETTER
  323.   jmp XALMSAFE
  324. XSAFE:  
  325.   add al,30h
  326. XALMSAFE:
  327.   xchg ah,al
  328.   cmp al,0Ah
  329.   jb XSAFEENOUGH
  330.   call ITS_A_LETTER
  331.   jmp XALMSAFEENOUGH
  332. XSAFEENOUGH:
  333.   add al,30h
  334. XALMSAFEENOUGH:
  335.   lea di,NUMDISPLAY
  336.   add di,word ptr[DATACOUNT]
  337.   mov [di],al
  338.   dec DATACOUNT
  339.   xchg ah,al
  340.   lea di,NUMDISPLAY
  341.   add di,word ptr[DATACOUNT]
  342.   mov [di],al
  343.   dec DATACOUNT
  344.  
  345.   loop @L00P
  346.  
  347. RETURN:
  348.   pop si
  349.   pop di
  350.   ret           ;value NUMDISPLAY
  351. ENKRYPT EndP
  352. ALSO Proc
  353.   push ax
  354.   push esi
  355.   push es
  356.   push di
  357.   mov di,LINE1-10
  358.   mov es,di
  359.   mov di,0
  360.   mov esi,offset ALSO_MSG
  361.   cld
  362. ALSO_1_1:
  363.   lodsb
  364.   mov ah,ERROR_MSG_COLOR
  365.   stosw
  366.   cmp al,0
  367.   jne ALSO_1_1
  368.   pop di
  369.   pop es
  370.   pop esi
  371.   pop ax
  372.   ret
  373. ALSO EndP
  374. ITS_A_LETTER Proc
  375.   cmp al,0Ah
  376.   jz @A
  377.   cmp al,0Bh
  378.   jz @B
  379.   cmp al,0Ch
  380.   jz @C
  381.   cmp al,0Dh
  382.   jz @D
  383.   cmp al,0Eh
  384.   jz @E
  385. @F:  
  386.   mov al,46h
  387.   ret
  388. @A:  
  389.   mov al,41h
  390.   ret
  391. @B:  
  392.   mov al,42h
  393.   ret
  394. @C:  
  395.   mov al,43h
  396.   ret
  397. @D:  
  398.   mov al,44h
  399.   ret
  400. @E:  
  401.   mov al,45h
  402.   ret
  403. ITS_A_LETTER EndP
  404. FadeOUT PROC    Near
  405.         call    WaitVGA
  406. ; kill the screen
  407. ;
  408.         mov     cx,2Ah
  409. RepeatKilling:
  410.         mov     dx,3C8h
  411.         mov     al,07h
  412.         out     dx,al
  413.         inc     dx
  414.         mov     ax,cx
  415.         dec     ax
  416.         out     dx,al
  417.         jmp     short $ + 2
  418.         out     dx,al
  419.         jmp     short $ + 2
  420.         out     dx,al
  421. ;
  422.         call    WaitVGA
  423.         loop   RepeatKilling
  424. FadeOut ENDP
  425. WaitVGA PROC    Near
  426.         pushf
  427.         push    ax
  428.         push    dx
  429.         mov     dx,3DAh
  430. Test1AgainVGA:
  431.         in      al,dx
  432.         test    al,8
  433.         jnz     Test1AgainVGA
  434. Test2AgainVGA:
  435.         in      al,dx
  436.         test    al,8
  437.         jz      Test2AgainVGA
  438. ;
  439.         pop     dx
  440.         pop     ax
  441.         popf
  442.         ret
  443. WaitVGA ENDP
  444.  
  445. _TEXT ENDS
  446. END INTRO
  447.