Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for pseudo functions / intrinsics #158

Open
ceeac opened this issue Dec 19, 2018 · 1 comment
Open

Add support for pseudo functions / intrinsics #158

ceeac opened this issue Dec 19, 2018 · 1 comment
Labels
dom: decoder (P/I) Related to instruction decoding / frontend dom: decompilation (P/I) Covers all middle end related issues dom: parsers (P/I) Covers all parser related issues type: feature (P/I) Brand new functionality

Comments

@ceeac
Copy link
Member

ceeac commented Dec 19, 2018

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 ceeac added type: feature (P/I) Brand new functionality dom: decoder (P/I) Related to instruction decoding / frontend dom: decompilation (P/I) Covers all middle end related issues dom: parsers (P/I) Covers all parser related issues labels Dec 19, 2018
@cb88
Copy link

cb88 commented Feb 5, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dom: decoder (P/I) Related to instruction decoding / frontend dom: decompilation (P/I) Covers all middle end related issues dom: parsers (P/I) Covers all parser related issues type: feature (P/I) Brand new functionality
Projects
None yet
Development

No branches or pull requests

2 participants