QLiberator decompiler

Anything QL Software or Programming Related.
Post Reply
Martin_Head
Aurora
Posts: 847
Joined: Tue Dec 17, 2013 1:17 pm

QLiberator decompiler

Post 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.


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

Re: QLiberator decompiler

Post 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.


Regards,

Derek
User avatar
pjw
QL Wafer Drive
Posts: 1286
Joined: Fri Jul 11, 2014 8:44 am
Location: Norway
Contact:

Re: QLiberator decompiler

Post 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?


Per
dont be happy. worry
- ?
User avatar
RalfR
Aurora
Posts: 870
Joined: Fri Jun 15, 2018 8:58 pm

Re: QLiberator decompiler

Post 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,


4E75 7000
Martin_Head
Aurora
Posts: 847
Joined: Tue Dec 17, 2013 1:17 pm

Re: QLiberator decompiler

Post 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.


User avatar
mk79
QL Wafer Drive
Posts: 1349
Joined: Sun Feb 02, 2014 10:54 am
Location: Esslingen/Germany
Contact:

Re: QLiberator decompiler

Post 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


Martin_Head
Aurora
Posts: 847
Joined: Tue Dec 17, 2013 1:17 pm

Re: QLiberator decompiler

Post 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.


User avatar
RalfR
Aurora
Posts: 870
Joined: Fri Jun 15, 2018 8:58 pm

Re: QLiberator decompiler

Post 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).


4E75 7000
Martin_Head
Aurora
Posts: 847
Joined: Tue Dec 17, 2013 1:17 pm

Re: QLiberator decompiler

Post 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.
Attachments
sedit_img.zip
(95.4 KiB) Downloaded 129 times


User avatar
RalfR
Aurora
Posts: 870
Joined: Fri Jun 15, 2018 8:58 pm

Re: QLiberator decompiler

Post 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!


4E75 7000
Post Reply