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.  
  4.  
  5. _STACK SEGMENT STACK
  6.  
  7. dw 100h dup (?)
  8.  
  9. _STACK ENDS
  10.  
  11.  
  12.  
  13. _DATA SEGMENT
  14.  
  15. DATACOUNT db 0
  16.  
  17. NUMDISPLAY db 50 dup (0)
  18.  
  19. ALSO_MSG db 'Run ZTW_REG and type in the number given',0
  20.  
  21. LINE1 equ 0B878h
  22.  
  23. REGMEMNAMECNTR dw 0
  24.  
  25. ACTUAL_LETTERS dw 0
  26.  
  27. RED db 0
  28.  
  29. GREEN db 0
  30.  
  31. BLUE db 0
  32.  
  33. COLOR db 63
  34.  
  35. ISTHEREANERROR db 0
  36.  
  37. INIT equ 1Fh
  38.  
  39. INIT_COLOR equ 01F7Eh
  40.  
  41. NAME_COLOR equ 1Fh
  42.  
  43. NUM_COLOR equ 1Fh
  44.  
  45. PRINT_NUM_CNT dw 22 ;and video address
  46.  
  47. ERROR_MSG_COLOR equ 0Ch
  48.  
  49. ERROR db 'Sorry bud, please read the instructions',0
  50.  
  51. LOGO db 1 dup (0dh,0ah)
  52.  
  53. UCF       DB '─────────────────────────────────────────',10,13
  54.  
  55.           DB '  ▄▄▄   ▄▄▄    ▄▄▄▄▄▄▄▄▄    ▄▄▄▄▄▄▄▄▄   ',10,13
  56.  
  57.           DB '  ███   ███    ███          ███▄▄▄      ',10,13
  58.  
  59.           DB '  ███▄  ███    ███▄         ███         ',10,13
  60.  
  61.           DB '  ▀▀▀▀▀▀▀▀▀    ▀▀▀▀▀▀▀▀▀    ▀▀▀         ',10,13
  62.  
  63.           DB '─────────────────────────────────────────',10,13
  64.  
  65.           DB ' u N I T E D  c R Æ C K I N G  f O R C E ',10,13
  66.  
  67.           DB '─────────────────────────────────────────',10,13
  68.  
  69.           DB ' ZTWin 1.20 and 1.21 Beta Keymaker - 3 char min -',10,13
  70.  
  71.           DB ' By IllumiTIE[UCF] - Thanks to xOANON[UCF]',10,13,10,13
  72.  
  73.           db '      Name:$'
  74.  
  75. SERIAL db 0dh,0ah,'    Serial:$'
  76.  
  77. NAMENOVMEM db 29 dup (0)
  78.  
  79. _DATA ENDS
  80.  
  81.  
  82.  
  83. _TEXT SEGMENT use16
  84.  
  85.   Assume CS:_TEXT, DS:_DATA, ES:_DATA, SS:_STACK
  86.  
  87. INTRO:
  88.  
  89.   call FADEOUT
  90.  
  91.   mov ax,0003h
  92.  
  93.   int 10h
  94.  
  95.   mov ax,_DATA
  96.  
  97.   mov ds,ax
  98.  
  99.   mov ax,1015h
  100.  
  101.   mov bx,0007h
  102.  
  103.   int 10h
  104.  
  105.   mov GREEN,ch
  106.  
  107.   mov BLUE,cl
  108.  
  109.   mov RED,dh
  110.  
  111.   lea dx,LOGO
  112.  
  113.   mov ah,9
  114.  
  115.   int 21h
  116.  
  117.   call CLASS
  118.  
  119.   cld
  120.  
  121.   sub di,58 ;numbe of char *2
  122.  
  123.   jmp DISPLAY_TEXT
  124.  
  125.  
  126.  
  127. ERROR_1:
  128.  
  129.   call ERROR_MSG
  130.  
  131. DISPLAY_TEXT:
  132.  
  133.   call ASK
  134.  
  135.   cmp ISTHEREANERROR,1
  136.  
  137.   jz ERROR_1
  138.  
  139.   call ENKRYPT
  140.  
  141. QUIT:
  142.  
  143.   call WRI_HEX_DIG
  144.  
  145.   call RESET_PAL
  146.  
  147.   call ALSO
  148.  
  149.   mov ax,4c00h
  150.  
  151.   int 21h
  152.  
  153.  
  154.  
  155. WRI_HEX_DIG Proc
  156.  
  157.   push di
  158.  
  159.   push ax
  160.  
  161.   push dx
  162.  
  163.   cld
  164.  
  165.   mov di,LINE1+10
  166.  
  167.   mov es,di
  168.  
  169.   mov di,PRINT_NUM_CNT
  170.  
  171.   lea si,NUMDISPLAY
  172.  
  173. L00PWRITE:
  174.  
  175.   lodsb
  176.  
  177.   mov ah,NUM_COLOR
  178.  
  179.   stosw
  180.  
  181.   or al,al
  182.  
  183.   jnz L00PWRITE
  184.  
  185.   pop dx
  186.  
  187.   pop ax
  188.  
  189.   pop di
  190.  
  191.   ret
  192.  
  193. WRI_HEX_DIG EndP
  194.  
  195. CLASS Proc
  196.  
  197.   mov bx,LINE1
  198.  
  199.   mov es,bx
  200.  
  201.   mov di,22
  202.  
  203.   mov ax,INIT_COLOR
  204.  
  205.   mov cx,29
  206.  
  207.   rep stosw
  208.  
  209.   mov ax,1000h
  210.  
  211.   xor bx,bx
  212.  
  213.   mov dx,1000h
  214.  
  215.   int 10h
  216.  
  217.   ret
  218.  
  219. CLASS EndP
  220.  
  221. DEL_ERR_MSG Proc
  222.  
  223.   push cx
  224.  
  225.   push ax
  226.  
  227.   push si
  228.  
  229.   push di
  230.  
  231.   push es
  232.  
  233.   mov di,LINE1-10
  234.  
  235.   mov es,di
  236.  
  237.   mov di,0
  238.  
  239.   xor ax,ax
  240.  
  241.   mov cx,40
  242.  
  243.   rep stosw
  244.  
  245.   pop es
  246.  
  247.   pop di
  248.  
  249.   pop si
  250.  
  251.   pop ax
  252.  
  253.   pop cx
  254.  
  255.   ret
  256.  
  257. DEL_ERR_MSG EndP
  258.  
  259. ERROR_MSG Proc
  260.  
  261.   push ax
  262.  
  263.   push esi
  264.  
  265.   push es
  266.  
  267.   push di
  268.  
  269.   dec ISTHEREANERROR
  270.  
  271.   mov di,LINE1-10
  272.  
  273.   mov es,di
  274.  
  275.   mov di,0
  276.  
  277.   mov esi,offset ERROR
  278.  
  279.   cld
  280.  
  281. ERROR_1_1:
  282.  
  283.   lodsb
  284.  
  285.   mov ah,ERROR_MSG_COLOR
  286.  
  287.   stosw
  288.  
  289.   cmp al,0
  290.  
  291.   jne ERROR_1_1
  292.  
  293.   pop di
  294.  
  295.   pop es
  296.  
  297.   pop esi
  298.  
  299.   pop ax
  300.  
  301.   ret
  302.  
  303. ERROR_MSG EndP
  304.  
  305. ASK Proc
  306.  
  307. STOP_1:
  308.  
  309.   call FLASHNOW
  310.  
  311.   xor ax,ax
  312.  
  313.   mov ah,01
  314.  
  315.   ;xor ah,ah
  316.  
  317.   int 16h
  318.  
  319.   jz STOP_1
  320.  
  321.   xor ah,ah
  322.  
  323.   int 16h
  324.  
  325.   call DEL_ERR_MSG
  326.  
  327.   cmp al,0dh
  328.  
  329.   jz DONE
  330.  
  331.   cmp al,08h
  332.  
  333.   jz NO_SAVE
  334.  
  335.   cmp ACTUAL_LETTERS,3
  336.  
  337.   jz ERROR_DONE
  338.  
  339. IS_IT_NUM:
  340.  
  341.   cmp al,39h
  342.  
  343.   jle SAVE
  344.  
  345. ;  and al,05fh
  346.  
  347.   jmp short SAVE
  348.  
  349. NO_SAVE:
  350.  
  351.   cmp ACTUAL_LETTERS,0
  352.  
  353.   jz ERROR_DONE
  354.  
  355.   std
  356.  
  357.   push ax
  358.  
  359.   dec di
  360.  
  361.   dec di
  362.  
  363.   mov ax,INIT_COLOR
  364.  
  365.   stosw
  366.  
  367.   inc di
  368.  
  369.   inc di
  370.  
  371.   pop ax
  372.  
  373.   cld
  374.  
  375.   dec ACTUAL_LETTERS
  376.  
  377.   dec ACTUAL_LETTERS
  378.  
  379.   dec REGMEMNAMECNTR
  380.  
  381.   jmp short BLAH
  382.  
  383. SAVE:
  384.  
  385.   mov ah,NAME_COLOR
  386.  
  387.   stosw
  388.  
  389.   call SAVEINREGMEM
  390.  
  391. BLAH:
  392.  
  393.   inc ACTUAL_LETTERS
  394.  
  395.   jmp STOP_1
  396.  
  397. ERROR_DONE:
  398.  
  399.   mov ISTHEREANERROR,1
  400.  
  401.   ret
  402.  
  403. DONE:
  404.  
  405.   cmp ACTUAL_LETTERS,3
  406.  
  407.   jl ERROR_DONE
  408.  
  409.   ret
  410.  
  411. ASK EndP
  412.  
  413. FLASHNOW Proc
  414.  
  415.   push ax
  416.  
  417.   push bx
  418.  
  419.   push cx
  420.  
  421.   push dx
  422.  
  423.   mov ax,1010h
  424.  
  425.   xor bh,bh
  426.  
  427.   mov bl,7
  428.  
  429.   mov cl,COLOR
  430.  
  431.   mov dh,COLOR
  432.  
  433.   mov ch,COLOR
  434.  
  435.  REDO:
  436.  
  437.   mov ax,1010h
  438.  
  439.   mov cl,COLOR
  440.  
  441.   mov ch,COLOR
  442.  
  443.   mov dh,COLOR
  444.  
  445.   int 10h
  446.  
  447.   dec COLOR
  448.  
  449.   or cl,cl
  450.  
  451.   jnz QUIT_COLOR
  452.  
  453.   mov COLOR,63
  454.  
  455.  QUIT_COLOR:
  456.  
  457.   pop dx
  458.  
  459.   pop cx
  460.  
  461.   pop bx
  462.  
  463.   pop ax
  464.  
  465.   ret
  466.  
  467. FLASHNOW EndP
  468.  
  469. RESET_PAL Proc
  470.  
  471.   mov ax,1010h
  472.  
  473.   xor bh,bh
  474.  
  475.   mov bl,7
  476.  
  477.   mov ch,GREEN
  478.  
  479.   mov cl,BLUE
  480.  
  481.   mov dh,RED
  482.  
  483.   int 10h
  484.  
  485.   ret
  486.  
  487. RESET_PAL EndP
  488.  
  489. SAVEINREGMEM Proc
  490.  
  491.   push es
  492.  
  493.   push ax
  494.  
  495.   push di
  496.  
  497.   push ds
  498.  
  499.   pop es
  500.  
  501.   mov edi,offset NAMENOVMEM
  502.  
  503.   add di,REGMEMNAMECNTR
  504.  
  505.   stosb
  506.  
  507.   inc REGMEMNAMECNTR
  508.  
  509.   pop di
  510.  
  511.   pop ax
  512.  
  513.   pop es
  514.  
  515.   ret
  516.  
  517. SAVEINREGMEM EndP
  518.  
  519. ENKRYPT Proc
  520.  
  521.   push ax
  522.  
  523.   mov ah,09
  524.  
  525.   push dx
  526.  
  527.   lea dx,SERIAL
  528.  
  529.   int 21h
  530.  
  531.   pop dx
  532.  
  533.   pop ax
  534.  
  535.   push si
  536.  
  537.   push di
  538.  
  539.   lea si,NAMENOVMEM
  540.  
  541.   lea di,NUMDISPLAY
  542.  
  543.   mov ax,ACTUAL_LETTERS
  544.  
  545.   mov ah,al
  546.  
  547.   add al,ah
  548.  
  549.   dec al
  550.  
  551.   mov DATACOUNT,al
  552.  
  553.   xor ah,ah
  554.  
  555.   cld
  556.  
  557.   lodsb
  558.  
  559.   mov bp,ax
  560.  
  561.   shl ax,4 ;It's a #
  562.  
  563.   shr al,4
  564.  
  565.   cmp al,0Ah
  566.  
  567.   jb SAFE
  568.  
  569.   call ITS_A_LETTER
  570.  
  571.   jmp ALMSAFE
  572.  
  573. SAFE:  
  574.  
  575.   add al,30h
  576.  
  577. ALMSAFE:
  578.  
  579.   xchg ah,al
  580.  
  581.   cmp al,0Ah
  582.  
  583.   jb SAFEENOUGH
  584.  
  585.   call ITS_A_LETTER
  586.  
  587.   jmp ALMSAFEENOUGH
  588.  
  589. SAFEENOUGH:
  590.  
  591.   add al,30h
  592.  
  593. ALMSAFEENOUGH:
  594.  
  595.   lea di,NUMDISPLAY
  596.  
  597.   add di,word ptr[DATACOUNT]
  598.  
  599.   mov [di],al
  600.  
  601.   dec DATACOUNT
  602.  
  603.   xchg ah,al
  604.  
  605.   lea di,NUMDISPLAY
  606.  
  607.   add di,word ptr[DATACOUNT]
  608.  
  609.   mov [di],al
  610.  
  611.   dec DATACOUNT
  612.  
  613.   mov cx,ACTUAL_LETTERS
  614.  
  615.  NEXT_SECT:
  616.  
  617.   mov bx,001bh
  618.  
  619.   sub bx,bp
  620.  
  621.   xor bh,bh
  622.  
  623.  @L00P:
  624.  
  625.   cld
  626.  
  627.   xor ah,ah
  628.  
  629.   lodsb
  630.  
  631.   sub al,bl
  632.  
  633.  
  634.  
  635.   shl ax,4 ;It's a #
  636.  
  637.   shr al,4
  638.  
  639.   cmp al,0Ah
  640.  
  641.   jb XSAFE
  642.  
  643.   call ITS_A_LETTER
  644.  
  645.   jmp XALMSAFE
  646.  
  647. XSAFE:  
  648.  
  649.   add al,30h
  650.  
  651. XALMSAFE:
  652.  
  653.   xchg ah,al
  654.  
  655.   cmp al,0Ah
  656.  
  657.   jb XSAFEENOUGH
  658.  
  659.   call ITS_A_LETTER
  660.  
  661.   jmp XALMSAFEENOUGH
  662.  
  663. XSAFEENOUGH:
  664.  
  665.   add al,30h
  666.  
  667. XALMSAFEENOUGH:
  668.  
  669.   lea di,NUMDISPLAY
  670.  
  671.   add di,word ptr[DATACOUNT]
  672.  
  673.   mov [di],al
  674.  
  675.   dec DATACOUNT
  676.  
  677.   xchg ah,al
  678.  
  679.   lea di,NUMDISPLAY
  680.  
  681.   add di,word ptr[DATACOUNT]
  682.  
  683.   mov [di],al
  684.  
  685.   dec DATACOUNT
  686.  
  687.  
  688.  
  689.   loop @L00P
  690.  
  691.  
  692.  
  693. RETURN:
  694.  
  695.   pop si
  696.  
  697.   pop di
  698.  
  699.   ret           ;value NUMDISPLAY
  700.  
  701. ENKRYPT EndP
  702.  
  703. ALSO Proc
  704.  
  705.   push ax
  706.  
  707.   push esi
  708.  
  709.   push es
  710.  
  711.   push di
  712.  
  713.   mov di,LINE1-10
  714.  
  715.   mov es,di
  716.  
  717.   mov di,0
  718.  
  719.   mov esi,offset ALSO_MSG
  720.  
  721.   cld
  722.  
  723. ALSO_1_1:
  724.  
  725.   lodsb
  726.  
  727.   mov ah,ERROR_MSG_COLOR
  728.  
  729.   stosw
  730.  
  731.   cmp al,0
  732.  
  733.   jne ALSO_1_1
  734.  
  735.   pop di
  736.  
  737.   pop es
  738.  
  739.   pop esi
  740.  
  741.   pop ax
  742.  
  743.   ret
  744.  
  745. ALSO EndP
  746.  
  747. ITS_A_LETTER Proc
  748.  
  749.   cmp al,0Ah
  750.  
  751.   jz @A
  752.  
  753.   cmp al,0Bh
  754.  
  755.   jz @B
  756.  
  757.   cmp al,0Ch
  758.  
  759.   jz @C
  760.  
  761.   cmp al,0Dh
  762.  
  763.   jz @D
  764.  
  765.   cmp al,0Eh
  766.  
  767.   jz @E
  768.  
  769. @F:  
  770.  
  771.   mov al,46h
  772.  
  773.   ret
  774.  
  775. @A:  
  776.  
  777.   mov al,41h
  778.  
  779.   ret
  780.  
  781. @B:  
  782.  
  783.   mov al,42h
  784.  
  785.   ret
  786.  
  787. @C:  
  788.  
  789.   mov al,43h
  790.  
  791.   ret
  792.  
  793. @D:  
  794.  
  795.   mov al,44h
  796.  
  797.   ret
  798.  
  799. @E:  
  800.  
  801.   mov al,45h
  802.  
  803.   ret
  804.  
  805. ITS_A_LETTER EndP
  806.  
  807. FadeOUT PROC    Near
  808.  
  809.         call    WaitVGA
  810.  
  811. ; kill the screen
  812.  
  813. ;
  814.  
  815.         mov     cx,2Ah
  816.  
  817. RepeatKilling:
  818.  
  819.         mov     dx,3C8h
  820.  
  821.         mov     al,07h
  822.  
  823.         out     dx,al
  824.  
  825.         inc     dx
  826.  
  827.         mov     ax,cx
  828.  
  829.         dec     ax
  830.  
  831.         out     dx,al
  832.  
  833.         jmp     short $ + 2
  834.  
  835.         out     dx,al
  836.  
  837.         jmp     short $ + 2
  838.  
  839.         out     dx,al
  840.  
  841. ;
  842.  
  843.         call    WaitVGA
  844.  
  845.         loop   RepeatKilling
  846.  
  847. FadeOut ENDP
  848.  
  849. WaitVGA PROC    Near
  850.  
  851.         pushf
  852.  
  853.         push    ax
  854.  
  855.         push    dx
  856.  
  857.         mov     dx,3DAh
  858.  
  859. Test1AgainVGA:
  860.  
  861.         in      al,dx
  862.  
  863.         test    al,8
  864.  
  865.         jnz     Test1AgainVGA
  866.  
  867. Test2AgainVGA:
  868.  
  869.         in      al,dx
  870.  
  871.         test    al,8
  872.  
  873.         jz      Test2AgainVGA
  874.  
  875. ;
  876.  
  877.         pop     dx
  878.  
  879.         pop     ax
  880.  
  881.         popf
  882.  
  883.         ret
  884.  
  885. WaitVGA ENDP
  886.  
  887.  
  888.  
  889. _TEXT ENDS
  890.  
  891. END INTRO
  892.  
  893.