mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
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:
@@ -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
|
||||||
Reference in New Issue
Block a user