Added basic pipe support to NtRead/WriteFile

This commit is contained in:
CarlTSpeak
2025-08-06 10:30:40 +01:00
parent 100638d8ea
commit ffea72d48a
5 changed files with 119 additions and 36 deletions

View File

@@ -3,6 +3,7 @@
#include "windows_emulator.hpp"
#include <ctime>
#include <platform/primitives.hpp>
#include "windows-emulator/devices/named_pipe.hpp"
struct syscall_context
{
@@ -28,6 +29,11 @@ inline bool is_syscall(const std::string_view name)
return name.starts_with("Nt") && name.size() > 3 && is_uppercase(name[2]);
}
inline bool is_named_pipe_path(const std::u16string_view& filename)
{
return filename == u"\\Device\\NamedPipe\\" || filename.starts_with(u"\\Device\\NamedPipe\\");
}
inline std::optional<uint32_t> extract_syscall_id(const exported_symbol& symbol, std::span<const std::byte> data)
{
if (!is_syscall(symbol.name))