Page 1 of 18

QLiberator decompiler

Posted: Sat Nov 16, 2019 11:01 am
by Martin_Head
I have started this thread to carry on from this thread viewtopic.php?f=3&t=3019&start=10

I have got the decompiler to the point where I am starting to throw real programs at it. It's still got a few problems to sort out, but it seems to be mostly going.

I thought I would ask if there are any programs, That there is a real interest in seeing decompiled. If I am going to put the effort into trying to decompile something, It might as well be something that there is interest in.

At the moment I am trying to decompile Disk Mate 5, as someone inquired about it when I was working on the Turbo decompiler. But it's a bit of a beast. Almost 3000 lines of SuperBACSIC.

Re: QLiberator decompiler

Posted: Sat Nov 16, 2019 1:21 pm
by Derek_Stewart
Hi Martin,

I think that me that enquired about Diskmate 5.

I have been trying to re-write it from the useage.

I have extracted most of the Easypointer screen, but not got a working programme yet.

Re: QLiberator decompiler

Posted: Sat Nov 16, 2019 4:59 pm
by pjw
Martin_Head wrote:I thought I would ask if there are any programs, That there is a real interest in seeing decompiled. If I am going to put the effort into trying to decompile something, It might as well be something that there is interest in.
The real biggie is Q-Liberator itself! Any chance of that?

Re: QLiberator decompiler

Posted: Sat Nov 16, 2019 8:59 pm
by RalfR
Perhaps you try to recompile sedit_63 Screen Eiditor from Dilwyns site, as I have lost the the source from a damaged HD. That would be useful, The ASM code included is here, if you need it,

Re: QLiberator decompiler

Posted: Mon Nov 18, 2019 10:02 am
by Martin_Head
Derek_Stewart wrote:Hi Martin,

I think that me that enquired about Diskmate 5.

I have been trying to re-write it from the useage.

I have extracted most of the Easypointer screen, but not got a working programme yet.
If you want I could upload the current decompilation. It's got some problems (especially SEL..ON) and would take a lot of work to get into something that would load and run.

I have started looking at the generated code to improve the decompilers output.
PJW wrote:The real biggie is Q-Liberator itself! Any chance of that?
I'm plucking up the courage for that. I would like to get the decompiler a bit more sorted out first.
Ralf R. wrote:Perhaps you try to recompile sedit_63 Screen Eiditor from Dilwyns site, as I have lost the the source from a damaged HD. That would be useful, The ASM code included is here, if you need it,
I will download it and have a look.

I may also try QL Menu Generator that was suggested in the previous thread.

I won't promise to do all suggestions, but it gives me some different programs to try.

Re: QLiberator decompiler

Posted: Mon Nov 18, 2019 2:45 pm
by mk79
First of all, great project! In how far did you analyze the runtime yet? I started putting it into my IDA Pro some months ago, but ran out of time.

Cheers, Marcel

Re: QLiberator decompiler

Posted: Tue Nov 19, 2019 11:01 am
by Martin_Head
mk79 wrote:First of all, great project! In how far did you analyze the runtime yet? I started putting it into my IDA Pro some months ago, but ran out of time.

Cheers, Marcel
Only a little. Most things I can work out by compiling test programs, then examining the results.

I have found the 'interpreter loop' that reads the encoded SuperBASIC program, and calls the appropriate subroutines from a table.

I have not got around to calculating all the offsets in the table to the actual subroutine locations. There are about two hundred of them.

Re: QLiberator decompiler

Posted: Tue Nov 19, 2019 5:31 pm
by RalfR
Martin_Head wrote:I have found the 'interpreter loop' that reads the encoded SuperBASIC program, and calls the appropriate subroutines from a table
This seems to be quite similar to SMSQ/E (for my sense, can be wrong).

Re: QLiberator decompiler

Posted: Tue Dec 03, 2019 4:23 pm
by Martin_Head
Ralf R. wrote:Perhaps you try to recompile sedit_63 Screen Eiditor from Dilwyns site, as I have lost the the source from a damaged HD. That would be useful, The ASM code included is here, if you need it,
I have been working on this.

The decompiled program has quite a few GO TO's in it. Did the original have GO TO's ? I have attached a floppy disk image file of the current tidied up decompiled version, and the raw output from the decompiler.

This is NOT a finished working version, just something to play with. It will easily crash out to Basic. Some the procedure calls have picked up the wrong names for the Procedure definitions e.g. a call to ProcFun10891 should be ProcFun10890

Run the BOOT file in the image, This will add the SuperBASIC extensions that I have extracted from the compiled version. And load the decompiled sedit program.

You can then RUN it.

Note you will need a larger than normal screen, see the original text file on the image.

You can type, and use some of the menus OK.

I don't know if I will have time to debug it further before Christmas, So I thought I would post it now, even though it's barely working.

Re: QLiberator decompiler

Posted: Wed Dec 04, 2019 10:35 am
by RalfR
Hi Martin,

my code looks interesting :), thank you. I have a few GOTOs in my code but not so much as in the recompiled code and just within a few PROCs. Seems I had better compiled with VARs ON to get a proper nametable for recompiling.

Seems, you had to add a BP.INIT to my(!) inbuilt extensions, as there weren't any.

Thank you!