2017-07-19 16:31:08 +01:00
|
|
|
|
// /***************************************************************************
|
2016-08-01 00:41:02 +01:00
|
|
|
|
// The Disc Image Chef
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
//
|
|
|
|
|
|
// Filename : AppleMFS.cs
|
|
|
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
|
|
|
|
|
//
|
|
|
|
|
|
// Component : Apple Macintosh File System plugin.
|
|
|
|
|
|
//
|
|
|
|
|
|
// --[ Description ] ----------------------------------------------------------
|
|
|
|
|
|
//
|
2016-08-01 00:43:31 +01:00
|
|
|
|
// Constructors and common variables for the Apple Macintosh File System plugin.
|
2016-08-01 00:41:02 +01:00
|
|
|
|
//
|
|
|
|
|
|
// --[ 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 <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
//
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
2017-12-19 03:50:57 +00:00
|
|
|
|
// Copyright © 2011-2018 Natalia Portillo
|
2016-08-01 00:41:02 +01:00
|
|
|
|
// ****************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
using System;
|
2016-08-01 17:59:22 +01:00
|
|
|
|
using System.Collections.Generic;
|
2017-06-06 21:23:20 +01:00
|
|
|
|
using System.Text;
|
2017-12-20 17:15:26 +00:00
|
|
|
|
using DiscImageChef.DiscImages;
|
2017-12-26 06:05:12 +00:00
|
|
|
|
using Schemas;
|
2016-08-01 00:41:02 +01:00
|
|
|
|
|
|
|
|
|
|
namespace DiscImageChef.Filesystems.AppleMFS
|
|
|
|
|
|
{
|
|
|
|
|
|
// Information from Inside Macintosh Volume II
|
2017-12-26 07:23:09 +00:00
|
|
|
|
public partial class AppleMFS : IReadOnlyFilesystem
|
2016-08-01 00:41:02 +01:00
|
|
|
|
{
|
2017-12-27 23:55:59 +00:00
|
|
|
|
bool mounted;
|
|
|
|
|
|
bool debug;
|
2017-12-26 06:05:12 +00:00
|
|
|
|
IMediaImage device;
|
2017-12-27 23:55:59 +00:00
|
|
|
|
ulong partitionStart;
|
2016-08-01 17:59:22 +01:00
|
|
|
|
|
2017-12-27 23:55:59 +00:00
|
|
|
|
Dictionary<uint, string> idToFilename;
|
2016-08-01 17:59:22 +01:00
|
|
|
|
Dictionary<uint, MFS_FileEntry> idToEntry;
|
2017-12-27 23:55:59 +00:00
|
|
|
|
Dictionary<string, uint> filenameToId;
|
2016-08-01 17:59:22 +01:00
|
|
|
|
|
|
|
|
|
|
MFS_MasterDirectoryBlock volMDB;
|
2017-12-27 23:55:59 +00:00
|
|
|
|
byte[] bootBlocks;
|
|
|
|
|
|
byte[] mdbBlocks;
|
|
|
|
|
|
byte[] directoryBlocks;
|
|
|
|
|
|
byte[] blockMapBytes;
|
|
|
|
|
|
uint[] blockMap;
|
|
|
|
|
|
int sectorsPerBlock;
|
|
|
|
|
|
byte[] bootTags;
|
|
|
|
|
|
byte[] mdbTags;
|
|
|
|
|
|
byte[] directoryTags;
|
|
|
|
|
|
byte[] bitmapTags;
|
2017-12-26 06:05:12 +00:00
|
|
|
|
|
2017-12-26 08:01:40 +00:00
|
|
|
|
public FileSystemType XmlFsType { get; private set; }
|
2017-12-27 23:55:59 +00:00
|
|
|
|
public string Name => "Apple Macintosh File System";
|
|
|
|
|
|
public Guid Id => new Guid("36405F8D-0D26-4066-6538-5DBF5D065C3A");
|
|
|
|
|
|
public Encoding Encoding { get; private set; }
|
2016-08-01 17:59:22 +01:00
|
|
|
|
|
2017-12-28 18:08:15 +00:00
|
|
|
|
// TODO: Implement Finder namespace (requires decoding Desktop database)
|
|
|
|
|
|
public IEnumerable<(string name, Type type, string description)> SupportedOptions =>
|
|
|
|
|
|
new(string name, Type type, string description)[] { };
|
|
|
|
|
|
|
2017-12-27 23:55:59 +00:00
|
|
|
|
static Dictionary<string, string> GetDefaultOptions()
|
2016-08-01 00:41:02 +01:00
|
|
|
|
{
|
2017-12-27 23:55:59 +00:00
|
|
|
|
return new Dictionary<string, string> {{"debug", false.ToString()}};
|
2016-08-01 00:41:02 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2017-12-19 20:33:03 +00:00
|
|
|
|
}
|