home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / UTILITY / VIRUS / INNOC.ZIP / INNOC.ASM next >
Encoding:
Assembly Source File  |  1991-02-07  |  2.4 KB  |  62 lines

  1. ;*********************************************************
  2. ; INNOC, a simple diskette-immunization program to 
  3. ; prevent infection by common Boot Sector viruses
  4. ;  by
  5. ; Mike McCune (c) 1990, 1991 - All Rights Reserved.
  6. ; This program may be freely used and distributed.
  7. ; For assembly into a .COM file with A86 shareware 
  8. ;  assembler or equivalent.
  9. ;*********************************************************
  10.  
  11.     .model small
  12.  
  13.        assume  cs:code , ds:code
  14.  
  15.  
  16.   jmp opening                   ;Start the program
  17.  
  18.   db '(c) 1990, 1991 Mike McCune. All rights reserved'
  19.                                  
  20. opening:                        
  21.       xor dx,dx             ;
  22.       xor ah,ah             ;Reset floppy
  23.       int 13h               ;Drive A:
  24.       mov cx,1h             ;We'll be reading
  25.       mov bx,200h           ;the Boot Sector
  26.       mov ax,201h           ;into memory
  27.       int 13h               ;do it now.
  28.       or ah,ah              ;and check for a Read error.
  29.       jnz read_error        ;If error was detected, inform operator.
  30.       es:                   ;Otherwise, we'll be writing
  31.       mov [bx],05eah        ;these strings
  32.       mov [bx+2],0c000h     ;into the Boot Sector..
  33.       mov [bx+4],1234h      ;(these are the 
  34.       mov [bx+1fc],1357h    ; actual immunization
  35.       mov ax,301h           ; strings).
  36.       int 13h               ;Do all that writing now.
  37.       or ah,ah              ;Now check for a write error.
  38.       jnz write_error       ;If error was detected, inform operator;
  39.       mov ah,9h             ;otherwise,
  40.       lea dx,innoc_message  ;tell operator the diskette has 
  41.       int 21h               ;been immunized
  42.       int 20h               ;and terminate program.
  43.  
  44. read_error:                     ;If Read error was earlier detected,
  45.       mov ah,9h             ;then
  46.       lea dx,read_message   ;display the Read Error message
  47.       int 21h               ;and
  48.       int 20h               ;end program.
  49.  
  50. write_error:                    ;If Write error was earlier detected,
  51.       mov ah,9h             ;then
  52.       lea dx,write_message  ;display the Write Error message
  53.       int 21h               ;and
  54.       int 20h               ;end program.
  55.  
  56. innoc_message:                  ;Immunization Completed message
  57.       db 'Diskette A: innoculated$'
  58. read_message:                   ;Read Error message
  59.       db 'Read Error!$'     ;
  60. write_message:                  ;Write Error message
  61.       db ' Write Error!$'   ;
  62.