Page 1 of 1

decompiler

Posted: Wed Jun 14, 2006 4:19 am
by ppalka
Is this possible to decompile routines bytecode to source code?

Best regards,
Piotrek

Posted: Wed Jun 14, 2006 5:10 am
by ArndW
Yes, you can decompile DS/Basic and UV/Basic code.
There is a product available out there which you can purchase. This will decompile programs and routines. Years ago I wrote a decompiler and it wasn't too difficult {I don't have the specs anymore, so can't help you}.

Posted: Wed Jun 14, 2006 5:48 am
by kduke
Do not think this is easy. Arnd has been using Universe for many years. This is something he has a great deal of knowledge about.

Posted: Wed Jun 14, 2006 6:07 am
by ArndW
Kim - I shouldn't have said "not too difficult" :wink:

Piotrek - The engine is stack based (think of inverse-Polish notation or the programming of old HP calculators); there aren't too many compiled OPCodes but there are special ones that have variable number of parameters (i.e. elements to pop off the stack) and job variables are referenced in two different ways. All in all a working decompiler requires a list of opcodes as well as description of the current file layout (which parts are code, xref, linking, parameter, etc.) and it will be impossible to do without documentation that none of us have access to.

It is possible to use VLIST on a program and to get a rough idea of what is going on. Any previous low-level programming experience will help.

Posted: Wed Jun 14, 2006 6:13 am
by chulett
Anyone gonna ask for the 'why' behind the question? :?

Posted: Wed Jun 14, 2006 7:08 am
by ppalka
chulett wrote:Anyone gonna ask for the 'why' behind the question? :? ...
I was just curious, cause some time ago I have a situation, that I export my project, but without source code and unfortunately I delete my project.
So I am wondering about how could I retrieve all my project source code in such situation.

Regards,
Piotrek

Posted: Wed Jun 14, 2006 7:17 am
by ArndW
The purchased decompiler (can't recall who sells it anymore) will retrieve everything but common block variable names and CASE constructs (they compile down to embedded IF-THEN-ELSE statements. But you would still need to take those programs and put them back into the repository. This can be done for function and routines but cannot be done for compiled DataStage jobs; there is no decompiler at the job level.

Posted: Wed Jun 14, 2006 7:20 am
by ppalka
ArndW wrote:All in all a working decompiler requires a list of opcodes as well as description of the current file layout (which parts are code, xref, linking, parameter, etc.) and it will be impossible to do without documentation that none of us have access to.
So how you wrote a decompiler some time ago if you haven't access to that documentation? :>
Thanks a lot for provided information.

Best regards,
Piotrek

Posted: Wed Jun 14, 2006 7:23 am
by ppalka
ArndW wrote:The purchased decompiler (can't recall who sells it anymore) will retrieve everything but common block variable names and CASE constructs (they compile down to embedded IF-THEN-ELSE statements. But you would still need to take those programs and put them back into the repository. This can be done for function and routines but cannot be done for compiled DataStage jobs; there is no decompiler at the job level.
I think that my problem doesn't worth buying decompiler. But I will remember that there is such possibility.

Best regards,
Piotrek

Posted: Wed Jun 14, 2006 3:46 pm
by ray.wurlod
I seriously doubt that the UniVerse decompiler will work with DataStage version 6.0 or later. There are traps in the object code to reflect that they are different products; code compiled on the one can not be executed on the other.

You can visit Source Recovery Service to find out about the UniVerse decompiler.

Having recovered the source code, what do you intend to do with it? You do not have any means to run it.

Why not just restored the deleted project from backup?

Posted: Thu Jun 15, 2006 3:42 am
by ascen
ray.wurlod wrote: Why not just restored the deleted project from backup?
But what if I haven't backup?
Nevermind, that was some test project, it wasn't important.

Best regards,
Piotrek