boomerang icon indicating copy to clipboard operation
boomerang copied to clipboard

Add support for pseudo functions / intrinsics

Open ceeac opened this issue 6 years ago • 1 comments

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.

ceeac avatar Dec 19 '18 10:12 ceeac

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".

cb88 avatar Feb 05 '19 19:02 cb88