mirror of
https://github.com/NaC-L/Mergen.git
synced 2026-05-12 09:40:34 +00:00
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 <yusuf.canislek@meetdandy.com>
This commit is contained in:
@@ -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<Function>(
|
||||
fnc->getParent()
|
||||
|
||||
Reference in New Issue
Block a user