===
2. The "Special Unprotect File" approach:
Article 56445 of comp.sys.ibm.pc:
Newsgroups: comp.sys.ibm.pc
Subject: Need help with encrypted GW-BASIC files...
Date: 30 May 90 17:55:04 GMT
Quote:
>Is there a utility which will unprotect the ",p" saved code?
Easy! Use DEBUG to make a two-byte file:
1. Cut out the lines below, save them to a file named MAGIC.RAW
2. Use these lines as input to DEBUG, thus:
C:> DEBUG < magic.raw
(This procedure automatically creates MAGIC.BAS).
------------------------- CUT HERE --------------------------------------
e 0100
ff 1a
r cx
2
n magic.bas
w
q
------------------------- END --------------------------------------------
This will create a file with a length of 2, the contents 0FFH 01AH. The
file can be created from GWBASIC also, but some versions don't handle the
length properly. It MUST be two bytes.
Now load the program in question. Then load MAGIC right on top of it.
LOAD"PROGRAM"
ok
LOAD"MAGIC"
ok
The program should now be unprotected.
-What's happening-
BASIC stores a byte in the first position of its program files to identify
the file type. For normal programs this byte is 0FFH. For BSAVEd files I
think it's 0FDH. For protected files the byte is 0FEH. Protected files are
also stored in a different format, so just changing the byte with a file
editor doesn't work.
When you load the file, BASIC translates it into a meaningful format, but
retains that 0FEH byte as a flag to prevent you from listing it. When you
load MAGIC, you change that first byte, but nothing else. Now when you
LIST, BASIC checks the type byte and sees that it's OK to list the program.
As always, keep a copy of the original in a safe place until you _know_ the
new stuff works right.
DISCLAIMER: He's lying.
(MAGIC.RAW by Al Stangenberger, Forestry, U.C. Berkeley Sept. 1994)
=============================================================================
3. Modify the GWBASIC interpreter (careful!)
Article 1341 of comp.lang.basic.misc:
Newsgroups: comp.lang.basic.misc
Subject: Re: GW Basic format, Please Help!!!
Organization: The National Capital FreeNet
Date: Mon, 1 Aug 1994 02:30:37 GMT
Quote:
>> I have an old Basic file (probably GW Basic), which is not
>>in its Text file source code, it in some kind of binary format.
>> Does anyone know how to convert this file into a EXE format?
>>or a Text file format? What Compiler is needed or what do I have to do?
>Simply read it into GWBASIC using the LOAD command, then
>SAVE "filename",A
> ^^
>Note the ,A there. This saves the program in text format which can be
>read by other programs, editors etc.
>On the other hand, the program may originally have been saved in "protected"
>mode (i.e. ,P was used as the option rather than ,A) in which case things
>are more difficult to undo, but programs are available which do the job
>for those legally entitled to do so. (Protected programs are usually
>saved that way to preserve somebody's copyright interest, as you no doubt
>realise :)
>Cheers, Ian S.
The following was posted on another bbs quite some time ago but sill might
be useful for unlocking a GW-BASIC program which has been saved in
protected mode. I have not tested this so I would suggest making copies
of anything you are working on before attemting this fix.
Packet: BITMAIL
Date: 20-12-93 (01:40) Number: 121
From: Mark Butler Refer#: 72
To: John Carriere Recvd: NO
Subj: Unprotect Basica? Help Conf: (1) Quik_Bas
---------------------------------------------------------------------------
Once upon a time John Carriere uttered this querie to All:
JC> How the Heck do I unprotect a BASICA File???? HELP!!!!!
I just patched my copy of GWBASIC.EXE v3.23 (the one that came with DOS
v4.01) so that it would always list "protected" files. You can patch it
like this...
Using a hex-editor such as Norton's 'DiskEdit' find
this string ----------> C3 9C A0 AA 05 0A C0 75 02
And change it to------> C3 9C B0 00 90 0A C0 75 02
^^ ^^ ^^
\|/
These three are the changes-------'
Now your copy of GWBASIC.EXE will list so-called "protected" basfiles.
Once it will list them you just need to save the file in ascii like so..
SAVE "MYFILE",A
--
Ottawa, Ontario, CANADA FidoNet: 1:163/215
Voice: (613)731-2120
--
Al Stangenberger Univ. of California at Berkeley
BITNET: FORAGS AT UCBNATUR 145 Mulford Hall # 3114
(510) 642-4424 FAX: (510) 643-5438 Berkeley, CA 94720-3114