Improve Windows version detection and LdrSystemDllInitBlock initialization

- Add WINDOWS_VERSION enum and PS_SYSTEM_DLL_INIT_BLOCK sizes for WOW64 support across different Windows builds.
- Read system information (SystemRoot, BuildNumber, UpdateBuildRevision) from registry instead of hardcoded paths.
- Add build comparison helpers in process_context for precise build checks.
This commit is contained in:
brian
2026-01-09 00:38:03 +08:00
parent 9090e29e21
commit 456dc99fb6
6 changed files with 161 additions and 61 deletions

View File

@@ -351,10 +351,7 @@ void windows_emulator::setup_process(const application_settings& app_settings)
const auto& emu = this->emu();
auto& context = this->process;
this->mod_manager.map_main_modules(app_settings.application, R"(C:\Windows\System32)", R"(C:\Windows\SysWOW64)", this->log);
// Set WOW64 flag based on the detected execution mode
context.is_wow64_process = (this->mod_manager.get_execution_mode() == execution_mode::wow64_32bit);
this->mod_manager.map_main_modules(app_settings.application, this->registry, context, this->log);
const auto* executable = this->mod_manager.executable;
const auto* ntdll = this->mod_manager.ntdll;