[comp.sys.apple] Vaccine

mdavis@pro-sol.cts.COM (Morgan Davis) (07/24/88)

Okay, I've written a vaccine for this virus (which I'm calling WOPFOG, because
that's what the screen says: WOP = Worshippers of Patrick, FOG = Friends of
Glen Bredon).  No where in it does it say "CyberAIDS" -- so I don't know where
that name came from.

This BASIC program will detect the virus in all SYS files in your root
directory (or just one file you select).  It will also, on your command, strip
the infection out of a sick file and will restore the file to its original
contents.  In addition, it will fix byte $1FF in Block #2 of your root volume.
The virus uses this byte as a counter to determine when the henchman cometh
to lop off the vital part of your volume directory: Blocks #2 through #5 !!

----------------------------( cut here )-----------------------------------
 100  REM ***********************************
 110  REM *                                 *
 120  REM *  [WOP] "Festering Hate" [FOG]   *
 130  REM *      Vaccination Utility        *
 140  REM *        by Morgan Davis          *
 150  REM *                                 *
 160  REM * This will detect and remove the *
 170  REM * virus from SYS files.  It will  *
 180  REM * also fix byte $1FF of Block 2.  *
 190  REM *                                 *
 200  REM ***********************************
 210 :
 220  DIM F$(52):D$ =  CHR$ (4):BUF = 768:ADR = 8192
 230  HOME 
 240  PRINT "*** NOTE ***": PRINT 
 250  PRINT "This program will detect and disinfect"
 260  PRINT "only a certain strain of virus.  If it"
 270  PRINT "doesn't detect a virus, it does not"
 280  PRINT "mean that one does not exist in a file!"
 290  PRINT 
 300  PRINT "Check a (F)ile or (V)olume: ";: GOSUB 750
 310 FIL = A$ = "F":VOL = A$ = "V"
 320  IF  NOT (FIL OR VOL) THEN  PRINT : END 
 330  PRINT : INPUT "Pathname: ";P$:F$(1) = P$:F = 1
 340  IF P$ = "" THEN  END 
 350  PRINT D$"VERIFY"P$: PRINT 
 360  IF FIL THEN 450
 370  PRINT D$"OPEN"P$",TDIR": PRINT D$"READ"P$
 380  INPUT A$: INPUT A$: INPUT A$:F = 0
 390  INPUT A$: IF A$ = "" THEN 420
 400  IF  MID$ (A$,18,3) = "SYS" THEN F = F + 1:F$(F) =  MID$ (A$,2,15)
 410  GOTO 390
 420  PRINT D$"CLOSE"
 430  IF  NOT F THEN  PRINT "Volume "P$" contains no SYS files.": END 
 440 :
 450  FOR I = 1 TO F
 460  PRINT "Checking "F$(I)"...";
 470  PRINT D$"BLOAD"F$(I)",TSYS,A"BUF",L3"
 480  IF  PEEK (BUF) <  > 76 THEN 640
 490 OFF = ( PEEK (BUF + 1) +  PEEK (BUF + 2) * 256) - ADR - 6
 500 X = BUF + 6
 510  PRINT D$"BLOAD"F$(I)",TSYS,A"BUF",L114,b"OFF
 520  IF  PEEK (X + 107) <  > 199 THEN 640
 530  RESTORE 
 540  READ N: IF N =  PEEK (X) THEN X = X + 1: GOTO 540
 550  ON N >  = 0 GOTO 640
 560  CALL  - 198: PRINT "INFECTED!  Kill the virus? ";: GOSUB 750
 570  IF A$ <  > "Y" THEN 650
 580  PRINT "Working hard...";
 590  PRINT D$"BLOAD"F$(I)",TSYS,A"ADR
 600  FOR X = 0 TO 5: POKE ADR + X, PEEK (BUF + X): NEXT 
 610  PRINT D$"DELETE"F$(I): PRINT D$"CREATE"F$(I)",TSYS"
 620  PRINT D$"BSAVE"F$(I)",TSYS,A"ADR",L"OFF
 630  PRINT F$(I)" cured!": GOTO 650
 640  PRINT "not infected."
 650  NEXT 
 660 :
 670 OP = 128: GOSUB 790: REM READ_BLOCK
 680 I =  PEEK (ADR + 511): IF  NOT I THEN  END 
 690  PRINT : PRINT P$" has a fuse!  (counter = "I"/30)"
 700  PRINT "Extinguish it? ";: GOSUB 750
 710  IF A$ <  > "Y" THEN  END 
 720  POKE ADR + 511,0:OP = 129: GOSUB 790: REM WRITE_BLOCK
 730  PRINT "Done.": END 
 740 :
 750  GET A$: IF A$ =  CHR$ (27) THEN  END 
 760  IF A$ > "_" THEN A$ =  CHR$ ( ASC (A$) - 32)
 770  PRINT A$: RETURN 
 780 :
 790  POKE 768,32: POKE 769,0: POKE 770,191: REM JSR $BF00
 800  POKE 771,OP: POKE 772,9: POKE 773,3: REM   DB  OP / DW $0309
 810  POKE 774,133: POKE 775,0: POKE 776,96: REM STA $00 / RTS
 820  POKE 777,3: POKE 778, PEEK (48944)
 830  POKE 779,ADR -  INT (ADR / 256) * 256: POKE 780, INT (ADR / 256)
 840  POKE 781,2: POKE 782,0
 850  CALL 768:I =  PEEK (0): IF I THEN  PRINT "MLI Err #"I" OP="OP: END 
 860  RETURN 
 870 :
 880  DATA 32,88,255,186,189,0,1,141,1,3,202,189,0,1,141,0,3,238,0,3,-1
----------------------------( cut here )-----------------------------------

--Morgan Davis

    UUCP: crash!pnet01!pro-sol!mdavis
 ProLine: mdavis@pro-sol
 ARPANet: crash!pnet01!pro-sol!mdavis@nosc.mil
InterNet: mdavis@pro-sol.cts.com