Merge branch 'main' of https://github.com/momo5502/sogen into knowndlls-patch

This commit is contained in:
ahm3dgg
2026-01-13 01:50:33 +02:00
9 changed files with 46 additions and 22 deletions

16
page/package-lock.json generated
View File

@@ -34,7 +34,7 @@
"react-dom": "^19.2.3",
"react-dropzone": "^14.3.8",
"react-helmet": "^6.1.0",
"react-router-dom": "^7.11.0",
"react-router-dom": "^7.12.0",
"react-window": "^2.2.3",
"shell-quote": "^1.8.3",
"tailwind-merge": "^3.4.0",
@@ -8118,9 +8118,9 @@
}
},
"node_modules/react-router": {
"version": "7.11.0",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-7.11.0.tgz",
"integrity": "sha512-uI4JkMmjbWCZc01WVP2cH7ZfSzH91JAZUDd7/nIprDgWxBV1TkkmLToFh7EbMTcMak8URFRa2YoBL/W8GWnCTQ==",
"version": "7.12.0",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-7.12.0.tgz",
"integrity": "sha512-kTPDYPFzDVGIIGNLS5VJykK0HfHLY5MF3b+xj0/tTyNYL1gF1qs7u67Z9jEhQk2sQ98SUaHxlG31g1JtF7IfVw==",
"license": "MIT",
"dependencies": {
"cookie": "^1.0.1",
@@ -8140,12 +8140,12 @@
}
},
"node_modules/react-router-dom": {
"version": "7.11.0",
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.11.0.tgz",
"integrity": "sha512-e49Ir/kMGRzFOOrYQBdoitq3ULigw4lKbAyKusnvtDu2t4dBX4AGYPrzNvorXmVuOyeakai6FUPW5MmibvVG8g==",
"version": "7.12.0",
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.12.0.tgz",
"integrity": "sha512-pfO9fiBcpEfX4Tx+iTYKDtPbrSLLCbwJ5EqP+SPYQu1VYCXdy79GSj0wttR0U4cikVdlImZuEZ/9ZNCgoaxwBA==",
"license": "MIT",
"dependencies": {
"react-router": "7.11.0"
"react-router": "7.12.0"
},
"engines": {
"node": ">=20.0.0"

View File

@@ -36,7 +36,7 @@
"react-dom": "^19.2.3",
"react-dropzone": "^14.3.8",
"react-helmet": "^6.1.0",
"react-router-dom": "^7.11.0",
"react-router-dom": "^7.12.0",
"react-window": "^2.2.3",
"shell-quote": "^1.8.3",
"tailwind-merge": "^3.4.0",

View File

@@ -43,6 +43,7 @@ using NTSTATUS = std::uint32_t;
#define STATUS_ACCESS_DENIED ((NTSTATUS)0xC0000022L)
#define STATUS_BUFFER_TOO_SMALL ((NTSTATUS)0xC0000023L)
#define STATUS_OBJECT_NAME_NOT_FOUND ((NTSTATUS)0xC0000034L)
#define STATUS_OBJECT_NAME_COLLISION ((NTSTATUS)0xC0000035L)
#define STATUS_INVALID_PAGE_PROTECTION ((NTSTATUS)0xC0000045L)
#define STATUS_MUTANT_NOT_OWNED ((NTSTATUS)0xC0000046L)
#define STATUS_SEMAPHORE_LIMIT_EXCEEDED ((NTSTATUS)0xC0000047L)

View File

@@ -23,7 +23,7 @@ struct USER_HANDLEENTRY
uint64_t pHead;
uint64_t pOwner;
uint64_t unknown;
uint8_t bType;
EMULATOR_CAST(uint8_t, USER_HANDLETYPE) bType;
uint8_t bFlags;
uint16_t wUniq;
};
@@ -31,10 +31,10 @@ static_assert(sizeof(USER_HANDLEENTRY) == 0x20);
struct USER_SHAREDINFO
{
uint64_t psi;
uint64_t aheList;
EMULATOR_CAST(uint64_t, USER_SERVERINFO*) psi;
EMULATOR_CAST(uint64_t, USER_HANDLEENTRY*) aheList;
uint32_t HeEntrySize;
uint64_t pDispInfo;
EMULATOR_CAST(uint64_t, USER_DISPINFO*) pDispInfo;
uint8_t unknown[0xFF];
};

View File

@@ -188,7 +188,7 @@ namespace utils::string
return std::ranges::equal(lhs, rhs, [](const auto c1, const auto c2) { return char_to_lower(c1) == char_to_lower(c2); });
}
template <class Elem, class Traits, class Alloc>
template <class Elem, class Traits, class Alloc>
bool starts_with_ignore_case(const std::basic_string<Elem, Traits, Alloc>& lhs, const std::basic_string_view<Elem, Traits> rhs)
{
if (lhs.length() < rhs.length())
@@ -224,7 +224,7 @@ namespace utils::string
[](const auto c1, const auto c2) { return char_to_lower(c1) == char_to_lower(c2); });
}
template <class Elem, class Traits, class Alloc>
template <class Elem, class Traits, class Alloc>
bool ends_with_ignore_case(const std::basic_string<Elem, Traits, Alloc>& lhs, const std::basic_string_view<Elem, Traits>& rhs)
{
if (lhs.length() < rhs.length())

View File

@@ -538,7 +538,7 @@ void process_context::setup_callback_hook(windows_emulator& win_emu, memory_mana
target_rip += 2;
}
const uint64_t ret_stack_ptr = frame.rsp - sizeof(emulator_pointer);
const uint64_t ret_stack_ptr = emu.reg(x86_register::rsp) - sizeof(emulator_pointer);
emu.write_memory(ret_stack_ptr, &target_rip, sizeof(target_rip));
emu.reg(x86_register::rsp, ret_stack_ptr);
});
@@ -698,7 +698,7 @@ std::optional<uint16_t> process_context::find_atom(const std::u16string_view nam
{
for (auto& entry : this->atoms)
{
if (entry.second.name == name)
if (utils::string::equals_ignore_case(std::u16string_view{entry.second.name}, name))
{
++entry.second.ref_count;
return entry.first;
@@ -721,7 +721,7 @@ uint16_t process_context::add_or_find_atom(std::u16string name)
std::optional<uint16_t> last_entry{};
for (auto& entry : this->atoms)
{
if (entry.second.name == name)
if (utils::string::equals_ignore_case(entry.second.name, name))
{
++entry.second.ref_count;
return entry.first;
@@ -755,7 +755,7 @@ bool process_context::delete_atom(const std::u16string& name)
{
for (auto it = atoms.begin(); it != atoms.end(); ++it)
{
if (it->second.name == name)
if (utils::string::equals_ignore_case(it->second.name, name))
{
if (--it->second.ref_count == 0)
{

View File

@@ -1020,7 +1020,8 @@ namespace syscalls
return STATUS_OBJECT_NAME_NOT_FOUND;
}
const bool is_directory = std::filesystem::is_directory(c.win_emu.file_sys.translate(path), ec);
const auto host_path = c.win_emu.file_sys.translate(path);
const bool is_directory = std::filesystem::is_directory(host_path, ec);
if (is_directory || create_options & FILE_DIRECTORY_FILE)
{
@@ -1028,7 +1029,7 @@ namespace syscalls
if (create_disposition & FILE_CREATE)
{
create_directory(c.win_emu.file_sys.translate(path), ec);
create_directory(host_path, ec);
if (ec)
{
@@ -1048,6 +1049,27 @@ namespace syscalls
c.win_emu.callbacks.on_generic_access("Opening file", f.name);
const bool file_exists = std::filesystem::exists(host_path, ec);
if (create_disposition == FILE_CREATE && file_exists)
{
return STATUS_OBJECT_NAME_COLLISION;
}
if ((create_disposition == FILE_OVERWRITE || create_disposition == FILE_OPEN) && !file_exists)
{
return STATUS_OBJECT_NAME_NOT_FOUND;
}
if (create_disposition == FILE_OPEN_IF && !file_exists)
{
std::ofstream touch(host_path, std::ios::binary | std::ios::app);
if (!touch)
{
return STATUS_ACCESS_DENIED;
}
}
std::u16string mode = map_mode(desired_access, create_disposition);
if (mode.empty() || path.is_relative())

View File

@@ -6,6 +6,7 @@
// In the real implementation, the kernel invokes ntdll!KiUserCallbackDispatcher and passes a callback
// index that refers to an entry in PEB->KernelCallbackTable. The dispatcher then looks up the function
// pointer in that table and invokes the corresponding user-mode callback.
// See Also: https://web.archive.org/web/20080717175308/http://www.nynaeve.net/?p=204
template <typename... Args>
void prepare_call_stack(x86_64_emulator& emu, uint64_t return_address, Args... args)

View File

@@ -33,7 +33,7 @@ class user_handle_table
handle_table_addr_ = this->allocate_memory(handle_table_size, memory_permission::read);
}
emulator_object<USER_SHAREDINFO> get_server_info() const
emulator_object<USER_SERVERINFO> get_server_info() const
{
return {*memory_, server_info_addr_};
}