Reverse Disassembley of Compiled Basic

Anything QL Software or Programming Related.
Post Reply
Derek_Stewart
Font of All Knowledge
Posts: 3958
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Reverse Disassembley of Compiled Basic

Post by Derek_Stewart »

Hi,

I have in the past tried at disassemble Qlib and Turbo complied programmes, but quite hard when they are not written in an assembler.

On the Amiga there is a programme called ReSource, which allows reverse disassembly of compiled programmes. Easier on there as the OS uses known libraries...

Could Turbo compiled code be disassembled and the resultant object code be then run through a Turbo re-translator to reconstruct the SuperBasic source code, as source code to Turbo is available and we know how the Turbo libraries work (maybe)?

This maybe good of great benefit to development programme to created which could yield the source code of older programmes that do not run on modern systems.

How would this affect copyrighted compiled programmes?


Regards,

Derek
User avatar
XorA
Site Admin
Posts: 1365
Joined: Thu Jun 02, 2011 11:31 am
Location: Shotts, North Lanarkshire, Scotland, UK

Re: Reverse Disassembley of Compiled Basic

Post by XorA »

All reverse compilers of this type use known patterns to work. Basically you just need to work out what code hunks Turbo creates for what statements then go through the binary pulling out those code hunks back into their original source.

It is a little easier to do this in C as you can leave bits of inline asm where you cannot figure out the original code. Not sure how you would do that in Superbasic.


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

Re: Reverse Disassembley of Compiled Basic

Post by RWAP »

It would actually be of great help - it does not break the copyright so long as you do not distribute the sources to copyright programs :)

Of more interest would be the older Supercharged programs, as they have even more problems running on modern systems


Ralf R.

Re: Reverse Disassembley of Compiled Basic

Post by Ralf R. »

RWAP wrote:It would actually be of great help - it does not break the copyright so long as you do not distribute the sources to copyright programs :)

Of more interest would be the older Supercharged programs, as they have even more problems running on modern systems
Especially the one which loads "The Pawn" without master cartridge :D


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

Re: Reverse Disassembley of Compiled Basic

Post by RWAP »

The program which loads the Pawn without the master cartridge was written (I think) by part of Ergon Software - Davide Santachiara may well know...


Ralf R.

Re: Reverse Disassembley of Compiled Basic

Post by Ralf R. »

RWAP wrote:The program which loads the Pawn without the master cartridge was written (I think) by part of Ergon Software - Davide Santachiara may well know...
I've got this "version" in 1987. As far as I know the loader was written by an italian guy.


User avatar
Mr_Navigator
QL Fanatic
Posts: 782
Joined: Mon Dec 13, 2010 11:17 pm
Location: UK, Essex
Contact:

Re: Reverse Disassembley of Compiled Basic

Post by Mr_Navigator »

I have my own SuperBASIC written then Turbo'ed programs that I don't have the original sources for and would like to improve them without reinventing the wheel. This option would be grand..


-----------------------------------------------------------------------------------
QLick here for the Back 2 the QL Blog http://backtotheql.blogspot.co.uk/
Derek_Stewart
Font of All Knowledge
Posts: 3958
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: Reverse Disassembley of Compiled Basic

Post by Derek_Stewart »

Mr_Navigator wrote:I have my own SuperBASIC written then Turbo'ed programs that I don't have the original sources for and would like to improve them without reinventing the wheel. This option would be grand..
Hi,

It is always worth looking at existing solutions.

I was going adapt some of the Turbo Source code to reverse compilation process.

I still need to understand the format of the output from the Turbo Parser, I will cross post this is the QL Users list, as George Gwilt may help.


Regards,

Derek
Post Reply