Demon

One of the first things I did when I started in DISMS was to give them my Demon.

Let me explain.

8086 assembly example.jpg8086 assembly example.jpg

Back in the mid-80s the hot program, or “killer app”, the application that convinced a lot of businesses and people that they needed to jump onto the personal computer bandwagon, was Lotus 1-2-3. (“Lotus” was the name of the company and “1-2-3” was the name of the product, but as “1-2-3” was initially their only product, almost everybody referred to it as just “Lotus”.)

Lotus 1-2-3 was a spreadsheet program, a genre that had been invented by Visicalc on the Apple ][, but it could also do charts and some rudimentary database functions. Everybody wanted it.

And that was the problem. In those days software companies charged an arm and a leg for their software; I forget the exact price that Lotus charged, but I know it was well north of a hundred bucks. And this was well before the concept of bundling software with the purchase of the PC had become a thing.

So in order to prevent piracy, software companies routinely punished their legitimate customers by placing copy protection of one sort or another on their software. In the case of Lotus 1-2-3 the copy protection took the form of requiring the original factory floppy installation disk being inserted in drive A: (remember floppy disks?). So even if your PC had one of those new-fangled 10 megabyte hard disks installed (remember what a boon those were when they first came out?), you still had to keep the original installation disk in drive A: or the software would refuse to start.

This was a nuisance at the very least.

Now in those days I used to read a lot of computer magazines, including one called simply Byte, which carried a monthly column by science fiction writer Jerry Pournelle. In one of his columns he outlined a method whereby someone might be able to defeat one of those copy protection schemes. He called his method a demon, and said the demon would just sit patiently waiting for whatever it was that the copy protection scheme was looking for and then supply it.

Sounded simple enough.

So while I was still in C&T, I took a copy of Lotus 1-2-3 home one evening and, probably using the DOS program Debug, I stepped through the code one line of assembly language at a time. This was something I enjoyed doing because I liked working with assembly language.

It didn’t take long to figure out what was going on. Very early on (meaning several hundred assembly language lines into the program), Lotus 1-2-3 was bypassing DOS and going directly to the PC’s BIOS (Basic Input Output System) to access a specific sector on the A: drive. If, and only if, the BIOS returned a certain error code, the program would proceed; if it did not get that error code, it would exit.

In other words the copy protection scheme relied on there being a damaged sector (that is, damaged in a particular way so as to return a specific error code) on the installation disk.

Once I knew that, fashioning a little program, or demon, to defeat the copy protection was easy. I wrote it in 8088 assembly language, as the 8088 was the chip then in use in IBM PCs and their clones.

So I wrote my first TSR, or Terminate and Stay Resident program (remember those? There used to be a big market for them in the days of DOS. Sidekick, Superkey, to name only a couple.)

Not being very imaginative, I called my program “Demon”.

When it was run it did the following: first it checked to make sure another copy of it wasn’t already running (that was an early bug that I had to squash), then it replaced the built-in BIOS disk interrupt handler (or INT 13H, for the technically minded among you) with its own handler, then it called the DOS API to terminate but stay resident. That’s all it did. It was just a few hundred bytes long.

Of course, the meat of it was in the disk handler routine that it substituted for the system’s, but even that was simple. All it did was check every call to the disk handler to see if it was for that particular sector in the A: drive. If it wasn’t, it just passed the request back on to the built-in handler, but if it was, it returned the error code that Lotus 1-2-3 was expecting.

And it worked! Now Lotus 1-2-3 would run without having that blasted disk in the A: drive.

I never did anything with it while I was in C&T, but as soon as I was in DISMS in Subsistence, I mentioned it to my boss, Allan Rosen. He liked it, because Subsistence had just gotten a bunch of PCs with hard disks, all with Lotus 1-2-3, but he wanted to check with Legal first.

That didn’t take long. We received a nice IOM (remember, our version of memos) from the Legal department saying essentially, of course, we were free to use our software to facilitate the use of Lotus’s software. So my demon was installed on all the PCs, and no one had to worry about inserting that silly installation disk in the floppy drive.

Later that year, I went to Alameda, CA, where we had a small base of people, in order to give a week’s worth of training on the PCs they had just received. I took my demon with me, but to my dismay, it didn’t work! It turned out that their copies of Lotus 1-2-3 relied on a slightly different sector and error code. How crafty of Lotus! But it was easy enough to fix. When I got back to Philadelphia, I reassembled my demon with the new scheme and mailed them a floppy disk (the Internet existed in those days, but we were not yet on it).

Leave a Reply