mirror of
https://github.com/bitdefender/bddisasm.git
synced 2024-12-22 14:08:08 +00:00
Applied some of the syntax recomandations from https://cdrdv2.intel.com/v1/dl/getContent/817241.
This commit is contained in:
parent
02cbe6a298
commit
37a8c94bc7
22
CHANGELOG.md
22
CHANGELOG.md
@ -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/).
|
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
|
## [2.1.0] - 2024-02-20
|
||||||
|
|
||||||
|
@ -311,14 +311,14 @@ NdToText(
|
|||||||
// Store NF specifier, if NoFlags presetn.
|
// Store NF specifier, if NoFlags presetn.
|
||||||
if (Instrux->HasNf)
|
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);
|
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Store ZU specifier, if ZeroUpper present.
|
// Store ZU specifier, if ZeroUpper present.
|
||||||
if (Instrux->HasZu)
|
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);
|
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -710,17 +710,39 @@ NdToText(
|
|||||||
|
|
||||||
case ND_OP_DFV:
|
case ND_OP_DFV:
|
||||||
{
|
{
|
||||||
status = NdSprintf(temp, sizeof(temp), "%c%c%c%c",
|
ND_BOOL comma = ND_FALSE;
|
||||||
pOp->Info.DefaultFlags.OF ? '1' : '0',
|
|
||||||
pOp->Info.DefaultFlags.SF ? '1' : '0',
|
res = nd_strcat_s(Buffer, BufferSize, "{dfv=");
|
||||||
pOp->Info.DefaultFlags.ZF ? '1' : '0',
|
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
|
||||||
pOp->Info.DefaultFlags.CF ? '1' : '0');
|
|
||||||
if (!ND_SUCCESS(status))
|
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);
|
RET_EQ(res, ND_NULL, ND_STATUS_BUFFER_OVERFLOW);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
File diff suppressed because it is too large
Load Diff
161
bddisasm_test/x86/apx/apx3_64.result
Normal file
161
bddisasm_test/x86/apx/apx3_64.result
Normal file
@ -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
|
||||||
|
|
1
bddisasm_test/x86/apx/apx3_64.test
Normal file
1
bddisasm_test/x86/apx/apx3_64.test
Normal file
@ -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>
|
Binary file not shown.
@ -12,7 +12,7 @@ from setuptools import find_packages, setup, Command, Extension, Distribution
|
|||||||
from codecs import open
|
from codecs import open
|
||||||
|
|
||||||
VERSION = (0, 3, 0)
|
VERSION = (0, 3, 0)
|
||||||
LIBRARY_VERSION = (2, 1, 2)
|
LIBRARY_VERSION = (2, 1, 3)
|
||||||
DIR_INCLUDE = '../../inc'
|
DIR_INCLUDE = '../../inc'
|
||||||
|
|
||||||
here = os.path.abspath(os.path.dirname(__file__))
|
here = os.path.abspath(os.path.dirname(__file__))
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
#define DISASM_VERSION_MAJOR 2
|
#define DISASM_VERSION_MAJOR 2
|
||||||
#define DISASM_VERSION_MINOR 1
|
#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_MAJOR DISASM_VERSION_MAJOR
|
||||||
#define SHEMU_VERSION_MINOR DISASM_VERSION_MINOR
|
#define SHEMU_VERSION_MINOR DISASM_VERSION_MINOR
|
||||||
|
Loading…
Reference in New Issue
Block a user