Exetools

Exetools (https://forum.exetools.com/index.php)
-   General Discussion (https://forum.exetools.com/forumdisplay.php?f=2)
-   -   decompiling back to C++? (https://forum.exetools.com/showthread.php?t=4573)

Rhodium 07-09-2004 06:34

decompiling back to C++?
 
Say you spent billions of dollars and hired all the best programmers in the world. Would they be able to come up with a program that decompiles applications back to their true C++ code?

Say you hired the worlds 100 best programmers and offered them 10 million dollars each if they did it.

Hypothetical.

JMI 07-09-2004 07:08

And how long did you give them to accomplish the task? :D

Regards,

Rhodium 07-09-2004 07:57

Give them a year.

fantast_xue 07-09-2004 20:58

They would failed. :eek:
But I think maybe scientists could do this job, with ten or more years. :D

Sarge 07-09-2004 21:43

Yeh, but what if those programmers were hired away from MS? What if they were the same programmers that wrote the C++ compiler in the first place? Maybe that would give them a edge; maybe they could do it in a year or less?

Sarge

Lunar_Dust 07-09-2004 22:04

I don't know, there are numerous optimizations which can result in totally throwing away the original source. Of course, this would also have the effect of optimizing the source, wouldn't it? But it would probably be much harder to read, and you wouldn't have comments anyway.

The problem is that converting back to C++ code doesn't really help you all that much, because you won't have comments, and you won't have variable names which make sense.

You will have constructs, and code flow.

But those you can still get from ASM disassemblers anyway (like IDA). Knowing the original high-level intent of the programmer (why something was done certain way, variable names, how variables connect to each other) in enough of a way to reconstruct a source is pretty much impossible. C++ really isn't a round trip language ( unlike .NET languages).

-Lunar

SHaG 07-10-2004 04:17

Check:
hxxp://boomerang.sourceforge.net

tAz 07-10-2004 08:44

true c++ code?
i wouldn't say impossible, but improbable.

decompilers will deal with the lost of code due to optimizations, and of course, the user-defined tokens (ex. variables, function names).

reusable code should be the target of decompilers, and until someone creates a program to analyze algorithms, and properly name all of the variables and functions, not to mention profiling the programmer on his/her preferences in the use of variables, we're still a long way to go before seeing the original code from a compiled sample.

_Servil_ 07-10-2004 15:17

it's impossible $10,000,000 is quite few.

JMI 07-10-2004 16:44

Ah, but he said $10 Million to EACH of the world's 100 best programers. ;)

Regards,

_Servil_ 07-10-2004 17:40

nevertheless :D

Sarge 07-11-2004 21:53

I like this comment:
>reusable code should be the target of decompilers<

but I don't necessarily see the need for EXACT/original source code re-creation, especially where variables are concerned. As long as the decompiler proggie keeps them straight, I'd think it's ok for the compiler to spit out a variable named "Var1", even though the source code was "MyVar", as long as "Var1" was consistantly named whenever that specific variable was actually used in the target proggie.

Do we want this decompiler to give us, for example, a structure definition too, or just give us the operations on the structures elements, and let the compiler (when operating on our recovered code) generate error messages telling us what (syntatically) is wrong that we poor humans would have to clean up (in this case, by defining that structure ourselves)? This would certainly result in useable, runnable code, but obviously not the EXACT/original source code. How close to the EXACT/original source code are we talking?

Further, if you actually reproduced runnable code, but it was only 80% (or 70%? or maybe only 50%) of the EXACT/original code, and therefore needed some additional user input, would people buy it?

Sarge

hmora 07-12-2004 09:21

Disassembler
 
sorry, but I don't know much about this topic, but I have used IDA a few times. My question is: is always possible to disassemble a program???
what are those exe protectors for?

Thanks in advance.

santa_kewl 07-12-2004 09:44

[what are those exe protectors for?]

To protect the exe from disassembled

To protect the exe from debugging

Satyric0n 07-12-2004 09:55

Quote:

Originally Posted by hmora
sorry, but I don't know much about this topic, but I have used IDA a few times. My question is: is always possible to disassemble a program???
what are those exe protectors for?

Thanks in advance.

Yes, it is always possible to disassemble a program, but if the program is protected/packed, the code you see disassembled is the unpacking/protector code; the actual program gets unpacked at runtime. So, you either need to unpack the program to see its code in the disassembler, or you just look at the code at runtime using a debugger.

Regards


All times are GMT +8. The time now is 04:44.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX