diff --git a/VERSION b/VERSION index 7cbea07..e230c83 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5.2.0 \ No newline at end of file +5.3.0 \ No newline at end of file diff --git a/include/omath/utility/elf_pattern_scan.hpp b/include/omath/utility/elf_pattern_scan.hpp index b75d0eb..4d9d733 100644 --- a/include/omath/utility/elf_pattern_scan.hpp +++ b/include/omath/utility/elf_pattern_scan.hpp @@ -19,7 +19,7 @@ namespace omath scan_for_pattern_in_loaded_module(const void* module_base_address, const std::string_view& pattern, const std::string_view& target_section_name = ".text"); - template + template [[nodiscard]] static std::optional scan_for_pattern_in_loaded_module(const void* module_base_address, @@ -34,7 +34,7 @@ namespace omath scan_for_pattern_in_file(const std::filesystem::path& path_to_file, const std::string_view& pattern, const std::string_view& target_section_name = ".text"); - template + template [[nodiscard]] static std::optional scan_for_pattern_in_file(const std::filesystem::path& path_to_file, @@ -49,7 +49,7 @@ namespace omath scan_for_pattern_in_memory_file(std::span file_data, const std::string_view& pattern, const std::string_view& target_section_name = ".text"); - template + template [[nodiscard]] static std::optional scan_for_pattern_in_memory_file(std::span file_data, @@ -62,7 +62,7 @@ namespace omath private: using SectionScanFunction = std::optional (*)(std::span); - template + template [[nodiscard]] static std::optional scan_section_for_pattern(const std::span section_data) { diff --git a/include/omath/utility/macho_pattern_scan.hpp b/include/omath/utility/macho_pattern_scan.hpp index aefd76f..c458bf0 100644 --- a/include/omath/utility/macho_pattern_scan.hpp +++ b/include/omath/utility/macho_pattern_scan.hpp @@ -19,7 +19,7 @@ namespace omath scan_for_pattern_in_loaded_module(const void* module_base_address, const std::string_view& pattern, const std::string_view& target_section_name = "__text"); - template + template [[nodiscard]] static std::optional scan_for_pattern_in_loaded_module(const void* module_base_address, @@ -34,7 +34,7 @@ namespace omath scan_for_pattern_in_file(const std::filesystem::path& path_to_file, const std::string_view& pattern, const std::string_view& target_section_name = "__text"); - template + template [[nodiscard]] static std::optional scan_for_pattern_in_file(const std::filesystem::path& path_to_file, @@ -49,7 +49,7 @@ namespace omath scan_for_pattern_in_memory_file(std::span file_data, const std::string_view& pattern, const std::string_view& target_section_name = "__text"); - template + template [[nodiscard]] static std::optional scan_for_pattern_in_memory_file(std::span file_data, @@ -62,7 +62,7 @@ namespace omath private: using SectionScanFunction = std::optional (*)(std::span); - template + template [[nodiscard]] static std::optional scan_section_for_pattern(const std::span section_data) { diff --git a/include/omath/utility/pattern_scan.hpp b/include/omath/utility/pattern_scan.hpp index d3d5679..c912d4b 100644 --- a/include/omath/utility/pattern_scan.hpp +++ b/include/omath/utility/pattern_scan.hpp @@ -39,11 +39,12 @@ namespace omath public: template - struct fixed_string final + struct ConstevalPattern final { char value[N]{}; - constexpr fixed_string(const char (&text)[N]) + // ReSharper disable once CppNonExplicitConvertingConstructor + constexpr ConstevalPattern(const char (&text)[N]) // NOLINT(*-explicit-constructor) { std::ranges::copy(text, value); } @@ -69,7 +70,7 @@ namespace omath return scan_for_parsed_pattern(begin, end, parsed_pattern.value()); } - template + template requires std::input_or_output_iterator> static IteratorType scan_for_pattern(const IteratorType& begin, const IteratorType& end) { @@ -129,7 +130,7 @@ namespace omath return c - 'a' + 10; return -1; } - template + template [[nodiscard]] static consteval std::size_t signature_size() { @@ -152,7 +153,7 @@ namespace omath return count; } - template + template static consteval std::array, signature_size()> parse_pattern() { std::array, signature_size()> result{}; diff --git a/include/omath/utility/pe_pattern_scan.hpp b/include/omath/utility/pe_pattern_scan.hpp index 7a6067c..ffa42ac 100644 --- a/include/omath/utility/pe_pattern_scan.hpp +++ b/include/omath/utility/pe_pattern_scan.hpp @@ -21,7 +21,7 @@ namespace omath scan_for_pattern_in_loaded_module(const void* module_base_address, const std::string_view& pattern, const std::string_view& target_section_name = ".text"); - template + template [[nodiscard]] static std::optional scan_for_pattern_in_loaded_module(const void* module_base_address, @@ -36,7 +36,7 @@ namespace omath scan_for_pattern_in_file(const std::filesystem::path& path_to_file, const std::string_view& pattern, const std::string_view& target_section_name = ".text"); - template + template [[nodiscard]] static std::optional scan_for_pattern_in_file(const std::filesystem::path& path_to_file, @@ -51,7 +51,7 @@ namespace omath scan_for_pattern_in_memory_file(std::span file_data, const std::string_view& pattern, const std::string_view& target_section_name = ".text"); - template + template [[nodiscard]] static std::optional scan_for_pattern_in_memory_file(std::span file_data, @@ -64,7 +64,7 @@ namespace omath private: using SectionScanFunction = std::optional (*)(std::span); - template + template [[nodiscard]] static std::optional scan_section_for_pattern(const std::span section_data) {