Path: utzoo!attcan!uunet!olivea!apple!uokmax!norlin From: norlin@uokmax.ecn.uoknor.edu (Norman Lin) Newsgroups: comp.sys.atari.8bit Subject: Re: Copy protection (was Re: M.U.L.E. Sorrow!) Message-ID: <1991Feb28.221834.16258@uokmax.ecn.uoknor.edu> Date: 28 Feb 91 22:18:34 GMT References: <1991Feb21.000558.15650@dhw68k.cts.com> <39563@cup.portal.com> <1991Feb25.022602.10895@uokmax.ecn.uoknor.edu> <1991Feb25.054200.4817@uokmax. Organization: Engineering Computer Network, University of Oklahoma, Norman, OK Lines: 60 wilmott@utopia.rutgers.edu (Ray Wilmott) writes: >The copy protection started by looking for a flawed sector. >Easy to take out. Then there was the loading and decrypting of a few >sectors (load 'em, EOR each byte with some number and store the >result somewhere, then jump and execute the resulting code). Cute, >and again pretty easy. Then that resulting code used a chained >decryption scheme on a bunch of other sectors (read a byte from disk, >EOR it with some memory location, add something else to it, EOR it >with something else, then store the result in a memory location >based upon some formula, then execute the resulting code). This one >was annoying, but do-able. This chunk of code then did the same sort >of thing, but with a much more complex set of formulas to decrypt >and lots of jumping back and forth between subroutines. What a mess. >I gave up. I have an Atari 800XL, and one major advantage of having an 800XL over a 400 or an 800 is the replacable O.S. One time I loaded in the Translator, thereby giving the old OS with the 4K section $C000-$CFFF free (since the old OS didn't use it). What's great is that now the NMI (non-maskable interrupt) vectors are in RAM, too. So I hooked into the NMI a routine to dump all memory to disk when I pressed a certain key combination. The routine itself was stored in the unused $C000-$CFFF region, known to be safe and free (much safer than, say, page 6!). Then, after doing this, I'd make a call to $E477 to reboot the computer then boot up a piece of software. After it loaded I'd replace it to disk and press the key combination to dump it all to disk. I had to save the PC (pushed onto the stack as with all interrupts) and all registers. What was tricky was how to load the thing back into memory; you had to restore the PC and the stack and all kinds of things like that that could quite easily disrupt the loader program itself. Bottom line is, it worked for some simple non-graphics oriented stuff, but didn't work for any games. Reason? The hardware registers, the strange little region $D000-$DFFF. Many (most?) of these locations are not the same when you write to them as when you read them. (And of course since many commercial graphics-oriented programs do away with system VBIs, shadow registers are useless, too.) Thus, for instance, P/M graphics could be initialized, but by saving the contents of location $D01D I wasn't saving the state of the P/M enable port but rather getting the status of some totally different input port. I never found a solution to this so abandoned this project. As a matter of curiosity *is* there any way to totally save the current state of an Atari, including all the changes that have been made to the hardware registers? Still, though, if you have an 800XL you can hook in some pretty neat NMI's into the O.S. that will let you, for instance, cheat on games. One that I once had constantly stored 0 into HITCLR (forgot the memory address, but that's the location that clears the registering of P/M collisions) unless you pressed a certain key or moved the second joystick or something similar, so that any game that involved P/M graphics would never register any collisions. Useful for getting to the end of some games. Just more ramblings from an old hacker... ---|\-#-/_|-------/|-------,*.----||---Norman Lin, University of Oklahoma---- ---|/-----|------/-|---,"--|---,"-||------norlin@uokmax.ecn.uoknor.edu------- --/|------------/-*'---|/------|--||-----(IP addr: 129.15.[20|22|24].2)------ -|/|\---/_|-----|-----------------||-"I gazed in your eyes, and saw the moon- --\|/-----|----*'-----------------||------------and the skies"---------------