mirror of
https://github.com/orange-cpp/omath.git
synced 2026-02-13 07:03:25 +00:00
Removes redundant NtHeaderVariant field declarations
Simplifies NtHeaderVariant structure by removing redundant field declarations. This improves code readability and reduces unnecessary code duplication.
This commit is contained in:
@@ -25,7 +25,6 @@ namespace
|
|||||||
};
|
};
|
||||||
struct OptionalHeaderX64 final
|
struct OptionalHeaderX64 final
|
||||||
{
|
{
|
||||||
|
|
||||||
std::uint16_t magic;
|
std::uint16_t magic;
|
||||||
|
|
||||||
std::uint16_t linker_version;
|
std::uint16_t linker_version;
|
||||||
@@ -170,14 +169,15 @@ namespace
|
|||||||
|
|
||||||
std::uint32_t ptr_relocs;
|
std::uint32_t ptr_relocs;
|
||||||
std::uint32_t ptr_line_numbers;
|
std::uint32_t ptr_line_numbers;
|
||||||
std::uint32_t num_relocs;
|
std::uint32_t num_relocs;
|
||||||
std::uint32_t num_line_numbers;
|
std::uint32_t num_line_numbers;
|
||||||
|
|
||||||
std::uint32_t characteristics;
|
std::uint32_t characteristics;
|
||||||
};
|
};
|
||||||
// ReSharper restore CppDeclaratorNeverUsed
|
// ReSharper restore CppDeclaratorNeverUsed
|
||||||
|
|
||||||
using NtHeaderVariant = std::variant<ImageNtHeaders<NtArchitecture::x64_bit>, ImageNtHeaders<NtArchitecture::x32_bit>>;
|
using NtHeaderVariant =
|
||||||
|
std::variant<ImageNtHeaders<NtArchitecture::x64_bit>, ImageNtHeaders<NtArchitecture::x32_bit>>;
|
||||||
|
|
||||||
[[nodiscard]]
|
[[nodiscard]]
|
||||||
std::optional<NtHeaderVariant> get_nt_header_from_file(std::fstream& file, const DosHeader& dos_header)
|
std::optional<NtHeaderVariant> get_nt_header_from_file(std::fstream& file, const DosHeader& dos_header)
|
||||||
|
|||||||
Reference in New Issue
Block a user