Pascal Decompiler 
Author Message
 Pascal Decompiler

-----BEGIN PGP SIGNED MESSAGE-----

I hereby, BRUCE LEE, grant the first person who gives me a Pascal
decompiler 3 wishes.  haahhahaha. sike.  Anywayz, I'll give whoever
whatever they want.  

BTW, I do not want any addons to exe2c or any other program like that.
I want a stand-alone pascal decompiler.

- -BRUCE LEE
Contact me at:

you can obtain my public pgp key to verify this message at my home
page at:
http://www.*-*-*.com/ ~brucelee
or at
http://www.*-*-*.com/

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBMiBEl3N2/CQSsuXZAQH1wQP/SedkI+QFp7ai2YXSceZmLJ1hzASZJCe/
3zs9SKqijOuBhkovuYzkxus7qIKn2L7t/wNrARaihPHQqszWmop6C5xPliiI5H81
9/GX9/XfWWh3xTiYy0qjtHgzYDomgtAQwrbe4hyJiiHoBFctmyH+1vfAHejO43VL
o+08Vp6zUxc=
=FvE1
-----END PGP SIGNATURE-----



Wed, 18 Jun 1902 08:00:00 GMT  
 Pascal Decompiler

Quote:
> I hereby, BRUCE LEE, grant the first person who gives me a pascal
> decompiler 3 wishes.  haahhahaha. sike.  Anywayz, I'll give whoever
> whatever they want.

> BTW, I do not want any addons to exe2c or any other program like that.
> I want a stand-alone pascal decompiler.

   There is no such thing, nor is it feasible to do such a program - if
you're asking for something which will decompile a .EXE or .TPU ile into
its .PAS source, that is.  There are various utilities which will produce
the assembler source from a .EXE file (the DOS DEBUG will do it. more or
less), but the regeneration of a .PAS osurce from an executeable or .TPU
is virtually impossible.


Wed, 18 Jun 1902 08:00:00 GMT  
 Pascal Decompiler

Quote:

>> I hereby, BRUCE LEE, grant the first person who gives me a pascal
>> decompiler 3 wishes.  haahhahaha. sike.  Anywayz, I'll give whoever
>> whatever they want.

>> BTW, I do not want any addons to exe2c or any other program like that.
>> I want a stand-alone pascal decompiler.

>   There is no such thing, nor is it feasible to do such a program - if
>you're asking for something which will decompile a .EXE or .TPU ile into
>its .PAS source, that is.  There are various utilities which will produce
>the assembler source from a .EXE file (the DOS DEBUG will do it. more or
>less), but the regeneration of a .PAS osurce from an executeable or .TPU
>is virtually impossible.

Here's an example of why.  Take the file USER.EXE and examine it using a hex
file editor.  Your task, should you choose to accept it, is to transform that
binary file back into the source-code, including variable and procedure names
and comments, that produced it.

A compiler produces executable code that corresponds to what the source code
says, but a tremendous amount of "human" knowledge is lost and a tremendous
amount of machine-specific procedural information is injected.  The process
can never be reversed.



Wed, 18 Jun 1902 08:00:00 GMT  
 Pascal Decompiler


Quote:
> > BTW, I do not want any addons to exe2c or any other program like that.
> > I want a stand-alone pascal decompiler.

>    There is no such thing, nor is it feasible to do such a program - if
> you're asking for something which will decompile a .EXE or .TPU ile into
> its .PAS source, that is.  There are various utilities which will produce
> the assembler source from a .EXE file (the DOS DEBUG will do it. more or
> less), but the regeneration of a .PAS osurce from an executeable or .TPU
> is virtually impossible.

It can be done with an EXE <as an addon to exe2c, which produces nearly
impossible to follow output> Just take the unreadable C and run it through
a c2pas program..  The results are equally unreadable Pascal...

What a mess, it's REALLY not worth it for what you get..

           \|/           Peace can not exist without war, nor can war
       \\\\/|\////          exist without peace. Think about it...
        \\\\|////             ----------------------------------



Wed, 18 Jun 1902 08:00:00 GMT  
 Pascal Decompiler

Quote:

>I hereby, BRUCE LEE, grant the first person who gives me a pascal
>decompiler 3 wishes.

If you can grant wishes, then why not wish for a decompiler yourself?
That seems to be the only way to get one.


Wed, 18 Jun 1902 08:00:00 GMT  
 Pascal Decompiler


Quote:

>>I hereby, BRUCE LEE, grant the first person who gives me a pascal
>>decompiler 3 wishes.
>If you can grant wishes, then why not wish for a decompiler yourself?
>That seems to be the only way to get one.

INddeed.  But of course, there is a pascal decompiler.  I'm looking
for a good one.  See, exe2c is a bad pseudo decompiler.  There are new
generations of decompilers that are really hard to find that get
pretty close to the source, of course overlooking variable names,
comments, etc, etc.  But the good ones I think only are like:

4 lines of code = 10 lines of code.

However, in exe2c,

4 lines of code = 250......



Wed, 18 Jun 1902 08:00:00 GMT  
 Pascal Decompiler

Quote:



> >>I hereby, BRUCE LEE, grant the first person who gives me a pascal
> >>decompiler 3 wishes.

> >If you can grant wishes, then why not wish for a decompiler yourself?
> >That seems to be the only way to get one.

> INddeed.  But of course, there is a pascal decompiler.  I'm looking
> for a good one.  See, exe2c is a bad pseudo decompiler.  There are new
> generations of decompilers that are really hard to find that get
> pretty close to the source, of course overlooking variable names,
> comments, etc, etc.  But the good ones I think only are like:

> 4 lines of code = 10 lines of code.

> However, in exe2c,

> 4 lines of code = 250......

What a load. Where might any of us find these decompilers?


Wed, 18 Jun 1902 08:00:00 GMT  
 Pascal Decompiler

Quote:



>>>I hereby, BRUCE LEE, grant the first person who gives me a pascal
>>>decompiler 3 wishes.
>>If you can grant wishes, then why not wish for a decompiler yourself?
>>That seems to be the only way to get one.
>INddeed.  But of course, there is a pascal decompiler.  I'm looking
>for a good one.  See, exe2c is a bad pseudo decompiler.  There are new
>generations of decompilers that are really hard to find that get
>pretty close to the source, of course overlooking variable names,
>comments, etc, etc.

You make a few interesting assertions there. But I wonder how you
heard about "the new generation of decompilers" but don't know where
to get one? It sounds like Internet myth.

However...having looked at some of the code produced by the Borland
Pascal compiler and having some experience in compilers, I think that
it would be quite possible to regenerate quite a lot of the original
source. Its a question of recognising patterns of object code and
relating them to source statements.

The Borland compiler makes it easier as it does not do much
optimisation and does not have many registers to play with in the x86.
The "hard" part would be regenerating information about types.

I will look into exe2c. If anyone has any info about decompilers I
would be grateful if you would let me know.

If you would like to hire me to develop a prototype decompiler I would
be happy to accept the project.

Regards,

--
Bob Cousins, Software Engineer.
http://www.*-*-*.com/ {*filter*}netics/



Wed, 18 Jun 1902 08:00:00 GMT  
 Pascal Decompiler

Quote:

>Here's an example of why.  Take the file USER.EXE and examine it using a hex
>file editor.  Your task, should you choose to accept it, is to transform that
>binary file back into the source-code, including variable and procedure names
>and comments, that produced it.

>A compiler produces executable code that corresponds to what the source code
>says, but a tremendous amount of "human" knowledge is lost and a tremendous
>amount of machine-specific procedural information is injected.  The process
>can never be reversed.

Given an .EXE compiled by TP7, I say it is possible to construct a set
of source files that will compile byte for byte into that .EXE. I think
it would take more effort to write a decompiler than writing the TP7
compiler in the first place.  

Andy



Wed, 18 Jun 1902 08:00:00 GMT  
 Pascal Decompiler


Quote:
> Given an .EXE compiled by TP7, I say it is possible to construct a set
> of source files that will compile byte for byte into that .EXE. I think
> it would take more effort to write a decompiler than writing the TP7
> compiler in the first place.

To beat this dead thread into the ground, such a set (in theory) would be  
infinitely large, but since Borland limits us to 255 length identifiers (I  
think, I'm sure I'll get corrected...) there is *some* upper limit, but I  
don't know what.

It's like the one time pad in cryptography.  If you have a completely random  
stream, the message aDfxOLA could be ATTACK! or RETREAT -- there is no way to  
tell.  Similarly, at the binary level, there is no way to distinguish between  
I := I + 1 and J := J + 1.

Chris Mathews



Wed, 18 Jun 1902 08:00:00 GMT  
 Pascal Decompiler

Quote:




> > >>I hereby, BRUCE LEE, grant the first person who gives me a pascal
> > >>decompiler 3 wishes.

> > >If you can grant wishes, then why not wish for a decompiler yourself?
> > >That seems to be the only way to get one.

> > INddeed.  But of course, there is a pascal decompiler.  I'm looking
> > for a good one.  See, exe2c is a bad pseudo decompiler.  There are new
> > generations of decompilers that are really hard to find that get
> > pretty close to the source, of course overlooking variable names,
> > comments, etc, etc.  But the good ones I think only are like:

> > 4 lines of code = 10 lines of code.

> > However, in exe2c,

> > 4 lines of code = 250......

> What a load. Where might any of us find these decompilers?

The absolute fact is: YOU CANNOT WRITE A (GOOD) PASCAL DECOMPILER !!!!!!!
You could decompile simple write or read instructions, but what about loops,
jumps, sub-routines ? EXE's are in machinecode, wich means that they modify
and write to memory and the CPU directly. EXE's don't use variables but
registers, how would you want to convert this to Pascal ???? Get a life and learn
Assembler wich is pretty close the machinecode (the actual code of EXE's), so you
can use simple Hexeditors (or disassemblers for Assembler) to modify EXE's

--------

 Greetingz from Neerkant, Holland (it's probable raining here.... as usual)



Wed, 18 Jun 1902 08:00:00 GMT  
 Pascal Decompiler

Quote:


>> Given an .EXE compiled by TP7, I say it is possible to construct a set
>> of source files that will compile byte for byte into that .EXE. I think
>> it would take more effort to write a decompiler than writing the TP7
>> compiler in the first place.
>To beat this dead thread into the ground, such a set (in theory) would be  
>infinitely large, but since Borland limits us to 255 length identifiers (I  
>think, I'm sure I'll get corrected...) there is *some* upper limit, but I  
>don't know what.

I would be interested to know what theory that is? I would have
thought a finite size of object code would have a  finite source
equivalent.

Quote:
>It's like the one time pad in cryptography.  If you have a completely random  
>stream, the message aDfxOLA could be ATTACK! or RETREAT -- there is no way to  
>tell.  Similarly, at the binary level, there is no way to distinguish between  
>I := I + 1 and J := J + 1.

I assume you mean that a particular address could not be determined to
be a variable "I". Obviously I and J would probably be distinguished
by the having different addresses.

--
Bob Cousins, Software Engineer.
Note: reply address in header is false to deter junk emailers.

http://www.*-*-*.com/ {*filter*}netics/



Wed, 18 Jun 1902 08:00:00 GMT  
 Pascal Decompiler

Quote:





>> > >>I hereby, BRUCE LEE, grant the first person who gives me a pascal
>> > >>decompiler 3 wishes.

>> > >If you can grant wishes, then why not wish for a decompiler yourself?
>> > >That seems to be the only way to get one.

>> > INddeed.  But of course, there is a pascal decompiler.  I'm looking
>> > for a good one.  See, exe2c is a bad pseudo decompiler.  There are new
>> > generations of decompilers that are really hard to find that get
>> > pretty close to the source, of course overlooking variable names,
>> > comments, etc, etc.  But the good ones I think only are like:

>> > 4 lines of code = 10 lines of code.

>> > However, in exe2c,

>> > 4 lines of code = 250......

>> What a load. Where might any of us find these decompilers?
>The absolute fact is: YOU CANNOT WRITE A (GOOD) PASCAL DECOMPILER !!!!!!!

Obviously it depends on your interpretation of good, but I'm pretty
sure it is not an absolute fact.

Quote:
>You could decompile simple write or read instructions, but what about loops,
>jumps, sub-routines ? EXE's are in machinecode, wich means that they modify
>and write to memory and the CPU directly. EXE's don't use variables but
>registers, how would you want to convert this to Pascal ????

In general variables are mapped to memory addresses. By examing memory
references you could deduce what variables are used and their basic
types. Loops are characterised by a test, some statements and a jump
back to the start. You could identify loops by looking for code that
meets that pattern. Sub-routines are identified by being the target of
a CALL instruction.

Regards,

--
Bob Cousins, Software Engineer.
Note: reply address in header is false to deter junk emailers.

http://www.*-*-*.com/ {*filter*}netics/



Wed, 18 Jun 1902 08:00:00 GMT  
 Pascal Decompiler

Quote:
>INddeed.  But of course, there is a pascal decompiler.  I'm looking
>for a good one.  See, exe2c is a bad pseudo decompiler.  There are new
>generations of decompilers that are really hard to find that get
>pretty close to the source, of course overlooking variable names,
>comments, etc, etc.

I read something about a Visual Basic decompiler a couple of weeks ago,
which must have been close to the real thing. It got the VB programmer
comunity so e{*filter*}d, that it was removed from the market.


Wed, 18 Jun 1902 08:00:00 GMT  
 Pascal Decompiler

"Dr E. Buxbaum"  allegedly said:

"E> I read something about a Visual Basic decompiler a couple of weeks ago,
"E> which must have been close to the real thing. It got the VB programmer
"E> comunity so e{*filter*}d, that it was removed from the market.

Visual Basic is an interpreted language, not machine code. As an interpreted
language, what makes up the .exe is a loader for the runtime library, with the
"tokenized" program following it. To reverse that, all you have to do is
figure out what tokens mean what, and make your source by pulling the tokens
out and writing their meanings to a file.

Disassemblers (big difference between a disassembler and a decompiler) look at
the machine code and try to "guess" what each byte means. Even the best,
however, make mistakes. For example, in a disassembly of a program, you might
see 200 lines of "DB 10" or something similar. Those are areas where the
disassembler simply couldn't figure out what the program was trying to do, and
simply started recording the bytes.

A DECOMPILER, on the other hand would have to have perfect knowledge of
everything a particular compiler (say, TP 7.0) would possibly put into an EXE
when it compiles. Otherwise it might mistake the string "Hello, how are you"
for 5 or more lines of actual code. And if someone used inline assembler or
something else the decompiler doesn't know about, this problem is compounded.

--
| Jeff Teunissen, President of Dusk To Dawn Computing.      Team OS/2
| Disclaimer: I am my employer, so anything I say goes double for me.



Wed, 18 Jun 1902 08:00:00 GMT  
 
 [ 17 post ]  Go to page: [1] [2]

 Relevant Pages 

1. pascal decompiler

2. Turbo Pascal Decompiler

3. Pascal Decompiler

4. Pascal Decompiler

5. Pascal decompiler

6. pascal decompiler

7. Pascal Decompiler?

8. is thera a decompiler for pascal?

9. decompiler for turbo pascal

10. Turbo.hlp decompiler

11. Has anybody a decompiler for TP 6/7

12. Turbo Helpfile (.tph, .tch, .hlp) Decompiler searched

 

 
Powered by phpBB® Forum Software