Skip to content

Commit b8d7b3b

Browse files
authored
Strip trailing int3 instructions (alignment padding) for x64 (#354)
* Strip trailing int3 instructions (alignment padding) for x64 * Improve strip trailing int3 instructions * Improve strip trailing int3 instructions again
1 parent 02daae4 commit b8d7b3b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

objdiff-core/src/arch/x86.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,12 @@ impl Arch for ArchX86 {
181181
branch_dest,
182182
});
183183
}
184+
// Strip trailing int3 instructions (alignment padding) for x64
185+
if matches!(self.arch, Architecture::X86_64) {
186+
while out.last().is_some_and(|i| i.opcode == iced_x86::Mnemonic::Int3 as u16) {
187+
out.pop();
188+
}
189+
}
184190
Ok(out)
185191
}
186192

0 commit comments

Comments
 (0)