Removes platform-specific error handling

Simplifies pattern scanner logic by removing conditional compilation for non-Windows platforms.

The error handling previously thrown on non-Windows platforms was unnecessary as this functionality is not intended for those systems. This change streamlines the code and removes a misleading error message.
This commit is contained in:
2025-10-09 20:03:43 +03:00
parent 3129e32f0c
commit 547f64e4c4

View File

@@ -70,7 +70,6 @@ namespace omath
PePatternScanner::extract_section_from_pe_file([[maybe_unused]] const std::filesystem::path& path_to_file, PePatternScanner::extract_section_from_pe_file([[maybe_unused]] const std::filesystem::path& path_to_file,
[[maybe_unused]] const std::string_view& section_name) [[maybe_unused]] const std::string_view& section_name)
{ {
#ifdef _WIN32
using namespace system::pe; using namespace system::pe;
std::fstream file(path_to_file, std::ios::binary | std::ios::in); std::fstream file(path_to_file, std::ios::binary | std::ios::in);
@@ -136,8 +135,5 @@ namespace omath
return std::nullopt; return std::nullopt;
}, },
nt_headers); nt_headers);
#else
throw std::runtime_error("Pattern scan for loaded modules is only for windows platform");
#endif
} }
} // namespace omath } // namespace omath