Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!uwm.edu!uakari.primate.wisc.edu!ginosko!usc!henry.jpl.nasa.gov!elroy.jpl.nasa.gov!cit-vax!tybalt.caltech.edu!toddpw From: toddpw@tybalt.caltech.edu (Todd P. Whitesel) Newsgroups: comp.arch Subject: Re: Self-modifying code Message-ID: <12288@cit-vax.Caltech.Edu> Date: 18 Oct 89 21:49:20 GMT References: <480@gp.govt.nz> <6481@pt.cs.cmu.edu> <9175@etana.tut.fi> <1619@atanasoff.cs.iastate.edu> <672@sce.carleton.ca> <218@dg.dg.com> Sender: news@cit-vax.Caltech.Edu Reply-To: toddpw@tybalt.caltech.edu.UUCP (Todd P. Whitesel) Organization: California Institute of Technology Lines: 27 This isn't a me too, but it is an early and (was) a widespread piece of code. The original Apple // DOS 3.3 (and its predecessors) came on a "DOS System Master" diskette with a bunch of nifty utilities and demos. When you booted a "Master" diskette (you could make one with a utility on the System Master disk) it would load in from $1D00-3FFF (i.e. 16K) and figure out how much memory there was. Then it would copy itself up to the top of RAM, via a relocator that took about 1/2K on the disk (I don't know exactly how long it was). If you used the INIT command to format a disk, it would be a "Slave" diskette because the bootable DOS image was already relocated (INIT saved a copy of the DOS in to disk when it was finished). one pirating technique was to remove the top row of DRAMs and boot a master, forcing it to load in 32K. then you INITed a disk with that DOS. after replacing the DRAMs you booted your favorite 48K copy-protected game (which almost always used a heavily-modified copy of DOS) and somehow got it to reboot the 32K slave disk. the slave thinks you only have 32K so it doesn't overwrite the copy-protected dos above it in memory, and you could examine the patched DOS at your leisure or even save it's routines to disk. (we had programs which used the copy-protected image in 48K and internal "standard routines" to copy a protected disk's files onto a normal disk, this was called "DeMuffin" which was a pun on the 13-to-16-sector converted on the system master called Muffin.) ain't nostalgia great? Todd Whitesel toddpw @ tybalt.caltech.edu