NtOpenSection: Do Case-Insensitive String Comparison And Some Refactoring

This commit is contained in:
ahm3dgg
2026-01-11 01:12:37 +02:00
parent d54c8bf9ca
commit 73d82d9ee9
2 changed files with 15 additions and 13 deletions

View File

@@ -866,9 +866,11 @@ bool process_context::is_knowndll_section_exists(const std::u16string& name, boo
if (is_32bit)
{
return knowndlls32_sections.contains(lname);
return knowndlls32_sections.contains(lname);
}
return knowndlls64_sections.contains(lname);
return knowndlls64_sections.contains(lname);
}
std::optional<section> process_context::get_knowndll_section_by_name(const std::u16string& name, bool is_32bit) const
@@ -877,17 +879,17 @@ std::optional<section> process_context::get_knowndll_section_by_name(const std::
if (is_32bit)
{
if (auto section = knowndlls32_sections.find(lname); section != knowndlls32_sections.end())
{
return section->second;
}
if (auto section = knowndlls32_sections.find(lname); section != knowndlls32_sections.end())
{
return section->second;
}
}
else
{
if (auto section = knowndlls64_sections.find(lname); section != knowndlls64_sections.end())
{
return section->second;
}
if (auto section = knowndlls64_sections.find(lname); section != knowndlls64_sections.end())
{
return section->second;
}
}
return {};
@@ -899,10 +901,10 @@ void process_context::add_knowndll_section(const std::u16string& name, const sec
if (is_32bit)
{
this->knowndlls32_sections[lname] = section;
knowndlls32_sections[lname] = section;
}
else
{
this->knowndlls64_sections[lname] = section;
knowndlls64_sections[lname] = section;
}
}