SuperCharge Decompiler

Anything QL Software or Programming Related.
Martin_Head
Gold Card
Posts: 291
Joined: Tue Dec 17, 2013 1:17 pm

SuperCharge Decompiler

Postby Martin_Head » Thu Mar 29, 2018 3:29 pm

This is a walk through on how to use my SuperCharge decompiler.

This is not a full release of the Decompiler, as it is still a work in progress, and it doesn't know how to handle all commands.

This worked, walk through shows you the steps involved in generating a BASIC program from a SuperCharged executable.

Before unzipping the sample file, rename it sample_zip, and unzip in QDOS to retain the executable file header
Attachments
Documents.zip
Libre office and PDF documents
(719.99 KiB) Downloaded 23 times
sample.zip
Rename to sample_zip and unzip in QDOS
(148.67 KiB) Downloaded 18 times


Martin_Head
Gold Card
Posts: 291
Joined: Tue Dec 17, 2013 1:17 pm

Re: SuperCharge Decompiler

Postby Martin_Head » Sun Apr 01, 2018 4:42 pm

Something went a bit wrong with the first upload. The DisCharge_bas program got corrupted.

Here is another go...

This is a slightly updated version of DisCharge_bas that now knows about, code array indexs

53, == (string)
183, colour stipples (triple)

plus a few other bug fixes

As before rename and unzip in QDOS
Attachments
sample2.zip
Unzip in QDOS
(152.94 KiB) Downloaded 19 times


User avatar
NormanDunbar
Gold Card
Posts: 451
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: SuperCharge Decompiler

Postby NormanDunbar » Sun Apr 01, 2018 10:37 pm

Hi Martin,

this is a very interesting project. Unfortunately, as far as I know, I don't have any Supercharged programs to try it out on, after the demo, even though I purchased Supercharge many years ago.

Sadly my floppy collection, built up over many years, died, or was found to be dead, a little while back. None of my originals or backups would spin in the drive. :(

Cheers,
Norm.


Why do they put lightning conductors on churches?
How come Tarzan never grew a beard?
If at first you don't succeed, don't take up skydiving!
Martin_Head
Gold Card
Posts: 291
Joined: Tue Dec 17, 2013 1:17 pm

Re: SuperCharge Decompiler

Postby Martin_Head » Mon Apr 02, 2018 10:01 am

Rich Mellor suggested a few programs for me to try. Mostly still commercial, but Nucleon Programmers Assistant by Pyramide, and Concept 3D graphics drawing. Are available from Dilwyn Jones web site, if you fancy having a go.

So far, apart from the original Tridim, I have been using 3D Slime, and Type22 to teach the decompiler. While 3D Slime produces a BASIC program that mostly looks good, it has one or two oddities. And Type22 is just about to produce it's first full decompile.


RWAP
RWAP Master
Posts: 2444
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Re: SuperCharge Decompiler

Postby RWAP » Mon Apr 02, 2018 10:45 am

It might be silly - but how about trying to decompile SuperCharge itself? I believe it self-compiled originally.....

There is also a selection of programs on the Sinclair QL Homepage:
CadQL.zip on http://www.dilwyn.me.uk/graphics/index.html
Caxton on http://www.dilwyn.me.uk/label/index.html

Probably several others too...
These have the benefit of including the original BASIC source, so can be useful to compare the output with the original


RWAP
RWAP Master
Posts: 2444
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Re: SuperCharge Decompiler

Postby RWAP » Mon Apr 02, 2018 12:05 pm

There is also the loading program for PAWN (cracked version) :D


QLObi
ROM Dongle
Posts: 39
Joined: Wed Mar 20, 2013 9:15 pm
Location: Germany Köln

Re: SuperCharge Decompiler

Postby QLObi » Thu Apr 05, 2018 12:24 pm

Good work !
I like to test for OMEGA. This game contains a bug, so i like to find that.
More intréssting is a decompiler for Qliberated files. is there anything around ?

Detlef


Martin_Head
Gold Card
Posts: 291
Joined: Tue Dec 17, 2013 1:17 pm

Re: SuperCharge Decompiler

Postby Martin_Head » Sat Apr 21, 2018 11:07 am

While working on the decompiler, I have noticed that SuperCharge seems to treat '==' (almost equals) for integers and floats the same as '='. '==' for strings is not a problem.

Is '=' and '==' for integers and floats any different in SuperBASIC? I can't see the point of '==' for numbers, either they are the same, or they are not.

So would it be safe to convert what was a '==' into a '=' for numbers.


RWAP
RWAP Master
Posts: 2444
Joined: Sun Nov 28, 2010 4:51 pm
Location: Stone, United Kingdom
Contact:

Re: SuperCharge Decompiler

Postby RWAP » Sat Apr 21, 2018 12:00 pm

I thought there was a slight difference when you got to tiny differences between numbers (eg 0==0.0000000001) but I can't prove it in q-emulator....


User avatar
NormanDunbar
Gold Card
Posts: 451
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: SuperCharge Decompiler

Postby NormanDunbar » Sat Apr 21, 2018 5:27 pm

From Jan Jones:

The equivalence (= =) or ‘almost equal’ operator has a greater tolerance. Here X = = Y will be true if | X-Y | < = | Y* 1E-7 | where | X-Y | means the absolute, or positive, value of X-Y.

Note : it may not be immediately obvious that no value will ever be = = zero. If in the above equation, Y is zero, the check reduces to | x | < = 0, clearly impossible when x is a non-zero number. If you make X zero instead of Y, the test becomes | Y | < = | Y* 1E-7 |, which is also somewhat infeasible. To test for a quantity being very close to zero, add 1 to both sides eg, (X + 1) = = 1.

HTH

Cheers,
Norm.


Why do they put lightning conductors on churches?
How come Tarzan never grew a beard?
If at first you don't succeed, don't take up skydiving!

Return to “Software & Programming”

Who is online

Users browsing this forum: No registered users and 2 guests