From 41b86f655b8422218ced906002ee96aea09bb660 Mon Sep 17 00:00:00 2001 From: 66hh <49398720+66hh@users.noreply.github.com> Date: Sun, 28 Dec 2025 19:44:02 +0800 Subject: [PATCH] Replace write with try_write in the handle_query function --- src/windows-emulator/syscall_utils.hpp | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/windows-emulator/syscall_utils.hpp b/src/windows-emulator/syscall_utils.hpp index 67660fa6..564bea14 100644 --- a/src/windows-emulator/syscall_utils.hpp +++ b/src/windows-emulator/syscall_utils.hpp @@ -232,17 +232,7 @@ 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) { - 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 (...) - { - - } + return_length.try_write(static_cast(required_size)); } };