Ultra-Safe Version 1.3 Program Reference Manual July 30, 1986 Copyright 1986, Richard Solomon All Rights Reserved. .OP T A B L E O F C O N T E N T S 1. Introduction to Ultra-Safe.................................1 1.1. What is needed to run Ultra-Safe?.....................1 1.2. The Catch.............................................2 1.2.1. The Benefits of The Catch......................2 1.3. The Legalese..........................................3 1.3.1. License Agreement..............................3 1.3.2. Disclaimer.....................................3 2. Configuring Ultra-Safe.....................................4 2.1. General configuration background......................4 2.2. Configuring with a debugger...........................4 2.2.1. Sample Patching Session........................6 2.3. Configuration Addresses...............................6 2.4. Explanation of configuration data.....................7 3. Operating Ultra-Safe.......................................9 3.1. Installing it in memory...............................9 3.2. Removing it from memory...............................9 3.3. Locking and unlocking files..........................10 3.4. The technical side of locking........................10 3.5. Turbo Pascal.........................................11 4. Security using Ultra-Safe.................................12 4.1. On a BBS or RCP/M....................................12 4.2. As part of another system............................13 5. Hints on using Ultra-Safe.................................14 6. Bugs, comments, upgrades and you..........................15 6.1. Bug Reporting........................................15 6.2. Changes you make.....................................15 7. Registration..............................................16 .PN 1 1. Introduction to Ultra-Safe Ultra-Safe is a small (<256 bytes) program which resides in memory just below the operating system. It blocks all access to ".COM" files which have not been specifically unlocked and to all other files which have been specifically locked. The locked files will merely register as NOT FOUND. Ultra-Safe is otherwise invisible to the system. The file security checking can be switched on or off via a flag placed anywhere in memory. Ultra- Safe also has the capability to be de-installed from memory. Ultra-Safe is ideal for the RCP/M sysop. The flag location as well as the locked/unlocked filename byte can be easily changed. The flag can also be used as an access level check allowing certain users or only the sysop access to the locked files. The access level flag is designed to be set by the BBS program to reflect the security level of the user. For more information consult the sections on configuring Ultra-Safe and the hints on operation. 1.1. What is needed to run Ultra-Safe? Ultra-Safe runs under the CP/M operating system. It has been extensively tested on CP/M Version 2.2 running on a Z80 processor. Ultra-safe uses exclusively 8080 opcodes and no version 2.2 specific CP/M calls and thus should run on any CP/M machine running any version of CP/M. I would greatly appreciate feedback on the use of Ultra-Safe under CP/M 3 and/or the 8080/8085 processor as I have no facilities to test its operation under those environments. 1.2. The Catch Ultra-Safe is NOT Public Domain. It is distributed under the "User Supported" concept. That is -- you are going to support me one way or another. Either you can mail in a contribution to help keep me gainfully employed and pay my way through college or I will soon go broke and you'll have to support me on welfare. Wouldn't it be nicer (and less expensive!) to just mail me a check? Seriously though, I am working to pay my way through college and this program has taken a great deal of my time. I would enjoy the opportunity to continue to create quality programs as I believe this to be. The only way I can do that is if you, the person who uses Ultra-Safe, send me some sort of contribution to help me purchase more pizza, soft-drinks, and other programming aids essential to my continued productivity. Please complete the registration form and mail with your contribution to me: Richard Solomon Ultra-Safe Registration 7421 Alafia Ridge Road Riverview, Fl 33569 (813) 677-3703 1.2.1. The Benefits of The Catch When you register, I will mail an acknowledgement upon receipt of your registration. In addition, you will be notified of updates or enhancements to Ultra-Safe. You will also receive fixes for any bugs that crop up. I will also mail you information about any other packages I create when and if they become available. Lastly, I will give you the patch to shut off the warm-boot "conscience tweaker".1.3. The Legalese 1.3.1. License Agreement This program (Ultra-Safe) is Copyright 1986, Richard Solomon. All rights reserved. Non-registered users are granted a limited license to use this product on a trial basis, and to copy the program for the trial use of others provided the following conditions are met: The program is distributed in it's complete, unmodified form with documentation and all support files. No fee, charge or other consideration is requested or accepted for the copying and/or distribution of the program. The program is not distributed in conjunction with any other product. Commercial, business, or governmental use of this program by non- registered users is prohibited. Registration for commercial, business, or governmental use must be accompanied by a license fee of $25. Contact the author for site licensing information. 1.3.2. Disclaimer While this program has been extensively tested on several different systems, its author, Richard Solomon, can have no liability or responsibility to the user or any other person or entity with respect to any liability, loss or damage caused, or alleged to be caused, directly or indirectly, by this program, including but not limited to, any interruption of service, loss of business, anticipatory profits or consequential damages resulting from the use or misuse of this program. 2. Configuring Ultra-Safe 2.1. General configuration background As of the initial distribution of Ultra-Safe, I have not written a configuration program. If I receive a large number of requests for such a program and if the general response is great enough, I may write one. The configuration process is fairly simple and requires only the use of a debugger such as DDT or SID. Note: if you have a program such as EDFILE or SPZ, this installation process can be completed much more quickly and easily. All of the programs distributed with Ultra-Safe have a common configuration block. That means that the addresses to be changed are the same for each of the programs distributed. You need know only the number of pages in the file in order to go on with the configuration process. Here is a table of the files and their lengths: Filename___ #_of_pages SAFE.COM 6 FILELOCK.COM 2 FILUNLOK.COM 2 COMLOCK.COM 2 COMUNLOK.COM 2 2.2. Configuring with a debugger Read this section if you plan to configure Ultra-Safe and its utilities with DDT or SID or some other similar debugger. If you are using a program like EDFILE or are already familiar with the use of DDT to patch programs you may skip this section. Before you begin patching a program make sure you know how many pages it contains. (See Table above) In this section the sequence refers to pressing the ENTER or RETURN key and CTRL-x refers to holding down the CONTROL key and pressing the key x (e.g. CTRL-A or CTRL-B). All numbers used here are in hexadecimal (base 16). If you are not familiar with hexadecimal you may wish to get help from a more experienced computer user before attempting to continue. You change the contents of an address by typing in a letter S followed by the address you wish to change. DDT will respond with the current contents of that address and allow you to make a change at that time. Enter the new value followed by a and DDT will move on to the next byte. Enter a period followed by a and repeat the process for the next address. When you are completely done, press CTRL-C to return to CP/M. Now simply type in the following command line, replacing x with the number of pages and filename.typ with the filename of the program you are installing: SAVE x filename.typ ****CP/M 3 Users: This process is different for you! Consult your manual for information on using SID to patch a program. Below is a transcript of a sample session which should give you a better idea of how to patch a program. The example is for patching the flag location and minimum value. (The values I change in this example and the reason I change them may not make much sense now, but will be explained in the next section. Note: This is only an EXAMPLE, do not carry out these exact steps, this is only provided to give you an idea of how to make changes.) 2.2.1. Sample Patching Session A>DDT SAFE.COM DDT VERS 2.2 NEXT PC 0700 0100 -S103 103 2B 83 104 00 DE 105 09 . -S107 107 00 03 -CTRL-C A>SAVE 6 SAFE.COM A> 2.3. Configuration Addresses Below is a short table of the various configuration addresses and their default values. A detailed explanation of each will be given in the section below the table. *****WARNING***** Unless specifically instructed to do so by the author (Richard Solomon) or an authorized Bug Fix, NEVER change ANY address except those listed below. Such an action, aside from violating the license agreement, will ALMOST CERTAINLY cause erratic results. Ultra-Safe uses a fairly complex relocation scheme which can be drastically thrown for a loop by uninformed meddling. Please, for your own sake, DO NOT change anything outside of the specified configuration area. Address Label Default Explanation ------- -------- ------- ----------------------------- 0103 LEVLOC 2B LSB of Access Flag Location 0104 LEVLOC+1 00 MSB of Access Flag Location 0105 MINLEV 09 Lowest value of Access Flag for which Ultra-Safe should disable its checking. 0106 UNLFLG 0B Offset into FCB for byte to use for flag 0107 USROFF 00 Number of 256 byte pages for Ultra-Safe to relocate below the CCP. 2.4. Explanation of configuration data LEVLOC is the only two-byte label in the configuration block. It's job is to tell Ultra-Safe where to look for the Access Flag. The Access Flag merely switches on or off the security function of Ultra-Safe. A more detailed explanation of the Access Flag will be given under the MINLEV explanation. You must know where the User Access Level or Sysop Flag for your BBS program is. If you are not using a BBS program or your BBS does not support some type of Access Level Flag, then set both LEVLOC and LEVLOC+1 to 0 and set MINLEV to C4. LEVLOC is the lower byte of a hex address and LEVLOC+1 is the higher byte. For example: if you had the Access Flag located at DE83, then LEVLOC would be set to 83 and LEVLOC+1 would be set to DE -- it's that simple. MINLEV is the switching value for the Access Level Flag. When the access level flag contains a value less than that contained at MINLEV, Ultra-Safe functions as normal and screens out the locked files. When the access level flag contains a value greater than or equal to that contained at MINLEV, Ultra- Safe allows all files, including locked files, to be accessed freely. Many BBS programs keep a flag in memory which reflects the currently logged-on user's level of access within the BBS. This may be as simple as a 2 value flag telling whether the user is the sysop or as complex as the 24 level system found on some of the more sophisticated systems. If this is the case, set LEVLOC to point to the BBS's flag and set MINLEV to the value of that flag which reflects the lowest level user permitted total file access. UNLFLG this byte tells Ultra-Safe which byte of the filename holds the locked/unlocked flag. Most people should never have the need to change this flag from it's default value of 0B. That value uses the last character of the filetype for the flag. Some real-time clock programs and hard-disk backup programs may already use that flag, if so, then you must change the value of UNLFLG. Don't worry too much about understanding this byte, just look at the chart of values below and pick the value which is beneath the position in the filename you wish to use for the flag. It is best to avoid values of 09 and 0A since these are flags used by CP/M. Erratic operation WILL result if you specify a value of 0 or one greater than 0B!!!! FILENAME.TYP <---FILENAME BUFFER 12345678 9AB <---VALUE OF FLAG For example: To use the 2nd character of the filetype as the flag, set UNLFLG to 0A. USROFF is a byte used in very odd situations only. Unless you are an experienced programmer DO NOT CHANGE this byte. If you are determined to do so (or have been advised to do so by this manual or the author) then here it is. USROFF contains the number of pages below the perceived CCP that Ultra-Safe will offset to the actual top of memory. The perceived CCP is that address found by locating the BIOS via the jump at 0000 and subtracting 1600h from it. If this byte is set to a value other than 0, then Ultra-Safe will find the CCP, subtract this many pages from that address and then proceed to relocate itself below the result. 3. Operating Ultra-Safe 3.1. Installing it in memory There really isn't much to tell about the operation of Ultra-Safe. Running Ultra-Safe by typing SAFE will bring up a short copyright and informational message and then the notice Ultra-Safe installed. From now until you turn off or reset your computer or until you remove Ultra-Safe, a small portion of Ultra-Safe resides below your operating system. Don't worry, it only costs you 1/4 of 1k bytes of memory. Ultra-Safe protects itself against being overwritten, so it will not interfere with the operation of 99% of CP/M programs. Yes, there is that 1% out there somewhere...it is conceivably possible that some programs which are also memory resident may interfere with Ultra-Safe. This is not likely. The system was Beta tested for many weeks on a local RCP/M and has yet to fail or be breached. Remember that Ultra-Safe is only actively screening files when the Access Level Flag holds a value less than that specified in the configuration block. It is your responsibility to make sure that this flag is set properly. 3.2. Removing it from memory If you wish to, you may remove Ultra-Safe from memory by re- running it with the command SAFE. You should again see the copyright message and the comment Ultra-Safe removed. Now your system is back to normal and the 1/4k used by Ultra-Safe has been freed for other use. If you wish only to temporarily deactivate the file security, remember that this can be done via the access level flag. 3.3. Locking and unlocking files When you got the library containing Ultra-Safe, you may just have noticed four other .COM files with strange names. They are provided to allow you to easily lock and unlock both programs and files. Please note, use of these programs is not necessarily required -- consult the Tech section of this chapter. Here is a list of the four programs and their functions. COMLOCK.COM - Locks out .COM files FILELOCK.COM - Locks out files other than .COM files COMUNLOK.COM - Unlocks .COM files FILUNLOK.COM - Unlocks files other than .COM files ****NOTE: .COM files are always locked until they have been unlocked via COMUNLOK or other. Other files are always unlocked until they have been locked via FILELOCK. That is -- you must UNlock any .COM files you wish to be generally accessible and LOCK any other files you wish to be generally INaccessible. Please note that due to this reverse nature, it is essential that you NOT use FILELOCK and FILUNLOK on .COM files. 3.4. The technical side of locking This section is only required for those who do not wish to use the supplied lock/unlock programs. It can be safely skipped by those who do wish to use them. Ultra-Safe uses bit 7 of the specified filename character as a flag. If the file is of the type .COM, then a 1 value for the flag means the file is unlocked and a 0 means it is locked. For other files it is the exact opposit -- a 0 means the file is unlocked and a 1 means it is locked. There are several programs, such as NSWEEP, which have the capability to change these bits, or you can easily write your own using the Set Attributes call. 3.5. Turbo Pascal Thos of you who run Turbo Pascal may encounter problems running (when Ultra-Safe is installed) programs compiled when Ultra-Safe was not installed. If this is the case, you have two options. Either re-compile the program while Ultra-Safe is installed in memory, or re-compile the program with the top of memory pointer (in the compiler options section of Turbo Pascal) set to an address about 2.5k lower than it is normally. The simplest option, and the one which leaves the most room for your Turbo Pascal Program, is the first. 4. Security using Ultra-Safe 4.1. On a BBS or RCP/M Ultra-Safe was designed for use in the RCP/M environment. On a sensibly set up system, the program is virtually impregnable. The key word there is sensibly. Sheer stupidity and/or forgetfullness can (and most often do) provide the board- breaker with a golden opportunity to wreak havoc. There are a number of simple steps you, the sysop, can take to ensure that your system remains inviolate. - Lock out all except the essential programs. Don't leave copies of DDT lying around unlocked. Don't hide special privilege files as SYS or R/O and figure "No one can find them, they can't see them....." well they will. - Don't let any level of user except sysop have open access to the files. I.e.-configure Ultra-Safe to work with your BBS software to allow only the sysop's access level to disable the file security. - Make sure you have a file transfer program (e.g. XMODEM or KMD) which will not upload or download .COM files. Make sure you have the equates set to enable this function! - Find a TYPE replacement which will not type SYS and .COM files. Find a file transfer program which won't download SYS files. - Protect yourself by locking out any commercial packages you might have on-line for your personal use. Make sure to lock out their overlay files and such as well. - Even though the files used by your BBS system cannot be locked out (since the BBS program must access them) make them SYS files so they cannot be downloaded or TYPEed. I have worked long hours to find a way around Ultra-Safe and it's security. I have tried everything I could think of on the Beta testing RCP/M. I know the system intimately; I should be able to crack it. I can't. 4.2. As part of another system Although Ultra-Safe was designed to protect an RCP/M against intrusion, it can easily be made into the heart of a simple access control system. All you need to do is create a program, in any language you wish, which will manipulate the Access Level Flag on the basis of a user's logon and password and you can easily build up a security system for your computer system. Take a small business which runs off a hard disk. The boot sequence could include the password program to set the Access Flag. The everyday programs like a wordprocessor, spreadsheet, database manager, etc... could be left unlocked while other, more sensitive files were locked. This way the secretaries could all use the wordprocessor; the salesmen could all use the database manager; the accountant could use the spreadsheet; but only The Boss could access the payroll, or the stock program, or anything else he/she chose. Note: Such an access control program may be in the works. As with the configuration program, it will depend on the magnitude of response which I receive. 5. Hints on using Ultra-Safe - Ultra-Safe uses a peculiar relocation scheme. Part of the copyright message is compared to an encoded copy and used to determine if the resident portion is installed in memory. What this means to you is that if Ultra-Safe is installed and the computer is re-booted (a hardware reset not power off) the contents of much of memory may remain the same and thus Ultra-Safe if re-run may believe itself already installed. If this is the case, it will try to remove itself from memory -- which may cause another crash. Worst, Ultra-Safe may inadvertently left uninstalled. The moral of the story is -- ALWAYS DE-INSTALL Ultra-Safe. If you turn the machine off, there is no problem as memory is wiped (usually). - Many of you will wish to run Ultra-Safe under some version of BYE (for an RCP/M). It is simplest and best to install Ultra-Safe FIRST and THEN BYE. This is the most effective configuration for a variety of reasons. If you must run BYE first, you will have to configure Ultra-Safe to relocate below BYE. (For information on changing the relocation address see the section on configuration.) 6. Bugs, comments, upgrades and you 6.1. Bug Reporting I certainly hope that this is one section of the manual you will never need to refer to. If you do find a bug in Ultra-Safe note down EXACTLY how it came about, what it was, etc.... The more detailed information you provide the better the chances of my finding and eliminating it. PLEASE take the time to report any bugs you find!!! Note: A bug is something the program does WRONG -- not "well, it should cook dinner for me and read my mail and it doesn't" or some other such. Don't get me wrong, I welcome comments and suggestions. I am very interested in your feedback -- without it I will be unable to improve Ultra-Safe to better meet your needs. Mail bug reports to me with the line Bug Report between my name and street address please. 6.2. Changes you make If you make any changes to Ultra-Safe that you believe upgrade and/or improve its operation, remember that under the terms of the license agreement you may not distribute the upgraded version. If you wish to do so, you must submit the changes to me for my written approval. You may submit changes in several ways -- Mail me printed patch instructions to effect the change; mail me a disk containing the new version as well as detailed info on the changes -- please note the only format I can read without hassle is Osborne 1 Double Density Single Sided; or you can telephone me. I would prefer the first or second options. If I approve the changes I will contact you with further information. Please be sure to include your name and mailing address with all submissions. 7. Registration I have provided this form so that I may get some idea of the audience that I am reaching. Please fill this out and mail it with your contribution to me: Richard Solomon Ultra-Safe Registration 7421 Alafia Ridge Road Riverview, Fl 33569 (813) 677-3703 ----------------------------------------------------------------- Ultra-Safe Registration Form Name: Street Address: City/State/Zip: Amount of contribution: Type of computer: Disk format: Please describe how and with what other programs (e.g. under BYE) you are using Ultra-Safe. Is this a commercial, business, or government registration? Comments: Thank you for registering, Richard Solomon