mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
REFACTOR: Reformat code.
This commit is contained in:
@@ -160,5 +160,4 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
KilledObject = 15
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -60,11 +60,9 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
short fileId;
|
||||
bool isDir;
|
||||
Errno error = LookupFileId(path, out fileId, out isDir);
|
||||
if(error != Errno.NoError)
|
||||
return error;
|
||||
if(error != Errno.NoError) return error;
|
||||
|
||||
if(!isDir)
|
||||
return Errno.NotDirectory;
|
||||
if(!isDir) return Errno.NotDirectory;
|
||||
|
||||
/*List<CatalogEntry> catalog;
|
||||
error = ReadCatalog(fileId, out catalog);
|
||||
@@ -108,8 +106,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
/// </summary>
|
||||
Errno ReadCatalog()
|
||||
{
|
||||
if(!mounted)
|
||||
return Errno.AccessDenied;
|
||||
if(!mounted) return Errno.AccessDenied;
|
||||
|
||||
catalogCache = new List<CatalogEntry>();
|
||||
|
||||
@@ -186,8 +183,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
}
|
||||
|
||||
// Catalog not found
|
||||
if(firstCatalogBlock == null)
|
||||
return Errno.NoSuchFile;
|
||||
if(firstCatalogBlock == null) return Errno.NoSuchFile;
|
||||
|
||||
ulong prevCatalogPointer;
|
||||
prevCatalogPointer = BigEndianBitConverter.ToUInt32(firstCatalogBlock, 0x7F6);
|
||||
@@ -196,10 +192,10 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
while(prevCatalogPointer != 0xFFFFFFFF)
|
||||
{
|
||||
LisaTag.PriamTag prevTag;
|
||||
DecodeTag(device.ReadSectorTag(prevCatalogPointer + mddf.mddf_block + volumePrefix, SectorTagType.AppleSectorTag), out prevTag);
|
||||
DecodeTag(device.ReadSectorTag(prevCatalogPointer + mddf.mddf_block + volumePrefix, SectorTagType.AppleSectorTag),
|
||||
out prevTag);
|
||||
|
||||
if(prevTag.fileID != FILEID_CATALOG)
|
||||
return Errno.InvalidArgument;
|
||||
if(prevTag.fileID != FILEID_CATALOG) return Errno.InvalidArgument;
|
||||
|
||||
firstCatalogBlock = device.ReadSectors(prevCatalogPointer + mddf.mddf_block + volumePrefix, 4);
|
||||
prevCatalogPointer = BigEndianBitConverter.ToUInt32(firstCatalogBlock, 0x7F6);
|
||||
@@ -215,10 +211,10 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
while(nextCatalogPointer != 0xFFFFFFFF)
|
||||
{
|
||||
LisaTag.PriamTag nextTag;
|
||||
DecodeTag(device.ReadSectorTag(nextCatalogPointer + mddf.mddf_block + volumePrefix, SectorTagType.AppleSectorTag), out nextTag);
|
||||
DecodeTag(device.ReadSectorTag(nextCatalogPointer + mddf.mddf_block + volumePrefix, SectorTagType.AppleSectorTag),
|
||||
out nextTag);
|
||||
|
||||
if(nextTag.fileID != FILEID_CATALOG)
|
||||
return Errno.InvalidArgument;
|
||||
if(nextTag.fileID != FILEID_CATALOG) return Errno.InvalidArgument;
|
||||
|
||||
byte[] nextCatalogBlock = device.ReadSectors(nextCatalogPointer + mddf.mddf_block + volumePrefix, 4);
|
||||
nextCatalogPointer = BigEndianBitConverter.ToUInt32(nextCatalogBlock, 0x7FA);
|
||||
@@ -234,14 +230,11 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
while((offset + 64) <= buf.Length)
|
||||
{
|
||||
// Catalog block header
|
||||
if(buf[offset + 0x24] == 0x08)
|
||||
offset += 78;
|
||||
if(buf[offset + 0x24] == 0x08) offset += 78;
|
||||
// Maybe just garbage? Found in more than 1 disk
|
||||
else if(buf[offset + 0x24] == 0x7C)
|
||||
offset += 50;
|
||||
else if(buf[offset + 0x24] == 0x7C) offset += 50;
|
||||
// Apparently reserved to indicate end of catalog?
|
||||
else if(buf[offset + 0x24] == 0xFF)
|
||||
break;
|
||||
else if(buf[offset + 0x24] == 0xFF) break;
|
||||
// Normal entry
|
||||
else if(buf[offset + 0x24] == 0x03 && buf[offset] == 0x24)
|
||||
{
|
||||
@@ -298,8 +291,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
|
||||
offset += 48;
|
||||
}
|
||||
else
|
||||
break;
|
||||
else break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -310,8 +302,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
{
|
||||
stat = null;
|
||||
|
||||
if(!mounted)
|
||||
return Errno.AccessDenied;
|
||||
if(!mounted) return Errno.AccessDenied;
|
||||
|
||||
stat = new FileEntryInfo();
|
||||
stat.Attributes = new FileAttributes();
|
||||
|
||||
@@ -55,24 +55,20 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
{
|
||||
file = new ExtentFile();
|
||||
|
||||
if(!mounted)
|
||||
return Errno.AccessDenied;
|
||||
if(!mounted) return Errno.AccessDenied;
|
||||
|
||||
if(fileId < 4 || (fileId == 4 && (mddf.fsversion != LisaFSv2 && mddf.fsversion != LisaFSv1)))
|
||||
return Errno.InvalidArgument;
|
||||
|
||||
if(extentCache.TryGetValue(fileId, out file))
|
||||
return Errno.NoError;
|
||||
if(extentCache.TryGetValue(fileId, out file)) return Errno.NoError;
|
||||
|
||||
// A file ID that cannot be stored in the S-Records File
|
||||
if(fileId >= srecords.Length)
|
||||
return Errno.InvalidArgument;
|
||||
if(fileId >= srecords.Length) return Errno.InvalidArgument;
|
||||
|
||||
ulong ptr = srecords[fileId].extent_ptr;
|
||||
|
||||
// An invalid pointer denotes file does not exist
|
||||
if(ptr == 0xFFFFFFFF || ptr == 0x00000000)
|
||||
return Errno.NoSuchFile;
|
||||
if(ptr == 0xFFFFFFFF || ptr == 0x00000000) return Errno.NoSuchFile;
|
||||
|
||||
// Pointers are relative to MDDF
|
||||
ptr += mddf.mddf_block + volumePrefix;
|
||||
@@ -96,8 +92,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
}
|
||||
}
|
||||
|
||||
if(!found)
|
||||
return Errno.InvalidArgument;
|
||||
if(!found) return Errno.InvalidArgument;
|
||||
}
|
||||
|
||||
// Checks that the sector tag indicates its the Extents File we are searching for
|
||||
@@ -107,13 +102,10 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
{
|
||||
byte[] sector;
|
||||
|
||||
if(mddf.fsversion == LisaFSv1)
|
||||
sector = device.ReadSectors(ptr, 2);
|
||||
else
|
||||
sector = device.ReadSector(ptr);
|
||||
if(mddf.fsversion == LisaFSv1) sector = device.ReadSectors(ptr, 2);
|
||||
else sector = device.ReadSector(ptr);
|
||||
|
||||
if(sector[0] >= 32 || sector[0] == 0)
|
||||
return Errno.InvalidArgument;
|
||||
if(sector[0] >= 32 || sector[0] == 0) return Errno.InvalidArgument;
|
||||
|
||||
file.filenameLen = sector[0];
|
||||
file.filename = new byte[file.filenameLen];
|
||||
@@ -174,8 +166,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
|
||||
for(int j = 0; j < 41; j++)
|
||||
{
|
||||
if(BigEndianBitConverter.ToInt16(sector, extentsOffset + j * 6 + 4) == 0)
|
||||
break;
|
||||
if(BigEndianBitConverter.ToInt16(sector, extentsOffset + j * 6 + 4) == 0) break;
|
||||
|
||||
extentsCount++;
|
||||
}
|
||||
@@ -195,54 +186,85 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
{
|
||||
if(!printedExtents.Contains(fileId))
|
||||
{
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].filenameLen = {1}", fileId, file.filenameLen);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].filename = {1}", fileId, StringHandlers.CToString(file.filename, CurrentEncoding));
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].unknown1 = 0x{1:X4}", fileId, file.unknown1);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].file_uid = 0x{1:X16}", fileId, file.file_uid);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].unknown2 = 0x{1:X2}", fileId, file.unknown2);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].etype = 0x{1:X2}", fileId, file.etype);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].filenameLen = {1}", fileId,
|
||||
file.filenameLen);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].filename = {1}", fileId,
|
||||
StringHandlers.CToString(file.filename, CurrentEncoding));
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].unknown1 = 0x{1:X4}", fileId,
|
||||
file.unknown1);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].file_uid = 0x{1:X16}", fileId,
|
||||
file.file_uid);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].unknown2 = 0x{1:X2}", fileId,
|
||||
file.unknown2);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].etype = 0x{1:X2}", fileId,
|
||||
file.etype);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].ftype = {1}", fileId, file.ftype);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].unknown3 = 0x{1:X2}", fileId, file.unknown3);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].unknown3 = 0x{1:X2}", fileId,
|
||||
file.unknown3);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].dtc = {1}", fileId, file.dtc);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].dta = {1}", fileId, file.dta);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].dtm = {1}", fileId, file.dtm);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].dtb = {1}", fileId, file.dtb);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].dts = {1}", fileId, file.dts);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].serial = {1}", fileId, file.serial);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].unknown4 = 0x{1:X2}", fileId, file.unknown4);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].locked = {1}", fileId, file.locked > 0);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].protect = {1}", fileId, file.protect > 0);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].master = {1}", fileId, file.master > 0);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].scavenged = {1}", fileId, file.scavenged > 0);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].closed = {1}", fileId, file.closed > 0);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].unknown4 = 0x{1:X2}", fileId,
|
||||
file.unknown4);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].locked = {1}", fileId,
|
||||
file.locked > 0);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].protect = {1}", fileId,
|
||||
file.protect > 0);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].master = {1}", fileId,
|
||||
file.master > 0);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].scavenged = {1}", fileId,
|
||||
file.scavenged > 0);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].closed = {1}", fileId,
|
||||
file.closed > 0);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].open = {1}", fileId, file.open > 0);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].unknown5 = 0x{1:X2}{2:X2}{3:X2}{4:X2}{5:X2}{6:X2}{7:X2}{8:X2}{9:X2}" +
|
||||
"{10:X2}{11:X2}", fileId, file.unknown5[0], file.unknown5[1], file.unknown5[2], file.unknown5[3],
|
||||
file.unknown5[4], file.unknown5[5], file.unknown5[6], file.unknown5[7], file.unknown5[8], file.unknown5[9],
|
||||
file.unknown5[10]);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].release = {1}", fileId, file.release);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin",
|
||||
"ExtentFile[{0}].unknown5 = 0x{1:X2}{2:X2}{3:X2}{4:X2}{5:X2}{6:X2}{7:X2}{8:X2}{9:X2}" +
|
||||
"{10:X2}{11:X2}", fileId, file.unknown5[0], file.unknown5[1],
|
||||
file.unknown5[2], file.unknown5[3], file.unknown5[4],
|
||||
file.unknown5[5], file.unknown5[6], file.unknown5[7],
|
||||
file.unknown5[8], file.unknown5[9], file.unknown5[10]);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].release = {1}", fileId,
|
||||
file.release);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].build = {1}", fileId, file.build);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].compatibility = {1}", fileId, file.compatibility);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].revision = {1}", fileId, file.revision);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].unknown6 = 0x{1:X4}", fileId, file.unknown6);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].password_valid = {1}", fileId, file.password_valid > 0);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].password = {1}", fileId, CurrentEncoding.GetString(file.password));
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].unknown7 = 0x{1:X2}{2:X2}{3:X2}", fileId, file.unknown7[0],
|
||||
file.unknown7[1], file.unknown7[2]);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].overhead = {1}", fileId, file.overhead);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].unknown8 = 0x{1:X2}{2:X2}{3:X2}{4:X2}{5:X2}{6:X2}{7:X2}{8:X2}{9:X2}" +
|
||||
"{10:X2}{11:X2}{12:X2}{13:X2}{14:X2}{15:X2}{16:X2}", fileId, file.unknown8[0], file.unknown8[1], file.unknown8[2],
|
||||
file.unknown8[3], file.unknown8[4], file.unknown8[5], file.unknown8[6], file.unknown8[7], file.unknown8[8],
|
||||
file.unknown8[9], file.unknown8[10], file.unknown8[11], file.unknown8[12], file.unknown8[13], file.unknown8[14],
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].compatibility = {1}", fileId,
|
||||
file.compatibility);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].revision = {1}", fileId,
|
||||
file.revision);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].unknown6 = 0x{1:X4}", fileId,
|
||||
file.unknown6);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].password_valid = {1}", fileId,
|
||||
file.password_valid > 0);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].password = {1}", fileId,
|
||||
CurrentEncoding.GetString(file.password));
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].unknown7 = 0x{1:X2}{2:X2}{3:X2}",
|
||||
fileId, file.unknown7[0], file.unknown7[1], file.unknown7[2]);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].overhead = {1}", fileId,
|
||||
file.overhead);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin",
|
||||
"ExtentFile[{0}].unknown8 = 0x{1:X2}{2:X2}{3:X2}{4:X2}{5:X2}{6:X2}{7:X2}{8:X2}{9:X2}" +
|
||||
"{10:X2}{11:X2}{12:X2}{13:X2}{14:X2}{15:X2}{16:X2}", fileId,
|
||||
file.unknown8[0], file.unknown8[1], file.unknown8[2],
|
||||
file.unknown8[3], file.unknown8[4], file.unknown8[5],
|
||||
file.unknown8[6], file.unknown8[7], file.unknown8[8],
|
||||
file.unknown8[9], file.unknown8[10], file.unknown8[11],
|
||||
file.unknown8[12], file.unknown8[13], file.unknown8[14],
|
||||
file.unknown8[15]);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].length = {1}", fileId, file.length);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].unknown9 = 0x{1:X8}", fileId, file.unknown9);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].unknown9 = 0x{1:X8}", fileId,
|
||||
file.unknown9);
|
||||
for(int ext = 0; ext < file.extents.Length; ext++)
|
||||
{
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].extents[{1}].start = {2}", fileId, ext, file.extents[ext].start);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].extents[{1}].length = {2}", fileId, ext, file.extents[ext].length);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].extents[{1}].start = {2}",
|
||||
fileId, ext, file.extents[ext].start);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].extents[{1}].length = {2}",
|
||||
fileId, ext, file.extents[ext].length);
|
||||
}
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].unknown10 = 0x{1:X4}", fileId, file.unknown10);
|
||||
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].unknown10 = 0x{1:X4}", fileId,
|
||||
file.unknown10);
|
||||
|
||||
printedExtents.Add(fileId);
|
||||
}
|
||||
@@ -259,8 +281,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
/// </summary>
|
||||
Errno ReadSRecords()
|
||||
{
|
||||
if(!mounted)
|
||||
return Errno.AccessDenied;
|
||||
if(!mounted) return Errno.AccessDenied;
|
||||
|
||||
// Searches the S-Records place using MDDF pointers
|
||||
byte[] sectors = device.ReadSectors(mddf.srec_ptr + mddf.mddf_block + volumePrefix, mddf.srec_len);
|
||||
@@ -280,5 +301,4 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
return Errno.NoError;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -44,11 +44,9 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
short fileId;
|
||||
bool isDir;
|
||||
Errno error = LookupFileId(path, out fileId, out isDir);
|
||||
if(error != Errno.NoError)
|
||||
return error;
|
||||
if(error != Errno.NoError) return error;
|
||||
|
||||
if(!isDir)
|
||||
return GetAttributes(fileId, ref attributes);
|
||||
if(!isDir) return GetAttributes(fileId, ref attributes);
|
||||
|
||||
attributes = new FileAttributes();
|
||||
attributes = FileAttributes.Directory;
|
||||
@@ -64,14 +62,12 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
return Errno.NoError;
|
||||
}
|
||||
|
||||
if(offset < 0)
|
||||
return Errno.InvalidArgument;
|
||||
if(offset < 0) return Errno.InvalidArgument;
|
||||
|
||||
short fileId;
|
||||
bool isDir;
|
||||
Errno error = LookupFileId(path, out fileId, out isDir);
|
||||
if(error != Errno.NoError)
|
||||
return error;
|
||||
if(error != Errno.NoError) return error;
|
||||
|
||||
byte[] tmp;
|
||||
if(debug)
|
||||
@@ -91,17 +87,13 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
error = ReadFile(fileId, out tmp);
|
||||
else error = ReadFile(fileId, out tmp);
|
||||
|
||||
if(error != Errno.NoError)
|
||||
return error;
|
||||
if(error != Errno.NoError) return error;
|
||||
|
||||
if(offset >= tmp.Length)
|
||||
return Errno.EINVAL;
|
||||
if(offset >= tmp.Length) return Errno.EINVAL;
|
||||
|
||||
if(size + offset >= tmp.Length)
|
||||
size = tmp.Length - offset;
|
||||
if(size + offset >= tmp.Length) size = tmp.Length - offset;
|
||||
|
||||
buf = new byte[size];
|
||||
Array.Copy(tmp, offset, buf, 0, size);
|
||||
@@ -113,21 +105,18 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
short fileId;
|
||||
bool isDir;
|
||||
Errno error = LookupFileId(path, out fileId, out isDir);
|
||||
if(error != Errno.NoError)
|
||||
return error;
|
||||
if(error != Errno.NoError) return error;
|
||||
|
||||
return isDir ? StatDir(fileId, out stat) : Stat(fileId, out stat);
|
||||
}
|
||||
|
||||
Errno GetAttributes(short fileId, ref FileAttributes attributes)
|
||||
{
|
||||
if(!mounted)
|
||||
return Errno.AccessDenied;
|
||||
if(!mounted) return Errno.AccessDenied;
|
||||
|
||||
if(fileId < 4)
|
||||
{
|
||||
if(!debug)
|
||||
return Errno.NoSuchFile;
|
||||
if(!debug) return Errno.NoSuchFile;
|
||||
|
||||
attributes = new FileAttributes();
|
||||
attributes = FileAttributes.System;
|
||||
@@ -141,8 +130,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
ExtentFile extFile;
|
||||
Errno error = ReadExtentsFile(fileId, out extFile);
|
||||
|
||||
if(error != Errno.NoError)
|
||||
return error;
|
||||
if(error != Errno.NoError) return error;
|
||||
|
||||
attributes = new FileAttributes();
|
||||
|
||||
@@ -158,20 +146,16 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
case FileType.Pipe:
|
||||
attributes |= FileAttributes.Pipe;
|
||||
break;
|
||||
case FileType.Undefined:
|
||||
break;
|
||||
case FileType.Undefined: break;
|
||||
default:
|
||||
attributes |= FileAttributes.File;
|
||||
attributes |= FileAttributes.Extents;
|
||||
break;
|
||||
}
|
||||
|
||||
if(extFile.protect > 0)
|
||||
attributes |= FileAttributes.Immutable;
|
||||
if(extFile.locked > 0)
|
||||
attributes |= FileAttributes.ReadOnly;
|
||||
if(extFile.password_valid > 0)
|
||||
attributes |= FileAttributes.Password;
|
||||
if(extFile.protect > 0) attributes |= FileAttributes.Immutable;
|
||||
if(extFile.locked > 0) attributes |= FileAttributes.ReadOnly;
|
||||
if(extFile.password_valid > 0) attributes |= FileAttributes.Password;
|
||||
|
||||
return Errno.NoError;
|
||||
}
|
||||
@@ -184,17 +168,14 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
Errno ReadSystemFile(short fileId, out byte[] buf, bool tags)
|
||||
{
|
||||
buf = null;
|
||||
if(!mounted || !debug)
|
||||
return Errno.AccessDenied;
|
||||
if(!mounted || !debug) return Errno.AccessDenied;
|
||||
|
||||
if(fileId > 4 || fileId <= 0)
|
||||
{
|
||||
if(fileId != FILEID_BOOT_SIGNED && fileId != FILEID_LOADER_SIGNED)
|
||||
return Errno.InvalidArgument;
|
||||
if(fileId != FILEID_BOOT_SIGNED && fileId != FILEID_LOADER_SIGNED) return Errno.InvalidArgument;
|
||||
}
|
||||
|
||||
if(systemFileCache.TryGetValue(fileId, out buf) && !tags)
|
||||
return Errno.NoError;
|
||||
if(systemFileCache.TryGetValue(fileId, out buf) && !tags) return Errno.NoError;
|
||||
|
||||
int count = 0;
|
||||
|
||||
@@ -208,7 +189,8 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
}
|
||||
else
|
||||
{
|
||||
buf = device.ReadSectorsTag(mddf.mddf_block + volumePrefix + mddf.srec_ptr, mddf.srec_len, SectorTagType.AppleSectorTag);
|
||||
buf = device.ReadSectorsTag(mddf.mddf_block + volumePrefix + mddf.srec_ptr, mddf.srec_len,
|
||||
SectorTagType.AppleSectorTag);
|
||||
return Errno.NoError;
|
||||
}
|
||||
}
|
||||
@@ -220,17 +202,13 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
{
|
||||
DecodeTag(device.ReadSectorTag(i, SectorTagType.AppleSectorTag), out sysTag);
|
||||
|
||||
if(sysTag.fileID == fileId)
|
||||
count++;
|
||||
if(sysTag.fileID == fileId) count++;
|
||||
}
|
||||
|
||||
if(count == 0)
|
||||
return Errno.NoSuchFile;
|
||||
if(count == 0) return Errno.NoSuchFile;
|
||||
|
||||
if(!tags)
|
||||
buf = new byte[count * device.GetSectorSize()];
|
||||
else
|
||||
buf = new byte[count * devTagSize];
|
||||
if(!tags) buf = new byte[count * device.GetSectorSize()];
|
||||
else buf = new byte[count * devTagSize];
|
||||
|
||||
// Should be enough to check 100 sectors?
|
||||
for(ulong i = 0; i < 100; i++)
|
||||
@@ -241,21 +219,17 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
{
|
||||
byte[] sector;
|
||||
|
||||
if(!tags)
|
||||
sector = device.ReadSector(i);
|
||||
else
|
||||
sector = device.ReadSectorTag(i, SectorTagType.AppleSectorTag);
|
||||
if(!tags) sector = device.ReadSector(i);
|
||||
else sector = device.ReadSectorTag(i, SectorTagType.AppleSectorTag);
|
||||
|
||||
// Relative block for $Loader starts at $Boot block
|
||||
if(sysTag.fileID == FILEID_LOADER_SIGNED)
|
||||
sysTag.relPage--;
|
||||
if(sysTag.fileID == FILEID_LOADER_SIGNED) sysTag.relPage--;
|
||||
|
||||
Array.Copy(sector, 0, buf, sector.Length * sysTag.relPage, sector.Length);
|
||||
}
|
||||
}
|
||||
|
||||
if(!tags)
|
||||
systemFileCache.Add(fileId, buf);
|
||||
if(!tags) systemFileCache.Add(fileId, buf);
|
||||
|
||||
return Errno.NoError;
|
||||
}
|
||||
@@ -264,30 +238,26 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
{
|
||||
stat = null;
|
||||
|
||||
if(!mounted)
|
||||
return Errno.AccessDenied;
|
||||
if(!mounted) return Errno.AccessDenied;
|
||||
|
||||
Errno error;
|
||||
ExtentFile file;
|
||||
|
||||
if(fileId <= 4)
|
||||
{
|
||||
if(!debug || fileId == 0)
|
||||
return Errno.NoSuchFile;
|
||||
if(!debug || fileId == 0) return Errno.NoSuchFile;
|
||||
else
|
||||
{
|
||||
stat = new FileEntryInfo();
|
||||
stat.Attributes = new FileAttributes();
|
||||
|
||||
error = GetAttributes(fileId, ref stat.Attributes);
|
||||
if(error != Errno.NoError)
|
||||
return error;
|
||||
if(error != Errno.NoError) return error;
|
||||
|
||||
if(fileId < 0 && fileId != FILEID_BOOT_SIGNED && fileId != FILEID_LOADER_SIGNED)
|
||||
{
|
||||
error = ReadExtentsFile((short)(fileId * -1), out file);
|
||||
if(error != Errno.NoError)
|
||||
return error;
|
||||
if(error != Errno.NoError) return error;
|
||||
|
||||
stat.CreationTime = DateHandlers.LisaToDateTime(file.dtc);
|
||||
stat.AccessTime = DateHandlers.LisaToDateTime(file.dta);
|
||||
@@ -308,13 +278,10 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
{
|
||||
byte[] buf;
|
||||
error = ReadSystemFile(fileId, out buf);
|
||||
if(error != Errno.NoError)
|
||||
return error;
|
||||
if(error != Errno.NoError) return error;
|
||||
|
||||
if(fileId != 4)
|
||||
stat.CreationTime = mddf.dtvc;
|
||||
else
|
||||
stat.CreationTime = mddf.dtcc;
|
||||
if(fileId != 4) stat.CreationTime = mddf.dtvc;
|
||||
else stat.CreationTime = mddf.dtcc;
|
||||
|
||||
stat.BackupTime = mddf.dtvb;
|
||||
|
||||
@@ -361,10 +328,8 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
stat.GID = 0;
|
||||
stat.DeviceNo = 0;
|
||||
int len;
|
||||
if(!fileSizeCache.TryGetValue(fileId, out len))
|
||||
stat.Length = srecords[fileId].filesize;
|
||||
else
|
||||
stat.Length = len;
|
||||
if(!fileSizeCache.TryGetValue(fileId, out len)) stat.Length = srecords[fileId].filesize;
|
||||
else stat.Length = len;
|
||||
stat.BlockSize = mddf.datasize;
|
||||
stat.Blocks = file.length;
|
||||
|
||||
@@ -379,29 +344,24 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
Errno ReadFile(short fileId, out byte[] buf, bool tags)
|
||||
{
|
||||
buf = null;
|
||||
if(!mounted)
|
||||
return Errno.AccessDenied;
|
||||
if(!mounted) return Errno.AccessDenied;
|
||||
|
||||
tags &= debug;
|
||||
|
||||
if(fileId < 4 || (fileId == 4 && (mddf.fsversion != LisaFSv2 && mddf.fsversion != LisaFSv1)))
|
||||
return Errno.InvalidArgument;
|
||||
|
||||
if(!tags && fileCache.TryGetValue(fileId, out buf))
|
||||
return Errno.NoError;
|
||||
if(!tags && fileCache.TryGetValue(fileId, out buf)) return Errno.NoError;
|
||||
|
||||
Errno error;
|
||||
ExtentFile file;
|
||||
|
||||
error = ReadExtentsFile(fileId, out file);
|
||||
if(error != Errno.NoError)
|
||||
return error;
|
||||
if(error != Errno.NoError) return error;
|
||||
|
||||
int sectorSize;
|
||||
if(tags)
|
||||
sectorSize = devTagSize;
|
||||
else
|
||||
sectorSize = (int)device.GetSectorSize();
|
||||
if(tags) sectorSize = devTagSize;
|
||||
else sectorSize = (int)device.GetSectorSize();
|
||||
|
||||
byte[] temp = new byte[file.length * sectorSize];
|
||||
|
||||
@@ -411,9 +371,11 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
byte[] sector;
|
||||
|
||||
if(!tags)
|
||||
sector = device.ReadSectors(((ulong)file.extents[i].start + mddf.mddf_block + volumePrefix), (uint)file.extents[i].length);
|
||||
sector = device.ReadSectors(((ulong)file.extents[i].start + mddf.mddf_block + volumePrefix),
|
||||
(uint)file.extents[i].length);
|
||||
else
|
||||
sector = device.ReadSectorsTag(((ulong)file.extents[i].start + mddf.mddf_block + volumePrefix), (uint)file.extents[i].length, SectorTagType.AppleSectorTag);
|
||||
sector = device.ReadSectorsTag(((ulong)file.extents[i].start + mddf.mddf_block + volumePrefix),
|
||||
(uint)file.extents[i].length, SectorTagType.AppleSectorTag);
|
||||
|
||||
Array.Copy(sector, 0, temp, offset, sector.Length);
|
||||
offset += sector.Length;
|
||||
@@ -424,15 +386,13 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
int realSize;
|
||||
if(fileSizeCache.TryGetValue(fileId, out realSize))
|
||||
{
|
||||
if(realSize > temp.Length)
|
||||
DicConsole.ErrorWriteLine("File {0} gets truncated.", fileId);
|
||||
if(realSize > temp.Length) DicConsole.ErrorWriteLine("File {0} gets truncated.", fileId);
|
||||
}
|
||||
buf = temp;
|
||||
|
||||
fileCache.Add(fileId, buf);
|
||||
}
|
||||
else
|
||||
buf = temp;
|
||||
else buf = temp;
|
||||
|
||||
return Errno.NoError;
|
||||
}
|
||||
@@ -442,10 +402,9 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
fileId = 0;
|
||||
isDir = false;
|
||||
|
||||
if(!mounted)
|
||||
return Errno.AccessDenied;
|
||||
if(!mounted) return Errno.AccessDenied;
|
||||
|
||||
string[] pathElements = path.Split(new char[] { '/' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
string[] pathElements = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
if(pathElements.Length == 0)
|
||||
{
|
||||
@@ -455,8 +414,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 != LisaFSv3) return Errno.NotSupported;
|
||||
|
||||
if(debug && pathElements.Length == 1)
|
||||
{
|
||||
@@ -507,19 +465,17 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
string filename = StringHandlers.CToString(entry.filename, CurrentEncoding);
|
||||
|
||||
// LisaOS is case insensitive
|
||||
if(string.Compare(wantedFilename, filename, StringComparison.InvariantCultureIgnoreCase) == 0
|
||||
&& entry.parentID == fileId)
|
||||
if(string.Compare(wantedFilename, filename, StringComparison.InvariantCultureIgnoreCase) == 0 &&
|
||||
entry.parentID == fileId)
|
||||
{
|
||||
fileId = entry.fileID;
|
||||
isDir = entry.fileType == 0x01;
|
||||
|
||||
// Not last path element, and it's not a directory
|
||||
if(lvl != pathElements.Length - 1 && !isDir)
|
||||
return Errno.NotDirectory;
|
||||
if(lvl != pathElements.Length - 1 && !isDir) return Errno.NotDirectory;
|
||||
|
||||
// Arrived last path element
|
||||
if(lvl == pathElements.Length - 1)
|
||||
return Errno.NoError;
|
||||
if(lvl == pathElements.Length - 1) return Errno.NoError;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -527,5 +483,4 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
return Errno.NoSuchFile;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -45,18 +45,15 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
{
|
||||
try
|
||||
{
|
||||
if(imagePlugin.ImageInfo.readableSectorTags == null)
|
||||
return false;
|
||||
if(imagePlugin.ImageInfo.readableSectorTags == null) return false;
|
||||
|
||||
if(!imagePlugin.ImageInfo.readableSectorTags.Contains(SectorTagType.AppleSectorTag))
|
||||
return false;
|
||||
if(!imagePlugin.ImageInfo.readableSectorTags.Contains(SectorTagType.AppleSectorTag)) return false;
|
||||
|
||||
// LisaOS is big-endian
|
||||
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
|
||||
|
||||
// Minimal LisaOS disk is 3.5" single sided double density, 800 sectors
|
||||
if(imagePlugin.GetSectors() < 800)
|
||||
return false;
|
||||
if(imagePlugin.GetSectors() < 800) return false;
|
||||
|
||||
int before_mddf = -1;
|
||||
|
||||
@@ -68,8 +65,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
|
||||
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(before_mddf == -1 && searchTag.fileID == FILEID_LOADER_SIGNED) before_mddf = i - 1;
|
||||
|
||||
if(searchTag.fileID == FILEID_MDDF)
|
||||
{
|
||||
@@ -87,32 +83,29 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.mddf_block = {0}", info_mddf.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 - mddf.mddf_block -1 = {0}", info_mddf.volsize_minus_mddf_minus_one);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "Disk sector = {0} bytes", imagePlugin.GetSectorSize());
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.vol_size - 1 = {0}",
|
||||
info_mddf.volsize_minus_one);
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.vol_size - mddf.mddf_block -1 = {0}",
|
||||
info_mddf.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);
|
||||
|
||||
if(info_mddf.mddf_block != i - before_mddf)
|
||||
return false;
|
||||
if(info_mddf.mddf_block != i - before_mddf) return false;
|
||||
|
||||
if(info_mddf.vol_size > imagePlugin.GetSectors())
|
||||
return false;
|
||||
if(info_mddf.vol_size > imagePlugin.GetSectors()) return false;
|
||||
|
||||
if(info_mddf.vol_size - 1 != info_mddf.volsize_minus_one)
|
||||
return false;
|
||||
if(info_mddf.vol_size - 1 != info_mddf.volsize_minus_one) return false;
|
||||
|
||||
if(info_mddf.vol_size - i - 1 != info_mddf.volsize_minus_mddf_minus_one - before_mddf)
|
||||
return false;
|
||||
|
||||
if(info_mddf.datasize > info_mddf.blocksize)
|
||||
return false;
|
||||
if(info_mddf.datasize > info_mddf.blocksize) return false;
|
||||
|
||||
if(info_mddf.blocksize < imagePlugin.GetSectorSize())
|
||||
return false;
|
||||
if(info_mddf.blocksize < imagePlugin.GetSectorSize()) return false;
|
||||
|
||||
if(info_mddf.datasize != imagePlugin.GetSectorSize())
|
||||
return false;
|
||||
if(info_mddf.datasize != imagePlugin.GetSectorSize()) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -134,18 +127,15 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
|
||||
try
|
||||
{
|
||||
if(imagePlugin.ImageInfo.readableSectorTags == null)
|
||||
return;
|
||||
if(imagePlugin.ImageInfo.readableSectorTags == null) return;
|
||||
|
||||
if(!imagePlugin.ImageInfo.readableSectorTags.Contains(SectorTagType.AppleSectorTag))
|
||||
return;
|
||||
if(!imagePlugin.ImageInfo.readableSectorTags.Contains(SectorTagType.AppleSectorTag)) return;
|
||||
|
||||
// LisaOS is big-endian
|
||||
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
|
||||
|
||||
// Minimal LisaOS disk is 3.5" single sided double density, 800 sectors
|
||||
if(imagePlugin.GetSectors() < 800)
|
||||
return;
|
||||
if(imagePlugin.GetSectors() < 800) return;
|
||||
|
||||
int before_mddf = -1;
|
||||
|
||||
@@ -157,8 +147,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
|
||||
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(before_mddf == -1 && searchTag.fileID == FILEID_LOADER_SIGNED) before_mddf = i - 1;
|
||||
|
||||
if(searchTag.fileID == FILEID_MDDF)
|
||||
{
|
||||
@@ -177,8 +166,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
// Prevent garbage
|
||||
if(pString[0] <= 32)
|
||||
info_mddf.password = StringHandlers.PascalToString(pString, CurrentEncoding);
|
||||
else
|
||||
info_mddf.password = "";
|
||||
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);
|
||||
@@ -249,65 +237,97 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
info_mddf.vol_sequence = BigEndianBitConverter.ToUInt16(sector, 0x136);
|
||||
info_mddf.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.unknown_timestamp = 0x{0:X8} ({0}, {1})", info_mddf.unknown_timestamp, DateHandlers.LisaToDateTime(info_mddf.unknown_timestamp));
|
||||
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.unknown_timestamp = 0x{0:X8} ({0}, {1})",
|
||||
info_mddf.unknown_timestamp,
|
||||
DateHandlers.LisaToDateTime(info_mddf.unknown_timestamp));
|
||||
|
||||
if(info_mddf.mddf_block != i - before_mddf)
|
||||
return;
|
||||
if(info_mddf.mddf_block != i - before_mddf) return;
|
||||
|
||||
if(info_mddf.vol_size > imagePlugin.GetSectors())
|
||||
return;
|
||||
if(info_mddf.vol_size > imagePlugin.GetSectors()) return;
|
||||
|
||||
if(info_mddf.vol_size - 1 != info_mddf.volsize_minus_one)
|
||||
return;
|
||||
if(info_mddf.vol_size - 1 != info_mddf.volsize_minus_one) return;
|
||||
|
||||
if(info_mddf.vol_size - i - 1 != info_mddf.volsize_minus_mddf_minus_one - before_mddf)
|
||||
return;
|
||||
if(info_mddf.vol_size - i - 1 != info_mddf.volsize_minus_mddf_minus_one - before_mddf) return;
|
||||
|
||||
if(info_mddf.datasize > info_mddf.blocksize)
|
||||
return;
|
||||
if(info_mddf.datasize > info_mddf.blocksize) return;
|
||||
|
||||
if(info_mddf.blocksize < imagePlugin.GetSectorSize())
|
||||
return;
|
||||
if(info_mddf.blocksize < imagePlugin.GetSectorSize()) return;
|
||||
|
||||
if(info_mddf.datasize != imagePlugin.GetSectorSize())
|
||||
return;
|
||||
if(info_mddf.datasize != imagePlugin.GetSectorSize()) return;
|
||||
|
||||
switch(info_mddf.fsversion)
|
||||
{
|
||||
@@ -332,10 +352,13 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
|
||||
sb.AppendFormat("Master copy ID: 0x{0:X8}", info_mddf.master_copy_id).AppendLine();
|
||||
|
||||
sb.AppendFormat("Volume is number {0} of {1}", info_mddf.volnum, info_mddf.vol_sequence).AppendLine();
|
||||
sb.AppendFormat("Volume is number {0} of {1}", info_mddf.volnum, info_mddf.vol_sequence)
|
||||
.AppendLine();
|
||||
|
||||
sb.AppendFormat("Serial number of Lisa computer that created this volume: {0}", info_mddf.machine_id).AppendLine();
|
||||
sb.AppendFormat("Serial number of Lisa computer that can use this volume's software {0}", info_mddf.serialization).AppendLine();
|
||||
sb.AppendFormat("Serial number of Lisa computer that created this volume: {0}",
|
||||
info_mddf.machine_id).AppendLine();
|
||||
sb.AppendFormat("Serial number of Lisa computer that can use this volume's software {0}",
|
||||
info_mddf.serialization).AppendLine();
|
||||
|
||||
sb.AppendFormat("Volume created on {0}", info_mddf.dtvc).AppendLine();
|
||||
sb.AppendFormat("Some timestamp, says {0}", info_mddf.dtcc).AppendLine();
|
||||
@@ -344,7 +367,8 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
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).AppendLine();
|
||||
sb.AppendFormat("{0} blocks minus one minus MDDF offset",
|
||||
info_mddf.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();
|
||||
@@ -358,12 +382,12 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
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("S-Records start at {0} and spans for {1} blocks", info_mddf.srec_ptr + info_mddf.mddf_block + before_mddf, info_mddf.srec_len).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)
|
||||
.AppendLine();
|
||||
|
||||
if(info_mddf.vol_left_mounted == 0)
|
||||
sb.AppendLine("Volume is clean");
|
||||
else
|
||||
sb.AppendLine("Volume is dirty");
|
||||
if(info_mddf.vol_left_mounted == 0) sb.AppendLine("Volume is clean");
|
||||
else sb.AppendLine("Volume is dirty");
|
||||
|
||||
information = sb.ToString();
|
||||
|
||||
@@ -402,5 +426,4 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -90,4 +90,4 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
CurrentEncoding = new Claunia.Encoding.LisaRoman();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -371,7 +371,6 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
public ushort flags;
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The catalog entry for the V1 and V2 volume formats.
|
||||
/// It merely contains the file name, type and ID, plus a few (mostly empty) unknown fields.
|
||||
@@ -399,5 +398,4 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
public byte[] unknown3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -106,10 +106,8 @@ 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 = "";
|
||||
if(pString[0] <= 32) mddf.password = StringHandlers.PascalToString(pString, CurrentEncoding);
|
||||
else mddf.password = "";
|
||||
mddf.unknown2 = sector[0x4F];
|
||||
mddf.machine_id = BigEndianBitConverter.ToUInt32(sector, 0x50);
|
||||
mddf.master_copy_id = BigEndianBitConverter.ToUInt32(sector, 0x54);
|
||||
@@ -181,13 +179,11 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
mddf.vol_left_mounted = sector[0x138];
|
||||
|
||||
// Check that the MDDF is correct
|
||||
if(mddf.mddf_block != i - volumePrefix ||
|
||||
mddf.vol_size > device.GetSectors() ||
|
||||
mddf.vol_size - 1 != mddf.volsize_minus_one ||
|
||||
mddf.vol_size - i - 1 != mddf.volsize_minus_mddf_minus_one - volumePrefix ||
|
||||
mddf.datasize > mddf.blocksize ||
|
||||
mddf.blocksize < device.GetSectorSize() ||
|
||||
mddf.datasize != device.GetSectorSize())
|
||||
if(mddf.mddf_block != i - volumePrefix || mddf.vol_size > device.GetSectors() ||
|
||||
mddf.vol_size - 1 != mddf.volsize_minus_one ||
|
||||
mddf.vol_size - i - 1 != mddf.volsize_minus_mddf_minus_one - volumePrefix ||
|
||||
mddf.datasize > mddf.blocksize || mddf.blocksize < device.GetSectorSize() ||
|
||||
mddf.datasize != device.GetSectorSize())
|
||||
{
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "Incorrect MDDF found");
|
||||
return Errno.InvalidArgument;
|
||||
@@ -222,10 +218,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
mounted = true;
|
||||
this.debug = debug;
|
||||
|
||||
if(debug)
|
||||
{
|
||||
printedExtents = new List<short>();
|
||||
}
|
||||
if(debug) { printedExtents = new List<short>(); }
|
||||
|
||||
// Read the S-Records file
|
||||
error = ReadSRecords();
|
||||
@@ -243,7 +236,8 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
|
||||
if(error != Errno.NoError)
|
||||
{
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "Cannot read Catalog File, error {0}", error.ToString());
|
||||
DicConsole.DebugWriteLine("LisaFS plugin", "Cannot read Catalog File, error {0}",
|
||||
error.ToString());
|
||||
mounted = false;
|
||||
return error;
|
||||
}
|
||||
@@ -357,8 +351,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
/// <param name="stat">Information about the mounted volume.</param>
|
||||
public override Errno StatFs(ref FileSystemInfo stat)
|
||||
{
|
||||
if(!mounted)
|
||||
return Errno.AccessDenied;
|
||||
if(!mounted) return Errno.AccessDenied;
|
||||
|
||||
stat = new FileSystemInfo();
|
||||
stat.Blocks = mddf.vol_size;
|
||||
@@ -385,5 +378,4 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
return Errno.NoError;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -51,8 +51,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
short fileId;
|
||||
bool isDir;
|
||||
Errno error = LookupFileId(path, out fileId, out isDir);
|
||||
if(error != Errno.NoError)
|
||||
return error;
|
||||
if(error != Errno.NoError) return error;
|
||||
|
||||
return isDir ? Errno.InvalidArgument : ListXAttr(fileId, ref xattrs);
|
||||
}
|
||||
@@ -69,8 +68,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
short fileId;
|
||||
bool isDir;
|
||||
Errno error = LookupFileId(path, out fileId, out isDir);
|
||||
if(error != Errno.NoError)
|
||||
return error;
|
||||
if(error != Errno.NoError) return error;
|
||||
|
||||
return isDir ? Errno.InvalidArgument : GetXattr(fileId, xattr, out buf);
|
||||
}
|
||||
@@ -85,14 +83,12 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
{
|
||||
xattrs = null;
|
||||
|
||||
if(!mounted)
|
||||
return Errno.AccessDenied;
|
||||
if(!mounted) return Errno.AccessDenied;
|
||||
|
||||
// System files
|
||||
if(fileId < 4)
|
||||
{
|
||||
if(!debug || fileId == 0)
|
||||
return Errno.InvalidArgument;
|
||||
if(!debug || fileId == 0) return Errno.InvalidArgument;
|
||||
|
||||
xattrs = new List<string>();
|
||||
|
||||
@@ -102,8 +98,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
byte[] buf = Encoding.ASCII.GetBytes(mddf.password);
|
||||
|
||||
// If the MDDF contains a password, show it
|
||||
if(buf.Length > 0)
|
||||
xattrs.Add("com.apple.lisa.password");
|
||||
if(buf.Length > 0) xattrs.Add("com.apple.lisa.password");
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -112,27 +107,22 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
ExtentFile file;
|
||||
Errno error = ReadExtentsFile(fileId, out file);
|
||||
|
||||
if(error != Errno.NoError)
|
||||
return error;
|
||||
if(error != Errno.NoError) return error;
|
||||
|
||||
xattrs = new List<string>();
|
||||
|
||||
// Password field is never emptied, check if valid
|
||||
if(file.password_valid > 0)
|
||||
xattrs.Add("com.apple.lisa.password");
|
||||
if(file.password_valid > 0) xattrs.Add("com.apple.lisa.password");
|
||||
|
||||
// Check for a valid copy-protection serial number
|
||||
if(file.serial > 0)
|
||||
xattrs.Add("com.apple.lisa.serial");
|
||||
if(file.serial > 0) xattrs.Add("com.apple.lisa.serial");
|
||||
|
||||
// Check if the label contains something or is empty
|
||||
if(!ArrayHelpers.ArrayIsNullOrEmpty(file.LisaInfo))
|
||||
xattrs.Add("com.apple.lisa.label");
|
||||
if(!ArrayHelpers.ArrayIsNullOrEmpty(file.LisaInfo)) xattrs.Add("com.apple.lisa.label");
|
||||
}
|
||||
|
||||
// On debug mode allow sector tags to be accessed as an xattr
|
||||
if(debug)
|
||||
xattrs.Add("com.apple.lisa.tags");
|
||||
if(debug) xattrs.Add("com.apple.lisa.tags");
|
||||
|
||||
xattrs.Sort();
|
||||
|
||||
@@ -150,14 +140,12 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
{
|
||||
buf = null;
|
||||
|
||||
if(!mounted)
|
||||
return Errno.AccessDenied;
|
||||
if(!mounted) return Errno.AccessDenied;
|
||||
|
||||
// System files
|
||||
if(fileId < 4)
|
||||
{
|
||||
if(!debug || fileId == 0)
|
||||
return Errno.InvalidArgument;
|
||||
if(!debug || fileId == 0) return Errno.InvalidArgument;
|
||||
|
||||
// Only MDDF contains an extended attributes
|
||||
if(fileId == FILEID_MDDF)
|
||||
@@ -170,8 +158,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
}
|
||||
|
||||
// But on debug mode even system files contain tags
|
||||
if(debug && xattr == "com.apple.lisa.tags")
|
||||
return ReadSystemFile(fileId, out buf, true);
|
||||
if(debug && xattr == "com.apple.lisa.tags") return ReadSystemFile(fileId, out buf, true);
|
||||
|
||||
return Errno.NoSuchExtendedAttribute;
|
||||
}
|
||||
@@ -180,8 +167,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
ExtentFile file;
|
||||
Errno error = ReadExtentsFile(fileId, out file);
|
||||
|
||||
if(error != Errno.NoError)
|
||||
return error;
|
||||
if(error != Errno.NoError) return error;
|
||||
|
||||
if(xattr == "com.apple.lisa.password" && file.password_valid > 0)
|
||||
{
|
||||
@@ -203,8 +189,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
return Errno.NoError;
|
||||
}
|
||||
|
||||
if(debug && xattr == "com.apple.lisa.tags")
|
||||
return ReadFile(fileId, out buf, true);
|
||||
if(debug && xattr == "com.apple.lisa.tags") return ReadFile(fileId, out buf, true);
|
||||
|
||||
return Errno.NoSuchExtendedAttribute;
|
||||
}
|
||||
@@ -220,8 +205,7 @@ namespace DiscImageChef.Filesystems.LisaFS
|
||||
decoded = new LisaTag.PriamTag();
|
||||
LisaTag.PriamTag? pmTag = LisaTag.DecodeTag(tag);
|
||||
|
||||
if(!pmTag.HasValue)
|
||||
return Errno.InvalidArgument;
|
||||
if(!pmTag.HasValue) return Errno.InvalidArgument;
|
||||
|
||||
decoded = pmTag.Value;
|
||||
return Errno.NoError;
|
||||
|
||||
Reference in New Issue
Block a user