Decompilation is actually wrong. Decompilers compile object code into a source representation. In many ways, they are easier to write than traditional compilers - the "source" code is already checked by syntax and is usually very accurately formatted.
They create a table of characters (addresses) and create a representation of the target application language. A common difficulty is that the source compiler optimized the source application to a greater or lesser extent by removing common subexpressions, pushing persistent code out of loops, and many other similar methods. It is often impossible to imagine in the target language.
In cases where the source is for a well-defined virtual machine, often this optimization remains in the JIT compiler, and the resulting decompiled code is very readable - in many cases it is almost identical to the original. Compilers of this type often leave some or all of the characters in the object code, allowing them to be recovered. Others include line numbers that help you debug and troubleshoot. All this helps to restore the source code.
As a counter, there are code obfuscators that intentionally perform conversions to code that prevent simple recovery of the original source by scrambling the names, changing the sequence code is generated (without changing its resulting value) and introducing constructs for which there is no equivalent of the source language.
Pekka source share