Classic Computer Magazine Archive COMPUTE! ISSUE 64 / SEPTEMBER 1985 / PAGE 10

 
Readers Feedback

 The Editors and Readers of COMPUTE!



Simpler IBM Unprotection
On CompuServe's PC-SIG disk #184 you can find a simpler procedure for unlocking protected IBM BASIC programs (see "Unlocking IBM BASIC Programs" by Peter Nicholson, COMPUTE!, June 1985). Written by Todd Pollock, this method uses BSAVE and BLOAD commands to restore the portion of RAM that is disabled by a protected program. First, type in any two- or three-line BASIC program such as this:

10 PRINT "HELLO"
20 GOTO 10
30 END

    Save the program by entering this line: BSAVE "UNPRO.CIM",&H400 ,&H7F. To unprotect a protected program, load the protected program into memory, then enter this line: BLOAD "UNPRO.CIM". I suspect that Nicholson's procedure may be required on some compatibles, since Pollock's does not simply query a standard location for standard information. A quick test on my friend's Sperry PC-compatible showed that it disables the BLOAD command while a protected program is in memory. However, Pollock's procedure does have the advantage of requiring much less typing.
Guy R. Winters

We tested this method on the PC and PCjr and found that you need to BSAVE only one byte of memory. Type in any one-line program such as 10 END. Then enter this command: BSAVE"UN.PRO",1124,1. The BSAVE command saves one byte of memory at location 1124 (&H464 hexadecimal). Now load a protected program (one that was saved with SAVE "filename",P), and load the one-byte file with BLOAD"UN.PRO". On the PC/PCjr, the protection evaporates and you can list, edit, or save the program as usual. Also, PEEK and POKE are reenabied in direct mode.
    The PC and PCjr use location 1124 as a flag: It contains 0 when an unprotectea program is in memory and 254 after you load a protected program. The BSAVE shown above saves location 1124 at a time when we know the flag is set to 0. The BLOAD simply loads the 0 back into location 1124, resetting the flag to signify no protection. As you found by testing your friend's Sperry, "compatibility" is a relative concept. Evidently one of the Sperry designers knew or anticipated this trick, and prevented it by disabling BLOAD.
    Although program protection disables POKE and PEEK in immediate mode, both commands are still legal in program mode (at least on the PC/PCjr). Thus, a protected program can unprotect itself while running (for instance, if you enter a password) and an unprotected program can protect itself as well. The PCs we tested put a 254 in location 1124 to indicate protection, but in fact any nonzero value seems to set the protection flag: Editing, listing, PEEKing, and POKEing are ruled out, and you can resave the program only in protected format.