From 6ab06b316fd6dc0f078ca190d027fbb508b54ea4 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Sat, 2 Aug 2025 18:00:05 +0100 Subject: [PATCH] Add support for V2 header. --- aaruformat.hexpat | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/aaruformat.hexpat b/aaruformat.hexpat index 07a9cb1..9aec923 100644 --- a/aaruformat.hexpat +++ b/aaruformat.hexpat @@ -53,7 +53,7 @@ import type.time; #define DIC_MAGIC "DICMFRMT" #define AARU_MAGIC "AARUFRMT" -enum MediaType : u32 +enum MediaTypeOld : u32 { Unknown = 0, UnknownMO = 1, @@ -773,10 +773,24 @@ struct AaruHeader u8 imageMinorVersion; u8 applicationMajorVersion; u8 applicationMinorVersion; - MediaType mediaType; + if(imageMajorVersion == 1) + MediaTypeOld mediaType; + else + u32 mediaType; Index *indexOffset : u64; type::FILETIME creationTime; type::FILETIME lastWrittenTime; + + if(imageMajorVersion >= 2) + { + type::GUID guid; + u8 blockAlignmentShift; + u8 dataShift; + u8 tableShift; + u64 featureCompatible; + u64 featureCompatibleRo; + u64 featureIncompatible; + } }; struct DdtHeader @@ -1085,4 +1099,4 @@ struct Index AaruHeader header @ 0x00; if(header.identifier != DIC_MAGIC && header.identifier != AARU_MAGIC) - std::error("Incorrect signature!"); + std::error("Incorrect signature!"); \ No newline at end of file