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

ZYDIS_VERSION macro is not usable in conditional preprocessor directives #530

Open
abouvier opened this issue Oct 22, 2024 · 0 comments
Open
Labels
A-utils Area: Utilities (tools, examples, fuzzing) C-enhancement Category: Enhancement of existing features P-low Priority: Low

Comments

@abouvier
Copy link
Contributor

ZYDIS_VERSION/ZYDIS_VERSION_* macros are defined as C code with type information, not as integer constants:

#define ZYDIS_VERSION (ZyanU64)0x0004000000000000
#define ZYDIS_VERSION_MAJOR(version) (ZyanU16)(((version) & 0xFFFF000000000000) >> 48)

This prevents to do something like this:

#if ZYDIS_VERSION_MAJOR(ZYDIS_VERSION) >= 5
    (...)
#else
    (...)
#endif

Can you provide a way to do version check in preprocessor? By removing the type or by creating a new raw version macro for example.

@athre0z athre0z added C-enhancement Category: Enhancement of existing features P-low Priority: Low A-utils Area: Utilities (tools, examples, fuzzing) labels Oct 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-utils Area: Utilities (tools, examples, fuzzing) C-enhancement Category: Enhancement of existing features P-low Priority: Low
Projects
None yet
Development

No branches or pull requests

2 participants