mirror of
https://github.com/capstone-engine/capstone.git
synced 2025-02-15 03:47:49 +00:00
x86: handle 16bit segment bound for JMP. bug reported by Pancake & Anton Kochkov
This commit is contained in:
parent
91a19232a2
commit
2d34251889
@ -12,8 +12,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
/* Capstone Disassembler Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013> */
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#include <ctype.h>
|
||||
#include <inttypes.h>
|
||||
@ -354,6 +354,10 @@ static void printPCRelImm(MCInst *MI, unsigned OpNo, SStream *O)
|
||||
else
|
||||
SStream_concat(O, "-%"PRIu64, -imm);
|
||||
} else {
|
||||
// handle 16bit segment bound
|
||||
if (MI->csh->mode == CS_MODE_16 && imm > 0x100000)
|
||||
imm -= 0x10000;
|
||||
|
||||
if (imm > HEX_THRESHOLD)
|
||||
SStream_concat(O, "0x%"PRIx64, imm);
|
||||
else
|
||||
|
@ -12,8 +12,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
/* Capstone Disassembler Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013> */
|
||||
/* Capstone Disassembly Engine */
|
||||
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2014 */
|
||||
|
||||
#include <ctype.h>
|
||||
#include <inttypes.h>
|
||||
@ -392,6 +392,10 @@ static void printPCRelImm(MCInst *MI, unsigned OpNo, SStream *O)
|
||||
else
|
||||
SStream_concat(O, "-%"PRIu64, -imm);
|
||||
} else {
|
||||
// handle 16bit segment bound
|
||||
if (MI->csh->mode == CS_MODE_16 && imm > 0x100000)
|
||||
imm -= 0x10000;
|
||||
|
||||
if (imm > HEX_THRESHOLD)
|
||||
SStream_concat(O, "0x%"PRIx64, imm);
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user