Decompilation is the process of converting executable binary code ready for execution on a physical or virtual machine into comprehensible high-level language code.
Typically compilation has been to the instructions executed by the CPU of the target architecture, e.g. x86, ARM etc. Another possibility is to compile to an intermediate 'virtual machine', which then interprets each instruction one at a time or compiles it to the underlying machine code in a process known a Just In Time compilation (JIT). One of the earliest examples of this is the O-code machine, developed by Martin Richards in the late 1960s to give platform independence to BCPL. The most prevalent example of this sort of virtual machine in existence today is the Java Virtual Machine (JVM), written by Sun Microsystems to execute intermediate code compiled from their Java language.
When a program is compiled to the machine instructions of the underlying architecture, it becomes very difficult for someone to understand the code if they only have the binary â€” this is after all the whole reason compilers exist. Decompilation is the process of converting a binary back to some high-level language, although not necessarily the same language that the code was compiled from. Compilation almost always loses information such as local variable names and explicit identification of control structures. As well as this many compilers perform optimisations which cause the compiled code to bear even less resemblance to the original code. For example, loop unrolling is a technique used to remove the number of branches a program must make.