Hacker News new | past | comments | ask | show | jobs | submit login

But what exactly is the difference to a decompiler then?



A decompiler translates bytecote into a structured program.

https://en.wikipedia.org/wiki/Structured_programming


Probably depends on your definition of a decompiler. For me, a decompiler reverses to some extend the operation of a compiler. Variables instead of registers, function call arguments instead of stack pushs, etc.

Of course, you could also say that a decompiler is any tool that produces something from a binary that you can compile again. But in that case, I could claim that this here is also a decompiled program:

   byte[] programbinary={ put binary of the program here };
   runEmulator(programbinary);


A compiler has optimization steps. Rather than going straight from human readable C to binary, it compiles to an IR and then uses some heuristics to create binary that is more efficient for the machine to execute.

I feel like you're effectively asking for an optimization step. Decompile to an IR, and then use some heuristics to get back to C that is more efficient for humans to read.

And if a compiler without an optimizer is still a compiler, then a decompiler without an "optimizer" should still be called a decompiler.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: