HOME › Forums › Space Quest Series › Space Quest EGA Original Disk › Reply To: Space Quest EGA Original Disk
(re: re: Space Quest EGA Original Disk – How it works)
Brandon asked how the copy-protection is programmed. Here it is:
The copy protection consists of three files:
AGI: The actual program file. This file is encrypted to prevent you from renaming it to AGI.EXE or something like that and from evading the copy-protection. After it is decrypted, it is a normal .exe format file.
SIERRA.COM: The “Loader”. It loads AGI into memory, asks for the original disk, reads and executes CPC.COM to obtain the decryption key, then decrypts and runs AGI.
CPC.COM: A hidden file on the original disk. Called by SIERRA.COM, checks for the presence of the copy-protected track (side 0, track 6), reads the decryption key and passes it on to SIERRA.COM.
So, whether the game starts up or not with your backup disk depends on whether CPC.COM recognizes the disk as an original disk or not. CPC.COM looks for the following things on side 0, track 6:
1) sectors 2 thru 8 must have a non-standard sector size of 1024 bytes per sector (a normal DOS sector has 512 bytes).
2) sector 1 must have a non-standard sector size of 8192 bytes per sector. This sector contains the decryption key.
3) sector 1 *must* have a CRC error. (BTW: This is what prevents the copy-protection from working under Windows 98, because Win98’s Int13 handler returns incorrect error codes (0Ah instead of 10h for CRC error))
4) all sectors on track 6 must overlap, i.e. the data for sector 2 also contains the beginning of sector 3, and so on. The data from sector 1 contains *all* the following sectors.
5) The checksum of the first 128 bytes from sector 1 must match a certain value (1Ch or something like that).
1), 2) and 5) can be reproduced with an advanced diskcopy program, like copyiipc or Teledisk. 3) and 4) can NOT be reproduced, because the PC’s floppy controller doesn’t allow you to write “bad” sectors (with CRC errors) on purpose, and it’s doesn’t allow you to write overlapping sectors (it wouldn’t make any sense, except of course for copy-protection purposes).