Virus Scripts - 10/1/98 Jacqueline Landman Gay HyperActive Software develop@hyperactivesw.com Below are some inoculation strings you can add to your Home stack script which will prevent some HyperCard viruses from attacking your stacks. Copy the entire block below and paste it into your Home stack for protection. You will notice that some viruses look for several different variations; in particular, all the MerryXmas varieties need three different strings each to completely inoculate your stacks. -- if the script of home contains -- pickle -- ¦ -- blink -- Independance Day -- Independance Day --on idle --merryxmas --on openbackground --merryxmas --on closebackground --merryxmas --on idle --merry2xmas --on openbackground --merry2xmas --on closebackground --merry2xmas --on idle --Lopez --on openbackground --Lopez --on closebackground --Lopez --on idle --crudshot --on openbackground --crudshot --on closebackground --crudshot --on openstack --merryxmas antibody Copy these text strings exactly, including the hyphens, when installing the inoculations. Remember, every virus has its own "trigger" and you will only prevent those viruses for which you have provided the proper corresponding string. Setting a trap - preventing other script-based viruses The best way to prevent the spread of any virus is to lock your Home stack in the Finder. If you do not want to do this, then you may want to use a "set" trap handler. This approach uses a generic handler which you place in the stack script of your Home stack. This handler's function is to monitor HyperCard activity and warn you when anything tries to change the script of your Home stack without your knowledge. This effectively stops the spread of any script-based virus that relies on the message hierarchy to propagate itself, which is most of them. The following handler will notice any script activity that tries to change your Home stack, warn you, and allow you to stop the activity before it happens. This script has been widely tested and does not interfere with other HyperCard scripts, although on 68K Macs it may slow down HyperCard somewhat. On a PPC Mac there is little noticeable performance hit. Use your judgment as to whether you want to implement this prevention or not. The advantage to using this handler in an unlocked Home stack is that it will catch and warn you of all message-based viruses, including any new ones that may appear in the future. Note that the HC 9507 (Pickle) virus is not message-based, and this trap will not intercept it. Your best bet for Pickle is to install the inoculation string. To implement the "set" trap, copy the following script and paste it into your Home stack script: on set -- virus block if param(1) = "script" and param(3) contains "home" then answer "Another stack is attempting to alter" Â && " the script of the Home stack. Allow alteration?" Â with "Allow" or "Don't Allow" if it = "allow" then pass set else put "Home stack script has not been altered."Â && "Current handler has been aborted." into prompt if the userlevel = 5 then put " Edit script of current stack?" after prompt if the userlevel < 5 then answer prompt else answer prompt with "Cancel" or "Edit" if it = "cancel" then exit to HyperCard edit script of this stack -- allows removal of virus exit to HyperCard end if else pass set end set Be aware that some stacks change your Home scripts legitimately. If you are installing AddColor from the Color Tools stack, for example, your Home scripts are altered to support this external. In general, if you receive a warning from the set trap handler and you are installing legitimate HyperCard software, you can probably allow the alteration to continue. If you have any doubts, of course, it is safer to stop the activity. Note: A bug in versions of HyperCard 2.2 or less causes this script to error whenever it triggers. You can still use this script under these versions since the error message will also abort any virus activity, but you will have to remember to check the current stack scripts manually for viruses if you receive a "can't understand 'set'" error message. For best results, use this script with HyperCard version 2.3 or higher. HyperActive Software Comments or inquiries: info@hyperactivesw.com All contents copyright (C) 1996, HyperActive Software. All rights reserved. URL: http://www.hyperactivesw.com/Virus2.html