From 78e616ab73e3d3f20b5e148ac551c0056ef76651 Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Mon, 9 Oct 2017 12:54:46 +0100 Subject: [PATCH] Added support for AAIP extensions to ISO9660. --- DiscImageChef.Filesystems/ISO9660/Consts.cs | 8 ++++++++ DiscImageChef.Filesystems/ISO9660/Info.cs | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/DiscImageChef.Filesystems/ISO9660/Consts.cs b/DiscImageChef.Filesystems/ISO9660/Consts.cs index 6509dd3f1..f4f1fdfb8 100644 --- a/DiscImageChef.Filesystems/ISO9660/Consts.cs +++ b/DiscImageChef.Filesystems/ISO9660/Consts.cs @@ -64,6 +64,8 @@ namespace DiscImageChef.Filesystems.ISO9660 const ushort ziso_Magic = 0x5A46; // "ZF" const ushort ziso_PagedZlib = 0x707A; // "pz" const ushort Amiga_Magic = 0x4153; // "AS" + const ushort AAIP_Magic = 0x414C; // "AL" + const ushort AAIP_OldMagic = 0x4141; // "AA" [Flags] enum FileFlags : byte @@ -267,5 +269,11 @@ namespace DiscImageChef.Filesystems.ISO9660 Script = 1 << 6, Reserved = 1 << 7, } + + [Flags] + enum AAIPFlags : byte + { + Continue = 1 + } } } diff --git a/DiscImageChef.Filesystems/ISO9660/Info.cs b/DiscImageChef.Filesystems/ISO9660/Info.cs index 035869322..8b520fa7e 100644 --- a/DiscImageChef.Filesystems/ISO9660/Info.cs +++ b/DiscImageChef.Filesystems/ISO9660/Info.cs @@ -259,6 +259,7 @@ namespace DiscImageChef.Filesystems.ISO9660 bool RRIP = false; bool ziso = false; bool Amiga = false; + bool AAIP = false; List contareas = new List(); List refareas = new List(); StringBuilder suspInformation = new StringBuilder(); @@ -380,6 +381,7 @@ namespace DiscImageChef.Filesystems.ISO9660 ziso |= nextSignature == ziso_Magic; Amiga |= nextSignature == Amiga_Magic; + AAIP |= nextSignature == AAIP_Magic || (nextSignature == AAIP_OldMagic && sa[sa_off + 3] == 1 && sa[sa_off + 2] >= 9); sa_off += sa[sa_off + 2]; @@ -438,6 +440,7 @@ namespace DiscImageChef.Filesystems.ISO9660 ziso |= nextSignature == ziso_Magic; Amiga |= nextSignature == Amiga_Magic; + AAIP |= nextSignature == AAIP_Magic || (nextSignature == AAIP_OldMagic && ca_data[ca_off + 3] == 1 && ca_data[ca_off + 2] >= 9); ca_off += ca_data[ca_off + 2]; } @@ -480,6 +483,8 @@ namespace DiscImageChef.Filesystems.ISO9660 ISOMetadata.AppendLine("System Use Sharing Protocol present."); if(RRIP) ISOMetadata.AppendLine("Rock Ridge Interchange Protocol present."); + if(AAIP) + ISOMetadata.AppendLine("Arbitrary Attribute Interchange Protocol present."); if(ziso) ISOMetadata.AppendLine("zisofs compression present."); if(bvd != null)