Reworked encoding of branching instructions (Fixes #268, Fixes #266)#284
Reworked encoding of branching instructions (Fixes #268, Fixes #266)#284athre0z merged 2 commits intozyantific:masterfrom
Conversation
c939ac7 to
8e70cda
Compare
|
LGTM! New API looks nice and documentation is well done. Just roughly swiped over the code details and noticed the special case handling for certain instructions by checking their mnemonics. While I don't really like that approach, I don't have a better solution in mind for that right now (besides adding new flags ofc. 😋). It might cause complications if - at some point - we can finally allow the user to choose what kind of extensions should be build into the binary (using CMake options). But until then, it's okay for me to leave the hardcoded checks like they are right now. |
|
Yeah, I didn't like hardcoding With bugged |
|
LGTM from my side, maybe @athre0z want's to have a look as well. |
athre0z
left a comment
There was a problem hiding this comment.
Awesome changes, thanks a lot for that! Definitely makes for a much better UX. I'll merge this later after I pushed the corresponding new fuzzing corpus.
| // Assemble `ret`. | ||
| memset(&req, 0, sizeof(req)); | ||
| req.mnemonic = ZYDIS_MNEMONIC_RET; | ||
| req.branch_type = ZYDIS_ENCODABLE_BRANCH_TYPE_NEAR64; |
There was a problem hiding this comment.
This is my favourite line in this PR! :)
|
Change of mind: did it immediately so I don't forget it later (also uploaded new corpus). :) |
Fixes #268
Fixes #266