BoomerangDecompiler / boomerang

Boomerang Decompiler - Fighting the code-rot :)
Other
367 stars 59 forks source link

Add support for pseudo functions / intrinsics #158

Open ceeac opened 5 years ago

ceeac commented 5 years ago

Currently, instructions with unknown semantics are treated as NOP. This causes a multitude of problems; most importantly, instructions with special semantics are decompiled wrong. For example, x86 executables containing a CPUID instruction are decompiled wrong because the semantics of CPUID cannot be represented with the current IR. A solution for this would be to add support for pseudo functions to SSL; these pseudo functions cannot be renamed and are either directly emitted as intrinsics (e.g. __cpuid(foo, bar)) or maybe with a __pseudo_ prefix if the pseudo function does not correspond to a known intrinsic.

cb88 commented 5 years ago

So, I think the problem here is that it typically is part of the system provided code anyway... and written in asm there, so there isn't anything to decompile.

I think some decompilers can do things like take the system libraries and headers you are decompiling against and figure this out correctly though... otherwise why not just reemit the ASM rather than some fake "intrinsic".