Applied some of the syntax recomandations from https://cdrdv2.intel.com/v1/dl/getContent/817241.

master v2.1.3
Andrei Vlad LUTAS 2 months ago
parent 02cbe6a298
commit 37a8c94bc7

@ -5,6 +5,28 @@ All notable (user-facing) changes to this project will be documented in this fil
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [2.1.3] - 2024-03-04
### Changed
- Aligned BDDISASM APX instructions syntax with some of the Intel recomandations (using the suffix notation for `NF` and `ZU` indications, using finite set notation for `DFV` operands).
### Disassembly differences
- The `ZU` indication is appended as a mnemonic sufix, as per recomandations. However, in case of `SETcc` instructions, BDDISASM will append the `ZU` indication AFTER the condition code (similar to `CMPccXADD` and with initial `SETcc.ZU` specification).
- The `DFV` (default flags value) operand obeys the finite set notation, but it is placed as the last operand of the instruction.
## [2.1.2] - 2024-02-27
### Added
- `Read` access for the `rIP` operand for the `SYSCALL` instruction.
- `SCS`, `rCX`, `rDX` operands for the `SYSEXIT` instruction.
## [2.1.1] - 2024-02-26
### Added
- `Read` access for the `rIP` operand for some `CALL` instructions.
## [2.1.0] - 2024-02-20

@ -311,14 +311,14 @@ NdToText(
// Store NF specifier, if NoFlags presetn.
if (Instrux->HasNf)
{
res = nd_strcat_s(Buffer, BufferSize, "{NF}");
res = nd_strcat_s(Buffer, BufferSize, "NF");
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
// Store ZU specifier, if ZeroUpper present.
if (Instrux->HasZu)
{
res = nd_strcat_s(Buffer, BufferSize, "{ZU}");
res = nd_strcat_s(Buffer, BufferSize, "ZU");
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
@ -710,17 +710,39 @@ NdToText(
case ND_OP_DFV:
{
status = NdSprintf(temp, sizeof(temp), "%c%c%c%c",
pOp->Info.DefaultFlags.OF ? '1' : '0',
pOp->Info.DefaultFlags.SF ? '1' : '0',
pOp->Info.DefaultFlags.ZF ? '1' : '0',
pOp->Info.DefaultFlags.CF ? '1' : '0');
if (!ND_SUCCESS(status))
ND_BOOL comma = ND_FALSE;
res = nd_strcat_s(Buffer, BufferSize, "{dfv=");
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
if (pOp->Info.DefaultFlags.OF)
{
return status;
res = nd_strcat_s(Buffer, BufferSize, "OF");
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
comma = ND_TRUE;
}
res = nd_strcat_s(Buffer, BufferSize, temp);
if (pOp->Info.DefaultFlags.SF)
{
res = nd_strcat_s(Buffer, BufferSize, comma ? ",SF" : "SF");
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
comma = ND_TRUE;
}
if (pOp->Info.DefaultFlags.ZF)
{
res = nd_strcat_s(Buffer, BufferSize, comma ? ",ZF" : "ZF");
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
comma = ND_TRUE;
}
if (pOp->Info.DefaultFlags.CF)
{
res = nd_strcat_s(Buffer, BufferSize, comma ? ",CF" : "CF");
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
res = nd_strcat_s(Buffer, BufferSize, "}");
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
}
break;

File diff suppressed because it is too large Load Diff

@ -0,0 +1,161 @@
0000000000000000 626c8902813ebdbdbdbd CCMPC qword ptr [r22], 0xbdbdbdbd, {dfv=OF,SF,ZF}
DSIZE: 64, ASIZE: 64, VLEN: -
ISA Set: APX_F, Ins cat: APX, CET tracked: no
CPUID leaf: 0x00000007, sub-leaf: 0x00000001, reg: edx, bit: 21
EVEX Tuple Type: None
Exception class: APX, exception type: APX-EVEX-CCMP
FLAGS access
CF: t,
Valid modes
R0: yes, R1: yes, R2: yes, R3: yes
Real: no, V8086: no, Prot: yes, Compat: yes, Long: yes
SMM on: yes, SMM off: yes, SGX on: yes, SGX off: yes, TSX on: yes, TSX off: yes
VMXRoot: yes, VMXNonRoot: yes, VMXRoot SEAM: yes, VMXNonRoot SEAM: yes, VMX off: yes
Valid prefixes
REP: no, REPcc: no, LOCK: no
HLE: no, XACQUIRE only: no, XRELEASE only: no
BND: no, BHINT: no, DNT: no
Operand: 0, Acc: R-, Type: Memory, Size: 8, RawSize: 8, Encoding: M,
Segment: 3, Base: 22,
Operand: 1, Acc: R-, Type: Immediate, Size: 4, RawSize: 4, Encoding: I
Operand: 2, Acc: R-, Type: Default flags, Size: 0, RawSize: 0, Encoding: V
Operand: 3, Acc: -W, Type: Register, Size: 8, RawSize: 8, Encoding: S, RegType: Flags, RegSize: 8, RegId: 0, RegCount: 1
000000000000000A 626c9902813ebdbdbdbd CCMPC qword ptr [r22], 0xbdbdbdbd, {dfv=OF,SF}
DSIZE: 64, ASIZE: 64, VLEN: -
ISA Set: APX_F, Ins cat: APX, CET tracked: no
CPUID leaf: 0x00000007, sub-leaf: 0x00000001, reg: edx, bit: 21
EVEX Tuple Type: None
Exception class: APX, exception type: APX-EVEX-CCMP
FLAGS access
CF: t,
Valid modes
R0: yes, R1: yes, R2: yes, R3: yes
Real: no, V8086: no, Prot: yes, Compat: yes, Long: yes
SMM on: yes, SMM off: yes, SGX on: yes, SGX off: yes, TSX on: yes, TSX off: yes
VMXRoot: yes, VMXNonRoot: yes, VMXRoot SEAM: yes, VMXNonRoot SEAM: yes, VMX off: yes
Valid prefixes
REP: no, REPcc: no, LOCK: no
HLE: no, XACQUIRE only: no, XRELEASE only: no
BND: no, BHINT: no, DNT: no
Operand: 0, Acc: R-, Type: Memory, Size: 8, RawSize: 8, Encoding: M,
Segment: 3, Base: 22,
Operand: 1, Acc: R-, Type: Immediate, Size: 4, RawSize: 4, Encoding: I
Operand: 2, Acc: R-, Type: Default flags, Size: 0, RawSize: 0, Encoding: V
Operand: 3, Acc: -W, Type: Register, Size: 8, RawSize: 8, Encoding: S, RegType: Flags, RegSize: 8, RegId: 0, RegCount: 1
0000000000000014 626cc902813ebdbdbdbd CCMPC qword ptr [r22], 0xbdbdbdbd, {dfv=SF,ZF}
DSIZE: 64, ASIZE: 64, VLEN: -
ISA Set: APX_F, Ins cat: APX, CET tracked: no
CPUID leaf: 0x00000007, sub-leaf: 0x00000001, reg: edx, bit: 21
EVEX Tuple Type: None
Exception class: APX, exception type: APX-EVEX-CCMP
FLAGS access
CF: t,
Valid modes
R0: yes, R1: yes, R2: yes, R3: yes
Real: no, V8086: no, Prot: yes, Compat: yes, Long: yes
SMM on: yes, SMM off: yes, SGX on: yes, SGX off: yes, TSX on: yes, TSX off: yes
VMXRoot: yes, VMXNonRoot: yes, VMXRoot SEAM: yes, VMXNonRoot SEAM: yes, VMX off: yes
Valid prefixes
REP: no, REPcc: no, LOCK: no
HLE: no, XACQUIRE only: no, XRELEASE only: no
BND: no, BHINT: no, DNT: no
Operand: 0, Acc: R-, Type: Memory, Size: 8, RawSize: 8, Encoding: M,
Segment: 3, Base: 22,
Operand: 1, Acc: R-, Type: Immediate, Size: 4, RawSize: 4, Encoding: I
Operand: 2, Acc: R-, Type: Default flags, Size: 0, RawSize: 0, Encoding: V
Operand: 3, Acc: -W, Type: Register, Size: 8, RawSize: 8, Encoding: S, RegType: Flags, RegSize: 8, RegId: 0, RegCount: 1
000000000000001E 626cd902813ebdbdbdbd CCMPC qword ptr [r22], 0xbdbdbdbd, {dfv=SF}
DSIZE: 64, ASIZE: 64, VLEN: -
ISA Set: APX_F, Ins cat: APX, CET tracked: no
CPUID leaf: 0x00000007, sub-leaf: 0x00000001, reg: edx, bit: 21
EVEX Tuple Type: None
Exception class: APX, exception type: APX-EVEX-CCMP
FLAGS access
CF: t,
Valid modes
R0: yes, R1: yes, R2: yes, R3: yes
Real: no, V8086: no, Prot: yes, Compat: yes, Long: yes
SMM on: yes, SMM off: yes, SGX on: yes, SGX off: yes, TSX on: yes, TSX off: yes
VMXRoot: yes, VMXNonRoot: yes, VMXRoot SEAM: yes, VMXNonRoot SEAM: yes, VMX off: yes
Valid prefixes
REP: no, REPcc: no, LOCK: no
HLE: no, XACQUIRE only: no, XRELEASE only: no
BND: no, BHINT: no, DNT: no
Operand: 0, Acc: R-, Type: Memory, Size: 8, RawSize: 8, Encoding: M,
Segment: 3, Base: 22,
Operand: 1, Acc: R-, Type: Immediate, Size: 4, RawSize: 4, Encoding: I
Operand: 2, Acc: R-, Type: Default flags, Size: 0, RawSize: 0, Encoding: V
Operand: 3, Acc: -W, Type: Register, Size: 8, RawSize: 8, Encoding: S, RegType: Flags, RegSize: 8, RegId: 0, RegCount: 1
0000000000000028 626ce902813ebdbdbdbd CCMPC qword ptr [r22], 0xbdbdbdbd, {dfv=ZF}
DSIZE: 64, ASIZE: 64, VLEN: -
ISA Set: APX_F, Ins cat: APX, CET tracked: no
CPUID leaf: 0x00000007, sub-leaf: 0x00000001, reg: edx, bit: 21
EVEX Tuple Type: None
Exception class: APX, exception type: APX-EVEX-CCMP
FLAGS access
CF: t,
Valid modes
R0: yes, R1: yes, R2: yes, R3: yes
Real: no, V8086: no, Prot: yes, Compat: yes, Long: yes
SMM on: yes, SMM off: yes, SGX on: yes, SGX off: yes, TSX on: yes, TSX off: yes
VMXRoot: yes, VMXNonRoot: yes, VMXRoot SEAM: yes, VMXNonRoot SEAM: yes, VMX off: yes
Valid prefixes
REP: no, REPcc: no, LOCK: no
HLE: no, XACQUIRE only: no, XRELEASE only: no
BND: no, BHINT: no, DNT: no
Operand: 0, Acc: R-, Type: Memory, Size: 8, RawSize: 8, Encoding: M,
Segment: 3, Base: 22,
Operand: 1, Acc: R-, Type: Immediate, Size: 4, RawSize: 4, Encoding: I
Operand: 2, Acc: R-, Type: Default flags, Size: 0, RawSize: 0, Encoding: V
Operand: 3, Acc: -W, Type: Register, Size: 8, RawSize: 8, Encoding: S, RegType: Flags, RegSize: 8, RegId: 0, RegCount: 1
0000000000000032 626cf102813ebdbdbdbd CCMPC qword ptr [r22], 0xbdbdbdbd, {dfv=CF}
DSIZE: 64, ASIZE: 64, VLEN: -
ISA Set: APX_F, Ins cat: APX, CET tracked: no
CPUID leaf: 0x00000007, sub-leaf: 0x00000001, reg: edx, bit: 21
EVEX Tuple Type: None
Exception class: APX, exception type: APX-EVEX-CCMP
FLAGS access
CF: t,
Valid modes
R0: yes, R1: yes, R2: yes, R3: yes
Real: no, V8086: no, Prot: yes, Compat: yes, Long: yes
SMM on: yes, SMM off: yes, SGX on: yes, SGX off: yes, TSX on: yes, TSX off: yes
VMXRoot: yes, VMXNonRoot: yes, VMXRoot SEAM: yes, VMXNonRoot SEAM: yes, VMX off: yes
Valid prefixes
REP: no, REPcc: no, LOCK: no
HLE: no, XACQUIRE only: no, XRELEASE only: no
BND: no, BHINT: no, DNT: no
Operand: 0, Acc: R-, Type: Memory, Size: 8, RawSize: 8, Encoding: M,
Segment: 3, Base: 22,
Operand: 1, Acc: R-, Type: Immediate, Size: 4, RawSize: 4, Encoding: I
Operand: 2, Acc: R-, Type: Default flags, Size: 0, RawSize: 0, Encoding: V
Operand: 3, Acc: -W, Type: Register, Size: 8, RawSize: 8, Encoding: S, RegType: Flags, RegSize: 8, RegId: 0, RegCount: 1
000000000000003C 626c8102813ebdbdbdbd CCMPC qword ptr [r22], 0xbdbdbdbd, {dfv=OF,SF,ZF,CF}
DSIZE: 64, ASIZE: 64, VLEN: -
ISA Set: APX_F, Ins cat: APX, CET tracked: no
CPUID leaf: 0x00000007, sub-leaf: 0x00000001, reg: edx, bit: 21
EVEX Tuple Type: None
Exception class: APX, exception type: APX-EVEX-CCMP
FLAGS access
CF: t,
Valid modes
R0: yes, R1: yes, R2: yes, R3: yes
Real: no, V8086: no, Prot: yes, Compat: yes, Long: yes
SMM on: yes, SMM off: yes, SGX on: yes, SGX off: yes, TSX on: yes, TSX off: yes
VMXRoot: yes, VMXNonRoot: yes, VMXRoot SEAM: yes, VMXNonRoot SEAM: yes, VMX off: yes
Valid prefixes
REP: no, REPcc: no, LOCK: no
HLE: no, XACQUIRE only: no, XRELEASE only: no
BND: no, BHINT: no, DNT: no
Operand: 0, Acc: R-, Type: Memory, Size: 8, RawSize: 8, Encoding: M,
Segment: 3, Base: 22,
Operand: 1, Acc: R-, Type: Immediate, Size: 4, RawSize: 4, Encoding: I
Operand: 2, Acc: R-, Type: Default flags, Size: 0, RawSize: 0, Encoding: V
Operand: 3, Acc: -W, Type: Register, Size: 8, RawSize: 8, Encoding: S, RegType: Flags, RegSize: 8, RegId: 0, RegCount: 1

@ -0,0 +1 @@
bl<EFBFBD><02>><3E><><EFBFBD><EFBFBD>bl<62><02>><3E><><EFBFBD><EFBFBD>bl<62><02>><3E><><EFBFBD><EFBFBD>bl<62><02>><3E><><EFBFBD><EFBFBD>bl<62><02>><3E><><EFBFBD><EFBFBD>bl<62><02>><3E><><EFBFBD><EFBFBD>bl<62><02>><3E><><EFBFBD><EFBFBD>

@ -12,7 +12,7 @@ from setuptools import find_packages, setup, Command, Extension, Distribution
from codecs import open
VERSION = (0, 3, 0)
LIBRARY_VERSION = (2, 1, 2)
LIBRARY_VERSION = (2, 1, 3)
DIR_INCLUDE = '../../inc'
here = os.path.abspath(os.path.dirname(__file__))

@ -7,7 +7,7 @@
#define DISASM_VERSION_MAJOR 2
#define DISASM_VERSION_MINOR 1
#define DISASM_VERSION_REVISION 2
#define DISASM_VERSION_REVISION 3
#define SHEMU_VERSION_MAJOR DISASM_VERSION_MAJOR
#define SHEMU_VERSION_MINOR DISASM_VERSION_MINOR

Loading…
Cancel
Save