From 39b7fcb71f9b3aefcf60c01669e8a6ee23a3de5c Mon Sep 17 00:00:00 2001 From: naci Date: Fri, 24 Apr 2026 21:05:03 +0300 Subject: [PATCH] lifter: handle INT1 and INT3 like UD2 (call @exception; ret) (#197) Both 0xF1 (INT1, ICEBP debug trap) and 0xCC (INT3, debugger break) previously fell through to the 'Instruction not implemented' default, emitting a DiagCode::InstructionNotImplemented error. They raise #DB/#BP exceptions at runtime, functionally equivalent to UD2 which already lowers to 'call @exception; ret'. Group them with UD2 by adding two fall-through case labels. Same lowering: emit call @exception(), ret, and stop the block. On example2-virt.bin @ 0x140001000: before: 1 warn, 1 err (INT1 at 0x1401928ef) after: 1 warn, 0 err (INT1 now lifts cleanly as @exception call) Baseline + quick + themida remain green. Non-virt example2.bin unchanged. The themida test's 'extra imports' list gains '@exception' alongside the existing '@fastfail' for the same kind of lowering. Co-authored-by: yusufcanislek --- lifter/semantics/Semantics.ipp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lifter/semantics/Semantics.ipp b/lifter/semantics/Semantics.ipp index 0adf67f..cb18bd1 100644 --- a/lifter/semantics/Semantics.ipp +++ b/lifter/semantics/Semantics.ipp @@ -56,6 +56,8 @@ MERGEN_LIFTER_DEFINITION_TEMPLATES(void)::liftInstructionSemantics() { #include "x86_64_opcodes.x" #undef OPCODE #undef OPCODE_CASE + case Mnemonic::INT1: + case Mnemonic::INT3: case Mnemonic::UD2: { Function* externFunc = cast( fnc->getParent()