From 092c4245a8f83ebdaf37f2dc2b4026890672b838 Mon Sep 17 00:00:00 2001 From: butilly Date: Thu, 5 Nov 2026 05:32:32 +0000 Subject: [PATCH] Windows: report inaccessible software interrupts as access violations --- Source/Windows/Common/Exception.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Source/Windows/Common/Exception.h b/Source/Windows/Common/Exception.h index 12162233cf..24b6f6b181 100644 --- a/Source/Windows/Common/Exception.h +++ b/Source/Windows/Common/Exception.h @@ -66,7 +66,14 @@ static inline EXCEPTION_RECORD HandleGuestException(FEXCore::Core::CpuStateFrame Dst.ExceptionInformation[0] = Rax; // Note that ExceptionAddress doesn't equal the reported context RIP here, this discrepancy expected and not having it can trigger anti-debug logic. return Dst; - default: LogMan::Msg::EFmt("Unknown interrupt: 0x{:X}", Fault.err_code >> 3); break; + default: + // An inaccessible INT imm8 gate raises #GP, not #UD. Match the + // Windows access-violation record and leave RIP on the instruction. + Dst.ExceptionCode = EXCEPTION_ACCESS_VIOLATION; + Dst.NumberParameters = 2; + Dst.ExceptionInformation[0] = 0; + Dst.ExceptionInformation[1] = static_cast(-1); + return Dst; } } else { Dst.ExceptionCode = EXCEPTION_PRIV_INSTRUCTION;