2017-07-19 16:31:08 +01:00
|
|
|
|
// /***************************************************************************
|
2016-07-21 17:36:51 +01:00
|
|
|
|
// The Disc Image Chef
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
//
|
|
|
|
|
|
// Filename : Info.cs
|
2016-07-28 18:13:49 +01:00
|
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
|
|
|
|
|
//
|
|
|
|
|
|
// Component : Apple Lisa filesystem plugin.
|
|
|
|
|
|
//
|
|
|
|
|
|
// --[ Description ] ----------------------------------------------------------
|
|
|
|
|
|
//
|
|
|
|
|
|
// Identifies the Apple Lisa filesystem and shows information.
|
|
|
|
|
|
//
|
|
|
|
|
|
// --[ 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-07-28 18:13:49 +01:00
|
|
|
|
// ****************************************************************************/
|
|
|
|
|
|
|
2016-07-21 17:36:51 +01:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Text;
|
2017-12-26 06:47:33 +00:00
|
|
|
|
using Claunia.Encoding;
|
2017-07-19 16:31:08 +01:00
|
|
|
|
using DiscImageChef.CommonTypes;
|
2016-07-21 17:36:51 +01:00
|
|
|
|
using DiscImageChef.Console;
|
2016-08-21 19:23:58 +01:00
|
|
|
|
using DiscImageChef.Decoders;
|
2017-12-20 17:15:26 +00:00
|
|
|
|
using DiscImageChef.DiscImages;
|
2017-12-21 14:30:38 +00:00
|
|
|
|
using Schemas;
|
2017-12-26 06:47:33 +00:00
|
|
|
|
using Encoding = System.Text.Encoding;
|
2016-07-21 17:36:51 +01:00
|
|
|
|
|
|
|
|
|
|
namespace DiscImageChef.Filesystems.LisaFS
|
|
|
|
|
|
{
|
2017-12-21 16:27:09 +00:00
|
|
|
|
public partial class LisaFS
|
2016-07-21 17:36:51 +01:00
|
|
|
|
{
|
2017-12-26 07:28:40 +00:00
|
|
|
|
public bool Identify(IMediaImage imagePlugin, Partition partition)
|
2016-07-21 17:36:51 +01:00
|
|
|
|
{
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2017-12-26 06:05:12 +00:00
|
|
|
|
if(imagePlugin.Info.ReadableSectorTags == null) return false;
|
2016-07-21 17:36:51 +01:00
|
|
|
|
|
2017-12-26 06:05:12 +00:00
|
|
|
|
if(!imagePlugin.Info.ReadableSectorTags.Contains(SectorTagType.AppleSectorTag)) return false;
|
2016-07-21 17:36:51 +01:00
|
|
|
|
|
|
|
|
|
|
// LisaOS is big-endian
|
|
|
|
|
|
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
|
|
|
|
|
|
|
|
|
|
|
|
// Minimal LisaOS disk is 3.5" single sided double density, 800 sectors
|
2017-12-26 06:05:12 +00:00
|
|
|
|
if(imagePlugin.Info.Sectors < 800) return false;
|
2016-07-21 17:36:51 +01:00
|
|
|
|
|
2017-12-22 08:43:22 +00:00
|
|
|
|
int beforeMddf = -1;
|
2016-07-27 22:13:47 +01:00
|
|
|
|
|
2016-07-21 17:36:51 +01:00
|
|
|
|
// LisaOS searches sectors until tag tells MDDF resides there, so we'll search 100 sectors
|
|
|
|
|
|
for(int i = 0; i < 100; i++)
|
|
|
|
|
|
{
|
2017-12-24 02:37:41 +00:00
|
|
|
|
DecodeTag(imagePlugin.ReadSectorTag((ulong)i, SectorTagType.AppleSectorTag),
|
|
|
|
|
|
out LisaTag.PriamTag searchTag);
|
2016-07-27 22:13:47 +01:00
|
|
|
|
|
2017-12-22 02:04:18 +00:00
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "Sector {0}, file ID 0x{1:X4}", i, searchTag.FileId);
|
2016-07-21 17:36:51 +01:00
|
|
|
|
|
2017-12-22 08:43:22 +00:00
|
|
|
|
if(beforeMddf == -1 && searchTag.FileId == FILEID_LOADER_SIGNED) beforeMddf = i - 1;
|
2016-07-21 17:36:51 +01:00
|
|
|
|
|
2017-12-22 02:04:18 +00:00
|
|
|
|
if(searchTag.FileId != FILEID_MDDF) continue;
|
2016-07-21 17:36:51 +01:00
|
|
|
|
|
2017-12-21 06:06:19 +00:00
|
|
|
|
byte[] sector = imagePlugin.ReadSector((ulong)i);
|
2017-12-22 08:43:22 +00:00
|
|
|
|
MDDF infoMddf = new MDDF
|
|
|
|
|
|
{
|
2018-06-22 08:08:38 +01:00
|
|
|
|
mddf_block = BigEndianBitConverter.ToUInt32(sector, 0x6C),
|
|
|
|
|
|
volsize_minus_one = BigEndianBitConverter.ToUInt32(sector, 0x70),
|
2017-12-22 08:43:22 +00:00
|
|
|
|
volsize_minus_mddf_minus_one = BigEndianBitConverter.ToUInt32(sector, 0x74),
|
2018-06-22 08:08:38 +01:00
|
|
|
|
vol_size = BigEndianBitConverter.ToUInt32(sector, 0x78),
|
|
|
|
|
|
blocksize = BigEndianBitConverter.ToUInt16(sector, 0x7C),
|
|
|
|
|
|
datasize = BigEndianBitConverter.ToUInt16(sector, 0x7E)
|
2017-12-22 08:43:22 +00:00
|
|
|
|
};
|
2016-07-21 17:36:51 +01:00
|
|
|
|
|
2018-06-22 08:08:38 +01:00
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "Current sector = {0}", i);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.mddf_block = {0}", infoMddf.mddf_block);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "Disk size = {0} sectors", imagePlugin.Info.Sectors);
|
2017-12-22 08:43:22 +00:00
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.vol_size = {0} sectors", infoMddf.vol_size);
|
2018-06-22 08:08:38 +01:00
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.vol_size - 1 = {0}",
|
|
|
|
|
|
infoMddf.volsize_minus_one);
|
2017-12-21 06:06:19 +00:00
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.vol_size - mddf.mddf_block -1 = {0}",
|
2017-12-22 08:43:22 +00:00
|
|
|
|
infoMddf.volsize_minus_mddf_minus_one);
|
2018-06-22 08:08:38 +01:00
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "Disk sector = {0} bytes",
|
|
|
|
|
|
imagePlugin.Info.SectorSize);
|
2017-12-22 08:43:22 +00:00
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.blocksize = {0} bytes", infoMddf.blocksize);
|
2018-06-22 08:08:38 +01:00
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.datasize = {0} bytes", infoMddf.datasize);
|
2016-07-21 17:36:51 +01:00
|
|
|
|
|
2017-12-22 08:43:22 +00:00
|
|
|
|
if(infoMddf.mddf_block != i - beforeMddf) return false;
|
2016-07-21 17:36:51 +01:00
|
|
|
|
|
2017-12-26 06:05:12 +00:00
|
|
|
|
if(infoMddf.vol_size > imagePlugin.Info.Sectors) return false;
|
2016-07-21 17:36:51 +01:00
|
|
|
|
|
2017-12-22 08:43:22 +00:00
|
|
|
|
if(infoMddf.vol_size - 1 != infoMddf.volsize_minus_one) return false;
|
2016-07-21 17:36:51 +01:00
|
|
|
|
|
2017-12-22 08:43:22 +00:00
|
|
|
|
if(infoMddf.vol_size - i - 1 != infoMddf.volsize_minus_mddf_minus_one - beforeMddf) return false;
|
2016-07-21 17:36:51 +01:00
|
|
|
|
|
2017-12-22 08:43:22 +00:00
|
|
|
|
if(infoMddf.datasize > infoMddf.blocksize) return false;
|
2016-07-21 17:36:51 +01:00
|
|
|
|
|
2017-12-26 06:05:12 +00:00
|
|
|
|
if(infoMddf.blocksize < imagePlugin.Info.SectorSize) return false;
|
2017-12-21 06:06:19 +00:00
|
|
|
|
|
2017-12-26 06:05:12 +00:00
|
|
|
|
return infoMddf.datasize == imagePlugin.Info.SectorSize;
|
2016-07-21 17:36:51 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
catch(Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
DicConsole.ErrorWriteLine("Exception {0}, {1}, {2}", ex.Message, ex.InnerException, ex.StackTrace);
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-12-26 08:01:40 +00:00
|
|
|
|
public void GetInformation(IMediaImage imagePlugin, Partition partition, out string information,
|
2018-06-22 08:08:38 +01:00
|
|
|
|
Encoding encoding)
|
2016-07-21 17:36:51 +01:00
|
|
|
|
{
|
2018-06-22 08:08:38 +01:00
|
|
|
|
Encoding = new LisaRoman();
|
2016-07-21 17:36:51 +01:00
|
|
|
|
information = "";
|
|
|
|
|
|
StringBuilder sb = new StringBuilder();
|
|
|
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
|
{
|
2017-12-26 06:05:12 +00:00
|
|
|
|
if(imagePlugin.Info.ReadableSectorTags == null) return;
|
2016-07-21 17:36:51 +01:00
|
|
|
|
|
2017-12-26 06:05:12 +00:00
|
|
|
|
if(!imagePlugin.Info.ReadableSectorTags.Contains(SectorTagType.AppleSectorTag)) return;
|
2016-07-21 17:36:51 +01:00
|
|
|
|
|
|
|
|
|
|
// LisaOS is big-endian
|
|
|
|
|
|
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
|
|
|
|
|
|
|
|
|
|
|
|
// Minimal LisaOS disk is 3.5" single sided double density, 800 sectors
|
2017-12-26 06:05:12 +00:00
|
|
|
|
if(imagePlugin.Info.Sectors < 800) return;
|
2016-07-21 17:36:51 +01:00
|
|
|
|
|
2017-12-22 08:43:22 +00:00
|
|
|
|
int beforeMddf = -1;
|
2016-07-27 22:13:47 +01:00
|
|
|
|
|
2016-07-21 17:36:51 +01:00
|
|
|
|
// LisaOS searches sectors until tag tells MDDF resides there, so we'll search 100 sectors
|
|
|
|
|
|
for(int i = 0; i < 100; i++)
|
|
|
|
|
|
{
|
2017-12-24 02:37:41 +00:00
|
|
|
|
DecodeTag(imagePlugin.ReadSectorTag((ulong)i, SectorTagType.AppleSectorTag),
|
|
|
|
|
|
out LisaTag.PriamTag searchTag);
|
2016-07-27 22:13:47 +01:00
|
|
|
|
|
2017-12-22 02:04:18 +00:00
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "Sector {0}, file ID 0x{1:X4}", i, searchTag.FileId);
|
2016-07-21 17:36:51 +01:00
|
|
|
|
|
2017-12-22 08:43:22 +00:00
|
|
|
|
if(beforeMddf == -1 && searchTag.FileId == FILEID_LOADER_SIGNED) beforeMddf = i - 1;
|
2016-07-21 17:36:51 +01:00
|
|
|
|
|
2017-12-22 02:04:18 +00:00
|
|
|
|
if(searchTag.FileId != FILEID_MDDF) continue;
|
2017-12-21 06:06:19 +00:00
|
|
|
|
|
2018-06-22 08:08:38 +01:00
|
|
|
|
byte[] sector = imagePlugin.ReadSector((ulong)i);
|
|
|
|
|
|
MDDF infoMddf = new MDDF();
|
|
|
|
|
|
byte[] pString = new byte[33];
|
2017-12-21 06:06:19 +00:00
|
|
|
|
|
2017-12-22 08:43:22 +00:00
|
|
|
|
infoMddf.fsversion = BigEndianBitConverter.ToUInt16(sector, 0x00);
|
2018-06-22 08:08:38 +01:00
|
|
|
|
infoMddf.volid = BigEndianBitConverter.ToUInt64(sector, 0x02);
|
|
|
|
|
|
infoMddf.volnum = BigEndianBitConverter.ToUInt16(sector, 0x0A);
|
2017-12-21 06:06:19 +00:00
|
|
|
|
Array.Copy(sector, 0x0C, pString, 0, 33);
|
2018-06-22 08:08:38 +01:00
|
|
|
|
infoMddf.volname = StringHandlers.PascalToString(pString, Encoding);
|
2017-12-22 08:43:22 +00:00
|
|
|
|
infoMddf.unknown1 = sector[0x2D];
|
2017-12-21 06:06:19 +00:00
|
|
|
|
Array.Copy(sector, 0x2E, pString, 0, 33);
|
|
|
|
|
|
// Prevent garbage
|
2018-06-22 08:08:38 +01:00
|
|
|
|
infoMddf.password = pString[0] <= 32 ? StringHandlers.PascalToString(pString, Encoding) : "";
|
|
|
|
|
|
infoMddf.unknown2 = sector[0x4F];
|
|
|
|
|
|
infoMddf.machine_id = BigEndianBitConverter.ToUInt32(sector, 0x50);
|
2017-12-22 08:43:22 +00:00
|
|
|
|
infoMddf.master_copy_id = BigEndianBitConverter.ToUInt32(sector, 0x54);
|
2018-06-20 22:22:21 +01:00
|
|
|
|
uint lisaTime = BigEndianBitConverter.ToUInt32(sector, 0x58);
|
2018-06-22 08:08:38 +01:00
|
|
|
|
infoMddf.dtvc = DateHandlers.LisaToDateTime(lisaTime);
|
|
|
|
|
|
lisaTime = BigEndianBitConverter.ToUInt32(sector, 0x5C);
|
|
|
|
|
|
infoMddf.dtcc = DateHandlers.LisaToDateTime(lisaTime);
|
|
|
|
|
|
lisaTime = BigEndianBitConverter.ToUInt32(sector, 0x60);
|
|
|
|
|
|
infoMddf.dtvb = DateHandlers.LisaToDateTime(lisaTime);
|
|
|
|
|
|
lisaTime = BigEndianBitConverter.ToUInt32(sector, 0x64);
|
|
|
|
|
|
infoMddf.dtvs = DateHandlers.LisaToDateTime(lisaTime);
|
|
|
|
|
|
infoMddf.unknown3 = BigEndianBitConverter.ToUInt32(sector, 0x68);
|
|
|
|
|
|
infoMddf.mddf_block = BigEndianBitConverter.ToUInt32(sector, 0x6C);
|
|
|
|
|
|
infoMddf.volsize_minus_one = BigEndianBitConverter.ToUInt32(sector, 0x70);
|
2017-12-22 08:43:22 +00:00
|
|
|
|
infoMddf.volsize_minus_mddf_minus_one = BigEndianBitConverter.ToUInt32(sector, 0x74);
|
2018-06-22 08:08:38 +01:00
|
|
|
|
infoMddf.vol_size = BigEndianBitConverter.ToUInt32(sector, 0x78);
|
|
|
|
|
|
infoMddf.blocksize = BigEndianBitConverter.ToUInt16(sector, 0x7C);
|
|
|
|
|
|
infoMddf.datasize = BigEndianBitConverter.ToUInt16(sector, 0x7E);
|
|
|
|
|
|
infoMddf.unknown4 = BigEndianBitConverter.ToUInt16(sector, 0x80);
|
|
|
|
|
|
infoMddf.unknown5 = BigEndianBitConverter.ToUInt32(sector, 0x82);
|
|
|
|
|
|
infoMddf.unknown6 = BigEndianBitConverter.ToUInt32(sector, 0x86);
|
|
|
|
|
|
infoMddf.clustersize = BigEndianBitConverter.ToUInt16(sector, 0x8A);
|
|
|
|
|
|
infoMddf.fs_size = BigEndianBitConverter.ToUInt32(sector, 0x8C);
|
|
|
|
|
|
infoMddf.unknown7 = BigEndianBitConverter.ToUInt32(sector, 0x90);
|
|
|
|
|
|
infoMddf.srec_ptr = BigEndianBitConverter.ToUInt32(sector, 0x94);
|
|
|
|
|
|
infoMddf.unknown9 = BigEndianBitConverter.ToUInt16(sector, 0x98);
|
|
|
|
|
|
infoMddf.srec_len = BigEndianBitConverter.ToUInt16(sector, 0x9A);
|
|
|
|
|
|
infoMddf.unknown10 = BigEndianBitConverter.ToUInt32(sector, 0x9C);
|
|
|
|
|
|
infoMddf.unknown11 = BigEndianBitConverter.ToUInt32(sector, 0xA0);
|
|
|
|
|
|
infoMddf.unknown12 = BigEndianBitConverter.ToUInt32(sector, 0xA4);
|
|
|
|
|
|
infoMddf.unknown13 = BigEndianBitConverter.ToUInt32(sector, 0xA8);
|
|
|
|
|
|
infoMddf.unknown14 = BigEndianBitConverter.ToUInt32(sector, 0xAC);
|
|
|
|
|
|
infoMddf.filecount = BigEndianBitConverter.ToUInt16(sector, 0xB0);
|
|
|
|
|
|
infoMddf.unknown15 = BigEndianBitConverter.ToUInt32(sector, 0xB2);
|
|
|
|
|
|
infoMddf.unknown16 = BigEndianBitConverter.ToUInt32(sector, 0xB6);
|
|
|
|
|
|
infoMddf.freecount = BigEndianBitConverter.ToUInt32(sector, 0xBA);
|
|
|
|
|
|
infoMddf.unknown17 = BigEndianBitConverter.ToUInt16(sector, 0xBE);
|
|
|
|
|
|
infoMddf.unknown18 = BigEndianBitConverter.ToUInt32(sector, 0xC0);
|
|
|
|
|
|
infoMddf.overmount_stamp = BigEndianBitConverter.ToUInt64(sector, 0xC4);
|
|
|
|
|
|
infoMddf.serialization = BigEndianBitConverter.ToUInt32(sector, 0xCC);
|
|
|
|
|
|
infoMddf.unknown19 = BigEndianBitConverter.ToUInt32(sector, 0xD0);
|
|
|
|
|
|
infoMddf.unknown_timestamp = BigEndianBitConverter.ToUInt32(sector, 0xD4);
|
|
|
|
|
|
infoMddf.unknown20 = BigEndianBitConverter.ToUInt32(sector, 0xD8);
|
|
|
|
|
|
infoMddf.unknown21 = BigEndianBitConverter.ToUInt32(sector, 0xDC);
|
|
|
|
|
|
infoMddf.unknown22 = BigEndianBitConverter.ToUInt32(sector, 0xE0);
|
|
|
|
|
|
infoMddf.unknown23 = BigEndianBitConverter.ToUInt32(sector, 0xE4);
|
|
|
|
|
|
infoMddf.unknown24 = BigEndianBitConverter.ToUInt32(sector, 0xE8);
|
|
|
|
|
|
infoMddf.unknown25 = BigEndianBitConverter.ToUInt32(sector, 0xEC);
|
|
|
|
|
|
infoMddf.unknown26 = BigEndianBitConverter.ToUInt32(sector, 0xF0);
|
|
|
|
|
|
infoMddf.unknown27 = BigEndianBitConverter.ToUInt32(sector, 0xF4);
|
|
|
|
|
|
infoMddf.unknown28 = BigEndianBitConverter.ToUInt32(sector, 0xF8);
|
|
|
|
|
|
infoMddf.unknown29 = BigEndianBitConverter.ToUInt32(sector, 0xFC);
|
|
|
|
|
|
infoMddf.unknown30 = BigEndianBitConverter.ToUInt32(sector, 0x100);
|
|
|
|
|
|
infoMddf.unknown31 = BigEndianBitConverter.ToUInt32(sector, 0x104);
|
|
|
|
|
|
infoMddf.unknown32 = BigEndianBitConverter.ToUInt32(sector, 0x108);
|
|
|
|
|
|
infoMddf.unknown33 = BigEndianBitConverter.ToUInt32(sector, 0x10C);
|
|
|
|
|
|
infoMddf.unknown34 = BigEndianBitConverter.ToUInt32(sector, 0x110);
|
|
|
|
|
|
infoMddf.unknown35 = BigEndianBitConverter.ToUInt32(sector, 0x114);
|
|
|
|
|
|
infoMddf.backup_volid = BigEndianBitConverter.ToUInt64(sector, 0x118);
|
|
|
|
|
|
infoMddf.label_size = BigEndianBitConverter.ToUInt16(sector, 0x120);
|
|
|
|
|
|
infoMddf.fs_overhead = BigEndianBitConverter.ToUInt16(sector, 0x122);
|
|
|
|
|
|
infoMddf.result_scavenge = BigEndianBitConverter.ToUInt16(sector, 0x124);
|
|
|
|
|
|
infoMddf.boot_code = BigEndianBitConverter.ToUInt16(sector, 0x126);
|
|
|
|
|
|
infoMddf.boot_environ = BigEndianBitConverter.ToUInt16(sector, 0x6C);
|
|
|
|
|
|
infoMddf.unknown36 = BigEndianBitConverter.ToUInt32(sector, 0x12A);
|
|
|
|
|
|
infoMddf.unknown37 = BigEndianBitConverter.ToUInt32(sector, 0x12E);
|
|
|
|
|
|
infoMddf.unknown38 = BigEndianBitConverter.ToUInt32(sector, 0x132);
|
|
|
|
|
|
infoMddf.vol_sequence = BigEndianBitConverter.ToUInt16(sector, 0x136);
|
|
|
|
|
|
infoMddf.vol_left_mounted = sector[0x138];
|
|
|
|
|
|
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown1 = 0x{0:X2} ({0})", infoMddf.unknown1);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown2 = 0x{0:X2} ({0})", infoMddf.unknown2);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown3 = 0x{0:X8} ({0})", infoMddf.unknown3);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown4 = 0x{0:X4} ({0})", infoMddf.unknown4);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown5 = 0x{0:X8} ({0})", infoMddf.unknown5);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown6 = 0x{0:X8} ({0})", infoMddf.unknown6);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown7 = 0x{0:X8} ({0})", infoMddf.unknown7);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown9 = 0x{0:X4} ({0})", infoMddf.unknown9);
|
2017-12-22 08:43:22 +00:00
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown10 = 0x{0:X8} ({0})", infoMddf.unknown10);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown11 = 0x{0:X8} ({0})", infoMddf.unknown11);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown12 = 0x{0:X8} ({0})", infoMddf.unknown12);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown13 = 0x{0:X8} ({0})", infoMddf.unknown13);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown14 = 0x{0:X8} ({0})", infoMddf.unknown14);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown15 = 0x{0:X8} ({0})", infoMddf.unknown15);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown16 = 0x{0:X8} ({0})", infoMddf.unknown16);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown17 = 0x{0:X4} ({0})", infoMddf.unknown17);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown18 = 0x{0:X8} ({0})", infoMddf.unknown18);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown19 = 0x{0:X8} ({0})", infoMddf.unknown19);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown20 = 0x{0:X8} ({0})", infoMddf.unknown20);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown21 = 0x{0:X8} ({0})", infoMddf.unknown21);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown22 = 0x{0:X8} ({0})", infoMddf.unknown22);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown23 = 0x{0:X8} ({0})", infoMddf.unknown23);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown24 = 0x{0:X8} ({0})", infoMddf.unknown24);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown25 = 0x{0:X8} ({0})", infoMddf.unknown25);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown26 = 0x{0:X8} ({0})", infoMddf.unknown26);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown27 = 0x{0:X8} ({0})", infoMddf.unknown27);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown28 = 0x{0:X8} ({0})", infoMddf.unknown28);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown29 = 0x{0:X8} ({0})", infoMddf.unknown29);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown30 = 0x{0:X8} ({0})", infoMddf.unknown30);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown31 = 0x{0:X8} ({0})", infoMddf.unknown31);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown32 = 0x{0:X8} ({0})", infoMddf.unknown32);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown33 = 0x{0:X8} ({0})", infoMddf.unknown33);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown34 = 0x{0:X8} ({0})", infoMddf.unknown34);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown35 = 0x{0:X8} ({0})", infoMddf.unknown35);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown36 = 0x{0:X8} ({0})", infoMddf.unknown36);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown37 = 0x{0:X8} ({0})", infoMddf.unknown37);
|
|
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown38 = 0x{0:X8} ({0})", infoMddf.unknown38);
|
2017-12-21 06:06:19 +00:00
|
|
|
|
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown_timestamp = 0x{0:X8} ({0}, {1})",
|
2017-12-22 08:43:22 +00:00
|
|
|
|
infoMddf.unknown_timestamp,
|
|
|
|
|
|
DateHandlers.LisaToDateTime(infoMddf.unknown_timestamp));
|
2017-12-21 06:06:19 +00:00
|
|
|
|
|
2017-12-22 08:43:22 +00:00
|
|
|
|
if(infoMddf.mddf_block != i - beforeMddf) return;
|
2017-12-21 06:06:19 +00:00
|
|
|
|
|
2017-12-26 06:05:12 +00:00
|
|
|
|
if(infoMddf.vol_size > imagePlugin.Info.Sectors) return;
|
2017-12-21 06:06:19 +00:00
|
|
|
|
|
2017-12-22 08:43:22 +00:00
|
|
|
|
if(infoMddf.vol_size - 1 != infoMddf.volsize_minus_one) return;
|
2017-12-21 06:06:19 +00:00
|
|
|
|
|
2017-12-22 08:43:22 +00:00
|
|
|
|
if(infoMddf.vol_size - i - 1 != infoMddf.volsize_minus_mddf_minus_one - beforeMddf) return;
|
2017-12-21 06:06:19 +00:00
|
|
|
|
|
2017-12-22 08:43:22 +00:00
|
|
|
|
if(infoMddf.datasize > infoMddf.blocksize) return;
|
2017-12-21 06:06:19 +00:00
|
|
|
|
|
2017-12-26 06:05:12 +00:00
|
|
|
|
if(infoMddf.blocksize < imagePlugin.Info.SectorSize) return;
|
2017-12-21 06:06:19 +00:00
|
|
|
|
|
2017-12-26 06:05:12 +00:00
|
|
|
|
if(infoMddf.datasize != imagePlugin.Info.SectorSize) return;
|
2017-12-21 06:06:19 +00:00
|
|
|
|
|
2017-12-22 08:43:22 +00:00
|
|
|
|
switch(infoMddf.fsversion)
|
2017-12-21 06:06:19 +00:00
|
|
|
|
{
|
2017-12-22 08:43:22 +00:00
|
|
|
|
case LISA_V1:
|
2017-12-21 06:06:19 +00:00
|
|
|
|
sb.AppendLine("LisaFS v1");
|
|
|
|
|
|
break;
|
2017-12-22 08:43:22 +00:00
|
|
|
|
case LISA_V2:
|
2017-12-21 06:06:19 +00:00
|
|
|
|
sb.AppendLine("LisaFS v2");
|
|
|
|
|
|
break;
|
2017-12-22 08:43:22 +00:00
|
|
|
|
case LISA_V3:
|
2017-12-21 06:06:19 +00:00
|
|
|
|
sb.AppendLine("LisaFS v3");
|
|
|
|
|
|
break;
|
|
|
|
|
|
default:
|
2017-12-22 08:43:22 +00:00
|
|
|
|
sb.AppendFormat("Uknown LisaFS version {0}", infoMddf.fsversion).AppendLine();
|
2017-12-21 06:06:19 +00:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2017-12-22 08:43:22 +00:00
|
|
|
|
sb.AppendFormat("Volume name: \"{0}\"", infoMddf.volname).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("Volume password: \"{0}\"", infoMddf.password).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("Volume ID: 0x{0:X16}", infoMddf.volid).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("Backup volume ID: 0x{0:X16}", infoMddf.backup_volid).AppendLine();
|
2017-12-21 06:06:19 +00:00
|
|
|
|
|
2017-12-22 08:43:22 +00:00
|
|
|
|
sb.AppendFormat("Master copy ID: 0x{0:X8}", infoMddf.master_copy_id).AppendLine();
|
2017-12-21 06:06:19 +00:00
|
|
|
|
|
2017-12-24 02:37:41 +00:00
|
|
|
|
sb.AppendFormat("Volume is number {0} of {1}", infoMddf.volnum, infoMddf.vol_sequence).AppendLine();
|
2017-12-21 06:06:19 +00:00
|
|
|
|
|
2017-12-24 02:37:41 +00:00
|
|
|
|
sb.AppendFormat("Serial number of Lisa computer that created this volume: {0}", infoMddf.machine_id)
|
|
|
|
|
|
.AppendLine();
|
2017-12-21 06:06:19 +00:00
|
|
|
|
sb.AppendFormat("Serial number of Lisa computer that can use this volume's software {0}",
|
2017-12-22 08:43:22 +00:00
|
|
|
|
infoMddf.serialization).AppendLine();
|
|
|
|
|
|
|
|
|
|
|
|
sb.AppendFormat("Volume created on {0}", infoMddf.dtvc).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("Some timestamp, says {0}", infoMddf.dtcc).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("Volume backed up on {0}", infoMddf.dtvb).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("Volume scavenged on {0}", infoMddf.dtvs).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("MDDF is in block {0}", infoMddf.mddf_block + beforeMddf).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("There are {0} reserved blocks before volume", beforeMddf).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("{0} blocks minus one", infoMddf.volsize_minus_one).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("{0} blocks minus one minus MDDF offset", infoMddf.volsize_minus_mddf_minus_one)
|
2017-12-21 06:06:19 +00:00
|
|
|
|
.AppendLine();
|
2017-12-22 08:43:22 +00:00
|
|
|
|
sb.AppendFormat("{0} blocks in volume", infoMddf.vol_size).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("{0} bytes per sector (uncooked)", infoMddf.blocksize).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("{0} bytes per sector", infoMddf.datasize).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("{0} blocks per cluster", infoMddf.clustersize).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("{0} blocks in filesystem", infoMddf.fs_size).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("{0} files in volume", infoMddf.filecount).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("{0} blocks free", infoMddf.freecount).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("{0} bytes in LisaInfo", infoMddf.label_size).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("Filesystem overhead: {0}", infoMddf.fs_overhead).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("Scanvenger result code: 0x{0:X8}", infoMddf.result_scavenge).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("Boot code: 0x{0:X8}", infoMddf.boot_code).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("Boot environment: 0x{0:X8}", infoMddf.boot_environ).AppendLine();
|
|
|
|
|
|
sb.AppendFormat("Overmount stamp: 0x{0:X16}", infoMddf.overmount_stamp).AppendLine();
|
2017-12-21 06:06:19 +00:00
|
|
|
|
sb.AppendFormat("S-Records start at {0} and spans for {1} blocks",
|
2017-12-22 08:43:22 +00:00
|
|
|
|
infoMddf.srec_ptr + infoMddf.mddf_block + beforeMddf, infoMddf.srec_len)
|
2017-12-21 06:06:19 +00:00
|
|
|
|
.AppendLine();
|
|
|
|
|
|
|
2017-12-24 02:37:41 +00:00
|
|
|
|
sb.AppendLine(infoMddf.vol_left_mounted == 0 ? "Volume is clean" : "Volume is dirty");
|
2017-12-21 06:06:19 +00:00
|
|
|
|
|
|
|
|
|
|
information = sb.ToString();
|
|
|
|
|
|
|
2017-12-26 08:01:40 +00:00
|
|
|
|
XmlFsType = new FileSystemType();
|
2017-12-22 08:43:22 +00:00
|
|
|
|
if(DateTime.Compare(infoMddf.dtvb, DateHandlers.LisaToDateTime(0)) > 0)
|
2017-12-21 06:06:19 +00:00
|
|
|
|
{
|
2018-06-22 08:08:38 +01:00
|
|
|
|
XmlFsType.BackupDate = infoMddf.dtvb;
|
2017-12-26 08:01:40 +00:00
|
|
|
|
XmlFsType.BackupDateSpecified = true;
|
2017-12-21 06:06:19 +00:00
|
|
|
|
}
|
2018-06-22 08:08:38 +01:00
|
|
|
|
|
|
|
|
|
|
XmlFsType.Clusters = infoMddf.vol_size;
|
2017-12-26 08:01:40 +00:00
|
|
|
|
XmlFsType.ClusterSize = infoMddf.clustersize * infoMddf.datasize;
|
2017-12-22 08:43:22 +00:00
|
|
|
|
if(DateTime.Compare(infoMddf.dtvc, DateHandlers.LisaToDateTime(0)) > 0)
|
2016-07-21 17:36:51 +01:00
|
|
|
|
{
|
2018-06-22 08:08:38 +01:00
|
|
|
|
XmlFsType.CreationDate = infoMddf.dtvc;
|
2017-12-26 08:01:40 +00:00
|
|
|
|
XmlFsType.CreationDateSpecified = true;
|
2016-07-21 17:36:51 +01:00
|
|
|
|
}
|
2018-06-22 08:08:38 +01:00
|
|
|
|
|
|
|
|
|
|
XmlFsType.Dirty = infoMddf.vol_left_mounted != 0;
|
|
|
|
|
|
XmlFsType.Files = infoMddf.filecount;
|
|
|
|
|
|
XmlFsType.FilesSpecified = true;
|
|
|
|
|
|
XmlFsType.FreeClusters = infoMddf.freecount;
|
2017-12-26 08:01:40 +00:00
|
|
|
|
XmlFsType.FreeClustersSpecified = true;
|
2018-06-22 08:08:38 +01:00
|
|
|
|
XmlFsType.Type = "LisaFS";
|
|
|
|
|
|
XmlFsType.VolumeName = infoMddf.volname;
|
|
|
|
|
|
XmlFsType.VolumeSerial = $"{infoMddf.volid:X16}";
|
2017-12-21 06:06:19 +00:00
|
|
|
|
|
|
|
|
|
|
return;
|
2016-07-21 17:36:51 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
catch(Exception ex)
|
|
|
|
|
|
{
|
|
|
|
|
|
DicConsole.ErrorWriteLine("Exception {0}, {1}, {2}", ex.Message, ex.InnerException, ex.StackTrace);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2017-12-19 20:33:03 +00:00
|
|
|
|
}
|