mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-12 22:53:27 +00:00
Organizes PE scanner code into namespaces
Refactors the PE scanner implementation to group related definitions and functions within namespaces. This improves code organization and readability, particularly for internal PE handling and scanning logic. The included link to the `linux-pe` repository served as a reference during this refactoring.
This commit is contained in:
@@ -11,6 +11,9 @@
|
||||
#include <Windows.h>
|
||||
#endif
|
||||
|
||||
// Internal PE shit defines
|
||||
// Big thx for linuxpe sources as ref
|
||||
// Link: https://github.com/can1357/linux-pe
|
||||
namespace
|
||||
{
|
||||
constexpr std::uint16_t opt_hdr32_magic = 0x010B;
|
||||
@@ -178,7 +181,11 @@ namespace
|
||||
|
||||
using NtHeaderVariant =
|
||||
std::variant<ImageNtHeaders<NtArchitecture::x64_bit>, ImageNtHeaders<NtArchitecture::x32_bit>>;
|
||||
}
|
||||
|
||||
// Internal PE scanner functions
|
||||
namespace
|
||||
{
|
||||
[[nodiscard]]
|
||||
std::optional<NtHeaderVariant> get_nt_header_from_file(std::fstream& file, const DosHeader& dos_header)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user