-
-
Notifications
You must be signed in to change notification settings - Fork 443
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
How to get operand info of ZydisEncodableInstruction? #559
Comments
What are you trying to achieve exactly? |
@mappzor I am trying to decode the operand mask.. |
You are not meant to access it at all. What's your use case? |
To generate random instructions with more constraints. example: |
Using internal structures for this is possible to an extent but you might want to just parse zydis-db in a way that's more suitable for you. Operand masks are just operand counts + basic operand types (register, memory, immediate or pointer). Accessing more detailed information about additional constraints can be rather convoluted. Table generation scripts for encoder are open-sourced here. |
Perhaps this can help you a little bit understand it, I also use the internal structures https://github.com/ZehMatt/x86Tester/blob/36532119a757e596256b99b29e22aeb01095d854/src/generator/generator.cpp#L519-L566 |
ZydisEncodableInstruction_ has this member:
ZyanU16 operand_mask;
How do I get the operand count?
How do I get the exact info of each operand, like register type (or memory type), count, size, and addressing mode?
I see you can only get it via decoding an instruction, how do i get it while encoding?
edit: in other words, how can I decode the operand mask
The text was updated successfully, but these errors were encountered: