REFACTOR: All refactor in DiscImageChef.Filesystems.

This commit is contained in:
2017-12-22 08:43:22 +00:00
parent ef2fff0abd
commit c59e424ec8
87 changed files with 3834 additions and 4122 deletions

View File

@@ -38,13 +38,13 @@ namespace DiscImageChef.Filesystems.LisaFS
/// Lisa FS v1, from Lisa OS 1.0 (Workshop or Office)
/// Never seen on Sony floppies.
/// </summary>
const byte LisaFSv1 = 0x0E;
const byte LISA_V1 = 0x0E;
/// <summary>
/// Lisa FS v2, from Lisa OS 2.0 (Workshop or Office)
/// Contrary to what most information online says the only difference with V1
/// is the Extents File size. Catalog format is the same
/// </summary>
const byte LisaFSv2 = 0x0F;
const byte LISA_V2 = 0x0F;
/// <summary>
/// Lisa FS v3, from Lisa OS 3.0 (Workshop or Office)
/// Adds support for user catalogs (aka subdirectories),
@@ -52,7 +52,7 @@ namespace DiscImageChef.Filesystems.LisaFS
/// Uses '-' as path separator (so people that created Lisa/FILE.TEXT just
/// created a file named like that :p)
/// </summary>
const byte LisaFSv3 = 0x11;
const byte LISA_V3 = 0x11;
/// <summary>Maximum string size in LisaFS</summary>
const uint E_NAME = 32;
/// <summary>

View File

@@ -58,9 +58,7 @@ namespace DiscImageChef.Filesystems.LisaFS
/// <param name="contents">Directory contents.</param>
public override Errno ReadDir(string path, ref List<string> contents)
{
short fileId;
bool isDir;
Errno error = LookupFileId(path, out fileId, out isDir);
Errno error = LookupFileId(path, out short fileId, out bool isDir);
if(error != Errno.NoError) return error;
if(!isDir) return Errno.NotDirectory;
@@ -106,13 +104,10 @@ namespace DiscImageChef.Filesystems.LisaFS
catalogCache = new List<CatalogEntry>();
Errno error;
// Do differently for V1 and V2
if(mddf.fsversion == LisaFSv2 || mddf.fsversion == LisaFSv1)
if(mddf.fsversion == LISA_V2 || mddf.fsversion == LISA_V1)
{
byte[] buf;
error = ReadFile((short)FILEID_CATALOG, out buf);
Errno error = ReadFile((short)FILEID_CATALOG, out byte[] buf);
if(error != Errno.NoError) return error;
int offset = 0;
@@ -142,18 +137,19 @@ namespace DiscImageChef.Filesystems.LisaFS
// Convert entries to V3 format
foreach(CatalogEntryV2 entV2 in catalogV2)
{
ExtentFile ext;
error = ReadExtentsFile(entV2.fileID, out ext);
error = ReadExtentsFile(entV2.fileID, out ExtentFile ext);
if(error != Errno.NoError) continue;
CatalogEntry entV3 = new CatalogEntry();
entV3.fileID = entV2.fileID;
entV3.filename = new byte[32];
CatalogEntry entV3 = new CatalogEntry
{
fileID = entV2.fileID,
filename = new byte[32],
fileType = entV2.fileType,
length = (int)srecords[entV2.fileID].filesize,
dtc = ext.dtc,
dtm = ext.dtm
};
Array.Copy(entV2.filename, 0, entV3.filename, 0, entV2.filenameLen);
entV3.fileType = entV2.fileType;
entV3.length = (int)srecords[entV2.fileID].filesize;
entV3.dtc = ext.dtc;
entV3.dtm = ext.dtm;
catalogCache.Add(entV3);
}
@@ -168,8 +164,7 @@ namespace DiscImageChef.Filesystems.LisaFS
// If root catalog is not pointed in MDDF (unchecked) maybe it's always following S-Records File?
for(ulong i = 0; i < device.GetSectors(); i++)
{
LisaTag.PriamTag catTag;
DecodeTag(device.ReadSectorTag(i, SectorTagType.AppleSectorTag), out catTag);
DecodeTag(device.ReadSectorTag(i, SectorTagType.AppleSectorTag), out LisaTag.PriamTag catTag);
if(catTag.FileId != FILEID_CATALOG || catTag.RelPage != 0) continue;
@@ -186,9 +181,8 @@ namespace DiscImageChef.Filesystems.LisaFS
// Traverse double-linked list until first catalog block
while(prevCatalogPointer != 0xFFFFFFFF)
{
LisaTag.PriamTag prevTag;
DecodeTag(device.ReadSectorTag(prevCatalogPointer + mddf.mddf_block + volumePrefix, SectorTagType.AppleSectorTag),
out prevTag);
out LisaTag.PriamTag prevTag);
if(prevTag.FileId != FILEID_CATALOG) return Errno.InvalidArgument;
@@ -199,15 +193,13 @@ namespace DiscImageChef.Filesystems.LisaFS
ulong nextCatalogPointer;
nextCatalogPointer = BigEndianBitConverter.ToUInt32(firstCatalogBlock, 0x7FA);
List<byte[]> catalogBlocks = new List<byte[]>();
catalogBlocks.Add(firstCatalogBlock);
List<byte[]> catalogBlocks = new List<byte[]> {firstCatalogBlock};
// Traverse double-linked list to read full catalog
while(nextCatalogPointer != 0xFFFFFFFF)
{
LisaTag.PriamTag nextTag;
DecodeTag(device.ReadSectorTag(nextCatalogPointer + mddf.mddf_block + volumePrefix, SectorTagType.AppleSectorTag),
out nextTag);
out LisaTag.PriamTag nextTag);
if(nextTag.FileId != FILEID_CATALOG) return Errno.InvalidArgument;
@@ -232,24 +224,25 @@ namespace DiscImageChef.Filesystems.LisaFS
// Normal entry
else if(buf[offset + 0x24] == 0x03 && buf[offset] == 0x24)
{
CatalogEntry entry = new CatalogEntry();
entry.marker = buf[offset];
entry.parentID = BigEndianBitConverter.ToUInt16(buf, offset + 0x01);
entry.filename = new byte[E_NAME];
CatalogEntry entry = new CatalogEntry
{
marker = buf[offset],
parentID = BigEndianBitConverter.ToUInt16(buf, offset + 0x01),
filename = new byte[E_NAME],
terminator = buf[offset + 0x23],
fileType = buf[offset + 0x24],
unknown = buf[offset + 0x25],
fileID = BigEndianBitConverter.ToInt16(buf, offset + 0x26),
dtc = BigEndianBitConverter.ToUInt32(buf, offset + 0x28),
dtm = BigEndianBitConverter.ToUInt32(buf, offset + 0x2C),
length = BigEndianBitConverter.ToInt32(buf, offset + 0x30),
wasted = BigEndianBitConverter.ToInt32(buf, offset + 0x34),
tail = new byte[8]
};
Array.Copy(buf, offset + 0x03, entry.filename, 0, E_NAME);
entry.terminator = buf[offset + 0x23];
entry.fileType = buf[offset + 0x24];
entry.unknown = buf[offset + 0x25];
entry.fileID = BigEndianBitConverter.ToInt16(buf, offset + 0x26);
entry.dtc = BigEndianBitConverter.ToUInt32(buf, offset + 0x28);
entry.dtm = BigEndianBitConverter.ToUInt32(buf, offset + 0x2C);
entry.length = BigEndianBitConverter.ToInt32(buf, offset + 0x30);
entry.wasted = BigEndianBitConverter.ToInt32(buf, offset + 0x34);
entry.tail = new byte[8];
Array.Copy(buf, offset + 0x38, entry.tail, 0, 8);
ExtentFile ext;
if(ReadExtentsFile(entry.fileID, out ext) == Errno.NoError)
if(ReadExtentsFile(entry.fileID, out _) == Errno.NoError)
if(!fileSizeCache.ContainsKey(entry.fileID))
{
catalogCache.Add(entry);
@@ -261,23 +254,25 @@ namespace DiscImageChef.Filesystems.LisaFS
// Subdirectory entry
else if(buf[offset + 0x24] == 0x01 && buf[offset] == 0x24)
{
CatalogEntry entry = new CatalogEntry();
entry.marker = buf[offset];
entry.parentID = BigEndianBitConverter.ToUInt16(buf, offset + 0x01);
entry.filename = new byte[E_NAME];
CatalogEntry entry = new CatalogEntry
{
marker = buf[offset],
parentID = BigEndianBitConverter.ToUInt16(buf, offset + 0x01),
filename = new byte[E_NAME],
terminator = buf[offset + 0x23],
fileType = buf[offset + 0x24],
unknown = buf[offset + 0x25],
fileID = BigEndianBitConverter.ToInt16(buf, offset + 0x26),
dtc = BigEndianBitConverter.ToUInt32(buf, offset + 0x28),
dtm = BigEndianBitConverter.ToUInt32(buf, offset + 0x2C),
length = 0,
wasted = 0,
tail = null
};
Array.Copy(buf, offset + 0x03, entry.filename, 0, E_NAME);
entry.terminator = buf[offset + 0x23];
entry.fileType = buf[offset + 0x24];
entry.unknown = buf[offset + 0x25];
entry.fileID = BigEndianBitConverter.ToInt16(buf, offset + 0x26);
entry.dtc = BigEndianBitConverter.ToUInt32(buf, offset + 0x28);
entry.dtm = BigEndianBitConverter.ToUInt32(buf, offset + 0x2C);
entry.length = 0;
entry.wasted = 0;
entry.tail = null;
if(!directoryDTCCache.ContainsKey(entry.fileID))
directoryDTCCache.Add(entry.fileID, DateHandlers.LisaToDateTime(entry.dtc));
if(!directoryDtcCache.ContainsKey(entry.fileID))
directoryDtcCache.Add(entry.fileID, DateHandlers.LisaToDateTime(entry.dtc));
catalogCache.Add(entry);
@@ -295,21 +290,22 @@ namespace DiscImageChef.Filesystems.LisaFS
if(!mounted) return Errno.AccessDenied;
stat = new FileEntryInfo();
stat.Attributes = new FileAttributes();
DateTime tmp;
stat = new FileEntryInfo
{
Attributes = new FileAttributes(),
Inode = FILEID_CATALOG,
Mode = 0x16D,
Links = 0,
UID = 0,
GID = 0,
DeviceNo = 0,
Length = 0,
BlockSize = mddf.datasize,
Blocks = 0
};
directoryDTCCache.TryGetValue(dirId, out tmp);
directoryDtcCache.TryGetValue(dirId, out DateTime tmp);
stat.CreationTime = tmp;
stat.Inode = FILEID_CATALOG;
stat.Mode = 0x16D;
stat.Links = 0;
stat.UID = 0;
stat.GID = 0;
stat.DeviceNo = 0;
stat.Length = 0;
stat.BlockSize = mddf.datasize;
stat.Blocks = 0;
return Errno.NoError;
}

View File

@@ -57,7 +57,7 @@ namespace DiscImageChef.Filesystems.LisaFS
if(!mounted) return Errno.AccessDenied;
if(fileId < 4 || fileId == 4 && mddf.fsversion != LisaFSv2 && mddf.fsversion != LisaFSv1)
if(fileId < 4 || fileId == 4 && mddf.fsversion != LISA_V2 && mddf.fsversion != LISA_V1)
return Errno.InvalidArgument;
if(extentCache.TryGetValue(fileId, out file)) return Errno.NoError;
@@ -100,10 +100,7 @@ namespace DiscImageChef.Filesystems.LisaFS
if(extTag.FileId != (short)(-1 * fileId)) return Errno.NoSuchFile;
byte[] sector;
if(mddf.fsversion == LisaFSv1) sector = device.ReadSectors(ptr, 2);
else sector = device.ReadSector(ptr);
byte[] sector = mddf.fsversion == LISA_V1 ? device.ReadSectors(ptr, 2) : device.ReadSector(ptr);
if(sector[0] >= 32 || sector[0] == 0) return Errno.InvalidArgument;
@@ -151,7 +148,7 @@ namespace DiscImageChef.Filesystems.LisaFS
int extentsCount = 0;
int extentsOffset;
if(mddf.fsversion == LisaFSv1)
if(mddf.fsversion == LISA_V1)
{
file.length = BigEndianBitConverter.ToInt32(sector, 0x200);
file.unknown9 = BigEndianBitConverter.ToInt32(sector, 0x204);
@@ -175,9 +172,11 @@ namespace DiscImageChef.Filesystems.LisaFS
for(int j = 0; j < extentsCount; j++)
{
file.extents[j] = new Extent();
file.extents[j].start = BigEndianBitConverter.ToInt32(sector, extentsOffset + j * 6);
file.extents[j].length = BigEndianBitConverter.ToInt16(sector, extentsOffset + j * 6 + 4);
file.extents[j] = new Extent
{
start = BigEndianBitConverter.ToInt32(sector, extentsOffset + j * 6),
length = BigEndianBitConverter.ToInt16(sector, extentsOffset + j * 6 + 4)
};
}
extentCache.Add(fileId, file);
@@ -278,11 +277,13 @@ namespace DiscImageChef.Filesystems.LisaFS
for(int s = 0; s < srecords.Length; s++)
{
srecords[s] = new SRecord();
srecords[s].extent_ptr = BigEndianBitConverter.ToUInt32(sectors, 0x00 + 14 * s);
srecords[s].unknown = BigEndianBitConverter.ToUInt32(sectors, 0x04 + 14 * s);
srecords[s].filesize = BigEndianBitConverter.ToUInt32(sectors, 0x08 + 14 * s);
srecords[s].flags = BigEndianBitConverter.ToUInt16(sectors, 0x0C + 14 * s);
srecords[s] = new SRecord
{
extent_ptr = BigEndianBitConverter.ToUInt32(sectors, 0x00 + 14 * s),
unknown = BigEndianBitConverter.ToUInt32(sectors, 0x04 + 14 * s),
filesize = BigEndianBitConverter.ToUInt32(sectors, 0x08 + 14 * s),
flags = BigEndianBitConverter.ToUInt16(sectors, 0x0C + 14 * s)
};
}
return Errno.NoError;

View File

@@ -41,9 +41,7 @@ namespace DiscImageChef.Filesystems.LisaFS
{
public override Errno GetAttributes(string path, ref FileAttributes attributes)
{
short fileId;
bool isDir;
Errno error = LookupFileId(path, out fileId, out isDir);
Errno error = LookupFileId(path, out short fileId, out bool isDir);
if(error != Errno.NoError) return error;
if(!isDir) return GetAttributes(fileId, ref attributes);
@@ -64,9 +62,7 @@ namespace DiscImageChef.Filesystems.LisaFS
if(offset < 0) return Errno.InvalidArgument;
short fileId;
bool isDir;
Errno error = LookupFileId(path, out fileId, out isDir);
Errno error = LookupFileId(path, out short fileId, out _);
if(error != Errno.NoError) return error;
byte[] tmp;
@@ -100,9 +96,7 @@ namespace DiscImageChef.Filesystems.LisaFS
public override Errno Stat(string path, ref FileEntryInfo stat)
{
short fileId;
bool isDir;
Errno error = LookupFileId(path, out fileId, out isDir);
Errno error = LookupFileId(path, out short fileId, out bool isDir);
if(error != Errno.NoError) return error;
return isDir ? StatDir(fileId, out stat) : Stat(fileId, out stat);
@@ -125,8 +119,7 @@ namespace DiscImageChef.Filesystems.LisaFS
return Errno.NoError;
}
ExtentFile extFile;
Errno error = ReadExtentsFile(fileId, out extFile);
Errno error = ReadExtentsFile(fileId, out ExtentFile extFile);
if(error != Errno.NoError) return error;
@@ -200,8 +193,7 @@ namespace DiscImageChef.Filesystems.LisaFS
if(count == 0) return Errno.NoSuchFile;
if(!tags) buf = new byte[count * device.GetSectorSize()];
else buf = new byte[count * devTagSize];
buf = !tags ? new byte[count * device.GetSectorSize()] : new byte[count * devTagSize];
// Should be enough to check 100 sectors?
for(ulong i = 0; i < 100; i++)
@@ -210,10 +202,7 @@ namespace DiscImageChef.Filesystems.LisaFS
if(sysTag.FileId != fileId) continue;
byte[] sector;
if(!tags) sector = device.ReadSector(i);
else sector = device.ReadSectorTag(i, SectorTagType.AppleSectorTag);
byte[] sector = !tags ? device.ReadSector(i) : device.ReadSectorTag(i, SectorTagType.AppleSectorTag);
// Relative block for $Loader starts at $Boot block
if(sysTag.FileId == FILEID_LOADER_SIGNED) sysTag.RelPage--;
@@ -239,8 +228,7 @@ namespace DiscImageChef.Filesystems.LisaFS
if(!debug || fileId == 0) return Errno.NoSuchFile;
else
{
stat = new FileEntryInfo();
stat.Attributes = new FileAttributes();
stat = new FileEntryInfo {Attributes = new FileAttributes()};
error = GetAttributes(fileId, ref stat.Attributes);
if(error != Errno.NoError) return error;
@@ -267,12 +255,10 @@ namespace DiscImageChef.Filesystems.LisaFS
}
else
{
byte[] buf;
error = ReadSystemFile(fileId, out buf);
error = ReadSystemFile(fileId, out byte[] buf);
if(error != Errno.NoError) return error;
if(fileId != 4) stat.CreationTime = mddf.dtvc;
else stat.CreationTime = mddf.dtcc;
stat.CreationTime = fileId != 4 ? mddf.dtvc : mddf.dtcc;
stat.BackupTime = mddf.dtvb;
@@ -290,8 +276,7 @@ namespace DiscImageChef.Filesystems.LisaFS
return Errno.NoError;
}
stat = new FileEntryInfo();
stat.Attributes = new FileAttributes();
stat = new FileEntryInfo {Attributes = new FileAttributes()};
error = GetAttributes(fileId, ref stat.Attributes);
if(error != Errno.NoError) return error;
@@ -309,8 +294,7 @@ namespace DiscImageChef.Filesystems.LisaFS
stat.UID = 0;
stat.GID = 0;
stat.DeviceNo = 0;
int len;
if(!fileSizeCache.TryGetValue(fileId, out len)) stat.Length = srecords[fileId].filesize;
if(!fileSizeCache.TryGetValue(fileId, out int len)) stat.Length = srecords[fileId].filesize;
else stat.Length = len;
stat.BlockSize = mddf.datasize;
stat.Blocks = file.length;
@@ -330,15 +314,12 @@ namespace DiscImageChef.Filesystems.LisaFS
tags &= debug;
if(fileId < 4 || fileId == 4 && mddf.fsversion != LisaFSv2 && mddf.fsversion != LisaFSv1)
if(fileId < 4 || fileId == 4 && mddf.fsversion != LISA_V2 && mddf.fsversion != LISA_V1)
return Errno.InvalidArgument;
if(!tags && fileCache.TryGetValue(fileId, out buf)) return Errno.NoError;
Errno error;
ExtentFile file;
error = ReadExtentsFile(fileId, out file);
Errno error = ReadExtentsFile(fileId, out ExtentFile file);
if(error != Errno.NoError) return error;
int sectorSize;
@@ -365,8 +346,7 @@ namespace DiscImageChef.Filesystems.LisaFS
if(!tags)
{
int realSize;
if(fileSizeCache.TryGetValue(fileId, out realSize)) if(realSize > temp.Length) DicConsole.ErrorWriteLine("File {0} gets truncated.", fileId);
if(fileSizeCache.TryGetValue(fileId, out int realSize)) if(realSize > temp.Length) DicConsole.ErrorWriteLine("File {0} gets truncated.", fileId);
buf = temp;
fileCache.Add(fileId, buf);
@@ -393,7 +373,7 @@ namespace DiscImageChef.Filesystems.LisaFS
}
// Only V3 supports subdirectories
if(pathElements.Length > 1 && mddf.fsversion != LisaFSv3) return Errno.NotSupported;
if(pathElements.Length > 1 && mddf.fsversion != LISA_V3) return Errno.NotSupported;
if(debug && pathElements.Length == 1)
{

View File

@@ -56,56 +56,54 @@ namespace DiscImageChef.Filesystems.LisaFS
// Minimal LisaOS disk is 3.5" single sided double density, 800 sectors
if(imagePlugin.GetSectors() < 800) return false;
int before_mddf = -1;
int beforeMddf = -1;
// LisaOS searches sectors until tag tells MDDF resides there, so we'll search 100 sectors
for(int i = 0; i < 100; i++)
{
LisaTag.PriamTag searchTag;
DecodeTag(imagePlugin.ReadSectorTag((ulong)i, SectorTagType.AppleSectorTag), out searchTag);
DecodeTag(imagePlugin.ReadSectorTag((ulong)i, SectorTagType.AppleSectorTag), out LisaTag.PriamTag searchTag);
DicConsole.DebugWriteLine("LisaFS plugin", "Sector {0}, file ID 0x{1:X4}", i, searchTag.FileId);
if(before_mddf == -1 && searchTag.FileId == FILEID_LOADER_SIGNED) before_mddf = i - 1;
if(beforeMddf == -1 && searchTag.FileId == FILEID_LOADER_SIGNED) beforeMddf = i - 1;
if(searchTag.FileId != FILEID_MDDF) continue;
byte[] sector = imagePlugin.ReadSector((ulong)i);
MDDF info_mddf = new MDDF();
info_mddf.mddf_block = BigEndianBitConverter.ToUInt32(sector, 0x6C);
info_mddf.volsize_minus_one = BigEndianBitConverter.ToUInt32(sector, 0x70);
info_mddf.volsize_minus_mddf_minus_one = BigEndianBitConverter.ToUInt32(sector, 0x74);
info_mddf.vol_size = BigEndianBitConverter.ToUInt32(sector, 0x78);
info_mddf.blocksize = BigEndianBitConverter.ToUInt16(sector, 0x7C);
info_mddf.datasize = BigEndianBitConverter.ToUInt16(sector, 0x7E);
MDDF infoMddf = new MDDF
{
mddf_block = BigEndianBitConverter.ToUInt32(sector, 0x6C),
volsize_minus_one = BigEndianBitConverter.ToUInt32(sector, 0x70),
volsize_minus_mddf_minus_one = BigEndianBitConverter.ToUInt32(sector, 0x74),
vol_size = BigEndianBitConverter.ToUInt32(sector, 0x78),
blocksize = BigEndianBitConverter.ToUInt16(sector, 0x7C),
datasize = BigEndianBitConverter.ToUInt16(sector, 0x7E)
};
DicConsole.DebugWriteLine("LisaFS plugin", "Current sector = {0}", i);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.mddf_block = {0}", info_mddf.mddf_block);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.mddf_block = {0}", infoMddf.mddf_block);
DicConsole.DebugWriteLine("LisaFS plugin", "Disk size = {0} sectors", imagePlugin.GetSectors());
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.vol_size = {0} sectors", info_mddf.vol_size);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.vol_size - 1 = {0}", info_mddf.volsize_minus_one);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.vol_size = {0} sectors", infoMddf.vol_size);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.vol_size - 1 = {0}", infoMddf.volsize_minus_one);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.vol_size - mddf.mddf_block -1 = {0}",
info_mddf.volsize_minus_mddf_minus_one);
infoMddf.volsize_minus_mddf_minus_one);
DicConsole.DebugWriteLine("LisaFS plugin", "Disk sector = {0} bytes", imagePlugin.GetSectorSize());
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.blocksize = {0} bytes", info_mddf.blocksize);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.datasize = {0} bytes", info_mddf.datasize);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.blocksize = {0} bytes", infoMddf.blocksize);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.datasize = {0} bytes", infoMddf.datasize);
if(info_mddf.mddf_block != i - before_mddf) return false;
if(infoMddf.mddf_block != i - beforeMddf) return false;
if(info_mddf.vol_size > imagePlugin.GetSectors()) return false;
if(infoMddf.vol_size > imagePlugin.GetSectors()) return false;
if(info_mddf.vol_size - 1 != info_mddf.volsize_minus_one) return false;
if(infoMddf.vol_size - 1 != infoMddf.volsize_minus_one) return false;
if(info_mddf.vol_size - i - 1 != info_mddf.volsize_minus_mddf_minus_one - before_mddf) return false;
if(infoMddf.vol_size - i - 1 != infoMddf.volsize_minus_mddf_minus_one - beforeMddf) return false;
if(info_mddf.datasize > info_mddf.blocksize) return false;
if(infoMddf.datasize > infoMddf.blocksize) return false;
if(info_mddf.blocksize < imagePlugin.GetSectorSize()) return false;
if(infoMddf.blocksize < imagePlugin.GetSectorSize()) return false;
if(info_mddf.datasize != imagePlugin.GetSectorSize()) return false;
return true;
return infoMddf.datasize == imagePlugin.GetSectorSize();
}
return false;
@@ -134,243 +132,241 @@ namespace DiscImageChef.Filesystems.LisaFS
// Minimal LisaOS disk is 3.5" single sided double density, 800 sectors
if(imagePlugin.GetSectors() < 800) return;
int before_mddf = -1;
int beforeMddf = -1;
// LisaOS searches sectors until tag tells MDDF resides there, so we'll search 100 sectors
for(int i = 0; i < 100; i++)
{
LisaTag.PriamTag searchTag;
DecodeTag(imagePlugin.ReadSectorTag((ulong)i, SectorTagType.AppleSectorTag), out searchTag);
DecodeTag(imagePlugin.ReadSectorTag((ulong)i, SectorTagType.AppleSectorTag), out LisaTag.PriamTag searchTag);
DicConsole.DebugWriteLine("LisaFS plugin", "Sector {0}, file ID 0x{1:X4}", i, searchTag.FileId);
if(before_mddf == -1 && searchTag.FileId == FILEID_LOADER_SIGNED) before_mddf = i - 1;
if(beforeMddf == -1 && searchTag.FileId == FILEID_LOADER_SIGNED) beforeMddf = i - 1;
if(searchTag.FileId != FILEID_MDDF) continue;
byte[] sector = imagePlugin.ReadSector((ulong)i);
MDDF info_mddf = new MDDF();
MDDF infoMddf = new MDDF();
byte[] pString = new byte[33];
uint lisa_time;
uint lisaTime;
info_mddf.fsversion = BigEndianBitConverter.ToUInt16(sector, 0x00);
info_mddf.volid = BigEndianBitConverter.ToUInt64(sector, 0x02);
info_mddf.volnum = BigEndianBitConverter.ToUInt16(sector, 0x0A);
infoMddf.fsversion = BigEndianBitConverter.ToUInt16(sector, 0x00);
infoMddf.volid = BigEndianBitConverter.ToUInt64(sector, 0x02);
infoMddf.volnum = BigEndianBitConverter.ToUInt16(sector, 0x0A);
Array.Copy(sector, 0x0C, pString, 0, 33);
info_mddf.volname = StringHandlers.PascalToString(pString, CurrentEncoding);
info_mddf.unknown1 = sector[0x2D];
infoMddf.volname = StringHandlers.PascalToString(pString, CurrentEncoding);
infoMddf.unknown1 = sector[0x2D];
Array.Copy(sector, 0x2E, pString, 0, 33);
// Prevent garbage
if(pString[0] <= 32) info_mddf.password = StringHandlers.PascalToString(pString, CurrentEncoding);
else info_mddf.password = "";
info_mddf.unknown2 = sector[0x4F];
info_mddf.machine_id = BigEndianBitConverter.ToUInt32(sector, 0x50);
info_mddf.master_copy_id = BigEndianBitConverter.ToUInt32(sector, 0x54);
lisa_time = BigEndianBitConverter.ToUInt32(sector, 0x58);
info_mddf.dtvc = DateHandlers.LisaToDateTime(lisa_time);
lisa_time = BigEndianBitConverter.ToUInt32(sector, 0x5C);
info_mddf.dtcc = DateHandlers.LisaToDateTime(lisa_time);
lisa_time = BigEndianBitConverter.ToUInt32(sector, 0x60);
info_mddf.dtvb = DateHandlers.LisaToDateTime(lisa_time);
lisa_time = BigEndianBitConverter.ToUInt32(sector, 0x64);
info_mddf.dtvs = DateHandlers.LisaToDateTime(lisa_time);
info_mddf.unknown3 = BigEndianBitConverter.ToUInt32(sector, 0x68);
info_mddf.mddf_block = BigEndianBitConverter.ToUInt32(sector, 0x6C);
info_mddf.volsize_minus_one = BigEndianBitConverter.ToUInt32(sector, 0x70);
info_mddf.volsize_minus_mddf_minus_one = BigEndianBitConverter.ToUInt32(sector, 0x74);
info_mddf.vol_size = BigEndianBitConverter.ToUInt32(sector, 0x78);
info_mddf.blocksize = BigEndianBitConverter.ToUInt16(sector, 0x7C);
info_mddf.datasize = BigEndianBitConverter.ToUInt16(sector, 0x7E);
info_mddf.unknown4 = BigEndianBitConverter.ToUInt16(sector, 0x80);
info_mddf.unknown5 = BigEndianBitConverter.ToUInt32(sector, 0x82);
info_mddf.unknown6 = BigEndianBitConverter.ToUInt32(sector, 0x86);
info_mddf.clustersize = BigEndianBitConverter.ToUInt16(sector, 0x8A);
info_mddf.fs_size = BigEndianBitConverter.ToUInt32(sector, 0x8C);
info_mddf.unknown7 = BigEndianBitConverter.ToUInt32(sector, 0x90);
info_mddf.srec_ptr = BigEndianBitConverter.ToUInt32(sector, 0x94);
info_mddf.unknown9 = BigEndianBitConverter.ToUInt16(sector, 0x98);
info_mddf.srec_len = BigEndianBitConverter.ToUInt16(sector, 0x9A);
info_mddf.unknown10 = BigEndianBitConverter.ToUInt32(sector, 0x9C);
info_mddf.unknown11 = BigEndianBitConverter.ToUInt32(sector, 0xA0);
info_mddf.unknown12 = BigEndianBitConverter.ToUInt32(sector, 0xA4);
info_mddf.unknown13 = BigEndianBitConverter.ToUInt32(sector, 0xA8);
info_mddf.unknown14 = BigEndianBitConverter.ToUInt32(sector, 0xAC);
info_mddf.filecount = BigEndianBitConverter.ToUInt16(sector, 0xB0);
info_mddf.unknown15 = BigEndianBitConverter.ToUInt32(sector, 0xB2);
info_mddf.unknown16 = BigEndianBitConverter.ToUInt32(sector, 0xB6);
info_mddf.freecount = BigEndianBitConverter.ToUInt32(sector, 0xBA);
info_mddf.unknown17 = BigEndianBitConverter.ToUInt16(sector, 0xBE);
info_mddf.unknown18 = BigEndianBitConverter.ToUInt32(sector, 0xC0);
info_mddf.overmount_stamp = BigEndianBitConverter.ToUInt64(sector, 0xC4);
info_mddf.serialization = BigEndianBitConverter.ToUInt32(sector, 0xCC);
info_mddf.unknown19 = BigEndianBitConverter.ToUInt32(sector, 0xD0);
info_mddf.unknown_timestamp = BigEndianBitConverter.ToUInt32(sector, 0xD4);
info_mddf.unknown20 = BigEndianBitConverter.ToUInt32(sector, 0xD8);
info_mddf.unknown21 = BigEndianBitConverter.ToUInt32(sector, 0xDC);
info_mddf.unknown22 = BigEndianBitConverter.ToUInt32(sector, 0xE0);
info_mddf.unknown23 = BigEndianBitConverter.ToUInt32(sector, 0xE4);
info_mddf.unknown24 = BigEndianBitConverter.ToUInt32(sector, 0xE8);
info_mddf.unknown25 = BigEndianBitConverter.ToUInt32(sector, 0xEC);
info_mddf.unknown26 = BigEndianBitConverter.ToUInt32(sector, 0xF0);
info_mddf.unknown27 = BigEndianBitConverter.ToUInt32(sector, 0xF4);
info_mddf.unknown28 = BigEndianBitConverter.ToUInt32(sector, 0xF8);
info_mddf.unknown29 = BigEndianBitConverter.ToUInt32(sector, 0xFC);
info_mddf.unknown30 = BigEndianBitConverter.ToUInt32(sector, 0x100);
info_mddf.unknown31 = BigEndianBitConverter.ToUInt32(sector, 0x104);
info_mddf.unknown32 = BigEndianBitConverter.ToUInt32(sector, 0x108);
info_mddf.unknown33 = BigEndianBitConverter.ToUInt32(sector, 0x10C);
info_mddf.unknown34 = BigEndianBitConverter.ToUInt32(sector, 0x110);
info_mddf.unknown35 = BigEndianBitConverter.ToUInt32(sector, 0x114);
info_mddf.backup_volid = BigEndianBitConverter.ToUInt64(sector, 0x118);
info_mddf.label_size = BigEndianBitConverter.ToUInt16(sector, 0x120);
info_mddf.fs_overhead = BigEndianBitConverter.ToUInt16(sector, 0x122);
info_mddf.result_scavenge = BigEndianBitConverter.ToUInt16(sector, 0x124);
info_mddf.boot_code = BigEndianBitConverter.ToUInt16(sector, 0x126);
info_mddf.boot_environ = BigEndianBitConverter.ToUInt16(sector, 0x6C);
info_mddf.unknown36 = BigEndianBitConverter.ToUInt32(sector, 0x12A);
info_mddf.unknown37 = BigEndianBitConverter.ToUInt32(sector, 0x12E);
info_mddf.unknown38 = BigEndianBitConverter.ToUInt32(sector, 0x132);
info_mddf.vol_sequence = BigEndianBitConverter.ToUInt16(sector, 0x136);
info_mddf.vol_left_mounted = sector[0x138];
infoMddf.password = pString[0] <= 32 ? StringHandlers.PascalToString(pString, CurrentEncoding) : "";
infoMddf.unknown2 = sector[0x4F];
infoMddf.machine_id = BigEndianBitConverter.ToUInt32(sector, 0x50);
infoMddf.master_copy_id = BigEndianBitConverter.ToUInt32(sector, 0x54);
lisaTime = BigEndianBitConverter.ToUInt32(sector, 0x58);
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);
infoMddf.volsize_minus_mddf_minus_one = BigEndianBitConverter.ToUInt32(sector, 0x74);
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})", info_mddf.unknown1);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown2 = 0x{0:X2} ({0})", info_mddf.unknown2);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown3 = 0x{0:X8} ({0})", info_mddf.unknown3);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown4 = 0x{0:X4} ({0})", info_mddf.unknown4);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown5 = 0x{0:X8} ({0})", info_mddf.unknown5);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown6 = 0x{0:X8} ({0})", info_mddf.unknown6);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown7 = 0x{0:X8} ({0})", info_mddf.unknown7);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown9 = 0x{0:X4} ({0})", info_mddf.unknown9);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown10 = 0x{0:X8} ({0})", info_mddf.unknown10);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown11 = 0x{0:X8} ({0})", info_mddf.unknown11);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown12 = 0x{0:X8} ({0})", info_mddf.unknown12);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown13 = 0x{0:X8} ({0})", info_mddf.unknown13);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown14 = 0x{0:X8} ({0})", info_mddf.unknown14);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown15 = 0x{0:X8} ({0})", info_mddf.unknown15);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown16 = 0x{0:X8} ({0})", info_mddf.unknown16);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown17 = 0x{0:X4} ({0})", info_mddf.unknown17);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown18 = 0x{0:X8} ({0})", info_mddf.unknown18);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown19 = 0x{0:X8} ({0})", info_mddf.unknown19);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown20 = 0x{0:X8} ({0})", info_mddf.unknown20);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown21 = 0x{0:X8} ({0})", info_mddf.unknown21);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown22 = 0x{0:X8} ({0})", info_mddf.unknown22);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown23 = 0x{0:X8} ({0})", info_mddf.unknown23);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown24 = 0x{0:X8} ({0})", info_mddf.unknown24);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown25 = 0x{0:X8} ({0})", info_mddf.unknown25);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown26 = 0x{0:X8} ({0})", info_mddf.unknown26);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown27 = 0x{0:X8} ({0})", info_mddf.unknown27);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown28 = 0x{0:X8} ({0})", info_mddf.unknown28);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown29 = 0x{0:X8} ({0})", info_mddf.unknown29);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown30 = 0x{0:X8} ({0})", info_mddf.unknown30);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown31 = 0x{0:X8} ({0})", info_mddf.unknown31);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown32 = 0x{0:X8} ({0})", info_mddf.unknown32);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown33 = 0x{0:X8} ({0})", info_mddf.unknown33);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown34 = 0x{0:X8} ({0})", info_mddf.unknown34);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown35 = 0x{0:X8} ({0})", info_mddf.unknown35);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown36 = 0x{0:X8} ({0})", info_mddf.unknown36);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown37 = 0x{0:X8} ({0})", info_mddf.unknown37);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown38 = 0x{0:X8} ({0})", info_mddf.unknown38);
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);
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);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.unknown_timestamp = 0x{0:X8} ({0}, {1})",
info_mddf.unknown_timestamp,
DateHandlers.LisaToDateTime(info_mddf.unknown_timestamp));
infoMddf.unknown_timestamp,
DateHandlers.LisaToDateTime(infoMddf.unknown_timestamp));
if(info_mddf.mddf_block != i - before_mddf) return;
if(infoMddf.mddf_block != i - beforeMddf) return;
if(info_mddf.vol_size > imagePlugin.GetSectors()) return;
if(infoMddf.vol_size > imagePlugin.GetSectors()) return;
if(info_mddf.vol_size - 1 != info_mddf.volsize_minus_one) return;
if(infoMddf.vol_size - 1 != infoMddf.volsize_minus_one) return;
if(info_mddf.vol_size - i - 1 != info_mddf.volsize_minus_mddf_minus_one - before_mddf) return;
if(infoMddf.vol_size - i - 1 != infoMddf.volsize_minus_mddf_minus_one - beforeMddf) return;
if(info_mddf.datasize > info_mddf.blocksize) return;
if(infoMddf.datasize > infoMddf.blocksize) return;
if(info_mddf.blocksize < imagePlugin.GetSectorSize()) return;
if(infoMddf.blocksize < imagePlugin.GetSectorSize()) return;
if(info_mddf.datasize != imagePlugin.GetSectorSize()) return;
if(infoMddf.datasize != imagePlugin.GetSectorSize()) return;
switch(info_mddf.fsversion)
switch(infoMddf.fsversion)
{
case LisaFSv1:
case LISA_V1:
sb.AppendLine("LisaFS v1");
break;
case LisaFSv2:
case LISA_V2:
sb.AppendLine("LisaFS v2");
break;
case LisaFSv3:
case LISA_V3:
sb.AppendLine("LisaFS v3");
break;
default:
sb.AppendFormat("Uknown LisaFS version {0}", info_mddf.fsversion).AppendLine();
sb.AppendFormat("Uknown LisaFS version {0}", infoMddf.fsversion).AppendLine();
break;
}
sb.AppendFormat("Volume name: \"{0}\"", info_mddf.volname).AppendLine();
sb.AppendFormat("Volume password: \"{0}\"", info_mddf.password).AppendLine();
sb.AppendFormat("Volume ID: 0x{0:X16}", info_mddf.volid).AppendLine();
sb.AppendFormat("Backup volume ID: 0x{0:X16}", info_mddf.backup_volid).AppendLine();
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();
sb.AppendFormat("Master copy ID: 0x{0:X8}", info_mddf.master_copy_id).AppendLine();
sb.AppendFormat("Master copy ID: 0x{0:X8}", infoMddf.master_copy_id).AppendLine();
sb.AppendFormat("Volume is number {0} of {1}", info_mddf.volnum, info_mddf.vol_sequence)
sb.AppendFormat("Volume is number {0} of {1}", infoMddf.volnum, infoMddf.vol_sequence)
.AppendLine();
sb.AppendFormat("Serial number of Lisa computer that created this volume: {0}",
info_mddf.machine_id).AppendLine();
infoMddf.machine_id).AppendLine();
sb.AppendFormat("Serial number of Lisa computer that can use this volume's software {0}",
info_mddf.serialization).AppendLine();
infoMddf.serialization).AppendLine();
sb.AppendFormat("Volume created on {0}", info_mddf.dtvc).AppendLine();
sb.AppendFormat("Some timestamp, says {0}", info_mddf.dtcc).AppendLine();
sb.AppendFormat("Volume backed up on {0}", info_mddf.dtvb).AppendLine();
sb.AppendFormat("Volume scavenged on {0}", info_mddf.dtvs).AppendLine();
sb.AppendFormat("MDDF is in block {0}", info_mddf.mddf_block + before_mddf).AppendLine();
sb.AppendFormat("There are {0} reserved blocks before volume", before_mddf).AppendLine();
sb.AppendFormat("{0} blocks minus one", info_mddf.volsize_minus_one).AppendLine();
sb.AppendFormat("{0} blocks minus one minus MDDF offset", info_mddf.volsize_minus_mddf_minus_one)
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)
.AppendLine();
sb.AppendFormat("{0} blocks in volume", info_mddf.vol_size).AppendLine();
sb.AppendFormat("{0} bytes per sector (uncooked)", info_mddf.blocksize).AppendLine();
sb.AppendFormat("{0} bytes per sector", info_mddf.datasize).AppendLine();
sb.AppendFormat("{0} blocks per cluster", info_mddf.clustersize).AppendLine();
sb.AppendFormat("{0} blocks in filesystem", info_mddf.fs_size).AppendLine();
sb.AppendFormat("{0} files in volume", info_mddf.filecount).AppendLine();
sb.AppendFormat("{0} blocks free", info_mddf.freecount).AppendLine();
sb.AppendFormat("{0} bytes in LisaInfo", info_mddf.label_size).AppendLine();
sb.AppendFormat("Filesystem overhead: {0}", info_mddf.fs_overhead).AppendLine();
sb.AppendFormat("Scanvenger result code: 0x{0:X8}", info_mddf.result_scavenge).AppendLine();
sb.AppendFormat("Boot code: 0x{0:X8}", info_mddf.boot_code).AppendLine();
sb.AppendFormat("Boot environment: 0x{0:X8}", info_mddf.boot_environ).AppendLine();
sb.AppendFormat("Overmount stamp: 0x{0:X16}", info_mddf.overmount_stamp).AppendLine();
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();
sb.AppendFormat("S-Records start at {0} and spans for {1} blocks",
info_mddf.srec_ptr + info_mddf.mddf_block + before_mddf, info_mddf.srec_len)
infoMddf.srec_ptr + infoMddf.mddf_block + beforeMddf, infoMddf.srec_len)
.AppendLine();
if(info_mddf.vol_left_mounted == 0) sb.AppendLine("Volume is clean");
if(infoMddf.vol_left_mounted == 0) sb.AppendLine("Volume is clean");
else sb.AppendLine("Volume is dirty");
information = sb.ToString();
xmlFSType = new FileSystemType();
if(DateTime.Compare(info_mddf.dtvb, DateHandlers.LisaToDateTime(0)) > 0)
XmlFsType = new FileSystemType();
if(DateTime.Compare(infoMddf.dtvb, DateHandlers.LisaToDateTime(0)) > 0)
{
xmlFSType.BackupDate = info_mddf.dtvb;
xmlFSType.BackupDateSpecified = true;
XmlFsType.BackupDate = infoMddf.dtvb;
XmlFsType.BackupDateSpecified = true;
}
xmlFSType.Clusters = info_mddf.vol_size;
xmlFSType.ClusterSize = info_mddf.clustersize * info_mddf.datasize;
if(DateTime.Compare(info_mddf.dtvc, DateHandlers.LisaToDateTime(0)) > 0)
XmlFsType.Clusters = infoMddf.vol_size;
XmlFsType.ClusterSize = infoMddf.clustersize * infoMddf.datasize;
if(DateTime.Compare(infoMddf.dtvc, DateHandlers.LisaToDateTime(0)) > 0)
{
xmlFSType.CreationDate = info_mddf.dtvc;
xmlFSType.CreationDateSpecified = true;
XmlFsType.CreationDate = infoMddf.dtvc;
XmlFsType.CreationDateSpecified = true;
}
xmlFSType.Dirty = info_mddf.vol_left_mounted != 0;
xmlFSType.Files = info_mddf.filecount;
xmlFSType.FilesSpecified = true;
xmlFSType.FreeClusters = info_mddf.freecount;
xmlFSType.FreeClustersSpecified = true;
xmlFSType.Type = "LisaFS";
xmlFSType.VolumeName = info_mddf.volname;
xmlFSType.VolumeSerial = $"{info_mddf.volid:X16}";
XmlFsType.Dirty = infoMddf.vol_left_mounted != 0;
XmlFsType.Files = infoMddf.filecount;
XmlFsType.FilesSpecified = true;
XmlFsType.FreeClusters = infoMddf.freecount;
XmlFsType.FreeClustersSpecified = true;
XmlFsType.Type = "LisaFS";
XmlFsType.VolumeName = infoMddf.volname;
XmlFsType.VolumeSerial = $"{infoMddf.volid:X16}";
return;
}

View File

@@ -66,20 +66,20 @@ namespace DiscImageChef.Filesystems.LisaFS
/// <summary>Lists Extents Files already printed in debug mode to not repeat them</summary>
List<short> printedExtents;
/// <summary>Caches the creation times for subdirectories as to not have to traverse the Catalog File on each stat</summary>
Dictionary<short, DateTime> directoryDTCCache;
Dictionary<short, DateTime> directoryDtcCache;
#endregion Caches
public LisaFS()
{
Name = "Apple Lisa File System";
PluginUUID = new Guid("7E6034D1-D823-4248-A54D-239742B28391");
PluginUuid = new Guid("7E6034D1-D823-4248-A54D-239742B28391");
CurrentEncoding = new LisaRoman();
}
public LisaFS(Encoding encoding)
{
Name = "Apple Lisa File System";
PluginUUID = new Guid("7E6034D1-D823-4248-A54D-239742B28391");
PluginUuid = new Guid("7E6034D1-D823-4248-A54D-239742B28391");
CurrentEncoding = new LisaRoman();
}
@@ -87,7 +87,7 @@ namespace DiscImageChef.Filesystems.LisaFS
{
device = imagePlugin;
Name = "Apple Lisa File System";
PluginUUID = new Guid("7E6034D1-D823-4248-A54D-239742B28391");
PluginUuid = new Guid("7E6034D1-D823-4248-A54D-239742B28391");
CurrentEncoding = new LisaRoman();
}
}

View File

@@ -82,8 +82,7 @@ namespace DiscImageChef.Filesystems.LisaFS
// LisaOS searches sectors until tag tells MDDF resides there, so we'll search 100 sectors
for(ulong i = 0; i < 100; i++)
{
LisaTag.PriamTag searchTag;
DecodeTag(device.ReadSectorTag(i, SectorTagType.AppleSectorTag), out searchTag);
DecodeTag(device.ReadSectorTag(i, SectorTagType.AppleSectorTag), out LisaTag.PriamTag searchTag);
DicConsole.DebugWriteLine("LisaFS plugin", "Sector {0}, file ID 0x{1:X4}", i, searchTag.FileId);
@@ -97,7 +96,7 @@ namespace DiscImageChef.Filesystems.LisaFS
byte[] sector = device.ReadSector(i);
mddf = new MDDF();
byte[] pString = new byte[33];
uint lisa_time;
uint lisaTime;
mddf.fsversion = BigEndianBitConverter.ToUInt16(sector, 0x00);
mddf.volid = BigEndianBitConverter.ToUInt64(sector, 0x02);
@@ -107,19 +106,18 @@ namespace DiscImageChef.Filesystems.LisaFS
mddf.unknown1 = sector[0x2D];
Array.Copy(sector, 0x2E, pString, 0, 33);
// Prevent garbage
if(pString[0] <= 32) mddf.password = StringHandlers.PascalToString(pString, CurrentEncoding);
else mddf.password = "";
mddf.password = pString[0] <= 32 ? StringHandlers.PascalToString(pString, CurrentEncoding) : "";
mddf.unknown2 = sector[0x4F];
mddf.machine_id = BigEndianBitConverter.ToUInt32(sector, 0x50);
mddf.master_copy_id = BigEndianBitConverter.ToUInt32(sector, 0x54);
lisa_time = BigEndianBitConverter.ToUInt32(sector, 0x58);
mddf.dtvc = DateHandlers.LisaToDateTime(lisa_time);
lisa_time = BigEndianBitConverter.ToUInt32(sector, 0x5C);
mddf.dtcc = DateHandlers.LisaToDateTime(lisa_time);
lisa_time = BigEndianBitConverter.ToUInt32(sector, 0x60);
mddf.dtvb = DateHandlers.LisaToDateTime(lisa_time);
lisa_time = BigEndianBitConverter.ToUInt32(sector, 0x64);
mddf.dtvs = DateHandlers.LisaToDateTime(lisa_time);
lisaTime = BigEndianBitConverter.ToUInt32(sector, 0x58);
mddf.dtvc = DateHandlers.LisaToDateTime(lisaTime);
lisaTime = BigEndianBitConverter.ToUInt32(sector, 0x5C);
mddf.dtcc = DateHandlers.LisaToDateTime(lisaTime);
lisaTime = BigEndianBitConverter.ToUInt32(sector, 0x60);
mddf.dtvb = DateHandlers.LisaToDateTime(lisaTime);
lisaTime = BigEndianBitConverter.ToUInt32(sector, 0x64);
mddf.dtvs = DateHandlers.LisaToDateTime(lisaTime);
mddf.unknown3 = BigEndianBitConverter.ToUInt32(sector, 0x68);
mddf.mddf_block = BigEndianBitConverter.ToUInt32(sector, 0x6C);
mddf.volsize_minus_one = BigEndianBitConverter.ToUInt32(sector, 0x70);
@@ -193,13 +191,13 @@ namespace DiscImageChef.Filesystems.LisaFS
// Check MDDF version
switch(mddf.fsversion)
{
case LisaFSv1:
case LISA_V1:
DicConsole.DebugWriteLine("LisaFS plugin", "Mounting LisaFS v1");
break;
case LisaFSv2:
case LISA_V2:
DicConsole.DebugWriteLine("LisaFS plugin", "Mounting LisaFS v2");
break;
case LisaFSv3:
case LISA_V3:
DicConsole.DebugWriteLine("LisaFS plugin", "Mounting LisaFS v3");
break;
default:
@@ -214,23 +212,20 @@ namespace DiscImageChef.Filesystems.LisaFS
//catalogCache = new Dictionary<short, List<CatalogEntry>>();
fileSizeCache = new Dictionary<short, int>();
Errno error;
mounted = true;
this.debug = debug;
if(debug) printedExtents = new List<short>();
// Read the S-Records file
error = ReadSRecords();
Errno error = ReadSRecords();
if(error != Errno.NoError)
{
DicConsole.ErrorWriteLine("Error {0} reading S-Records file.", error);
return error;
}
directoryDTCCache = new Dictionary<short, DateTime>();
directoryDTCCache.Add(DIRID_ROOT, mddf.dtcc);
directoryDtcCache = new Dictionary<short, DateTime> {{DIRID_ROOT, mddf.dtcc}};
// Read the Catalog File
error = ReadCatalog();
@@ -246,9 +241,7 @@ namespace DiscImageChef.Filesystems.LisaFS
// If debug, cache system files
if(debug)
{
byte[] temp;
error = ReadSystemFile(FILEID_BOOT_SIGNED, out temp);
error = ReadSystemFile(FILEID_BOOT_SIGNED, out _);
if(error != Errno.NoError)
{
DicConsole.DebugWriteLine("LisaFS plugin", "Unable to read boot blocks");
@@ -256,7 +249,7 @@ namespace DiscImageChef.Filesystems.LisaFS
return error;
}
error = ReadSystemFile(FILEID_LOADER_SIGNED, out temp);
error = ReadSystemFile(FILEID_LOADER_SIGNED, out _);
if(error != Errno.NoError)
{
DicConsole.DebugWriteLine("LisaFS plugin", "Unable to read boot loader");
@@ -264,7 +257,7 @@ namespace DiscImageChef.Filesystems.LisaFS
return error;
}
error = ReadSystemFile((short)FILEID_MDDF, out temp);
error = ReadSystemFile((short)FILEID_MDDF, out _);
if(error != Errno.NoError)
{
DicConsole.DebugWriteLine("LisaFS plugin", "Unable to read MDDF");
@@ -272,7 +265,7 @@ namespace DiscImageChef.Filesystems.LisaFS
return error;
}
error = ReadSystemFile((short)FILEID_BITMAP, out temp);
error = ReadSystemFile((short)FILEID_BITMAP, out _);
if(error != Errno.NoError)
{
DicConsole.DebugWriteLine("LisaFS plugin", "Unable to read volume bitmap");
@@ -280,7 +273,7 @@ namespace DiscImageChef.Filesystems.LisaFS
return error;
}
error = ReadSystemFile((short)FILEID_SRECORD, out temp);
error = ReadSystemFile((short)FILEID_SRECORD, out _);
if(error != Errno.NoError)
{
DicConsole.DebugWriteLine("LisaFS plugin", "Unable to read S-Records file");
@@ -290,27 +283,27 @@ namespace DiscImageChef.Filesystems.LisaFS
}
// Create XML metadata for mounted filesystem
xmlFSType = new FileSystemType();
XmlFsType = new FileSystemType();
if(DateTime.Compare(mddf.dtvb, DateHandlers.LisaToDateTime(0)) > 0)
{
xmlFSType.BackupDate = mddf.dtvb;
xmlFSType.BackupDateSpecified = true;
XmlFsType.BackupDate = mddf.dtvb;
XmlFsType.BackupDateSpecified = true;
}
xmlFSType.Clusters = mddf.vol_size;
xmlFSType.ClusterSize = mddf.clustersize * mddf.datasize;
XmlFsType.Clusters = mddf.vol_size;
XmlFsType.ClusterSize = mddf.clustersize * mddf.datasize;
if(DateTime.Compare(mddf.dtvc, DateHandlers.LisaToDateTime(0)) > 0)
{
xmlFSType.CreationDate = mddf.dtvc;
xmlFSType.CreationDateSpecified = true;
XmlFsType.CreationDate = mddf.dtvc;
XmlFsType.CreationDateSpecified = true;
}
xmlFSType.Dirty = mddf.vol_left_mounted != 0;
xmlFSType.Files = mddf.filecount;
xmlFSType.FilesSpecified = true;
xmlFSType.FreeClusters = mddf.freecount;
xmlFSType.FreeClustersSpecified = true;
xmlFSType.Type = "LisaFS";
xmlFSType.VolumeName = mddf.volname;
xmlFSType.VolumeSerial = $"{mddf.volid:X16}";
XmlFsType.Dirty = mddf.vol_left_mounted != 0;
XmlFsType.Files = mddf.filecount;
XmlFsType.FilesSpecified = true;
XmlFsType.FreeClusters = mddf.freecount;
XmlFsType.FreeClustersSpecified = true;
XmlFsType.Type = "LisaFS";
XmlFsType.VolumeName = mddf.volname;
XmlFsType.VolumeSerial = $"{mddf.volid:X16}";
return Errno.NoError;
}
@@ -353,24 +346,25 @@ namespace DiscImageChef.Filesystems.LisaFS
{
if(!mounted) return Errno.AccessDenied;
stat = new FileSystemInfo();
stat.Blocks = mddf.vol_size;
stat.FilenameLength = (ushort)E_NAME;
stat.Files = mddf.filecount;
stat.FreeBlocks = mddf.freecount;
stat = new FileSystemInfo
{
Blocks = mddf.vol_size,
FilenameLength = (ushort)E_NAME,
Files = mddf.filecount,
FreeBlocks = mddf.freecount,
Id = {Serial64 = mddf.volid, IsLong = true},
PluginId = PluginUuid
};
stat.FreeFiles = FILEID_MAX - stat.Files;
stat.Id.Serial64 = mddf.volid;
stat.Id.IsLong = true;
stat.PluginId = PluginUUID;
switch(mddf.fsversion)
{
case LisaFSv1:
case LISA_V1:
stat.Type = "LisaFS v1";
break;
case LisaFSv2:
case LISA_V2:
stat.Type = "LisaFS v2";
break;
case LisaFSv3:
case LISA_V3:
stat.Type = "LisaFS v3";
break;
}

View File

@@ -48,9 +48,7 @@ namespace DiscImageChef.Filesystems.LisaFS
/// <param name="xattrs">List of extended attributes, alternate data streams and forks.</param>
public override Errno ListXAttr(string path, ref List<string> xattrs)
{
short fileId;
bool isDir;
Errno error = LookupFileId(path, out fileId, out isDir);
Errno error = LookupFileId(path, out short fileId, out bool isDir);
if(error != Errno.NoError) return error;
return isDir ? Errno.InvalidArgument : ListXAttr(fileId, ref xattrs);
@@ -65,9 +63,7 @@ namespace DiscImageChef.Filesystems.LisaFS
/// <param name="buf">Buffer.</param>
public override Errno GetXattr(string path, string xattr, ref byte[] buf)
{
short fileId;
bool isDir;
Errno error = LookupFileId(path, out fileId, out isDir);
Errno error = LookupFileId(path, out short fileId, out bool isDir);
if(error != Errno.NoError) return error;
return isDir ? Errno.InvalidArgument : GetXattr(fileId, xattr, out buf);
@@ -104,8 +100,7 @@ namespace DiscImageChef.Filesystems.LisaFS
else
{
// Search for the file
ExtentFile file;
Errno error = ReadExtentsFile(fileId, out file);
Errno error = ReadExtentsFile(fileId, out ExtentFile file);
if(error != Errno.NoError) return error;
@@ -162,8 +157,7 @@ namespace DiscImageChef.Filesystems.LisaFS
}
// Search for the file
ExtentFile file;
Errno error = ReadExtentsFile(fileId, out file);
Errno error = ReadExtentsFile(fileId, out ExtentFile file);
if(error != Errno.NoError) return error;