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:
2025-10-12 19:43:29 +03:00
parent f10dc60772
commit 3dcd033616

View File

@@ -25,7 +25,6 @@ namespace
};
struct OptionalHeaderX64 final
{
std::uint16_t magic;
std::uint16_t linker_version;
@@ -177,7 +176,8 @@ namespace
};
// 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]]
std::optional<NtHeaderVariant> get_nt_header_from_file(std::fstream& file, const DosHeader& dos_header)