// /*************************************************************************** // Aaru Data Preservation Suite // ---------------------------------------------------------------------------- // // Filename : Structs.cs // Author(s) : Natalia Portillo // // Component : Apple Macintosh File System plugin. // // --[ Description ] ---------------------------------------------------------- // // Apple Macintosh File System structures. // // --[ 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.Diagnostics.CodeAnalysis; #pragma warning disable 169 namespace Aaru.Filesystems { // Information from Inside Macintosh Volume II [SuppressMessage("ReSharper", "InconsistentNaming"), SuppressMessage("ReSharper", "NotAccessedField.Local")] public sealed partial class AppleMFS { /// Master Directory Block, should be at offset 0x0400 bytes in volume struct MasterDirectoryBlock { /// 0x000, Signature, 0xD2D7 public ushort drSigWord; /// 0x002, Volume creation date public uint drCrDate; /// 0x006, Volume last backup date public uint drLsBkUp; /// 0x00A, Volume attributes public AppleCommon.VolumeAttributes drAtrb; /// 0x00C, Volume number of files public ushort drNmFls; /// 0x00E, First directory sector public ushort drDirSt; /// 0x010, Length of directory in sectors public ushort drBlLen; /// 0x012, Volume allocation blocks public ushort drNmAlBlks; /// 0x014, Size of allocation blocks public uint drAlBlkSiz; /// 0x018, Number of bytes to allocate public uint drClpSiz; /// 0x01C, First allocation block in block map public ushort drAlBlSt; /// 0x01E. Next unused file number public uint drNxtFNum; /// 0x022, Number of unused allocation blocks public ushort drFreeBks; /// 0x024, Length of volume name public byte drVNSiz; /// 0x025, Characters of volume name public string drVN; } [Flags] enum FileFlags : byte { Locked = 0x01, Used = 0x80 } struct FileEntry { /// 0x00, Entry flags public FileFlags flFlags; /// 0x01, Version number public byte flTyp; /// 0x02, FinderInfo public AppleCommon.FInfo flUsrWds; /// 0x12, file ID public uint flFlNum; /// 0x16, first allocation block of data fork public ushort flStBlk; /// 0x18, logical end-of-file of data fork public uint flLgLen; /// 0x1C, physical end-of-file of data fork public uint flPyLen; /// 0x20, first allocation block of resource fork public ushort flRStBlk; /// 0x22, logical end-of-file of resource fork public uint flRLgLen; /// 0x26, physical end-of-file of resource fork public uint flRPyLen; /// 0x2A, date and time of creation public uint flCrDat; /// 0x2E, date and time of last modification public uint flMdDat; /// 0x32, file name prefixed with length public byte[] flNam; } } }