From 49ae9ef68aa6141b6580ce1e602c34f3b503d241 Mon Sep 17 00:00:00 2001 From: ahm3dgg Date: Wed, 7 Jan 2026 20:21:19 +0200 Subject: [PATCH] Add dummy stub for NtFlushInstructionCache --- src/windows-emulator/process_context.cpp | 4 ++-- src/windows-emulator/syscalls.cpp | 3 +++ src/windows-emulator/syscalls/process.cpp | 10 ++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/windows-emulator/process_context.cpp b/src/windows-emulator/process_context.cpp index 22331b74..e04bcd70 100644 --- a/src/windows-emulator/process_context.cpp +++ b/src/windows-emulator/process_context.cpp @@ -290,7 +290,7 @@ namespace auto file = utils::io::read_file(known_dll_path); { section s; - s.file_name = known_dll_path.u16string(); + s.file_name = (system_root_path / known_dll_name).u16string(); s.maximum_size = page_align_up(std::filesystem::file_size(s.file_name)); s.allocation_attributes = SEC_IMAGE; s.section_page_protection = PAGE_EXECUTE; @@ -354,7 +354,7 @@ namespace auto known_dll_dep_file = utils::io::read_file(known_dll_dep_path); section s; - s.file_name = known_dll_dep_path.u16string(); + s.file_name = (system_root_path / known_dll_dep_name_16).u16string(); s.maximum_size = page_align_up(std::filesystem::file_size(s.file_name)); s.allocation_attributes = SEC_IMAGE; s.section_page_protection = PAGE_EXECUTE; diff --git a/src/windows-emulator/syscalls.cpp b/src/windows-emulator/syscalls.cpp index d8d02f22..9b29022a 100644 --- a/src/windows-emulator/syscalls.cpp +++ b/src/windows-emulator/syscalls.cpp @@ -363,6 +363,8 @@ namespace syscalls emulator_object return_length); NTSTATUS handle_NtQuerySecurityAttributesToken(); NTSTATUS handle_NtAdjustPrivilegesToken(); + NTSTATUS handle_NtFlushInstructionCache(const syscall_context& c, const handle process_handle, + const emulator_object base_address, const uint64_t region_size); NTSTATUS handle_NtQueryPerformanceCounter(const syscall_context& c, const emulator_object performance_counter, const emulator_object performance_frequency) @@ -1266,6 +1268,7 @@ void syscall_dispatcher::add_handlers(std::map& ha add_handler(NtRemoveProcessDebug); add_handler(NtNotifyChangeDirectoryFileEx); add_handler(NtUserGetHDevName); + add_handler(NtFlushInstructionCache); #undef add_handler } diff --git a/src/windows-emulator/syscalls/process.cpp b/src/windows-emulator/syscalls/process.cpp index f708eb73..329db21a 100644 --- a/src/windows-emulator/syscalls/process.cpp +++ b/src/windows-emulator/syscalls/process.cpp @@ -421,4 +421,14 @@ namespace syscalls return STATUS_NOT_SUPPORTED; } + + NTSTATUS handle_NtFlushInstructionCache(const syscall_context& c, const handle process_handle, + const emulator_object base_address, const uint64_t region_size) + { + (void)c; + (void)process_handle; + (void)base_address; + (void)region_size; + return STATUS_SUCCESS; + } }