From 725c7e3e9cc26d26fd9c8405ddb58d4f54fcf5f4 Mon Sep 17 00:00:00 2001 From: ahm3dgg Date: Tue, 6 Jan 2026 09:16:45 +0200 Subject: [PATCH] Pass file_system to process_context::setup --- src/windows-emulator/process_context.cpp | 10 +++++----- src/windows-emulator/process_context.hpp | 2 +- src/windows-emulator/windows_emulator.cpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/windows-emulator/process_context.cpp b/src/windows-emulator/process_context.cpp index db62e749..1e2a8a0f 100644 --- a/src/windows-emulator/process_context.cpp +++ b/src/windows-emulator/process_context.cpp @@ -177,9 +177,9 @@ namespace return env_map; } - void create_known_dlls_section_objects(std::unordered_map& knowndlls_sections, bool is_wow64) + void create_known_dlls_section_objects(std::unordered_map& knowndlls_sections, const file_system& file_system, bool is_wow64) { - std::filesystem::path known_dlls_fs_root_path; + windows_path known_dlls_fs_root_path; std::u16string known_dlls_objmgn_root_path; if (is_wow64) @@ -219,7 +219,7 @@ namespace const auto known_dll_fs_path = known_dlls_fs_root_path / known_dll_name; auto known_dll_objmgn_path = known_dlls_objmgn_root_path + u"\\" + known_dll_name; - const auto file_size = std::filesystem::file_size(known_dll_fs_path); + const auto file_size = std::filesystem::file_size(file_system.translate(known_dll_fs_path)); utils::string::to_lower_inplace(known_dll_objmgn_path); s.name = known_dll_objmgn_path; @@ -233,7 +233,7 @@ namespace } } -void process_context::setup(x86_64_emulator& emu, memory_manager& memory, registry_manager& registry, +void process_context::setup(x86_64_emulator& emu, memory_manager& memory, registry_manager& registry, const file_system& file_system, const application_settings& app_settings, const mapped_module& executable, const mapped_module& ntdll, const apiset::container& apiset_container, const mapped_module* ntdll32) { @@ -438,7 +438,7 @@ void process_context::setup(x86_64_emulator& emu, memory_manager& memory, regist } } - create_known_dlls_section_objects(this->knowndlls_sections, is_wow64_process); + create_known_dlls_section_objects(this->knowndlls_sections, file_system, is_wow64_process); this->ntdll_image_base = ntdll.image_base; this->ldr_initialize_thunk = ntdll.find_export("LdrInitializeThunk"); diff --git a/src/windows-emulator/process_context.hpp b/src/windows-emulator/process_context.hpp index fc39204b..86ae3dc1 100644 --- a/src/windows-emulator/process_context.hpp +++ b/src/windows-emulator/process_context.hpp @@ -70,7 +70,7 @@ struct process_context { } - void setup(x86_64_emulator& emu, memory_manager& memory, registry_manager& registry, const application_settings& app_settings, + void setup(x86_64_emulator& emu, memory_manager& memory, registry_manager& registry, const file_system& file_system, const application_settings& app_settings, const mapped_module& executable, const mapped_module& ntdll, const apiset::container& apiset_container, const mapped_module* ntdll32 = nullptr); diff --git a/src/windows-emulator/windows_emulator.cpp b/src/windows-emulator/windows_emulator.cpp index c4057fc4..dba25ffb 100644 --- a/src/windows-emulator/windows_emulator.cpp +++ b/src/windows-emulator/windows_emulator.cpp @@ -362,7 +362,7 @@ void windows_emulator::setup_process(const application_settings& app_settings) const auto apiset_data = apiset::obtain(this->emulation_root); - this->process.setup(this->emu(), this->memory, this->registry, app_settings, *executable, *ntdll, apiset_data, + this->process.setup(this->emu(), this->memory, this->registry, this->file_sys, app_settings, *executable, *ntdll, apiset_data, this->mod_manager.wow64_modules_.ntdll32); const auto ntdll_data = emu.read_memory(ntdll->image_base, static_cast(ntdll->size_of_image));