!pr1
DOS Patch:  Prevent Direct Commands.....Richard Gendron

I operate a AE/CATFUR line using my Apple and a modem in Montreal, Quebec.  I have found that protecting your DOS from illegal entry can be a tough job to say the least.

In searching for ways to protect my system, I came across an interesting address in DOS:  at $A026 there is some code which is executed whenever you try to type in a DOS command.  The code checks to see if the command you typed is allowed as a direct command, and if not gives you the NOT DIRECT COMMAND message (or ERROR 15 if you are using DiversiDOS).

I have written a little patch that will catch you when you type a DOS command, and re-RUN the Applesoft program.  If a sneaky caller finds a way to get out of the executing Applesoft program, at least he/she will be prevented from doing DOS commands.

Now every lock should have a key.  You do want to be able to use your own DOS in direct mode, so I have included a way to turn off the protection.  If you type "PRINT USR (0)" the system will respond with "PW:".  Then enter a two-character  password and the protection patch will be removed.  Then you can CATALOG, DELETE, or whatever you want to do.

Since I use Diversi-DOS, and in both the 48K and 64K configurations, I set up my patching program so that it will work with both.  The code which checks which version is loaded is in lines 1220-1260 and lines 1390-1410.  If the output hook at $36,37 points up to $BDxx or higher, the 64K version must be running.  Normal 48K DOS points to $9EBD.

These patches worked on my system, but yours may be a little different depending on which version of DOS you use.  Examine carefully all the addresses I use inside DOS to see if yours is the same as mine before you try to use these patches.
