diff --git a/SabreTools.Serialization/Extensions/ISO9660.cs b/SabreTools.Serialization/Extensions/ISO9660.cs index 6108c2bd..289bba22 100644 --- a/SabreTools.Serialization/Extensions/ISO9660.cs +++ b/SabreTools.Serialization/Extensions/ISO9660.cs @@ -1,5 +1,6 @@ using System; using SabreTools.Data.Models.ISO9660; +using SabreTools.IO.Extensions; namespace SabreTools.Data.Extensions { @@ -57,6 +58,36 @@ namespace SabreTools.Data.Extensions return Array.TrueForAll(bvd.Reserved653Bytes, b => b == 0x00); } + /// + /// Determine if a volume descriptor was written by ImgBurn + /// + /// Volume descriptor containing the application use bytes + /// True if the descriptor was written by ImgBurn, false otherwise + public static bool IsImgBurn(this BaseVolumeDescriptor? bvd) + { + // Invalid volume descriptor + if (bvd?.ApplicationUse == null) + return false; + + // "ImgBurn" + return bvd.ApplicationUse.StartsWith([0x49, 0x6D, 0x67, 0x42, 0x75, 0x72, 0x6E]); + } + + /// + /// Determine if a volume descriptor was written by UltraISO + /// + /// Volume descriptor containing the application use bytes + /// True if the descriptor was written by UltraISO, false otherwise + public static bool IsUltraISO(this BaseVolumeDescriptor? bvd) + { + // Invalid volume descriptor + if (bvd?.ApplicationUse == null) + return false; + + // "ULTRAISO" + return bvd.ApplicationUse.StartsWith([0x55, 0x4C, 0x54, 0x52, 0x41, 0x49, 0x53, 0x4F]); + } + /// /// Indicates if an array contains all ASCII numeric digits ///