Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

INFO/BASIC decompiler

586 views
Skip to first unread message

Toni van de Wiel

unread,
Dec 8, 1994, 4:29:14 AM12/8/94
to
On mailing-list Info-Prime Kevin Yoders <yod...@bob.Wittenberg.EDU> writes:

[I include lots of quoting because I've crossposted to groups that haven't
seen the original mail]

> I am in the (depressing) process of decommissioning our Prime. I
>came across a few INFO/BASIC programs that might be of interest. Through
>some rather unusual circumstances, I started writing an INFO/BASIC
>de-compiler. I made some great progress with it when I got moved to
>another position almost 2 years ago. I haven't had time to get back to
>it since, and now I have no use for it.
[snip]
> Anyway, the program as it sits doesn't work, but I felt like I
>was on the verge of getting it to work. If anybody is interested, I can
>send you a copy. There is absolutely NO documentation with it, and I
>can't answer any questions about it since I still don't have time to play
>with it. I put a LOT of time into getting it this far and I'd hate to
>see it all go to waste.

> I was working on it under Rev. 8.1.4, so it should work equally
>well on PI/Open (at least until VMark removes object-compatibility). It
>also worked on Rev. 7 code. And, as an added incentive, it worked on
>Prime-supplied code and was able to de-compile many of the "internal"
>compiler-generated op codes. Not that I ever used it to de-compile or
>reverse engineer any of Prime's code, or any other copyrighted object
>(that would be illegal, immoral, unethical, and possibly a few other
>negatives). I absolutely never did this, but... I seem to remember a few
>other goodies I stumbled on, and I will include them if I can remember
>where they are (one was a hunk of PLP code that could call the compiler
>with the internal flag set, thereby letting you do such magical things as
>modify read-only @ variables). I also discovered that you can do this
>without using the internal compiler, as long as you were willing to edit
>the object code and make one particular change... Like I said, this was a
>very interesting project.

If only I knew...

A few months ago we needed to modify one of our own programs of which the
source file sadly had been moved to the binary twilight zone.
I took a quick glance at a hex-dump of the Info-Basic object file to see
if we could salvage anything of the source and soon became addicted to yet
another of my personal projects. I simply _had_ to write a decompiler, just
for the fun of it.

I now have a (almost) fully functional decompiler. It will decompile any
self-written Info-Basic code, and a lot of the Prime-supplied routines, but,
like Kevin, I never used this to reverse-engineer anything ;-)

I found many hidden/undocumented statements and functions.
Some of them did compile and run ok, other didn't even compile. I found it
hard to find the proper syntax of an undocumented statement.
Sometimes, if the code does compile (with internal-mode flag set during
compile), it will hit an 'unimplemented op-code' during run-time.
Aparently there are different run-engines as well...

I found the following undocumented goodies:

Statements: cputime, xeq.gosub, dtraceon, dtraceoff, writelist,
matblock, informwidth, staticfunit, debugger, writeh, transaction,
message

Functions: descriptor(), refop(), recovery(), iostatus(), message()

There also appear to be a whole bunch of @-functions. Only a couple of them
I could trace: @transaction, @dev.op.load.temp, @dev.op.load.at.var,
@dev.op.load.register, @dev.op.load.trfiles
The @-var with code 0x00 apears to be the open VOC file unit.

The decompiler (named UNBAS) can succesfully decompile IF/THEN/ELSE
constructions (CASE statements are treated as IF/THEN blocks). It will
handle ON ERROR and LOCKED clauses (boy, was that hard to implement)
It recognizes multi-dimensional arrays (some parts of the code appears to
handle 4-dimensional arrays! I want that implemented!), as well as
common blocks. It also does a great attempt to indent the produced code, and
generates the (physical) line numbers of the source.
It's a shame though, that comments are not included in the object... :-)

One _big_ problem still remains, and I have not yet found a way to get
around it: arrays passed to a subroutine or function are not recognizable
as being arrays. Only the run-machine really _knows_ if a var is an array
and can act according to it, but there seems to be no way to find it in
the object itself. :(

One thing that struck me the most is that aparently there is transaction
functionality in Information. There is a TRANSACTION THEN/ELSE construction
and a @TRANSACTION variable. Can anybody tell why this never made it into
a documented, useable feature?

By the way: any idea how CLOSE F.VAR is implemented?
Believe it or not, it's just: F.VAR= 0
Really.

And what about CLEARSELECT ALL
It's just: CLEARSELECT 0; CLEARSELECT 1; CLEARSELECT 2; CLEARSELECT 3 ... etc
Really!...

cheers,
++Toni;

--
Toni van de Wiel phone: +31 35 258411 Intomart BV
to...@intomart.nl home: +31 35 856513 Hilversum - The Netherlands

Andrew Sorrell

unread,
Jan 10, 1995, 12:56:20 PM1/10/95
to

VMARK Software (which now owns all rights to Prime INFORMATION and PI/open)
is currently in the final stages of releasing uniVerse 8.3. This release
of uniVerse supplies extremely high levels of compatibility with PI/open and
Prime INFORMATION. The PI related features include

-- Source code compatibility (not object compatible)
-- Verb / keyword compatibility
-- New PI/open "flavor" selection
-- Extended GCI compatibility

and last but not least,

-- an INFO/BASIC decompiler

This is obviously to help our customers who have programs that they have
on either PI or PI/open that they have lost source code to.

I am not sure that a final decision has been made as to the method of
distribution (ie: included w/release or by request).

Since this utility was written by the same engineers who designed and
developed PI and PI/open it didn't have to go through the challenging /
frustrating reverse engineering process. It is also guaranteed to
decompile any program no matter what statements it includes.

Again (std disclosure), VMARK does not supply this with the intention of
facilitating any illegal attempts to decompile copyrighted applications.
It is intended for customer use on programs that are wholly owned or
for third party apps that have granted rights for source code access.

For more information you can contact your local VMARK tech support rep or
give me a call.

Andy Sorrell
Sales Support Manager
VMARK Software, Inc.
asor...@uvmark.vmark.com
800-899-6101

David Hona

unread,
Jan 10, 1995, 6:23:01 PM1/10/95
to
In article <3euho4$3...@fohnix.metronet.com> asor...@fohnix.metronet.com (Andrew Sorrell) writes:
>From: asor...@fohnix.metronet.com (Andrew Sorrell)
>Subject: Re: INFO/BASIC decompiler
>Date: 10 Jan 1995 11:56:20 -0600


>VMARK Software (which now owns all rights to Prime INFORMATION and PI/open)
>is currently in the final stages of releasing uniVerse 8.3. This release
>of uniVerse supplies extremely high levels of compatibility with PI/open and
>Prime INFORMATION. The PI related features include
>
> -- Source code compatibility (not object compatible)
> -- Verb / keyword compatibility
> -- New PI/open "flavor" selection
> -- Extended GCI compatibility
>
>and last but not least,
>
> -- an INFO/BASIC decompiler
>
>This is obviously to help our customers who have programs that they have
>on either PI or PI/open that they have lost source code to.
>
>I am not sure that a final decision has been made as to the method of
>distribution (ie: included w/release or by request).

[snip]

>Andy Sorrell
>Sales Support Manager
>VMARK Software, Inc.
>asor...@uvmark.vmark.com
>800-899-6101

Thanks for the info, but will it include such PI goodies as...


- UPDATE.RECORD
- SHOW
- COMMAND.EDITOR
- EDFS
- HELP ABOUT (a decent on-line help system)

- Better documentation?

Thanks.

Regards,
David Hona

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
David Hona | "The best movie is your own imagination"
dh...@ozemail.com.au | Some people are always at the movies!
10025...@compuserve.com | http://www.ozemail.com.au/~dhona
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&

ERNIE VEGAS

unread,
Jul 10, 2014, 9:44:45 PM7/10/14
to
I'm very impressed with the intricate mind of the decompiler writer. I know how fun it is to encounter useful, undocumented things.

I wonder if he has ever applied his mind to Universe or Unidata. I betcha' all kind of goodies will spring forth...

Robert Norman

ROBERT NORMAN AND ASSOCIATES
http://users.keyway.net/~ice/
[Affordable UNIVERSE programming services for PICK/BASIC,
DATA/BASIC, UniVerse Basic, UniBasic, R/BASIC, jBC]

Dennis Boone

unread,
Jul 11, 2014, 1:45:03 AM7/11/14
to
> I'm very impressed with the intricate mind of the decompiler
> writer. I know how fun it is to encounter useful, undocumented things.

This was, of course, a reply to a nearly 20 year old post. I don't
know if Toni or Kevin ever posted their decompilers publicly.
I've looked for a few archives of Prime-related stuff that I know once
existed, without any luck. Old c.s.p. posts refer to a file-by-mail
server and at least a couple of ftp sites. The Prime era ended
just a couple of years too early for the internet effect to preserve
most things.

De
0 new messages