Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Serious Question

Name: Anonymous 2011-12-28 19:06

If disassembling a program is a easy task to do and compiling a program from org src -> assembly -> machine code is a easy task then why is machine code -> assembly -> org src such a hard task?


For languages like C/C++,etc

Name: Anonymous 2011-12-28 19:08

Because the machine code generated by any real-world compiler doesn't look anything like the original source due to OPTIMIZATION.

Name: Anonymous 2011-12-28 19:14

>>2
But then wouldn't the decompiled org src then look like a super OPTIMIZED version of the true org src?



A better question: why can't be UNOPTIMIZED

Name: Anonymous 2011-12-28 19:14

It's a lossy transform.

Name: Anonymous 2011-12-28 19:14

>>3
be
we*

Name: Anonymous 2011-12-28 19:19

>>3
But then wouldn't the decompiled org src then look like a super OPTIMIZED version of the true org src?
Sure it would. There are such `decompilers', but their output isn't any more helpful than just reading the disassembly. The optimizations performed on non-trivial programs can be surprisingly brutal.

You might want to read a book about how compilers actually work. Aho-Lam-Sethi-Ullman is ok.

Name: Anonymous 2011-12-28 19:19

>>3

You can create constructs in assembly that don't quite exist in C, or at least just end up looking like a bunch of gotos and arithmetic with uninformative variable names.

Name: Anonymous 2011-12-28 19:34

It's not that hard, but no one really cares about this area of research much.

Name: Anonymous 2011-12-28 19:46

>>6
Aho-Lam-Sethi-Ullman is ok.
40% Increased Attack Speed
Prevent Monster Heal
66% Chance of Open Wounds
33% Chance of Deadly Strike
7% Life Stolen per hit

... yeah, more than OK, I guess.

Name: Anonymous 2011-12-28 21:04

>>4
This. A lot of information is lost and while decompiled code can be semantically correct (depending on assembly output, original compiler and the decompiler's implementation), it may not be aestheticly pleasing if the compiler was too abusive with the original code or the decompiler does not have a good understanding of the way the compiler works (as well as various ways of translating the listing back into a tree and matching various patterns the compiler used, as well as doing various data and code flow analyses).

In practice decompilation produces best results when done on code with enough information being preserved in the bytecode, such as VM languages like Java or C#. For x86 or other 'real' architectures, it tends to be possible to decompile C code to some intermediate quality if one provides enough data about types and structures used, otherwise the output may be quite ugly, in general, the more detail you can infer, the better the quality of the decompiled output. Humans are still the best decompilers and I expect this to remain true at least until we solve that AGI problem.

Name: DUBS LIBERATION FRONT 2012-03-24 18:32

NON-DUBS SHALL BE CLEANSED FROM THE EARTH!

Name: Anonymous 2013-03-14 11:19

>>1
a easy task

I think you meant "an easy task"

Don't change these.
Name: Email:
Entire Thread Thread List