diff options
author | Mark Scott <nasm@mscott.cx> | 2015-11-03 23:09:05 +0300 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2015-11-03 23:09:05 +0300 |
commit | db6ecf9b76a25c465887946fe70e74b3dcdce234 (patch) | |
tree | 71673385fe64c9319158c001af4414c1fa269238 | |
parent | be8a5c8f2dbde47719796209a796cd7ccea32e54 (diff) | |
download | nasm-db6ecf9b76a25c465887946fe70e74b3dcdce234.tar.gz |
disasm: Fix for disassembly of BOUND
The opcode for BOUND, 62h, has a different meaning in long mode - it is the
prefix for EVEX instructions. ndisasm did not take this into account and always
tried to disassemble 62h back to an EVEX instruction.
Attached patch only permits EVEX disassembly if bitness is 64.
In 16/32 bit mode 62h will be not be a prefix and so disassemble
to BOUND.
Signed-off-by: Mark Scott <nasm@mscott.cx>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
-rw-r--r-- | disasm.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1216,7 +1216,7 @@ int32_t disasm(uint8_t *data, char *output, int outbufsize, int segsize, case 0x62: { uint8_t evex_p0 = data[1] & 0x0f; - if (segsize == 64 || + if (segsize == 64 && ((evex_p0 >= 0x01) && (evex_p0 <= 0x03))) { data++; /* 62h EVEX prefix */ prefix.evex[0] = *data++; |