New Newbie question , decompiling C++

J

Juda

I know you have heard this a thousand times before, and I am not
asking where I can get a program to decompile C++. How to decompile
C++, or whether anyone knows about of any information on decompiling C++.

I am asking, will it ever be possible to decompile C++.


--
The truth depends on, or is only arrived at by, a legitimate
deduction from all the facts which are truly material.
Whispering tongues can poison truth. --Coleridge

Reality is a figment of the imagination for a k00k.
- Juda
 
S

Stuart Golodetz

,---------------------------------------------------------------------------
------------------------------------.
|---[From: Aggro <[email protected]>:
|---[Date: Tue, 01 Jul 2003 05:00:10 GMT:
|---[|---[wrote:
|
|---Juda wrote:
|---> I know you have heard this a thousand times before, and I am not
|---> asking where I can get a program to decompile C++. How to decompile
|---> C++, or whether anyone knows about of any information on decompiling
C++.
|--->
|---> I am asking, will it ever be possible to decompile C++.
|---
|---Yes, you can decompile C++ into Assembly, no problem there. But you
|---can't decompile C++ to original C++ code, unless you for example save
|---the full source code into compiled program, for debug information. There
|---is just too much information lost during the compilation.
Do you think in a few year that someone very talented may be able to decompile
C++? Or is this never going to be possible.

It's not that no-one's talented enough to do it, it's that it's technically
impossible to recover the original source file from the executable. It's
theoretically possible (though exceedingly difficult with something like
C++) to get *a* source file out, which when recompiled would give you the
same executable you started with. However, it will never be the original
source file because you've lost too much information in the compilation
process (see Charles LaCour's post for an example).
Someone I know once stated "If it can be compiled, it can be decompiled"
Do you believe this statement? Or do you think it is an incorrect
assertion?

The thing is, can it be compiled to anything vaguely useful? It's not much
good if it decompiles your code to something a bit like this:

// Slightly exaggerated example
void f1232412312312(int a32132198490, int a32132188490)
{
//...
}

Who'd want to read through and decipher thousands of lines of that?

HTH,

Stuart.
 
L

-linux_lad

Juda said:
I know you have heard this a thousand times before, and I am not
asking where I can get a program to decompile C++. How to decompile
C++, or whether anyone knows about of any information on decompiling C++.

I am asking, will it ever be possible to decompile C++.

This question is probably not appropriate for this for this group, and has already
been asked a million times, but for the sake of completeness, I'll cover it again.
C++ is not now, and is unlikely to ever be subject to "decompilation" as it is
commonly defined. As I have already stated in the other newsgroup, retrieving source
code from a compiled object would require an astronomical degree of effort. Yes, you
can view the assembler in any compiled object, but that is essentially meaningless.
Assembler is just the language the compiled object uses to talk to the computer,
it's not C++ source code and cannot be used to extrapolate the source code in any
meaningful way. When a C++ source file is compiled, lots of things happen that are
intimately dependant upon the relationship between the compiler, the host machine,
and the options passed to the compiler. Accurately predicting all of these variables
would be like predicting the lottery. Yes, some people claim to have decompilers,
and some people claim to have been present when the object was reduced to source
code, and some people have been able to extrapolate the behavior of a trivial app
and write source which mimics the original application, but I can assure you that
there has been no successful decompilation of any application of substance. If
someone claims to have witnessed or taken part in this, they probably saw an
academic demonstration..that means that the outcome was known before the
demonstration was concocted. If such a product existed, there would be no software
industry because no one would be able to make any money. If it were possible (even
nominally) to decompile a C++ or Delphi or Visual Basic 5+ applications, there would
be no "warez" scene, no "cracks" and no "serials". Anyone who wanted to could just
remove the registration mechanism. There would be no Microsoft, No Novell, and no
Oracle either. No software publisher could survive if their products could be
converted to source code.

Simply put, decompilation is like time travel, is only a concept at the moment. It
may be possible in the distant future if some miraculous new tool is developed, but
that is about as likely as finding a terminating number for pi...it may exist, we
can't prove it doesn't, but it's beyond our capability at this time.
 
J

John Carson

-linux_lad said:
Simply put, decompilation is like time travel, is only a concept at
the moment. It may be possible in the distant future if some
miraculous new tool is developed, but that is about as likely as
finding a terminating number for pi...it may exist, we can't prove it
doesn't, but it's beyond our capability at this time.

No terminating number for pi exists. This was proved in 1768.

http://www-groups.dcs.st-and.ac.uk/history/Mathematicians/Lambert.html
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top