boomerang
boomerang copied to clipboard
Add support for pseudo functions / intrinsics
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.
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".