Can we generate a C++ source code from the binary file?

Guys I need your help, (again)
I'm getting different answers to the question:
Can we generate a C++ source code from the binary file?
Some say it's impossible!!! some say I can.
Can some clear it up for me please.
Many thanks...
[280 byte] By [Salvadoravi] at [2007-11-20 11:47:28]
# 1 Re: Can we generate a C++ source code from the binary file?
You can generate assembly from a binary file.

*If* that file has debug symbols, the assembly may even be moderately readable. In that case, it may be possible to generate equivalent C++ source.

If there are no debug symbols, things get a lot harder.

In either case, I wouldn't expect the generated source code to be terribly elegant.
Lindley at 2007-11-9 1:26:09 >
# 2 Re: Can we generate a C++ source code from the binary file?
Some say it's impossible!!! some say I can.
It's not impossible, you CAN generate source code from a binary file. However the source that would be generated would be horribly ugly and would probably not resemble the original code at all. Variable names are stripped out so you wouldn't have any of the names, some code gets stripped out if the compiler thinks its redundant or it could do it a better way, etc.

So the people who say you can are pushing the word "can" to its limit. You CAN do it, but you wouldn't really want to.
IllegalCharacter at 2007-11-9 1:27:17 >
# 3 Re: Can we generate a C++ source code from the binary file?
Some say it's impossible!!! some say I can.Both answers might be correct, depending on the situation. This depends highly on the form of the binary file, particularly on the content and level of debug information available. Some binary executable files contain no debug information. These can only be disassembled into non-descriptive assembler codes. Other kinds of binary files contain full source-level debug information suitable for a full in-circuit-emulator. These can be used by the emulator software to create full source-level debug information.

You must be clear about what you actually mean with this kind of generic question. The answer can be highly dependent on the situation.

Sincerely, Chris.
dude_1967 at 2007-11-9 1:28:13 >