' *** BOOTCHCK.LST *** 2nd GFA-Manual, page 11-24 FUNCTION boot_check(drive$) ' ' *** Calculate checkcum of bootsector on drive$ ' *** Warn user if bootsector is executable (could be a virus) ' *** Returns TRUE if bootsector not executable (no boot-virus) ' LOCAL drive,buffer%,sum%,i,m$,k drive$=UPPER$(drive$) CLS PRINT PRINT " Checking bootsector of drive ";drive$;"..." drive=SUB(ASC(drive$),65) INLINE buffer%,512 ~BIOS(4,0,L:buffer%,1,0,drive) ! bootsector (0) in buffer FOR i=0 TO 255 ADD sum%,CARD{ADD(buffer%,MUL(i,2))} NEXT i sum%=sum% AND &HFFFF IF sum%=&H1234 m$=" *** Warning ***| |Bootsector is executable,|" m$=m$+"could be a boot-virus!" ALERT 3,m$,2,"Continue|Exit",k IF k=1 RETURN FALSE ELSE m$="Turn everything off and |examine the bootsector |of drive "+drive$ ALERT 3,m$,1," OK ",k CLS PRINT " Performing endless loop..." PRINT " Turn everything off!" DO LOOP ENDIF ENDIF RETURN TRUE ENDFUNC ' ***** '