[comp.os.misc] Fooling IBM PC disk device

gram@uctcs.uucp (Graham Wheeler) (10/23/90)

A friend of mine has written a computer game, and he would like to try
to sell it. He wants some form of simple copy protection (just to prevent
the basic DOS commands from copying the disk). I said I would try to do
this for him.

My approach has been to try to either:

i) Format a 41st track on a 40 track diskette
ii) Format one track with 4 1024-byte sectors

Obviously in each case I would want to be able to read and write a signature
sector.

Anyway, I've failed. I've tried changing the drive parameter table, and the
disk media info on track 0, and then using the BIOS format-track service
to do the job. I haven't had any joy. In the case of 1024-byte sectors, I
don't get an error when I use the format service, but read/write services
give me a bad address mark. The extra track just fails (except on high-density
drives, but that's no good). I am using the interrupt 13h services, but thru
int 40h (as DOS alters the 13h vector, but the 40h vector seems right - I
checked by running my BIOS through Sourcer). Has anyone tried to do this,
and have any ideas? The original idea came from Peter Norton's Programmer's
Guide to the IBM PC, which states that these are common techniques for copy
protection. He hinted that it was a straightforward task, but it ain't.
In fact, I'm about to give up - this is my last resort (I could go and write
a low-level disk device driver, but hell, I'm just doing this as a favour -
I've spent too much time on this already...)


Graham Wheeler		      |	"Don't bother me,
Data Network Architectures Lab|		I'm reading a `Crisis'!"
Dept. of Computer Science     | Internet: <gram.uctcs@f4.n494.z5.fidonet.org>
University of Cape Town       |     BANG: <...uunet!ddsw1!olsa99!uctcs!gram>

slsw2@cc.usu.edu (10/28/90)

In article <858@ucthpx.UUCP>, gram@uctcs.uucp (Graham Wheeler) writes:
> A friend of mine has written a computer game, and he would like to try
> to sell it. He wants some form of simple copy protection (just to prevent
> the basic DOS commands from copying the disk). I said I would try to do
> this for him.
> 
> My approach has been to try to either:
> 
> i) Format a 41st track on a 40 track diskette
> ii) Format one track with 4 1024-byte sectors

Much as I hate to be giving advice on implementing copy protection, there's
a simpler way that doesn't require mucking about with the driver parameter
tables or assuming that every drive out there can access a 41st track.

You give the BIOS a list of Cylinder, Head, Sector, and Size bytes when you
format a track. Simply set one of the Sector numbers to 255 on an otherwise
normal track.
-- 
===============================================================================
Roger Ivie

35 S 300 W
Logan, Ut.  84321
(801) 752-8633
===============================================================================