The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

"Detective Work," or "It's Basic my dear Watson."

I recently began work on a side project involving "modernizing" an old program written in 1984.  I didn't know what language it was written in, how it was used, or if there was even any human-readable source available; but, as is characteristic of a young (24) programmer fresh out of the University "green house," I was optimistic that, aided by the mighty oracle at Google, I would demystify this little understood program, for the output of which the owners had to keep an old dot-matrix printer around.

Upon first glance, the program appeared to be written in Basic; the famously misspelled BASICA.exe and several .bas files presented themselves as evidence.  "Great," I thought.  "Basic is an interpreted language, so I should be able to pour over the source to understand the program with a little testing."

Aside from small hurtles, setting run paths, downloading and installing the wild "blue" yonder of QBasic 4.5, I was humming right along.  Until I opened the source files. 


Nothing.  Nothing aside from some string comments made by the original programmer were visible, yet the file took up 56 Kb on my hard drive.  I pulled out my trust Swiss Army Knife TextPad, hoping its robust capabilities would reveal the hidden text QBasic was adverse to showing. 

It did somewhat better, showing me variable names, looping constructs, and some assignment statements, but multitude of null characters littered the screen.  What's more, Textpad wouldn't let me copy any of the text, due to the null characters.

After a little poking around, I thought that maybe (perhaps out of Basic ignorance ;) ) this file had been written on a system using an EBCDIC charset.  Armed with this hypothesis, I set out to convert the file into ASCII, something which (I thought) TextPad could display as readable to me.

Not so much luck.  The ASCII conversion from produces something slightly less helpful to me than ancient Sanskrit:

ÿ)ŽÉ€€€€€€¯¼¹¾¾µ>€²`š€¦/¼`€Á€¯¹¾¸¼?ÁŒ€ %%€ª¹·¸¾½€ªµ½µ¼Àµ´ dŽ’€€¢!(&+ (¤„X‚€€€€€€€€€€€©(¨Œ€¨>³‚ kŽ„€€]¤ª!
X ⎀€f€¤„ˆ‰€šÉR!&¤ª ¬¨!+€£¤«¢ª¨&¬¨!+ PŽ˜€€f€£¨ ˆ‰€šÉR£¨ (¤¬¤ª 1Ž¡€€f€¥¤¤£ˆ‰€šÉR¥¤¤£ ‡<€€f€<¤+¦¢­¬ˆ‰€šÉR<¤+¦¬§€!¥€¢­¬ ®€€f€¯¨£¬§¬!!<ˆ‰€šÉR¬!!<€¯¨£¬§ ´-€€f€«­ª¥¬(¨+
ˆ‰€šÉR«­ª¥ ¢¤€¥¬

etc, etc.

I submit these things for your consideration, ladies and gentlemen.  Can anyone give me clue as to how I can work with these files?
Jason Knight Send private email
Sunday, August 10, 2008
Sunday, August 10, 2008
+1 to dev1

I must be getting old because I knew this little fact too.  The good 'ol days of programming in GWBasic.
Almost H. Anonymous Send private email
Sunday, August 10, 2008
Yup, sounds like they're "tokenized" basic files.

SAVE "OutputFile.bas",a

will save them as the ascii equivalents, and you can work on them from there.
Sunday, August 10, 2008
During those times, you could save your BASIC source code files in binary form or ASCII form (up to VB3, VB4 I think). If it was saved in binary, you could open it in a text editor but it would give a byte textual representation. I suspect this file was saved in binary form.
Monday, August 11, 2008
By jove, I think I've got it!  Thank you folks.  I'll mention you all in the memoirs when my assistant doctor friend gets around to writing them down.  His shoulder's been somewhat stiff lately.
Jason Knight Send private email
Monday, August 11, 2008
Could you ask him which one - we have been puzzling over it.
Martin Send private email
Monday, August 11, 2008
Interesting.  Is there more information about this "binary" format?

What is it really?

Is there a file format definition?
Thursday, August 21, 2008
" Could you ask him which one - we have been puzzling over it."

Clearly his right shoulder, since everyone knows he's right handed, and hence has difficulty putting pen to paper.
Tom Send private email
Friday, August 22, 2008
Another possibility is the files being saved in protected format:
    save "filename",p
You should be able to find a crack for that on the Web.


Gene Wirchenko
Gene Wirchenko Send private email
Monday, August 25, 2008

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz