From 02298e2303ce92625b1b67d9da6ea97f34a9808e Mon Sep 17 00:00:00 2001 From: 66hh <49398720+66hh@users.noreply.github.com> Date: Sat, 27 Dec 2025 16:58:28 +0800 Subject: [PATCH] Fix illegal address write --- src/windows-emulator/syscall_utils.hpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/windows-emulator/syscall_utils.hpp b/src/windows-emulator/syscall_utils.hpp index ad7ce564..67660fa6 100644 --- a/src/windows-emulator/syscall_utils.hpp +++ b/src/windows-emulator/syscall_utils.hpp @@ -232,7 +232,17 @@ NTSTATUS handle_query(x86_64_emulator& emu, const uint64_t buffer, const uint32_ const auto length_setter = [&](const size_t required_size) { if (return_length) { - return_length.write(static_cast(required_size)); + try + { + // VMProtect is trying to pass an incorrect return address. + // This can run on the original version of Windows, but in + // the emulator, this will cause an exception. + return_length.write(static_cast(required_size)); + } + catch (...) + { + + } } };