Implement ALPC port abstraction and implement DNS resolver port

This commit is contained in:
Igor Pissolati
2025-10-19 18:06:15 -03:00
parent 9453123db0
commit 248c09d554
15 changed files with 845 additions and 111 deletions

View File

@@ -0,0 +1,36 @@
#include "../std_include.hpp"
#include "api_port.hpp"
#include "../windows_emulator.hpp"
namespace
{
struct api_port : port
{
NTSTATUS handle_request(windows_emulator& win_emu, const lpc_request_context& c) override
{
// TODO: Fix this. This is broken and wrong.
try
{
const emulator_object<PORT_DATA_ENTRY<EmulatorTraits<Emu64>>> data{win_emu.emu(), c.recv_buffer + 0x20};
const auto dest = data.read();
const auto base = dest.Base;
const auto value = base + 0x10;
win_emu.emu().write_memory(base + 8, &value, sizeof(value));
}
catch (...)
{
return STATUS_NOT_SUPPORTED;
}
return STATUS_SUCCESS;
}
};
}
std::unique_ptr<port> create_api_port()
{
return std::make_unique<api_port>();
}