mirror of
https://github.com/momo5502/emulator.git
synced 2026-01-18 19:23:56 +00:00
Progress with kernelbase initialization
This commit is contained in:
@@ -282,7 +282,7 @@ namespace
|
||||
context.process_params.access([&](RTL_USER_PROCESS_PARAMETERS& proc_params)
|
||||
{
|
||||
proc_params.Length = sizeof(proc_params);
|
||||
proc_params.Flags = 0x6001;
|
||||
proc_params.Flags = 0x6001 | 0x80000000;
|
||||
gs.make_unicode_string(proc_params.CurrentDirectory.DosPath, L"C:\\Users\\mauri\\Desktop");
|
||||
gs.make_unicode_string(proc_params.ImagePathName, L"C:\\Users\\mauri\\Desktop\\ConsoleApplication6.exe");
|
||||
gs.make_unicode_string(proc_params.CommandLine, L"C:\\Users\\mauri\\Desktop\\ConsoleApplication6.exe");
|
||||
@@ -575,6 +575,7 @@ namespace
|
||||
(void)entry1;
|
||||
(void)entry2;
|
||||
|
||||
|
||||
syscall_dispatcher dispatcher{context.ntdll.exports};
|
||||
|
||||
emu->hook_instruction(x64_hookable_instructions::syscall, [&]
|
||||
|
||||
@@ -571,6 +571,29 @@ namespace
|
||||
return STATUS_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
if (info_class == SystemTimeOfDayInformation)
|
||||
{
|
||||
if (return_length)
|
||||
{
|
||||
return_length.write(sizeof(SYSTEM_TIMEOFDAY_INFORMATION));
|
||||
}
|
||||
|
||||
if (system_information_length != sizeof(SYSTEM_TIMEOFDAY_INFORMATION))
|
||||
{
|
||||
return STATUS_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
const emulator_object<SYSTEM_TIMEOFDAY_INFORMATION> info_obj{c.emu, system_information};
|
||||
|
||||
info_obj.access([&](SYSTEM_TIMEOFDAY_INFORMATION& info)
|
||||
{
|
||||
info.BootTime.QuadPart = 0;
|
||||
// TODO: Fill
|
||||
});
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
if (info_class == SystemRangeStartInformation)
|
||||
{
|
||||
if (return_length)
|
||||
@@ -592,6 +615,7 @@ namespace
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
if (info_class == SystemNumaProcessorMap)
|
||||
{
|
||||
if (return_length)
|
||||
@@ -977,6 +1001,28 @@ namespace
|
||||
|
||||
throw std::runtime_error("Bad free type");
|
||||
}
|
||||
|
||||
NTSTATUS handle_NtCreateSection(const syscall_context& /*c*/, const emulator_object<uint64_t> section_handle,
|
||||
const ACCESS_MASK /*desired_access*/,
|
||||
const emulator_object<OBJECT_ATTRIBUTES> /*object_attributes*/,
|
||||
const emulator_object<LARGE_INTEGER> maximum_size,
|
||||
const ULONG /*section_page_protection*/, const ULONG /*allocation_attributes*/,
|
||||
const uint64_t /*file_handle*/)
|
||||
{
|
||||
section_handle.write(SHARED_SECTION);
|
||||
|
||||
maximum_size.access([](LARGE_INTEGER& large_int)
|
||||
{
|
||||
large_int.QuadPart = page_align_up(large_int.QuadPart);
|
||||
});
|
||||
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
NTSTATUS handle_NtConnectPort()
|
||||
{
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
syscall_dispatcher::syscall_dispatcher(const exported_symbols& ntdll_exports)
|
||||
@@ -1022,6 +1068,8 @@ syscall_dispatcher::syscall_dispatcher(const exported_symbols& ntdll_exports)
|
||||
add_handler(NtOpenFile);
|
||||
add_handler(NtQueryVolumeInformationFile);
|
||||
add_handler(NtApphelpCacheControl);
|
||||
add_handler(NtCreateSection);
|
||||
add_handler(NtConnectPort);
|
||||
|
||||
#undef add_handler
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user