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

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

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

Postby Martin_Head » Sun Oct 10, 2021 9:36 am

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.


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

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

Postby Martin_Head » Sun Oct 10, 2021 9:37 am

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.


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

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

Postby Martin_Head » Sun Oct 10, 2021 9:41 am

Sorry for the double post, but the QL forum threw up some SQL errors, but the post still got through


User avatar
bwinkel67
Aurora
Posts: 818
Joined: Thu Oct 03, 2019 2:09 am

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

Postby bwinkel67 » Tue Oct 12, 2021 11:56 am

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. https://qlforum.co.uk/viewtopic.php?f=3&t=2373&p=28287&hilit=discharge#p28287
It also decompiles Turbo programs.

And here's a QLiberator decompiler https://qlforum.co.uk/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.


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

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

Postby Martin_Head » Wed Oct 13, 2021 10:15 am

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.


User avatar
bwinkel67
Aurora
Posts: 818
Joined: Thu Oct 03, 2019 2:09 am

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

Postby bwinkel67 » Wed Oct 13, 2021 2:48 pm

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.


Derek_Stewart
Font of All Knowledge
Posts: 2516
Joined: Mon Dec 20, 2010 11:40 am
Location: Runcorn, Cheshire, UK

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

Postby Derek_Stewart » Wed Oct 13, 2021 8:12 pm

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.


Regards,

Derek
User avatar
bwinkel67
Aurora
Posts: 818
Joined: Thu Oct 03, 2019 2:09 am

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

Postby bwinkel67 » Thu Oct 14, 2021 1:11 am

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.



Who is online

Users browsing this forum: No registered users and 5 guests