Watch interesting system objects

This commit is contained in:
momo5502
2024-12-23 11:15:53 +01:00
parent 86c7886b62
commit 56af439dcd
3 changed files with 48 additions and 6 deletions

View File

@@ -1431,6 +1431,32 @@ namespace
return STATUS_INVALID_HANDLE;
}
if (info_class == FileNameInformation)
{
const auto required_length = sizeof(FILE_NAME_INFORMATION) + (f->name.size() * 2);
if (io_status_block)
{
IO_STATUS_BLOCK block{};
block.Information = sizeof(FILE_NAME_INFORMATION) + required_length;
io_status_block.write(block);
}
if (length != required_length)
{
return STATUS_BUFFER_OVERFLOW;
}
c.emu.write_memory(file_information, FILE_NAME_INFORMATION{
.FileNameLength = static_cast<ULONG>(f->name.size() * 2),
});
c.emu.write_memory(file_information + offsetof(FILE_NAME_INFORMATION, FileName), f->name.c_str(),
(f->name.size() + 1) * 2);
return STATUS_SUCCESS;
}
if (info_class == FileStandardInformation)
{
if (io_status_block)
@@ -1618,6 +1644,11 @@ namespace
return STATUS_NOT_SUPPORTED;
}
NTSTATUS handle_NtSetInformationKey()
{
return STATUS_NOT_SUPPORTED;
}
NTSTATUS handle_NtApphelpCacheControl()
{
return STATUS_NOT_SUPPORTED;
@@ -3243,6 +3274,7 @@ void syscall_dispatcher::add_handlers(std::map<std::string, syscall_handler>& ha
add_handler(NtReleaseMutant);
add_handler(NtDuplicateToken);
add_handler(NtQueryTimerResolution);
add_handler(NtSetInformationKey);
#undef add_handler
}