Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I view the source code of a Gwbasic .bas file?

I have an old .bas file that I'm trying to view and running into some problems. Searching online seems to indicate that I should be able to just open it in notepad or simililar, but doing so gives me gibberish, like this:

þ*©¿TÜ…7[/C̸yõ»€¹Ù<Ñ~Æ-$Ì™}³nFuJ,ÖYòÎg)ʇŒ~Š¯DËðïþSnhœJN
‰=É™2+df”c).vX»[šû'Û9¹8%ñx5m#8úV4ÊBº)Eª;Iú¹ó‹|àÆ„72@Ž§i§Ë @îÑ?
í‘ú™ÞMÖæÕjYе‘_¢y<…7i$°Ò.ÃÅR×ÒTÒç_yÄÐ
}+d&jQ *YòÎg)ʇŒ~Š¯DË?úŽ©Ž5\šm€S{ÔÍo—#ìôÔ”ÜÍѱ]ʵ¬0wêÂLª¡öm@Å„Ws雦 X
Ô¶æ¯÷¦É®jÛ ¼§
”n ŸëÆf¿´ó½4ÂäÌ3§Œ®

I know the file is sound, because I can open it in Gwbasic. However, list does not seem to work to view the file either. I also tried to save the file in ascii format from within Gwbasic, but that didn't work either. Both just gave me an "Illegal function call" error:

GW-BASIC 3.22
(C) Copyright Microsoft 1983,1984,1986,1987
60300 Bytes free
Ok
LOAD"Pwrharm
Ok
LIST
Illegal function call
Ok
SAVE "Pwrharm2",A
Illegal function call
Ok
RUN
[Program runs successfully]

Again, the RUN command works just fine. What am I doing wrong?

like image 228
user2320886 Avatar asked Dec 15 '16 15:12

user2320886


1 Answers

You're not doing anything wrong; the file was originally saved in GWBASIC with the ,P option. There is a 'hack' to unprotect it, described at https://groups.google.com/forum/#!topic/comp.os.msdos.misc/PA9sve0eKAk - basically, you create a file (call it UNPROT.BAS) containing only the character 0x1a, then load the protected file, then load UNPROT.BAS, and you should then be able to list and save the program.

like image 122
Jeff Zeitlin Avatar answered Nov 21 '22 08:11

Jeff Zeitlin