From 2ff291b255b51f410cabcbfaab9adea0ff49a0df Mon Sep 17 00:00:00 2001 From: Orange Date: Thu, 9 Oct 2025 19:58:19 +0300 Subject: [PATCH] Supports broader architectures in PE scanner Updates the PE scanner implementation to support both 32-bit and 64-bit architectures. Leverages `std::variant` and a generic `ImageNtHeaders` to abstract architecture-specific details. Simplifies the logic for retrieving section data, generalizing the process for improved maintainability. --- .idea/editor.xml | 4 +- include/omath/system/pe/file_header.hpp | 111 ++++++++---------- include/omath/system/pe/image_nt_headers.hpp | 23 ++++ include/omath/system/pe/optional_header.hpp | 115 ++++++++++++++++++- include/omath/system/pe/section_header.hpp | 70 ++++------- include/omath/system/pe_headers_x64.hpp | 32 ------ include/omath/utility/pe_pattern_scan.hpp | 18 ++- source/utility/pe_pattern_scan.cpp | 93 ++++++++++----- tests/general/unit_test_pattern_scan.cpp | 9 +- 9 files changed, 288 insertions(+), 187 deletions(-) create mode 100644 include/omath/system/pe/image_nt_headers.hpp delete mode 100644 include/omath/system/pe_headers_x64.hpp diff --git a/.idea/editor.xml b/.idea/editor.xml index fde5348..373c50f 100644 --- a/.idea/editor.xml +++ b/.idea/editor.xml @@ -201,7 +201,7 @@