Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add implicitdisp to ZydisOperandDefinition #512

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/Zydis/Internal/SharedData.h
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ typedef struct ZydisOperandDefinition_
} reg;
struct
{
ZyanU8 implicitdisp ZYAN_BITFIELD(1);
ZyanU8 seg ZYAN_BITFIELD(3);
ZyanU8 base ZYAN_BITFIELD(ZYDIS_IMPLMEM_BASE_REQUIRED_BITS);
} mem;
Expand Down
4 changes: 4 additions & 0 deletions src/Decoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -1586,6 +1586,10 @@ static void ZydisDecodeOperandImplicitMemory(const ZydisDecoder* decoder,
ZydisRegisterEncode(ZYDIS_REGCLASS_SEGMENT, definition->op.mem.seg - 1);
ZYAN_ASSERT(operand->mem.segment);
}
if (definition->op.mem.implicitdisp)
{
operand->mem.disp.value = -(definition->size[context->eosz_index]);
}
}
#endif

Expand Down
272 changes: 136 additions & 136 deletions src/Generated/OperandDefinitions.inc

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion tests/cases/default_017.out
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
BASE = rsp
INDEX = none
SCALE = 0
DISP = 0x0000000000000000
DISP = 0xFFFFFFFFFFFFFFF8
-- --------- ---------- ------ ------------ ---- ----- ------ -------- ---------------------------

== [ ATT ] ============================================================================================
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/default_024.out
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
BASE = rsp
INDEX = none
SCALE = 0
DISP = 0x0000000000000000
DISP = 0xFFFFFFFFFFFFFFF8
-- --------- ---------- ------ ------------ ---- ----- ------ -------- ---------------------------

== [ ATT ] ============================================================================================
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/default_038.out
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
BASE = rsp
INDEX = none
SCALE = 0
DISP = 0x0000000000000000
DISP = 0xFFFFFFFFFFFFFFF8
-- --------- ---------- ------ ------------ ---- ----- ------ -------- ---------------------------

== [ ATT ] ============================================================================================
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/default_039.out
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
BASE = rsp
INDEX = none
SCALE = 0
DISP = 0x0000000000000000
DISP = 0xFFFFFFFFFFFFFFF8
-- --------- ---------- ------ ------------ ---- ----- ------ -------- ---------------------------

== [ ATT ] ============================================================================================
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/default_040.out
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
BASE = rsp
INDEX = none
SCALE = 0
DISP = 0x0000000000000000
DISP = 0xFFFFFFFFFFFFFFF8
-- --------- ---------- ------ ------------ ---- ----- ------ -------- ---------------------------

== [ ATT ] ============================================================================================
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/default_041.out
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
BASE = esp
INDEX = none
SCALE = 0
DISP = 0x0000000000000000
DISP = 0xFFFFFFFFFFFFFFFC
-- --------- ---------- ------ ------------ ---- ----- ------ -------- ---------------------------

== [ ATT ] ============================================================================================
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/default_042.out
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
BASE = esp
INDEX = none
SCALE = 0
DISP = 0x0000000000000000
DISP = 0xFFFFFFFFFFFFFFFC
-- --------- ---------- ------ ------------ ---- ----- ------ -------- ---------------------------

== [ ATT ] ============================================================================================
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/default_043.out
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
BASE = esp
INDEX = none
SCALE = 0
DISP = 0x0000000000000000
DISP = 0xFFFFFFFFFFFFFFFC
-- --------- ---------- ------ ------------ ---- ----- ------ -------- ---------------------------

== [ ATT ] ============================================================================================
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/default_044.out
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
BASE = esp
INDEX = none
SCALE = 0
DISP = 0x0000000000000000
DISP = 0xFFFFFFFFFFFFFFFC
-- --------- ---------- ------ ------------ ---- ----- ------ -------- ---------------------------

== [ ATT ] ============================================================================================
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/default_045.out
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
BASE = esp
INDEX = none
SCALE = 0
DISP = 0x0000000000000000
DISP = 0xFFFFFFFFFFFFFFFC
-- --------- ---------- ------ ------------ ---- ----- ------ -------- ---------------------------

== [ ATT ] ============================================================================================
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/default_046.out
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
BASE = rsp
INDEX = none
SCALE = 0
DISP = 0x0000000000000000
DISP = 0xFFFFFFFFFFFFFFF8
-- --------- ---------- ------ ------------ ---- ----- ------ -------- ---------------------------

== [ ATT ] ============================================================================================
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/default_047.out
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
BASE = rsp
INDEX = none
SCALE = 0
DISP = 0x0000000000000000
DISP = 0xFFFFFFFFFFFFFFF8
-- --------- ---------- ------ ------------ ---- ----- ------ -------- ---------------------------

== [ ATT ] ============================================================================================
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/jmp_far_16.out
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
BASE = esp
INDEX = none
SCALE = 0
DISP = 0x0000000000000000
DISP = 0xFFFFFFFFFFFFFFFC
-- --------- ---------- ------ ------------ ---- ----- ------ -------- ---------------------------

== [ ATT ] ============================================================================================
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/jmp_far_32.out
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
BASE = esp
INDEX = none
SCALE = 0
DISP = 0x0000000000000000
DISP = 0xFFFFFFFFFFFFFFF8
-- --------- ---------- ------ ------------ ---- ----- ------ -------- ---------------------------

== [ ATT ] ============================================================================================
Expand Down
Loading