From e4131e4eb64595d9b24493eb31a9af4c5e21b1eb Mon Sep 17 00:00:00 2001 From: iximeow Date: Sat, 21 Aug 2021 13:21:50 -0700 Subject: add push/pop/call/ret mem_size fixes to changelog --- CHANGELOG | 6 ++++++ src/protected_mode/mod.rs | 5 ++--- src/real_mode/mod.rs | 5 ++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 5cb8d07..b10a6c0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -8,6 +8,12 @@ about being a relative or absolute address. - `DisplayStyle::Intel` is how `impl Display for Instruction` works, so typical `Display` use is also fixed. +* `push`, `pop`, `call`, and `ret` now report `mem_size` in all cases. + - earlier, these instructions only reported a `mem_size` if their operand was a memory access. + - for `call`, in 32- and 16-bit modes the reported memory size may describe + the *read*, not the corresponding write of pushing `{e}ip` to the stack. + documentation has been added to `mem_size` more specifically describing + this circumstance. ## 1.0.4 diff --git a/src/protected_mode/mod.rs b/src/protected_mode/mod.rs index 79eb1b1..2d37bc6 100644 --- a/src/protected_mode/mod.rs +++ b/src/protected_mode/mod.rs @@ -4229,9 +4229,8 @@ impl Instruction { /// the reported size is correct for displayed operand sizes (`word [ptr]` will have a /// `MemoryAccessSize` indicating two bytes) but is _not_ sufficient to describe all accesses /// of all instructions. the most notable exception is for operand-size-prefixed `call`, where - /// `66ff10` is the instruction `call word [eax]`, but will push a four-byte `eip`. this same - /// imprecision exists for `jmp word [mem]` as well. tools must account for these inconsistent - /// sizes internally. + /// `66ff10` is the instruction `call word [eax]`, but will push a four-byte `eip`. tools must + /// account for these inconsistent sizes internally. pub fn mem_size(&self) -> Option { if self.mem_size != 0 { Some(MemoryAccessSize { size: self.mem_size }) diff --git a/src/real_mode/mod.rs b/src/real_mode/mod.rs index 8a7e453..7f3ad42 100644 --- a/src/real_mode/mod.rs +++ b/src/real_mode/mod.rs @@ -4229,9 +4229,8 @@ impl Instruction { /// the reported size is correct for displayed operand sizes (`word [ptr]` will have a /// `MemoryAccessSize` indicating two bytes) but is _not_ sufficient to describe all accesses /// of all instructions. the most notable exception is for operand-size-prefixed `call`, where - /// `66ff10` is the instruction `call dword [eax]`, but will push a four-byte `eip`. this same - /// imprecision exists for `jmp dword [mem]` as well. tools must account for these inconsistent - /// sizes internally. + /// `66ff10` is the instruction `call dword [eax]`, but will push a four-byte `eip`. tools + /// must account for these inconsistent sizes internally. pub fn mem_size(&self) -> Option { if self.mem_size != 0 { Some(MemoryAccessSize { size: self.mem_size }) -- cgit v1.1