From 6937827e59ecac5bf3a70df3c7215905b56ddf8b Mon Sep 17 00:00:00 2001 From: momo5502 Date: Sun, 3 Nov 2024 21:00:12 +0100 Subject: [PATCH] Dummy user info --- src/windows-emulator/syscalls.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/windows-emulator/syscalls.cpp b/src/windows-emulator/syscalls.cpp index e01e1a1f..c4ed8f16 100644 --- a/src/windows-emulator/syscalls.cpp +++ b/src/windows-emulator/syscalls.cpp @@ -1689,7 +1689,29 @@ namespace if (token_information_class == TokenUser) { - return STATUS_NOT_SUPPORTED; + const uint8_t sid[] = + { + 0x01, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x05, 0x15, 0x00, 0x00, 0x00, 0x84, 0x94, + 0xD4, 0x04, 0x4B, 0x68, 0x42, 0x34, 0x23, + 0xBE, 0x69, 0x4E, 0xE9, 0x03, 0x00, 0x00, + }; + + constexpr auto required_size = sizeof(sid) + 0x10; + return_length.write(required_size); + + if (required_size > token_information_length) + { + return STATUS_BUFFER_TOO_SMALL; + } + + TOKEN_USER user{}; + user.User.Attributes = 0; + user.User.Sid = reinterpret_cast(token_information + 0x10); + + emulator_object{c.emu, token_information}.write(user); + c.emu.write_memory(token_information + 0x10, sid, sizeof(sid)); + return STATUS_SUCCESS; } if (token_information_class == TokenIsAppContainer)