[PHP] Extracting Source code from Binary Files(.dll,.exe.,class)

2003-11-13 Thread Prashant Akerkar
Dear Friends

I have a Query. Is it Possible to extract the source code from 
.exe,(VB,'C',C++),.dll(VB,'C',C++) or .class(java) files.

A Utility program which can be written which will extract .exe-.c source code 
conversion or .exe-com or .exe-.frm files,.dll-.cpp,.dll-.c source code

Or is it Virtually Impossible to extract the source code ???

Do the System Level Programmers who are writing compilers,interpretors,operating 
systems,Device Drivers,TSR,Anti-Virus Packages,
Programmers who know machine language and assembly language very well can they extract 
the source code?

Thanks,

Prashant A




Re: [PHP] Extracting Source code from Binary Files(.dll,.exe.,class)

2003-11-13 Thread Christophe Chisogne
Prashant Akerkar wrote:
Is it Possible to extract the source code from .exe, ... .class(java) files.
[ I think you're way off-topic but... ]

Nope. But you can try to decompile binaries or java class files.
Try googling for decompilation tools
Note that decompiling softs can be prohibited by law enforcements
(not in Europe for interoperability reasons, but well in the US).
Result from decompilation is not source code of course, can be made
very difficult, and result is very different from src code.
In particular case of java class files, decompilation can lead to
really good results (with bad-looking variable names tough)
Christophe

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Extracting Source code from Binary Files(.dll,.exe.,class)

2003-11-13 Thread Prashant Akerkar

Dear  Christophe


My Point is like this  


.c source code/file/s  - .obj file/s is done by the C compiler

.obj file/s -- .exe binary file is done by the Linker(Assembly Language)


In the same way can we do the following steps to extract the .c source
code/files as follows


 Step 1 :   .exe binary file -- Linker (assembly language)
.. .obj file/s

 Step 2 :.obj file/s  .c (Compiler) source code file/s

Is it Right or i am going somewhere illogical?

Awaiting Your Prompt Reply,

Thanks   Regards,

Prashant A









- Original Message -
From: Christophe Chisogne [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, November 13, 2003 6:46 PM
Subject: Re: [PHP] Extracting Source code from Binary
Files(.dll,.exe.,class)


 Prashant Akerkar wrote:
  Is it Possible to extract the source code from .exe, ... .class(java)
files.

 [ I think you're way off-topic but... ]

 Nope. But you can try to decompile binaries or java class files.
 Try googling for decompilation tools

 Note that decompiling softs can be prohibited by law enforcements
 (not in Europe for interoperability reasons, but well in the US).

 Result from decompilation is not source code of course, can be made
 very difficult, and result is very different from src code.
 In particular case of java class files, decompilation can lead to
 really good results (with bad-looking variable names tough)

 Christophe

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] Extracting Source code from Binary Files(.dll,.exe.,class)

2003-11-13 Thread Jay Blanchard
[snip]
 Step 1 :   .exe binary file -- Linker (assembly language)
.. .obj file/s

 Step 2 :.obj file/s  .c (Compiler) source code file/s

Is it Right or i am going somewhere illogical?
[/snip]

Really this cannot be done with any degree of reliability, if at all.
The .obj file has been stripped of things and has had additional code
placed into it. This is dependent upon the compiler (.obj files from
compiler to compiler have different looks to them based on several
items. Makefiles are different.).The .exe file is a translation of the
.obj into assembly language.

Does the compiled code you want to use have hooks into it, an API? If so
you can use PHP to interact with the API.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Extracting Source code from Binary Files(.dll,.exe.,class)

2003-11-13 Thread Prashant

Dear Mr Jay Blanchard

That is exactly my Point of Argument. Programmers who are well versed with
assembly language and Programmers who have written
C Compilers should be knowing the Process of Delinking and as well as
Decompiling?

Is it not possible for the Programmer who has written C Compiler(Who is also
an assembly Language Expert) say on Unix or Windows then why not he will be
able to do the reverse engineering Process of extracting the source code
with 100% Reliability ??

I feel so that he should succeed with the Reverse Engineering Process of
Extracting the original source code(.c files) from .exe binary file.

Are you getting my Point?

Pls give your opinion on this asap

Thanks,

Prashant A




- Original Message -
From: Jay Blanchard [EMAIL PROTECTED]
To: Prashant Akerkar [EMAIL PROTECTED]; Christophe Chisogne
[EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Sent: Thursday, November 13, 2003 7:08 PM
Subject: RE: [PHP] Extracting Source code from Binary
Files(.dll,.exe.,class)


[snip]
 Step 1 :   .exe binary file -- Linker (assembly language)
.. .obj file/s

 Step 2 :.obj file/s  .c (Compiler) source code file/s

Is it Right or i am going somewhere illogical?
[/snip]

Really this cannot be done with any degree of reliability, if at all.
The .obj file has been stripped of things and has had additional code
placed into it. This is dependent upon the compiler (.obj files from
compiler to compiler have different looks to them based on several
items. Makefiles are different.).The .exe file is a translation of the
.obj into assembly language.

Does the compiled code you want to use have hooks into it, an API? If so
you can use PHP to interact with the API.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Extracting Source code from Binary Files(.dll,.exe.,class)

2003-11-13 Thread Dan Anderson
 Is it Right or i am going somewhere illogical?

Basically, source code is a convenient way to represent in a human
readable form what the machine is supposed to do.  Unless you happen to
be debugging it is unlikely that the source code will be saved within
the compiled file.  The problem is that there are many places in code
which are either irrelevant to the compiler (i.e. variable names) or
could be many things -- i.e. the code from all your headers and includes
is combine and you'll have problems figuring out what's what.

Think of it like blue prints.  You can recreate the original thing from
the blue prints, but anybody trying to create blueprints for the
original thing might create something different -- that can still be
used to assemble the original thing.

-Dan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Extracting Source code from Binary Files(.dll,.exe.,class)

2003-11-13 Thread Leif K-Brooks
Prashant Akerkar wrote:

I have a Query. Is it Possible to extract the source code from .exe,(VB,'C',C++),.dll(VB,'C',C++) or .class(java) files.
 

To some extent. All that's left intact by the compiler is the logic, not 
the exact source code. In theory, a utility to transform machine code 
logic into C (or another high-level language), but you wouldn't get the 
exact source code you compiled.

--
The above message is encrypted with double rot13 encoding.  Any unauthorized attempt 
to decrypt it will be prosecuted to the full extent of the law.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php