___________________________________________________________________ THE ZAPPER Volume 1, Number 1 For Registered Users Of FreeSoft Products ___________________________________________________________________ Copy Protecting Diskettes ------------------------- The Ultra-Format program has the capability to format diskettes that cannot be copied by DOS's DISKCOPY utility. This article will explain how to use the Ultra-Format program to produce copy-protected diskettes. The whole idea behind producing copy-protected diskettes is to know exactly what DISKCOPY can and can't duplicate. Specifically, DISKCOPY looks for and copies only the following: 1) Side 0 and Side 1 2) Tracks 0 to 39 3) Sectors 1 to 8 (512 bytes each). Knowing this, it is easy to confuse DISKCOPY by formatting a diskette outside of these "normal" limits. Although we certainly can't format more than two or less than one diskette sides, there are a number of other approaches we can take. All disk drives we have used, for instance, have been able to format 1 or 2 more tracks than the manufacturer specifies. On your IBM-PC, you could actually format tracks 40 and 41 if you wanted to. Since DISKCOPY does not look for these tracks during a backup, (and, by the way, neither do many "pirate" backup programs), any copies made will not contain the information in these tracks. Although, due to the way DOS handles free disk space, the extra tracks can't be used for programs or files, you can use the sectors in these tracks to contain special passwords. Use the FORMAT STANDARD TRACK option in Ultra-Format to format a track 40 on a scratch diskette. Then, using Ultra-Zap, go in with the DISPLAY/MODIFY DISK SECTOR function to insert a secret password into one of that track's sectors. If your program has the ability to read a raw disk sector, this password can be checked for validity. We will discuss this "read a sector" function in more detail later. Another good way to fool DISKCOPY is to format a standard track of 8 sectors of 512 bytes each, but numbered weirdly (Sectors 32, 34, 5, 93, 87, 2, 14, and 201, for instance). Again, a password can be inserted and later verified in one of these sectors. Remember that DISKCOPY expects the sectors to be numbered consecutively from 1 to 8 and won't copy any others. Finally, you can also format a track containing sectors of a different length than 512 btyes. The disk controller circuit in your IBM-PC has the ability to format sectors of either 128, 256, 512, or 1024 bytes each. You can forget about formatting a track of ten 1024 byte sectors, though - there just isn't enough room on a track. A good rule of thumb is to format sectors in relation to their size. That is, four 1024 byte sectors per track, eight 512 byte sectors per track, sixteen 256 byte sectors per track, or thirty two 128 byte sectors per track. All of these combinations give the same number of available bytes for data. 2) When using sectors of other than 512 byte lengths, there is another matter to consider. Several bytes in the Disk Parameter Table will have to be fiddled with in order to format a track correctly. If you don't adjust these values, the resulting track will contain CRC errors. CRC (cyclic redundency check) is just a checksum that is used by the disk controller circuit to confirm that data is being read properly. Of course, you could purposefully format a track with CRC errors, try to read a sector, and verify that it is a non-pirated copy when it returns a CRC error code. To do this, just format a track using the FORMAT NON-STANDARD TRACK option in Ultra-Format. When specifying sectors, go ahead and specify the first 7 sectors as would be found in a standard track (logical sector numbers 1 through 7 with a length value of 2). On the eight sector, specify a length value of 3 (meaning 256 bytes). When sector 8 is later read (assuming the Disk Parameter Table bytes/sector value is changed to value 3), you should get a CRC error. Don't forget, when you later want to read odd-sized sectors, you will have to change the bytes per sector value in the Disk Parameter Table to reflect the sector's size. Don't forget to restore this byte back to it's original value before doing other disk I/O or exiting your program. Here are the bytes in the Disk Parameter Table that will need to be modified before formatting oddly-sized (not 512 bytes) sectors: 1) Byte #5 (Highest X-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-X