BBS: Inland Empire Archive Date: 07-05-92 (19:24) Number: 299 From: MARK BUTLER Refer#: NONE To: MONTE FERGUSON Recvd: NO Subj: Convert Bascia Files to A Conf: (2) Quik_Bas
On 07-01-92 Monte Ferguson wrote to Jeff Taylor...
JT> I need some help locating a program that will convert a program,
JT> written in MS-DOS 3.3 Basica, to an ASCII text file so that it
JT> can be read in Qbasic. A friend of mine showed me his problem
JT> and I could not believe that a file written in Basica was
JT> incrypted in some way.
MF> BASICA can save files in one of three formats:
MF> 1) Binary memory image........<text deleted>..............
MF>
MF> 2) Text file.......<text deleted>..................
MF>
MF> 3) "Protected" binary. This is a method of saving the file so
MF> prying eyes and fingers can't mess with it.
MF> .......<text deleted>..................
Some time ago Tom Hammond posted a a patch for GW-Basic that would
cause it to list any file normally whether it was saved in
"protected" format or not. You are right, the "BLOAD" method doesn't
works on some versions. Tom's says his patch works for version 2.0 of
GW-Basic but I tested this patch out on two later versions of GW-
Basic (v3.22 and v3.23) and found that it worked with them to. I only
wish I'd known about this patch five or six years ago! The following
is an excerpt from Tom's post...
--------------------------8< CUT HERE 8<----------------------------
Unprotecting BASICA (or GW Basic) files is a fairly simple task, if
you have the right tools and know what to look for. The following
sequence is the procedure for creating a copy of BASICA, version 2.0,
that will NOT test the protect flag when you ask for a LIST, LLIST,
SAVE, etc. This procedure is possible as the BasicA LOAD or implied
(command line) program load both convert the program to BasicA's
normal tokenized internal format and just relies on an internal flag
to disallow those commands. This patch changes that flag test to
always return "allowed".
In the following we patch the main version of BASICA (in this
version, three programs make up the BASIC set, they are named
BASIC.COM, BASICA.COM and BASICA.EXE. The first two are just loaders
for the latter, which we'll patch).
Note, finally, that the search pattern I used is for the OR AL,AL JMP
+2 POPF RET and JMP opcodes, which makes the search version
independent (where the exact addresses may vary).
The comments following the "*" character have been added as an
explanation.
A> copy basica.exe b.xxx * Make an editable copy to
patch
1 File(s) copied * (DEBUG won't edit .EXE
files).
A> DEBUG b.xxx * Invoke DEBUG b.XXX
-s cs:0 ffff 0a c0 75 02 9d c3 e9 * Search for the test, NO
addresses.
786B:A557 * DEBUG only found the right
address.
-u cs:a554 * Now, UNASSEMBLE 3 bytes
BEFORE that.
786B:A554 A00C06 MOV AL,[060C]
786B:A557 0AC0 OR AL,AL
786B:A559 7502 JNZ A55D
786B:A55B 9D POPF
786B:A55C C3 RET
786B:A55D E95068 JMP 0DB0
786B:A560 807C2800 CMP Byte Ptr [SI+28],00
786B:A564 7403 JZ A569
* NOTE in the above that the
* address of the first
* instruction may vary slightly
* with the BASICA version.
-a cs:a554 * ASSEMBLE the following patch:
786B:A554 mov al,0 * Put a zero into AL,
786B:A556 nop * NOP for the correct code
length.
786B:A557 * RETURN only to stop ASSEMBLE.
-u cs:a554 * UNASSEMBLE the code to check
it.
786B:A554 B000 MOV AL,00
786B:A556 90 NOP
786B:A557 0AC0 OR AL,AL
786B:A559 7502 JNZ A55D
786B:A55B 9D POPF
786B:A55C C3 RET
786B:A55D E95068 JMP 0DB0
786B:A560 807C2800 CMP Byte Ptr [SI+28],00
-w * Looks good, WRITE it to disk,
Writing FF90 bytes * this may vary slightly on
* yours,
-q * and QUIT the DEBUG.
A> Ren b.xxx b-unprot.exe * REName the file to use it.
That does it. You now have a program named B-UnProt that will allow
you to LOAD a protected file and then LIST, SAVE, edit, etc, it to your
heart's content.
--------------------------8< CUT HERE 8<----------------------------
Well, that's it. Work's like a charm to!
-----------> MHB :-)
... OFFLINE 1.39 * Never insult an alligator until you have crossed the river
--- DB B1073/001271
* Origin: * Bare Bones BBS * (1:105/360)

Books at Amazon:
Back to BASIC: The History, Corruption, and Future of the Language
Hackers: Heroes of the Computer Revolution (including Tiny BASIC)
Go to: The Story of the Math Majors, Bridge Players, Engineers, Chess Wizards, Scientists and Iconoclasts who were the Hero Programmers of the Software Revolution
The Advent of the Algorithm: The Idea that Rules the World
Moths in the Machine: The Power and Perils of Programming
Mastering Visual Basic .NET