Add REP-prefix table
This commit is contained in:
8
decode.c
8
decode.c
@@ -38,6 +38,7 @@ typedef enum DecodeMode DecodeMode;
|
||||
#define ENTRY_TABLE72 4
|
||||
#define ENTRY_TABLE_PREFIX 5
|
||||
#define ENTRY_TABLE_VEX 6
|
||||
#define ENTRY_TABLE_PREFIX_REP 7
|
||||
#define ENTRY_MASK 7
|
||||
|
||||
#define ENTRY_UNPACK(table,kind,entry) do { \
|
||||
@@ -388,6 +389,13 @@ fd_decode(const uint8_t* buffer, size_t len_sz, int mode_int, uintptr_t address,
|
||||
prefixes &= ~(PREFIX_OPSZ | PREFIX_REPNZ | PREFIX_REP);
|
||||
ENTRY_UNPACK(table, kind, table[index]);
|
||||
}
|
||||
else if (kind == ENTRY_TABLE_PREFIX_REP)
|
||||
{
|
||||
// Discard 66h mandatory prefix
|
||||
uint8_t index = mandatory_prefix != 1 ? mandatory_prefix : 0;
|
||||
prefixes &= ~(PREFIX_REPNZ | PREFIX_REP);
|
||||
ENTRY_UNPACK(table, kind, table[index]);
|
||||
}
|
||||
|
||||
// For VEX prefix, we have to distinguish between VEX.W and VEX.L which may
|
||||
// be part of the opcode.
|
||||
|
||||
Reference in New Issue
Block a user