Pass file_system to process_context::setup

This commit is contained in:
ahm3dgg
2026-01-06 09:16:45 +02:00
parent b642486bc4
commit 725c7e3e9c
3 changed files with 7 additions and 7 deletions

View File

@@ -177,9 +177,9 @@ namespace
return env_map;
}
void create_known_dlls_section_objects(std::unordered_map<std::u16string, section>& knowndlls_sections, bool is_wow64)
void create_known_dlls_section_objects(std::unordered_map<std::u16string, section>& 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");

View File

@@ -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);

View File

@@ -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<size_t>(ntdll->size_of_image));