Page 3 of 3

Re: MT.DMODE alternative (i.e. how else to change display mode)

Posted: Sun Oct 10, 2021 9:36 am
by Martin_Head
mk79 wrote:
Martin_Head wrote:I can't see anything in the SuperCharge manual that says you can compile without line numbers, except for command files. And I don't quite see how you could do that with a program that has loops, and GO TO's.
Seeing to what extrems they went to protect the software, this, too, is probably a special for themselves to make reverse engineering more difficult.
There's also no version number of the Codegen used in Parser_task. And how did they compile the program with those odd SuperBASIC extensions names. Unless they patched the names in the executable afterwards.

Re: MT.DMODE alternative (i.e. how else to change display mode)

Posted: Sun Oct 10, 2021 9:37 am
by Martin_Head
mk79 wrote:
Martin_Head wrote:I can't see anything in the SuperCharge manual that says you can compile without line numbers, except for command files. And I don't quite see how you could do that with a program that has loops, and GO TO's.
Seeing to what extrems they went to protect the software, this, too, is probably a special for themselves to make reverse engineering more difficult.
There's also no version number of the Codegen used in Parser_task. And how did they compile the program with those odd SuperBASIC extensions names. Unless they patched the names in the executable afterwards.

Re: MT.DMODE alternative (i.e. how else to change display mode)

Posted: Sun Oct 10, 2021 9:41 am
by Martin_Head
Sorry for the double post, but the QL forum threw up some SQL errors, but the post still got through

Re: MT.DMODE alternative (i.e. how else to change display mode)

Posted: Tue Oct 12, 2021 11:56 am
by bwinkel67
Martin_Head wrote:
bwinkel67 wrote:
Martin_Head wrote:I'm in the process of trying to decompile SuperCharge's Parser_task...
Oh wow, I didn't realize there was a decompiler for SuperCharge. Did you write it or was that from DP as well? Is it available to play with?
Here's the last one I posted here. viewtopic.php?f=3&t=2373&p=28287&hilit=discharge#p28287
It also decompiles Turbo programs.

And here's a QLiberator decompiler viewtopic.php?f=3&t=3042&hilit=delib&start=100#p30978

The decompilers don't produce ready to run BASIC programs. You have to do some tiding up. I think the SuperCharge one has a walk through demo on decompiling.
Thanks for the link. I will definitely play around with DisCharge. It looks like its written in SuperBASIC and loads in some libraries depending on what is being disassembled. I started reading the initial documentation (from March 2018) but then went to the latest (June 2019) and it seems there was quiet a change (I didn't read through the entire thread). Was the initial version more manual and the current one is more automated?

This all looks quite extensive in that for each of the 3 compilers, you had to figure out what each code generator build for each specific construct. Must have taken quite some time.

Re: MT.DMODE alternative (i.e. how else to change display mode)

Posted: Wed Oct 13, 2021 10:15 am
by Martin_Head
bwinkel67 wrote: Thanks for the link. I will definitely play around with DisCharge. It looks like its written in SuperBASIC and loads in some libraries depending on what is being disassembled. I started reading the initial documentation (from March 2018) but then went to the latest (June 2019) and it seems there was quiet a change (I didn't read through the entire thread). Was the initial version more manual and the current one is more automated?

This all looks quite extensive in that for each of the 3 compilers, you had to figure out what each code generator build for each specific construct. Must have taken quite some time.
It's all written in BASIC. The library files of disassembly's are not used by the decompiler, They are there to help identify routines in the different code generators that may not have been found yet.
As you say, the initial versions were more manual. And I did some automation to make it easier.
To work out what each of the code routines did. I compiled a lot of short test routines, then disassembled them. Knowing what the original program was, you can work out what each routine does.

Re: MT.DMODE alternative (i.e. how else to change display mode)

Posted: Wed Oct 13, 2021 2:48 pm
by bwinkel67
Martin_Head wrote:As you say, the initial versions were more manual. And I did some automation to make it easier.
To work out what each of the code routines did. I compiled a lot of short test routines, then disassembled them. Knowing what the original program was, you can work out what each routine does.
That's quite an impressive feat and a lot of work so wow and thank you. Would be interesting to do a decompile on a different language (say Digital C) into BASIC...wonder if that would be more challenging or if there are enough similarities to map the two.

Re: MT.DMODE alternative (i.e. how else to change display mode)

Posted: Wed Oct 13, 2021 8:12 pm
by Derek_Stewart
Hi,

Digital Prevision sold a programme called CPORT, which was supposed to translate Superbasic into C.

The CPORT is a Turbo compiled executable, written in Superbasic. Which is kind funny, in that it is a Superbasic programme to convert Superbasic to C.

Sadly the CPORT programme is part of the Digital Precision software package and probably still copyright to the original software writer and there is no source code, so would have to be decompiled.

Re: MT.DMODE alternative (i.e. how else to change display mode)

Posted: Thu Oct 14, 2021 1:11 am
by bwinkel67
Derek_Stewart wrote:Hi,

Digital Prevision sold a programme called CPORT, which was supposed to translate Superbasic into C.

The CPORT is a Turbo compiled executable, written in Superbasic. Which is kind funny, in that it is a Superbasic programme to convert Superbasic to C.

Sadly the CPORT programme is part of the Digital Precision software package and probably still copyright to the original software writer and there is no source code, so would have to be decompiled.
Wow, that's pretty cool. So much neat software out there...sucks that DP disappeared without releasing it to the community.