Skip to content

Commit d99656d

Browse files
committed
Strip trailing int3 instructions (alignment padding) for x64
1 parent 13f1267 commit d99656d

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().map(|i| i.opcode == iced_x86::Mnemonic::Int3 as u16).unwrap_or(false) {
187+
out.pop();
188+
}
189+
}
184190
Ok(out)
185191
}
186192

0 commit comments

Comments
 (0)