// /*************************************************************************** // Aaru Data Preservation Suite // ---------------------------------------------------------------------------- // // Filename : SGI.cs // Author(s) : Natalia Portillo // // Component : Partitioning scheme plugins. // // --[ Description ] ---------------------------------------------------------- // // Manages SGI DVHs (Disk Volume Headers). // // --[ License ] -------------------------------------------------------------- // // This library is free software; you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as // published by the Free Software Foundation; either version 2.1 of the // License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, but // WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, see . // // ---------------------------------------------------------------------------- // Copyright © 2011-2025 Natalia Portillo // ****************************************************************************/ using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using System.Runtime.InteropServices; using Aaru.CommonTypes.Attributes; using Aaru.CommonTypes.Enums; using Aaru.CommonTypes.Interfaces; using Aaru.Helpers; using Aaru.Logging; using Marshal = Aaru.Helpers.Marshal; #pragma warning disable 169 #pragma warning disable 649 namespace Aaru.Partitions; /// /// Implements decoding of the SGI Disk Volume Header [SuppressMessage("ReSharper", "InconsistentNaming")] public sealed partial class SGI : IPartition { const int SGI_MAGIC = 0x0BE5A941; const string MODULE_NAME = "SGI Volume Header plugin"; #region IPartition Members /// public string Name => Localization.SGI_Name; /// public Guid Id => new("AEF5AB45-4880-4CE8-8735-F0A402E2E5F2"); /// public string Author => Authors.NATALIA_PORTILLO; /// public bool GetInformation(IMediaImage imagePlugin, out List partitions, ulong sectorOffset) { partitions = []; ErrorNumber errno = imagePlugin.ReadSector(sectorOffset, false, out byte[] sector, out _); if(errno != ErrorNumber.NoError || sector.Length < 512) return false; Label dvh = Marshal.ByteArrayToStructureBigEndian