fix: fix bug in offset advancing with modrm bytes

This commit is contained in:
2025-05-08 20:22:40 +09:00
parent df00f59b5a
commit 1dcd231f51

View File

@@ -111,13 +111,13 @@ impl Disassembler {
None None
} }
1 => { 1 => {
self.offset += 2; // one additional byte was read // self.offset += 2; // one additional byte was read
let byte = self.parse_byte(); let byte = self.parse_byte();
log::debug!("Additional byte during ModRM parsing was read."); log::debug!("Additional byte during ModRM parsing was read.");
Some(Displacement::Byte(byte)) Some(Displacement::Byte(byte))
} }
2 => { 2 => {
self.offset += 3; // two additional bytes (word) was read // self.offset += 3; // two additional bytes (word) was read
let word = self.parse_word(); let word = self.parse_word();
log::debug!("Additional two bytes during ModRM parsing was read."); log::debug!("Additional two bytes during ModRM parsing was read.");
Some(Displacement::Word(word)) Some(Displacement::Word(word))