Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 UW 5/3/83; site uw-beaver Path: utzoo!watmath!clyde!burl!ulysses!mhuxj!houxm!vax135!cornell!uw-beaver!info-mac From: info-mac@uw-beaver (info-mac) Newsgroups: fa.info-mac Subject: MacPascal Copy Protection Message-ID: <1992@uw-beaver> Date: Sun, 28-Oct-84 00:41:05 EDT Article-I.D.: uw-beave.1992 Posted: Sun Oct 28 00:41:05 1984 Date-Received: Tue, 23-Oct-84 00:44:11 EDT Sender: daemon@uw-beave Organization: U of Washington Computer Science Lines: 62 From: Thomas.Newton@cmu-cs-spice.arpa Well, it looks like copy protection is starting to turn nasty. . . I picked up a copy of MacPascal the other day at a local dealer, and when I got home I started working on the problem of removing the copy protection. Please send anti-piracy flames to /dev/null -- I want to remove the protection because it is generally inconvenient to use protected programs, and U.S. copyright laws do give me the right to make copies of the program for my own use. The most obvious problem was that the file "Macintosh Pascal" had been copy- protected using the "Examine File" method. No problem, I thought, I'll just make a copy of the disk using "Disk Utility" and then hack on the copy until I have it unprotected. Well, this didn't work. Disk Utility reported some type of error shortly after it began to copy the disk. I thought that perhaps Apple had modified Disk Utility so that it couldn't copy disks protected with "Examine File," so I decided to try other methods. (This initial guess turned out to be wrong). I looked at "Macintosh Pascal" with FEdit and noted that it had a resource fork and no data fork (not too surprising). So I got out my MS-BASIC and my copy of BinHex 3.0 and started to convert Pascal into .HEX form (note: this is only feasible if you have two drives). Unfortunately, BinHex thought that the file was only about 50K long... So I looked at BinHex and made a minor fix to allow it to work with files longer than 64K. I then read a couple of paperback books while BinHex ground and ground...after BinHex converted Pascal to .HEX form I had it convert the .HEX form into an application. The resulting file did have the same size as the original, and after I set the bundle bit with FEdit, it had the same icon. I tried to launch it and it crashed. "So," I thought, "maybe it needs some of the other files on the Pascal disk." Fortunately they were all copyable and I soon had a disk that looked just like the original. When I rebooted the system and attempted to launch Pascal, it died in the same place. I then noted that my diskette had about 20K more free space than the Pascal diskette. Sure enough, the Pascal disk had three invisible files. I made these visible and copied them over to my scratch diskette. Now when I launch Pascal, it puts up the menu bar and the three windows for the program, text output, and drawing. It then crashes with a system error whose ID is 5. I even tried changing the file's creation and modification dates, but it still dies in the same manner. Last night I tried the experiment of copy-protecting a throwaway file using Examine File and copying the disk using Disk Utility. Disk Utility was able to copy the disk -- which means there is something strange about that Pascal disk other than the Examine File stuff. So, the Pascal disk appears to be protected using three methods: 1) EXAMINE FILE copy protection on "Macintosh Pascal" 2) The use of three invisible files which are necessary for the proper operation of same. 3) Some sort of strange formatting/bad sector nonsense that is checked by Pascal at startup time. It is fairly easy to get around (1) and (2). The usual solution to (3) is to NOP the offending code (possibly having to add extra code to any side effects). Does anyone know what patches need to be made to Pascal (and possibly to the three invisible files) to get around (3)? -- tdn