zyantific / zydis

Fast and lightweight x86/x86-64 disassembler and code generation library
https://zydis.re
MIT License
3.3k stars 427 forks source link

Encoder generates wrong relative offset with bnd prefix #463

Closed ZehMatt closed 7 months ago

ZehMatt commented 7 months ago

[ERR] Assertion failed: bnd jnb 0x7FF64AEE5472 == bnd jnb 0x7FF64AEE5473

Found this one while adding rewriter validation to my instrumentation tool that uses Zydis, the offset is off by 1 when it contains ZYDIS_ATTRIB_HAS_BND

It seems that ZydisTestEncoderAbsolute doesn't cover this case, adding the prefix makes it fail the tests.