From 547f64e4c463189abd317c46222f89b15254f952 Mon Sep 17 00:00:00 2001 From: Orange Date: Thu, 9 Oct 2025 20:03:43 +0300 Subject: [PATCH] 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. --- source/utility/pe_pattern_scan.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/source/utility/pe_pattern_scan.cpp b/source/utility/pe_pattern_scan.cpp index a78dc26..41e07a7 100644 --- a/source/utility/pe_pattern_scan.cpp +++ b/source/utility/pe_pattern_scan.cpp @@ -70,7 +70,6 @@ namespace omath PePatternScanner::extract_section_from_pe_file([[maybe_unused]] const std::filesystem::path& path_to_file, [[maybe_unused]] const std::string_view& section_name) { -#ifdef _WIN32 using namespace system::pe; std::fstream file(path_to_file, std::ios::binary | std::ios::in); @@ -136,8 +135,5 @@ namespace omath return std::nullopt; }, nt_headers); -#else - throw std::runtime_error("Pattern scan for loaded modules is only for windows platform"); -#endif } } // namespace omath \ No newline at end of file