Closed KosBeg closed 3 years ago
Hi, this also happens in zydis, so is not specific to zydis-rs:
== [ OPERANDS ] ============================================================================================
## TYPE VISIBILITY ACTION ENCODING SIZE NELEM ELEMSZ ELEMTYPE VALUE
-- --------- ---------- ------ ------------ ---- ----- ------ -------- ---------------------------
0 REGISTER EXPLICIT W MODRM_REG 64 1 64 INT rax
1 MEMORY EXPLICIT NONE MODRM_RM 64 1 0 INT TYPE = AGEN
SEG = ss
BASE = rsp
INDEX = none
SCALE = 0
DISP = 0x0000000000000020
However, I'm not quite sure what the bug should be. NONE
(which gets printed as (empty)
in rust) for the second operand makes sense to me, since the memory is never read, because it is only used for address generation (which can be figured out by checking for operand.mem.ty == MemoryOperandType::AGEN
). As far as I can see, this is intended, but maybe @flobernd or @athre0z can give more details.
@th0rex is right. The LEA instruction does not actually access the memory referenced by the AGEN operand in any way. That's why the action is NONE and not e.g. READ.
thx @th0rex && @flobernd, after your explanation this is also intended for me ;)
hi! there is a bug in rust bindings(and potentially in zydis-c) long short story
code to reproduce bug