From 66a529cf4321a265f9a6fe5a585e2ba27bd29376 Mon Sep 17 00:00:00 2001 From: Maurice Heumann Date: Mon, 7 Apr 2025 15:36:25 +0200 Subject: [PATCH] More logging --- src/common/platform/status.hpp | 1 + src/windows-emulator/syscalls.cpp | 2 +- src/windows-emulator/windows_emulator.cpp | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/common/platform/status.hpp b/src/common/platform/status.hpp index 0bda4ca5..ba1a0cc3 100644 --- a/src/common/platform/status.hpp +++ b/src/common/platform/status.hpp @@ -45,6 +45,7 @@ using NTSTATUS = std::uint32_t; #define STATUS_CONNECTION_REFUSED ((NTSTATUS)0xC0000236L) #define STATUS_TIMER_RESOLUTION_NOT_SET ((NTSTATUS)0xC0000245L) #define STATUS_ADDRESS_ALREADY_ASSOCIATED ((NTSTATUS)0xC0000328L) +#define STATUS_DEBUGGER_INACTIVE ((NTSTATUS)0xC0000354L) #define STATUS_BUFFER_OVERFLOW ((NTSTATUS)0x80000005L) diff --git a/src/windows-emulator/syscalls.cpp b/src/windows-emulator/syscalls.cpp index edd49c3f..18e5c29f 100644 --- a/src/windows-emulator/syscalls.cpp +++ b/src/windows-emulator/syscalls.cpp @@ -3853,7 +3853,7 @@ namespace NTSTATUS handle_NtSystemDebugControl() { - return STATUS_NOT_SUPPORTED; + return STATUS_DEBUGGER_INACTIVE; } NTSTATUS handle_NtRequestWaitReplyPort() diff --git a/src/windows-emulator/windows_emulator.cpp b/src/windows-emulator/windows_emulator.cpp index 00bcf949..de8f6874 100644 --- a/src/windows-emulator/windows_emulator.cpp +++ b/src/windows-emulator/windows_emulator.cpp @@ -457,7 +457,8 @@ void windows_emulator::setup_hooks() this->emu().hook_instruction(x64_hookable_instructions::invalid, [&] { const auto ip = this->emu().read_instruction_pointer(); - this->log.print(color::gray, "Invalid instruction at: 0x%" PRIx64 "\n", ip); + this->log.print(color::gray, "Invalid instruction at: 0x%" PRIx64 " (via 0x%" PRIx64 ")\n", ip, + this->process.previous_ip); return instruction_hook_continuation::skip_instruction; });