Jump to content

Recommended Posts

One of the most interesting copy protection techniques I came across was on the Atari Microsoft Basic disk.  You booted this disk and it automatically loaded into Microsoft Basic.  If you then typed a DOS command, you were taken to the usual DOS menu where you could see an AUTORUN.SYS file.  But if you copied the AUTORUN.SYS file to another disk, it wouldn't load into Microsoft Basic.  It started to load but then simply performed a system reset.

 

It turns out that the clever programmers at Atari created a hidden directory on the disk.  Normally, the directory is found on sector $169 and runs for 8 sectors.  On the Microsoft Basic disk, there is another directory at $179.  This directory points to the real AUTORUN.SYS file which loads when the disk is booted.  At address $1082 in the Disk Operating System there is a byte which points to the directory sector.  The value of this byte is usually $69.  But in the Microsoft Basic version, the byte is $79 which allows DOS to use the hidden directory and load the proper AUTORUN.SYS.

 

As the AUTORUN.SYS loads, one of the final things it does it to place a $69 back into address $1082.  Now DOS is pointing to its normal directory which points to a bogus version of AUTORUN.SYS.

 

To copy the correct AUTORUN.SYS to another disk, you could write a basic program which poked $1082 with $79.  Then open AUTORUN.SYS for input.  Poke $1082 with $69 to reset DOS back to its normal value, and open an output file on another disk.  Now simply read and write bytes until end of file.  Poke $1082 with $79, issue a close on the first file, poke $1082 with $69 and issue a close for file 2 and voila!, you have a copy of Microsoft Basic that loads properly.

Copy Microsoft Basic.atr

  • Like 5

Share this post


Link to post
Share on other sites

I'm not sure that's a copy protection...  Any raw sector copier should have no problem with that, since you mentioned no bad sectors.  It kind of sounds like they were providing a way to have your own AUTORUN.SYS file for your own use.

 

I haven't looked into it at all, or downloaded it, but that's how it appears to me.

 

  • Like 1

Share this post


Link to post
Share on other sites

A normal Dos duplicate would probably work also as long as the VTOC bitmap indicated the sectors in use were correct.

Share this post


Link to post
Share on other sites

Wow, this triggered a memory! In 1982 I wrote a program to defeat that protection. My law school buddy and I advertised it in magazines and sold 6 copies!

 

Here are the source and instructions. No comments I'm afraid, and I haven't gone through it to see if it's similar to the OP's method.

 

MANUAL.SRCMICRODUP.SRC

  • Like 8

Share this post


Link to post
Share on other sites

Given that the entire point of BASIC is to write your own programs and distribute them, I've never heard of a copy protected BASIC.  I found the "Atari Microsoft BASIC Handbook" PDF online (it was on Wayback) and it TELLS you how to copy it so you can put your original disk away.

... You should now remove the ATARI Microsoft BASIC diskette and hereafter use the 
new program storage diskette(s) you have created. With a program diskette you can 
save and load the programs you write, and return to BASIC...

They seem to have done it this way as a convenience so that you can have a disk to autoboots into BASIC.

 

I think some serious misunderstandings are going on here...

  • Like 1

Share this post


Link to post
Share on other sites

 

I think we may be a little unfair to the OP, if you start hiding directories then that says it's a form of protection, maybe only to make sure you used a copy of that disk and only that disk but why else make it look for an alternative directory.

 

Lets not forget that many people using those disks did not have a manual and therefore didn't know they asked you TO copy the disk using conventional methods and would have thought it might be protected. Some would have noticed there was an autorun.sys that suggested the BASIC was hidden in that, so thought about just copying that.

  • Like 1

Share this post


Link to post
Share on other sites
8 hours ago, glurk said:

I think some serious misunderstandings are going on here.

Yes, you are misunderstanding the manual. Making a program disk is not making a backup disk of BASIC.

Share this post


Link to post
Share on other sites
Posted (edited)

Yes indeed, rereading it shows that it's merely to save your work on so you don't mess with the original disk, I suspect you still need the main disk with that novelty protection on..

 

@glurk I think you have been stressed with the 2600 stuff :)

Edited by Mclaneinc

Share this post


Link to post
Share on other sites
1 hour ago, ClausB said:

Yes, you are misunderstanding the manual. Making a program disk is not making a backup disk of BASIC.

Exactly.

 

The original MS BASIC disk IS copy protected and checks for missing sectors (364 and 380). And you need the original disk every time you boot your Atari.

 

The part of the manual cited by @glurk is about a work disk which you can use to 1. save your programs to and 2. exit to DOS/DUP and get right back into BASIC with everything (i.e. your current program) still in place using MEM.SAV and RESET. This work disk can be inserted into the drive AFTER booting the original disk.

 

I tried to run the second (non-hidden) AUTORUN.SYS and did get no useful results. It also tries to read a missing sector (720 twice) and fails if it is good. But it also "fails back into DUP" at the end of loading if the sector was bad.

The code is basically identical but has a few bytes removed in some places. Therefore most 16-bit addresses differ by three bytes between both versions.

At first I thought of some sort of runtime (which does not allow to edit programs) but this is neither mentioned in the manual nor does it make sense with the above mentioned behaviour to always exit.

Share this post


Link to post
Share on other sites

Well, I actually learned programming by breaking copy protections... And this doesn't sound like one to me with no bad sectors, or checks, etc.  What happens if you just copy the disk using DOS?  I don't have the ATR or the time to mess with it, plus I hate BASIC, LOL...

 

It's just so weird being that the intention of BASIC is writing programs, sharing and exchanging them, etc.  There's nothing I saw in the manual about making a backup, or about NOT making a backup.  No mention of copy protection.  And I've never heard of a copy-protected BASIC, I really have not.  MAYBE Visual BASIC, years later, but I don't think that was either...

 

And certainly any sector copier would work.  It's a really odd one, that's all I can say!

 

EDIT: Claus B DjayBee clarified this as I was posting, OK, it does have bad sectors?

Edited by glurk

Share this post


Link to post
Share on other sites
22 hours ago, glurk said:

Given that the entire point of BASIC is to write your own programs and distribute them, I've never heard of a copy protected BASIC.

Don't forget Gates' open letter to discourage people from copying his Basic without paying.
See https://commons.wikimedia.org/wiki/File:Bill_Gates_Letter_to_Hobbyists.jpg
Your program written in Basic is free to whoever you want to give it to.
But the Basic interpreter itself is under copyright.
Atari Basic is also technically under copyright - but since the only people who can run it have already paid for it when they bought the machine, therefore this isn't a practical problem.
Remember that MS Basic is a third party product.

Share this post


Link to post
Share on other sites

I'm aware of Gates' "Open Letter" but this is still the first time I've heard of any BASIC with copy protection.  And the OP (which started my responses) made no mention at all of bad sectors, etc.  Hidden directories and such were explained in Compute, Analog, Antic, and other magazines of the day, and were just simple things, not really "copy protection."  So there was some misunderstanding there....

 

(Some BASICs were on cartridge, which is arguably a copy protection itself, I suppose...)

 

I grew up with TRS-80, Apple ][, C64, Atari, etc, etc. and BASIC was always built-in or free.  So it's no wonder that MS Atari BASIC never caught on.  Who would want to write software that requires another purchased software (language) just to run it.  Just a really bad idea, IMO.

 

Of course, being 'early days' I guess people were just trying things with no real road map of how it would all shake out. 

Share this post


Link to post
Share on other sites

Agreed that there was no real road map back in the day.
Every version of Basic was quite different to every other version (even MS Basic had differences for each platform, mainly around file handling, graphics, audio).
It was more like throwing spaghetti at the wall and seeing what sticks.

 

Perhaps MS might have done better if they allowed your programs to be written to a new disk with a cut-down interpreter with no editor and no save command.
That way you could give/sell your Basic program to others and they could run it but still need to pay MS if they wanted to develop programs of their own.
Kind of how today we would do that by providing runtime libraries.
But, as you said, there was no real road map.

Share this post


Link to post
Share on other sites

Yes the original Microsoft Basic disk had bad sectors so you could not copy the disk.  The manual says to create a new disk and then copy all the files from the original disk using D2:*.*,D1:*.* as the source and destination.  When you execute this command, Atari DOS will NOT copy either the DOS files or the AUTORUN.SYS files, so the only files that will be copied to your data disk will be the data files on the original disk.  You CAN copy the AUTORUN.SYS file to your new disk by explicitly referencing it but then you will be copying the bogus AUTORUN.SYS and so it will not run.

 

And that is why the original disk is in fact copy protected.  Atari did everything possible to keep folks from getting that AUTORUN.SYS file copied.

 

 

Share this post


Link to post
Share on other sites

This type of "copy protection" was also used by "The Eidolon", which stores its caves and graphics in a regular Dos 2 file structure, except that the directory starts in another sector. It is not too hard to decode these data files, or create your own caves if you like to.

 

Share this post


Link to post
Share on other sites

Very cool.  I was able to assemble the Microdup program and create a boot disk from it.  I ran it against the Microsoft Basic disk and it worked!!!  Very cool.

  • Like 2

Share this post


Link to post
Share on other sites
5 hours ago, AGiambra said:

it worked

Thanks for reviving it! I wasn't going to because, frankly, I've had my fill of Micros#!t over the last 40 years.

Edited by ClausB
  • Haha 2

Share this post


Link to post
Share on other sites

ClausB, by the way, how does your program work.  I started poring through the assembler code but it's a whole lot easier if you just explain it.  It looks like you used a different method than I did.

Share this post


Link to post
Share on other sites

I don't remember. I would have to pore through it. I was hoping you would do that.

  • Haha 1

Share this post


Link to post
Share on other sites

I've dug out my DOS manual and started poring.

 

Edit: halfway thru, didn't need DOS manual, it's all sector I/O.

 

Edit: It reads the boot sector to find the DOS file. Then it reads the DOS file to find the hidden directory. Then it uses that to read the AUTORUN file. Then it scans that file and changes it (haven't pored through all that yet) and writes it to a new disk with a normal directory.

 

Edit: I think it's figured out. It scans the file for init address segments (2E2-2E3) and kills all but the first and last. That must avoid the bad sector reads.

Edited by ClausB
  • Like 1

Share this post


Link to post
Share on other sites

Commented source:

 

MICRODUP.SRC

 

See how it gets everything it needs from the original disk and makes few assumptions. That's how we avoided copyright infringement. We did not distribute any portion of their code. Still they could have defeated it easily in the next version, which is why we offered a refund as long as the customer lent us the copy for examination. Then we could break that version.

 

But no one requested a refund and it died quickly. The small proceeds went to my partner who paid for advertising and DBA fees. I recall he took a loss. I also lost time and effort (even moreso after these posts).

 

I have wondered whether MicroDup itself was copied and widely distributed in the day. Does anyone here recall it?

Edited by ClausB
  • Like 1

Share this post


Link to post
Share on other sites

It made the BBS file area rounds. Most didn't even know what it was for as they skipped the descriptions section and just collected.

  • Like 1

Share this post


Link to post
Share on other sites
On 1/9/2022 at 4:17 PM, DjayBee said:

I tried to run the second (non-hidden) AUTORUN.SYS and did get no useful results. It also tries to read a missing sector (720 twice) and fails if it is good. But it also "fails back into DUP" at the end of loading if the sector was bad.

The code is basically identical but has a few bytes removed in some places. Therefore most 16-bit addresses differ by three bytes between both versions.

At first I thought of some sort of runtime (which does not allow to edit programs) but this is neither mentioned in the manual nor does it make sense with the above mentioned behaviour to always exit.

I just had to go down that rabbit hole 🐇 and found some red herring 🐟.
😬

 

With a little patching, the second AUTORUN.SYS - the one which shows up in the standard directory - can be run.

 

Check this screenshot 🤣.
The disk image is based on a8preservation's verified(!) dump (and no text was modified by me!):

 

grafik.png.0c760ff3ded3cffb0d5221a30cd5b381.png

 

Since "Microsort BASIK" printed "HELLO" and the correct result for 5*3, it seems to run, but I did not dig deeper.

 

What did I find and do?

  • It uses the same code to check for bad sectors as the real program.
  • First it wants sector 720 bad twice and then sector 361.
  • Sector 361 is not bad on the original disk and the reason why it aborts loading (in the first place).
  • After ignoring this fault, it continues loading but fails with an INITAD of $E474.
  • As I wrote in my first post, the program data of the two files differs by 1-3 bytes in memory.
    I checked the real program's INITAD and found it to be $6851. A quick check of the loaded code verified that $684E was the same code.
  • Changed INITAD to $684E and got the above output.

If somebody else wants to play around with this, here's my crack of it.

Boot it, exit to DOS and load AUTORUN.SYS manually.

Microsoft BASIC (1981)(Atari)(US)[!][cr CSS]v2.atr

 

Have fun!

Edited by DjayBee
  • Like 3

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...