Support SameTebFlags.InitialThread

This flag is needed to suport emulation of .net executables
that don't have an entry point set in PE header. This applies
to both PE32 and PE64 executables. If InitialThread is set
the loader substitutes an entry point of the .net executable
with mscoree.dll!_CorExeMain.
This commit is contained in:
ssvine
2025-12-30 13:44:21 +03:00
parent d3cb3f4995
commit fea27338bb
5 changed files with 11 additions and 6 deletions

View File

@@ -371,7 +371,7 @@ void windows_emulator::setup_process(const application_settings& app_settings)
this->dispatcher.setup(ntdll->exports, ntdll_data, win32u->exports, win32u_data);
const auto main_thread_id = context.create_thread(this->memory, this->mod_manager.executable->entry_point, 0,
this->mod_manager.executable->size_of_stack_commit, false);
this->mod_manager.executable->size_of_stack_commit, false, true);
switch_to_thread(*this, main_thread_id);
}