Update CICMMetadata version.

This commit is contained in:
2019-04-23 01:38:33 +01:00
parent 421ce1574b
commit ffd1cd6564
77 changed files with 2263 additions and 2230 deletions

View File

@@ -221,13 +221,13 @@ namespace DiscImageChef.CommonTypes.Structs
public class FileSystemInfo public class FileSystemInfo
{ {
/// <summary>Blocks for this filesystem</summary> /// <summary>Blocks for this filesystem</summary>
public long Blocks; public ulong Blocks;
/// <summary>Maximum length of filenames on this filesystem</summary> /// <summary>Maximum length of filenames on this filesystem</summary>
public ushort FilenameLength; public ushort FilenameLength;
/// <summary>Files on this filesystem</summary> /// <summary>Files on this filesystem</summary>
public ulong Files; public ulong Files;
/// <summary>Blocks free on this filesystem</summary> /// <summary>Blocks free on this filesystem</summary>
public long FreeBlocks; public ulong FreeBlocks;
/// <summary>Free inodes on this filesystem</summary> /// <summary>Free inodes on this filesystem</summary>
public ulong FreeFiles; public ulong FreeFiles;
/// <summary>Filesystem ID</summary> /// <summary>Filesystem ID</summary>

View File

@@ -553,7 +553,7 @@ namespace DiscImageChef.Core.Devices.Dumping
Descriptors = new DumpType Descriptors = new DumpType
{ {
Image = outputPath, Image = outputPath,
Size = dev.UsbDescriptors.Length, Size = (ulong)dev.UsbDescriptors.Length,
Checksums = Checksum.GetChecksums(dev.UsbDescriptors).ToArray() Checksums = Checksum.GetChecksums(dev.UsbDescriptors).ToArray()
} }
}; };
@@ -571,7 +571,7 @@ namespace DiscImageChef.Core.Devices.Dumping
CIS = new DumpType CIS = new DumpType
{ {
Image = outputPath, Image = outputPath,
Size = dev.Cis.Length, Size = (ulong)dev.Cis.Length,
Checksums = Checksum.GetChecksums(dev.Cis).ToArray() Checksums = Checksum.GetChecksums(dev.Cis).ToArray()
} }
}; };
@@ -622,7 +622,7 @@ namespace DiscImageChef.Core.Devices.Dumping
Identify = new DumpType Identify = new DumpType
{ {
Image = outputPath, Image = outputPath,
Size = cmdBuf.Length, Size = (ulong)cmdBuf.Length,
Checksums = Checksum.GetChecksums(cmdBuf).ToArray() Checksums = Checksum.GetChecksums(cmdBuf).ToArray()
} }
}; };
@@ -642,7 +642,7 @@ namespace DiscImageChef.Core.Devices.Dumping
filesystems.AddRange(from partition in sidecar.BlockMedia[0].FileSystemInformation filesystems.AddRange(from partition in sidecar.BlockMedia[0].FileSystemInformation
where partition.FileSystems != null where partition.FileSystems != null
from fileSystem in partition.FileSystems from fileSystem in partition.FileSystems
select ((ulong)partition.StartSector, fileSystem.Type)); select (partition.StartSector, fileSystem.Type));
if(filesystems.Count > 0) if(filesystems.Count > 0)
foreach(var filesystem in filesystems.Select(o => new {o.start, o.type}).Distinct()) foreach(var filesystem in filesystems.Select(o => new {o.start, o.type}).Distinct())
@@ -666,13 +666,13 @@ namespace DiscImageChef.Core.Devices.Dumping
sidecar.BlockMedia[0].DiskType = xmlDskTyp; sidecar.BlockMedia[0].DiskType = xmlDskTyp;
sidecar.BlockMedia[0].DiskSubType = xmlDskSubTyp; sidecar.BlockMedia[0].DiskSubType = xmlDskSubTyp;
sidecar.BlockMedia[0].Interface = "ATA"; sidecar.BlockMedia[0].Interface = "ATA";
sidecar.BlockMedia[0].LogicalBlocks = (long)blocks; sidecar.BlockMedia[0].LogicalBlocks = blocks;
sidecar.BlockMedia[0].PhysicalBlockSize = (int)physicalsectorsize; sidecar.BlockMedia[0].PhysicalBlockSize = physicalsectorsize;
sidecar.BlockMedia[0].LogicalBlockSize = (int)blockSize; sidecar.BlockMedia[0].LogicalBlockSize = blockSize;
sidecar.BlockMedia[0].Manufacturer = dev.Manufacturer; sidecar.BlockMedia[0].Manufacturer = dev.Manufacturer;
sidecar.BlockMedia[0].Model = dev.Model; sidecar.BlockMedia[0].Model = dev.Model;
sidecar.BlockMedia[0].Serial = dev.Serial; sidecar.BlockMedia[0].Serial = dev.Serial;
sidecar.BlockMedia[0].Size = (long)(blocks * blockSize); sidecar.BlockMedia[0].Size = blocks * blockSize;
if(cylinders > 0 && heads > 0 && sectors > 0) if(cylinders > 0 && heads > 0 && sectors > 0)
{ {
sidecar.BlockMedia[0].Cylinders = cylinders; sidecar.BlockMedia[0].Cylinders = cylinders;

View File

@@ -585,7 +585,7 @@ namespace DiscImageChef.Core.Devices.Dumping
sidecar.OpticalDisc[0].PFI = new DumpType sidecar.OpticalDisc[0].PFI = new DumpType
{ {
Image = outputPath, Image = outputPath,
Size = tag.Value.Length, Size = (ulong)tag.Value.Length,
Checksums = Checksum.GetChecksums(tag.Value).ToArray() Checksums = Checksum.GetChecksums(tag.Value).ToArray()
}; };
break; break;
@@ -593,7 +593,7 @@ namespace DiscImageChef.Core.Devices.Dumping
sidecar.OpticalDisc[0].DMI = new DumpType sidecar.OpticalDisc[0].DMI = new DumpType
{ {
Image = outputPath, Image = outputPath,
Size = tag.Value.Length, Size = (ulong)tag.Value.Length,
Checksums = Checksum.GetChecksums(tag.Value).ToArray() Checksums = Checksum.GetChecksums(tag.Value).ToArray()
}; };
break; break;
@@ -602,7 +602,7 @@ namespace DiscImageChef.Core.Devices.Dumping
sidecar.OpticalDisc[0].CMI = new DumpType sidecar.OpticalDisc[0].CMI = new DumpType
{ {
Image = outputPath, Image = outputPath,
Size = tag.Value.Length, Size = (ulong)tag.Value.Length,
Checksums = Checksum.GetChecksums(tag.Value).ToArray() Checksums = Checksum.GetChecksums(tag.Value).ToArray()
}; };
@@ -621,7 +621,7 @@ namespace DiscImageChef.Core.Devices.Dumping
sidecar.OpticalDisc[0].BCA = new DumpType sidecar.OpticalDisc[0].BCA = new DumpType
{ {
Image = outputPath, Image = outputPath,
Size = tag.Value.Length, Size = (ulong)tag.Value.Length,
Checksums = Checksum.GetChecksums(tag.Value).ToArray() Checksums = Checksum.GetChecksums(tag.Value).ToArray()
}; };
break; break;
@@ -630,7 +630,7 @@ namespace DiscImageChef.Core.Devices.Dumping
sidecar.OpticalDisc[0].DDS = new DumpType sidecar.OpticalDisc[0].DDS = new DumpType
{ {
Image = outputPath, Image = outputPath,
Size = tag.Value.Length, Size = (ulong)tag.Value.Length,
Checksums = Checksum.GetChecksums(tag.Value).ToArray() Checksums = Checksum.GetChecksums(tag.Value).ToArray()
}; };
break; break;
@@ -639,7 +639,7 @@ namespace DiscImageChef.Core.Devices.Dumping
sidecar.OpticalDisc[0].SAI = new DumpType sidecar.OpticalDisc[0].SAI = new DumpType
{ {
Image = outputPath, Image = outputPath,
Size = tag.Value.Length, Size = (ulong)tag.Value.Length,
Checksums = Checksum.GetChecksums(tag.Value).ToArray() Checksums = Checksum.GetChecksums(tag.Value).ToArray()
}; };
break; break;
@@ -647,7 +647,7 @@ namespace DiscImageChef.Core.Devices.Dumping
sidecar.OpticalDisc[0].PRI = new DumpType sidecar.OpticalDisc[0].PRI = new DumpType
{ {
Image = outputPath, Image = outputPath,
Size = tag.Value.Length, Size = (ulong)tag.Value.Length,
Checksums = Checksum.GetChecksums(tag.Value).ToArray() Checksums = Checksum.GetChecksums(tag.Value).ToArray()
}; };
break; break;
@@ -655,7 +655,7 @@ namespace DiscImageChef.Core.Devices.Dumping
sidecar.OpticalDisc[0].MediaID = new DumpType sidecar.OpticalDisc[0].MediaID = new DumpType
{ {
Image = outputPath, Image = outputPath,
Size = tag.Value.Length, Size = (ulong)tag.Value.Length,
Checksums = Checksum.GetChecksums(tag.Value).ToArray() Checksums = Checksum.GetChecksums(tag.Value).ToArray()
}; };
break; break;
@@ -663,7 +663,7 @@ namespace DiscImageChef.Core.Devices.Dumping
sidecar.OpticalDisc[0].PFIR = new DumpType sidecar.OpticalDisc[0].PFIR = new DumpType
{ {
Image = outputPath, Image = outputPath,
Size = tag.Value.Length, Size = (ulong)tag.Value.Length,
Checksums = Checksum.GetChecksums(tag.Value).ToArray() Checksums = Checksum.GetChecksums(tag.Value).ToArray()
}; };
break; break;
@@ -671,7 +671,7 @@ namespace DiscImageChef.Core.Devices.Dumping
sidecar.OpticalDisc[0].ADIP = new DumpType sidecar.OpticalDisc[0].ADIP = new DumpType
{ {
Image = outputPath, Image = outputPath,
Size = tag.Value.Length, Size = (ulong)tag.Value.Length,
Checksums = Checksum.GetChecksums(tag.Value).ToArray() Checksums = Checksum.GetChecksums(tag.Value).ToArray()
}; };
break; break;
@@ -679,7 +679,7 @@ namespace DiscImageChef.Core.Devices.Dumping
sidecar.OpticalDisc[0].DCB = new DumpType sidecar.OpticalDisc[0].DCB = new DumpType
{ {
Image = outputPath, Image = outputPath,
Size = tag.Value.Length, Size = (ulong)tag.Value.Length,
Checksums = Checksum.GetChecksums(tag.Value).ToArray() Checksums = Checksum.GetChecksums(tag.Value).ToArray()
}; };
break; break;
@@ -687,7 +687,7 @@ namespace DiscImageChef.Core.Devices.Dumping
sidecar.OpticalDisc[0].DI = new DumpType sidecar.OpticalDisc[0].DI = new DumpType
{ {
Image = outputPath, Image = outputPath,
Size = tag.Value.Length, Size = (ulong)tag.Value.Length,
Checksums = Checksum.GetChecksums(tag.Value).ToArray() Checksums = Checksum.GetChecksums(tag.Value).ToArray()
}; };
break; break;
@@ -703,7 +703,7 @@ namespace DiscImageChef.Core.Devices.Dumping
SecuritySectors = new DumpType SecuritySectors = new DumpType
{ {
Image = outputPath, Image = outputPath,
Size = tag.Value.Length, Size = (ulong)tag.Value.Length,
Checksums = Checksum.GetChecksums(tag.Value).ToArray() Checksums = Checksum.GetChecksums(tag.Value).ToArray()
} }
} }
@@ -716,7 +716,7 @@ namespace DiscImageChef.Core.Devices.Dumping
sidecar.OpticalDisc[0].Xbox.PFI = new DumpType sidecar.OpticalDisc[0].Xbox.PFI = new DumpType
{ {
Image = outputPath, Image = outputPath,
Size = tag.Value.Length, Size = (ulong)tag.Value.Length,
Checksums = Checksum.GetChecksums(tag.Value).ToArray() Checksums = Checksum.GetChecksums(tag.Value).ToArray()
}; };
break; break;
@@ -726,7 +726,7 @@ namespace DiscImageChef.Core.Devices.Dumping
sidecar.OpticalDisc[0].Xbox.DMI = new DumpType sidecar.OpticalDisc[0].Xbox.DMI = new DumpType
{ {
Image = outputPath, Image = outputPath,
Size = tag.Value.Length, Size = (ulong)tag.Value.Length,
Checksums = Checksum.GetChecksums(tag.Value).ToArray() Checksums = Checksum.GetChecksums(tag.Value).ToArray()
}; };
break; break;
@@ -734,7 +734,7 @@ namespace DiscImageChef.Core.Devices.Dumping
sidecar.OpticalDisc[0].TOC = new DumpType sidecar.OpticalDisc[0].TOC = new DumpType
{ {
Image = outputPath, Image = outputPath,
Size = tag.Value.Length, Size = (ulong)tag.Value.Length,
Checksums = Checksum.GetChecksums(tag.Value).ToArray() Checksums = Checksum.GetChecksums(tag.Value).ToArray()
}; };
break; break;
@@ -742,7 +742,7 @@ namespace DiscImageChef.Core.Devices.Dumping
sidecar.OpticalDisc[0].ATIP = new DumpType sidecar.OpticalDisc[0].ATIP = new DumpType
{ {
Image = outputPath, Image = outputPath,
Size = tag.Value.Length, Size = (ulong)tag.Value.Length,
Checksums = Checksum.GetChecksums(tag.Value).ToArray() Checksums = Checksum.GetChecksums(tag.Value).ToArray()
}; };
break; break;
@@ -750,7 +750,7 @@ namespace DiscImageChef.Core.Devices.Dumping
sidecar.OpticalDisc[0].PMA = new DumpType sidecar.OpticalDisc[0].PMA = new DumpType
{ {
Image = outputPath, Image = outputPath,
Size = tag.Value.Length, Size = (ulong)tag.Value.Length,
Checksums = Checksum.GetChecksums(tag.Value).ToArray() Checksums = Checksum.GetChecksums(tag.Value).ToArray()
}; };
break; break;
@@ -758,17 +758,28 @@ namespace DiscImageChef.Core.Devices.Dumping
sidecar.OpticalDisc[0].LeadInCdText = new DumpType sidecar.OpticalDisc[0].LeadInCdText = new DumpType
{ {
Image = outputPath, Image = outputPath,
Size = tag.Value.Length, Size = (ulong)tag.Value.Length,
Checksums = Checksum.GetChecksums(tag.Value).ToArray() Checksums = Checksum.GetChecksums(tag.Value).ToArray()
}; };
break; break;
case MediaTagType.CD_FirstTrackPregap: case MediaTagType.CD_FirstTrackPregap:
sidecar.OpticalDisc[0].FirstTrackPregrap = new[]
{
new BorderType
{
Image = outputPath,
Size = (ulong)tag.Value.Length,
Checksums = Checksum.GetChecksums(tag.Value).ToArray()
}
};
break;
case MediaTagType.CD_LeadIn:
sidecar.OpticalDisc[0].LeadIn = new[] sidecar.OpticalDisc[0].LeadIn = new[]
{ {
new BorderType new BorderType
{ {
Image = outputPath, Image = outputPath,
Size = tag.Value.Length, Size = (ulong)tag.Value.Length,
Checksums = Checksum.GetChecksums(tag.Value).ToArray() Checksums = Checksum.GetChecksums(tag.Value).ToArray()
} }
}; };

View File

@@ -863,7 +863,7 @@ namespace DiscImageChef.Core.Devices.Dumping
from partition in xmlTrack.FileSystemInformation from partition in xmlTrack.FileSystemInformation
where partition.FileSystems != null where partition.FileSystems != null
from fileSystem in partition.FileSystems from fileSystem in partition.FileSystems
select ((ulong)partition.StartSector, fileSystem.Type)); select (partition.StartSector, fileSystem.Type));
if(filesystems.Count > 0) if(filesystems.Count > 0)
foreach(var filesystem in filesystems.Select(o => new {o.start, o.type}).Distinct()) foreach(var filesystem in filesystems.Select(o => new {o.start, o.type}).Distinct())
@@ -904,7 +904,7 @@ namespace DiscImageChef.Core.Devices.Dumping
Descriptors = new DumpType Descriptors = new DumpType
{ {
Image = outputPath, Image = outputPath,
Size = dev.UsbDescriptors.Length, Size = (ulong)dev.UsbDescriptors.Length,
Checksums = Checksum.GetChecksums(dev.UsbDescriptors).ToArray() Checksums = Checksum.GetChecksums(dev.UsbDescriptors).ToArray()
} }
}; };
@@ -920,7 +920,7 @@ namespace DiscImageChef.Core.Devices.Dumping
Identify = new DumpType Identify = new DumpType
{ {
Image = outputPath, Image = outputPath,
Size = cmdBuf.Length, Size = (ulong)cmdBuf.Length,
Checksums = Checksum.GetChecksums(cmdBuf).ToArray() Checksums = Checksum.GetChecksums(cmdBuf).ToArray()
} }
}; };
@@ -935,7 +935,7 @@ namespace DiscImageChef.Core.Devices.Dumping
Inquiry = new DumpType Inquiry = new DumpType
{ {
Image = outputPath, Image = outputPath,
Size = cmdBuf.Length, Size = (ulong)cmdBuf.Length,
Checksums = Checksum.GetChecksums(cmdBuf).ToArray() Checksums = Checksum.GetChecksums(cmdBuf).ToArray()
} }
}; };
@@ -990,7 +990,7 @@ namespace DiscImageChef.Core.Devices.Dumping
sidecar.BlockMedia[0].SCSI.ModeSense10 = new DumpType sidecar.BlockMedia[0].SCSI.ModeSense10 = new DumpType
{ {
Image = outputPath, Image = outputPath,
Size = cmdBuf.Length, Size = (ulong)cmdBuf.Length,
Checksums = Checksum.GetChecksums(cmdBuf).ToArray() Checksums = Checksum.GetChecksums(cmdBuf).ToArray()
}; };
@@ -1009,7 +1009,7 @@ namespace DiscImageChef.Core.Devices.Dumping
sidecar.BlockMedia[0].SCSI.ModeSense = new DumpType sidecar.BlockMedia[0].SCSI.ModeSense = new DumpType
{ {
Image = outputPath, Image = outputPath,
Size = cmdBuf.Length, Size = (ulong)cmdBuf.Length,
Checksums = Checksum.GetChecksums(cmdBuf).ToArray() Checksums = Checksum.GetChecksums(cmdBuf).ToArray()
}; };
} }
@@ -1020,7 +1020,7 @@ namespace DiscImageChef.Core.Devices.Dumping
filesystems.AddRange(from partition in sidecar.BlockMedia[0].FileSystemInformation filesystems.AddRange(from partition in sidecar.BlockMedia[0].FileSystemInformation
where partition.FileSystems != null where partition.FileSystems != null
from fileSystem in partition.FileSystems from fileSystem in partition.FileSystems
select ((ulong)partition.StartSector, fileSystem.Type)); select (partition.StartSector, fileSystem.Type));
if(filesystems.Count > 0) if(filesystems.Count > 0)
foreach(var filesystem in filesystems.Select(o => new {o.start, o.type}).Distinct()) foreach(var filesystem in filesystems.Select(o => new {o.start, o.type}).Distinct())
@@ -1040,13 +1040,13 @@ namespace DiscImageChef.Core.Devices.Dumping
else if(dev.IsUsb) sidecar.BlockMedia[0].Interface = "USB"; else if(dev.IsUsb) sidecar.BlockMedia[0].Interface = "USB";
else if(dev.IsFireWire) sidecar.BlockMedia[0].Interface = "FireWire"; else if(dev.IsFireWire) sidecar.BlockMedia[0].Interface = "FireWire";
else sidecar.BlockMedia[0].Interface = "SCSI"; else sidecar.BlockMedia[0].Interface = "SCSI";
sidecar.BlockMedia[0].LogicalBlocks = (long)blocks; sidecar.BlockMedia[0].LogicalBlocks = blocks;
sidecar.BlockMedia[0].PhysicalBlockSize = (int)physicalBlockSize; sidecar.BlockMedia[0].PhysicalBlockSize = physicalBlockSize;
sidecar.BlockMedia[0].LogicalBlockSize = (int)logicalBlockSize; sidecar.BlockMedia[0].LogicalBlockSize = logicalBlockSize;
sidecar.BlockMedia[0].Manufacturer = dev.Manufacturer; sidecar.BlockMedia[0].Manufacturer = dev.Manufacturer;
sidecar.BlockMedia[0].Model = dev.Model; sidecar.BlockMedia[0].Model = dev.Model;
sidecar.BlockMedia[0].Serial = dev.Serial; sidecar.BlockMedia[0].Serial = dev.Serial;
sidecar.BlockMedia[0].Size = (long)(blocks * blockSize); sidecar.BlockMedia[0].Size = blocks * blockSize;
if(dev.IsRemovable) sidecar.BlockMedia[0].DumpHardwareArray = resume.Tries.ToArray(); if(dev.IsRemovable) sidecar.BlockMedia[0].DumpHardwareArray = resume.Tries.ToArray();
} }

View File

@@ -231,7 +231,7 @@ namespace DiscImageChef.Core.Devices.Dumping
sidecar.BlockMedia[0].SCSI.ModeSense10 = new DumpType sidecar.BlockMedia[0].SCSI.ModeSense10 = new DumpType
{ {
Image = outputPrefix + ".modesense10.bin", Image = outputPrefix + ".modesense10.bin",
Size = cmdBuf.Length, Size = (ulong)cmdBuf.Length,
Checksums = Checksum.GetChecksums(cmdBuf).ToArray() Checksums = Checksum.GetChecksums(cmdBuf).ToArray()
}; };
DataFile.WriteTo("SCSI Dump", sidecar.BlockMedia[0].SCSI.ModeSense10.Image, cmdBuf); DataFile.WriteTo("SCSI Dump", sidecar.BlockMedia[0].SCSI.ModeSense10.Image, cmdBuf);
@@ -252,7 +252,7 @@ namespace DiscImageChef.Core.Devices.Dumping
sidecar.BlockMedia[0].SCSI.ModeSense = new DumpType sidecar.BlockMedia[0].SCSI.ModeSense = new DumpType
{ {
Image = outputPrefix + ".modesense.bin", Image = outputPrefix + ".modesense.bin",
Size = cmdBuf.Length, Size = (ulong)cmdBuf.Length,
Checksums = Checksum.GetChecksums(cmdBuf).ToArray() Checksums = Checksum.GetChecksums(cmdBuf).ToArray()
}; };
DataFile.WriteTo("SCSI Dump", sidecar.BlockMedia[0].SCSI.ModeSense.Image, cmdBuf); DataFile.WriteTo("SCSI Dump", sidecar.BlockMedia[0].SCSI.ModeSense.Image, cmdBuf);
@@ -379,12 +379,12 @@ namespace DiscImageChef.Core.Devices.Dumping
Image = new ImageType Image = new ImageType
{ {
format = "BINARY", format = "BINARY",
offset = (long)currentSize, offset = currentSize,
offsetSpecified = true, offsetSpecified = true,
Value = outputPrefix + ".bin" Value = outputPrefix + ".bin"
}, },
Sequence = (long)currentFile, Sequence = currentFile,
StartBlock = (long)currentBlock, StartBlock = currentBlock,
BlockSize = blockSize BlockSize = blockSize
}; };
Checksum fileChk = new Checksum(); Checksum fileChk = new Checksum();
@@ -393,12 +393,12 @@ namespace DiscImageChef.Core.Devices.Dumping
Image = new ImageType Image = new ImageType
{ {
format = "BINARY", format = "BINARY",
offset = (long)currentSize, offset = currentSize,
offsetSpecified = true, offsetSpecified = true,
Value = outputPrefix + ".bin" Value = outputPrefix + ".bin"
}, },
Sequence = currentPartition, Sequence = currentPartition,
StartBlock = (long)currentBlock StartBlock = currentBlock
}; };
Checksum partitionChk = new Checksum(); Checksum partitionChk = new Checksum();
@@ -421,8 +421,8 @@ namespace DiscImageChef.Core.Devices.Dumping
dumpLog.WriteLine("Finished partition {0}", currentPartition); dumpLog.WriteLine("Finished partition {0}", currentPartition);
currentTapePartition.File = files.ToArray(); currentTapePartition.File = files.ToArray();
currentTapePartition.Checksums = partitionChk.End().ToArray(); currentTapePartition.Checksums = partitionChk.End().ToArray();
currentTapePartition.EndBlock = (long)(currentBlock - 1); currentTapePartition.EndBlock = currentBlock - 1;
currentTapePartition.Size = (long)currentPartitionSize; currentTapePartition.Size = currentPartitionSize;
partitions.Add(currentTapePartition); partitions.Add(currentTapePartition);
currentPartition++; currentPartition++;
@@ -435,12 +435,12 @@ namespace DiscImageChef.Core.Devices.Dumping
Image = new ImageType Image = new ImageType
{ {
format = "BINARY", format = "BINARY",
offset = (long)currentSize, offset = currentSize,
offsetSpecified = true, offsetSpecified = true,
Value = outputPrefix + ".bin" Value = outputPrefix + ".bin"
}, },
Sequence = (long)currentFile, Sequence = currentFile,
StartBlock = (long)currentBlock, StartBlock = currentBlock,
BlockSize = blockSize BlockSize = blockSize
}; };
currentFileSize = 0; currentFileSize = 0;
@@ -451,12 +451,12 @@ namespace DiscImageChef.Core.Devices.Dumping
Image = new ImageType Image = new ImageType
{ {
format = "BINARY", format = "BINARY",
offset = (long)currentSize, offset = currentSize,
offsetSpecified = true, offsetSpecified = true,
Value = outputPrefix + ".bin" Value = outputPrefix + ".bin"
}, },
Sequence = currentPartition, Sequence = currentPartition,
StartBlock = (long)currentBlock StartBlock = currentBlock
}; };
currentPartitionSize = 0; currentPartitionSize = 0;
partitionChk = new Checksum(); partitionChk = new Checksum();
@@ -551,8 +551,8 @@ namespace DiscImageChef.Core.Devices.Dumping
(fxSense.Value.ASCQ == 0x01 || fxSense.Value.Filemark)) (fxSense.Value.ASCQ == 0x01 || fxSense.Value.Filemark))
{ {
currentTapeFile.Checksums = fileChk.End().ToArray(); currentTapeFile.Checksums = fileChk.End().ToArray();
currentTapeFile.EndBlock = (long)(currentBlock - 1); currentTapeFile.EndBlock = currentBlock - 1;
currentTapeFile.Size = (long)currentFileSize; currentTapeFile.Size = currentFileSize;
files.Add(currentTapeFile); files.Add(currentTapeFile);
currentFile++; currentFile++;
@@ -561,12 +561,12 @@ namespace DiscImageChef.Core.Devices.Dumping
Image = new ImageType Image = new ImageType
{ {
format = "BINARY", format = "BINARY",
offset = (long)currentSize, offset = currentSize,
offsetSpecified = true, offsetSpecified = true,
Value = outputPrefix + ".bin" Value = outputPrefix + ".bin"
}, },
Sequence = (long)currentFile, Sequence = currentFile,
StartBlock = (long)currentBlock, StartBlock = currentBlock,
BlockSize = blockSize BlockSize = blockSize
}; };
currentFileSize = 0; currentFileSize = 0;
@@ -644,8 +644,8 @@ namespace DiscImageChef.Core.Devices.Dumping
{ {
format = "Raw disk image (sector by sector copy)", Value = outputPrefix + ".bin" format = "Raw disk image (sector by sector copy)", Value = outputPrefix + ".bin"
}; };
sidecar.BlockMedia[0].LogicalBlocks = (long)blocks; sidecar.BlockMedia[0].LogicalBlocks = blocks;
sidecar.BlockMedia[0].Size = (long)currentSize; sidecar.BlockMedia[0].Size = currentSize;
sidecar.BlockMedia[0].DumpHardwareArray = new DumpHardwareType[1]; sidecar.BlockMedia[0].DumpHardwareArray = new DumpHardwareType[1];
sidecar.BlockMedia[0].DumpHardwareArray[0] = sidecar.BlockMedia[0].DumpHardwareArray[0] =
new DumpHardwareType {Extents = new ExtentType[1]}; new DumpHardwareType {Extents = new ExtentType[1]};

View File

@@ -82,7 +82,7 @@ namespace DiscImageChef.Core.Devices.Dumping
byte[] ocr = null; byte[] ocr = null;
byte[] ecsd = null; byte[] ecsd = null;
byte[] scr = null; byte[] scr = null;
int physicalBlockSize = 0; uint physicalBlockSize = 0;
bool byteAddressed = true; bool byteAddressed = true;
Dictionary<MediaTagType, byte[]> mediaTags = new Dictionary<MediaTagType, byte[]>(); Dictionary<MediaTagType, byte[]> mediaTags = new Dictionary<MediaTagType, byte[]>();
@@ -513,7 +513,9 @@ namespace DiscImageChef.Core.Devices.Dumping
{ {
cidDump = new DumpType cidDump = new DumpType
{ {
Image = outputPath, Size = cid.Length, Checksums = Checksum.GetChecksums(cid).ToArray() Image = outputPath,
Size = (ulong)cid.Length,
Checksums = Checksum.GetChecksums(cid).ToArray()
}; };
ret = ret =
@@ -536,7 +538,9 @@ namespace DiscImageChef.Core.Devices.Dumping
{ {
csdDump = new DumpType csdDump = new DumpType
{ {
Image = outputPath, Size = csd.Length, Checksums = Checksum.GetChecksums(csd).ToArray() Image = outputPath,
Size = (ulong)csd.Length,
Checksums = Checksum.GetChecksums(csd).ToArray()
}; };
ret = ret =
@@ -559,7 +563,9 @@ namespace DiscImageChef.Core.Devices.Dumping
{ {
sidecar.BlockMedia[0].MultiMediaCard.ExtendedCSD = new DumpType sidecar.BlockMedia[0].MultiMediaCard.ExtendedCSD = new DumpType
{ {
Image = outputPath, Size = ecsd.Length, Checksums = Checksum.GetChecksums(ecsd).ToArray() Image = outputPath,
Size = (ulong)ecsd.Length,
Checksums = Checksum.GetChecksums(ecsd).ToArray()
}; };
ret = outputPlugin.WriteMediaTag(ecsd, MediaTagType.MMC_ExtendedCSD); ret = outputPlugin.WriteMediaTag(ecsd, MediaTagType.MMC_ExtendedCSD);
@@ -579,7 +585,9 @@ namespace DiscImageChef.Core.Devices.Dumping
{ {
ocrDump = new DumpType ocrDump = new DumpType
{ {
Image = outputPath, Size = ocr.Length, Checksums = Checksum.GetChecksums(ocr).ToArray() Image = outputPath,
Size = (ulong)ocr.Length,
Checksums = Checksum.GetChecksums(ocr).ToArray()
}; };
ret = ret =
@@ -602,7 +610,9 @@ namespace DiscImageChef.Core.Devices.Dumping
{ {
sidecar.BlockMedia[0].SecureDigital.SCR = new DumpType sidecar.BlockMedia[0].SecureDigital.SCR = new DumpType
{ {
Image = outputPath, Size = scr.Length, Checksums = Checksum.GetChecksums(scr).ToArray() Image = outputPath,
Size = (ulong)scr.Length,
Checksums = Checksum.GetChecksums(scr).ToArray()
}; };
ret = outputPlugin.WriteMediaTag(scr, MediaTagType.SD_SCR); ret = outputPlugin.WriteMediaTag(scr, MediaTagType.SD_SCR);
@@ -659,13 +669,13 @@ namespace DiscImageChef.Core.Devices.Dumping
sidecar.BlockMedia[0].DiskType = xmlDskTyp; sidecar.BlockMedia[0].DiskType = xmlDskTyp;
sidecar.BlockMedia[0].DiskSubType = xmlDskSubTyp; sidecar.BlockMedia[0].DiskSubType = xmlDskSubTyp;
// TODO: Implement device firmware revision // TODO: Implement device firmware revision
sidecar.BlockMedia[0].LogicalBlocks = (long)blocks; sidecar.BlockMedia[0].LogicalBlocks = blocks;
sidecar.BlockMedia[0].PhysicalBlockSize = physicalBlockSize > 0 ? physicalBlockSize : (int)blockSize; sidecar.BlockMedia[0].PhysicalBlockSize = physicalBlockSize > 0 ? physicalBlockSize : blockSize;
sidecar.BlockMedia[0].LogicalBlockSize = (int)blockSize; sidecar.BlockMedia[0].LogicalBlockSize = blockSize;
sidecar.BlockMedia[0].Manufacturer = dev.Manufacturer; sidecar.BlockMedia[0].Manufacturer = dev.Manufacturer;
sidecar.BlockMedia[0].Model = dev.Model; sidecar.BlockMedia[0].Model = dev.Model;
sidecar.BlockMedia[0].Serial = dev.Serial; sidecar.BlockMedia[0].Serial = dev.Serial;
sidecar.BlockMedia[0].Size = (long)(blocks * blockSize); sidecar.BlockMedia[0].Size = blocks * blockSize;
UpdateStatus?.Invoke("Writing metadata sidecar"); UpdateStatus?.Invoke("Writing metadata sidecar");

View File

@@ -964,7 +964,7 @@ namespace DiscImageChef.Core.Devices.Dumping
from partition in xmlTrack.FileSystemInformation from partition in xmlTrack.FileSystemInformation
where partition.FileSystems != null where partition.FileSystems != null
from fileSystem in partition.FileSystems from fileSystem in partition.FileSystems
select ((ulong)partition.StartSector, fileSystem.Type)); select (partition.StartSector, fileSystem.Type));
if(filesystems.Count > 0) if(filesystems.Count > 0)
foreach(var filesystem in filesystems.Select(o => new {o.start, o.type}).Distinct()) foreach(var filesystem in filesystems.Select(o => new {o.start, o.type}).Distinct())
@@ -977,7 +977,7 @@ namespace DiscImageChef.Core.Devices.Dumping
{ {
type = LayersTypeType.OTP, typeSpecified = true, Sectors = new SectorsType[1] type = LayersTypeType.OTP, typeSpecified = true, Sectors = new SectorsType[1]
}; };
sidecar.OpticalDisc[0].Layers.Sectors[0] = new SectorsType {Value = (long)layerBreak}; sidecar.OpticalDisc[0].Layers.Sectors[0] = new SectorsType {Value = layerBreak};
sidecar.OpticalDisc[0].Sessions = 1; sidecar.OpticalDisc[0].Sessions = 1;
sidecar.OpticalDisc[0].Dimensions = Dimensions.DimensionsFromMediaType(dskType); sidecar.OpticalDisc[0].Dimensions = Dimensions.DimensionsFromMediaType(dskType);
CommonTypes.Metadata.MediaType.MediaTypeToString(dskType, out string xmlDskTyp, CommonTypes.Metadata.MediaType.MediaTypeToString(dskType, out string xmlDskTyp,

View File

@@ -69,15 +69,15 @@ namespace DiscImageChef.Core
offsetSpecified = true, offsetSpecified = true,
Value = Path.GetFileName(imagePath) Value = Path.GetFileName(imagePath)
}, },
Size = fi.Length, Size = (ulong)fi.Length,
Sequence = new SequenceType {MediaTitle = image.Info.MediaTitle} Sequence = new SequenceType {MediaTitle = image.Info.MediaTitle}
} }
}; };
if(image.Info.MediaSequence != 0 && image.Info.LastMediaSequence != 0) if(image.Info.MediaSequence != 0 && image.Info.LastMediaSequence != 0)
{ {
sidecar.AudioMedia[0].Sequence.MediaSequence = image.Info.MediaSequence; sidecar.AudioMedia[0].Sequence.MediaSequence = (uint)image.Info.MediaSequence;
sidecar.AudioMedia[0].Sequence.TotalMedia = image.Info.LastMediaSequence; sidecar.AudioMedia[0].Sequence.TotalMedia = (uint)image.Info.LastMediaSequence;
} }
else else
{ {

View File

@@ -80,15 +80,15 @@ namespace DiscImageChef.Core
offsetSpecified = true, offsetSpecified = true,
Value = Path.GetFileName(imagePath) Value = Path.GetFileName(imagePath)
}, },
Size = fi.Length, Size = (ulong)fi.Length,
Sequence = new SequenceType {MediaTitle = image.Info.MediaTitle} Sequence = new SequenceType {MediaTitle = image.Info.MediaTitle}
} }
}; };
if(image.Info.MediaSequence != 0 && image.Info.LastMediaSequence != 0) if(image.Info.MediaSequence != 0 && image.Info.LastMediaSequence != 0)
{ {
sidecar.BlockMedia[0].Sequence.MediaSequence = image.Info.MediaSequence; sidecar.BlockMedia[0].Sequence.MediaSequence = (uint)image.Info.MediaSequence;
sidecar.BlockMedia[0].Sequence.TotalMedia = image.Info.LastMediaSequence; sidecar.BlockMedia[0].Sequence.TotalMedia = (uint)image.Info.LastMediaSequence;
} }
else else
{ {
@@ -111,7 +111,7 @@ namespace DiscImageChef.Core
Checksums = Checksums =
Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.ATAPI_IDENTIFY)) Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.ATAPI_IDENTIFY))
.ToArray(), .ToArray(),
Size = image.ReadDiskTag(MediaTagType.ATAPI_IDENTIFY).Length Size = (ulong)image.ReadDiskTag(MediaTagType.ATAPI_IDENTIFY).Length
} }
}; };
break; break;
@@ -123,7 +123,7 @@ namespace DiscImageChef.Core
Checksums = Checksum Checksums = Checksum
.GetChecksums(image.ReadDiskTag(MediaTagType.ATA_IDENTIFY)) .GetChecksums(image.ReadDiskTag(MediaTagType.ATA_IDENTIFY))
.ToArray(), .ToArray(),
Size = image.ReadDiskTag(MediaTagType.ATA_IDENTIFY).Length Size = (ulong)image.ReadDiskTag(MediaTagType.ATA_IDENTIFY).Length
} }
}; };
break; break;
@@ -131,7 +131,10 @@ namespace DiscImageChef.Core
byte[] cis = image.ReadDiskTag(MediaTagType.PCMCIA_CIS); byte[] cis = image.ReadDiskTag(MediaTagType.PCMCIA_CIS);
sidecar.BlockMedia[0].PCMCIA = new PCMCIAType sidecar.BlockMedia[0].PCMCIA = new PCMCIAType
{ {
CIS = new DumpType {Checksums = Checksum.GetChecksums(cis).ToArray(), Size = cis.Length} CIS = new DumpType
{
Checksums = Checksum.GetChecksums(cis).ToArray(), Size = (ulong)cis.Length
}
}; };
Tuple[] tuples = CIS.GetTuples(cis); Tuple[] tuples = CIS.GetTuples(cis);
if(tuples != null) if(tuples != null)
@@ -177,7 +180,7 @@ namespace DiscImageChef.Core
Checksums = Checksum Checksums = Checksum
.GetChecksums(image.ReadDiskTag(MediaTagType.SCSI_INQUIRY)) .GetChecksums(image.ReadDiskTag(MediaTagType.SCSI_INQUIRY))
.ToArray(), .ToArray(),
Size = image.ReadDiskTag(MediaTagType.SCSI_INQUIRY).Length Size = (ulong)image.ReadDiskTag(MediaTagType.SCSI_INQUIRY).Length
} }
}; };
break; break;
@@ -187,7 +190,7 @@ namespace DiscImageChef.Core
sidecar.BlockMedia[0].SecureDigital.CID = new DumpType sidecar.BlockMedia[0].SecureDigital.CID = new DumpType
{ {
Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.SD_CID)).ToArray(), Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.SD_CID)).ToArray(),
Size = image.ReadDiskTag(MediaTagType.SD_CID).Length Size = (ulong)image.ReadDiskTag(MediaTagType.SD_CID).Length
}; };
break; break;
case MediaTagType.SD_CSD: case MediaTagType.SD_CSD:
@@ -196,7 +199,7 @@ namespace DiscImageChef.Core
sidecar.BlockMedia[0].SecureDigital.CSD = new DumpType sidecar.BlockMedia[0].SecureDigital.CSD = new DumpType
{ {
Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.SD_CSD)).ToArray(), Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.SD_CSD)).ToArray(),
Size = image.ReadDiskTag(MediaTagType.SD_CSD).Length Size = (ulong)image.ReadDiskTag(MediaTagType.SD_CSD).Length
}; };
break; break;
case MediaTagType.SD_SCR: case MediaTagType.SD_SCR:
@@ -205,7 +208,7 @@ namespace DiscImageChef.Core
sidecar.BlockMedia[0].SecureDigital.SCR = new DumpType sidecar.BlockMedia[0].SecureDigital.SCR = new DumpType
{ {
Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.SD_SCR)).ToArray(), Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.SD_SCR)).ToArray(),
Size = image.ReadDiskTag(MediaTagType.SD_SCR).Length Size = (ulong)image.ReadDiskTag(MediaTagType.SD_SCR).Length
}; };
break; break;
case MediaTagType.SD_OCR: case MediaTagType.SD_OCR:
@@ -214,7 +217,7 @@ namespace DiscImageChef.Core
sidecar.BlockMedia[0].SecureDigital.OCR = new DumpType sidecar.BlockMedia[0].SecureDigital.OCR = new DumpType
{ {
Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.SD_OCR)).ToArray(), Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.SD_OCR)).ToArray(),
Size = image.ReadDiskTag(MediaTagType.SD_OCR).Length Size = (ulong)image.ReadDiskTag(MediaTagType.SD_OCR).Length
}; };
break; break;
case MediaTagType.MMC_CID: case MediaTagType.MMC_CID:
@@ -223,7 +226,7 @@ namespace DiscImageChef.Core
sidecar.BlockMedia[0].MultiMediaCard.CID = new DumpType sidecar.BlockMedia[0].MultiMediaCard.CID = new DumpType
{ {
Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.SD_CID)).ToArray(), Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.SD_CID)).ToArray(),
Size = image.ReadDiskTag(MediaTagType.SD_CID).Length Size = (ulong)image.ReadDiskTag(MediaTagType.SD_CID).Length
}; };
break; break;
case MediaTagType.MMC_CSD: case MediaTagType.MMC_CSD:
@@ -232,7 +235,7 @@ namespace DiscImageChef.Core
sidecar.BlockMedia[0].MultiMediaCard.CSD = new DumpType sidecar.BlockMedia[0].MultiMediaCard.CSD = new DumpType
{ {
Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.SD_CSD)).ToArray(), Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.SD_CSD)).ToArray(),
Size = image.ReadDiskTag(MediaTagType.SD_CSD).Length Size = (ulong)image.ReadDiskTag(MediaTagType.SD_CSD).Length
}; };
break; break;
case MediaTagType.MMC_OCR: case MediaTagType.MMC_OCR:
@@ -241,7 +244,7 @@ namespace DiscImageChef.Core
sidecar.BlockMedia[0].MultiMediaCard.OCR = new DumpType sidecar.BlockMedia[0].MultiMediaCard.OCR = new DumpType
{ {
Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.SD_OCR)).ToArray(), Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.SD_OCR)).ToArray(),
Size = image.ReadDiskTag(MediaTagType.SD_OCR).Length Size = (ulong)image.ReadDiskTag(MediaTagType.SD_OCR).Length
}; };
break; break;
case MediaTagType.MMC_ExtendedCSD: case MediaTagType.MMC_ExtendedCSD:
@@ -251,7 +254,7 @@ namespace DiscImageChef.Core
{ {
Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.MMC_ExtendedCSD)) Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.MMC_ExtendedCSD))
.ToArray(), .ToArray(),
Size = image.ReadDiskTag(MediaTagType.MMC_ExtendedCSD).Length Size = (ulong)image.ReadDiskTag(MediaTagType.MMC_ExtendedCSD).Length
}; };
break; break;
case MediaTagType.USB_Descriptors: case MediaTagType.USB_Descriptors:
@@ -260,7 +263,7 @@ namespace DiscImageChef.Core
{ {
Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.USB_Descriptors)) Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.USB_Descriptors))
.ToArray(), .ToArray(),
Size = image.ReadDiskTag(MediaTagType.USB_Descriptors).Length Size = (ulong)image.ReadDiskTag(MediaTagType.USB_Descriptors).Length
}; };
break; break;
case MediaTagType.SCSI_MODESENSE_6: case MediaTagType.SCSI_MODESENSE_6:
@@ -269,7 +272,7 @@ namespace DiscImageChef.Core
{ {
Checksums = Checksums =
Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.SCSI_MODESENSE_6)).ToArray(), Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.SCSI_MODESENSE_6)).ToArray(),
Size = image.ReadDiskTag(MediaTagType.SCSI_MODESENSE_6).Length Size = (ulong)image.ReadDiskTag(MediaTagType.SCSI_MODESENSE_6).Length
}; };
break; break;
case MediaTagType.SCSI_MODESENSE_10: case MediaTagType.SCSI_MODESENSE_10:
@@ -278,7 +281,7 @@ namespace DiscImageChef.Core
{ {
Checksums = Checksums =
Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.SCSI_MODESENSE_10)).ToArray(), Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.SCSI_MODESENSE_10)).ToArray(),
Size = image.ReadDiskTag(MediaTagType.SCSI_MODESENSE_10).Length Size = (ulong)image.ReadDiskTag(MediaTagType.SCSI_MODESENSE_10).Length
}; };
break; break;
} }
@@ -345,10 +348,10 @@ namespace DiscImageChef.Core
sidecar.BlockMedia[0].Dimensions = Dimensions.DimensionsFromMediaType(image.Info.MediaType); sidecar.BlockMedia[0].Dimensions = Dimensions.DimensionsFromMediaType(image.Info.MediaType);
sidecar.BlockMedia[0].LogicalBlocks = (long)image.Info.Sectors; sidecar.BlockMedia[0].LogicalBlocks = image.Info.Sectors;
sidecar.BlockMedia[0].LogicalBlockSize = (int)image.Info.SectorSize; sidecar.BlockMedia[0].LogicalBlockSize = image.Info.SectorSize;
// TODO: Detect it // TODO: Detect it
sidecar.BlockMedia[0].PhysicalBlockSize = (int)image.Info.SectorSize; sidecar.BlockMedia[0].PhysicalBlockSize = image.Info.SectorSize;
UpdateStatus("Checking filesystems..."); UpdateStatus("Checking filesystems...");
@@ -368,10 +371,10 @@ namespace DiscImageChef.Core
sidecar.BlockMedia[0].FileSystemInformation[i] = new PartitionType sidecar.BlockMedia[0].FileSystemInformation[i] = new PartitionType
{ {
Description = partitions[i].Description, Description = partitions[i].Description,
EndSector = (int)partitions[i].End, EndSector = partitions[i].End,
Name = partitions[i].Name, Name = partitions[i].Name,
Sequence = (int)partitions[i].Sequence, Sequence = (uint)partitions[i].Sequence,
StartSector = (int)partitions[i].Start, StartSector = partitions[i].Start,
Type = partitions[i].Type Type = partitions[i].Type
}; };
List<FileSystemType> lstFs = new List<FileSystemType>(); List<FileSystemType> lstFs = new List<FileSystemType>();
@@ -402,7 +405,7 @@ namespace DiscImageChef.Core
if(aborted) return; if(aborted) return;
sidecar.BlockMedia[0].FileSystemInformation[0] = sidecar.BlockMedia[0].FileSystemInformation[0] =
new PartitionType {StartSector = 0, EndSector = (int)(image.Info.Sectors - 1)}; new PartitionType {StartSector = 0, EndSector = image.Info.Sectors - 1};
Partition wholePart = new Partition Partition wholePart = new Partition
{ {
@@ -442,7 +445,7 @@ namespace DiscImageChef.Core
sidecar.BlockMedia[0].HeadsSpecified = true; sidecar.BlockMedia[0].HeadsSpecified = true;
sidecar.BlockMedia[0].SectorsPerTrackSpecified = true; sidecar.BlockMedia[0].SectorsPerTrackSpecified = true;
sidecar.BlockMedia[0].Cylinders = image.Info.Cylinders; sidecar.BlockMedia[0].Cylinders = image.Info.Cylinders;
sidecar.BlockMedia[0].Heads = image.Info.Heads; sidecar.BlockMedia[0].Heads = (ushort)image.Info.Heads;
sidecar.BlockMedia[0].SectorsPerTrack = image.Info.SectorsPerTrack; sidecar.BlockMedia[0].SectorsPerTrack = image.Info.SectorsPerTrack;
} }
@@ -611,7 +614,7 @@ namespace DiscImageChef.Core
if(scpImage.Header.end + 1 >= image.Info.Cylinders) if(scpImage.Header.end + 1 >= image.Info.Cylinders)
{ {
List<BlockTrackType> scpBlockTrackTypes = new List<BlockTrackType>(); List<BlockTrackType> scpBlockTrackTypes = new List<BlockTrackType>();
long currentSector = 0; ulong currentSector = 0;
Stream scpStream = scpFilter.GetDataForkStream(); Stream scpStream = scpFilter.GetDataForkStream();
for(byte t = scpImage.Header.start; t <= scpImage.Header.end; t++) for(byte t = scpImage.Header.start; t <= scpImage.Header.end; t++)
@@ -621,7 +624,7 @@ namespace DiscImageChef.Core
BlockTrackType scpBlockTrackType = new BlockTrackType BlockTrackType scpBlockTrackType = new BlockTrackType
{ {
Cylinder = t / image.Info.Heads, Cylinder = t / image.Info.Heads,
Head = t % image.Info.Heads, Head = (ushort)(t % image.Info.Heads),
Image = new ImageType Image = new ImageType
{ {
format = scpImage.Format, format = scpImage.Format,
@@ -636,7 +639,7 @@ namespace DiscImageChef.Core
currentSector += image.Info.SectorsPerTrack; currentSector += image.Info.SectorsPerTrack;
scpBlockTrackType.EndSector = currentSector - 1; scpBlockTrackType.EndSector = currentSector - 1;
scpBlockTrackType.Sectors = image.Info.SectorsPerTrack; scpBlockTrackType.Sectors = image.Info.SectorsPerTrack;
scpBlockTrackType.BytesPerSector = (int)image.Info.SectorSize; scpBlockTrackType.BytesPerSector = image.Info.SectorSize;
scpBlockTrackType.Format = trkFormat; scpBlockTrackType.Format = trkFormat;
} }
@@ -647,7 +650,7 @@ namespace DiscImageChef.Core
scpTrack.Entries.Last().trackLength - scpImage.Header.offsets[t] + 1]; scpTrack.Entries.Last().trackLength - scpImage.Header.offsets[t] + 1];
scpStream.Position = scpImage.Header.offsets[t]; scpStream.Position = scpImage.Header.offsets[t];
scpStream.Read(trackContents, 0, trackContents.Length); scpStream.Read(trackContents, 0, trackContents.Length);
scpBlockTrackType.Size = trackContents.Length; scpBlockTrackType.Size = (ulong)trackContents.Length;
scpBlockTrackType.Checksums = Checksum.GetChecksums(trackContents).ToArray(); scpBlockTrackType.Checksums = Checksum.GetChecksums(trackContents).ToArray();
} }
@@ -705,7 +708,7 @@ namespace DiscImageChef.Core
{ {
List<BlockTrackType> kfBlockTrackTypes = new List<BlockTrackType>(); List<BlockTrackType> kfBlockTrackTypes = new List<BlockTrackType>();
long currentSector = 0; ulong currentSector = 0;
foreach(KeyValuePair<byte, IFilter> kvp in kfImage.tracks) foreach(KeyValuePair<byte, IFilter> kvp in kfImage.tracks)
{ {
@@ -714,7 +717,7 @@ namespace DiscImageChef.Core
BlockTrackType kfBlockTrackType = new BlockTrackType BlockTrackType kfBlockTrackType = new BlockTrackType
{ {
Cylinder = kvp.Key / image.Info.Heads, Cylinder = kvp.Key / image.Info.Heads,
Head = kvp.Key % image.Info.Heads, Head = (ushort)(kvp.Key % image.Info.Heads),
Image = new ImageType Image = new ImageType
{ {
format = kfImage.Format, format = kfImage.Format,
@@ -733,7 +736,7 @@ namespace DiscImageChef.Core
currentSector += image.Info.SectorsPerTrack; currentSector += image.Info.SectorsPerTrack;
kfBlockTrackType.EndSector = currentSector - 1; kfBlockTrackType.EndSector = currentSector - 1;
kfBlockTrackType.Sectors = image.Info.SectorsPerTrack; kfBlockTrackType.Sectors = image.Info.SectorsPerTrack;
kfBlockTrackType.BytesPerSector = (int)image.Info.SectorSize; kfBlockTrackType.BytesPerSector = image.Info.SectorSize;
kfBlockTrackType.Format = trkFormat; kfBlockTrackType.Format = trkFormat;
} }
@@ -741,7 +744,7 @@ namespace DiscImageChef.Core
byte[] trackContents = new byte[kfStream.Length]; byte[] trackContents = new byte[kfStream.Length];
kfStream.Position = 0; kfStream.Position = 0;
kfStream.Read(trackContents, 0, trackContents.Length); kfStream.Read(trackContents, 0, trackContents.Length);
kfBlockTrackType.Size = trackContents.Length; kfBlockTrackType.Size = (ulong)trackContents.Length;
kfBlockTrackType.Checksums = Checksum.GetChecksums(trackContents).ToArray(); kfBlockTrackType.Checksums = Checksum.GetChecksums(trackContents).ToArray();
kfBlockTrackTypes.Add(kfBlockTrackType); kfBlockTrackTypes.Add(kfBlockTrackType);
@@ -784,7 +787,7 @@ namespace DiscImageChef.Core
if(dfiImage.Info.Cylinders >= image.Info.Cylinders) if(dfiImage.Info.Cylinders >= image.Info.Cylinders)
{ {
List<BlockTrackType> dfiBlockTrackTypes = new List<BlockTrackType>(); List<BlockTrackType> dfiBlockTrackTypes = new List<BlockTrackType>();
long currentSector = 0; ulong currentSector = 0;
Stream dfiStream = dfiFilter.GetDataForkStream(); Stream dfiStream = dfiFilter.GetDataForkStream();
foreach(int t in dfiImage.TrackOffsets.Keys) foreach(int t in dfiImage.TrackOffsets.Keys)
@@ -793,8 +796,8 @@ namespace DiscImageChef.Core
BlockTrackType dfiBlockTrackType = new BlockTrackType BlockTrackType dfiBlockTrackType = new BlockTrackType
{ {
Cylinder = t / image.Info.Heads, Cylinder = (uint)(t / image.Info.Heads),
Head = t % image.Info.Heads, Head = (ushort)(t % image.Info.Heads),
Image = new ImageType {format = dfiImage.Format, Value = Path.GetFileName(dfiFilePath)} Image = new ImageType {format = dfiImage.Format, Value = Path.GetFileName(dfiFilePath)}
}; };
@@ -804,18 +807,18 @@ namespace DiscImageChef.Core
currentSector += image.Info.SectorsPerTrack; currentSector += image.Info.SectorsPerTrack;
dfiBlockTrackType.EndSector = currentSector - 1; dfiBlockTrackType.EndSector = currentSector - 1;
dfiBlockTrackType.Sectors = image.Info.SectorsPerTrack; dfiBlockTrackType.Sectors = image.Info.SectorsPerTrack;
dfiBlockTrackType.BytesPerSector = (int)image.Info.SectorSize; dfiBlockTrackType.BytesPerSector = image.Info.SectorSize;
dfiBlockTrackType.Format = trkFormat; dfiBlockTrackType.Format = trkFormat;
} }
if(dfiImage.TrackOffsets.TryGetValue(t, out long offset) && if(dfiImage.TrackOffsets.TryGetValue(t, out long offset) &&
dfiImage.TrackLengths.TryGetValue(t, out long length)) dfiImage.TrackLengths.TryGetValue(t, out long length))
{ {
dfiBlockTrackType.Image.offset = offset; dfiBlockTrackType.Image.offset = (ulong)offset;
byte[] trackContents = new byte[length]; byte[] trackContents = new byte[length];
dfiStream.Position = offset; dfiStream.Position = offset;
dfiStream.Read(trackContents, 0, trackContents.Length); dfiStream.Read(trackContents, 0, trackContents.Length);
dfiBlockTrackType.Size = trackContents.Length; dfiBlockTrackType.Size = (ulong)trackContents.Length;
dfiBlockTrackType.Checksums = Checksum.GetChecksums(trackContents).ToArray(); dfiBlockTrackType.Checksums = Checksum.GetChecksums(trackContents).ToArray();
} }

View File

@@ -44,7 +44,7 @@ namespace DiscImageChef.Core
/// <param name="files">List of files</param> /// <param name="files">List of files</param>
/// <param name="folderName">Dump path</param> /// <param name="folderName">Dump path</param>
/// <param name="blockSize">Expected block size in bytes</param> /// <param name="blockSize">Expected block size in bytes</param>
public CICMMetadataType BlockTape(string folderName, List<string> files, int blockSize) public CICMMetadataType BlockTape(string folderName, List<string> files, uint blockSize)
{ {
sidecar = new CICMMetadataType sidecar = new CICMMetadataType
{ {
@@ -79,8 +79,8 @@ namespace DiscImageChef.Core
if(aborted) return sidecar; if(aborted) return sidecar;
long currentBlock = 0; ulong currentBlock = 0;
long totalSize = 0; ulong totalSize = 0;
Checksum tapeWorker = new Checksum(); Checksum tapeWorker = new Checksum();
List<TapeFileType> tapeFiles = new List<TapeFileType>(); List<TapeFileType> tapeFiles = new List<TapeFileType>();
@@ -99,15 +99,15 @@ namespace DiscImageChef.Core
offset = 0, offset = 0,
Value = Path.GetFileName(files[i]) Value = Path.GetFileName(files[i])
}, },
Size = fs.Length, Size = (ulong)fs.Length,
BlockSize = blockSize, BlockSize = blockSize,
StartBlock = currentBlock, StartBlock = currentBlock,
Sequence = i Sequence = (ulong)i
}; };
const uint SECTORS_TO_READ = 512; const uint SECTORS_TO_READ = 512;
long sectors = fs.Length / blockSize; ulong sectors = (ulong)fs.Length / blockSize;
long doneSectors = 0; ulong doneSectors = 0;
InitProgress2(); InitProgress2();
while(doneSectors < sectors) while(doneSectors < sectors)
@@ -125,7 +125,7 @@ namespace DiscImageChef.Core
sector = new byte[SECTORS_TO_READ * blockSize]; sector = new byte[SECTORS_TO_READ * blockSize];
fs.Read(sector, 0, sector.Length); fs.Read(sector, 0, sector.Length);
UpdateProgress2($"Hashing block {doneSectors} of {sectors} on file {i + 1} of {files.Count}", UpdateProgress2($"Hashing block {doneSectors} of {sectors} on file {i + 1} of {files.Count}",
doneSectors, sectors); (long)doneSectors, (long)sectors);
doneSectors += SECTORS_TO_READ; doneSectors += SECTORS_TO_READ;
} }
else else
@@ -133,7 +133,7 @@ namespace DiscImageChef.Core
sector = new byte[(uint)(sectors - doneSectors) * blockSize]; sector = new byte[(uint)(sectors - doneSectors) * blockSize];
fs.Read(sector, 0, sector.Length); fs.Read(sector, 0, sector.Length);
UpdateProgress2($"Hashing block {doneSectors} of {sectors} on file {i + 1} of {files.Count}", UpdateProgress2($"Hashing block {doneSectors} of {sectors} on file {i + 1} of {files.Count}",
doneSectors, sectors); (long)doneSectors, (long)sectors);
doneSectors += sectors - doneSectors; doneSectors += sectors - doneSectors;
} }
@@ -143,7 +143,7 @@ namespace DiscImageChef.Core
tapeFile.EndBlock = tapeFile.StartBlock + sectors - 1; tapeFile.EndBlock = tapeFile.StartBlock + sectors - 1;
currentBlock += sectors; currentBlock += sectors;
totalSize += fs.Length; totalSize += (ulong)fs.Length;
tapeFile.Checksums = fileWorker.End().ToArray(); tapeFile.Checksums = fileWorker.End().ToArray();
tapeFiles.Add(tapeFile); tapeFiles.Add(tapeFile);

View File

@@ -69,7 +69,7 @@ namespace DiscImageChef.Core
offsetSpecified = true, offsetSpecified = true,
Value = Path.GetFileName(imagePath) Value = Path.GetFileName(imagePath)
}, },
Size = fi.Length Size = (ulong)fi.Length
} }
}; };
} }

View File

@@ -80,15 +80,15 @@ namespace DiscImageChef.Core
offsetSpecified = true, offsetSpecified = true,
Value = Path.GetFileName(imagePath) Value = Path.GetFileName(imagePath)
}, },
Size = fi.Length, Size = (ulong)fi.Length,
Sequence = new SequenceType {MediaTitle = image.Info.MediaTitle} Sequence = new SequenceType {MediaTitle = image.Info.MediaTitle}
} }
}; };
if(image.Info.MediaSequence != 0 && image.Info.LastMediaSequence != 0) if(image.Info.MediaSequence != 0 && image.Info.LastMediaSequence != 0)
{ {
sidecar.OpticalDisc[0].Sequence.MediaSequence = image.Info.MediaSequence; sidecar.OpticalDisc[0].Sequence.MediaSequence = (uint)image.Info.MediaSequence;
sidecar.OpticalDisc[0].Sequence.TotalMedia = image.Info.LastMediaSequence; sidecar.OpticalDisc[0].Sequence.TotalMedia = (uint)image.Info.LastMediaSequence;
} }
else else
{ {
@@ -110,7 +110,7 @@ namespace DiscImageChef.Core
{ {
Image = Path.GetFileName(imagePath), Image = Path.GetFileName(imagePath),
Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.CD_ATIP)).ToArray(), Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.CD_ATIP)).ToArray(),
Size = image.ReadDiskTag(MediaTagType.CD_ATIP).Length Size = (ulong)image.ReadDiskTag(MediaTagType.CD_ATIP).Length
}; };
ATIP.CDATIP? atip = ATIP.Decode(image.ReadDiskTag(MediaTagType.CD_ATIP)); ATIP.CDATIP? atip = ATIP.Decode(image.ReadDiskTag(MediaTagType.CD_ATIP));
if(atip.HasValue) if(atip.HasValue)
@@ -122,7 +122,7 @@ namespace DiscImageChef.Core
{ {
Image = Path.GetFileName(imagePath), Image = Path.GetFileName(imagePath),
Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.DVD_BCA)).ToArray(), Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.DVD_BCA)).ToArray(),
Size = image.ReadDiskTag(MediaTagType.DVD_BCA).Length Size = (ulong)image.ReadDiskTag(MediaTagType.DVD_BCA).Length
}; };
break; break;
case MediaTagType.BD_BCA: case MediaTagType.BD_BCA:
@@ -130,7 +130,7 @@ namespace DiscImageChef.Core
{ {
Image = Path.GetFileName(imagePath), Image = Path.GetFileName(imagePath),
Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.BD_BCA)).ToArray(), Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.BD_BCA)).ToArray(),
Size = image.ReadDiskTag(MediaTagType.BD_BCA).Length Size = (ulong)image.ReadDiskTag(MediaTagType.BD_BCA).Length
}; };
break; break;
case MediaTagType.DVD_CMI: case MediaTagType.DVD_CMI:
@@ -138,7 +138,7 @@ namespace DiscImageChef.Core
{ {
Image = Path.GetFileName(imagePath), Image = Path.GetFileName(imagePath),
Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.DVD_CMI)).ToArray(), Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.DVD_CMI)).ToArray(),
Size = image.ReadDiskTag(MediaTagType.DVD_CMI).Length Size = (ulong)image.ReadDiskTag(MediaTagType.DVD_CMI).Length
}; };
CSS_CPRM.LeadInCopyright? cmi = CSS_CPRM.LeadInCopyright? cmi =
CSS_CPRM.DecodeLeadInCopyright(image.ReadDiskTag(MediaTagType.DVD_CMI)); CSS_CPRM.DecodeLeadInCopyright(image.ReadDiskTag(MediaTagType.DVD_CMI));
@@ -162,7 +162,7 @@ namespace DiscImageChef.Core
{ {
Image = Path.GetFileName(imagePath), Image = Path.GetFileName(imagePath),
Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.DVD_DMI)).ToArray(), Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.DVD_DMI)).ToArray(),
Size = image.ReadDiskTag(MediaTagType.DVD_DMI).Length Size = (ulong)image.ReadDiskTag(MediaTagType.DVD_DMI).Length
}; };
if(DMI.IsXbox(image.ReadDiskTag(MediaTagType.DVD_DMI))) if(DMI.IsXbox(image.ReadDiskTag(MediaTagType.DVD_DMI)))
{ {
@@ -181,7 +181,7 @@ namespace DiscImageChef.Core
{ {
Image = Path.GetFileName(imagePath), Image = Path.GetFileName(imagePath),
Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.DVD_PFI)).ToArray(), Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.DVD_PFI)).ToArray(),
Size = image.ReadDiskTag(MediaTagType.DVD_PFI).Length Size = (ulong)image.ReadDiskTag(MediaTagType.DVD_PFI).Length
}; };
PFI.PhysicalFormatInformation? pfi = PFI.Decode(image.ReadDiskTag(MediaTagType.DVD_PFI)); PFI.PhysicalFormatInformation? pfi = PFI.Decode(image.ReadDiskTag(MediaTagType.DVD_PFI));
if(pfi.HasValue) if(pfi.HasValue)
@@ -270,7 +270,7 @@ namespace DiscImageChef.Core
{ {
Image = Path.GetFileName(imagePath), Image = Path.GetFileName(imagePath),
Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.CD_PMA)).ToArray(), Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.CD_PMA)).ToArray(),
Size = image.ReadDiskTag(MediaTagType.CD_PMA).Length Size = (ulong)image.ReadDiskTag(MediaTagType.CD_PMA).Length
}; };
break; break;
case MediaTagType.CD_FullTOC: case MediaTagType.CD_FullTOC:
@@ -278,11 +278,11 @@ namespace DiscImageChef.Core
{ {
Image = Path.GetFileName(imagePath), Image = Path.GetFileName(imagePath),
Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.CD_FullTOC)).ToArray(), Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.CD_FullTOC)).ToArray(),
Size = image.ReadDiskTag(MediaTagType.CD_FullTOC).Length Size = (ulong)image.ReadDiskTag(MediaTagType.CD_FullTOC).Length
}; };
break; break;
case MediaTagType.CD_FirstTrackPregap: case MediaTagType.CD_FirstTrackPregap:
sidecar.OpticalDisc[0].LeadIn = new[] sidecar.OpticalDisc[0].FirstTrackPregrap = new[]
{ {
new BorderType new BorderType
{ {
@@ -290,7 +290,19 @@ namespace DiscImageChef.Core
Checksums = Checksum Checksums = Checksum
.GetChecksums(image.ReadDiskTag(MediaTagType.CD_FirstTrackPregap)) .GetChecksums(image.ReadDiskTag(MediaTagType.CD_FirstTrackPregap))
.ToArray(), .ToArray(),
Size = image.ReadDiskTag(MediaTagType.CD_FirstTrackPregap).Length Size = (ulong)image.ReadDiskTag(MediaTagType.CD_FirstTrackPregap).Length
}
};
break;
case MediaTagType.CD_LeadIn:
sidecar.OpticalDisc[0].LeadIn = new[]
{
new BorderType
{
Image = Path.GetFileName(imagePath),
Checksums = Checksum
.GetChecksums(image.ReadDiskTag(MediaTagType.CD_LeadIn)).ToArray(),
Size = (ulong)image.ReadDiskTag(MediaTagType.CD_LeadIn).Length
} }
}; };
break; break;
@@ -311,7 +323,7 @@ namespace DiscImageChef.Core
.GetChecksums(image.ReadDiskTag(MediaTagType .GetChecksums(image.ReadDiskTag(MediaTagType
.Xbox_SecuritySector)) .Xbox_SecuritySector))
.ToArray(), .ToArray(),
Size = image.ReadDiskTag(MediaTagType.Xbox_SecuritySector).Length Size = (ulong)image.ReadDiskTag(MediaTagType.Xbox_SecuritySector).Length
} }
} }
}; };
@@ -324,7 +336,7 @@ namespace DiscImageChef.Core
{ {
Image = Path.GetFileName(imagePath), Image = Path.GetFileName(imagePath),
Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.Xbox_PFI)).ToArray(), Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.Xbox_PFI)).ToArray(),
Size = image.ReadDiskTag(MediaTagType.Xbox_PFI).Length Size = (ulong)image.ReadDiskTag(MediaTagType.Xbox_PFI).Length
}; };
break; break;
case MediaTagType.Xbox_DMI: case MediaTagType.Xbox_DMI:
@@ -334,7 +346,7 @@ namespace DiscImageChef.Core
{ {
Image = Path.GetFileName(imagePath), Image = Path.GetFileName(imagePath),
Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.Xbox_DMI)).ToArray(), Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.Xbox_DMI)).ToArray(),
Size = image.ReadDiskTag(MediaTagType.Xbox_DMI).Length Size = (ulong)image.ReadDiskTag(MediaTagType.Xbox_DMI).Length
}; };
break; break;
} }
@@ -343,7 +355,7 @@ namespace DiscImageChef.Core
try try
{ {
List<Session> sessions = image.Sessions; List<Session> sessions = image.Sessions;
sidecar.OpticalDisc[0].Sessions = sessions?.Count ?? 1; sidecar.OpticalDisc[0].Sessions = (uint)(sessions?.Count ?? 1);
} }
catch { sidecar.OpticalDisc[0].Sessions = 1; } catch { sidecar.OpticalDisc[0].Sessions = 1; }
@@ -351,8 +363,8 @@ namespace DiscImageChef.Core
List<TrackType> trksLst = null; List<TrackType> trksLst = null;
if(tracks != null) if(tracks != null)
{ {
sidecar.OpticalDisc[0].Tracks = new int[1]; sidecar.OpticalDisc[0].Tracks = new uint[1];
sidecar.OpticalDisc[0].Tracks[0] = tracks.Count; sidecar.OpticalDisc[0].Tracks[0] = (uint)tracks.Count;
trksLst = new List<TrackType>(); trksLst = new List<TrackType>();
} }
@@ -418,24 +430,24 @@ namespace DiscImageChef.Core
} }
xmlTrk.Sequence = xmlTrk.Sequence =
new TrackSequenceType {Session = trk.TrackSession, TrackNumber = (int)trk.TrackSequence}; new TrackSequenceType {Session = trk.TrackSession, TrackNumber = trk.TrackSequence};
xmlTrk.StartSector = (long)trk.TrackStartSector; xmlTrk.StartSector = trk.TrackStartSector;
xmlTrk.EndSector = (long)trk.TrackEndSector; xmlTrk.EndSector = trk.TrackEndSector;
if(trk.Indexes != null && trk.Indexes.ContainsKey(0)) if(trk.Indexes != null && trk.Indexes.ContainsKey(0))
if(trk.Indexes.TryGetValue(0, out ulong idx0)) if(trk.Indexes.TryGetValue(0, out ulong idx0))
xmlTrk.StartSector = (long)idx0; xmlTrk.StartSector = idx0;
switch(sidecar.OpticalDisc[0].DiscType) switch(sidecar.OpticalDisc[0].DiscType)
{ {
case "CD": case "CD":
case "GD": case "GD":
xmlTrk.StartMSF = LbaToMsf(xmlTrk.StartSector); xmlTrk.StartMSF = LbaToMsf((long)xmlTrk.StartSector);
xmlTrk.EndMSF = LbaToMsf(xmlTrk.EndSector); xmlTrk.EndMSF = LbaToMsf((long)xmlTrk.EndSector);
break; break;
case "DDCD": case "DDCD":
xmlTrk.StartMSF = DdcdLbaToMsf(xmlTrk.StartSector); xmlTrk.StartMSF = DdcdLbaToMsf((long)xmlTrk.StartSector);
xmlTrk.EndMSF = DdcdLbaToMsf(xmlTrk.EndSector); xmlTrk.EndMSF = DdcdLbaToMsf((long)xmlTrk.EndSector);
break; break;
} }
@@ -443,15 +455,15 @@ namespace DiscImageChef.Core
if(trk.TrackFileOffset > 0) if(trk.TrackFileOffset > 0)
{ {
xmlTrk.Image.offset = (long)trk.TrackFileOffset; xmlTrk.Image.offset = trk.TrackFileOffset;
xmlTrk.Image.offsetSpecified = true; xmlTrk.Image.offsetSpecified = true;
} }
xmlTrk.Size = (xmlTrk.EndSector - xmlTrk.StartSector + 1) * trk.TrackRawBytesPerSector; xmlTrk.Size = (xmlTrk.EndSector - xmlTrk.StartSector + 1) * (ulong)trk.TrackRawBytesPerSector;
xmlTrk.BytesPerSector = trk.TrackBytesPerSector; xmlTrk.BytesPerSector = (uint)trk.TrackBytesPerSector;
uint sectorsToRead = 512; uint sectorsToRead = 512;
ulong sectors = (ulong)(xmlTrk.EndSector - xmlTrk.StartSector + 1); ulong sectors = xmlTrk.EndSector - xmlTrk.StartSector + 1;
ulong doneSectors = 0; ulong doneSectors = 0;
// If there is only one track, and it's the same as the image file (e.g. ".iso" files), don't re-checksum. // If there is only one track, and it's the same as the image file (e.g. ".iso" files), don't re-checksum.
@@ -484,8 +496,7 @@ namespace DiscImageChef.Core
if(sectors - doneSectors >= sectorsToRead) if(sectors - doneSectors >= sectorsToRead)
{ {
sector = image.ReadSectorsLong(doneSectors, sectorsToRead, sector = image.ReadSectorsLong(doneSectors, sectorsToRead, xmlTrk.Sequence.TrackNumber);
(uint)xmlTrk.Sequence.TrackNumber);
UpdateProgress2("Hashings sector {0} of {1}", (long)doneSectors, UpdateProgress2("Hashings sector {0} of {1}", (long)doneSectors,
(long)(trk.TrackEndSector - trk.TrackStartSector + 1)); (long)(trk.TrackEndSector - trk.TrackStartSector + 1));
doneSectors += sectorsToRead; doneSectors += sectorsToRead;
@@ -493,7 +504,7 @@ namespace DiscImageChef.Core
else else
{ {
sector = image.ReadSectorsLong(doneSectors, (uint)(sectors - doneSectors), sector = image.ReadSectorsLong(doneSectors, (uint)(sectors - doneSectors),
(uint)xmlTrk.Sequence.TrackNumber); xmlTrk.Sequence.TrackNumber);
UpdateProgress2("Hashings sector {0} of {1}", (long)doneSectors, UpdateProgress2("Hashings sector {0} of {1}", (long)doneSectors,
(long)(trk.TrackEndSector - trk.TrackStartSector + 1)); (long)(trk.TrackEndSector - trk.TrackStartSector + 1));
doneSectors += sectors - doneSectors; doneSectors += sectors - doneSectors;
@@ -536,13 +547,13 @@ namespace DiscImageChef.Core
if(trk.TrackFileOffset > 0) if(trk.TrackFileOffset > 0)
{ {
xmlTrk.SubChannel.Image.offset = (long)trk.TrackSubchannelOffset; xmlTrk.SubChannel.Image.offset = trk.TrackSubchannelOffset;
xmlTrk.SubChannel.Image.offsetSpecified = true; xmlTrk.SubChannel.Image.offsetSpecified = true;
} }
Checksum subChkWorker = new Checksum(); Checksum subChkWorker = new Checksum();
sectors = (ulong)(xmlTrk.EndSector - xmlTrk.StartSector + 1); sectors = xmlTrk.EndSector - xmlTrk.StartSector + 1;
doneSectors = 0; doneSectors = 0;
InitProgress2(); InitProgress2();
@@ -559,7 +570,7 @@ namespace DiscImageChef.Core
if(sectors - doneSectors >= sectorsToRead) if(sectors - doneSectors >= sectorsToRead)
{ {
sector = image.ReadSectorsTag(doneSectors, sectorsToRead, (uint)xmlTrk.Sequence.TrackNumber, sector = image.ReadSectorsTag(doneSectors, sectorsToRead, xmlTrk.Sequence.TrackNumber,
SectorTagType.CdSectorSubchannel); SectorTagType.CdSectorSubchannel);
UpdateProgress2("Hashings subchannel sector {0} of {1}", (long)doneSectors, UpdateProgress2("Hashings subchannel sector {0} of {1}", (long)doneSectors,
(long)(trk.TrackEndSector - trk.TrackStartSector + 1)); (long)(trk.TrackEndSector - trk.TrackStartSector + 1));
@@ -568,7 +579,7 @@ namespace DiscImageChef.Core
else else
{ {
sector = image.ReadSectorsTag(doneSectors, (uint)(sectors - doneSectors), sector = image.ReadSectorsTag(doneSectors, (uint)(sectors - doneSectors),
(uint)xmlTrk.Sequence.TrackNumber, xmlTrk.Sequence.TrackNumber,
SectorTagType.CdSectorSubchannel); SectorTagType.CdSectorSubchannel);
UpdateProgress2("Hashings subchannel sector {0} of {1}", (long)doneSectors, UpdateProgress2("Hashings subchannel sector {0} of {1}", (long)doneSectors,
(long)(trk.TrackEndSector - trk.TrackStartSector + 1)); (long)(trk.TrackEndSector - trk.TrackStartSector + 1));
@@ -601,10 +612,10 @@ namespace DiscImageChef.Core
xmlTrk.FileSystemInformation[i] = new PartitionType xmlTrk.FileSystemInformation[i] = new PartitionType
{ {
Description = trkPartitions[i].Description, Description = trkPartitions[i].Description,
EndSector = (int)trkPartitions[i].End, EndSector = trkPartitions[i].End,
Name = trkPartitions[i].Name, Name = trkPartitions[i].Name,
Sequence = (int)trkPartitions[i].Sequence, Sequence = (uint)trkPartitions[i].Sequence,
StartSector = (int)trkPartitions[i].Start, StartSector = trkPartitions[i].Start,
Type = trkPartitions[i].Type Type = trkPartitions[i].Type
}; };
List<FileSystemType> lstFs = new List<FileSystemType>(); List<FileSystemType> lstFs = new List<FileSystemType>();
@@ -654,17 +665,17 @@ namespace DiscImageChef.Core
{ {
xmlTrk.FileSystemInformation[0] = new PartitionType xmlTrk.FileSystemInformation[0] = new PartitionType
{ {
EndSector = (int)xmlTrk.EndSector, StartSector = (int)xmlTrk.StartSector EndSector = xmlTrk.EndSector, StartSector = xmlTrk.StartSector
}; };
List<FileSystemType> lstFs = new List<FileSystemType>(); List<FileSystemType> lstFs = new List<FileSystemType>();
Partition xmlPart = new Partition Partition xmlPart = new Partition
{ {
Start = (ulong)xmlTrk.StartSector, Start = xmlTrk.StartSector,
Length = (ulong)(xmlTrk.EndSector - xmlTrk.StartSector + 1), Length = xmlTrk.EndSector - xmlTrk.StartSector + 1,
Type = xmlTrk.TrackType1.ToString(), Type = xmlTrk.TrackType1.ToString(),
Size = (ulong)xmlTrk.Size, Size = xmlTrk.Size,
Sequence = (ulong)xmlTrk.Sequence.TrackNumber Sequence = xmlTrk.Sequence.TrackNumber
}; };
foreach(IFilesystem plugin in plugins.PluginsList.Values) foreach(IFilesystem plugin in plugins.PluginsList.Values)
try try
@@ -717,8 +728,8 @@ namespace DiscImageChef.Core
// All XGD3 all have the same number of blocks // All XGD3 all have the same number of blocks
if(dskType == MediaType.XGD2 && sidecar.OpticalDisc[0].Track.Length == 1) if(dskType == MediaType.XGD2 && sidecar.OpticalDisc[0].Track.Length == 1)
{ {
ulong blocks = (ulong)(sidecar.OpticalDisc[0].Track[0].EndSector - ulong blocks = sidecar.OpticalDisc[0].Track[0].EndSector - sidecar.OpticalDisc[0].Track[0].StartSector +
sidecar.OpticalDisc[0].Track[0].StartSector + 1); 1;
if(blocks == 25063 || // Locked (or non compatible drive) if(blocks == 25063 || // Locked (or non compatible drive)
blocks == 4229664 || // Xtreme unlock blocks == 4229664 || // Xtreme unlock
blocks == 4246304) // Wxripper unlock blocks == 4246304) // Wxripper unlock

View File

@@ -83,11 +83,11 @@ namespace DiscImageChef.Filesystems
XmlFsType = new FileSystemType XmlFsType = new FileSystemType
{ {
Type = "Alexander Osipov DOS file system", Type = "Alexander Osipov DOS file system",
Clusters = (long)imagePlugin.Info.Sectors, Clusters = imagePlugin.Info.Sectors,
ClusterSize = (int)imagePlugin.Info.SectorSize, ClusterSize = imagePlugin.Info.SectorSize,
Files = bb.files, Files = bb.files,
FilesSpecified = true, FilesSpecified = true,
FreeClusters = (long)(imagePlugin.Info.Sectors - bb.usedSectors), FreeClusters = imagePlugin.Info.Sectors - bb.usedSectors,
FreeClustersSpecified = true, FreeClustersSpecified = true,
VolumeName = StringHandlers.SpacePaddedToString(bb.volumeLabel, Encoding), VolumeName = StringHandlers.SpacePaddedToString(bb.volumeLabel, Encoding),
Bootable = true Bootable = true
@@ -107,33 +107,33 @@ namespace DiscImageChef.Filesystems
/// <summary> /// <summary>
/// A NOP opcode /// A NOP opcode
/// </summary> /// </summary>
public byte nop; public readonly byte nop;
/// <summary> /// <summary>
/// A branch to real bootloader /// A branch to real bootloader
/// </summary> /// </summary>
public ushort branch; public readonly ushort branch;
/// <summary> /// <summary>
/// Unused /// Unused
/// </summary> /// </summary>
public byte unused; public readonly byte unused;
/// <summary> /// <summary>
/// " AO-DOS " /// " AO-DOS "
/// </summary> /// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[] identifier; public readonly byte[] identifier;
/// <summary> /// <summary>
/// Volume label /// Volume label
/// </summary> /// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)]
public byte[] volumeLabel; public readonly byte[] volumeLabel;
/// <summary> /// <summary>
/// How many files are present in disk /// How many files are present in disk
/// </summary> /// </summary>
public ushort files; public readonly ushort files;
/// <summary> /// <summary>
/// How many sectors are used /// How many sectors are used
/// </summary> /// </summary>
public ushort usedSectors; public readonly ushort usedSectors;
} }
} }
} }

View File

@@ -93,8 +93,8 @@ namespace DiscImageChef.Filesystems
XmlFsType = new FileSystemType XmlFsType = new FileSystemType
{ {
Bootable = false, Bootable = false,
Clusters = (long)nxSb.containerBlocks, Clusters = nxSb.containerBlocks,
ClusterSize = (int)nxSb.blockSize, ClusterSize = nxSb.blockSize,
Type = "Apple File System" Type = "Apple File System"
}; };
} }
@@ -102,13 +102,13 @@ namespace DiscImageChef.Filesystems
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct ApfsContainerSuperBlock struct ApfsContainerSuperBlock
{ {
public ulong unknown1; // Varies between copies of the superblock public readonly ulong unknown1; // Varies between copies of the superblock
public ulong unknown2; public readonly ulong unknown2;
public ulong unknown3; // Varies by 1 between copies of the superblock public readonly ulong unknown3; // Varies by 1 between copies of the superblock
public ulong unknown4; public readonly ulong unknown4;
public uint magic; public readonly uint magic;
public uint blockSize; public readonly uint blockSize;
public ulong containerBlocks; public readonly ulong containerBlocks;
} }
} }
} }

View File

@@ -287,8 +287,8 @@ namespace DiscImageChef.Filesystems
XmlFsType = new FileSystemType XmlFsType = new FileSystemType
{ {
Bootable = oldMap1.boot != 0, // Or not? Bootable = oldMap1.boot != 0, // Or not?
Clusters = (long)(bytes / imagePlugin.Info.SectorSize), Clusters = bytes / imagePlugin.Info.SectorSize,
ClusterSize = (int)imagePlugin.Info.SectorSize, ClusterSize = imagePlugin.Info.SectorSize,
Type = "Acorn Advanced Disc Filing System" Type = "Acorn Advanced Disc Filing System"
}; };
@@ -476,8 +476,8 @@ namespace DiscImageChef.Filesystems
information = sbInformation.ToString(); information = sbInformation.ToString();
XmlFsType.Bootable |= drSb.bootoption != 0; // Or not? XmlFsType.Bootable |= drSb.bootoption != 0; // Or not?
XmlFsType.Clusters = (long)(bytes / (ulong)(1 << drSb.log2secsize)); XmlFsType.Clusters = bytes / (ulong)(1 << drSb.log2secsize);
XmlFsType.ClusterSize = 1 << drSb.log2secsize; XmlFsType.ClusterSize = (uint)(1 << drSb.log2secsize);
XmlFsType.Type = "Acorn Advanced Disc Filing System"; XmlFsType.Type = "Acorn Advanced Disc Filing System";
} }
@@ -562,11 +562,11 @@ namespace DiscImageChef.Filesystems
struct BootBlock struct BootBlock
{ {
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x1C0)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x1C0)]
public byte[] spare; public readonly byte[] spare;
public DiscRecord discRecord; public readonly DiscRecord discRecord;
public byte flags; public readonly byte flags;
public ushort startCylinder; public readonly ushort startCylinder;
public byte checksum; public readonly byte checksum;
} }
/// <summary> /// <summary>
@@ -575,30 +575,30 @@ namespace DiscImageChef.Filesystems
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct DiscRecord struct DiscRecord
{ {
public byte log2secsize; public readonly byte log2secsize;
public byte spt; public readonly byte spt;
public byte heads; public readonly byte heads;
public byte density; public readonly byte density;
public byte idlen; public readonly byte idlen;
public byte log2bpmb; public readonly byte log2bpmb;
public byte skew; public readonly byte skew;
public byte bootoption; public readonly byte bootoption;
public byte lowsector; public readonly byte lowsector;
public byte nzones; public readonly byte nzones;
public ushort zone_spare; public readonly ushort zone_spare;
public uint root; public readonly uint root;
public uint disc_size; public readonly uint disc_size;
public ushort disc_id; public readonly ushort disc_id;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
public byte[] disc_name; public readonly byte[] disc_name;
public uint disc_type; public readonly uint disc_type;
public uint disc_size_high; public readonly uint disc_size_high;
public byte flags; public readonly byte flags;
public byte nzones_high; public readonly byte nzones_high;
public uint format_version; public readonly uint format_version;
public uint root_size; public readonly uint root_size;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[] reserved; public readonly byte[] reserved;
} }
/// <summary> /// <summary>
@@ -608,13 +608,13 @@ namespace DiscImageChef.Filesystems
struct OldMapSector0 struct OldMapSector0
{ {
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 82 * 3)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 82 * 3)]
public byte[] freeStart; public readonly byte[] freeStart;
public byte reserved; public readonly byte reserved;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
public byte[] name; public readonly byte[] name;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public byte[] size; public readonly byte[] size;
public byte checksum; public readonly byte checksum;
} }
/// <summary> /// <summary>
@@ -624,13 +624,13 @@ namespace DiscImageChef.Filesystems
struct OldMapSector1 struct OldMapSector1
{ {
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 82 * 3)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 82 * 3)]
public byte[] freeStart; public readonly byte[] freeStart;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
public byte[] name; public readonly byte[] name;
public ushort discId; public readonly ushort discId;
public byte boot; public readonly byte boot;
public byte freeEnd; public readonly byte freeEnd;
public byte checksum; public readonly byte checksum;
} }
/// <summary> /// <summary>
@@ -639,10 +639,10 @@ namespace DiscImageChef.Filesystems
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct NewMap struct NewMap
{ {
public byte zoneChecksum; public readonly byte zoneChecksum;
public ushort freeLink; public readonly ushort freeLink;
public byte crossChecksum; public readonly byte crossChecksum;
public DiscRecord discRecord; public readonly DiscRecord discRecord;
} }
/// <summary> /// <summary>
@@ -651,8 +651,8 @@ namespace DiscImageChef.Filesystems
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct DirectoryHeader struct DirectoryHeader
{ {
public byte masterSequence; public readonly byte masterSequence;
public uint magic; public readonly uint magic;
} }
/// <summary> /// <summary>
@@ -662,13 +662,13 @@ namespace DiscImageChef.Filesystems
struct DirectoryEntry struct DirectoryEntry
{ {
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
public byte[] name; public readonly byte[] name;
public uint load; public readonly uint load;
public uint exec; public readonly uint exec;
public uint length; public readonly uint length;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public byte[] address; public readonly byte[] address;
public byte atts; public readonly byte atts;
} }
/// <summary> /// <summary>
@@ -677,17 +677,17 @@ namespace DiscImageChef.Filesystems
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct NewDirectoryTail struct NewDirectoryTail
{ {
public byte lastMark; public readonly byte lastMark;
public ushort reserved; public readonly ushort reserved;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public byte[] parent; public readonly byte[] parent;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 19)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 19)]
public byte[] title; public readonly byte[] title;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
public byte[] name; public readonly byte[] name;
public byte endMasSeq; public readonly byte endMasSeq;
public uint magic; public readonly uint magic;
public byte checkByte; public readonly byte checkByte;
} }
/// <summary> /// <summary>
@@ -696,18 +696,18 @@ namespace DiscImageChef.Filesystems
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct OldDirectoryTail struct OldDirectoryTail
{ {
public byte lastMark; public readonly byte lastMark;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
public byte[] name; public readonly byte[] name;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public byte[] parent; public readonly byte[] parent;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 19)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 19)]
public byte[] title; public readonly byte[] title;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 14)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 14)]
public byte[] reserved; public readonly byte[] reserved;
public byte endMasSeq; public readonly byte endMasSeq;
public uint magic; public readonly uint magic;
public byte checkByte; public readonly byte checkByte;
} }
/// <summary> /// <summary>
@@ -716,10 +716,10 @@ namespace DiscImageChef.Filesystems
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct OldDirectory struct OldDirectory
{ {
public DirectoryHeader header; public readonly DirectoryHeader header;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 47)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 47)]
public DirectoryEntry[] entries; public readonly DirectoryEntry[] entries;
public OldDirectoryTail tail; public readonly OldDirectoryTail tail;
} }
/// <summary> /// <summary>
@@ -728,10 +728,10 @@ namespace DiscImageChef.Filesystems
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct NewDirectory struct NewDirectory
{ {
public DirectoryHeader header; public readonly DirectoryHeader header;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 77)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 77)]
public DirectoryEntry[] entries; public readonly DirectoryEntry[] entries;
public NewDirectoryTail tail; public readonly NewDirectoryTail tail;
} }
} }
} }

View File

@@ -304,7 +304,7 @@ namespace DiscImageChef.Filesystems
if((bootBlk.diskType & 0xFF) == 4 || (bootBlk.diskType & 0xFF) == 5) if((bootBlk.diskType & 0xFF) == 4 || (bootBlk.diskType & 0xFF) == 5)
sbInformation.AppendFormat("Directory cache starts at block {0}", rootBlk.extension).AppendLine(); sbInformation.AppendFormat("Directory cache starts at block {0}", rootBlk.extension).AppendLine();
long blocks = (long)((partition.End - partition.Start + 1) * imagePlugin.Info.SectorSize / blockSize); ulong blocks = (partition.End - partition.Start + 1) * imagePlugin.Info.SectorSize / blockSize;
sbInformation.AppendFormat("Volume block size is {0} bytes", blockSize).AppendLine(); sbInformation.AppendFormat("Volume block size is {0} bytes", blockSize).AppendLine();
sbInformation.AppendFormat("Volume has {0} blocks", blocks).AppendLine(); sbInformation.AppendFormat("Volume has {0} blocks", blocks).AppendLine();
@@ -328,7 +328,7 @@ namespace DiscImageChef.Filesystems
XmlFsType.ModificationDateSpecified = true; XmlFsType.ModificationDateSpecified = true;
XmlFsType.Dirty = rootBlk.bitmapFlag != 0xFFFFFFFF; XmlFsType.Dirty = rootBlk.bitmapFlag != 0xFFFFFFFF;
XmlFsType.Clusters = blocks; XmlFsType.Clusters = blocks;
XmlFsType.ClusterSize = (int)blockSize; XmlFsType.ClusterSize = blockSize;
XmlFsType.VolumeName = diskName; XmlFsType.VolumeName = diskName;
XmlFsType.Bootable = bsum == bootBlk.checksum; XmlFsType.Bootable = bsum == bootBlk.checksum;
// Useful as a serial // Useful as a serial
@@ -381,15 +381,15 @@ namespace DiscImageChef.Filesystems
/// <summary> /// <summary>
/// Offset 0x00, "DOSx" disk type /// Offset 0x00, "DOSx" disk type
/// </summary> /// </summary>
public uint diskType; public readonly uint diskType;
/// <summary> /// <summary>
/// Offset 0x04, Checksum /// Offset 0x04, Checksum
/// </summary> /// </summary>
public uint checksum; public readonly uint checksum;
/// <summary> /// <summary>
/// Offset 0x08, Pointer to root block, mostly invalid /// Offset 0x08, Pointer to root block, mostly invalid
/// </summary> /// </summary>
public uint root_ptr; public readonly uint root_ptr;
/// <summary> /// <summary>
/// Offset 0x0C, Boot code, til completion. Size is intentionally incorrect to allow marshaling to work. /// Offset 0x0C, Boot code, til completion. Size is intentionally incorrect to allow marshaling to work.
/// </summary> /// </summary>
@@ -407,11 +407,11 @@ namespace DiscImageChef.Filesystems
/// <summary> /// <summary>
/// Offset 0x04, unused /// Offset 0x04, unused
/// </summary> /// </summary>
public uint headerKey; public readonly uint headerKey;
/// <summary> /// <summary>
/// Offset 0x08, unused /// Offset 0x08, unused
/// </summary> /// </summary>
public uint highSeq; public readonly uint highSeq;
/// <summary> /// <summary>
/// Offset 0x0C, longs used by hash table /// Offset 0x0C, longs used by hash table
/// </summary> /// </summary>
@@ -419,7 +419,7 @@ namespace DiscImageChef.Filesystems
/// <summary> /// <summary>
/// Offset 0x10, unused /// Offset 0x10, unused
/// </summary> /// </summary>
public uint firstData; public readonly uint firstData;
/// <summary> /// <summary>
/// Offset 0x14, Rootblock checksum /// Offset 0x14, Rootblock checksum
/// </summary> /// </summary>
@@ -433,81 +433,81 @@ namespace DiscImageChef.Filesystems
/// <summary> /// <summary>
/// Offset 0x18+hashTableSize*4+0, bitmap flag, 0xFFFFFFFF if valid /// Offset 0x18+hashTableSize*4+0, bitmap flag, 0xFFFFFFFF if valid
/// </summary> /// </summary>
public uint bitmapFlag; public readonly uint bitmapFlag;
/// <summary> /// <summary>
/// Offset 0x18+hashTableSize*4+4, bitmap pages, 25 entries /// Offset 0x18+hashTableSize*4+4, bitmap pages, 25 entries
/// </summary> /// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 25)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 25)]
public uint[] bitmapPages; public readonly uint[] bitmapPages;
/// <summary> /// <summary>
/// Offset 0x18+hashTableSize*4+104, pointer to bitmap extension block /// Offset 0x18+hashTableSize*4+104, pointer to bitmap extension block
/// </summary> /// </summary>
public uint bitmapExtensionBlock; public readonly uint bitmapExtensionBlock;
/// <summary> /// <summary>
/// Offset 0x18+hashTableSize*4+108, last root alteration days since 1978/01/01 /// Offset 0x18+hashTableSize*4+108, last root alteration days since 1978/01/01
/// </summary> /// </summary>
public uint rDays; public readonly uint rDays;
/// <summary> /// <summary>
/// Offset 0x18+hashTableSize*4+112, last root alteration minutes past midnight /// Offset 0x18+hashTableSize*4+112, last root alteration minutes past midnight
/// </summary> /// </summary>
public uint rMins; public readonly uint rMins;
/// <summary> /// <summary>
/// Offset 0x18+hashTableSize*4+116, last root alteration ticks (1/50 secs) /// Offset 0x18+hashTableSize*4+116, last root alteration ticks (1/50 secs)
/// </summary> /// </summary>
public uint rTicks; public readonly uint rTicks;
/// <summary> /// <summary>
/// Offset 0x18+hashTableSize*4+120, disk name, pascal string, 31 bytes /// Offset 0x18+hashTableSize*4+120, disk name, pascal string, 31 bytes
/// </summary> /// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 31)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 31)]
public byte[] diskName; public readonly byte[] diskName;
/// <summary> /// <summary>
/// Offset 0x18+hashTableSize*4+151, unused /// Offset 0x18+hashTableSize*4+151, unused
/// </summary> /// </summary>
public byte padding; public readonly byte padding;
/// <summary> /// <summary>
/// Offset 0x18+hashTableSize*4+152, unused /// Offset 0x18+hashTableSize*4+152, unused
/// </summary> /// </summary>
public uint reserved1; public readonly uint reserved1;
/// <summary> /// <summary>
/// Offset 0x18+hashTableSize*4+156, unused /// Offset 0x18+hashTableSize*4+156, unused
/// </summary> /// </summary>
public uint reserved2; public readonly uint reserved2;
/// <summary> /// <summary>
/// Offset 0x18+hashTableSize*4+160, last disk alteration days since 1978/01/01 /// Offset 0x18+hashTableSize*4+160, last disk alteration days since 1978/01/01
/// </summary> /// </summary>
public uint vDays; public readonly uint vDays;
/// <summary> /// <summary>
/// Offset 0x18+hashTableSize*4+164, last disk alteration minutes past midnight /// Offset 0x18+hashTableSize*4+164, last disk alteration minutes past midnight
/// </summary> /// </summary>
public uint vMins; public readonly uint vMins;
/// <summary> /// <summary>
/// Offset 0x18+hashTableSize*4+168, last disk alteration ticks (1/50 secs) /// Offset 0x18+hashTableSize*4+168, last disk alteration ticks (1/50 secs)
/// </summary> /// </summary>
public uint vTicks; public readonly uint vTicks;
/// <summary> /// <summary>
/// Offset 0x18+hashTableSize*4+172, filesystem creation days since 1978/01/01 /// Offset 0x18+hashTableSize*4+172, filesystem creation days since 1978/01/01
/// </summary> /// </summary>
public uint cDays; public readonly uint cDays;
/// <summary> /// <summary>
/// Offset 0x18+hashTableSize*4+176, filesystem creation minutes since 1978/01/01 /// Offset 0x18+hashTableSize*4+176, filesystem creation minutes since 1978/01/01
/// </summary> /// </summary>
public uint cMins; public readonly uint cMins;
/// <summary> /// <summary>
/// Offset 0x18+hashTableSize*4+180, filesystem creation ticks since 1978/01/01 /// Offset 0x18+hashTableSize*4+180, filesystem creation ticks since 1978/01/01
/// </summary> /// </summary>
public uint cTicks; public readonly uint cTicks;
/// <summary> /// <summary>
/// Offset 0x18+hashTableSize*4+184, unused /// Offset 0x18+hashTableSize*4+184, unused
/// </summary> /// </summary>
public uint nextHash; public readonly uint nextHash;
/// <summary> /// <summary>
/// Offset 0x18+hashTableSize*4+188, unused /// Offset 0x18+hashTableSize*4+188, unused
/// </summary> /// </summary>
public uint parentDir; public readonly uint parentDir;
/// <summary> /// <summary>
/// Offset 0x18+hashTableSize*4+192, first directory cache block /// Offset 0x18+hashTableSize*4+192, first directory cache block
/// </summary> /// </summary>
public uint extension; public readonly uint extension;
/// <summary> /// <summary>
/// Offset 0x18+hashTableSize*4+196, block secondary type = ST_ROOT (1) /// Offset 0x18+hashTableSize*4+196, block secondary type = ST_ROOT (1)
/// </summary> /// </summary>

View File

@@ -48,7 +48,7 @@ namespace DiscImageChef.Filesystems.AppleDOS
ulong totalFileEntries; ulong totalFileEntries;
bool track1UsedByFiles; bool track1UsedByFiles;
bool track2UsedByFiles; bool track2UsedByFiles;
int usedSectors; uint usedSectors;
Vtoc vtoc; Vtoc vtoc;

View File

@@ -80,8 +80,7 @@ namespace DiscImageChef.Filesystems.AppleDOS
if(debug && (string.Compare(path, "$", StringComparison.InvariantCulture) == 0 || if(debug && (string.Compare(path, "$", StringComparison.InvariantCulture) == 0 ||
string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0 || string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0 ||
string.Compare(path, "$Vtoc", StringComparison.InvariantCulture) == 0)) string.Compare(path, "$Vtoc", StringComparison.InvariantCulture) == 0))
if(string.Compare(path, "$", StringComparison.InvariantCulture) == 0) if(string.Compare(path, "$", StringComparison.InvariantCulture) == 0) file = catalogBlocks;
file = catalogBlocks;
else if(string.Compare(path, "$Vtoc", StringComparison.InvariantCulture) == 0) file = vtocBlocks; else if(string.Compare(path, "$Vtoc", StringComparison.InvariantCulture) == 0) file = vtocBlocks;
else file = bootBlocks; else file = bootBlocks;
else else
@@ -227,7 +226,7 @@ namespace DiscImageChef.Filesystems.AppleDOS
if(!track2UsedByFiles) tracksOnBoot++; if(!track2UsedByFiles) tracksOnBoot++;
bootBlocks = device.ReadSectors(0, (uint)(tracksOnBoot * sectorsPerTrack)); bootBlocks = device.ReadSectors(0, (uint)(tracksOnBoot * sectorsPerTrack));
usedSectors += bootBlocks.Length / vtoc.bytesPerSector; usedSectors += (uint)(bootBlocks.Length / vtoc.bytesPerSector);
return Errno.NoError; return Errno.NoError;
} }

View File

@@ -88,8 +88,8 @@ namespace DiscImageChef.Filesystems.AppleDOS
XmlFsType = new FileSystemType XmlFsType = new FileSystemType
{ {
Bootable = true, Bootable = true,
Clusters = (long)imagePlugin.Info.Sectors, Clusters = imagePlugin.Info.Sectors,
ClusterSize = (int)imagePlugin.Info.SectorSize, ClusterSize = imagePlugin.Info.SectorSize,
Type = "Apple DOS" Type = "Apple DOS"
}; };
} }

View File

@@ -100,9 +100,9 @@ namespace DiscImageChef.Filesystems.AppleDOS
XmlFsType = new FileSystemType XmlFsType = new FileSystemType
{ {
Bootable = true, Bootable = true,
Clusters = (long)device.Info.Sectors, Clusters = device.Info.Sectors,
ClusterSize = vtoc.bytesPerSector, ClusterSize = vtoc.bytesPerSector,
Files = catalogCache.Count, Files = (ulong)catalogCache.Count,
FilesSpecified = true, FilesSpecified = true,
FreeClustersSpecified = true, FreeClustersSpecified = true,
Type = "Apple DOS" Type = "Apple DOS"
@@ -137,7 +137,7 @@ namespace DiscImageChef.Filesystems.AppleDOS
{ {
stat = new FileSystemInfo stat = new FileSystemInfo
{ {
Blocks = (long)device.Info.Sectors, Blocks = device.Info.Sectors,
FilenameLength = 30, FilenameLength = 30,
Files = (ulong)catalogCache.Count, Files = (ulong)catalogCache.Count,
PluginId = Id, PluginId = Id,

View File

@@ -264,7 +264,7 @@ namespace DiscImageChef.Filesystems
XmlFsType.Bootable = bb.signature == HFSBB_MAGIC || mdb.drFndrInfo0 != 0 || mdb.drFndrInfo3 != 0 || XmlFsType.Bootable = bb.signature == HFSBB_MAGIC || mdb.drFndrInfo0 != 0 || mdb.drFndrInfo3 != 0 ||
mdb.drFndrInfo5 != 0; mdb.drFndrInfo5 != 0;
XmlFsType.Clusters = mdb.drNmAlBlks; XmlFsType.Clusters = mdb.drNmAlBlks;
XmlFsType.ClusterSize = (int)mdb.drAlBlkSiz; XmlFsType.ClusterSize = mdb.drAlBlkSiz;
if(mdb.drCrDate > 0) if(mdb.drCrDate > 0)
{ {
XmlFsType.CreationDate = DateHandlers.MacToDateTime(mdb.drCrDate); XmlFsType.CreationDate = DateHandlers.MacToDateTime(mdb.drCrDate);
@@ -308,91 +308,91 @@ namespace DiscImageChef.Filesystems
struct HfsMasterDirectoryBlock // Should be sector 2 in volume struct HfsMasterDirectoryBlock // Should be sector 2 in volume
{ {
/// <summary>0x000, Signature, 0x4244</summary> /// <summary>0x000, Signature, 0x4244</summary>
public ushort drSigWord; public readonly ushort drSigWord;
/// <summary>0x002, Volume creation date</summary> /// <summary>0x002, Volume creation date</summary>
public uint drCrDate; public readonly uint drCrDate;
/// <summary>0x006, Volume last modification date</summary> /// <summary>0x006, Volume last modification date</summary>
public uint drLsMod; public readonly uint drLsMod;
/// <summary>0x00A, Volume attributes</summary> /// <summary>0x00A, Volume attributes</summary>
public ushort drAtrb; public readonly ushort drAtrb;
/// <summary>0x00C, Files in root directory</summary> /// <summary>0x00C, Files in root directory</summary>
public ushort drNmFls; public readonly ushort drNmFls;
/// <summary>0x00E, Start 512-byte sector of volume bitmap</summary> /// <summary>0x00E, Start 512-byte sector of volume bitmap</summary>
public ushort drVBMSt; public readonly ushort drVBMSt;
/// <summary>0x010, Allocation block to begin next allocation</summary> /// <summary>0x010, Allocation block to begin next allocation</summary>
public ushort drAllocPtr; public readonly ushort drAllocPtr;
/// <summary>0x012, Allocation blocks</summary> /// <summary>0x012, Allocation blocks</summary>
public ushort drNmAlBlks; public readonly ushort drNmAlBlks;
/// <summary>0x014, Bytes per allocation block</summary> /// <summary>0x014, Bytes per allocation block</summary>
public uint drAlBlkSiz; public readonly uint drAlBlkSiz;
/// <summary>0x018, Bytes to allocate when extending a file</summary> /// <summary>0x018, Bytes to allocate when extending a file</summary>
public uint drClpSiz; public readonly uint drClpSiz;
/// <summary>0x01C, Start 512-byte sector of first allocation block</summary> /// <summary>0x01C, Start 512-byte sector of first allocation block</summary>
public ushort drAlBlSt; public readonly ushort drAlBlSt;
/// <summary>0x01E, CNID for next file</summary> /// <summary>0x01E, CNID for next file</summary>
public uint drNxtCNID; public readonly uint drNxtCNID;
/// <summary>0x022, Free allocation blocks</summary> /// <summary>0x022, Free allocation blocks</summary>
public ushort drFreeBks; public readonly ushort drFreeBks;
/// <summary>0x024, Volume name (28 bytes)</summary> /// <summary>0x024, Volume name (28 bytes)</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 28)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 28)]
public byte[] drVN; public readonly byte[] drVN;
/// <summary>0x040, Volume last backup time</summary> /// <summary>0x040, Volume last backup time</summary>
public uint drVolBkUp; public readonly uint drVolBkUp;
/// <summary>0x044, Volume backup sequence number</summary> /// <summary>0x044, Volume backup sequence number</summary>
public ushort drVSeqNum; public readonly ushort drVSeqNum;
/// <summary>0x046, Filesystem write count</summary> /// <summary>0x046, Filesystem write count</summary>
public uint drWrCnt; public readonly uint drWrCnt;
/// <summary>0x04A, Bytes to allocate when extending the extents B-Tree</summary> /// <summary>0x04A, Bytes to allocate when extending the extents B-Tree</summary>
public uint drXTClpSiz; public readonly uint drXTClpSiz;
/// <summary>0x04E, Bytes to allocate when extending the catalog B-Tree</summary> /// <summary>0x04E, Bytes to allocate when extending the catalog B-Tree</summary>
public uint drCTClpSiz; public readonly uint drCTClpSiz;
/// <summary>0x052, Number of directories in root directory</summary> /// <summary>0x052, Number of directories in root directory</summary>
public ushort drNmRtDirs; public readonly ushort drNmRtDirs;
/// <summary>0x054, Number of files in the volume</summary> /// <summary>0x054, Number of files in the volume</summary>
public uint drFilCnt; public readonly uint drFilCnt;
/// <summary>0x058, Number of directories in the volume</summary> /// <summary>0x058, Number of directories in the volume</summary>
public uint drDirCnt; public readonly uint drDirCnt;
/// <summary>0x05C, finderInfo[0], CNID for bootable system's directory</summary> /// <summary>0x05C, finderInfo[0], CNID for bootable system's directory</summary>
public uint drFndrInfo0; public readonly uint drFndrInfo0;
/// <summary>0x060, finderInfo[1], CNID of the directory containing the boot application</summary> /// <summary>0x060, finderInfo[1], CNID of the directory containing the boot application</summary>
public uint drFndrInfo1; public readonly uint drFndrInfo1;
/// <summary>0x064, finderInfo[2], CNID of the directory that should be opened on boot</summary> /// <summary>0x064, finderInfo[2], CNID of the directory that should be opened on boot</summary>
public uint drFndrInfo2; public readonly uint drFndrInfo2;
/// <summary>0x068, finderInfo[3], CNID for Mac OS 8 or 9 directory</summary> /// <summary>0x068, finderInfo[3], CNID for Mac OS 8 or 9 directory</summary>
public uint drFndrInfo3; public readonly uint drFndrInfo3;
/// <summary>0x06C, finderInfo[4], Reserved</summary> /// <summary>0x06C, finderInfo[4], Reserved</summary>
public uint drFndrInfo4; public readonly uint drFndrInfo4;
/// <summary>0x070, finderInfo[5], CNID for Mac OS X directory</summary> /// <summary>0x070, finderInfo[5], CNID for Mac OS X directory</summary>
public uint drFndrInfo5; public readonly uint drFndrInfo5;
/// <summary>0x074, finderInfo[6], first part of Mac OS X volume ID</summary> /// <summary>0x074, finderInfo[6], first part of Mac OS X volume ID</summary>
public uint drFndrInfo6; public readonly uint drFndrInfo6;
/// <summary>0x078, finderInfo[7], second part of Mac OS X volume ID</summary> /// <summary>0x078, finderInfo[7], second part of Mac OS X volume ID</summary>
public uint drFndrInfo7; public readonly uint drFndrInfo7;
// If wrapping HFS+ // If wrapping HFS+
/// <summary>0x07C, Embedded volume signature, "H+" if HFS+ is embedded ignore following two fields if not</summary> /// <summary>0x07C, Embedded volume signature, "H+" if HFS+ is embedded ignore following two fields if not</summary>
public ushort drEmbedSigWord; public readonly ushort drEmbedSigWord;
/// <summary>0x07E, Starting block number of embedded HFS+ volume</summary> /// <summary>0x07E, Starting block number of embedded HFS+ volume</summary>
public ushort xdrStABNt; public readonly ushort xdrStABNt;
/// <summary>0x080, Allocation blocks used by embedded volume</summary> /// <summary>0x080, Allocation blocks used by embedded volume</summary>
public ushort xdrNumABlks; public readonly ushort xdrNumABlks;
// If not // If not
/// <summary>0x07C, Size in blocks of volume cache</summary> /// <summary>0x07C, Size in blocks of volume cache</summary>
public ushort drVCSize; public readonly ushort drVCSize;
/// <summary>0x07E, Size in blocks of volume bitmap cache</summary> /// <summary>0x07E, Size in blocks of volume bitmap cache</summary>
public ushort drVBMCSize; public readonly ushort drVBMCSize;
/// <summary>0x080, Size in blocks of volume common cache</summary> /// <summary>0x080, Size in blocks of volume common cache</summary>
public ushort drCtlCSize; public readonly ushort drCtlCSize;
// End of variable variables :D // End of variable variables :D
/// <summary> /// <summary>
/// 0x082, Bytes in the extents B-Tree /// 0x082, Bytes in the extents B-Tree
/// 3 HFS extents following, 32 bits each /// 3 HFS extents following, 32 bits each
/// </summary> /// </summary>
public uint drXTFlSize; public readonly uint drXTFlSize;
/// <summary> /// <summary>
/// 0x092, Bytes in the catalog B-Tree /// 0x092, Bytes in the catalog B-Tree
/// 3 HFS extents following, 32 bits each /// 3 HFS extents following, 32 bits each
/// </summary> /// </summary>
public uint drCTFlSize; public readonly uint drCTFlSize;
} }
/// <summary> /// <summary>
@@ -402,50 +402,50 @@ namespace DiscImageChef.Filesystems
struct HfsBootBlock // Should be sectors 0 and 1 in volume struct HfsBootBlock // Should be sectors 0 and 1 in volume
{ {
/// <summary>0x000, Signature, 0x4C4B if bootable</summary> /// <summary>0x000, Signature, 0x4C4B if bootable</summary>
public ushort signature; public readonly ushort signature;
/// <summary>0x002, Branch</summary> /// <summary>0x002, Branch</summary>
public uint branch; public readonly uint branch;
/// <summary>0x007, Boot block version</summary> /// <summary>0x007, Boot block version</summary>
public ushort boot_version; public readonly ushort boot_version;
/// <summary>0x006, Boot block flags</summary> /// <summary>0x006, Boot block flags</summary>
public short boot_flags; public readonly short boot_flags;
/// <summary>0x00A, System file name (16 bytes)</summary> /// <summary>0x00A, System file name (16 bytes)</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] system_name; public readonly byte[] system_name;
/// <summary>0x01A, Finder file name (16 bytes)</summary> /// <summary>0x01A, Finder file name (16 bytes)</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] finder_name; public readonly byte[] finder_name;
/// <summary>0x02A, Debugger file name (16 bytes)</summary> /// <summary>0x02A, Debugger file name (16 bytes)</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] debug_name; public readonly byte[] debug_name;
/// <summary>0x03A, Disassembler file name (16 bytes)</summary> /// <summary>0x03A, Disassembler file name (16 bytes)</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] disasm_name; public readonly byte[] disasm_name;
/// <summary>0x04A, Startup screen file name (16 bytes)</summary> /// <summary>0x04A, Startup screen file name (16 bytes)</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] stupscr_name; public readonly byte[] stupscr_name;
/// <summary>0x05A, First program to execute on boot (16 bytes)</summary> /// <summary>0x05A, First program to execute on boot (16 bytes)</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] bootup_name; public readonly byte[] bootup_name;
/// <summary>0x06A, Clipboard file name (16 bytes)</summary> /// <summary>0x06A, Clipboard file name (16 bytes)</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] clipbrd_name; public readonly byte[] clipbrd_name;
/// <summary>0x07A, 1/4 of maximum opened at a time files</summary> /// <summary>0x07A, 1/4 of maximum opened at a time files</summary>
public ushort max_files; public readonly ushort max_files;
/// <summary>0x07C, Event queue size</summary> /// <summary>0x07C, Event queue size</summary>
public ushort queue_size; public readonly ushort queue_size;
/// <summary>0x07E, Heap size on a Mac with 128KiB of RAM</summary> /// <summary>0x07E, Heap size on a Mac with 128KiB of RAM</summary>
public uint heap_128k; public readonly uint heap_128k;
/// <summary>0x082, Heap size on a Mac with 256KiB of RAM</summary> /// <summary>0x082, Heap size on a Mac with 256KiB of RAM</summary>
public uint heap_256k; public readonly uint heap_256k;
/// <summary>0x086, Heap size on a Mac with 512KiB of RAM or more</summary> /// <summary>0x086, Heap size on a Mac with 512KiB of RAM or more</summary>
public uint heap_512k; public readonly uint heap_512k;
/// <summary>Padding</summary> /// <summary>Padding</summary>
public ushort padding; public readonly ushort padding;
/// <summary>Additional system heap space</summary> /// <summary>Additional system heap space</summary>
public uint heap_extra; public readonly uint heap_extra;
/// <summary>Fraction of RAM for system heap</summary> /// <summary>Fraction of RAM for system heap</summary>
public uint heap_fract; public readonly uint heap_fract;
} }
} }
} }

View File

@@ -220,7 +220,7 @@ namespace DiscImageChef.Filesystems
XmlFsType.Bootable |= vh.drFndrInfo0 != 0 || vh.drFndrInfo3 != 0 || vh.drFndrInfo5 != 0; XmlFsType.Bootable |= vh.drFndrInfo0 != 0 || vh.drFndrInfo3 != 0 || vh.drFndrInfo5 != 0;
XmlFsType.Clusters = vh.totalBlocks; XmlFsType.Clusters = vh.totalBlocks;
XmlFsType.ClusterSize = (int)vh.blockSize; XmlFsType.ClusterSize = vh.blockSize;
if(vh.createDate > 0) if(vh.createDate > 0)
{ {
XmlFsType.CreationDate = DateHandlers.MacToDateTime(vh.createDate); XmlFsType.CreationDate = DateHandlers.MacToDateTime(vh.createDate);
@@ -262,9 +262,9 @@ namespace DiscImageChef.Filesystems
/// <summary>0x000, "H+" for HFS+, "HX" for HFSX</summary> /// <summary>0x000, "H+" for HFS+, "HX" for HFSX</summary>
public ushort signature; public ushort signature;
/// <summary>0x002, 4 for HFS+, 5 for HFSX</summary> /// <summary>0x002, 4 for HFS+, 5 for HFSX</summary>
public ushort version; public readonly ushort version;
/// <summary>0x004, Volume attributes</summary> /// <summary>0x004, Volume attributes</summary>
public uint attributes; public readonly uint attributes;
/// <summary> /// <summary>
/// 0x008, Implementation that last mounted the volume. /// 0x008, Implementation that last mounted the volume.
/// Reserved by Apple: /// Reserved by Apple:
@@ -274,250 +274,250 @@ namespace DiscImageChef.Filesystems
/// "fsck" /sbin/fsck /// "fsck" /sbin/fsck
/// </summary> /// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public byte[] lastMountedVersion; public readonly byte[] lastMountedVersion;
/// <summary>0x00C, Allocation block number containing the journal</summary> /// <summary>0x00C, Allocation block number containing the journal</summary>
public uint journalInfoBlock; public readonly uint journalInfoBlock;
/// <summary>0x010, Date of volume creation</summary> /// <summary>0x010, Date of volume creation</summary>
public uint createDate; public readonly uint createDate;
/// <summary>0x014, Date of last volume modification</summary> /// <summary>0x014, Date of last volume modification</summary>
public uint modifyDate; public readonly uint modifyDate;
/// <summary>0x018, Date of last backup</summary> /// <summary>0x018, Date of last backup</summary>
public uint backupDate; public readonly uint backupDate;
/// <summary>0x01C, Date of last consistency check</summary> /// <summary>0x01C, Date of last consistency check</summary>
public uint checkedDate; public readonly uint checkedDate;
/// <summary>0x020, File on the volume</summary> /// <summary>0x020, File on the volume</summary>
public uint fileCount; public readonly uint fileCount;
/// <summary>0x024, Folders on the volume</summary> /// <summary>0x024, Folders on the volume</summary>
public uint folderCount; public readonly uint folderCount;
/// <summary>0x028, Bytes per allocation block</summary> /// <summary>0x028, Bytes per allocation block</summary>
public uint blockSize; public readonly uint blockSize;
/// <summary>0x02C, Allocation blocks on the volume</summary> /// <summary>0x02C, Allocation blocks on the volume</summary>
public uint totalBlocks; public readonly uint totalBlocks;
/// <summary>0x030, Free allocation blocks</summary> /// <summary>0x030, Free allocation blocks</summary>
public uint freeBlocks; public readonly uint freeBlocks;
/// <summary>0x034, Hint for next allocation block</summary> /// <summary>0x034, Hint for next allocation block</summary>
public uint nextAllocation; public readonly uint nextAllocation;
/// <summary>0x038, Resource fork clump size</summary> /// <summary>0x038, Resource fork clump size</summary>
public uint rsrcClumpSize; public readonly uint rsrcClumpSize;
/// <summary>0x03C, Data fork clump size</summary> /// <summary>0x03C, Data fork clump size</summary>
public uint dataClumpSize; public readonly uint dataClumpSize;
/// <summary>0x040, Next unused CNID</summary> /// <summary>0x040, Next unused CNID</summary>
public uint nextCatalogID; public readonly uint nextCatalogID;
/// <summary>0x044, Times that the volume has been mounted writable</summary> /// <summary>0x044, Times that the volume has been mounted writable</summary>
public uint writeCount; public readonly uint writeCount;
/// <summary>0x048, Used text encoding hints</summary> /// <summary>0x048, Used text encoding hints</summary>
public ulong encodingsBitmap; public readonly ulong encodingsBitmap;
/// <summary>0x050, finderInfo[0], CNID for bootable system's directory</summary> /// <summary>0x050, finderInfo[0], CNID for bootable system's directory</summary>
public uint drFndrInfo0; public readonly uint drFndrInfo0;
/// <summary>0x054, finderInfo[1], CNID of the directory containing the boot application</summary> /// <summary>0x054, finderInfo[1], CNID of the directory containing the boot application</summary>
public uint drFndrInfo1; public readonly uint drFndrInfo1;
/// <summary>0x058, finderInfo[2], CNID of the directory that should be opened on boot</summary> /// <summary>0x058, finderInfo[2], CNID of the directory that should be opened on boot</summary>
public uint drFndrInfo2; public readonly uint drFndrInfo2;
/// <summary>0x05C, finderInfo[3], CNID for Mac OS 8 or 9 directory</summary> /// <summary>0x05C, finderInfo[3], CNID for Mac OS 8 or 9 directory</summary>
public uint drFndrInfo3; public readonly uint drFndrInfo3;
/// <summary>0x060, finderInfo[4], Reserved</summary> /// <summary>0x060, finderInfo[4], Reserved</summary>
public uint drFndrInfo4; public readonly uint drFndrInfo4;
/// <summary>0x064, finderInfo[5], CNID for Mac OS X directory</summary> /// <summary>0x064, finderInfo[5], CNID for Mac OS X directory</summary>
public uint drFndrInfo5; public readonly uint drFndrInfo5;
/// <summary>0x068, finderInfo[6], first part of Mac OS X volume ID</summary> /// <summary>0x068, finderInfo[6], first part of Mac OS X volume ID</summary>
public uint drFndrInfo6; public readonly uint drFndrInfo6;
/// <summary>0x06C, finderInfo[7], second part of Mac OS X volume ID</summary> /// <summary>0x06C, finderInfo[7], second part of Mac OS X volume ID</summary>
public uint drFndrInfo7; public readonly uint drFndrInfo7;
// HFSPlusForkData allocationFile; // HFSPlusForkData allocationFile;
/// <summary>0x070</summary> /// <summary>0x070</summary>
public ulong allocationFile_logicalSize; public readonly ulong allocationFile_logicalSize;
/// <summary>0x078</summary> /// <summary>0x078</summary>
public uint allocationFile_clumpSize; public readonly uint allocationFile_clumpSize;
/// <summary>0x07C</summary> /// <summary>0x07C</summary>
public uint allocationFile_totalBlocks; public readonly uint allocationFile_totalBlocks;
/// <summary>0x080</summary> /// <summary>0x080</summary>
public uint allocationFile_extents_startBlock0; public readonly uint allocationFile_extents_startBlock0;
/// <summary>0x084</summary> /// <summary>0x084</summary>
public uint allocationFile_extents_blockCount0; public readonly uint allocationFile_extents_blockCount0;
/// <summary>0x088</summary> /// <summary>0x088</summary>
public uint allocationFile_extents_startBlock1; public readonly uint allocationFile_extents_startBlock1;
/// <summary>0x08C</summary> /// <summary>0x08C</summary>
public uint allocationFile_extents_blockCount1; public readonly uint allocationFile_extents_blockCount1;
/// <summary>0x090</summary> /// <summary>0x090</summary>
public uint allocationFile_extents_startBlock2; public readonly uint allocationFile_extents_startBlock2;
/// <summary>0x094</summary> /// <summary>0x094</summary>
public uint allocationFile_extents_blockCount2; public readonly uint allocationFile_extents_blockCount2;
/// <summary>0x098</summary> /// <summary>0x098</summary>
public uint allocationFile_extents_startBlock3; public readonly uint allocationFile_extents_startBlock3;
/// <summary>0x09C</summary> /// <summary>0x09C</summary>
public uint allocationFile_extents_blockCount3; public readonly uint allocationFile_extents_blockCount3;
/// <summary>0x0A0</summary> /// <summary>0x0A0</summary>
public uint allocationFile_extents_startBlock4; public readonly uint allocationFile_extents_startBlock4;
/// <summary>0x0A4</summary> /// <summary>0x0A4</summary>
public uint allocationFile_extents_blockCount4; public readonly uint allocationFile_extents_blockCount4;
/// <summary>0x0A8</summary> /// <summary>0x0A8</summary>
public uint allocationFile_extents_startBlock5; public readonly uint allocationFile_extents_startBlock5;
/// <summary>0x0AC</summary> /// <summary>0x0AC</summary>
public uint allocationFile_extents_blockCount5; public readonly uint allocationFile_extents_blockCount5;
/// <summary>0x0B0</summary> /// <summary>0x0B0</summary>
public uint allocationFile_extents_startBlock6; public readonly uint allocationFile_extents_startBlock6;
/// <summary>0x0B4</summary> /// <summary>0x0B4</summary>
public uint allocationFile_extents_blockCount6; public readonly uint allocationFile_extents_blockCount6;
/// <summary>0x0B8</summary> /// <summary>0x0B8</summary>
public uint allocationFile_extents_startBlock7; public readonly uint allocationFile_extents_startBlock7;
/// <summary>0x0BC</summary> /// <summary>0x0BC</summary>
public uint allocationFile_extents_blockCount7; public readonly uint allocationFile_extents_blockCount7;
// HFSPlusForkData extentsFile; // HFSPlusForkData extentsFile;
/// <summary>0x0C0</summary> /// <summary>0x0C0</summary>
public ulong extentsFile_logicalSize; public readonly ulong extentsFile_logicalSize;
/// <summary>0x0C8</summary> /// <summary>0x0C8</summary>
public uint extentsFile_clumpSize; public readonly uint extentsFile_clumpSize;
/// <summary>0x0CC</summary> /// <summary>0x0CC</summary>
public uint extentsFile_totalBlocks; public readonly uint extentsFile_totalBlocks;
/// <summary>0x0D0</summary> /// <summary>0x0D0</summary>
public uint extentsFile_extents_startBlock0; public readonly uint extentsFile_extents_startBlock0;
/// <summary>0x0D4</summary> /// <summary>0x0D4</summary>
public uint extentsFile_extents_blockCount0; public readonly uint extentsFile_extents_blockCount0;
/// <summary>0x0D8</summary> /// <summary>0x0D8</summary>
public uint extentsFile_extents_startBlock1; public readonly uint extentsFile_extents_startBlock1;
/// <summary>0x0DC</summary> /// <summary>0x0DC</summary>
public uint extentsFile_extents_blockCount1; public readonly uint extentsFile_extents_blockCount1;
/// <summary>0x0E0</summary> /// <summary>0x0E0</summary>
public uint extentsFile_extents_startBlock2; public readonly uint extentsFile_extents_startBlock2;
/// <summary>0x0E4</summary> /// <summary>0x0E4</summary>
public uint extentsFile_extents_blockCount2; public readonly uint extentsFile_extents_blockCount2;
/// <summary>0x0E8</summary> /// <summary>0x0E8</summary>
public uint extentsFile_extents_startBlock3; public readonly uint extentsFile_extents_startBlock3;
/// <summary>0x0EC</summary> /// <summary>0x0EC</summary>
public uint extentsFile_extents_blockCount3; public readonly uint extentsFile_extents_blockCount3;
/// <summary>0x0F0</summary> /// <summary>0x0F0</summary>
public uint extentsFile_extents_startBlock4; public readonly uint extentsFile_extents_startBlock4;
/// <summary>0x0F4</summary> /// <summary>0x0F4</summary>
public uint extentsFile_extents_blockCount4; public readonly uint extentsFile_extents_blockCount4;
/// <summary>0x0F8</summary> /// <summary>0x0F8</summary>
public uint extentsFile_extents_startBlock5; public readonly uint extentsFile_extents_startBlock5;
/// <summary>0x0FC</summary> /// <summary>0x0FC</summary>
public uint extentsFile_extents_blockCount5; public readonly uint extentsFile_extents_blockCount5;
/// <summary>0x100</summary> /// <summary>0x100</summary>
public uint extentsFile_extents_startBlock6; public readonly uint extentsFile_extents_startBlock6;
/// <summary>0x104</summary> /// <summary>0x104</summary>
public uint extentsFile_extents_blockCount6; public readonly uint extentsFile_extents_blockCount6;
/// <summary>0x108</summary> /// <summary>0x108</summary>
public uint extentsFile_extents_startBlock7; public readonly uint extentsFile_extents_startBlock7;
/// <summary>0x10C</summary> /// <summary>0x10C</summary>
public uint extentsFile_extents_blockCount7; public readonly uint extentsFile_extents_blockCount7;
// HFSPlusForkData catalogFile; // HFSPlusForkData catalogFile;
/// <summary>0x110</summary> /// <summary>0x110</summary>
public ulong catalogFile_logicalSize; public readonly ulong catalogFile_logicalSize;
/// <summary>0x118</summary> /// <summary>0x118</summary>
public uint catalogFile_clumpSize; public readonly uint catalogFile_clumpSize;
/// <summary>0x11C</summary> /// <summary>0x11C</summary>
public uint catalogFile_totalBlocks; public readonly uint catalogFile_totalBlocks;
/// <summary>0x120</summary> /// <summary>0x120</summary>
public uint catalogFile_extents_startBlock0; public readonly uint catalogFile_extents_startBlock0;
/// <summary>0x124</summary> /// <summary>0x124</summary>
public uint catalogFile_extents_blockCount0; public readonly uint catalogFile_extents_blockCount0;
/// <summary>0x128</summary> /// <summary>0x128</summary>
public uint catalogFile_extents_startBlock1; public readonly uint catalogFile_extents_startBlock1;
/// <summary>0x12C</summary> /// <summary>0x12C</summary>
public uint catalogFile_extents_blockCount1; public readonly uint catalogFile_extents_blockCount1;
/// <summary>0x130</summary> /// <summary>0x130</summary>
public uint catalogFile_extents_startBlock2; public readonly uint catalogFile_extents_startBlock2;
/// <summary>0x134</summary> /// <summary>0x134</summary>
public uint catalogFile_extents_blockCount2; public readonly uint catalogFile_extents_blockCount2;
/// <summary>0x138</summary> /// <summary>0x138</summary>
public uint catalogFile_extents_startBlock3; public readonly uint catalogFile_extents_startBlock3;
/// <summary>0x13C</summary> /// <summary>0x13C</summary>
public uint catalogFile_extents_blockCount3; public readonly uint catalogFile_extents_blockCount3;
/// <summary>0x140</summary> /// <summary>0x140</summary>
public uint catalogFile_extents_startBlock4; public readonly uint catalogFile_extents_startBlock4;
/// <summary>0x144</summary> /// <summary>0x144</summary>
public uint catalogFile_extents_blockCount4; public readonly uint catalogFile_extents_blockCount4;
/// <summary>0x148</summary> /// <summary>0x148</summary>
public uint catalogFile_extents_startBlock5; public readonly uint catalogFile_extents_startBlock5;
/// <summary>0x14C</summary> /// <summary>0x14C</summary>
public uint catalogFile_extents_blockCount5; public readonly uint catalogFile_extents_blockCount5;
/// <summary>0x150</summary> /// <summary>0x150</summary>
public uint catalogFile_extents_startBlock6; public readonly uint catalogFile_extents_startBlock6;
/// <summary>0x154</summary> /// <summary>0x154</summary>
public uint catalogFile_extents_blockCount6; public readonly uint catalogFile_extents_blockCount6;
/// <summary>0x158</summary> /// <summary>0x158</summary>
public uint catalogFile_extents_startBlock7; public readonly uint catalogFile_extents_startBlock7;
/// <summary>0x15C</summary> /// <summary>0x15C</summary>
public uint catalogFile_extents_blockCount7; public readonly uint catalogFile_extents_blockCount7;
// HFSPlusForkData attributesFile; // HFSPlusForkData attributesFile;
/// <summary>0x160</summary> /// <summary>0x160</summary>
public ulong attributesFile_logicalSize; public readonly ulong attributesFile_logicalSize;
/// <summary>0x168</summary> /// <summary>0x168</summary>
public uint attributesFile_clumpSize; public readonly uint attributesFile_clumpSize;
/// <summary>0x16C</summary> /// <summary>0x16C</summary>
public uint attributesFile_totalBlocks; public readonly uint attributesFile_totalBlocks;
/// <summary>0x170</summary> /// <summary>0x170</summary>
public uint attributesFile_extents_startBlock0; public readonly uint attributesFile_extents_startBlock0;
/// <summary>0x174</summary> /// <summary>0x174</summary>
public uint attributesFile_extents_blockCount0; public readonly uint attributesFile_extents_blockCount0;
/// <summary>0x178</summary> /// <summary>0x178</summary>
public uint attributesFile_extents_startBlock1; public readonly uint attributesFile_extents_startBlock1;
/// <summary>0x17C</summary> /// <summary>0x17C</summary>
public uint attributesFile_extents_blockCount1; public readonly uint attributesFile_extents_blockCount1;
/// <summary>0x180</summary> /// <summary>0x180</summary>
public uint attributesFile_extents_startBlock2; public readonly uint attributesFile_extents_startBlock2;
/// <summary>0x184</summary> /// <summary>0x184</summary>
public uint attributesFile_extents_blockCount2; public readonly uint attributesFile_extents_blockCount2;
/// <summary>0x188</summary> /// <summary>0x188</summary>
public uint attributesFile_extents_startBlock3; public readonly uint attributesFile_extents_startBlock3;
/// <summary>0x18C</summary> /// <summary>0x18C</summary>
public uint attributesFile_extents_blockCount3; public readonly uint attributesFile_extents_blockCount3;
/// <summary>0x190</summary> /// <summary>0x190</summary>
public uint attributesFile_extents_startBlock4; public readonly uint attributesFile_extents_startBlock4;
/// <summary>0x194</summary> /// <summary>0x194</summary>
public uint attributesFile_extents_blockCount4; public readonly uint attributesFile_extents_blockCount4;
/// <summary>0x198</summary> /// <summary>0x198</summary>
public uint attributesFile_extents_startBlock5; public readonly uint attributesFile_extents_startBlock5;
/// <summary>0x19C</summary> /// <summary>0x19C</summary>
public uint attributesFile_extents_blockCount5; public readonly uint attributesFile_extents_blockCount5;
/// <summary>0x1A0</summary> /// <summary>0x1A0</summary>
public uint attributesFile_extents_startBlock6; public readonly uint attributesFile_extents_startBlock6;
/// <summary>0x1A4</summary> /// <summary>0x1A4</summary>
public uint attributesFile_extents_blockCount6; public readonly uint attributesFile_extents_blockCount6;
/// <summary>0x1A8</summary> /// <summary>0x1A8</summary>
public uint attributesFile_extents_startBlock7; public readonly uint attributesFile_extents_startBlock7;
/// <summary>0x1AC</summary> /// <summary>0x1AC</summary>
public uint attributesFile_extents_blockCount7; public readonly uint attributesFile_extents_blockCount7;
// HFSPlusForkData startupFile; // HFSPlusForkData startupFile;
/// <summary>0x1B0</summary> /// <summary>0x1B0</summary>
public ulong startupFile_logicalSize; public readonly ulong startupFile_logicalSize;
/// <summary>0x1B8</summary> /// <summary>0x1B8</summary>
public uint startupFile_clumpSize; public readonly uint startupFile_clumpSize;
/// <summary>0x1BC</summary> /// <summary>0x1BC</summary>
public uint startupFile_totalBlocks; public readonly uint startupFile_totalBlocks;
/// <summary>0x1C0</summary> /// <summary>0x1C0</summary>
public uint startupFile_extents_startBlock0; public readonly uint startupFile_extents_startBlock0;
/// <summary>0x1C4</summary> /// <summary>0x1C4</summary>
public uint startupFile_extents_blockCount0; public readonly uint startupFile_extents_blockCount0;
/// <summary>0x1C8</summary> /// <summary>0x1C8</summary>
public uint startupFile_extents_startBlock1; public readonly uint startupFile_extents_startBlock1;
/// <summary>0x1D0</summary> /// <summary>0x1D0</summary>
public uint startupFile_extents_blockCount1; public readonly uint startupFile_extents_blockCount1;
/// <summary>0x1D4</summary> /// <summary>0x1D4</summary>
public uint startupFile_extents_startBlock2; public readonly uint startupFile_extents_startBlock2;
/// <summary>0x1D8</summary> /// <summary>0x1D8</summary>
public uint startupFile_extents_blockCount2; public readonly uint startupFile_extents_blockCount2;
/// <summary>0x1DC</summary> /// <summary>0x1DC</summary>
public uint startupFile_extents_startBlock3; public readonly uint startupFile_extents_startBlock3;
/// <summary>0x1E0</summary> /// <summary>0x1E0</summary>
public uint startupFile_extents_blockCount3; public readonly uint startupFile_extents_blockCount3;
/// <summary>0x1E4</summary> /// <summary>0x1E4</summary>
public uint startupFile_extents_startBlock4; public readonly uint startupFile_extents_startBlock4;
/// <summary>0x1E8</summary> /// <summary>0x1E8</summary>
public uint startupFile_extents_blockCount4; public readonly uint startupFile_extents_blockCount4;
/// <summary>0x1EC</summary> /// <summary>0x1EC</summary>
public uint startupFile_extents_startBlock5; public readonly uint startupFile_extents_startBlock5;
/// <summary>0x1F0</summary> /// <summary>0x1F0</summary>
public uint startupFile_extents_blockCount5; public readonly uint startupFile_extents_blockCount5;
/// <summary>0x1F4</summary> /// <summary>0x1F4</summary>
public uint startupFile_extents_startBlock6; public readonly uint startupFile_extents_startBlock6;
/// <summary>0x1F8</summary> /// <summary>0x1F8</summary>
public uint startupFile_extents_blockCount6; public readonly uint startupFile_extents_blockCount6;
/// <summary>0x1FC</summary> /// <summary>0x1FC</summary>
public uint startupFile_extents_startBlock7; public readonly uint startupFile_extents_startBlock7;
/// <summary>0x200</summary> /// <summary>0x200</summary>
public uint startupFile_extents_blockCount7; public readonly uint startupFile_extents_blockCount7;
} }
} }
} }

View File

@@ -184,7 +184,7 @@ namespace DiscImageChef.Filesystems.AppleMFS
XmlFsType.Bootable = bb.signature == MFSBB_MAGIC; XmlFsType.Bootable = bb.signature == MFSBB_MAGIC;
XmlFsType.Clusters = mdb.drNmAlBlks; XmlFsType.Clusters = mdb.drNmAlBlks;
XmlFsType.ClusterSize = (int)mdb.drAlBlkSiz; XmlFsType.ClusterSize = mdb.drAlBlkSiz;
if(mdb.drCrDate > 0) if(mdb.drCrDate > 0)
{ {
XmlFsType.CreationDate = DateHandlers.MacToDateTime(mdb.drCrDate); XmlFsType.CreationDate = DateHandlers.MacToDateTime(mdb.drCrDate);

View File

@@ -144,7 +144,7 @@ namespace DiscImageChef.Filesystems.AppleMFS
XmlFsType.Bootable = bbSig == MFSBB_MAGIC; XmlFsType.Bootable = bbSig == MFSBB_MAGIC;
XmlFsType.Clusters = volMDB.drNmAlBlks; XmlFsType.Clusters = volMDB.drNmAlBlks;
XmlFsType.ClusterSize = (int)volMDB.drAlBlkSiz; XmlFsType.ClusterSize = volMDB.drAlBlkSiz;
if(volMDB.drCrDate > 0) if(volMDB.drCrDate > 0)
{ {
XmlFsType.CreationDate = DateHandlers.MacToDateTime(volMDB.drCrDate); XmlFsType.CreationDate = DateHandlers.MacToDateTime(volMDB.drCrDate);

View File

@@ -135,10 +135,10 @@ namespace DiscImageChef.Filesystems
XmlFsType = new FileSystemType XmlFsType = new FileSystemType
{ {
Clusters = afsSb.num_blocks, Clusters = (ulong)afsSb.num_blocks,
ClusterSize = (int)afsSb.block_size, ClusterSize = afsSb.block_size,
Dirty = false, Dirty = false,
FreeClusters = afsSb.num_blocks - afsSb.used_blocks, FreeClusters = (ulong)(afsSb.num_blocks - afsSb.used_blocks),
FreeClustersSpecified = true, FreeClustersSpecified = true,
Type = "AtheOS filesystem", Type = "AtheOS filesystem",
VolumeName = StringHandlers.CToString(afsSb.name, Encoding) VolumeName = StringHandlers.CToString(afsSb.name, Encoding)
@@ -153,65 +153,65 @@ namespace DiscImageChef.Filesystems
{ {
/// <summary>0x000, Volume name, 32 bytes</summary> /// <summary>0x000, Volume name, 32 bytes</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] name; public readonly byte[] name;
/// <summary>0x020, "AFS1", 0x41465331</summary> /// <summary>0x020, "AFS1", 0x41465331</summary>
public uint magic1; public readonly uint magic1;
/// <summary>0x024, "BIGE", 0x42494745</summary> /// <summary>0x024, "BIGE", 0x42494745</summary>
public uint fs_byte_order; public readonly uint fs_byte_order;
/// <summary>0x028, Bytes per block</summary> /// <summary>0x028, Bytes per block</summary>
public uint block_size; public readonly uint block_size;
/// <summary>0x02C, 1 &lt;&lt; block_shift == block_size</summary> /// <summary>0x02C, 1 &lt;&lt; block_shift == block_size</summary>
public uint block_shift; public readonly uint block_shift;
/// <summary>0x030, Blocks in volume</summary> /// <summary>0x030, Blocks in volume</summary>
public long num_blocks; public readonly long num_blocks;
/// <summary>0x038, Used blocks in volume</summary> /// <summary>0x038, Used blocks in volume</summary>
public long used_blocks; public readonly long used_blocks;
/// <summary>0x040, Bytes per inode</summary> /// <summary>0x040, Bytes per inode</summary>
public int inode_size; public readonly int inode_size;
/// <summary>0x044, 0xDD121031</summary> /// <summary>0x044, 0xDD121031</summary>
public uint magic2; public readonly uint magic2;
/// <summary>0x048, Blocks per allocation group</summary> /// <summary>0x048, Blocks per allocation group</summary>
public int blocks_per_ag; public readonly int blocks_per_ag;
/// <summary>0x04C, 1 &lt;&lt; ag_shift == blocks_per_ag</summary> /// <summary>0x04C, 1 &lt;&lt; ag_shift == blocks_per_ag</summary>
public int ag_shift; public readonly int ag_shift;
/// <summary>0x050, Allocation groups in volume</summary> /// <summary>0x050, Allocation groups in volume</summary>
public int num_ags; public readonly int num_ags;
/// <summary>0x054, 0x434c454e if clean, 0x44495254 if dirty</summary> /// <summary>0x054, 0x434c454e if clean, 0x44495254 if dirty</summary>
public uint flags; public readonly uint flags;
/// <summary>0x058, Allocation group of journal</summary> /// <summary>0x058, Allocation group of journal</summary>
public int log_blocks_ag; public readonly int log_blocks_ag;
/// <summary>0x05C, Start block of journal, inside ag</summary> /// <summary>0x05C, Start block of journal, inside ag</summary>
public ushort log_blocks_start; public readonly ushort log_blocks_start;
/// <summary>0x05E, Length in blocks of journal, inside ag</summary> /// <summary>0x05E, Length in blocks of journal, inside ag</summary>
public ushort log_blocks_len; public readonly ushort log_blocks_len;
/// <summary>0x060, Start of journal</summary> /// <summary>0x060, Start of journal</summary>
public long log_start; public readonly long log_start;
/// <summary>0x068, Valid block logs</summary> /// <summary>0x068, Valid block logs</summary>
public int log_valid_blocks; public readonly int log_valid_blocks;
/// <summary>0x06C, Log size</summary> /// <summary>0x06C, Log size</summary>
public int log_size; public readonly int log_size;
/// <summary>0x070, 0x15B6830E</summary> /// <summary>0x070, 0x15B6830E</summary>
public uint magic3; public readonly uint magic3;
/// <summary>0x074, Allocation group where root folder's i-node resides</summary> /// <summary>0x074, Allocation group where root folder's i-node resides</summary>
public int root_dir_ag; public readonly int root_dir_ag;
/// <summary>0x078, Start in ag of root folder's i-node</summary> /// <summary>0x078, Start in ag of root folder's i-node</summary>
public ushort root_dir_start; public readonly ushort root_dir_start;
/// <summary>0x07A, As this is part of inode_addr, this is 1</summary> /// <summary>0x07A, As this is part of inode_addr, this is 1</summary>
public ushort root_dir_len; public readonly ushort root_dir_len;
/// <summary>0x07C, Allocation group where pending-delete-files' i-node resides</summary> /// <summary>0x07C, Allocation group where pending-delete-files' i-node resides</summary>
public int deleted_ag; public readonly int deleted_ag;
/// <summary>0x080, Start in ag of pending-delete-files' i-node</summary> /// <summary>0x080, Start in ag of pending-delete-files' i-node</summary>
public ushort deleted_start; public readonly ushort deleted_start;
/// <summary>0x082, As this is part of inode_addr, this is 1</summary> /// <summary>0x082, As this is part of inode_addr, this is 1</summary>
public ushort deleted_len; public readonly ushort deleted_len;
/// <summary>0x084, Allocation group where indices' i-node resides</summary> /// <summary>0x084, Allocation group where indices' i-node resides</summary>
public int indices_ag; public readonly int indices_ag;
/// <summary>0x088, Start in ag of indices' i-node</summary> /// <summary>0x088, Start in ag of indices' i-node</summary>
public ushort indices_start; public readonly ushort indices_start;
/// <summary>0x08A, As this is part of inode_addr, this is 1</summary> /// <summary>0x08A, As this is part of inode_addr, this is 1</summary>
public ushort indices_len; public readonly ushort indices_len;
/// <summary>0x08C, Size of bootloader</summary> /// <summary>0x08C, Size of bootloader</summary>
public int boot_size; public readonly int boot_size;
} }
} }
} }

View File

@@ -192,10 +192,10 @@ namespace DiscImageChef.Filesystems
XmlFsType = new FileSystemType XmlFsType = new FileSystemType
{ {
Clusters = besb.num_blocks, Clusters = (ulong)besb.num_blocks,
ClusterSize = (int)besb.block_size, ClusterSize = besb.block_size,
Dirty = besb.flags == BEFS_DIRTY, Dirty = besb.flags == BEFS_DIRTY,
FreeClusters = besb.num_blocks - besb.used_blocks, FreeClusters = (ulong)(besb.num_blocks - besb.used_blocks),
FreeClustersSpecified = true, FreeClustersSpecified = true,
Type = "BeFS", Type = "BeFS",
VolumeName = StringHandlers.CToString(besb.name, Encoding) VolumeName = StringHandlers.CToString(besb.name, Encoding)
@@ -210,55 +210,55 @@ namespace DiscImageChef.Filesystems
{ {
/// <summary>0x000, Volume name, 32 bytes</summary> /// <summary>0x000, Volume name, 32 bytes</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] name; public readonly byte[] name;
/// <summary>0x020, "BFS1", 0x42465331</summary> /// <summary>0x020, "BFS1", 0x42465331</summary>
public uint magic1; public uint magic1;
/// <summary>0x024, "BIGE", 0x42494745</summary> /// <summary>0x024, "BIGE", 0x42494745</summary>
public uint fs_byte_order; public readonly uint fs_byte_order;
/// <summary>0x028, Bytes per block</summary> /// <summary>0x028, Bytes per block</summary>
public uint block_size; public readonly uint block_size;
/// <summary>0x02C, 1 &lt;&lt; block_shift == block_size</summary> /// <summary>0x02C, 1 &lt;&lt; block_shift == block_size</summary>
public uint block_shift; public readonly uint block_shift;
/// <summary>0x030, Blocks in volume</summary> /// <summary>0x030, Blocks in volume</summary>
public long num_blocks; public readonly long num_blocks;
/// <summary>0x038, Used blocks in volume</summary> /// <summary>0x038, Used blocks in volume</summary>
public long used_blocks; public readonly long used_blocks;
/// <summary>0x040, Bytes per inode</summary> /// <summary>0x040, Bytes per inode</summary>
public int inode_size; public readonly int inode_size;
/// <summary>0x044, 0xDD121031</summary> /// <summary>0x044, 0xDD121031</summary>
public uint magic2; public readonly uint magic2;
/// <summary>0x048, Blocks per allocation group</summary> /// <summary>0x048, Blocks per allocation group</summary>
public int blocks_per_ag; public readonly int blocks_per_ag;
/// <summary>0x04C, 1 &lt;&lt; ag_shift == blocks_per_ag</summary> /// <summary>0x04C, 1 &lt;&lt; ag_shift == blocks_per_ag</summary>
public int ag_shift; public readonly int ag_shift;
/// <summary>0x050, Allocation groups in volume</summary> /// <summary>0x050, Allocation groups in volume</summary>
public int num_ags; public readonly int num_ags;
/// <summary>0x054, 0x434c454e if clean, 0x44495254 if dirty</summary> /// <summary>0x054, 0x434c454e if clean, 0x44495254 if dirty</summary>
public uint flags; public readonly uint flags;
/// <summary>0x058, Allocation group of journal</summary> /// <summary>0x058, Allocation group of journal</summary>
public int log_blocks_ag; public readonly int log_blocks_ag;
/// <summary>0x05C, Start block of journal, inside ag</summary> /// <summary>0x05C, Start block of journal, inside ag</summary>
public ushort log_blocks_start; public readonly ushort log_blocks_start;
/// <summary>0x05E, Length in blocks of journal, inside ag</summary> /// <summary>0x05E, Length in blocks of journal, inside ag</summary>
public ushort log_blocks_len; public readonly ushort log_blocks_len;
/// <summary>0x060, Start of journal</summary> /// <summary>0x060, Start of journal</summary>
public long log_start; public readonly long log_start;
/// <summary>0x068, End of journal</summary> /// <summary>0x068, End of journal</summary>
public long log_end; public readonly long log_end;
/// <summary>0x070, 0x15B6830E</summary> /// <summary>0x070, 0x15B6830E</summary>
public uint magic3; public readonly uint magic3;
/// <summary>0x074, Allocation group where root folder's i-node resides</summary> /// <summary>0x074, Allocation group where root folder's i-node resides</summary>
public int root_dir_ag; public readonly int root_dir_ag;
/// <summary>0x078, Start in ag of root folder's i-node</summary> /// <summary>0x078, Start in ag of root folder's i-node</summary>
public ushort root_dir_start; public readonly ushort root_dir_start;
/// <summary>0x07A, As this is part of inode_addr, this is 1</summary> /// <summary>0x07A, As this is part of inode_addr, this is 1</summary>
public ushort root_dir_len; public readonly ushort root_dir_len;
/// <summary>0x07C, Allocation group where indices' i-node resides</summary> /// <summary>0x07C, Allocation group where indices' i-node resides</summary>
public int indices_ag; public readonly int indices_ag;
/// <summary>0x080, Start in ag of indices' i-node</summary> /// <summary>0x080, Start in ag of indices' i-node</summary>
public ushort indices_start; public readonly ushort indices_start;
/// <summary>0x082, As this is part of inode_addr, this is 1</summary> /// <summary>0x082, As this is part of inode_addr, this is 1</summary>
public ushort indices_len; public readonly ushort indices_len;
} }
} }
} }

View File

@@ -165,76 +165,76 @@ namespace DiscImageChef.Filesystems
XmlFsType = new FileSystemType XmlFsType = new FileSystemType
{ {
Clusters = (long)(btrfsSb.total_bytes / btrfsSb.sectorsize), Clusters = btrfsSb.total_bytes / btrfsSb.sectorsize,
ClusterSize = (int)btrfsSb.sectorsize, ClusterSize = btrfsSb.sectorsize,
FreeClustersSpecified = true, FreeClustersSpecified = true,
VolumeName = btrfsSb.label, VolumeName = btrfsSb.label,
VolumeSerial = $"{btrfsSb.uuid}", VolumeSerial = $"{btrfsSb.uuid}",
VolumeSetIdentifier = $"{btrfsSb.dev_item.device_uuid}", VolumeSetIdentifier = $"{btrfsSb.dev_item.device_uuid}",
Type = Name Type = Name
}; };
XmlFsType.FreeClusters = XmlFsType.Clusters - (long)(btrfsSb.bytes_used / btrfsSb.sectorsize); XmlFsType.FreeClusters = XmlFsType.Clusters - btrfsSb.bytes_used / btrfsSb.sectorsize;
} }
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct SuperBlock struct SuperBlock
{ {
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x20)]
public byte[] checksum; public readonly byte[] checksum;
public Guid uuid; public readonly Guid uuid;
public ulong pba; public readonly ulong pba;
public ulong flags; public readonly ulong flags;
public ulong magic; public readonly ulong magic;
public ulong generation; public readonly ulong generation;
public ulong root_lba; public readonly ulong root_lba;
public ulong chunk_lba; public readonly ulong chunk_lba;
public ulong log_lba; public readonly ulong log_lba;
public ulong log_root_transid; public readonly ulong log_root_transid;
public ulong total_bytes; public readonly ulong total_bytes;
public ulong bytes_used; public readonly ulong bytes_used;
public ulong root_dir_objectid; public readonly ulong root_dir_objectid;
public ulong num_devices; public readonly ulong num_devices;
public uint sectorsize; public readonly uint sectorsize;
public uint nodesize; public readonly uint nodesize;
public uint leafsize; public readonly uint leafsize;
public uint stripesize; public readonly uint stripesize;
public uint n; public readonly uint n;
public ulong chunk_root_generation; public readonly ulong chunk_root_generation;
public ulong compat_flags; public readonly ulong compat_flags;
public ulong compat_ro_flags; public readonly ulong compat_ro_flags;
public ulong incompat_flags; public readonly ulong incompat_flags;
public ushort csum_type; public readonly ushort csum_type;
public byte root_level; public readonly byte root_level;
public byte chunk_root_level; public readonly byte chunk_root_level;
public byte log_root_level; public readonly byte log_root_level;
public DevItem dev_item; public readonly DevItem dev_item;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 0x100)] [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 0x100)]
public string label; public readonly string label;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x100)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x100)]
public byte[] reserved; public readonly byte[] reserved;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x800)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x800)]
public byte[] chunkpairs; public readonly byte[] chunkpairs;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x4D5)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x4D5)]
public byte[] unused; public readonly byte[] unused;
} }
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct DevItem struct DevItem
{ {
public ulong id; public readonly ulong id;
public ulong bytes; public readonly ulong bytes;
public ulong used; public readonly ulong used;
public uint optimal_align; public readonly uint optimal_align;
public uint optimal_width; public readonly uint optimal_width;
public uint minimal_size; public readonly uint minimal_size;
public ulong type; public readonly ulong type;
public ulong generation; public readonly ulong generation;
public ulong start_offset; public readonly ulong start_offset;
public uint dev_group; public readonly uint dev_group;
public byte seek_speed; public readonly byte seek_speed;
public byte bandwitdh; public readonly byte bandwitdh;
public Guid device_uuid; public readonly Guid device_uuid;
public Guid uuid; public readonly Guid uuid;
} }
} }
} }

View File

@@ -93,7 +93,7 @@ namespace DiscImageChef.Filesystems
XmlFsType = new FileSystemType XmlFsType = new FileSystemType
{ {
Type = "Commodore file system", Clusters = (long)imagePlugin.Info.Sectors, ClusterSize = 256 Type = "Commodore file system", Clusters = imagePlugin.Info.Sectors, ClusterSize = 256
}; };
if(imagePlugin.Info.Sectors == 3200) if(imagePlugin.Info.Sectors == 3200)
@@ -146,73 +146,73 @@ namespace DiscImageChef.Filesystems
/// <summary> /// <summary>
/// Track where directory starts /// Track where directory starts
/// </summary> /// </summary>
public byte directoryTrack; public readonly byte directoryTrack;
/// <summary> /// <summary>
/// Sector where directory starts /// Sector where directory starts
/// </summary> /// </summary>
public byte directorySector; public readonly byte directorySector;
/// <summary> /// <summary>
/// Disk DOS version, 0x41 /// Disk DOS version, 0x41
/// </summary> /// </summary>
public byte dosVersion; public readonly byte dosVersion;
/// <summary> /// <summary>
/// Set to 0x80 if 1571, 0x00 if not /// Set to 0x80 if 1571, 0x00 if not
/// </summary> /// </summary>
public byte doubleSided; public readonly byte doubleSided;
/// <summary> /// <summary>
/// Block allocation map /// Block allocation map
/// </summary> /// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 140)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 140)]
public byte[] bam; public readonly byte[] bam;
/// <summary> /// <summary>
/// Disk name /// Disk name
/// </summary> /// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] name; public readonly byte[] name;
/// <summary> /// <summary>
/// Filled with 0xA0 /// Filled with 0xA0
/// </summary> /// </summary>
public ushort fill1; public readonly ushort fill1;
/// <summary> /// <summary>
/// Disk ID /// Disk ID
/// </summary> /// </summary>
public ushort diskId; public readonly ushort diskId;
/// <summary> /// <summary>
/// Filled with 0xA0 /// Filled with 0xA0
/// </summary> /// </summary>
public byte fill2; public readonly byte fill2;
/// <summary> /// <summary>
/// DOS type /// DOS type
/// </summary> /// </summary>
public ushort dosType; public readonly ushort dosType;
/// <summary> /// <summary>
/// Filled with 0xA0 /// Filled with 0xA0
/// </summary> /// </summary>
public uint fill3; public readonly uint fill3;
/// <summary> /// <summary>
/// Unused /// Unused
/// </summary> /// </summary>
public byte unused1; public readonly byte unused1;
/// <summary> /// <summary>
/// Block allocation map for Dolphin DOS extended tracks /// Block allocation map for Dolphin DOS extended tracks
/// </summary> /// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
public byte[] dolphinBam; public readonly byte[] dolphinBam;
/// <summary> /// <summary>
/// Block allocation map for Speed DOS extended tracks /// Block allocation map for Speed DOS extended tracks
/// </summary> /// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
public byte[] speedBam; public readonly byte[] speedBam;
/// <summary> /// <summary>
/// Unused /// Unused
/// </summary> /// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 9)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 9)]
public byte[] unused2; public readonly byte[] unused2;
/// <summary> /// <summary>
/// Free sector count for second side in 1571 /// Free sector count for second side in 1571
/// </summary> /// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 9)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 9)]
public byte[] freeCount; public readonly byte[] freeCount;
} }
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
@@ -221,48 +221,48 @@ namespace DiscImageChef.Filesystems
/// <summary> /// <summary>
/// Track where directory starts /// Track where directory starts
/// </summary> /// </summary>
public byte directoryTrack; public readonly byte directoryTrack;
/// <summary> /// <summary>
/// Sector where directory starts /// Sector where directory starts
/// </summary> /// </summary>
public byte directorySector; public readonly byte directorySector;
/// <summary> /// <summary>
/// Disk DOS version, 0x44 /// Disk DOS version, 0x44
/// </summary> /// </summary>
public byte diskDosVersion; public readonly byte diskDosVersion;
/// <summary> /// <summary>
/// Unusued /// Unusued
/// </summary> /// </summary>
public byte unused1; public readonly byte unused1;
/// <summary> /// <summary>
/// Disk name /// Disk name
/// </summary> /// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] name; public readonly byte[] name;
/// <summary> /// <summary>
/// Filled with 0xA0 /// Filled with 0xA0
/// </summary> /// </summary>
public ushort fill1; public readonly ushort fill1;
/// <summary> /// <summary>
/// Disk ID /// Disk ID
/// </summary> /// </summary>
public ushort diskId; public readonly ushort diskId;
/// <summary> /// <summary>
/// Filled with 0xA0 /// Filled with 0xA0
/// </summary> /// </summary>
public byte fill2; public readonly byte fill2;
/// <summary> /// <summary>
/// DOS version ('3') /// DOS version ('3')
/// </summary> /// </summary>
public byte dosVersion; public readonly byte dosVersion;
/// <summary> /// <summary>
/// Disk version ('D') /// Disk version ('D')
/// </summary> /// </summary>
public byte diskVersion; public readonly byte diskVersion;
/// <summary> /// <summary>
/// Filled with 0xA0 /// Filled with 0xA0
/// </summary> /// </summary>
public short fill3; public readonly short fill3;
} }
} }
} }

View File

@@ -379,10 +379,8 @@ namespace DiscImageChef.Filesystems.CPM
// Check for alternate location of format ID // Check for alternate location of format ID
if(sector.Last() == 0x00 || sector.Last() == 0xFF) if(sector.Last() == 0x00 || sector.Last() == 0xFF)
if(sector[0x40] == 0x94 || sector[0x40] == 0x26) if(sector[0x40] == 0x94 || sector[0x40] == 0x26) formatByte = sector[0x40];
formatByte = sector[0x40]; else formatByte = sector.Last();
else
formatByte = sector.Last();
else formatByte = sector.Last(); else formatByte = sector.Last();
uint firstDirectorySector86 = 0; uint firstDirectorySector86 = 0;
@@ -1047,9 +1045,9 @@ namespace DiscImageChef.Filesystems.CPM
XmlFsType = new FileSystemType(); XmlFsType = new FileSystemType();
XmlFsType.Bootable |= workingDefinition.sofs > 0 || workingDefinition.ofs > 0; XmlFsType.Bootable |= workingDefinition.sofs > 0 || workingDefinition.ofs > 0;
XmlFsType.ClusterSize = 128 << dpb.bsh; XmlFsType.ClusterSize = (uint)(128 << dpb.bsh);
if(dpb.dsm > 0) XmlFsType.Clusters = dpb.dsm; if(dpb.dsm > 0) XmlFsType.Clusters = dpb.dsm;
else XmlFsType.Clusters = (long)(partition.End - partition.Start); else XmlFsType.Clusters = partition.End - partition.Start;
if(labelCreationDate != null) if(labelCreationDate != null)
{ {
XmlFsType.CreationDate = DateHandlers.CpmToDateTime(labelCreationDate); XmlFsType.CreationDate = DateHandlers.CpmToDateTime(labelCreationDate);

View File

@@ -640,10 +640,10 @@ namespace DiscImageChef.Filesystems.CPM
} }
// Generate statfs. // Generate statfs.
cpmStat.Blocks = dpb.dsm + 1; cpmStat.Blocks = (ulong)(dpb.dsm + 1);
cpmStat.FilenameLength = 11; cpmStat.FilenameLength = 11;
cpmStat.Files = (ulong)fileCache.Count; cpmStat.Files = (ulong)fileCache.Count;
cpmStat.FreeBlocks = cpmStat.Blocks - usedBlocks; cpmStat.FreeBlocks = cpmStat.Blocks - (ulong)usedBlocks;
cpmStat.PluginId = Id; cpmStat.PluginId = Id;
cpmStat.Type = "CP/M filesystem"; cpmStat.Type = "CP/M filesystem";
@@ -651,8 +651,8 @@ namespace DiscImageChef.Filesystems.CPM
XmlFsType = new FileSystemType XmlFsType = new FileSystemType
{ {
Clusters = cpmStat.Blocks, Clusters = cpmStat.Blocks,
ClusterSize = blockSize, ClusterSize = (uint)blockSize,
Files = fileCache.Count, Files = (ulong)fileCache.Count,
FilesSpecified = true, FilesSpecified = true,
FreeClusters = cpmStat.FreeBlocks, FreeClusters = cpmStat.FreeBlocks,
FreeClustersSpecified = true, FreeClustersSpecified = true,

View File

@@ -85,7 +85,7 @@ namespace DiscImageChef.Filesystems
{ {
Type = "ECMA-67", Type = "ECMA-67",
ClusterSize = 256, ClusterSize = 256,
Clusters = (long)(partition.End - partition.Start + 1), Clusters = partition.End - partition.Start + 1,
VolumeName = Encoding.ASCII.GetString(vol.volumeIdentifier) VolumeName = Encoding.ASCII.GetString(vol.volumeIdentifier)
}; };
@@ -96,27 +96,27 @@ namespace DiscImageChef.Filesystems
struct VolumeLabel struct VolumeLabel
{ {
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public byte[] labelIdentifier; public readonly byte[] labelIdentifier;
public byte labelNumber; public readonly byte labelNumber;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
public byte[] volumeIdentifier; public readonly byte[] volumeIdentifier;
public byte volumeAccessibility; public readonly byte volumeAccessibility;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 26)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 26)]
public byte[] reserved1; public readonly byte[] reserved1;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 14)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 14)]
public byte[] owner; public readonly byte[] owner;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
public byte[] reserved2; public readonly byte[] reserved2;
public byte surface; public readonly byte surface;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public byte[] reserved3; public readonly byte[] reserved3;
public byte recordLength; public readonly byte recordLength;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
public byte[] reserved4; public readonly byte[] reserved4;
public byte fileLabelAllocation; public readonly byte fileLabelAllocation;
public byte labelStandardVersion; public readonly byte labelStandardVersion;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 48)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 48)]
public byte[] reserved5; public readonly byte[] reserved5;
} }
} }
} }

View File

@@ -170,8 +170,8 @@ namespace DiscImageChef.Filesystems
{ {
Type = "Extent File System", Type = "Extent File System",
ClusterSize = 512, ClusterSize = 512,
Clusters = efsSb.sb_size, Clusters = (ulong)efsSb.sb_size,
FreeClusters = efsSb.sb_tfree, FreeClusters = (ulong)efsSb.sb_tfree,
FreeClustersSpecified = true, FreeClustersSpecified = true,
Dirty = efsSb.sb_dirty > 0, Dirty = efsSb.sb_dirty > 0,
VolumeName = StringHandlers.CToString(efsSb.sb_fname, Encoding), VolumeName = StringHandlers.CToString(efsSb.sb_fname, Encoding),
@@ -186,50 +186,50 @@ namespace DiscImageChef.Filesystems
struct EFS_Superblock struct EFS_Superblock
{ {
/* 0: fs size incl. bb 0 (in bb) */ /* 0: fs size incl. bb 0 (in bb) */
public int sb_size; public readonly int sb_size;
/* 4: first cg offset (in bb) */ /* 4: first cg offset (in bb) */
public int sb_firstcg; public readonly int sb_firstcg;
/* 8: cg size (in bb) */ /* 8: cg size (in bb) */
public int sb_cgfsize; public readonly int sb_cgfsize;
/* 12: inodes/cg (in bb) */ /* 12: inodes/cg (in bb) */
public short sb_cgisize; public readonly short sb_cgisize;
/* 14: geom: sectors/track */ /* 14: geom: sectors/track */
public short sb_sectors; public readonly short sb_sectors;
/* 16: geom: heads/cylinder (unused) */ /* 16: geom: heads/cylinder (unused) */
public short sb_heads; public readonly short sb_heads;
/* 18: num of cg's in the filesystem */ /* 18: num of cg's in the filesystem */
public short sb_ncg; public readonly short sb_ncg;
/* 20: non-0 indicates fsck required */ /* 20: non-0 indicates fsck required */
public short sb_dirty; public readonly short sb_dirty;
/* 22: */ /* 22: */
public short sb_pad0; public readonly short sb_pad0;
/* 24: superblock ctime */ /* 24: superblock ctime */
public int sb_time; public readonly int sb_time;
/* 28: magic [0] */ /* 28: magic [0] */
public uint sb_magic; public readonly uint sb_magic;
/* 32: name of filesystem */ /* 32: name of filesystem */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
public byte[] sb_fname; public readonly byte[] sb_fname;
/* 38: name of filesystem pack */ /* 38: name of filesystem pack */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
public byte[] sb_fpack; public readonly byte[] sb_fpack;
/* 44: bitmap size (in bytes) */ /* 44: bitmap size (in bytes) */
public int sb_bmsize; public readonly int sb_bmsize;
/* 48: total free data blocks */ /* 48: total free data blocks */
public int sb_tfree; public readonly int sb_tfree;
/* 52: total free inodes */ /* 52: total free inodes */
public int sb_tinode; public readonly int sb_tinode;
/* 56: bitmap offset (grown fs) */ /* 56: bitmap offset (grown fs) */
public int sb_bmblock; public readonly int sb_bmblock;
/* 62: repl. superblock offset */ /* 62: repl. superblock offset */
public int sb_replsb; public readonly int sb_replsb;
/* 64: last allocated inode */ /* 64: last allocated inode */
public int sb_lastinode; public readonly int sb_lastinode;
/* 68: unused */ /* 68: unused */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
public byte[] sb_spare; public readonly byte[] sb_spare;
/* 88: checksum (all above) */ /* 88: checksum (all above) */
public uint sb_checksum; public readonly uint sb_checksum;
} }
} }
} }

View File

@@ -124,8 +124,8 @@ namespace DiscImageChef.Filesystems
{ {
Type = "F2FS filesystem", Type = "F2FS filesystem",
SystemIdentifier = Encoding.ASCII.GetString(f2fsSb.version), SystemIdentifier = Encoding.ASCII.GetString(f2fsSb.version),
Clusters = (long)f2fsSb.block_count, Clusters = f2fsSb.block_count,
ClusterSize = 1 << (int)f2fsSb.log_blocksize, ClusterSize = (uint)(1 << (int)f2fsSb.log_blocksize),
DataPreparerIdentifier = Encoding.ASCII.GetString(f2fsSb.init_version), DataPreparerIdentifier = Encoding.ASCII.GetString(f2fsSb.init_version),
VolumeName = StringHandlers.CToString(f2fsSb.volume_name, Encoding.Unicode, true), VolumeName = StringHandlers.CToString(f2fsSb.volume_name, Encoding.Unicode, true),
VolumeSerial = f2fsSb.uuid.ToString() VolumeSerial = f2fsSb.uuid.ToString()
@@ -136,64 +136,64 @@ namespace DiscImageChef.Filesystems
[SuppressMessage("ReSharper", "InconsistentNaming")] [SuppressMessage("ReSharper", "InconsistentNaming")]
struct F2FS_Superblock struct F2FS_Superblock
{ {
public uint magic; public readonly uint magic;
public ushort major_ver; public readonly ushort major_ver;
public ushort minor_ver; public readonly ushort minor_ver;
public uint log_sectorsize; public readonly uint log_sectorsize;
public uint log_sectors_per_block; public readonly uint log_sectors_per_block;
public uint log_blocksize; public readonly uint log_blocksize;
public uint log_blocks_per_seg; public readonly uint log_blocks_per_seg;
public uint segs_per_sec; public readonly uint segs_per_sec;
public uint secs_per_zone; public readonly uint secs_per_zone;
public uint checksum_offset; public readonly uint checksum_offset;
public ulong block_count; public readonly ulong block_count;
public uint section_count; public readonly uint section_count;
public uint segment_count; public readonly uint segment_count;
public uint segment_count_ckpt; public readonly uint segment_count_ckpt;
public uint segment_count_sit; public readonly uint segment_count_sit;
public uint segment_count_nat; public readonly uint segment_count_nat;
public uint segment_count_ssa; public readonly uint segment_count_ssa;
public uint segment_count_main; public readonly uint segment_count_main;
public uint segment0_blkaddr; public readonly uint segment0_blkaddr;
public uint cp_blkaddr; public readonly uint cp_blkaddr;
public uint sit_blkaddr; public readonly uint sit_blkaddr;
public uint nat_blkaddr; public readonly uint nat_blkaddr;
public uint ssa_blkaddr; public readonly uint ssa_blkaddr;
public uint main_blkaddr; public readonly uint main_blkaddr;
public uint root_ino; public readonly uint root_ino;
public uint node_ino; public readonly uint node_ino;
public uint meta_ino; public readonly uint meta_ino;
public Guid uuid; public readonly Guid uuid;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1024)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1024)]
public byte[] volume_name; public readonly byte[] volume_name;
public uint extension_count; public readonly uint extension_count;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)]
public byte[] extension_list1; public readonly byte[] extension_list1;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)]
public byte[] extension_list2; public readonly byte[] extension_list2;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)]
public byte[] extension_list3; public readonly byte[] extension_list3;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)]
public byte[] extension_list4; public readonly byte[] extension_list4;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)]
public byte[] extension_list5; public readonly byte[] extension_list5;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)]
public byte[] extension_list6; public readonly byte[] extension_list6;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)]
public byte[] extension_list7; public readonly byte[] extension_list7;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)]
public byte[] extension_list8; public readonly byte[] extension_list8;
public uint cp_payload; public readonly uint cp_payload;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)]
public byte[] version; public readonly byte[] version;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)]
public byte[] init_version; public readonly byte[] init_version;
public uint feature; public readonly uint feature;
public byte encryption_level; public readonly byte encryption_level;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] encrypt_pw_salt; public readonly byte[] encrypt_pw_salt;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 871)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 871)]
public byte[] reserved; public readonly byte[] reserved;
} }
} }
} }

File diff suppressed because it is too large Load Diff

View File

@@ -97,13 +97,13 @@ namespace DiscImageChef.Filesystems.FATX
{ {
Type = "FATX filesystem", Type = "FATX filesystem",
ClusterSize = ClusterSize =
(int)(fatxSb.sectorsPerCluster * logicalSectorsPerPhysicalSectors * (uint)(fatxSb.sectorsPerCluster * logicalSectorsPerPhysicalSectors *
imagePlugin.Info.SectorSize), imagePlugin.Info.SectorSize),
VolumeName = volumeLabel, VolumeName = volumeLabel,
VolumeSerial = $"{fatxSb.id:X8}" VolumeSerial = $"{fatxSb.id:X8}"
}; };
XmlFsType.Clusters = (long)((partition.End - partition.Start + 1) * imagePlugin.Info.SectorSize / XmlFsType.Clusters = (partition.End - partition.Start + 1) * imagePlugin.Info.SectorSize /
(ulong)XmlFsType.ClusterSize); XmlFsType.ClusterSize;
} }
} }
} }

View File

@@ -85,13 +85,13 @@ namespace DiscImageChef.Filesystems.FATX
{ {
Type = "FATX filesystem", Type = "FATX filesystem",
ClusterSize = ClusterSize =
(int)(superblock.sectorsPerCluster * logicalSectorsPerPhysicalSectors * (uint)(superblock.sectorsPerCluster * logicalSectorsPerPhysicalSectors *
imagePlugin.Info.SectorSize), imagePlugin.Info.SectorSize),
VolumeName = volumeLabel, VolumeName = volumeLabel,
VolumeSerial = $"{superblock.id:X8}" VolumeSerial = $"{superblock.id:X8}"
}; };
XmlFsType.Clusters = (long)((partition.End - partition.Start + 1) * imagePlugin.Info.SectorSize / XmlFsType.Clusters = (partition.End - partition.Start + 1) * imagePlugin.Info.SectorSize /
(ulong)XmlFsType.ClusterSize); XmlFsType.ClusterSize;
statfs = new FileSystemInfo statfs = new FileSystemInfo
{ {

View File

@@ -346,8 +346,8 @@ namespace DiscImageChef.Filesystems
XmlFsType.ModificationDateSpecified = true; XmlFsType.ModificationDateSpecified = true;
sbInformation.AppendFormat("{0} blocks in volume ({1} bytes)", ufs_sb.fs_old_size, sbInformation.AppendFormat("{0} blocks in volume ({1} bytes)", ufs_sb.fs_old_size,
(long)ufs_sb.fs_old_size * ufs_sb.fs_fsize).AppendLine(); (long)ufs_sb.fs_old_size * ufs_sb.fs_fsize).AppendLine();
XmlFsType.Clusters = ufs_sb.fs_old_size; XmlFsType.Clusters = (ulong)ufs_sb.fs_old_size;
XmlFsType.ClusterSize = ufs_sb.fs_fsize; XmlFsType.ClusterSize = (uint)ufs_sb.fs_fsize;
sbInformation.AppendFormat("{0} data blocks in volume ({1} bytes)", ufs_sb.fs_old_dsize, sbInformation.AppendFormat("{0} data blocks in volume ({1} bytes)", ufs_sb.fs_old_dsize,
(long)ufs_sb.fs_old_dsize * ufs_sb.fs_fsize).AppendLine(); (long)ufs_sb.fs_old_dsize * ufs_sb.fs_fsize).AppendLine();
sbInformation.AppendFormat("{0} cylinder groups in volume", ufs_sb.fs_ncg).AppendLine(); sbInformation.AppendFormat("{0} cylinder groups in volume", ufs_sb.fs_ncg).AppendLine();
@@ -408,7 +408,7 @@ namespace DiscImageChef.Filesystems
sbInformation.AppendFormat("{0} directories", ufs_sb.fs_old_cstotal.cs_ndir).AppendLine(); sbInformation.AppendFormat("{0} directories", ufs_sb.fs_old_cstotal.cs_ndir).AppendLine();
sbInformation.AppendFormat("{0} free blocks ({1} bytes)", ufs_sb.fs_old_cstotal.cs_nbfree, sbInformation.AppendFormat("{0} free blocks ({1} bytes)", ufs_sb.fs_old_cstotal.cs_nbfree,
(long)ufs_sb.fs_old_cstotal.cs_nbfree * ufs_sb.fs_fsize).AppendLine(); (long)ufs_sb.fs_old_cstotal.cs_nbfree * ufs_sb.fs_fsize).AppendLine();
XmlFsType.FreeClusters = ufs_sb.fs_old_cstotal.cs_nbfree; XmlFsType.FreeClusters = (ulong)ufs_sb.fs_old_cstotal.cs_nbfree;
XmlFsType.FreeClustersSpecified = true; XmlFsType.FreeClustersSpecified = true;
sbInformation.AppendFormat("{0} free inodes", ufs_sb.fs_old_cstotal.cs_nifree).AppendLine(); sbInformation.AppendFormat("{0} free inodes", ufs_sb.fs_old_cstotal.cs_nifree).AppendLine();
sbInformation.AppendFormat("{0} free frags", ufs_sb.fs_old_cstotal.cs_nffree).AppendLine(); sbInformation.AppendFormat("{0} free frags", ufs_sb.fs_old_cstotal.cs_nffree).AppendLine();
@@ -439,7 +439,7 @@ namespace DiscImageChef.Filesystems
sbInformation.AppendFormat("{0} directories", ufs_sb.fs_cstotal.cs_ndir).AppendLine(); sbInformation.AppendFormat("{0} directories", ufs_sb.fs_cstotal.cs_ndir).AppendLine();
sbInformation.AppendFormat("{0} free blocks ({1} bytes)", ufs_sb.fs_cstotal.cs_nbfree, sbInformation.AppendFormat("{0} free blocks ({1} bytes)", ufs_sb.fs_cstotal.cs_nbfree,
ufs_sb.fs_cstotal.cs_nbfree * ufs_sb.fs_fsize).AppendLine(); ufs_sb.fs_cstotal.cs_nbfree * ufs_sb.fs_fsize).AppendLine();
XmlFsType.FreeClusters = ufs_sb.fs_cstotal.cs_nbfree; XmlFsType.FreeClusters = (ulong)ufs_sb.fs_cstotal.cs_nbfree;
XmlFsType.FreeClustersSpecified = true; XmlFsType.FreeClustersSpecified = true;
sbInformation.AppendFormat("{0} free inodes", ufs_sb.fs_cstotal.cs_nifree).AppendLine(); sbInformation.AppendFormat("{0} free inodes", ufs_sb.fs_cstotal.cs_nifree).AppendLine();
sbInformation.AppendFormat("{0} free frags", ufs_sb.fs_cstotal.cs_nffree).AppendLine(); sbInformation.AppendFormat("{0} free frags", ufs_sb.fs_cstotal.cs_nffree).AppendLine();
@@ -450,7 +450,7 @@ namespace DiscImageChef.Filesystems
XmlFsType.ModificationDateSpecified = true; XmlFsType.ModificationDateSpecified = true;
sbInformation.AppendFormat("{0} blocks ({1} bytes)", ufs_sb.fs_size, ufs_sb.fs_size * ufs_sb.fs_fsize) sbInformation.AppendFormat("{0} blocks ({1} bytes)", ufs_sb.fs_size, ufs_sb.fs_size * ufs_sb.fs_fsize)
.AppendLine(); .AppendLine();
XmlFsType.Clusters = ufs_sb.fs_size; XmlFsType.Clusters = (ulong)ufs_sb.fs_size;
sbInformation sbInformation
.AppendFormat("{0} data blocks ({1} bytes)", ufs_sb.fs_dsize, ufs_sb.fs_dsize * ufs_sb.fs_fsize) .AppendFormat("{0} data blocks ({1} bytes)", ufs_sb.fs_dsize, ufs_sb.fs_dsize * ufs_sb.fs_fsize)
.AppendLine(); .AppendLine();
@@ -509,242 +509,242 @@ namespace DiscImageChef.Filesystems
public long cs_numclusters; public long cs_numclusters;
/// <summary>future expansion</summary> /// <summary>future expansion</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public long[] cs_spare; public readonly long[] cs_spare;
} }
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct UFSSuperBlock struct UFSSuperBlock
{ {
/// <summary>linked list of file systems</summary> /// <summary>linked list of file systems</summary>
public uint fs_link; public readonly uint fs_link;
/// <summary> /// <summary>
/// used for incore super blocks /// used for incore super blocks
/// on Sun: uint fs_rolled; // logging only: fs fully rolled /// on Sun: uint fs_rolled; // logging only: fs fully rolled
/// </summary> /// </summary>
public uint fs_rlink; public readonly uint fs_rlink;
/// <summary>addr of super-block in filesys</summary> /// <summary>addr of super-block in filesys</summary>
public int fs_sblkno; public readonly int fs_sblkno;
/// <summary>offset of cyl-block in filesys</summary> /// <summary>offset of cyl-block in filesys</summary>
public int fs_cblkno; public readonly int fs_cblkno;
/// <summary>offset of inode-blocks in filesys</summary> /// <summary>offset of inode-blocks in filesys</summary>
public int fs_iblkno; public readonly int fs_iblkno;
/// <summary>offset of first data after cg</summary> /// <summary>offset of first data after cg</summary>
public int fs_dblkno; public readonly int fs_dblkno;
/// <summary>cylinder group offset in cylinder</summary> /// <summary>cylinder group offset in cylinder</summary>
public int fs_old_cgoffset; public readonly int fs_old_cgoffset;
/// <summary>used to calc mod fs_ntrak</summary> /// <summary>used to calc mod fs_ntrak</summary>
public int fs_old_cgmask; public readonly int fs_old_cgmask;
/// <summary>last time written</summary> /// <summary>last time written</summary>
public int fs_old_time; public readonly int fs_old_time;
/// <summary>number of blocks in fs</summary> /// <summary>number of blocks in fs</summary>
public int fs_old_size; public readonly int fs_old_size;
/// <summary>number of data blocks in fs</summary> /// <summary>number of data blocks in fs</summary>
public int fs_old_dsize; public readonly int fs_old_dsize;
/// <summary>number of cylinder groups</summary> /// <summary>number of cylinder groups</summary>
public int fs_ncg; public readonly int fs_ncg;
/// <summary>size of basic blocks in fs</summary> /// <summary>size of basic blocks in fs</summary>
public int fs_bsize; public readonly int fs_bsize;
/// <summary>size of frag blocks in fs</summary> /// <summary>size of frag blocks in fs</summary>
public int fs_fsize; public readonly int fs_fsize;
/// <summary>number of frags in a block in fs</summary> /// <summary>number of frags in a block in fs</summary>
public int fs_frag; public readonly int fs_frag;
/* these are configuration parameters */ /* these are configuration parameters */
/// <summary>minimum percentage of free blocks</summary> /// <summary>minimum percentage of free blocks</summary>
public int fs_minfree; public readonly int fs_minfree;
/// <summary>num of ms for optimal next block</summary> /// <summary>num of ms for optimal next block</summary>
public int fs_old_rotdelay; public readonly int fs_old_rotdelay;
/// <summary>disk revolutions per second</summary> /// <summary>disk revolutions per second</summary>
public int fs_old_rps; public readonly int fs_old_rps;
/* these fields can be computed from the others */ /* these fields can be computed from the others */
/// <summary>``blkoff'' calc of blk offsets</summary> /// <summary>``blkoff'' calc of blk offsets</summary>
public int fs_bmask; public readonly int fs_bmask;
/// <summary>``fragoff'' calc of frag offsets</summary> /// <summary>``fragoff'' calc of frag offsets</summary>
public int fs_fmask; public readonly int fs_fmask;
/// <summary>``lblkno'' calc of logical blkno</summary> /// <summary>``lblkno'' calc of logical blkno</summary>
public int fs_bshift; public readonly int fs_bshift;
/// <summary>``numfrags'' calc number of frags</summary> /// <summary>``numfrags'' calc number of frags</summary>
public int fs_fshift; public readonly int fs_fshift;
/* these are configuration parameters */ /* these are configuration parameters */
/// <summary>max number of contiguous blks</summary> /// <summary>max number of contiguous blks</summary>
public int fs_maxcontig; public readonly int fs_maxcontig;
/// <summary>max number of blks per cyl group</summary> /// <summary>max number of blks per cyl group</summary>
public int fs_maxbpg; public readonly int fs_maxbpg;
/* these fields can be computed from the others */ /* these fields can be computed from the others */
/// <summary>block to frag shift</summary> /// <summary>block to frag shift</summary>
public int fs_fragshift; public readonly int fs_fragshift;
/// <summary>fsbtodb and dbtofsb shift constant</summary> /// <summary>fsbtodb and dbtofsb shift constant</summary>
public int fs_fsbtodb; public readonly int fs_fsbtodb;
/// <summary>actual size of super block</summary> /// <summary>actual size of super block</summary>
public int fs_sbsize; public readonly int fs_sbsize;
/// <summary>csum block offset</summary> /// <summary>csum block offset</summary>
public int fs_csmask; public readonly int fs_csmask;
/// <summary>csum block number</summary> /// <summary>csum block number</summary>
public int fs_csshift; public readonly int fs_csshift;
/// <summary>value of NINDIR</summary> /// <summary>value of NINDIR</summary>
public int fs_nindir; public readonly int fs_nindir;
/// <summary>value of INOPB</summary> /// <summary>value of INOPB</summary>
public uint fs_inopb; public readonly uint fs_inopb;
/// <summary>value of NSPF</summary> /// <summary>value of NSPF</summary>
public int fs_old_nspf; public readonly int fs_old_nspf;
/* yet another configuration parameter */ /* yet another configuration parameter */
/// <summary> /// <summary>
/// optimization preference, see below /// optimization preference, see below
/// On SVR: int fs_state; // file system state /// On SVR: int fs_state; // file system state
/// </summary> /// </summary>
public int fs_optim; public readonly int fs_optim;
/// <summary># sectors/track including spares</summary> /// <summary># sectors/track including spares</summary>
public int fs_old_npsect; public readonly int fs_old_npsect;
/// <summary>hardware sector interleave</summary> /// <summary>hardware sector interleave</summary>
public int fs_old_interleave; public readonly int fs_old_interleave;
/// <summary> /// <summary>
/// sector 0 skew, per track /// sector 0 skew, per track
/// On A/UX: int fs_state; // file system state /// On A/UX: int fs_state; // file system state
/// </summary> /// </summary>
public int fs_old_trackskew; public readonly int fs_old_trackskew;
/// <summary> /// <summary>
/// unique filesystem id /// unique filesystem id
/// On old: int fs_headswitch; // head switch time, usec /// On old: int fs_headswitch; // head switch time, usec
/// </summary> /// </summary>
public int fs_id_1; public readonly int fs_id_1;
/// <summary> /// <summary>
/// unique filesystem id /// unique filesystem id
/// On old: int fs_trkseek; // track-to-track seek, usec /// On old: int fs_trkseek; // track-to-track seek, usec
/// </summary> /// </summary>
public int fs_id_2; public readonly int fs_id_2;
/* sizes determined by number of cylinder groups and their sizes */ /* sizes determined by number of cylinder groups and their sizes */
/// <summary>blk addr of cyl grp summary area</summary> /// <summary>blk addr of cyl grp summary area</summary>
public int fs_old_csaddr; public readonly int fs_old_csaddr;
/// <summary>size of cyl grp summary area</summary> /// <summary>size of cyl grp summary area</summary>
public int fs_cssize; public readonly int fs_cssize;
/// <summary>cylinder group size</summary> /// <summary>cylinder group size</summary>
public int fs_cgsize; public readonly int fs_cgsize;
/* these fields are derived from the hardware */ /* these fields are derived from the hardware */
/// <summary>tracks per cylinder</summary> /// <summary>tracks per cylinder</summary>
public int fs_old_ntrak; public readonly int fs_old_ntrak;
/// <summary>sectors per track</summary> /// <summary>sectors per track</summary>
public int fs_old_nsect; public readonly int fs_old_nsect;
/// <summary>sectors per cylinder</summary> /// <summary>sectors per cylinder</summary>
public int fs_old_spc; public readonly int fs_old_spc;
/* this comes from the disk driver partitioning */ /* this comes from the disk driver partitioning */
/// <summary>cylinders in filesystem</summary> /// <summary>cylinders in filesystem</summary>
public int fs_old_ncyl; public readonly int fs_old_ncyl;
/* these fields can be computed from the others */ /* these fields can be computed from the others */
/// <summary>cylinders per group</summary> /// <summary>cylinders per group</summary>
public int fs_old_cpg; public readonly int fs_old_cpg;
/// <summary>inodes per group</summary> /// <summary>inodes per group</summary>
public int fs_ipg; public readonly int fs_ipg;
/// <summary>blocks per group * fs_frag</summary> /// <summary>blocks per group * fs_frag</summary>
public int fs_fpg; public readonly int fs_fpg;
/* this data must be re-computed after crashes */ /* this data must be re-computed after crashes */
/// <summary>cylinder summary information</summary> /// <summary>cylinder summary information</summary>
public csum fs_old_cstotal; public csum fs_old_cstotal;
/* these fields are cleared at mount time */ /* these fields are cleared at mount time */
/// <summary>super block modified flag</summary> /// <summary>super block modified flag</summary>
public sbyte fs_fmod; public readonly sbyte fs_fmod;
/// <summary>filesystem is clean flag</summary> /// <summary>filesystem is clean flag</summary>
public sbyte fs_clean; public readonly sbyte fs_clean;
/// <summary>mounted read-only flag</summary> /// <summary>mounted read-only flag</summary>
public sbyte fs_ronly; public readonly sbyte fs_ronly;
/// <summary>old FS_ flags</summary> /// <summary>old FS_ flags</summary>
public sbyte fs_old_flags; public readonly sbyte fs_old_flags;
/// <summary>name mounted on</summary> /// <summary>name mounted on</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 468)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 468)]
public byte[] fs_fsmnt; public readonly byte[] fs_fsmnt;
/// <summary>volume name</summary> /// <summary>volume name</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] fs_volname; public readonly byte[] fs_volname;
/// <summary>system-wide uid</summary> /// <summary>system-wide uid</summary>
public ulong fs_swuid; public readonly ulong fs_swuid;
/// <summary>due to alignment of fs_swuid</summary> /// <summary>due to alignment of fs_swuid</summary>
public int fs_pad; public readonly int fs_pad;
/* these fields retain the current block allocation info */ /* these fields retain the current block allocation info */
/// <summary>last cg searched</summary> /// <summary>last cg searched</summary>
public int fs_cgrotor; public readonly int fs_cgrotor;
/// <summary>padding; was list of fs_cs buffers</summary> /// <summary>padding; was list of fs_cs buffers</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 28)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 28)]
public uint[] fs_ocsp; public readonly uint[] fs_ocsp;
/// <summary>(u) # of contig. allocated dirs</summary> /// <summary>(u) # of contig. allocated dirs</summary>
public uint fs_contigdirs; public readonly uint fs_contigdirs;
/// <summary>(u) cg summary info buffer</summary> /// <summary>(u) cg summary info buffer</summary>
public uint fs_csp; public readonly uint fs_csp;
/// <summary>(u) max cluster in each cyl group</summary> /// <summary>(u) max cluster in each cyl group</summary>
public uint fs_maxcluster; public readonly uint fs_maxcluster;
/// <summary>(u) used by snapshots to track fs</summary> /// <summary>(u) used by snapshots to track fs</summary>
public uint fs_active; public readonly uint fs_active;
/// <summary>cyl per cycle in postbl</summary> /// <summary>cyl per cycle in postbl</summary>
public int fs_old_cpc; public readonly int fs_old_cpc;
/// <summary>maximum blocking factor permitted</summary> /// <summary>maximum blocking factor permitted</summary>
public int fs_maxbsize; public readonly int fs_maxbsize;
/// <summary>number of unreferenced inodes</summary> /// <summary>number of unreferenced inodes</summary>
public long fs_unrefs; public readonly long fs_unrefs;
/// <summary>size of underlying GEOM provider</summary> /// <summary>size of underlying GEOM provider</summary>
public long fs_providersize; public readonly long fs_providersize;
/// <summary>size of area reserved for metadata</summary> /// <summary>size of area reserved for metadata</summary>
public long fs_metaspace; public readonly long fs_metaspace;
/// <summary>old rotation block list head</summary> /// <summary>old rotation block list head</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 14)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 14)]
public long[] fs_sparecon64; public readonly long[] fs_sparecon64;
/// <summary>byte offset of standard superblock</summary> /// <summary>byte offset of standard superblock</summary>
public long fs_sblockloc; public readonly long fs_sblockloc;
/// <summary>(u) cylinder summary information</summary> /// <summary>(u) cylinder summary information</summary>
public csum_total fs_cstotal; public csum_total fs_cstotal;
/// <summary>last time written</summary> /// <summary>last time written</summary>
public long fs_time; public readonly long fs_time;
/// <summary>number of blocks in fs</summary> /// <summary>number of blocks in fs</summary>
public long fs_size; public readonly long fs_size;
/// <summary>number of data blocks in fs</summary> /// <summary>number of data blocks in fs</summary>
public long fs_dsize; public readonly long fs_dsize;
/// <summary>blk addr of cyl grp summary area</summary> /// <summary>blk addr of cyl grp summary area</summary>
public long fs_csaddr; public readonly long fs_csaddr;
/// <summary>(u) blocks being freed</summary> /// <summary>(u) blocks being freed</summary>
public long fs_pendingblocks; public readonly long fs_pendingblocks;
/// <summary>(u) inodes being freed</summary> /// <summary>(u) inodes being freed</summary>
public uint fs_pendinginodes; public readonly uint fs_pendinginodes;
/// <summary>list of snapshot inode numbers</summary> /// <summary>list of snapshot inode numbers</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
public uint[] fs_snapinum; public readonly uint[] fs_snapinum;
/// <summary>expected average file size</summary> /// <summary>expected average file size</summary>
public uint fs_avgfilesize; public readonly uint fs_avgfilesize;
/// <summary>expected # of files per directory</summary> /// <summary>expected # of files per directory</summary>
public uint fs_avgfpdir; public readonly uint fs_avgfpdir;
/// <summary>save real cg size to use fs_bsize</summary> /// <summary>save real cg size to use fs_bsize</summary>
public int fs_save_cgsize; public readonly int fs_save_cgsize;
/// <summary>Last mount or fsck time.</summary> /// <summary>Last mount or fsck time.</summary>
public long fs_mtime; public readonly long fs_mtime;
/// <summary>SUJ free list</summary> /// <summary>SUJ free list</summary>
public int fs_sujfree; public readonly int fs_sujfree;
/// <summary>reserved for future constants</summary> /// <summary>reserved for future constants</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 23)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 23)]
public int[] fs_sparecon32; public readonly int[] fs_sparecon32;
/// <summary>see FS_ flags below</summary> /// <summary>see FS_ flags below</summary>
public int fs_flags; public readonly int fs_flags;
/// <summary>size of cluster summary array</summary> /// <summary>size of cluster summary array</summary>
public int fs_contigsumsize; public readonly int fs_contigsumsize;
/// <summary>max length of an internal symlink</summary> /// <summary>max length of an internal symlink</summary>
public int fs_maxsymlinklen; public readonly int fs_maxsymlinklen;
/// <summary>format of on-disk inodes</summary> /// <summary>format of on-disk inodes</summary>
public int fs_old_inodefmt; public readonly int fs_old_inodefmt;
/// <summary>maximum representable file size</summary> /// <summary>maximum representable file size</summary>
public ulong fs_maxfilesize; public readonly ulong fs_maxfilesize;
/// <summary>~fs_bmask for use with 64-bit size</summary> /// <summary>~fs_bmask for use with 64-bit size</summary>
public long fs_qbmask; public readonly long fs_qbmask;
/// <summary>~fs_fmask for use with 64-bit size</summary> /// <summary>~fs_fmask for use with 64-bit size</summary>
public long fs_qfmask; public readonly long fs_qfmask;
/// <summary>validate fs_clean field</summary> /// <summary>validate fs_clean field</summary>
public int fs_state; public readonly int fs_state;
/// <summary>format of positional layout tables</summary> /// <summary>format of positional layout tables</summary>
public int fs_old_postblformat; public readonly int fs_old_postblformat;
/// <summary>number of rotational positions</summary> /// <summary>number of rotational positions</summary>
public int fs_old_nrpos; public readonly int fs_old_nrpos;
/// <summary>(short) rotation block list head</summary> /// <summary>(short) rotation block list head</summary>
public int fs_old_postbloff; public readonly int fs_old_postbloff;
/// <summary>(uchar_t) blocks for each rotation</summary> /// <summary>(uchar_t) blocks for each rotation</summary>
public int fs_old_rotbloff; public readonly int fs_old_rotbloff;
/// <summary>magic number</summary> /// <summary>magic number</summary>
public uint fs_magic; public readonly uint fs_magic;
/// <summary>list of blocks for each rotation</summary> /// <summary>list of blocks for each rotation</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)]
public byte[] fs_rotbl; public readonly byte[] fs_rotbl;
} }
} }
} }

View File

@@ -111,7 +111,7 @@ namespace DiscImageChef.Filesystems
XmlFsType = new FileSystemType XmlFsType = new FileSystemType
{ {
Clusters = (long)(partition.Size / HAMMER_BIGBLOCK_SIZE), Clusters = partition.Size / HAMMER_BIGBLOCK_SIZE,
ClusterSize = HAMMER_BIGBLOCK_SIZE, ClusterSize = HAMMER_BIGBLOCK_SIZE,
Dirty = false, Dirty = false,
Type = "HAMMER", Type = "HAMMER",
@@ -127,10 +127,10 @@ namespace DiscImageChef.Filesystems
hammerSb.vol0_stat_freebigblocks * HAMMER_BIGBLOCK_SIZE).AppendLine(); hammerSb.vol0_stat_freebigblocks * HAMMER_BIGBLOCK_SIZE).AppendLine();
sb.AppendFormat("Filesystem has {0} inode used", hammerSb.vol0_stat_inodes).AppendLine(); sb.AppendFormat("Filesystem has {0} inode used", hammerSb.vol0_stat_inodes).AppendLine();
XmlFsType.Clusters = hammerSb.vol0_stat_bigblocks; XmlFsType.Clusters = (ulong)hammerSb.vol0_stat_bigblocks;
XmlFsType.FreeClusters = hammerSb.vol0_stat_freebigblocks; XmlFsType.FreeClusters = (ulong)hammerSb.vol0_stat_freebigblocks;
XmlFsType.FreeClustersSpecified = true; XmlFsType.FreeClustersSpecified = true;
XmlFsType.Files = hammerSb.vol0_stat_inodes; XmlFsType.Files = (ulong)hammerSb.vol0_stat_inodes;
XmlFsType.FilesSpecified = true; XmlFsType.FilesSpecified = true;
} }
// 0 ? // 0 ?
@@ -147,43 +147,43 @@ namespace DiscImageChef.Filesystems
struct HammerSuperBlock struct HammerSuperBlock
{ {
/// <summary><see cref="HAMMER_FSBUF_VOLUME" /> for a valid header</summary> /// <summary><see cref="HAMMER_FSBUF_VOLUME" /> for a valid header</summary>
public ulong vol_signature; public readonly ulong vol_signature;
/* These are relative to block device offset, not zone offsets. */ /* These are relative to block device offset, not zone offsets. */
/// <summary>offset of boot area</summary> /// <summary>offset of boot area</summary>
public long vol_bot_beg; public readonly long vol_bot_beg;
/// <summary>offset of memory log</summary> /// <summary>offset of memory log</summary>
public long vol_mem_beg; public readonly long vol_mem_beg;
/// <summary>offset of the first buffer in volume</summary> /// <summary>offset of the first buffer in volume</summary>
public long vol_buf_beg; public readonly long vol_buf_beg;
/// <summary>offset of volume EOF (on buffer boundary)</summary> /// <summary>offset of volume EOF (on buffer boundary)</summary>
public long vol_buf_end; public readonly long vol_buf_end;
public long vol_reserved01; public readonly long vol_reserved01;
/// <summary>identify filesystem</summary> /// <summary>identify filesystem</summary>
public Guid vol_fsid; public readonly Guid vol_fsid;
/// <summary>identify filesystem type</summary> /// <summary>identify filesystem type</summary>
public Guid vol_fstype; public readonly Guid vol_fstype;
/// <summary>filesystem label</summary> /// <summary>filesystem label</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)]
public byte[] vol_label; public readonly byte[] vol_label;
/// <summary>volume number within filesystem</summary> /// <summary>volume number within filesystem</summary>
public int vol_no; public readonly int vol_no;
/// <summary>number of volumes making up filesystem</summary> /// <summary>number of volumes making up filesystem</summary>
public int vol_count; public readonly int vol_count;
/// <summary>version control information</summary> /// <summary>version control information</summary>
public uint vol_version; public readonly uint vol_version;
/// <summary>header crc</summary> /// <summary>header crc</summary>
public hammer_crc_t vol_crc; public readonly hammer_crc_t vol_crc;
/// <summary>volume flags</summary> /// <summary>volume flags</summary>
public uint vol_flags; public readonly uint vol_flags;
/// <summary>the root volume number (must be 0)</summary> /// <summary>the root volume number (must be 0)</summary>
public uint vol_rootvol; public readonly uint vol_rootvol;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public uint[] vol_reserved; public readonly uint[] vol_reserved;
/* /*
* These fields are initialized and space is reserved in every * These fields are initialized and space is reserved in every
@@ -193,29 +193,29 @@ namespace DiscImageChef.Filesystems
* by newfs_hammer(8). * by newfs_hammer(8).
*/ */
/// <summary>total big-blocks when fs is empty</summary> /// <summary>total big-blocks when fs is empty</summary>
public long vol0_stat_bigblocks; public readonly long vol0_stat_bigblocks;
/// <summary>number of free big-blocks</summary> /// <summary>number of free big-blocks</summary>
public long vol0_stat_freebigblocks; public readonly long vol0_stat_freebigblocks;
public long vol0_reserved01; public readonly long vol0_reserved01;
/// <summary>for statfs only</summary> /// <summary>for statfs only</summary>
public long vol0_stat_inodes; public readonly long vol0_stat_inodes;
public long vol0_reserved02; public readonly long vol0_reserved02;
/// <summary>B-Tree root offset in zone-8</summary> /// <summary>B-Tree root offset in zone-8</summary>
public hammer_off_t vol0_btree_root; public readonly hammer_off_t vol0_btree_root;
/// <summary>highest partially synchronized TID</summary> /// <summary>highest partially synchronized TID</summary>
public hammer_tid_t vol0_next_tid; public readonly hammer_tid_t vol0_next_tid;
public hammer_off_t vol0_reserved03; public readonly hammer_off_t vol0_reserved03;
/// <summary> /// <summary>
/// Blockmaps for zones. Not all zones use a blockmap. Note that the entire root blockmap is cached in the /// Blockmaps for zones. Not all zones use a blockmap. Note that the entire root blockmap is cached in the
/// hammer_mount structure. /// hammer_mount structure.
/// </summary> /// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public HammerBlockMap[] vol0_blockmap; public readonly HammerBlockMap[] vol0_blockmap;
/// <summary>Array of zone-2 addresses for undo FIFO.</summary> /// <summary>Array of zone-2 addresses for undo FIFO.</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public hammer_off_t[] vol0_undo_array; public readonly hammer_off_t[] vol0_undo_array;
} }
[SuppressMessage("ReSharper", "InconsistentNaming")] [SuppressMessage("ReSharper", "InconsistentNaming")]

View File

@@ -186,7 +186,7 @@ namespace DiscImageChef.Filesystems
XmlFsType = new FileSystemType XmlFsType = new FileSystemType
{ {
Clusters = mib.sectors / bpb.spc, Clusters = mib.sectors / bpb.spc,
ClusterSize = bpb.bps * bpb.spc, ClusterSize = (uint)(bpb.bps * bpb.spc),
CreationDate = DateHandlers.DosToDateTime(mib.creationDate, mib.creationTime), CreationDate = DateHandlers.DosToDateTime(mib.creationDate, mib.creationTime),
CreationDateSpecified = true, CreationDateSpecified = true,
DataPreparerIdentifier = StringHandlers.SpacePaddedToString(vib.owner, Encoding), DataPreparerIdentifier = StringHandlers.SpacePaddedToString(vib.owner, Encoding),
@@ -207,57 +207,57 @@ namespace DiscImageChef.Filesystems
{ {
/// <summary>0x000, Jump to boot code</summary> /// <summary>0x000, Jump to boot code</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public byte[] jump; public readonly byte[] jump;
/// <summary>0x003, OEM Name, 8 bytes, space-padded</summary> /// <summary>0x003, OEM Name, 8 bytes, space-padded</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[] oem_name; public readonly byte[] oem_name;
/// <summary>0x00B, Bytes per sector</summary> /// <summary>0x00B, Bytes per sector</summary>
public ushort bps; public readonly ushort bps;
/// <summary>0x00D, Sectors per cluster</summary> /// <summary>0x00D, Sectors per cluster</summary>
public byte spc; public readonly byte spc;
/// <summary>0x00E, Reserved sectors between BPB and... does it have sense in HPFS?</summary> /// <summary>0x00E, Reserved sectors between BPB and... does it have sense in HPFS?</summary>
public ushort rsectors; public readonly ushort rsectors;
/// <summary>0x010, Number of FATs... seriously?</summary> /// <summary>0x010, Number of FATs... seriously?</summary>
public byte fats_no; public readonly byte fats_no;
/// <summary>0x011, Number of entries on root directory... ok</summary> /// <summary>0x011, Number of entries on root directory... ok</summary>
public ushort root_ent; public readonly ushort root_ent;
/// <summary>0x013, Sectors in volume... doubt it</summary> /// <summary>0x013, Sectors in volume... doubt it</summary>
public ushort sectors; public readonly ushort sectors;
/// <summary>0x015, Media descriptor</summary> /// <summary>0x015, Media descriptor</summary>
public byte media; public readonly byte media;
/// <summary>0x016, Sectors per FAT... again</summary> /// <summary>0x016, Sectors per FAT... again</summary>
public ushort spfat; public readonly ushort spfat;
/// <summary>0x018, Sectors per track... you're kidding</summary> /// <summary>0x018, Sectors per track... you're kidding</summary>
public ushort sptrk; public readonly ushort sptrk;
/// <summary>0x01A, Heads... stop!</summary> /// <summary>0x01A, Heads... stop!</summary>
public ushort heads; public readonly ushort heads;
/// <summary>0x01C, Hidden sectors before BPB</summary> /// <summary>0x01C, Hidden sectors before BPB</summary>
public uint hsectors; public readonly uint hsectors;
/// <summary>0x024, Sectors in volume if &gt; 65535...</summary> /// <summary>0x024, Sectors in volume if &gt; 65535...</summary>
public uint big_sectors; public readonly uint big_sectors;
/// <summary>0x028, Drive number</summary> /// <summary>0x028, Drive number</summary>
public byte drive_no; public readonly byte drive_no;
/// <summary>0x029, Volume flags?</summary> /// <summary>0x029, Volume flags?</summary>
public byte nt_flags; public readonly byte nt_flags;
/// <summary>0x02A, EPB signature, 0x29</summary> /// <summary>0x02A, EPB signature, 0x29</summary>
public byte signature; public readonly byte signature;
/// <summary>0x02B, Volume serial number</summary> /// <summary>0x02B, Volume serial number</summary>
public uint serial_no; public readonly uint serial_no;
/// <summary>0x02F, Volume label, 11 bytes, space-padded</summary> /// <summary>0x02F, Volume label, 11 bytes, space-padded</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
public byte[] volume_label; public readonly byte[] volume_label;
/// <summary>0x03A, Filesystem type, 8 bytes, space-padded ("HPFS ")</summary> /// <summary>0x03A, Filesystem type, 8 bytes, space-padded ("HPFS ")</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[] fs_type; public readonly byte[] fs_type;
/// <summary>Boot code.</summary> /// <summary>Boot code.</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 442)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 442)]
public byte[] boot_code; public readonly byte[] boot_code;
/// <summary>0x1F8, Unknown</summary> /// <summary>0x1F8, Unknown</summary>
public uint unknown; public readonly uint unknown;
/// <summary>0x1FC, Unknown</summary> /// <summary>0x1FC, Unknown</summary>
public ushort unknown2; public readonly ushort unknown2;
/// <summary>0x1FE, 0xAA55</summary> /// <summary>0x1FE, 0xAA55</summary>
public ushort signature2; public readonly ushort signature2;
} }
/// <summary> /// <summary>
@@ -268,50 +268,50 @@ namespace DiscImageChef.Filesystems
{ {
/// <summary>Block identifier "MEDINFO "</summary> /// <summary>Block identifier "MEDINFO "</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[] blockId; public readonly byte[] blockId;
/// <summary>Volume label</summary> /// <summary>Volume label</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] volumeLabel; public readonly byte[] volumeLabel;
/// <summary>Volume comment</summary> /// <summary>Volume comment</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 160)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 160)]
public byte[] comment; public readonly byte[] comment;
/// <summary>Volume serial number</summary> /// <summary>Volume serial number</summary>
public uint serial; public readonly uint serial;
/// <summary>Volume creation date, DOS format</summary> /// <summary>Volume creation date, DOS format</summary>
public ushort creationDate; public readonly ushort creationDate;
/// <summary>Volume creation time, DOS format</summary> /// <summary>Volume creation time, DOS format</summary>
public ushort creationTime; public readonly ushort creationTime;
/// <summary> /// <summary>
/// Codepage type: 1 ASCII, 2 EBCDIC /// Codepage type: 1 ASCII, 2 EBCDIC
/// </summary> /// </summary>
public ushort codepageType; public readonly ushort codepageType;
/// <summary>Codepage</summary> /// <summary>Codepage</summary>
public ushort codepage; public readonly ushort codepage;
/// <summary>RPS level</summary> /// <summary>RPS level</summary>
public uint rps; public readonly uint rps;
/// <summary>Coincides with bytes per sector, and bytes per cluster, need more media</summary> /// <summary>Coincides with bytes per sector, and bytes per cluster, need more media</summary>
public ushort bps; public readonly ushort bps;
/// <summary>Coincides with bytes per sector, and bytes per cluster, need more media</summary> /// <summary>Coincides with bytes per sector, and bytes per cluster, need more media</summary>
public ushort bpc; public readonly ushort bpc;
/// <summary>Unknown, empty</summary> /// <summary>Unknown, empty</summary>
public uint unknown2; public readonly uint unknown2;
/// <summary>Sectors (or clusters)</summary> /// <summary>Sectors (or clusters)</summary>
public uint sectors; public readonly uint sectors;
/// <summary>Unknown, coincides with bps but changing it makes nothing</summary> /// <summary>Unknown, coincides with bps but changing it makes nothing</summary>
public uint unknown3; public readonly uint unknown3;
/// <summary>Empty?</summary> /// <summary>Empty?</summary>
public ulong unknown4; public readonly ulong unknown4;
/// <summary>Format major version</summary> /// <summary>Format major version</summary>
public ushort major; public readonly ushort major;
/// <summary>Format minor version</summary> /// <summary>Format minor version</summary>
public ushort minor; public readonly ushort minor;
/// <summary>Empty?</summary> /// <summary>Empty?</summary>
public uint unknown5; public readonly uint unknown5;
/// <summary>Unknown, non-empty</summary> /// <summary>Unknown, non-empty</summary>
public uint unknown6; public readonly uint unknown6;
/// <summary>Empty</summary> /// <summary>Empty</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 260)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 260)]
public byte[] filler; public readonly byte[] filler;
} }
/// <summary> /// <summary>
@@ -322,32 +322,32 @@ namespace DiscImageChef.Filesystems
{ {
/// <summary>Block identifier "VOLINFO "</summary> /// <summary>Block identifier "VOLINFO "</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[] blockId; public readonly byte[] blockId;
/// <summary>Unknown</summary> /// <summary>Unknown</summary>
public uint unknown; public readonly uint unknown;
/// <summary>Unknown</summary> /// <summary>Unknown</summary>
public uint unknown2; public readonly uint unknown2;
/// <summary>Unknown</summary> /// <summary>Unknown</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 24)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 24)]
public byte[] unknown3; public readonly byte[] unknown3;
/// <summary>Unknown, space-padded string</summary> /// <summary>Unknown, space-padded string</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] unknown4; public readonly byte[] unknown4;
/// <summary>Owner, space-padded string</summary> /// <summary>Owner, space-padded string</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] owner; public readonly byte[] owner;
/// <summary>Unknown, space-padded string</summary> /// <summary>Unknown, space-padded string</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] unknown5; public readonly byte[] unknown5;
/// <summary>Unknown, empty?</summary> /// <summary>Unknown, empty?</summary>
public uint unknown6; public readonly uint unknown6;
/// <summary>Maximum percent full</summary> /// <summary>Maximum percent full</summary>
public ushort percentFull; public readonly ushort percentFull;
/// <summary>Unknown, empty?</summary> /// <summary>Unknown, empty?</summary>
public ushort unknown7; public readonly ushort unknown7;
/// <summary>Empty</summary> /// <summary>Empty</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 384)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 384)]
public byte[] filler; public readonly byte[] filler;
} }
} }
} }

View File

@@ -118,8 +118,8 @@ namespace DiscImageChef.Filesystems
XmlFsType = new FileSystemType XmlFsType = new FileSystemType
{ {
Type = "JFS filesystem", Type = "JFS filesystem",
Clusters = (long)jfsSb.s_size, Clusters = jfsSb.s_size,
ClusterSize = (int)jfsSb.s_bsize, ClusterSize = jfsSb.s_bsize,
Bootable = true, Bootable = true,
VolumeName = Encoding.GetString(jfsSb.s_version == 1 ? jfsSb.s_fpack : jfsSb.s_label), VolumeName = Encoding.GetString(jfsSb.s_version == 1 ? jfsSb.s_fpack : jfsSb.s_label),
VolumeSerial = $"{jfsSb.s_uuid}", VolumeSerial = $"{jfsSb.s_uuid}",
@@ -176,51 +176,51 @@ namespace DiscImageChef.Filesystems
/// <summary> /// <summary>
/// Leftmost 24 bits are extent length, rest 8 bits are most significant for <see cref="addr2" /> /// Leftmost 24 bits are extent length, rest 8 bits are most significant for <see cref="addr2" />
/// </summary> /// </summary>
public uint len_addr; public readonly uint len_addr;
public uint addr2; public readonly uint addr2;
} }
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct JfsTimeStruct struct JfsTimeStruct
{ {
public uint tv_sec; public readonly uint tv_sec;
public uint tv_nsec; public readonly uint tv_nsec;
} }
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct JfsSuperBlock struct JfsSuperBlock
{ {
public uint s_magic; public readonly uint s_magic;
public uint s_version; public readonly uint s_version;
public ulong s_size; public readonly ulong s_size;
public uint s_bsize; public readonly uint s_bsize;
public ushort s_l2bsize; public readonly ushort s_l2bsize;
public ushort s_l2bfactor; public readonly ushort s_l2bfactor;
public uint s_pbsize; public readonly uint s_pbsize;
public ushort s_l1pbsize; public readonly ushort s_l1pbsize;
public ushort pad; public readonly ushort pad;
public uint s_agsize; public readonly uint s_agsize;
public JfsFlags s_flags; public readonly JfsFlags s_flags;
public JfsState s_state; public readonly JfsState s_state;
public uint s_compress; public readonly uint s_compress;
public JfsExtent s_ait2; public readonly JfsExtent s_ait2;
public JfsExtent s_aim2; public readonly JfsExtent s_aim2;
public uint s_logdev; public readonly uint s_logdev;
public uint s_logserial; public readonly uint s_logserial;
public JfsExtent s_logpxd; public readonly JfsExtent s_logpxd;
public JfsExtent s_fsckpxd; public readonly JfsExtent s_fsckpxd;
public JfsTimeStruct s_time; public readonly JfsTimeStruct s_time;
public uint s_fsckloglen; public readonly uint s_fsckloglen;
public sbyte s_fscklog; public readonly sbyte s_fscklog;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 11)]
public byte[] s_fpack; public readonly byte[] s_fpack;
public ulong s_xsize; public readonly ulong s_xsize;
public JfsExtent s_xfsckpxd; public readonly JfsExtent s_xfsckpxd;
public JfsExtent s_xlogpxd; public readonly JfsExtent s_xlogpxd;
public Guid s_uuid; public readonly Guid s_uuid;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] s_label; public readonly byte[] s_label;
public Guid s_loguuid; public readonly Guid s_loguuid;
} }
} }
} }

View File

@@ -96,7 +96,7 @@ namespace DiscImageChef.Filesystems
{ {
Type = "HP Logical Interchange Format", Type = "HP Logical Interchange Format",
ClusterSize = 256, ClusterSize = 256,
Clusters = (long)(partition.Size / 256), Clusters = partition.Size / 256,
CreationDate = DateHandlers.LifToDateTime(lifSb.creationDate), CreationDate = DateHandlers.LifToDateTime(lifSb.creationDate),
CreationDateSpecified = true, CreationDateSpecified = true,
VolumeName = StringHandlers.CToString(lifSb.volumeLabel, Encoding) VolumeName = StringHandlers.CToString(lifSb.volumeLabel, Encoding)
@@ -106,20 +106,20 @@ namespace DiscImageChef.Filesystems
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct LifSystemBlock struct LifSystemBlock
{ {
public ushort magic; public readonly ushort magic;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
public byte[] volumeLabel; public readonly byte[] volumeLabel;
public uint directoryStart; public readonly uint directoryStart;
public ushort lifId; public readonly ushort lifId;
public ushort unused; public readonly ushort unused;
public uint directorySize; public readonly uint directorySize;
public ushort lifVersion; public readonly ushort lifVersion;
public ushort unused2; public readonly ushort unused2;
public uint tracks; public readonly uint tracks;
public uint heads; public readonly uint heads;
public uint sectors; public readonly uint sectors;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
public byte[] creationDate; public readonly byte[] creationDate;
} }
} }
} }

View File

@@ -360,7 +360,7 @@ namespace DiscImageChef.Filesystems.LisaFS
} }
XmlFsType.Clusters = infoMddf.vol_size; XmlFsType.Clusters = infoMddf.vol_size;
XmlFsType.ClusterSize = infoMddf.clustersize * infoMddf.datasize; XmlFsType.ClusterSize = (uint)(infoMddf.clustersize * infoMddf.datasize);
if(DateTime.Compare(infoMddf.dtvc, DateHandlers.LisaToDateTime(0)) > 0) if(DateTime.Compare(infoMddf.dtvc, DateHandlers.LisaToDateTime(0)) > 0)
{ {
XmlFsType.CreationDate = infoMddf.dtvc; XmlFsType.CreationDate = infoMddf.dtvc;

View File

@@ -296,7 +296,7 @@ namespace DiscImageChef.Filesystems.LisaFS
} }
XmlFsType.Clusters = mddf.vol_size; XmlFsType.Clusters = mddf.vol_size;
XmlFsType.ClusterSize = mddf.clustersize * mddf.datasize; XmlFsType.ClusterSize = (uint)(mddf.clustersize * mddf.datasize);
if(DateTime.Compare(mddf.dtvc, DateHandlers.LisaToDateTime(0)) > 0) if(DateTime.Compare(mddf.dtvc, DateHandlers.LisaToDateTime(0)) > 0)
{ {
XmlFsType.CreationDate = mddf.dtvc; XmlFsType.CreationDate = mddf.dtvc;

View File

@@ -197,15 +197,15 @@ namespace DiscImageChef.Filesystems
XmlFsType = new FileSystemType XmlFsType = new FileSystemType
{ {
Type = "Locus filesystem", Type = "Locus filesystem",
ClusterSize = blockSize, ClusterSize = (uint)blockSize,
Clusters = locusSb.s_fsize, Clusters = (ulong)locusSb.s_fsize,
// Sometimes it uses one, or the other. Use the bigger // Sometimes it uses one, or the other. Use the bigger
VolumeName = string.IsNullOrEmpty(s_fsmnt) ? s_fpack : s_fsmnt, VolumeName = string.IsNullOrEmpty(s_fsmnt) ? s_fpack : s_fsmnt,
ModificationDate = DateHandlers.UnixToDateTime(locusSb.s_time), ModificationDate = DateHandlers.UnixToDateTime(locusSb.s_time),
ModificationDateSpecified = true, ModificationDateSpecified = true,
Dirty = !locusSb.s_flags.HasFlag(LocusFlags.SB_CLEAN) || Dirty = !locusSb.s_flags.HasFlag(LocusFlags.SB_CLEAN) ||
locusSb.s_flags.HasFlag(LocusFlags.SB_DIRTY), locusSb.s_flags.HasFlag(LocusFlags.SB_DIRTY),
FreeClusters = locusSb.s_tfree, FreeClusters = (ulong)locusSb.s_tfree,
FreeClustersSpecified = true FreeClustersSpecified = true
}; };
} }
@@ -215,54 +215,54 @@ namespace DiscImageChef.Filesystems
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct Locus_Superblock struct Locus_Superblock
{ {
public uint s_magic; /* identifies this as a locus filesystem */ public readonly uint s_magic; /* identifies this as a locus filesystem */
/* defined as a constant below */ /* defined as a constant below */
public gfs_t s_gfs; /* global filesystem number */ public readonly gfs_t s_gfs; /* global filesystem number */
public daddr_t s_fsize; /* size in blocks of entire volume */ public readonly daddr_t s_fsize; /* size in blocks of entire volume */
/* several ints for replicated filsystems */ /* several ints for replicated filsystems */
public commitcnt_t s_lwm; /* all prior commits propagated */ public readonly commitcnt_t s_lwm; /* all prior commits propagated */
public commitcnt_t s_hwm; /* highest commit propagated */ public readonly commitcnt_t s_hwm; /* highest commit propagated */
/* oldest committed version in the list. /* oldest committed version in the list.
* llst mod NCMTLST is the offset of commit #llst in the list, * llst mod NCMTLST is the offset of commit #llst in the list,
* which wraps around from there. * which wraps around from there.
*/ */
public commitcnt_t s_llst; public readonly commitcnt_t s_llst;
public fstore_t s_fstore; /* filesystem storage bit mask; if the public readonly fstore_t s_fstore; /* filesystem storage bit mask; if the
filsys is replicated and this is not a filsys is replicated and this is not a
primary or backbone copy, this bit mask primary or backbone copy, this bit mask
determines which files are stored */ determines which files are stored */
public time_t s_time; /* last super block update */ public readonly time_t s_time; /* last super block update */
public daddr_t s_tfree; /* total free blocks*/ public readonly daddr_t s_tfree; /* total free blocks*/
public ino_t s_isize; /* size in blocks of i-list */ public readonly ino_t s_isize; /* size in blocks of i-list */
public short s_nfree; /* number of addresses in s_free */ public readonly short s_nfree; /* number of addresses in s_free */
public LocusFlags s_flags; /* filsys flags, defined below */ public LocusFlags s_flags; /* filsys flags, defined below */
public ino_t s_tinode; /* total free inodes */ public readonly ino_t s_tinode; /* total free inodes */
public ino_t s_lasti; /* start place for circular search */ public readonly ino_t s_lasti; /* start place for circular search */
public ino_t s_nbehind; /* est # free inodes before s_lasti */ public readonly ino_t s_nbehind; /* est # free inodes before s_lasti */
public pckno_t s_gfspack; /* global filesystem pack number */ public readonly pckno_t s_gfspack; /* global filesystem pack number */
public short s_ninode; /* number of i-nodes in s_inode */ public readonly short s_ninode; /* number of i-nodes in s_inode */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public short[] s_dinfo; /* interleave stuff */ public readonly short[] s_dinfo; /* interleave stuff */
//#define s_m s_dinfo[0] //#define s_m s_dinfo[0]
//#define s_skip s_dinfo[0] /* AIX defines */ //#define s_skip s_dinfo[0] /* AIX defines */
//#define s_n s_dinfo[1] //#define s_n s_dinfo[1]
//#define s_cyl s_dinfo[1] /* AIX defines */ //#define s_cyl s_dinfo[1] /* AIX defines */
public byte s_flock; /* lock during free list manipulation */ public readonly byte s_flock; /* lock during free list manipulation */
public byte s_ilock; /* lock during i-list manipulation */ public readonly byte s_ilock; /* lock during i-list manipulation */
public byte s_fmod; /* super block modified flag */ public readonly byte s_fmod; /* super block modified flag */
public LocusVersion s_version; /* version of the data format in fs. */ public readonly LocusVersion s_version; /* version of the data format in fs. */
/* defined below. */ /* defined below. */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] s_fsmnt; /* name of this file system */ public readonly byte[] s_fsmnt; /* name of this file system */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[] s_fpack; /* name of this physical volume */ public readonly byte[] s_fpack; /* name of this physical volume */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = NICINOD)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = NICINOD)]
public ino_t[] s_inode; /* free i-node list */ public readonly ino_t[] s_inode; /* free i-node list */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = NICFREE)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = NICFREE)]
public daddr_t[] su_free; /* free block list for non-replicated filsys */ public readonly daddr_t[] su_free; /* free block list for non-replicated filsys */
public byte s_byteorder; /* byte order of integers */ public readonly byte s_byteorder; /* byte order of integers */
} }
[SuppressMessage("ReSharper", "InconsistentNaming")] [SuppressMessage("ReSharper", "InconsistentNaming")]
@@ -270,54 +270,54 @@ namespace DiscImageChef.Filesystems
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct Locus_OldSuperblock struct Locus_OldSuperblock
{ {
public uint s_magic; /* identifies this as a locus filesystem */ public readonly uint s_magic; /* identifies this as a locus filesystem */
/* defined as a constant below */ /* defined as a constant below */
public gfs_t s_gfs; /* global filesystem number */ public readonly gfs_t s_gfs; /* global filesystem number */
public daddr_t s_fsize; /* size in blocks of entire volume */ public readonly daddr_t s_fsize; /* size in blocks of entire volume */
/* several ints for replicated filsystems */ /* several ints for replicated filsystems */
public commitcnt_t s_lwm; /* all prior commits propagated */ public readonly commitcnt_t s_lwm; /* all prior commits propagated */
public commitcnt_t s_hwm; /* highest commit propagated */ public readonly commitcnt_t s_hwm; /* highest commit propagated */
/* oldest committed version in the list. /* oldest committed version in the list.
* llst mod NCMTLST is the offset of commit #llst in the list, * llst mod NCMTLST is the offset of commit #llst in the list,
* which wraps around from there. * which wraps around from there.
*/ */
public commitcnt_t s_llst; public readonly commitcnt_t s_llst;
public fstore_t s_fstore; /* filesystem storage bit mask; if the public readonly fstore_t s_fstore; /* filesystem storage bit mask; if the
filsys is replicated and this is not a filsys is replicated and this is not a
primary or backbone copy, this bit mask primary or backbone copy, this bit mask
determines which files are stored */ determines which files are stored */
public time_t s_time; /* last super block update */ public readonly time_t s_time; /* last super block update */
public daddr_t s_tfree; /* total free blocks*/ public readonly daddr_t s_tfree; /* total free blocks*/
public ino_t s_isize; /* size in blocks of i-list */ public readonly ino_t s_isize; /* size in blocks of i-list */
public short s_nfree; /* number of addresses in s_free */ public readonly short s_nfree; /* number of addresses in s_free */
public LocusFlags s_flags; /* filsys flags, defined below */ public readonly LocusFlags s_flags; /* filsys flags, defined below */
public ino_t s_tinode; /* total free inodes */ public readonly ino_t s_tinode; /* total free inodes */
public ino_t s_lasti; /* start place for circular search */ public readonly ino_t s_lasti; /* start place for circular search */
public ino_t s_nbehind; /* est # free inodes before s_lasti */ public readonly ino_t s_nbehind; /* est # free inodes before s_lasti */
public pckno_t s_gfspack; /* global filesystem pack number */ public readonly pckno_t s_gfspack; /* global filesystem pack number */
public short s_ninode; /* number of i-nodes in s_inode */ public readonly short s_ninode; /* number of i-nodes in s_inode */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public short[] s_dinfo; /* interleave stuff */ public readonly short[] s_dinfo; /* interleave stuff */
//#define s_m s_dinfo[0] //#define s_m s_dinfo[0]
//#define s_skip s_dinfo[0] /* AIX defines */ //#define s_skip s_dinfo[0] /* AIX defines */
//#define s_n s_dinfo[1] //#define s_n s_dinfo[1]
//#define s_cyl s_dinfo[1] /* AIX defines */ //#define s_cyl s_dinfo[1] /* AIX defines */
public byte s_flock; /* lock during free list manipulation */ public readonly byte s_flock; /* lock during free list manipulation */
public byte s_ilock; /* lock during i-list manipulation */ public readonly byte s_ilock; /* lock during i-list manipulation */
public byte s_fmod; /* super block modified flag */ public readonly byte s_fmod; /* super block modified flag */
public LocusVersion s_version; /* version of the data format in fs. */ public readonly LocusVersion s_version; /* version of the data format in fs. */
/* defined below. */ /* defined below. */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] s_fsmnt; /* name of this file system */ public readonly byte[] s_fsmnt; /* name of this file system */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[] s_fpack; /* name of this physical volume */ public readonly byte[] s_fpack; /* name of this physical volume */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = OLDNICINOD)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = OLDNICINOD)]
public ino_t[] s_inode; /* free i-node list */ public readonly ino_t[] s_inode; /* free i-node list */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = OLDNICFREE)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = OLDNICFREE)]
public daddr_t[] su_free; /* free block list for non-replicated filsys */ public readonly daddr_t[] su_free; /* free block list for non-replicated filsys */
public byte s_byteorder; /* byte order of integers */ public readonly byte s_byteorder; /* byte order of integers */
} }
[SuppressMessage("ReSharper", "InconsistentNaming")] [SuppressMessage("ReSharper", "InconsistentNaming")]

View File

@@ -92,7 +92,7 @@ namespace DiscImageChef.Filesystems
Clusters = block0.blocks, Clusters = block0.blocks,
Files = block0.files, Files = block0.files,
FilesSpecified = true, FilesSpecified = true,
FreeClusters = block0.blocks - block0.usedBlocks, FreeClusters = (ulong)(block0.blocks - block0.usedBlocks),
FreeClustersSpecified = true FreeClustersSpecified = true
}; };
@@ -105,52 +105,52 @@ namespace DiscImageChef.Filesystems
{ {
/// <summary>BK starts booting here</summary> /// <summary>BK starts booting here</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 24)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 24)]
public byte[] bootCode; public readonly byte[] bootCode;
/// <summary>Number of files in directory</summary> /// <summary>Number of files in directory</summary>
public ushort files; public readonly ushort files;
/// <summary>Total number of blocks in files of the directory</summary> /// <summary>Total number of blocks in files of the directory</summary>
public ushort usedBlocks; public readonly ushort usedBlocks;
/// <summary>Unknown</summary> /// <summary>Unknown</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 228)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 228)]
public byte[] unknown; public readonly byte[] unknown;
/// <summary>Ownership label (label that shows it belongs to Micro DOS format)</summary> /// <summary>Ownership label (label that shows it belongs to Micro DOS format)</summary>
public ushort label; public readonly ushort label;
/// <summary>MK-DOS directory format label</summary> /// <summary>MK-DOS directory format label</summary>
public ushort mklabel; public readonly ushort mklabel;
/// <summary>Unknown</summary> /// <summary>Unknown</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 50)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50)]
public byte[] unknown2; public readonly byte[] unknown2;
/// <summary> /// <summary>
/// Disk size in blocks (absolute value for the system unlike NORD, NORTON etc.) that /// Disk size in blocks (absolute value for the system unlike NORD, NORTON etc.) that
/// doesn't use two fixed values 40 or 80 tracks, but i.e. if you drive works with 76 tracks /// doesn't use two fixed values 40 or 80 tracks, but i.e. if you drive works with 76 tracks
/// this field will contain an appropriate number of blocks /// this field will contain an appropriate number of blocks
/// </summary> /// </summary>
public ushort blocks; public readonly ushort blocks;
/// <summary> Number of the first file's block. Value is changable</summary> /// <summary> Number of the first file's block. Value is changable</summary>
public ushort firstUsedBlock; public readonly ushort firstUsedBlock;
/// <summary>Unknown</summary> /// <summary>Unknown</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
public byte[] unknown3; public readonly byte[] unknown3;
} }
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct DirectoryEntry struct DirectoryEntry
{ {
/// <summary>File status</summary> /// <summary>File status</summary>
public byte status; public readonly byte status;
/// <summary>Directory number (0 - root)</summary> /// <summary>Directory number (0 - root)</summary>
public byte directory; public readonly byte directory;
/// <summary>File name 14. symbols in ASCII KOI8</summary> /// <summary>File name 14. symbols in ASCII KOI8</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)]
public byte[] filename; public readonly byte[] filename;
/// <summary>Block number</summary> /// <summary>Block number</summary>
public ushort blockNo; public readonly ushort blockNo;
/// <summary>Length in blocks</summary> /// <summary>Length in blocks</summary>
public ushort blocks; public readonly ushort blocks;
/// <summary>Address</summary> /// <summary>Address</summary>
public ushort address; public readonly ushort address;
/// <summary>Length</summary> /// <summary>Length</summary>
public ushort length; public readonly ushort length;
} }
enum FileStatus : byte enum FileStatus : byte

View File

@@ -115,7 +115,7 @@ namespace DiscImageChef.Filesystems
XmlFsType = new FileSystemType XmlFsType = new FileSystemType
{ {
Type = "NILFS2 filesystem", Type = "NILFS2 filesystem",
ClusterSize = 1 << (int)(nilfsSb.log_block_size + 10), ClusterSize = (uint)(1 << (int)(nilfsSb.log_block_size + 10)),
VolumeName = StringHandlers.CToString(nilfsSb.volume_name, Encoding), VolumeName = StringHandlers.CToString(nilfsSb.volume_name, Encoding),
VolumeSerial = nilfsSb.uuid.ToString(), VolumeSerial = nilfsSb.uuid.ToString(),
CreationDate = DateHandlers.UnixUnsignedToDateTime(nilfsSb.ctime), CreationDate = DateHandlers.UnixUnsignedToDateTime(nilfsSb.ctime),
@@ -124,7 +124,7 @@ namespace DiscImageChef.Filesystems
ModificationDateSpecified = true ModificationDateSpecified = true
}; };
if(nilfsSb.creator_os == 0) XmlFsType.SystemIdentifier = "Linux"; if(nilfsSb.creator_os == 0) XmlFsType.SystemIdentifier = "Linux";
XmlFsType.Clusters = (long)nilfsSb.dev_size / XmlFsType.ClusterSize; XmlFsType.Clusters = nilfsSb.dev_size / XmlFsType.ClusterSize;
} }
enum NILFS2_State : ushort enum NILFS2_State : ushort
@@ -137,48 +137,48 @@ namespace DiscImageChef.Filesystems
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct NILFS2_Superblock struct NILFS2_Superblock
{ {
public uint rev_level; public readonly uint rev_level;
public ushort minor_rev_level; public readonly ushort minor_rev_level;
public ushort magic; public readonly ushort magic;
public ushort bytes; public readonly ushort bytes;
public ushort flags; public readonly ushort flags;
public uint crc_seed; public readonly uint crc_seed;
public uint sum; public readonly uint sum;
public uint log_block_size; public readonly uint log_block_size;
public ulong nsegments; public readonly ulong nsegments;
public ulong dev_size; public readonly ulong dev_size;
public ulong first_data_block; public readonly ulong first_data_block;
public uint blocks_per_segment; public readonly uint blocks_per_segment;
public uint r_segments_percentage; public readonly uint r_segments_percentage;
public ulong last_cno; public readonly ulong last_cno;
public ulong last_pseg; public readonly ulong last_pseg;
public ulong last_seq; public readonly ulong last_seq;
public ulong free_blocks_count; public readonly ulong free_blocks_count;
public ulong ctime; public readonly ulong ctime;
public ulong mtime; public readonly ulong mtime;
public ulong wtime; public readonly ulong wtime;
public ushort mnt_count; public readonly ushort mnt_count;
public ushort max_mnt_count; public readonly ushort max_mnt_count;
public NILFS2_State state; public readonly NILFS2_State state;
public ushort errors; public readonly ushort errors;
public ulong lastcheck; public readonly ulong lastcheck;
public uint checkinterval; public readonly uint checkinterval;
public uint creator_os; public readonly uint creator_os;
public ushort def_resuid; public readonly ushort def_resuid;
public ushort def_resgid; public readonly ushort def_resgid;
public uint first_ino; public readonly uint first_ino;
public ushort inode_size; public readonly ushort inode_size;
public ushort dat_entry_size; public readonly ushort dat_entry_size;
public ushort checkpoint_size; public readonly ushort checkpoint_size;
public ushort segment_usage_size; public readonly ushort segment_usage_size;
public Guid uuid; public readonly Guid uuid;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 80)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 80)]
public byte[] volume_name; public readonly byte[] volume_name;
public uint c_interval; public readonly uint c_interval;
public uint c_block_max; public readonly uint c_block_max;
public ulong feature_compat; public readonly ulong feature_compat;
public ulong feature_compat_ro; public readonly ulong feature_compat_ro;
public ulong feature_incompat; public readonly ulong feature_incompat;
} }
} }
} }

View File

@@ -127,8 +127,8 @@ namespace DiscImageChef.Filesystems
sb.AppendFormat("Boot code's SHA1: {0}", bootChk).AppendLine(); sb.AppendFormat("Boot code's SHA1: {0}", bootChk).AppendLine();
} }
XmlFsType.ClusterSize = ntfsBb.spc * ntfsBb.bps; XmlFsType.ClusterSize = (uint)(ntfsBb.spc * ntfsBb.bps);
XmlFsType.Clusters = ntfsBb.sectors / ntfsBb.spc; XmlFsType.Clusters = (ulong)(ntfsBb.sectors / ntfsBb.spc);
XmlFsType.VolumeSerial = $"{ntfsBb.serial_no:X16}"; XmlFsType.VolumeSerial = $"{ntfsBb.serial_no:X16}";
XmlFsType.Type = "NTFS"; XmlFsType.Type = "NTFS";
@@ -144,70 +144,70 @@ namespace DiscImageChef.Filesystems
// Start of BIOS Parameter Block // Start of BIOS Parameter Block
/// <summary>0x000, Jump to boot code</summary> /// <summary>0x000, Jump to boot code</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public byte[] jump; public readonly byte[] jump;
/// <summary>0x003, OEM Name, 8 bytes, space-padded, must be "NTFS "</summary> /// <summary>0x003, OEM Name, 8 bytes, space-padded, must be "NTFS "</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[] oem_name; public readonly byte[] oem_name;
/// <summary>0x00B, Bytes per sector</summary> /// <summary>0x00B, Bytes per sector</summary>
public ushort bps; public readonly ushort bps;
/// <summary>0x00D, Sectors per cluster</summary> /// <summary>0x00D, Sectors per cluster</summary>
public byte spc; public readonly byte spc;
/// <summary>0x00E, Reserved sectors, seems 0</summary> /// <summary>0x00E, Reserved sectors, seems 0</summary>
public ushort rsectors; public readonly ushort rsectors;
/// <summary>0x010, Number of FATs... obviously, 0</summary> /// <summary>0x010, Number of FATs... obviously, 0</summary>
public byte fats_no; public readonly byte fats_no;
/// <summary>0x011, Number of entries on root directory... 0</summary> /// <summary>0x011, Number of entries on root directory... 0</summary>
public ushort root_ent; public readonly ushort root_ent;
/// <summary>0x013, Sectors in volume... 0</summary> /// <summary>0x013, Sectors in volume... 0</summary>
public ushort sml_sectors; public readonly ushort sml_sectors;
/// <summary>0x015, Media descriptor</summary> /// <summary>0x015, Media descriptor</summary>
public byte media; public readonly byte media;
/// <summary>0x016, Sectors per FAT... 0</summary> /// <summary>0x016, Sectors per FAT... 0</summary>
public ushort spfat; public readonly ushort spfat;
/// <summary>0x018, Sectors per track, required to boot</summary> /// <summary>0x018, Sectors per track, required to boot</summary>
public ushort sptrk; public readonly ushort sptrk;
/// <summary>0x01A, Heads... required to boot</summary> /// <summary>0x01A, Heads... required to boot</summary>
public ushort heads; public readonly ushort heads;
/// <summary>0x01C, Hidden sectors before BPB</summary> /// <summary>0x01C, Hidden sectors before BPB</summary>
public uint hsectors; public readonly uint hsectors;
/// <summary>0x020, Sectors in volume if &gt; 65535... 0</summary> /// <summary>0x020, Sectors in volume if &gt; 65535... 0</summary>
public uint big_sectors; public readonly uint big_sectors;
/// <summary>0x024, Drive number</summary> /// <summary>0x024, Drive number</summary>
public byte drive_no; public readonly byte drive_no;
/// <summary>0x025, 0</summary> /// <summary>0x025, 0</summary>
public byte nt_flags; public readonly byte nt_flags;
/// <summary>0x026, EPB signature, 0x80</summary> /// <summary>0x026, EPB signature, 0x80</summary>
public byte signature1; public readonly byte signature1;
/// <summary>0x027, Alignment</summary> /// <summary>0x027, Alignment</summary>
public byte dummy; public readonly byte dummy;
// End of BIOS Parameter Block // End of BIOS Parameter Block
// Start of NTFS real superblock // Start of NTFS real superblock
/// <summary>0x028, Sectors on volume</summary> /// <summary>0x028, Sectors on volume</summary>
public long sectors; public readonly long sectors;
/// <summary>0x030, LSN of $MFT</summary> /// <summary>0x030, LSN of $MFT</summary>
public long mft_lsn; public readonly long mft_lsn;
/// <summary>0x038, LSN of $MFTMirror</summary> /// <summary>0x038, LSN of $MFTMirror</summary>
public long mftmirror_lsn; public readonly long mftmirror_lsn;
/// <summary>0x040, Clusters per MFT record</summary> /// <summary>0x040, Clusters per MFT record</summary>
public sbyte mft_rc_clusters; public readonly sbyte mft_rc_clusters;
/// <summary>0x041, Alignment</summary> /// <summary>0x041, Alignment</summary>
public byte dummy2; public readonly byte dummy2;
/// <summary>0x042, Alignment</summary> /// <summary>0x042, Alignment</summary>
public ushort dummy3; public readonly ushort dummy3;
/// <summary>0x044, Clusters per index block</summary> /// <summary>0x044, Clusters per index block</summary>
public sbyte index_blk_cts; public readonly sbyte index_blk_cts;
/// <summary>0x045, Alignment</summary> /// <summary>0x045, Alignment</summary>
public byte dummy4; public readonly byte dummy4;
/// <summary>0x046, Alignment</summary> /// <summary>0x046, Alignment</summary>
public ushort dummy5; public readonly ushort dummy5;
/// <summary>0x048, Volume serial number</summary> /// <summary>0x048, Volume serial number</summary>
public ulong serial_no; public readonly ulong serial_no;
/// <summary>Boot code.</summary> /// <summary>Boot code.</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 430)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 430)]
public byte[] boot_code; public readonly byte[] boot_code;
/// <summary>0x1FE, 0xAA55</summary> /// <summary>0x1FE, 0xAA55</summary>
public ushort signature2; public readonly ushort signature2;
} }
} }
} }

View File

@@ -292,7 +292,7 @@ namespace DiscImageChef.Filesystems
information = sbInformation.ToString(); information = sbInformation.ToString();
XmlFsType.Bootable = true; XmlFsType.Bootable = true;
XmlFsType.Clusters = (long)(imagePlugin.Info.Sectors * imagePlugin.Info.SectorSize / 2048); XmlFsType.Clusters = imagePlugin.Info.Sectors * imagePlugin.Info.SectorSize / 2048;
XmlFsType.ClusterSize = 2048; XmlFsType.ClusterSize = 2048;
XmlFsType.Type = wii ? "Nintendo Wii filesystem" : "Nintendo Gamecube filesystem"; XmlFsType.Type = wii ? "Nintendo Wii filesystem" : "Nintendo Gamecube filesystem";
XmlFsType.VolumeName = fields.Title; XmlFsType.VolumeName = fields.Title;

View File

@@ -205,8 +205,8 @@ namespace DiscImageChef.Filesystems
XmlFsType = new FileSystemType XmlFsType = new FileSystemType
{ {
Type = "FILES-11", Type = "FILES-11",
ClusterSize = homeblock.cluster * 512, ClusterSize = (uint)(homeblock.cluster * 512),
Clusters = (long)partition.Size / (homeblock.cluster * 512), Clusters = partition.Size / (ulong)(homeblock.cluster * 512),
VolumeName = StringHandlers.SpacePaddedToString(homeblock.volname, Encoding), VolumeName = StringHandlers.SpacePaddedToString(homeblock.volname, Encoding),
VolumeSerial = $"{homeblock.serialnum:X8}" VolumeSerial = $"{homeblock.serialnum:X8}"
}; };
@@ -229,104 +229,104 @@ namespace DiscImageChef.Filesystems
struct OdsHomeBlock struct OdsHomeBlock
{ {
/// <summary>0x000, LBN of THIS home block</summary> /// <summary>0x000, LBN of THIS home block</summary>
public uint homelbn; public readonly uint homelbn;
/// <summary>0x004, LBN of the secondary home block</summary> /// <summary>0x004, LBN of the secondary home block</summary>
public uint alhomelbn; public readonly uint alhomelbn;
/// <summary>0x008, LBN of backup INDEXF.SYS;1</summary> /// <summary>0x008, LBN of backup INDEXF.SYS;1</summary>
public uint altidxlbn; public readonly uint altidxlbn;
/// <summary>0x00C, High byte contains filesystem version (1, 2 or 5), low byte contains revision (1)</summary> /// <summary>0x00C, High byte contains filesystem version (1, 2 or 5), low byte contains revision (1)</summary>
public ushort struclev; public readonly ushort struclev;
/// <summary>0x00E, Number of blocks each bit of the volume bitmap represents</summary> /// <summary>0x00E, Number of blocks each bit of the volume bitmap represents</summary>
public ushort cluster; public readonly ushort cluster;
/// <summary>0x010, VBN of THIS home block</summary> /// <summary>0x010, VBN of THIS home block</summary>
public ushort homevbn; public readonly ushort homevbn;
/// <summary>0x012, VBN of the secondary home block</summary> /// <summary>0x012, VBN of the secondary home block</summary>
public ushort alhomevbn; public readonly ushort alhomevbn;
/// <summary>0x014, VBN of backup INDEXF.SYS;1</summary> /// <summary>0x014, VBN of backup INDEXF.SYS;1</summary>
public ushort altidxvbn; public readonly ushort altidxvbn;
/// <summary>0x016, VBN of the bitmap</summary> /// <summary>0x016, VBN of the bitmap</summary>
public ushort ibmapvbn; public readonly ushort ibmapvbn;
/// <summary>0x018, LBN of the bitmap</summary> /// <summary>0x018, LBN of the bitmap</summary>
public uint ibmaplbn; public readonly uint ibmaplbn;
/// <summary>0x01C, Max files on volume</summary> /// <summary>0x01C, Max files on volume</summary>
public uint maxfiles; public readonly uint maxfiles;
/// <summary>0x020, Bitmap size in sectors</summary> /// <summary>0x020, Bitmap size in sectors</summary>
public ushort ibmapsize; public readonly ushort ibmapsize;
/// <summary>0x022, Reserved files, 5 at minimum</summary> /// <summary>0x022, Reserved files, 5 at minimum</summary>
public ushort resfiles; public readonly ushort resfiles;
/// <summary>0x024, Device type, ODS-2 defines it as always 0</summary> /// <summary>0x024, Device type, ODS-2 defines it as always 0</summary>
public ushort devtype; public readonly ushort devtype;
/// <summary>0x026, Relative volume number (number of the volume in a set)</summary> /// <summary>0x026, Relative volume number (number of the volume in a set)</summary>
public ushort rvn; public readonly ushort rvn;
/// <summary>0x028, Total number of volumes in the set this volume is</summary> /// <summary>0x028, Total number of volumes in the set this volume is</summary>
public ushort setcount; public readonly ushort setcount;
/// <summary>0x02A, Flags</summary> /// <summary>0x02A, Flags</summary>
public ushort volchar; public readonly ushort volchar;
/// <summary>0x02C, User ID of the volume owner</summary> /// <summary>0x02C, User ID of the volume owner</summary>
public uint volowner; public readonly uint volowner;
/// <summary>0x030, Security mask (??)</summary> /// <summary>0x030, Security mask (??)</summary>
public uint sec_mask; public readonly uint sec_mask;
/// <summary>0x034, Volume permissions (system, owner, group and other)</summary> /// <summary>0x034, Volume permissions (system, owner, group and other)</summary>
public ushort protect; public readonly ushort protect;
/// <summary>0x036, Default file protection, unsupported in ODS-2</summary> /// <summary>0x036, Default file protection, unsupported in ODS-2</summary>
public ushort fileprot; public readonly ushort fileprot;
/// <summary>0x038, Default file record protection</summary> /// <summary>0x038, Default file record protection</summary>
public ushort recprot; public readonly ushort recprot;
/// <summary>0x03A, Checksum of all preceding entries</summary> /// <summary>0x03A, Checksum of all preceding entries</summary>
public ushort checksum1; public readonly ushort checksum1;
/// <summary>0x03C, Creation date</summary> /// <summary>0x03C, Creation date</summary>
public ulong credate; public readonly ulong credate;
/// <summary>0x044, Window size (pointers for the window)</summary> /// <summary>0x044, Window size (pointers for the window)</summary>
public byte window; public readonly byte window;
/// <summary>0x045, Directories to be stored in cache</summary> /// <summary>0x045, Directories to be stored in cache</summary>
public byte lru_lim; public readonly byte lru_lim;
/// <summary>0x046, Default allocation size in blocks</summary> /// <summary>0x046, Default allocation size in blocks</summary>
public ushort extend; public readonly ushort extend;
/// <summary>0x048, Minimum file retention period</summary> /// <summary>0x048, Minimum file retention period</summary>
public ulong retainmin; public readonly ulong retainmin;
/// <summary>0x050, Maximum file retention period</summary> /// <summary>0x050, Maximum file retention period</summary>
public ulong retainmax; public readonly ulong retainmax;
/// <summary>0x058, Last modification date</summary> /// <summary>0x058, Last modification date</summary>
public ulong revdate; public readonly ulong revdate;
/// <summary>0x060, Minimum security class, 20 bytes</summary> /// <summary>0x060, Minimum security class, 20 bytes</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
public byte[] min_class; public readonly byte[] min_class;
/// <summary>0x074, Maximum security class, 20 bytes</summary> /// <summary>0x074, Maximum security class, 20 bytes</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)]
public byte[] max_class; public readonly byte[] max_class;
/// <summary>0x088, File lookup table FID</summary> /// <summary>0x088, File lookup table FID</summary>
public ushort filetab_fid1; public readonly ushort filetab_fid1;
/// <summary>0x08A, File lookup table FID</summary> /// <summary>0x08A, File lookup table FID</summary>
public ushort filetab_fid2; public readonly ushort filetab_fid2;
/// <summary>0x08C, File lookup table FID</summary> /// <summary>0x08C, File lookup table FID</summary>
public ushort filetab_fid3; public readonly ushort filetab_fid3;
/// <summary>0x08E, Lowest structure level on the volume</summary> /// <summary>0x08E, Lowest structure level on the volume</summary>
public ushort lowstruclev; public readonly ushort lowstruclev;
/// <summary>0x090, Highest structure level on the volume</summary> /// <summary>0x090, Highest structure level on the volume</summary>
public ushort highstruclev; public readonly ushort highstruclev;
/// <summary>0x092, Volume copy date (??)</summary> /// <summary>0x092, Volume copy date (??)</summary>
public ulong copydate; public readonly ulong copydate;
/// <summary>0x09A, 302 bytes</summary> /// <summary>0x09A, 302 bytes</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 302)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 302)]
public byte[] reserved1; public readonly byte[] reserved1;
/// <summary>0x1C8, Physical drive serial number</summary> /// <summary>0x1C8, Physical drive serial number</summary>
public uint serialnum; public readonly uint serialnum;
/// <summary>0x1CC, Name of the volume set, 12 bytes</summary> /// <summary>0x1CC, Name of the volume set, 12 bytes</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)]
public byte[] strucname; public readonly byte[] strucname;
/// <summary>0x1D8, Volume label, 12 bytes</summary> /// <summary>0x1D8, Volume label, 12 bytes</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)]
public byte[] volname; public readonly byte[] volname;
/// <summary>0x1E4, Name of the volume owner, 12 bytes</summary> /// <summary>0x1E4, Name of the volume owner, 12 bytes</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)]
public byte[] ownername; public readonly byte[] ownername;
/// <summary>0x1F0, ODS-2 defines it as "DECFILE11B", 12 bytes</summary> /// <summary>0x1F0, ODS-2 defines it as "DECFILE11B", 12 bytes</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)]
public byte[] format; public readonly byte[] format;
/// <summary>0x1FC, Reserved</summary> /// <summary>0x1FC, Reserved</summary>
public ushort reserved2; public readonly ushort reserved2;
/// <summary>0x1FE, Checksum of preceding 255 words (16 bit units)</summary> /// <summary>0x1FE, Checksum of preceding 255 words (16 bit units)</summary>
public ushort checksum2; public readonly ushort checksum2;
} }
} }
} }

View File

@@ -123,8 +123,8 @@ namespace DiscImageChef.Filesystems
{ {
Type = "Opera", Type = "Opera",
VolumeName = StringHandlers.CToString(sb.volume_label, Encoding), VolumeName = StringHandlers.CToString(sb.volume_label, Encoding),
ClusterSize = sb.block_size, ClusterSize = (uint)sb.block_size,
Clusters = sb.block_count Clusters = (ulong)sb.block_count
}; };
} }
@@ -132,34 +132,34 @@ namespace DiscImageChef.Filesystems
struct OperaSuperBlock struct OperaSuperBlock
{ {
/// <summary>0x000, Record type, must be 1</summary> /// <summary>0x000, Record type, must be 1</summary>
public byte record_type; public readonly byte record_type;
/// <summary>0x001, 5 bytes, "ZZZZZ"</summary> /// <summary>0x001, 5 bytes, "ZZZZZ"</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
public byte[] sync_bytes; public byte[] sync_bytes;
/// <summary>0x006, Record version, must be 1</summary> /// <summary>0x006, Record version, must be 1</summary>
public byte record_version; public readonly byte record_version;
/// <summary>0x007, Volume flags</summary> /// <summary>0x007, Volume flags</summary>
public byte volume_flags; public readonly byte volume_flags;
/// <summary>0x008, 32 bytes, volume comment</summary> /// <summary>0x008, 32 bytes, volume comment</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] volume_comment; public readonly byte[] volume_comment;
/// <summary>0x028, 32 bytes, volume label</summary> /// <summary>0x028, 32 bytes, volume label</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] volume_label; public readonly byte[] volume_label;
/// <summary>0x048, Volume ID</summary> /// <summary>0x048, Volume ID</summary>
public int volume_id; public readonly int volume_id;
/// <summary>0x04C, Block size in bytes</summary> /// <summary>0x04C, Block size in bytes</summary>
public int block_size; public readonly int block_size;
/// <summary>0x050, Blocks in volume</summary> /// <summary>0x050, Blocks in volume</summary>
public int block_count; public readonly int block_count;
/// <summary>0x054, Root directory ID</summary> /// <summary>0x054, Root directory ID</summary>
public int root_dirid; public readonly int root_dirid;
/// <summary>0x058, Root directory blocks</summary> /// <summary>0x058, Root directory blocks</summary>
public int rootdir_blocks; public readonly int rootdir_blocks;
/// <summary>0x05C, Root directory block size</summary> /// <summary>0x05C, Root directory block size</summary>
public int rootdir_bsize; public readonly int rootdir_bsize;
/// <summary>0x060, Last root directory copy</summary> /// <summary>0x060, Last root directory copy</summary>
public int last_root_copy; public readonly int last_root_copy;
} }
} }
} }

View File

@@ -66,7 +66,7 @@ namespace DiscImageChef.Filesystems
XmlFsType = new FileSystemType XmlFsType = new FileSystemType
{ {
Type = "PC Engine filesystem", Type = "PC Engine filesystem",
Clusters = (long)((partition.End - partition.Start + 1) / imagePlugin.Info.SectorSize * 2048), Clusters = (partition.End - partition.Start + 1) / imagePlugin.Info.SectorSize * 2048,
ClusterSize = 2048 ClusterSize = 2048
}; };
} }

View File

@@ -106,7 +106,7 @@ namespace DiscImageChef.Filesystems
XmlFsType = new FileSystemType XmlFsType = new FileSystemType
{ {
Type = "PC-FX", Type = "PC-FX",
Clusters = (long)partition.Length, Clusters = partition.Length,
ClusterSize = 2048, ClusterSize = 2048,
Bootable = true, Bootable = true,
CreationDate = dateTime, CreationDate = dateTime,
@@ -121,27 +121,27 @@ namespace DiscImageChef.Filesystems
struct PcfxHeader struct PcfxHeader
{ {
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] signature; public readonly byte[] signature;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0xE0)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0xE0)]
public byte[] copyright; public readonly byte[] copyright;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x710)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 0x710)]
public byte[] unknown; public readonly byte[] unknown;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] title; public readonly byte[] title;
public uint loadOffset; public readonly uint loadOffset;
public uint loadCount; public readonly uint loadCount;
public uint loadAddress; public readonly uint loadAddress;
public uint entryPoint; public readonly uint entryPoint;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public byte[] makerId; public readonly byte[] makerId;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 60)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 60)]
public byte[] makerName; public readonly byte[] makerName;
public uint volumeNumber; public readonly uint volumeNumber;
public byte majorVersion; public readonly byte majorVersion;
public byte minorVersion; public readonly byte minorVersion;
public ushort country; public readonly ushort country;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[] date; public readonly byte[] date;
} }
} }
} }

View File

@@ -135,7 +135,7 @@ namespace DiscImageChef.Filesystems
XmlFsType.FreeClusters = rootBlock.blocksfree; XmlFsType.FreeClusters = rootBlock.blocksfree;
XmlFsType.FreeClustersSpecified = true; XmlFsType.FreeClustersSpecified = true;
XmlFsType.Clusters = rootBlock.diskSize; XmlFsType.Clusters = rootBlock.diskSize;
XmlFsType.ClusterSize = (int)imagePlugin.Info.SectorSize; XmlFsType.ClusterSize = imagePlugin.Info.SectorSize;
XmlFsType.VolumeName = StringHandlers.PascalToString(rootBlock.diskname, Encoding); XmlFsType.VolumeName = StringHandlers.PascalToString(rootBlock.diskname, Encoding);
} }
@@ -148,11 +148,11 @@ namespace DiscImageChef.Filesystems
/// <summary> /// <summary>
/// "PFS\1" disk type /// "PFS\1" disk type
/// </summary> /// </summary>
public uint diskType; public readonly uint diskType;
/// <summary> /// <summary>
/// Boot code, til completion /// Boot code, til completion
/// </summary> /// </summary>
public byte[] bootCode; public readonly byte[] bootCode;
} }
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
@@ -161,84 +161,84 @@ namespace DiscImageChef.Filesystems
/// <summary> /// <summary>
/// Disk type /// Disk type
/// </summary> /// </summary>
public uint diskType; public readonly uint diskType;
/// <summary> /// <summary>
/// Options /// Options
/// </summary> /// </summary>
public uint options; public readonly uint options;
/// <summary> /// <summary>
/// Current datestamp /// Current datestamp
/// </summary> /// </summary>
public uint datestamp; public readonly uint datestamp;
/// <summary> /// <summary>
/// Volume creation day /// Volume creation day
/// </summary> /// </summary>
public ushort creationday; public readonly ushort creationday;
/// <summary> /// <summary>
/// Volume creation minute /// Volume creation minute
/// </summary> /// </summary>
public ushort creationminute; public readonly ushort creationminute;
/// <summary> /// <summary>
/// Volume creation tick /// Volume creation tick
/// </summary> /// </summary>
public ushort creationtick; public readonly ushort creationtick;
/// <summary> /// <summary>
/// AmigaDOS protection bits /// AmigaDOS protection bits
/// </summary> /// </summary>
public ushort protection; public readonly ushort protection;
/// <summary> /// <summary>
/// Volume label (Pascal string) /// Volume label (Pascal string)
/// </summary> /// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] diskname; public readonly byte[] diskname;
/// <summary> /// <summary>
/// Last reserved block /// Last reserved block
/// </summary> /// </summary>
public uint lastreserved; public readonly uint lastreserved;
/// <summary> /// <summary>
/// First reserved block /// First reserved block
/// </summary> /// </summary>
public uint firstreserved; public readonly uint firstreserved;
/// <summary> /// <summary>
/// Free reserved blocks /// Free reserved blocks
/// </summary> /// </summary>
public uint reservedfree; public readonly uint reservedfree;
/// <summary> /// <summary>
/// Size of reserved blocks in bytes /// Size of reserved blocks in bytes
/// </summary> /// </summary>
public ushort reservedblocksize; public readonly ushort reservedblocksize;
/// <summary> /// <summary>
/// Blocks in rootblock, including bitmap /// Blocks in rootblock, including bitmap
/// </summary> /// </summary>
public ushort rootblockclusters; public readonly ushort rootblockclusters;
/// <summary> /// <summary>
/// Free blocks /// Free blocks
/// </summary> /// </summary>
public uint blocksfree; public readonly uint blocksfree;
/// <summary> /// <summary>
/// Blocks that must be always free /// Blocks that must be always free
/// </summary> /// </summary>
public uint alwaysfree; public readonly uint alwaysfree;
/// <summary> /// <summary>
/// Current bitmapfield number for allocation /// Current bitmapfield number for allocation
/// </summary> /// </summary>
public uint rovingPointer; public readonly uint rovingPointer;
/// <summary> /// <summary>
/// Pointer to deldir /// Pointer to deldir
/// </summary> /// </summary>
public uint delDirPtr; public readonly uint delDirPtr;
/// <summary> /// <summary>
/// Disk size in sectors /// Disk size in sectors
/// </summary> /// </summary>
public uint diskSize; public readonly uint diskSize;
/// <summary> /// <summary>
/// Rootblock extension /// Rootblock extension
/// </summary> /// </summary>
public uint extension; public readonly uint extension;
/// <summary> /// <summary>
/// Unused /// Unused
/// </summary> /// </summary>
public uint unused; public readonly uint unused;
} }
} }
} }

View File

@@ -307,8 +307,8 @@ namespace DiscImageChef.Filesystems
Type = "ProDOS" Type = "ProDOS"
}; };
XmlFsType.ClusterSize = (int)((partition.End - partition.Start + 1) * imagePlugin.Info.SectorSize / XmlFsType.ClusterSize = (uint)((partition.End - partition.Start + 1) * imagePlugin.Info.SectorSize /
(ulong)XmlFsType.Clusters); XmlFsType.Clusters);
if(!dateCorrect) return; if(!dateCorrect) return;
XmlFsType.CreationDate = rootDirectoryKeyBlock.header.creation_time; XmlFsType.CreationDate = rootDirectoryKeyBlock.header.creation_time;

View File

@@ -175,7 +175,7 @@ namespace DiscImageChef.Filesystems
XmlFsType = new FileSystemType XmlFsType = new FileSystemType
{ {
Type = "QNX4 filesystem", Type = "QNX4 filesystem",
Clusters = (long)partition.Length, Clusters = partition.Length,
ClusterSize = 512, ClusterSize = 512,
CreationDate = DateHandlers.UnixUnsignedToDateTime(qnxSb.rootDir.di_ftime), CreationDate = DateHandlers.UnixUnsignedToDateTime(qnxSb.rootDir.di_ftime),
CreationDateSpecified = true, CreationDateSpecified = true,
@@ -195,59 +195,59 @@ namespace DiscImageChef.Filesystems
struct QNX4_Inode struct QNX4_Inode
{ {
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] di_fname; public readonly byte[] di_fname;
public uint di_size; public readonly uint di_size;
public QNX4_Extent di_first_xtnt; public readonly QNX4_Extent di_first_xtnt;
public uint di_xblk; public readonly uint di_xblk;
public uint di_ftime; public readonly uint di_ftime;
public uint di_mtime; public readonly uint di_mtime;
public uint di_atime; public readonly uint di_atime;
public uint di_ctime; public readonly uint di_ctime;
public ushort di_num_xtnts; public readonly ushort di_num_xtnts;
public ushort di_mode; public readonly ushort di_mode;
public ushort di_uid; public readonly ushort di_uid;
public ushort di_gid; public readonly ushort di_gid;
public ushort di_nlink; public readonly ushort di_nlink;
public uint di_zero; public readonly uint di_zero;
public byte di_type; public readonly byte di_type;
public byte di_status; public readonly byte di_status;
} }
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct QNX4_LinkInfo struct QNX4_LinkInfo
{ {
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 48)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 48)]
public byte[] dl_fname; public readonly byte[] dl_fname;
public uint dl_inode_blk; public readonly uint dl_inode_blk;
public byte dl_inode_ndx; public readonly byte dl_inode_ndx;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
public byte[] dl_spare; public readonly byte[] dl_spare;
public byte dl_status; public readonly byte dl_status;
} }
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct QNX4_ExtentBlock struct QNX4_ExtentBlock
{ {
public uint next_xblk; public readonly uint next_xblk;
public uint prev_xblk; public readonly uint prev_xblk;
public byte num_xtnts; public readonly byte num_xtnts;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public byte[] spare; public readonly byte[] spare;
public uint num_blocks; public readonly uint num_blocks;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 60)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 60)]
public QNX4_Extent[] xtnts; public readonly QNX4_Extent[] xtnts;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[] signature; public readonly byte[] signature;
public QNX4_Extent first_xtnt; public readonly QNX4_Extent first_xtnt;
} }
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct QNX4_Superblock struct QNX4_Superblock
{ {
public QNX4_Inode rootDir; public readonly QNX4_Inode rootDir;
public QNX4_Inode inode; public readonly QNX4_Inode inode;
public QNX4_Inode boot; public readonly QNX4_Inode boot;
public QNX4_Inode altBoot; public readonly QNX4_Inode altBoot;
} }
} }
} }

View File

@@ -104,7 +104,7 @@ namespace DiscImageChef.Filesystems
{ {
Type = "QNX6 (Audi) filesystem", Type = "QNX6 (Audi) filesystem",
Clusters = audiSb.numBlocks, Clusters = audiSb.numBlocks,
ClusterSize = (int)audiSb.blockSize, ClusterSize = audiSb.blockSize,
Bootable = true, Bootable = true,
Files = audiSb.numInodes - audiSb.freeInodes, Files = audiSb.numInodes - audiSb.freeInodes,
FilesSpecified = true, FilesSpecified = true,
@@ -137,7 +137,7 @@ namespace DiscImageChef.Filesystems
{ {
Type = "QNX6 filesystem", Type = "QNX6 filesystem",
Clusters = qnxSb.numBlocks, Clusters = qnxSb.numBlocks,
ClusterSize = (int)qnxSb.blockSize, ClusterSize = qnxSb.blockSize,
Bootable = true, Bootable = true,
Files = qnxSb.numInodes - qnxSb.freeInodes, Files = qnxSb.numInodes - qnxSb.freeInodes,
FilesSpecified = true, FilesSpecified = true,
@@ -157,60 +157,60 @@ namespace DiscImageChef.Filesystems
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct QNX6_RootNode struct QNX6_RootNode
{ {
public ulong size; public readonly ulong size;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public uint[] pointers; public readonly uint[] pointers;
public byte levels; public readonly byte levels;
public byte mode; public readonly byte mode;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
public byte[] spare; public readonly byte[] spare;
} }
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct QNX6_SuperBlock struct QNX6_SuperBlock
{ {
public uint magic; public readonly uint magic;
public uint checksum; public readonly uint checksum;
public ulong serial; public readonly ulong serial;
public uint ctime; public readonly uint ctime;
public uint atime; public readonly uint atime;
public uint flags; public readonly uint flags;
public ushort version1; public readonly ushort version1;
public ushort version2; public readonly ushort version2;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] volumeid; public readonly byte[] volumeid;
public uint blockSize; public readonly uint blockSize;
public uint numInodes; public readonly uint numInodes;
public uint freeInodes; public readonly uint freeInodes;
public uint numBlocks; public readonly uint numBlocks;
public uint freeBlocks; public readonly uint freeBlocks;
public uint allocationGroup; public readonly uint allocationGroup;
public QNX6_RootNode inode; public readonly QNX6_RootNode inode;
public QNX6_RootNode bitmap; public readonly QNX6_RootNode bitmap;
public QNX6_RootNode longfile; public readonly QNX6_RootNode longfile;
public QNX6_RootNode unknown; public readonly QNX6_RootNode unknown;
} }
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct QNX6_AudiSuperBlock struct QNX6_AudiSuperBlock
{ {
public uint magic; public readonly uint magic;
public uint checksum; public readonly uint checksum;
public ulong serial; public readonly ulong serial;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)]
public byte[] spare1; public readonly byte[] spare1;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)]
public byte[] id; public readonly byte[] id;
public uint blockSize; public readonly uint blockSize;
public uint numInodes; public readonly uint numInodes;
public uint freeInodes; public readonly uint freeInodes;
public uint numBlocks; public readonly uint numBlocks;
public uint freeBlocks; public readonly uint freeBlocks;
public uint spare2; public readonly uint spare2;
public QNX6_RootNode inode; public readonly QNX6_RootNode inode;
public QNX6_RootNode bitmap; public readonly QNX6_RootNode bitmap;
public QNX6_RootNode longfile; public readonly QNX6_RootNode longfile;
public QNX6_RootNode unknown; public readonly QNX6_RootNode unknown;
} }
} }
} }

View File

@@ -207,7 +207,7 @@ namespace DiscImageChef.Filesystems
{ {
Type = "OS-9 Random Block File", Type = "OS-9 Random Block File",
Bootable = LSNToUInt32(rbfSb.dd_bt) > 0 && rbfSb.dd_bsz > 0, Bootable = LSNToUInt32(rbfSb.dd_bt) > 0 && rbfSb.dd_bsz > 0,
ClusterSize = rbfSb.dd_bit * (256 << rbfSb.dd_lsnsize), ClusterSize = (uint)(rbfSb.dd_bit * (256 << rbfSb.dd_lsnsize)),
Clusters = LSNToUInt32(rbfSb.dd_tot), Clusters = LSNToUInt32(rbfSb.dd_tot),
CreationDate = DateHandlers.Os9ToDateTime(rbfSb.dd_dat), CreationDate = DateHandlers.Os9ToDateTime(rbfSb.dd_dat),
CreationDateSpecified = true, CreationDateSpecified = true,
@@ -234,52 +234,52 @@ namespace DiscImageChef.Filesystems
{ {
/// <summary>Sectors on disk</summary> /// <summary>Sectors on disk</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public byte[] dd_tot; public readonly byte[] dd_tot;
/// <summary>Tracks</summary> /// <summary>Tracks</summary>
public byte dd_tks; public readonly byte dd_tks;
/// <summary>Bytes in allocation map</summary> /// <summary>Bytes in allocation map</summary>
public ushort dd_map; public readonly ushort dd_map;
/// <summary>Sectors per cluster</summary> /// <summary>Sectors per cluster</summary>
public ushort dd_bit; public readonly ushort dd_bit;
/// <summary>LSN of root directory</summary> /// <summary>LSN of root directory</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public byte[] dd_dir; public readonly byte[] dd_dir;
/// <summary>Owner ID</summary> /// <summary>Owner ID</summary>
public ushort dd_own; public readonly ushort dd_own;
/// <summary>Attributes</summary> /// <summary>Attributes</summary>
public byte dd_att; public readonly byte dd_att;
/// <summary>Disk ID</summary> /// <summary>Disk ID</summary>
public ushort dd_dsk; public readonly ushort dd_dsk;
/// <summary>Format byte</summary> /// <summary>Format byte</summary>
public byte dd_fmt; public readonly byte dd_fmt;
/// <summary>Sectors per track</summary> /// <summary>Sectors per track</summary>
public ushort dd_spt; public readonly ushort dd_spt;
/// <summary>Reserved</summary> /// <summary>Reserved</summary>
public ushort dd_res; public readonly ushort dd_res;
/// <summary>LSN of boot file</summary> /// <summary>LSN of boot file</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public byte[] dd_bt; public readonly byte[] dd_bt;
/// <summary>Size of boot file</summary> /// <summary>Size of boot file</summary>
public ushort dd_bsz; public readonly ushort dd_bsz;
/// <summary>Creation date</summary> /// <summary>Creation date</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
public byte[] dd_dat; public readonly byte[] dd_dat;
/// <summary>Volume name</summary> /// <summary>Volume name</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] dd_nam; public readonly byte[] dd_nam;
/// <summary>Path options</summary> /// <summary>Path options</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] dd_opt; public readonly byte[] dd_opt;
/// <summary>Reserved</summary> /// <summary>Reserved</summary>
public byte reserved; public readonly byte reserved;
/// <summary>Magic number</summary> /// <summary>Magic number</summary>
public uint dd_sync; public readonly uint dd_sync;
/// <summary>LSN of allocation map</summary> /// <summary>LSN of allocation map</summary>
public uint dd_maplsn; public readonly uint dd_maplsn;
/// <summary>Size of an LSN</summary> /// <summary>Size of an LSN</summary>
public ushort dd_lsnsize; public readonly ushort dd_lsnsize;
/// <summary>Version ID</summary> /// <summary>Version ID</summary>
public ushort dd_versid; public readonly ushort dd_versid;
} }
/// <summary> /// <summary>
@@ -290,53 +290,53 @@ namespace DiscImageChef.Filesystems
struct RBF_NewIdSector struct RBF_NewIdSector
{ {
/// <summary>Magic number</summary> /// <summary>Magic number</summary>
public uint rid_sync; public readonly uint rid_sync;
/// <summary>Disk ID</summary> /// <summary>Disk ID</summary>
public uint rid_diskid; public readonly uint rid_diskid;
/// <summary>Sectors on disk</summary> /// <summary>Sectors on disk</summary>
public uint rid_totblocks; public readonly uint rid_totblocks;
/// <summary>Cylinders</summary> /// <summary>Cylinders</summary>
public ushort rid_cylinders; public readonly ushort rid_cylinders;
/// <summary>Sectors in cylinder 0</summary> /// <summary>Sectors in cylinder 0</summary>
public ushort rid_cyl0size; public readonly ushort rid_cyl0size;
/// <summary>Sectors per cylinder</summary> /// <summary>Sectors per cylinder</summary>
public ushort rid_cylsize; public readonly ushort rid_cylsize;
/// <summary>Heads</summary> /// <summary>Heads</summary>
public ushort rid_heads; public readonly ushort rid_heads;
/// <summary>Bytes per sector</summary> /// <summary>Bytes per sector</summary>
public ushort rid_blocksize; public readonly ushort rid_blocksize;
/// <summary>Disk format</summary> /// <summary>Disk format</summary>
public ushort rid_format; public readonly ushort rid_format;
/// <summary>Flags</summary> /// <summary>Flags</summary>
public ushort rid_flags; public readonly ushort rid_flags;
/// <summary>Padding</summary> /// <summary>Padding</summary>
public ushort rid_unused1; public readonly ushort rid_unused1;
/// <summary>Sector of allocation bitmap</summary> /// <summary>Sector of allocation bitmap</summary>
public uint rid_bitmap; public readonly uint rid_bitmap;
/// <summary>Sector of debugger FD</summary> /// <summary>Sector of debugger FD</summary>
public uint rid_firstboot; public readonly uint rid_firstboot;
/// <summary>Sector of bootfile FD</summary> /// <summary>Sector of bootfile FD</summary>
public uint rid_bootfile; public readonly uint rid_bootfile;
/// <summary>Sector of root directory FD</summary> /// <summary>Sector of root directory FD</summary>
public uint rid_rootdir; public readonly uint rid_rootdir;
/// <summary>Group owner of media</summary> /// <summary>Group owner of media</summary>
public ushort rid_group; public readonly ushort rid_group;
/// <summary>Owner of media</summary> /// <summary>Owner of media</summary>
public ushort rid_owner; public readonly ushort rid_owner;
/// <summary>Creation time</summary> /// <summary>Creation time</summary>
public uint rid_ctime; public readonly uint rid_ctime;
/// <summary>Last write time for this structure</summary> /// <summary>Last write time for this structure</summary>
public uint rid_mtime; public readonly uint rid_mtime;
/// <summary>Volume name</summary> /// <summary>Volume name</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] rid_name; public readonly byte[] rid_name;
/// <summary>Endian flag</summary> /// <summary>Endian flag</summary>
public byte rid_endflag; public readonly byte rid_endflag;
/// <summary>Padding</summary> /// <summary>Padding</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public byte[] rid_unused2; public readonly byte[] rid_unused2;
/// <summary>Parity</summary> /// <summary>Parity</summary>
public uint rid_parity; public readonly uint rid_parity;
} }
} }
} }

View File

@@ -105,7 +105,7 @@ namespace DiscImageChef.Filesystems
XmlFsType = new FileSystemType XmlFsType = new FileSystemType
{ {
Type = "RT-11", Type = "RT-11",
ClusterSize = homeblock.cluster * 512, ClusterSize = (uint)(homeblock.cluster * 512),
Clusters = homeblock.cluster, Clusters = homeblock.cluster,
VolumeName = StringHandlers.SpacePaddedToString(homeblock.volname, Encoding), VolumeName = StringHandlers.SpacePaddedToString(homeblock.volname, Encoding),
Bootable = !ArrayHelpers.ArrayIsNullOrEmpty(bootBlock) Bootable = !ArrayHelpers.ArrayIsNullOrEmpty(bootBlock)
@@ -119,47 +119,47 @@ namespace DiscImageChef.Filesystems
{ {
/// <summary>Bad block replacement table</summary> /// <summary>Bad block replacement table</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 130)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 130)]
public byte[] badBlockTable; public readonly byte[] badBlockTable;
/// <summary>Unused</summary> /// <summary>Unused</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
public byte[] unused; public readonly byte[] unused;
/// <summary>INITIALIZE/RESTORE data area</summary> /// <summary>INITIALIZE/RESTORE data area</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 38)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 38)]
public byte[] initArea; public readonly byte[] initArea;
/// <summary>BUP information area</summary> /// <summary>BUP information area</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 18)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 18)]
public byte[] bupInformation; public readonly byte[] bupInformation;
/// <summary>Empty</summary> /// <summary>Empty</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 260)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 260)]
public byte[] empty; public readonly byte[] empty;
/// <summary>Reserved</summary> /// <summary>Reserved</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
public byte[] reserved1; public readonly byte[] reserved1;
/// <summary>Reserved</summary> /// <summary>Reserved</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
public byte[] reserved2; public readonly byte[] reserved2;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 14)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 14)]
public byte[] empty2; public readonly byte[] empty2;
/// <summary>Cluster size</summary> /// <summary>Cluster size</summary>
public ushort cluster; public readonly ushort cluster;
/// <summary>Block of the first directory segment</summary> /// <summary>Block of the first directory segment</summary>
public ushort rootBlock; public readonly ushort rootBlock;
/// <summary>"V3A" in Radix-50</summary> /// <summary>"V3A" in Radix-50</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
public byte[] systemVersion; public readonly byte[] systemVersion;
/// <summary>Name of the volume, 12 bytes</summary> /// <summary>Name of the volume, 12 bytes</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)]
public byte[] volname; public readonly byte[] volname;
/// <summary>Name of the volume owner, 12 bytes</summary> /// <summary>Name of the volume owner, 12 bytes</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)]
public byte[] ownername; public readonly byte[] ownername;
/// <summary>RT11 defines it as "DECRT11A ", 12 bytes</summary> /// <summary>RT11 defines it as "DECRT11A ", 12 bytes</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)]
public byte[] format; public readonly byte[] format;
/// <summary>Unused</summary> /// <summary>Unused</summary>
public ushort unused2; public readonly ushort unused2;
/// <summary>Checksum of preceding 255 words (16 bit units)</summary> /// <summary>Checksum of preceding 255 words (16 bit units)</summary>
public ushort checksum; public readonly ushort checksum;
} }
} }
} }

View File

@@ -122,8 +122,8 @@ namespace DiscImageChef.Filesystems
XmlFsType = new FileSystemType XmlFsType = new FileSystemType
{ {
Type = "Resilient File System", Type = "Resilient File System",
ClusterSize = (int)(refsVhdr.bytesPerSector * refsVhdr.sectorsPerCluster), ClusterSize = refsVhdr.bytesPerSector * refsVhdr.sectorsPerCluster,
Clusters = (long)(refsVhdr.sectors / refsVhdr.sectorsPerCluster) Clusters = refsVhdr.sectors / refsVhdr.sectorsPerCluster
}; };
} }
@@ -131,23 +131,23 @@ namespace DiscImageChef.Filesystems
struct RefsVolumeHeader struct RefsVolumeHeader
{ {
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public byte[] jump; public readonly byte[] jump;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[] signature; public readonly byte[] signature;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)]
public byte[] mustBeZero; public readonly byte[] mustBeZero;
public uint identifier; public readonly uint identifier;
public ushort length; public readonly ushort length;
public ushort checksum; public readonly ushort checksum;
public ulong sectors; public readonly ulong sectors;
public uint bytesPerSector; public readonly uint bytesPerSector;
public uint sectorsPerCluster; public readonly uint sectorsPerCluster;
public uint unknown1; public readonly uint unknown1;
public uint unknown2; public readonly uint unknown2;
public ulong unknown3; public readonly ulong unknown3;
public ulong unknown4; public readonly ulong unknown4;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 15872)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 15872)]
public byte[] unknown5; public readonly byte[] unknown5;
} }
} }
} }

View File

@@ -108,10 +108,9 @@ namespace DiscImageChef.Filesystems
XmlFsType = new FileSystemType XmlFsType = new FileSystemType
{ {
Type = "Reiser 4 filesystem", Type = "Reiser 4 filesystem",
ClusterSize = reiserSb.blocksize, ClusterSize = reiserSb.blocksize,
Clusters = Clusters = (partition.End - partition.Start) * imagePlugin.Info.SectorSize / reiserSb.blocksize,
(long)((partition.End - partition.Start) * imagePlugin.Info.SectorSize / reiserSb.blocksize),
VolumeName = StringHandlers.CToString(reiserSb.label, Encoding), VolumeName = StringHandlers.CToString(reiserSb.label, Encoding),
VolumeSerial = reiserSb.uuid.ToString() VolumeSerial = reiserSb.uuid.ToString()
}; };
@@ -121,12 +120,12 @@ namespace DiscImageChef.Filesystems
struct Reiser4_Superblock struct Reiser4_Superblock
{ {
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] magic; public readonly byte[] magic;
public ushort diskformat; public readonly ushort diskformat;
public ushort blocksize; public readonly ushort blocksize;
public Guid uuid; public readonly Guid uuid;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] label; public readonly byte[] label;
} }
} }
} }

View File

@@ -105,7 +105,7 @@ namespace DiscImageChef.Filesystems
CreationDate = DateHandlers.UnixUnsignedToDateTime(rootBlock.datecreated).AddYears(8), CreationDate = DateHandlers.UnixUnsignedToDateTime(rootBlock.datecreated).AddYears(8),
CreationDateSpecified = true, CreationDateSpecified = true,
Clusters = rootBlock.totalblocks, Clusters = rootBlock.totalblocks,
ClusterSize = (int)rootBlock.blocksize, ClusterSize = rootBlock.blocksize,
Type = "SmartFileSystem" Type = "SmartFileSystem"
}; };
} }
@@ -120,32 +120,32 @@ namespace DiscImageChef.Filesystems
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct RootBlock struct RootBlock
{ {
public uint blockId; public readonly uint blockId;
public uint blockChecksum; public readonly uint blockChecksum;
public uint blockSelfPointer; public readonly uint blockSelfPointer;
public ushort version; public readonly ushort version;
public ushort sequence; public readonly ushort sequence;
public uint datecreated; public readonly uint datecreated;
public SFSFlags bits; public readonly SFSFlags bits;
public byte padding1; public readonly byte padding1;
public ushort padding2; public readonly ushort padding2;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
public uint[] reserved1; public readonly uint[] reserved1;
public ulong firstbyte; public readonly ulong firstbyte;
public ulong lastbyte; public readonly ulong lastbyte;
public uint totalblocks; public readonly uint totalblocks;
public uint blocksize; public readonly uint blocksize;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
public uint[] reserved2; public readonly uint[] reserved2;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public uint[] reserved3; public readonly uint[] reserved3;
public uint bitmapbase; public readonly uint bitmapbase;
public uint adminspacecontainer; public readonly uint adminspacecontainer;
public uint rootobjectcontainer; public readonly uint rootobjectcontainer;
public uint extentbnoderoot; public readonly uint extentbnoderoot;
public uint objectnoderoot; public readonly uint objectnoderoot;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public uint[] reserved4; public readonly uint[] reserved4;
} }
} }
} }

View File

@@ -130,8 +130,8 @@ namespace DiscImageChef.Filesystems
CreationDate = DateHandlers.UnixUnsignedToDateTime(sqSb.mkfs_time), CreationDate = DateHandlers.UnixUnsignedToDateTime(sqSb.mkfs_time),
CreationDateSpecified = true, CreationDateSpecified = true,
Clusters = Clusters =
(long)((partition.End - partition.Start + 1) * imagePlugin.Info.SectorSize / sqSb.block_size), (partition.End - partition.Start + 1) * imagePlugin.Info.SectorSize / sqSb.block_size,
ClusterSize = (int)sqSb.block_size, ClusterSize = sqSb.block_size,
Files = sqSb.inodes, Files = sqSb.inodes,
FilesSpecified = true, FilesSpecified = true,
FreeClusters = 0, FreeClusters = 0,
@@ -152,25 +152,25 @@ namespace DiscImageChef.Filesystems
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct SquashSuperBlock struct SquashSuperBlock
{ {
public uint magic; public readonly uint magic;
public uint inodes; public readonly uint inodes;
public uint mkfs_time; public readonly uint mkfs_time;
public uint block_size; public readonly uint block_size;
public uint fragments; public readonly uint fragments;
public ushort compression; public readonly ushort compression;
public ushort block_log; public readonly ushort block_log;
public ushort flags; public readonly ushort flags;
public ushort no_ids; public readonly ushort no_ids;
public ushort s_major; public readonly ushort s_major;
public ushort s_minor; public readonly ushort s_minor;
public ulong root_inode; public readonly ulong root_inode;
public ulong bytes_used; public readonly ulong bytes_used;
public ulong id_table_start; public readonly ulong id_table_start;
public ulong xattr_id_table_start; public readonly ulong xattr_id_table_start;
public ulong inode_table_start; public readonly ulong inode_table_start;
public ulong directory_table_start; public readonly ulong directory_table_start;
public ulong fragment_table_start; public readonly ulong fragment_table_start;
public ulong lookup_table_start; public readonly ulong lookup_table_start;
} }
} }
} }

View File

@@ -165,9 +165,9 @@ namespace DiscImageChef.Filesystems.UCSDPascal
{ {
Bootable = Bootable =
!ArrayHelpers.ArrayIsNullOrEmpty(imagePlugin.ReadSectors(partition.Start, multiplier * 2)), !ArrayHelpers.ArrayIsNullOrEmpty(imagePlugin.ReadSectors(partition.Start, multiplier * 2)),
Clusters = volEntry.Blocks, Clusters = (ulong)volEntry.Blocks,
ClusterSize = (int)imagePlugin.Info.SectorSize, ClusterSize = imagePlugin.Info.SectorSize,
Files = volEntry.Files, Files = (ulong)volEntry.Files,
FilesSpecified = true, FilesSpecified = true,
Type = "UCSD Pascal", Type = "UCSD Pascal",
VolumeName = StringHandlers.PascalToString(volEntry.VolumeName, Encoding) VolumeName = StringHandlers.PascalToString(volEntry.VolumeName, Encoding)

View File

@@ -112,9 +112,9 @@ namespace DiscImageChef.Filesystems.UCSDPascal
XmlFsType = new FileSystemType XmlFsType = new FileSystemType
{ {
Bootable = !ArrayHelpers.ArrayIsNullOrEmpty(bootBlocks), Bootable = !ArrayHelpers.ArrayIsNullOrEmpty(bootBlocks),
Clusters = mountedVolEntry.Blocks, Clusters = (ulong)mountedVolEntry.Blocks,
ClusterSize = (int)device.Info.SectorSize, ClusterSize = device.Info.SectorSize,
Files = mountedVolEntry.Files, Files = (ulong)mountedVolEntry.Files,
FilesSpecified = true, FilesSpecified = true,
Type = "UCSD Pascal", Type = "UCSD Pascal",
VolumeName = StringHandlers.PascalToString(mountedVolEntry.VolumeName, Encoding) VolumeName = StringHandlers.PascalToString(mountedVolEntry.VolumeName, Encoding)
@@ -136,7 +136,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
{ {
stat = new FileSystemInfo stat = new FileSystemInfo
{ {
Blocks = mountedVolEntry.Blocks, Blocks = (ulong)mountedVolEntry.Blocks,
FilenameLength = 16, FilenameLength = 16,
Files = (ulong)mountedVolEntry.Files, Files = (ulong)mountedVolEntry.Files,
FreeBlocks = 0, FreeBlocks = 0,
@@ -144,9 +144,11 @@ namespace DiscImageChef.Filesystems.UCSDPascal
Type = "UCSD Pascal" Type = "UCSD Pascal"
}; };
stat.FreeBlocks = mountedVolEntry.Blocks - (mountedVolEntry.LastBlock - mountedVolEntry.FirstBlock); stat.FreeBlocks =
(ulong)(mountedVolEntry.Blocks - (mountedVolEntry.LastBlock - mountedVolEntry.FirstBlock));
foreach(PascalFileEntry entry in fileEntries) stat.FreeBlocks -= entry.LastBlock - entry.FirstBlock; foreach(PascalFileEntry entry in fileEntries)
stat.FreeBlocks -= (ulong)(entry.LastBlock - entry.FirstBlock);
return Errno.NotImplemented; return Errno.NotImplemented;
} }

View File

@@ -254,7 +254,7 @@ namespace DiscImageChef.Filesystems
$"UDF v{Convert.ToInt32($"{(lvidiu.maximumWriteUDF & 0xFF00) >> 8}", 10)}.{Convert.ToInt32($"{lvidiu.maximumWriteUDF & 0xFF}", 10):X2}", $"UDF v{Convert.ToInt32($"{(lvidiu.maximumWriteUDF & 0xFF00) >> 8}", 10)}.{Convert.ToInt32($"{lvidiu.maximumWriteUDF & 0xFF}", 10):X2}",
ApplicationIdentifier = ApplicationIdentifier =
Encoding.GetString(pvd.implementationIdentifier.identifier).TrimEnd('\u0000'), Encoding.GetString(pvd.implementationIdentifier.identifier).TrimEnd('\u0000'),
ClusterSize = (int)lvd.logicalBlockSize, ClusterSize = lvd.logicalBlockSize,
ModificationDate = EcmaToDateTime(lvid.recordingDateTime), ModificationDate = EcmaToDateTime(lvid.recordingDateTime),
ModificationDateSpecified = true, ModificationDateSpecified = true,
Files = lvidiu.files, Files = lvidiu.files,
@@ -264,8 +264,8 @@ namespace DiscImageChef.Filesystems
SystemIdentifier = SystemIdentifier =
Encoding.GetString(pvd.implementationIdentifier.identifier).TrimEnd('\u0000') Encoding.GetString(pvd.implementationIdentifier.identifier).TrimEnd('\u0000')
}; };
XmlFsType.Clusters = (long)((partition.End - partition.Start + 1) * imagePlugin.Info.SectorSize / XmlFsType.Clusters = (partition.End - partition.Start + 1) * imagePlugin.Info.SectorSize /
(ulong)XmlFsType.ClusterSize); XmlFsType.ClusterSize;
information = sbInformation.ToString(); information = sbInformation.ToString();
} }
@@ -288,32 +288,32 @@ namespace DiscImageChef.Filesystems
/// <summary> /// <summary>
/// Entity flags /// Entity flags
/// </summary> /// </summary>
public EntityFlags flags; public readonly EntityFlags flags;
/// <summary> /// <summary>
/// Structure identifier /// Structure identifier
/// </summary> /// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 23)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 23)]
public byte[] identifier; public readonly byte[] identifier;
/// <summary> /// <summary>
/// Structure data /// Structure data
/// </summary> /// </summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[] identifierSuffix; public readonly byte[] identifierSuffix;
} }
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct Timestamp struct Timestamp
{ {
public ushort typeAndZone; public readonly ushort typeAndZone;
public short year; public readonly short year;
public byte month; public readonly byte month;
public byte day; public readonly byte day;
public byte hour; public readonly byte hour;
public byte minute; public readonly byte minute;
public byte second; public readonly byte second;
public byte centiseconds; public readonly byte centiseconds;
public byte hundredsMicroseconds; public readonly byte hundredsMicroseconds;
public byte microseconds; public readonly byte microseconds;
} }
enum TagIdentifier : ushort enum TagIdentifier : ushort
@@ -332,103 +332,103 @@ namespace DiscImageChef.Filesystems
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct DescriptorTag struct DescriptorTag
{ {
public TagIdentifier tagIdentifier; public readonly TagIdentifier tagIdentifier;
public ushort descriptorVersion; public readonly ushort descriptorVersion;
public byte tagChecksum; public readonly byte tagChecksum;
public byte reserved; public readonly byte reserved;
public ushort tagSerialNumber; public readonly ushort tagSerialNumber;
public ushort descriptorCrc; public readonly ushort descriptorCrc;
public ushort descriptorCrcLength; public readonly ushort descriptorCrcLength;
public uint tagLocation; public readonly uint tagLocation;
} }
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct ExtentDescriptor struct ExtentDescriptor
{ {
public uint length; public readonly uint length;
public uint location; public readonly uint location;
} }
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct CharacterSpecification struct CharacterSpecification
{ {
public byte type; public readonly byte type;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 63)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 63)]
public byte[] information; public readonly byte[] information;
} }
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct AnchorVolumeDescriptorPointer struct AnchorVolumeDescriptorPointer
{ {
public DescriptorTag tag; public readonly DescriptorTag tag;
public ExtentDescriptor mainVolumeDescriptorSequenceExtent; public readonly ExtentDescriptor mainVolumeDescriptorSequenceExtent;
public ExtentDescriptor reserveVolumeDescriptorSequenceExtent; public readonly ExtentDescriptor reserveVolumeDescriptorSequenceExtent;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 480)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 480)]
public byte[] reserved; public readonly byte[] reserved;
} }
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct PrimaryVolumeDescriptor struct PrimaryVolumeDescriptor
{ {
public DescriptorTag tag; public readonly DescriptorTag tag;
public uint volumeDescriptorSequenceNumber; public readonly uint volumeDescriptorSequenceNumber;
public uint primaryVolumeDescriptorNumber; public readonly uint primaryVolumeDescriptorNumber;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] volumeIdentifier; public readonly byte[] volumeIdentifier;
public ushort volumeSequenceNumber; public readonly ushort volumeSequenceNumber;
public ushort maximumVolumeSequenceNumber; public readonly ushort maximumVolumeSequenceNumber;
public ushort interchangeLevel; public readonly ushort interchangeLevel;
public ushort maximumInterchangeLevel; public readonly ushort maximumInterchangeLevel;
public uint characterSetList; public readonly uint characterSetList;
public uint maximumCharacterSetList; public readonly uint maximumCharacterSetList;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public byte[] volumeSetIdentifier; public readonly byte[] volumeSetIdentifier;
public CharacterSpecification descriptorCharacterSet; public readonly CharacterSpecification descriptorCharacterSet;
public CharacterSpecification explanatoryCharacterSet; public readonly CharacterSpecification explanatoryCharacterSet;
public ExtentDescriptor volumeAbstract; public readonly ExtentDescriptor volumeAbstract;
public ExtentDescriptor volumeCopyright; public readonly ExtentDescriptor volumeCopyright;
public EntityIdentifier applicationIdentifier; public readonly EntityIdentifier applicationIdentifier;
public Timestamp recordingDateTime; public readonly Timestamp recordingDateTime;
public EntityIdentifier implementationIdentifier; public readonly EntityIdentifier implementationIdentifier;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)]
public byte[] implementationUse; public readonly byte[] implementationUse;
public uint predecessorVolumeDescriptorSequenceLocation; public readonly uint predecessorVolumeDescriptorSequenceLocation;
public ushort flags; public readonly ushort flags;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 22)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 22)]
public byte[] reserved; public readonly byte[] reserved;
} }
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct LogicalVolumeDescriptor struct LogicalVolumeDescriptor
{ {
public DescriptorTag tag; public readonly DescriptorTag tag;
public uint volumeDescriptorSequenceNumber; public readonly uint volumeDescriptorSequenceNumber;
public CharacterSpecification descriptorCharacterSet; public readonly CharacterSpecification descriptorCharacterSet;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public byte[] logicalVolumeIdentifier; public readonly byte[] logicalVolumeIdentifier;
public uint logicalBlockSize; public readonly uint logicalBlockSize;
public EntityIdentifier domainIdentifier; public readonly EntityIdentifier domainIdentifier;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] logicalVolumeContentsUse; public readonly byte[] logicalVolumeContentsUse;
public uint mapTableLength; public readonly uint mapTableLength;
public uint numberOfPartitionMaps; public readonly uint numberOfPartitionMaps;
public EntityIdentifier implementationIdentifier; public readonly EntityIdentifier implementationIdentifier;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public byte[] implementationUse; public readonly byte[] implementationUse;
public ExtentDescriptor integritySequenceExtent; public readonly ExtentDescriptor integritySequenceExtent;
} }
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct LogicalVolumeIntegrityDescriptor struct LogicalVolumeIntegrityDescriptor
{ {
public DescriptorTag tag; public readonly DescriptorTag tag;
public Timestamp recordingDateTime; public readonly Timestamp recordingDateTime;
public uint integrityType; public readonly uint integrityType;
public ExtentDescriptor nextIntegrityExtent; public readonly ExtentDescriptor nextIntegrityExtent;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] logicalVolumeContentsUse; public readonly byte[] logicalVolumeContentsUse;
public uint numberOfPartitions; public readonly uint numberOfPartitions;
public uint lengthOfImplementationUse; public readonly uint lengthOfImplementationUse;
// Follows uint[numberOfPartitions] freeSpaceTable; // Follows uint[numberOfPartitions] freeSpaceTable;
// Follows uint[numberOfPartitions] sizeTable; // Follows uint[numberOfPartitions] sizeTable;
// Follows byte[lengthOfImplementationUse] implementationUse; // Follows byte[lengthOfImplementationUse] implementationUse;
@@ -437,12 +437,12 @@ namespace DiscImageChef.Filesystems
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct LogicalVolumeIntegrityDescriptorImplementationUse struct LogicalVolumeIntegrityDescriptorImplementationUse
{ {
public EntityIdentifier implementationId; public readonly EntityIdentifier implementationId;
public uint files; public readonly uint files;
public uint directories; public readonly uint directories;
public ushort minimumReadUDF; public readonly ushort minimumReadUDF;
public ushort minimumWriteUDF; public readonly ushort minimumWriteUDF;
public ushort maximumWriteUDF; public readonly ushort maximumWriteUDF;
} }
} }
} }

View File

@@ -119,7 +119,7 @@ namespace DiscImageChef.Filesystems
{ {
Type = "UNICOS filesystem", Type = "UNICOS filesystem",
ClusterSize = 4096, ClusterSize = 4096,
Clusters = unicosSb.s_fsize, Clusters = (ulong)unicosSb.s_fsize,
VolumeName = StringHandlers.CToString(unicosSb.s_fname, Encoding), VolumeName = StringHandlers.CToString(unicosSb.s_fname, Encoding),
ModificationDate = DateHandlers.UnixToDateTime(unicosSb.s_time), ModificationDate = DateHandlers.UnixToDateTime(unicosSb.s_time),
ModificationDateSpecified = true ModificationDateSpecified = true
@@ -131,20 +131,20 @@ namespace DiscImageChef.Filesystems
[SuppressMessage("ReSharper", "InconsistentNaming")] [SuppressMessage("ReSharper", "InconsistentNaming")]
struct nc1ireg_sb struct nc1ireg_sb
{ {
public ushort i_unused; /* reserved */ public readonly ushort i_unused; /* reserved */
public ushort i_nblk; /* number of blocks */ public readonly ushort i_nblk; /* number of blocks */
public uint i_sblk; /* start block number */ public readonly uint i_sblk; /* start block number */
} }
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
[SuppressMessage("ReSharper", "InconsistentNaming")] [SuppressMessage("ReSharper", "InconsistentNaming")]
struct nc1fdev_sb struct nc1fdev_sb
{ {
public long fd_name; /* Physical device name */ public readonly long fd_name; /* Physical device name */
public uint fd_sblk; /* Start block number */ public readonly uint fd_sblk; /* Start block number */
public uint fd_nblk; /* Number of blocks */ public readonly uint fd_nblk; /* Number of blocks */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = NC1_MAXIREG)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = NC1_MAXIREG)]
public nc1ireg_sb[] fd_ireg; /* Inode regions */ public readonly nc1ireg_sb[] fd_ireg; /* Inode regions */
} }
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
@@ -152,64 +152,64 @@ namespace DiscImageChef.Filesystems
[SuppressMessage("ReSharper", "BuiltInTypeReferenceStyle")] [SuppressMessage("ReSharper", "BuiltInTypeReferenceStyle")]
struct UNICOS_Superblock struct UNICOS_Superblock
{ {
public ulong s_magic; /* magic number to indicate file system type */ public readonly ulong s_magic; /* magic number to indicate file system type */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[] s_fname; /* file system name */ public readonly byte[] s_fname; /* file system name */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[] s_fpack; /* file system pack name */ public readonly byte[] s_fpack; /* file system pack name */
public dev_t s_dev; /* major/minor device, for verification */ public readonly dev_t s_dev; /* major/minor device, for verification */
public daddr_t s_fsize; /* size in blocks of entire volume */ public readonly daddr_t s_fsize; /* size in blocks of entire volume */
public long s_isize; /* Number of total inodes */ public readonly long s_isize; /* Number of total inodes */
public long s_bigfile; /* number of bytes at which a file is big */ public readonly long s_bigfile; /* number of bytes at which a file is big */
public long s_bigunit; /* minimum number of blocks allocated for big files */ public readonly long s_bigunit; /* minimum number of blocks allocated for big files */
public ulong s_secure; /* security: secure FS label */ public readonly ulong s_secure; /* security: secure FS label */
public long s_maxlvl; /* security: maximum security level */ public readonly long s_maxlvl; /* security: maximum security level */
public long s_minlvl; /* security: minimum security level */ public readonly long s_minlvl; /* security: minimum security level */
public long s_valcmp; /* security: valid security compartments */ public readonly long s_valcmp; /* security: valid security compartments */
public time_t s_time; /* last super block update */ public readonly time_t s_time; /* last super block update */
public blkno_t s_dboff; /* Dynamic block number */ public readonly blkno_t s_dboff; /* Dynamic block number */
public ino_t s_root; /* root inode */ public readonly ino_t s_root; /* root inode */
public long s_error; /* Type of file system error detected */ public readonly long s_error; /* Type of file system error detected */
public blkno_t s_mapoff; /* Start map block number */ public readonly blkno_t s_mapoff; /* Start map block number */
public long s_mapblks; /* Last map block number */ public readonly long s_mapblks; /* Last map block number */
public long s_nscpys; /* Number of copies of s.b per partition */ public readonly long s_nscpys; /* Number of copies of s.b per partition */
public long s_npart; /* Number of partitions */ public readonly long s_npart; /* Number of partitions */
public long s_ifract; /* Ratio of inodes to blocks */ public readonly long s_ifract; /* Ratio of inodes to blocks */
public extent_t s_sfs; /* SFS only blocks */ public readonly extent_t s_sfs; /* SFS only blocks */
public long s_flag; /* Flag word */ public readonly long s_flag; /* Flag word */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = NC1_MAXPART)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = NC1_MAXPART)]
public nc1fdev_sb[] s_part; /* Partition descriptors */ public readonly nc1fdev_sb[] s_part; /* Partition descriptors */
public long s_iounit; /* Physical block size */ public readonly long s_iounit; /* Physical block size */
public long s_numiresblks; /* number of inode reservation blocks */ public readonly long s_numiresblks; /* number of inode reservation blocks */
/* per region (currently 1) */ /* per region (currently 1) */
/* 0 = 1*(AU) words, n = (n+1)*(AU) words */ /* 0 = 1*(AU) words, n = (n+1)*(AU) words */
public long s_priparts; /* bitmap of primary partitions */ public readonly long s_priparts; /* bitmap of primary partitions */
public long s_priblock; /* block size of primary partition(s) */ public readonly long s_priblock; /* block size of primary partition(s) */
/* 0 = 1*512 words, n = (n+1)*512 words */ /* 0 = 1*512 words, n = (n+1)*512 words */
public long s_prinblks; /* number of 512 wds blocks in primary */ public readonly long s_prinblks; /* number of 512 wds blocks in primary */
public long s_secparts; /* bitmap of secondary partitions */ public readonly long s_secparts; /* bitmap of secondary partitions */
public long s_secblock; /* block size of secondary partition(s) */ public readonly long s_secblock; /* block size of secondary partition(s) */
/* 0 = 1*512 words, n = (n+1)*512 words */ /* 0 = 1*512 words, n = (n+1)*512 words */
public long s_secnblks; /* number of 512 wds blocks in secondary */ public readonly long s_secnblks; /* number of 512 wds blocks in secondary */
public long s_sbdbparts; /* bitmap of partitions with file system data */ public readonly long s_sbdbparts; /* bitmap of partitions with file system data */
/* including super blocks, dynamic block */ /* including super blocks, dynamic block */
/* and free block bitmaps (only primary */ /* and free block bitmaps (only primary */
/* partitions may contain these) */ /* partitions may contain these) */
public long s_rootdparts; /* bitmap of partitions with root directory */ public readonly long s_rootdparts; /* bitmap of partitions with root directory */
/* (only primary partitions) */ /* (only primary partitions) */
public long s_nudparts; /* bitmap of no-user-data partitions */ public readonly long s_nudparts; /* bitmap of no-user-data partitions */
/* (only primary partitions) */ /* (only primary partitions) */
public long s_nsema; /* SFS: # fs semaphores to allocate */ public readonly long s_nsema; /* SFS: # fs semaphores to allocate */
public long s_priactive; /* bitmap of primary partitions which contain */ public readonly long s_priactive; /* bitmap of primary partitions which contain */
/* active (up to date) dynamic blocks and */ /* active (up to date) dynamic blocks and */
/* free block bitmaps. All bits set indicate */ /* free block bitmaps. All bits set indicate */
/* that all primary partitions are active, */ /* that all primary partitions are active, */
/* and no kernel manipulation of active flag */ /* and no kernel manipulation of active flag */
/* is allowed. */ /* is allowed. */
public long s_sfs_arbiterid; /* SFS Arbiter ID */ public readonly long s_sfs_arbiterid; /* SFS Arbiter ID */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 91)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 91)]
public long[] s_fill; /* reserved */ public readonly long[] s_fill; /* reserved */
} }
} }
} }

View File

@@ -105,8 +105,8 @@ namespace DiscImageChef.Filesystems
{ {
Type = "BFS", Type = "BFS",
VolumeName = bfsSb.s_volume, VolumeName = bfsSb.s_volume,
ClusterSize = (int)imagePlugin.Info.SectorSize, ClusterSize = imagePlugin.Info.SectorSize,
Clusters = (long)(partition.End - partition.Start + 1) Clusters = partition.End - partition.Start + 1
}; };
information = sb.ToString(); information = sb.ToString();

View File

@@ -108,7 +108,7 @@ namespace DiscImageChef.Filesystems
ModificationDate = DateHandlers.UnixUnsignedToDateTime(mtimeSecs, mtimeNanoSecs), ModificationDate = DateHandlers.UnixUnsignedToDateTime(mtimeSecs, mtimeNanoSecs),
ModificationDateSpecified = true, ModificationDateSpecified = true,
Clusters = volInfo.size * 256 / imagePlugin.Info.SectorSize, Clusters = volInfo.size * 256 / imagePlugin.Info.SectorSize,
ClusterSize = (int)imagePlugin.Info.SectorSize, ClusterSize = imagePlugin.Info.SectorSize,
VolumeSerial = volInfo.uuid.ToString() VolumeSerial = volInfo.uuid.ToString()
}; };
} }
@@ -123,23 +123,23 @@ namespace DiscImageChef.Filesystems
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct VolumeInfo struct VolumeInfo
{ {
public uint magic; public readonly uint magic;
public uint version; public readonly uint version;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
public byte[] unknown1; public readonly byte[] unknown1;
public byte lun; public readonly byte lun;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public byte[] unknown2; public readonly byte[] unknown2;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 28)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 28)]
public byte[] name; public readonly byte[] name;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 49)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 49)]
public byte[] unknown3; public readonly byte[] unknown3;
public uint size; public readonly uint size;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 31)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 31)]
public byte[] unknown4; public readonly byte[] unknown4;
public Guid uuid; public readonly Guid uuid;
public ulong ctime; public readonly ulong ctime;
public ulong mtime; public readonly ulong mtime;
} }
} }
} }

View File

@@ -103,10 +103,10 @@ namespace DiscImageChef.Filesystems
CreationDateSpecified = true, CreationDateSpecified = true,
ModificationDate = DateHandlers.UnixUnsignedToDateTime(vxSb.vs_wtime, vxSb.vs_wutime), ModificationDate = DateHandlers.UnixUnsignedToDateTime(vxSb.vs_wtime, vxSb.vs_wutime),
ModificationDateSpecified = true, ModificationDateSpecified = true,
Clusters = vxSb.vs_size, Clusters = (ulong)vxSb.vs_size,
ClusterSize = vxSb.vs_bsize, ClusterSize = (uint)vxSb.vs_bsize,
Dirty = vxSb.vs_clean != 0, Dirty = vxSb.vs_clean != 0,
FreeClusters = vxSb.vs_free, FreeClusters = (ulong)vxSb.vs_free,
FreeClustersSpecified = true FreeClustersSpecified = true
}; };
} }
@@ -115,147 +115,147 @@ namespace DiscImageChef.Filesystems
struct VxSuperBlock struct VxSuperBlock
{ {
/// <summary>Magic number</summary> /// <summary>Magic number</summary>
public uint vs_magic; public readonly uint vs_magic;
/// <summary>VxFS version</summary> /// <summary>VxFS version</summary>
public int vs_version; public readonly int vs_version;
/// <summary>create time - secs</summary> /// <summary>create time - secs</summary>
public uint vs_ctime; public readonly uint vs_ctime;
/// <summary>create time - usecs</summary> /// <summary>create time - usecs</summary>
public uint vs_cutime; public readonly uint vs_cutime;
/// <summary>unused</summary> /// <summary>unused</summary>
public int __unused1; public readonly int __unused1;
/// <summary>unused</summary> /// <summary>unused</summary>
public int __unused2; public readonly int __unused2;
/// <summary>obsolete</summary> /// <summary>obsolete</summary>
public int vs_old_logstart; public readonly int vs_old_logstart;
/// <summary>obsolete</summary> /// <summary>obsolete</summary>
public int vs_old_logend; public readonly int vs_old_logend;
/// <summary>block size</summary> /// <summary>block size</summary>
public int vs_bsize; public readonly int vs_bsize;
/// <summary>number of blocks</summary> /// <summary>number of blocks</summary>
public int vs_size; public readonly int vs_size;
/// <summary>number of data blocks</summary> /// <summary>number of data blocks</summary>
public int vs_dsize; public readonly int vs_dsize;
/// <summary>obsolete</summary> /// <summary>obsolete</summary>
public uint vs_old_ninode; public readonly uint vs_old_ninode;
/// <summary>obsolete</summary> /// <summary>obsolete</summary>
public int vs_old_nau; public readonly int vs_old_nau;
/// <summary>unused</summary> /// <summary>unused</summary>
public int __unused3; public readonly int __unused3;
/// <summary>obsolete</summary> /// <summary>obsolete</summary>
public int vs_old_defiextsize; public readonly int vs_old_defiextsize;
/// <summary>obsolete</summary> /// <summary>obsolete</summary>
public int vs_old_ilbsize; public readonly int vs_old_ilbsize;
/// <summary>size of immediate data area</summary> /// <summary>size of immediate data area</summary>
public int vs_immedlen; public readonly int vs_immedlen;
/// <summary>number of direct extentes</summary> /// <summary>number of direct extentes</summary>
public int vs_ndaddr; public readonly int vs_ndaddr;
/// <summary>address of first AU</summary> /// <summary>address of first AU</summary>
public int vs_firstau; public readonly int vs_firstau;
/// <summary>offset of extent map in AU</summary> /// <summary>offset of extent map in AU</summary>
public int vs_emap; public readonly int vs_emap;
/// <summary>offset of inode map in AU</summary> /// <summary>offset of inode map in AU</summary>
public int vs_imap; public readonly int vs_imap;
/// <summary>offset of ExtOp. map in AU</summary> /// <summary>offset of ExtOp. map in AU</summary>
public int vs_iextop; public readonly int vs_iextop;
/// <summary>offset of inode list in AU</summary> /// <summary>offset of inode list in AU</summary>
public int vs_istart; public readonly int vs_istart;
/// <summary>offset of fdblock in AU</summary> /// <summary>offset of fdblock in AU</summary>
public int vs_bstart; public readonly int vs_bstart;
/// <summary>aufirst + emap</summary> /// <summary>aufirst + emap</summary>
public int vs_femap; public readonly int vs_femap;
/// <summary>aufirst + imap</summary> /// <summary>aufirst + imap</summary>
public int vs_fimap; public readonly int vs_fimap;
/// <summary>aufirst + iextop</summary> /// <summary>aufirst + iextop</summary>
public int vs_fiextop; public readonly int vs_fiextop;
/// <summary>aufirst + istart</summary> /// <summary>aufirst + istart</summary>
public int vs_fistart; public readonly int vs_fistart;
/// <summary>aufirst + bstart</summary> /// <summary>aufirst + bstart</summary>
public int vs_fbstart; public readonly int vs_fbstart;
/// <summary>number of entries in indir</summary> /// <summary>number of entries in indir</summary>
public int vs_nindir; public readonly int vs_nindir;
/// <summary>length of AU in blocks</summary> /// <summary>length of AU in blocks</summary>
public int vs_aulen; public readonly int vs_aulen;
/// <summary>length of imap in blocks</summary> /// <summary>length of imap in blocks</summary>
public int vs_auimlen; public readonly int vs_auimlen;
/// <summary>length of emap in blocks</summary> /// <summary>length of emap in blocks</summary>
public int vs_auemlen; public readonly int vs_auemlen;
/// <summary>length of ilist in blocks</summary> /// <summary>length of ilist in blocks</summary>
public int vs_auilen; public readonly int vs_auilen;
/// <summary>length of pad in blocks</summary> /// <summary>length of pad in blocks</summary>
public int vs_aupad; public readonly int vs_aupad;
/// <summary>data blocks in AU</summary> /// <summary>data blocks in AU</summary>
public int vs_aublocks; public readonly int vs_aublocks;
/// <summary>log base 2 of aublocks</summary> /// <summary>log base 2 of aublocks</summary>
public int vs_maxtier; public readonly int vs_maxtier;
/// <summary>number of inodes per blk</summary> /// <summary>number of inodes per blk</summary>
public int vs_inopb; public readonly int vs_inopb;
/// <summary>obsolete</summary> /// <summary>obsolete</summary>
public int vs_old_inopau; public readonly int vs_old_inopau;
/// <summary>obsolete</summary> /// <summary>obsolete</summary>
public int vs_old_inopilb; public readonly int vs_old_inopilb;
/// <summary>obsolete</summary> /// <summary>obsolete</summary>
public int vs_old_ndiripau; public readonly int vs_old_ndiripau;
/// <summary>size of indirect addr ext.</summary> /// <summary>size of indirect addr ext.</summary>
public int vs_iaddrlen; public readonly int vs_iaddrlen;
/// <summary>log base 2 of bsize</summary> /// <summary>log base 2 of bsize</summary>
public int vs_bshift; public readonly int vs_bshift;
/// <summary>log base 2 of inobp</summary> /// <summary>log base 2 of inobp</summary>
public int vs_inoshift; public readonly int vs_inoshift;
/// <summary>~( bsize - 1 )</summary> /// <summary>~( bsize - 1 )</summary>
public int vs_bmask; public readonly int vs_bmask;
/// <summary>bsize - 1</summary> /// <summary>bsize - 1</summary>
public int vs_boffmask; public readonly int vs_boffmask;
/// <summary>old_inopilb - 1</summary> /// <summary>old_inopilb - 1</summary>
public int vs_old_inomask; public readonly int vs_old_inomask;
/// <summary>checksum of V1 data</summary> /// <summary>checksum of V1 data</summary>
public int vs_checksum; public readonly int vs_checksum;
/// <summary>number of free blocks</summary> /// <summary>number of free blocks</summary>
public int vs_free; public readonly int vs_free;
/// <summary>number of free inodes</summary> /// <summary>number of free inodes</summary>
public int vs_ifree; public readonly int vs_ifree;
/// <summary>number of free extents by size</summary> /// <summary>number of free extents by size</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public int[] vs_efree; public readonly int[] vs_efree;
/// <summary>flags ?!?</summary> /// <summary>flags ?!?</summary>
public int vs_flags; public readonly int vs_flags;
/// <summary>filesystem has been changed</summary> /// <summary>filesystem has been changed</summary>
public byte vs_mod; public readonly byte vs_mod;
/// <summary>clean FS</summary> /// <summary>clean FS</summary>
public byte vs_clean; public readonly byte vs_clean;
/// <summary>unused</summary> /// <summary>unused</summary>
public ushort __unused4; public readonly ushort __unused4;
/// <summary>mount time log ID</summary> /// <summary>mount time log ID</summary>
public uint vs_firstlogid; public readonly uint vs_firstlogid;
/// <summary>last time written - sec</summary> /// <summary>last time written - sec</summary>
public uint vs_wtime; public readonly uint vs_wtime;
/// <summary>last time written - usec</summary> /// <summary>last time written - usec</summary>
public uint vs_wutime; public readonly uint vs_wutime;
/// <summary>FS name</summary> /// <summary>FS name</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
public byte[] vs_fname; public readonly byte[] vs_fname;
/// <summary>FS pack name</summary> /// <summary>FS pack name</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6)]
public byte[] vs_fpack; public readonly byte[] vs_fpack;
/// <summary>log format version</summary> /// <summary>log format version</summary>
public int vs_logversion; public readonly int vs_logversion;
/// <summary>unused</summary> /// <summary>unused</summary>
public int __unused5; public readonly int __unused5;
/// <summary>OLT extent and replica</summary> /// <summary>OLT extent and replica</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
public int[] vs_oltext; public readonly int[] vs_oltext;
/// <summary>OLT extent size</summary> /// <summary>OLT extent size</summary>
public int vs_oltsize; public readonly int vs_oltsize;
/// <summary>size of inode map</summary> /// <summary>size of inode map</summary>
public int vs_iauimlen; public readonly int vs_iauimlen;
/// <summary>size of IAU in blocks</summary> /// <summary>size of IAU in blocks</summary>
public int vs_iausize; public readonly int vs_iausize;
/// <summary>size of inode in bytes</summary> /// <summary>size of inode in bytes</summary>
public int vs_dinosize; public readonly int vs_dinosize;
/// <summary>indir levels per inode</summary> /// <summary>indir levels per inode</summary>
public int vs_old_dniaddr; public readonly int vs_old_dniaddr;
/// <summary>checksum of V2 RO</summary> /// <summary>checksum of V2 RO</summary>
public int vs_checksum2; public readonly int vs_checksum2;
} }
} }
} }

View File

@@ -173,11 +173,11 @@ namespace DiscImageChef.Filesystems
XmlFsType = new FileSystemType XmlFsType = new FileSystemType
{ {
Type = "XFS filesystem", Type = "XFS filesystem",
ClusterSize = (int)xfsSb.blocksize, ClusterSize = xfsSb.blocksize,
Clusters = (long)xfsSb.dblocks, Clusters = xfsSb.dblocks,
FreeClusters = (long)xfsSb.fdblocks, FreeClusters = xfsSb.fdblocks,
FreeClustersSpecified = true, FreeClustersSpecified = true,
Files = (long)(xfsSb.icount - xfsSb.ifree), Files = xfsSb.icount - xfsSb.ifree,
FilesSpecified = true, FilesSpecified = true,
Dirty = xfsSb.inprogress > 0, Dirty = xfsSb.inprogress > 0,
VolumeName = StringHandlers.CToString(xfsSb.fname, Encoding), VolumeName = StringHandlers.CToString(xfsSb.fname, Encoding),
@@ -188,63 +188,63 @@ namespace DiscImageChef.Filesystems
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct XFS_Superblock struct XFS_Superblock
{ {
public uint magicnum; public readonly uint magicnum;
public uint blocksize; public readonly uint blocksize;
public ulong dblocks; public readonly ulong dblocks;
public ulong rblocks; public readonly ulong rblocks;
public ulong rextents; public readonly ulong rextents;
public Guid uuid; public readonly Guid uuid;
public ulong logstat; public readonly ulong logstat;
public ulong rootino; public readonly ulong rootino;
public ulong rbmino; public readonly ulong rbmino;
public ulong rsumino; public readonly ulong rsumino;
public uint rextsize; public readonly uint rextsize;
public uint agblocks; public readonly uint agblocks;
public uint agcount; public readonly uint agcount;
public uint rbmblocks; public readonly uint rbmblocks;
public uint logblocks; public readonly uint logblocks;
public ushort version; public readonly ushort version;
public ushort sectsize; public readonly ushort sectsize;
public ushort inodesize; public readonly ushort inodesize;
public ushort inopblock; public readonly ushort inopblock;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 12)]
public byte[] fname; public readonly byte[] fname;
public byte blocklog; public readonly byte blocklog;
public byte sectlog; public readonly byte sectlog;
public byte inodelog; public readonly byte inodelog;
public byte inopblog; public readonly byte inopblog;
public byte agblklog; public readonly byte agblklog;
public byte rextslog; public readonly byte rextslog;
public byte inprogress; public readonly byte inprogress;
public byte imax_pct; public readonly byte imax_pct;
public ulong icount; public readonly ulong icount;
public ulong ifree; public readonly ulong ifree;
public ulong fdblocks; public readonly ulong fdblocks;
public ulong frextents; public readonly ulong frextents;
public ulong uquotino; public readonly ulong uquotino;
public ulong gquotino; public readonly ulong gquotino;
public ushort qflags; public readonly ushort qflags;
public byte flags; public readonly byte flags;
public byte shared_vn; public readonly byte shared_vn;
public ulong inoalignmt; public readonly ulong inoalignmt;
public ulong unit; public readonly ulong unit;
public ulong width; public readonly ulong width;
public byte dirblklog; public readonly byte dirblklog;
public byte logsectlog; public readonly byte logsectlog;
public ushort logsectsize; public readonly ushort logsectsize;
public uint logsunit; public readonly uint logsunit;
public uint features2; public readonly uint features2;
public uint bad_features2; public readonly uint bad_features2;
public uint features_compat; public readonly uint features_compat;
public uint features_ro_compat; public readonly uint features_ro_compat;
public uint features_incompat; public readonly uint features_incompat;
public uint features_log_incompat; public readonly uint features_log_incompat;
// This field is little-endian while rest of superblock is big-endian // This field is little-endian while rest of superblock is big-endian
public uint crc; public readonly uint crc;
public uint spino_align; public readonly uint spino_align;
public ulong pquotino; public readonly ulong pquotino;
public ulong lsn; public readonly ulong lsn;
public Guid meta_uuid; public readonly Guid meta_uuid;
} }
} }
} }

View File

@@ -106,7 +106,7 @@ namespace DiscImageChef.Filesystems
{ {
Bootable = !ArrayHelpers.ArrayIsNullOrEmpty(supblk.s_boot_segment), Bootable = !ArrayHelpers.ArrayIsNullOrEmpty(supblk.s_boot_segment),
Clusters = supblk.s_nzones, Clusters = supblk.s_nzones,
ClusterSize = (int)supblk.s_zone_size, ClusterSize = supblk.s_zone_size,
Type = "Xia filesystem" Type = "Xia filesystem"
}; };
@@ -121,39 +121,39 @@ namespace DiscImageChef.Filesystems
{ {
/// <summary>1st sector reserved for boot</summary> /// <summary>1st sector reserved for boot</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)]
public byte[] s_boot_segment; public readonly byte[] s_boot_segment;
/// <summary>the name says it</summary> /// <summary>the name says it</summary>
public uint s_zone_size; public readonly uint s_zone_size;
/// <summary>volume size, zone aligned</summary> /// <summary>volume size, zone aligned</summary>
public uint s_nzones; public readonly uint s_nzones;
/// <summary># of inodes</summary> /// <summary># of inodes</summary>
public uint s_ninodes; public readonly uint s_ninodes;
/// <summary># of data zones</summary> /// <summary># of data zones</summary>
public uint s_ndatazones; public readonly uint s_ndatazones;
/// <summary># of imap zones</summary> /// <summary># of imap zones</summary>
public uint s_imap_zones; public readonly uint s_imap_zones;
/// <summary># of zmap zones</summary> /// <summary># of zmap zones</summary>
public uint s_zmap_zones; public readonly uint s_zmap_zones;
/// <summary>first data zone</summary> /// <summary>first data zone</summary>
public uint s_firstdatazone; public readonly uint s_firstdatazone;
/// <summary>z size = 1KB &lt;&lt; z shift</summary> /// <summary>z size = 1KB &lt;&lt; z shift</summary>
public uint s_zone_shift; public readonly uint s_zone_shift;
/// <summary>max size of a single file</summary> /// <summary>max size of a single file</summary>
public uint s_max_size; public readonly uint s_max_size;
/// <summary>reserved</summary> /// <summary>reserved</summary>
public uint s_reserved0; public readonly uint s_reserved0;
/// <summary>reserved</summary> /// <summary>reserved</summary>
public uint s_reserved1; public readonly uint s_reserved1;
/// <summary>reserved</summary> /// <summary>reserved</summary>
public uint s_reserved2; public readonly uint s_reserved2;
/// <summary>reserved</summary> /// <summary>reserved</summary>
public uint s_reserved3; public readonly uint s_reserved3;
/// <summary>first kernel zone</summary> /// <summary>first kernel zone</summary>
public uint s_firstkernzone; public readonly uint s_firstkernzone;
/// <summary>kernel size in zones</summary> /// <summary>kernel size in zones</summary>
public uint s_kernzones; public readonly uint s_kernzones;
/// <summary>magic number for xiafs</summary> /// <summary>magic number for xiafs</summary>
public uint s_magic; public readonly uint s_magic;
} }
/// <summary> /// <summary>
@@ -162,11 +162,11 @@ namespace DiscImageChef.Filesystems
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct XiaDirect struct XiaDirect
{ {
public uint d_ino; public readonly uint d_ino;
public ushort d_rec_len; public readonly ushort d_rec_len;
public byte d_name_len; public readonly byte d_name_len;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = XIAFS_NAME_LEN + 1)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = XIAFS_NAME_LEN + 1)]
public byte[] d_name; public readonly byte[] d_name;
} }
/// <summary> /// <summary>
@@ -175,16 +175,16 @@ namespace DiscImageChef.Filesystems
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct XiaInode struct XiaInode
{ {
public ushort i_mode; public readonly ushort i_mode;
public ushort i_nlinks; public readonly ushort i_nlinks;
public ushort i_uid; public readonly ushort i_uid;
public ushort i_gid; public readonly ushort i_gid;
public uint i_size; public readonly uint i_size;
public uint i_ctime; public readonly uint i_ctime;
public uint i_atime; public readonly uint i_atime;
public uint i_mtime; public readonly uint i_mtime;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = XIAFS_NUM_BLOCK_POINTERS)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = XIAFS_NUM_BLOCK_POINTERS)]
public uint[] i_zone; public readonly uint[] i_zone;
} }
} }
} }

View File

@@ -181,7 +181,7 @@ namespace DiscImageChef.Filesystems
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
XmlFsType = new FileSystemType {ClusterSize = 1024, Clusters = (long)(partition.Size / 1024)}; XmlFsType = new FileSystemType {ClusterSize = 1024, Clusters = partition.Size / 1024};
if(useOld) if(useOld)
{ {
@@ -278,21 +278,21 @@ namespace DiscImageChef.Filesystems
struct spcl16 struct spcl16
{ {
/// <summary>Record type</summary> /// <summary>Record type</summary>
public short c_type; public readonly short c_type;
/// <summary>Dump date</summary> /// <summary>Dump date</summary>
public int c_date; public int c_date;
/// <summary>Previous dump date</summary> /// <summary>Previous dump date</summary>
public int c_ddate; public int c_ddate;
/// <summary>Dump volume number</summary> /// <summary>Dump volume number</summary>
public short c_volume; public readonly short c_volume;
/// <summary>Logical block of this record</summary> /// <summary>Logical block of this record</summary>
public int c_tapea; public readonly int c_tapea;
/// <summary>Inode number</summary> /// <summary>Inode number</summary>
public ushort c_inumber; public readonly ushort c_inumber;
/// <summary>Magic number</summary> /// <summary>Magic number</summary>
public ushort c_magic; public readonly ushort c_magic;
/// <summary>Record checksum</summary> /// <summary>Record checksum</summary>
public int c_checksum; public readonly int c_checksum;
// Unneeded for now // Unneeded for now
/* /*
struct dinode c_dinode; struct dinode c_dinode;
@@ -306,18 +306,18 @@ namespace DiscImageChef.Filesystems
struct spcl_aix struct spcl_aix
{ {
/// <summary>Record type</summary> /// <summary>Record type</summary>
public int c_type; public readonly int c_type;
/// <summary>Dump date</summary> /// <summary>Dump date</summary>
public int c_date; public readonly int c_date;
/// <summary>Previous dump date</summary> /// <summary>Previous dump date</summary>
public int c_ddate; public readonly int c_ddate;
/// <summary>Dump volume number</summary> /// <summary>Dump volume number</summary>
public int c_volume; public readonly int c_volume;
/// <summary>Logical block of this record</summary> /// <summary>Logical block of this record</summary>
public int c_tapea; public readonly int c_tapea;
public uint c_inumber; public readonly uint c_inumber;
public uint c_magic; public readonly uint c_magic;
public int c_checksum; public readonly int c_checksum;
// Unneeded for now // Unneeded for now
/* /*
public bsd_dinode bsd_c_dinode; public bsd_dinode bsd_c_dinode;
@@ -331,61 +331,61 @@ namespace DiscImageChef.Filesystems
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct s_spcl struct s_spcl
{ {
public int c_type; /* record type (see below) */ public readonly int c_type; /* record type (see below) */
public int c_date; /* date of this dump */ public readonly int c_date; /* date of this dump */
public int c_ddate; /* date of previous dump */ public readonly int c_ddate; /* date of previous dump */
public int c_volume; /* dump volume number */ public readonly int c_volume; /* dump volume number */
public int c_tapea; /* logical block of this record */ public readonly int c_tapea; /* logical block of this record */
public uint c_inumber; /* number of inode */ public readonly uint c_inumber; /* number of inode */
public int c_magic; /* magic number (see above) */ public readonly int c_magic; /* magic number (see above) */
public int c_checksum; /* record checksum */ public readonly int c_checksum; /* record checksum */
public dinode c_dinode; /* ownership and mode of inode */ public readonly dinode c_dinode; /* ownership and mode of inode */
public int c_count; /* number of valid c_addr entries */ public readonly int c_count; /* number of valid c_addr entries */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = TP_NINDIR)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = TP_NINDIR)]
public byte[] c_addr; /* 1 => data; 0 => hole in inode */ public readonly byte[] c_addr; /* 1 => data; 0 => hole in inode */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = LBLSIZE)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = LBLSIZE)]
public byte[] c_label; /* dump label */ public readonly byte[] c_label; /* dump label */
public int c_level; /* level of this dump */ public readonly int c_level; /* level of this dump */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = NAMELEN)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = NAMELEN)]
public byte[] c_filesys; /* name of dumpped file system */ public readonly byte[] c_filesys; /* name of dumpped file system */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = NAMELEN)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = NAMELEN)]
public byte[] c_dev; /* name of dumpped device */ public readonly byte[] c_dev; /* name of dumpped device */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = NAMELEN)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = NAMELEN)]
public byte[] c_host; /* name of dumpped host */ public readonly byte[] c_host; /* name of dumpped host */
public int c_flags; /* additional information */ public readonly int c_flags; /* additional information */
public int c_firstrec; /* first record on volume */ public readonly int c_firstrec; /* first record on volume */
public long c_ndate; /* date of this dump */ public readonly long c_ndate; /* date of this dump */
public long c_nddate; /* date of previous dump */ public readonly long c_nddate; /* date of previous dump */
public long c_ntapea; /* logical block of this record */ public readonly long c_ntapea; /* logical block of this record */
public long c_nfirstrec; /* first record on volume */ public readonly long c_nfirstrec; /* first record on volume */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public int[] c_spare; /* reserved for future uses */ public readonly int[] c_spare; /* reserved for future uses */
} }
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct dinode struct dinode
{ {
public ushort di_mode; /* 0: IFMT, permissions; see below. */ public readonly ushort di_mode; /* 0: IFMT, permissions; see below. */
public short di_nlink; /* 2: File link count. */ public readonly short di_nlink; /* 2: File link count. */
public int inumber; /* 4: Lfs: inode number. */ public readonly int inumber; /* 4: Lfs: inode number. */
public ulong di_size; /* 8: File byte count. */ public readonly ulong di_size; /* 8: File byte count. */
public int di_atime; /* 16: Last access time. */ public readonly int di_atime; /* 16: Last access time. */
public int di_atimensec; /* 20: Last access time. */ public readonly int di_atimensec; /* 20: Last access time. */
public int di_mtime; /* 24: Last modified time. */ public readonly int di_mtime; /* 24: Last modified time. */
public int di_mtimensec; /* 28: Last modified time. */ public readonly int di_mtimensec; /* 28: Last modified time. */
public int di_ctime; /* 32: Last inode change time. */ public readonly int di_ctime; /* 32: Last inode change time. */
public int di_ctimensec; /* 36: Last inode change time. */ public readonly int di_ctimensec; /* 36: Last inode change time. */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = NDADDR)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = NDADDR)]
public int[] di_db; /* 40: Direct disk blocks. */ public readonly int[] di_db; /* 40: Direct disk blocks. */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = NIADDR)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = NIADDR)]
public int[] di_ib; /* 88: Indirect disk blocks. */ public readonly int[] di_ib; /* 88: Indirect disk blocks. */
public uint di_flags; /* 100: Status flags (chflags). */ public readonly uint di_flags; /* 100: Status flags (chflags). */
public uint di_blocks; /* 104: Blocks actually held. */ public readonly uint di_blocks; /* 104: Blocks actually held. */
public int di_gen; /* 108: Generation number. */ public readonly int di_gen; /* 108: Generation number. */
public uint di_uid; /* 112: File owner. */ public readonly uint di_uid; /* 112: File owner. */
public uint di_gid; /* 116: File group. */ public readonly uint di_gid; /* 116: File group. */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
public int[] di_spare; /* 120: Reserved; currently unused */ public readonly int[] di_spare; /* 120: Reserved; currently unused */
} }
} }
} }

View File

@@ -127,7 +127,7 @@ namespace DiscImageChef.Filesystems
sb.AppendFormat("Checksum 0x{0:X8}", chksector.checksum[0]).AppendLine(); sb.AppendFormat("Checksum 0x{0:X8}", chksector.checksum[0]).AppendLine();
XmlFsType.ClusterSize = (1 << vbr.sectorShift) * (1 << vbr.clusterShift); XmlFsType.ClusterSize = (uint)((1 << vbr.sectorShift) * (1 << vbr.clusterShift));
XmlFsType.Clusters = vbr.clusterHeapLength; XmlFsType.Clusters = vbr.clusterHeapLength;
XmlFsType.Dirty = vbr.flags.HasFlag(VolumeFlags.VolumeDirty); XmlFsType.Dirty = vbr.flags.HasFlag(VolumeFlags.VolumeDirty);
XmlFsType.Type = "exFAT"; XmlFsType.Type = "exFAT";
@@ -149,62 +149,62 @@ namespace DiscImageChef.Filesystems
struct VolumeBootRecord struct VolumeBootRecord
{ {
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)]
public byte[] jump; public readonly byte[] jump;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
public byte[] signature; public readonly byte[] signature;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 53)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 53)]
public byte[] zero; public readonly byte[] zero;
public ulong offset; public readonly ulong offset;
public ulong sectors; public readonly ulong sectors;
public uint fatOffset; public readonly uint fatOffset;
public uint fatLength; public readonly uint fatLength;
public uint clusterHeapOffset; public readonly uint clusterHeapOffset;
public uint clusterHeapLength; public readonly uint clusterHeapLength;
public uint rootDirectoryCluster; public readonly uint rootDirectoryCluster;
public uint volumeSerial; public readonly uint volumeSerial;
public ushort revision; public readonly ushort revision;
public VolumeFlags flags; public readonly VolumeFlags flags;
public byte sectorShift; public readonly byte sectorShift;
public byte clusterShift; public readonly byte clusterShift;
public byte fats; public readonly byte fats;
public byte drive; public readonly byte drive;
public byte heapUsage; public readonly byte heapUsage;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 53)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 53)]
public byte[] reserved; public readonly byte[] reserved;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 53)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 53)]
public byte[] bootCode; public readonly byte[] bootCode;
public ushort bootSignature; public readonly ushort bootSignature;
} }
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct OemParameter struct OemParameter
{ {
public Guid OemParameterType; public readonly Guid OemParameterType;
public uint eraseBlockSize; public readonly uint eraseBlockSize;
public uint pageSize; public readonly uint pageSize;
public uint spareBlocks; public readonly uint spareBlocks;
public uint randomAccessTime; public readonly uint randomAccessTime;
public uint programTime; public readonly uint programTime;
public uint readCycleTime; public readonly uint readCycleTime;
public uint writeCycleTime; public readonly uint writeCycleTime;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public byte[] reserved; public readonly byte[] reserved;
} }
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct OemParameterTable struct OemParameterTable
{ {
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
public OemParameter[] parameters; public readonly OemParameter[] parameters;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] padding; public readonly byte[] padding;
} }
[StructLayout(LayoutKind.Sequential, Pack = 1)] [StructLayout(LayoutKind.Sequential, Pack = 1)]
struct ChecksumSector struct ChecksumSector
{ {
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)]
public uint[] checksum; public readonly uint[] checksum;
} }
} }
} }

View File

@@ -356,8 +356,8 @@ namespace DiscImageChef.Filesystems
sb.AppendFormat("Volume has {0} blocks of {1} bytes, for a total of {2} bytes", blocks, sb.AppendFormat("Volume has {0} blocks of {1} bytes, for a total of {2} bytes", blocks,
1024 << (int)supblk.block_size, blocks * (ulong)(1024 << (int)supblk.block_size)) 1024 << (int)supblk.block_size, blocks * (ulong)(1024 << (int)supblk.block_size))
.AppendLine(); .AppendLine();
XmlFsType.Clusters = (long)blocks; XmlFsType.Clusters = blocks;
XmlFsType.ClusterSize = 1024 << (int)supblk.block_size; XmlFsType.ClusterSize = (uint)(1024 << (int)supblk.block_size);
if(supblk.mount_t > 0 || supblk.mount_c > 0) if(supblk.mount_t > 0 || supblk.mount_c > 0)
{ {
if(supblk.mount_t > 0) if(supblk.mount_t > 0)
@@ -463,7 +463,7 @@ namespace DiscImageChef.Filesystems
sb.AppendFormat("{0} KiB has been written on volume", supblk.kbytes_written).AppendLine(); sb.AppendFormat("{0} KiB has been written on volume", supblk.kbytes_written).AppendLine();
sb.AppendFormat("{0} reserved and {1} free blocks", reserved, free).AppendLine(); sb.AppendFormat("{0} reserved and {1} free blocks", reserved, free).AppendLine();
XmlFsType.FreeClusters = (long)free; XmlFsType.FreeClusters = free;
XmlFsType.FreeClustersSpecified = true; XmlFsType.FreeClustersSpecified = true;
sb.AppendFormat("{0} inodes with {1} free inodes ({2}%)", supblk.inodes, supblk.free_inodes, sb.AppendFormat("{0} inodes with {1} free inodes ({2}%)", supblk.inodes, supblk.free_inodes,
supblk.free_inodes * 100 / supblk.inodes).AppendLine(); supblk.free_inodes * 100 / supblk.inodes).AppendLine();
@@ -640,227 +640,227 @@ namespace DiscImageChef.Filesystems
struct ext2FSSuperBlock struct ext2FSSuperBlock
{ {
/// <summary>0x000, inodes on volume</summary> /// <summary>0x000, inodes on volume</summary>
public uint inodes; public readonly uint inodes;
/// <summary>0x004, blocks on volume</summary> /// <summary>0x004, blocks on volume</summary>
public uint blocks; public readonly uint blocks;
/// <summary>0x008, reserved blocks</summary> /// <summary>0x008, reserved blocks</summary>
public uint reserved_blocks; public readonly uint reserved_blocks;
/// <summary>0x00C, free blocks count</summary> /// <summary>0x00C, free blocks count</summary>
public uint free_blocks; public readonly uint free_blocks;
/// <summary>0x010, free inodes count</summary> /// <summary>0x010, free inodes count</summary>
public uint free_inodes; public readonly uint free_inodes;
/// <summary>0x014, first data block</summary> /// <summary>0x014, first data block</summary>
public uint first_block; public readonly uint first_block;
/// <summary>0x018, block size</summary> /// <summary>0x018, block size</summary>
public uint block_size; public uint block_size;
/// <summary>0x01C, fragment size</summary> /// <summary>0x01C, fragment size</summary>
public int frag_size; public readonly int frag_size;
/// <summary>0x020, blocks per group</summary> /// <summary>0x020, blocks per group</summary>
public uint blocks_per_grp; public readonly uint blocks_per_grp;
/// <summary>0x024, fragments per group</summary> /// <summary>0x024, fragments per group</summary>
public uint flags_per_grp; public readonly uint flags_per_grp;
/// <summary>0x028, inodes per group</summary> /// <summary>0x028, inodes per group</summary>
public uint inodes_per_grp; public readonly uint inodes_per_grp;
/// <summary>0x02C, last mount time</summary> /// <summary>0x02C, last mount time</summary>
public uint mount_t; public readonly uint mount_t;
/// <summary>0x030, last write time</summary> /// <summary>0x030, last write time</summary>
public uint write_t; public readonly uint write_t;
/// <summary>0x034, mounts count</summary> /// <summary>0x034, mounts count</summary>
public ushort mount_c; public readonly ushort mount_c;
/// <summary>0x036, max mounts</summary> /// <summary>0x036, max mounts</summary>
public short max_mount_c; public readonly short max_mount_c;
/// <summary>0x038, (little endian)</summary> /// <summary>0x038, (little endian)</summary>
public ushort magic; public readonly ushort magic;
/// <summary>0x03A, filesystem state</summary> /// <summary>0x03A, filesystem state</summary>
public ushort state; public readonly ushort state;
/// <summary>0x03C, behaviour on errors</summary> /// <summary>0x03C, behaviour on errors</summary>
public ushort err_behaviour; public readonly ushort err_behaviour;
/// <summary>0x03E, From 0.5b onward</summary> /// <summary>0x03E, From 0.5b onward</summary>
public ushort minor_revision; public readonly ushort minor_revision;
/// <summary>0x040, last check time</summary> /// <summary>0x040, last check time</summary>
public uint check_t; public readonly uint check_t;
/// <summary>0x044, max time between checks</summary> /// <summary>0x044, max time between checks</summary>
public uint check_inv; public readonly uint check_inv;
// From 0.5a onward // From 0.5a onward
/// <summary>0x048, Creation OS</summary> /// <summary>0x048, Creation OS</summary>
public uint creator_os; public readonly uint creator_os;
/// <summary>0x04C, Revison level</summary> /// <summary>0x04C, Revison level</summary>
public uint revision; public readonly uint revision;
/// <summary>0x050, Default UID for reserved blocks</summary> /// <summary>0x050, Default UID for reserved blocks</summary>
public ushort default_uid; public readonly ushort default_uid;
/// <summary>0x052, Default GID for reserved blocks</summary> /// <summary>0x052, Default GID for reserved blocks</summary>
public ushort default_gid; public readonly ushort default_gid;
// From 0.5b onward // From 0.5b onward
/// <summary>0x054, First unreserved inode</summary> /// <summary>0x054, First unreserved inode</summary>
public uint first_inode; public readonly uint first_inode;
/// <summary>0x058, inode size</summary> /// <summary>0x058, inode size</summary>
public ushort inode_size; public readonly ushort inode_size;
/// <summary>0x05A, Block group number of THIS superblock</summary> /// <summary>0x05A, Block group number of THIS superblock</summary>
public ushort block_group_no; public readonly ushort block_group_no;
/// <summary>0x05C, Compatible features set</summary> /// <summary>0x05C, Compatible features set</summary>
public uint ftr_compat; public readonly uint ftr_compat;
/// <summary>0x060, Incompatible features set</summary> /// <summary>0x060, Incompatible features set</summary>
public uint ftr_incompat; public readonly uint ftr_incompat;
// Found on Linux 2.0.40 // Found on Linux 2.0.40
/// <summary>0x064, Read-only compatible features set</summary> /// <summary>0x064, Read-only compatible features set</summary>
public uint ftr_ro_compat; public readonly uint ftr_ro_compat;
// Found on Linux 2.1.132 // Found on Linux 2.1.132
/// <summary>0x068, 16 bytes, UUID</summary> /// <summary>0x068, 16 bytes, UUID</summary>
public Guid uuid; public readonly Guid uuid;
/// <summary>0x078, 16 bytes, volume name</summary> /// <summary>0x078, 16 bytes, volume name</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] volume_name; public readonly byte[] volume_name;
/// <summary>0x088, 64 bytes, where last mounted</summary> /// <summary>0x088, 64 bytes, where last mounted</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)]
public byte[] last_mount_dir; public readonly byte[] last_mount_dir;
/// <summary>0x0C8, Usage bitmap algorithm, for compression</summary> /// <summary>0x0C8, Usage bitmap algorithm, for compression</summary>
public uint algo_usage_bmp; public readonly uint algo_usage_bmp;
/// <summary>0x0CC, Block to try to preallocate</summary> /// <summary>0x0CC, Block to try to preallocate</summary>
public byte prealloc_blks; public readonly byte prealloc_blks;
/// <summary>0x0CD, Blocks to try to preallocate for directories</summary> /// <summary>0x0CD, Blocks to try to preallocate for directories</summary>
public byte prealloc_dir_blks; public readonly byte prealloc_dir_blks;
/// <summary>0x0CE, Per-group desc for online growth</summary> /// <summary>0x0CE, Per-group desc for online growth</summary>
public ushort rsrvd_gdt_blocks; public readonly ushort rsrvd_gdt_blocks;
// Found on Linux 2.4 // Found on Linux 2.4
// ext3 // ext3
/// <summary>0x0D0, 16 bytes, UUID of journal superblock</summary> /// <summary>0x0D0, 16 bytes, UUID of journal superblock</summary>
public Guid journal_uuid; public readonly Guid journal_uuid;
/// <summary>0x0E0, inode no. of journal file</summary> /// <summary>0x0E0, inode no. of journal file</summary>
public uint journal_inode; public readonly uint journal_inode;
/// <summary>0x0E4, device no. of journal file</summary> /// <summary>0x0E4, device no. of journal file</summary>
public uint journal_dev; public readonly uint journal_dev;
/// <summary>0x0E8, Start of list of inodes to delete</summary> /// <summary>0x0E8, Start of list of inodes to delete</summary>
public uint last_orphan; public readonly uint last_orphan;
/// <summary>0x0EC, First byte of 128bit HTREE hash seed</summary> /// <summary>0x0EC, First byte of 128bit HTREE hash seed</summary>
public uint hash_seed_1; public readonly uint hash_seed_1;
/// <summary>0x0F0, Second byte of 128bit HTREE hash seed</summary> /// <summary>0x0F0, Second byte of 128bit HTREE hash seed</summary>
public uint hash_seed_2; public readonly uint hash_seed_2;
/// <summary>0x0F4, Third byte of 128bit HTREE hash seed</summary> /// <summary>0x0F4, Third byte of 128bit HTREE hash seed</summary>
public uint hash_seed_3; public readonly uint hash_seed_3;
/// <summary>0x0F8, Fourth byte of 128bit HTREE hash seed</summary> /// <summary>0x0F8, Fourth byte of 128bit HTREE hash seed</summary>
public uint hash_seed_4; public readonly uint hash_seed_4;
/// <summary>0x0FC, Hash version</summary> /// <summary>0x0FC, Hash version</summary>
public byte hash_version; public readonly byte hash_version;
/// <summary>0x0FD, Journal backup type</summary> /// <summary>0x0FD, Journal backup type</summary>
public byte jnl_backup_type; public readonly byte jnl_backup_type;
/// <summary>0x0FE, Size of group descriptor</summary> /// <summary>0x0FE, Size of group descriptor</summary>
public ushort desc_grp_size; public readonly ushort desc_grp_size;
/// <summary>0x100, Default mount options</summary> /// <summary>0x100, Default mount options</summary>
public uint default_mnt_opts; public readonly uint default_mnt_opts;
/// <summary>0x104, First metablock block group</summary> /// <summary>0x104, First metablock block group</summary>
public uint first_meta_bg; public readonly uint first_meta_bg;
// Introduced with ext4, some can be ext3 // Introduced with ext4, some can be ext3
/// <summary>0x108, Filesystem creation time</summary> /// <summary>0x108, Filesystem creation time</summary>
public uint mkfs_t; public readonly uint mkfs_t;
/// <summary>Backup of the journal inode</summary> /// <summary>Backup of the journal inode</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 17)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 17)]
public uint[] jnl_blocks; public readonly uint[] jnl_blocks;
// Following 3 fields are valid if EXT4_FEATURE_COMPAT_64BIT is set // Following 3 fields are valid if EXT4_FEATURE_COMPAT_64BIT is set
/// <summary>0x14C, High 32bits of blocks no.</summary> /// <summary>0x14C, High 32bits of blocks no.</summary>
public uint blocks_hi; public readonly uint blocks_hi;
/// <summary>0x150, High 32bits of reserved blocks no.</summary> /// <summary>0x150, High 32bits of reserved blocks no.</summary>
public uint reserved_blocks_hi; public readonly uint reserved_blocks_hi;
/// <summary>0x154, High 32bits of free blocks no.</summary> /// <summary>0x154, High 32bits of free blocks no.</summary>
public uint free_blocks_hi; public readonly uint free_blocks_hi;
/// <summary>0x158, inodes minimal size in bytes</summary> /// <summary>0x158, inodes minimal size in bytes</summary>
public ushort min_inode_size; public readonly ushort min_inode_size;
/// <summary>0x15A, Bytes reserved by new inodes</summary> /// <summary>0x15A, Bytes reserved by new inodes</summary>
public ushort rsv_inode_size; public readonly ushort rsv_inode_size;
/// <summary>0x15C, Flags</summary> /// <summary>0x15C, Flags</summary>
public uint flags; public readonly uint flags;
/// <summary>0x160, RAID stride</summary> /// <summary>0x160, RAID stride</summary>
public ushort raid_stride; public readonly ushort raid_stride;
/// <summary>0x162, Waiting seconds in MMP check</summary> /// <summary>0x162, Waiting seconds in MMP check</summary>
public ushort mmp_interval; public readonly ushort mmp_interval;
/// <summary>0x164, Block for multi-mount protection</summary> /// <summary>0x164, Block for multi-mount protection</summary>
public ulong mmp_block; public readonly ulong mmp_block;
/// <summary>0x16C, Blocks on all data disks (N*stride)</summary> /// <summary>0x16C, Blocks on all data disks (N*stride)</summary>
public uint raid_stripe_width; public readonly uint raid_stripe_width;
/// <summary>0x170, FLEX_BG group size</summary> /// <summary>0x170, FLEX_BG group size</summary>
public byte flex_bg_grp_size; public readonly byte flex_bg_grp_size;
/// <summary>0x171 Metadata checksum algorithm</summary> /// <summary>0x171 Metadata checksum algorithm</summary>
public byte checksum_type; public readonly byte checksum_type;
/// <summary>0x172 Versioning level for encryption</summary> /// <summary>0x172 Versioning level for encryption</summary>
public byte encryption_level; public readonly byte encryption_level;
/// <summary>0x173 Padding</summary> /// <summary>0x173 Padding</summary>
public ushort padding; public readonly ushort padding;
// Following are introduced with ext4 // Following are introduced with ext4
/// <summary>0x174, Kibibytes written in volume lifetime</summary> /// <summary>0x174, Kibibytes written in volume lifetime</summary>
public ulong kbytes_written; public readonly ulong kbytes_written;
/// <summary>0x17C, Active snapshot inode number</summary> /// <summary>0x17C, Active snapshot inode number</summary>
public uint snapshot_inum; public readonly uint snapshot_inum;
/// <summary>0x180, Active snapshot sequential ID</summary> /// <summary>0x180, Active snapshot sequential ID</summary>
public uint snapshot_id; public readonly uint snapshot_id;
/// <summary>0x184, Reserved blocks for active snapshot's future use</summary> /// <summary>0x184, Reserved blocks for active snapshot's future use</summary>
public ulong snapshot_blocks; public readonly ulong snapshot_blocks;
/// <summary>0x18C, inode number of the on-disk start of the snapshot list</summary> /// <summary>0x18C, inode number of the on-disk start of the snapshot list</summary>
public uint snapshot_list; public readonly uint snapshot_list;
// Optional ext4 error-handling features // Optional ext4 error-handling features
/// <summary>0x190, total registered filesystem errors</summary> /// <summary>0x190, total registered filesystem errors</summary>
public uint error_count; public readonly uint error_count;
/// <summary>0x194, time on first error</summary> /// <summary>0x194, time on first error</summary>
public uint first_error_t; public readonly uint first_error_t;
/// <summary>0x198, inode involved in first error</summary> /// <summary>0x198, inode involved in first error</summary>
public uint first_error_inode; public readonly uint first_error_inode;
/// <summary>0x19C, block involved of first error</summary> /// <summary>0x19C, block involved of first error</summary>
public ulong first_error_block; public readonly ulong first_error_block;
/// <summary>0x1A0, 32 bytes, function where the error happened</summary> /// <summary>0x1A0, 32 bytes, function where the error happened</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] first_error_func; public readonly byte[] first_error_func;
/// <summary>0x1B0, line number where error happened</summary> /// <summary>0x1B0, line number where error happened</summary>
public uint first_error_line; public readonly uint first_error_line;
/// <summary>0x1B4, time of most recent error</summary> /// <summary>0x1B4, time of most recent error</summary>
public uint last_error_t; public readonly uint last_error_t;
/// <summary>0x1B8, inode involved in last error</summary> /// <summary>0x1B8, inode involved in last error</summary>
public uint last_error_inode; public readonly uint last_error_inode;
/// <summary>0x1BC, line number where error happened</summary> /// <summary>0x1BC, line number where error happened</summary>
public uint last_error_line; public readonly uint last_error_line;
/// <summary>0x1C0, block involved of last error</summary> /// <summary>0x1C0, block involved of last error</summary>
public ulong last_error_block; public readonly ulong last_error_block;
/// <summary>0x1C8, 32 bytes, function where the error happened</summary> /// <summary>0x1C8, 32 bytes, function where the error happened</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)]
public byte[] last_error_func; public readonly byte[] last_error_func;
// End of optional error-handling features // End of optional error-handling features
// 0x1D8, 64 bytes, last used mount options</summary> // 0x1D8, 64 bytes, last used mount options</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)]
public byte[] mount_options; public readonly byte[] mount_options;
/// <summary>Inode for user quota</summary> /// <summary>Inode for user quota</summary>
public uint usr_quota_inum; public readonly uint usr_quota_inum;
/// <summary>Inode for group quota</summary> /// <summary>Inode for group quota</summary>
public uint grp_quota_inum; public readonly uint grp_quota_inum;
/// <summary>Overhead clusters in volume</summary> /// <summary>Overhead clusters in volume</summary>
public uint overhead_clusters; public readonly uint overhead_clusters;
/// <summary>Groups with sparse_super2 SBs</summary> /// <summary>Groups with sparse_super2 SBs</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)]
public uint[] backup_bgs; public readonly uint[] backup_bgs;
/// <summary>Encryption algorithms in use</summary> /// <summary>Encryption algorithms in use</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)]
public byte[] encrypt_algos; public readonly byte[] encrypt_algos;
/// <summary>Salt used for string2key algorithm</summary> /// <summary>Salt used for string2key algorithm</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)]
public byte[] encrypt_pw_salt; public readonly byte[] encrypt_pw_salt;
/// <summary>Inode number of lost+found</summary> /// <summary>Inode number of lost+found</summary>
public uint lpf_inum; public readonly uint lpf_inum;
/// <summary>Inode number for tracking project quota</summary> /// <summary>Inode number for tracking project quota</summary>
public uint prj_quota_inum; public readonly uint prj_quota_inum;
/// <summary>crc32c(uuid) if csum_seed is set</summary> /// <summary>crc32c(uuid) if csum_seed is set</summary>
public uint checksum_seed; public readonly uint checksum_seed;
/// <summary>Reserved</summary> /// <summary>Reserved</summary>
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 98)] [MarshalAs(UnmanagedType.ByValArray, SizeConst = 98)]
public byte[] reserved; public readonly byte[] reserved;
/// <summary>crc32c(superblock)</summary> /// <summary>crc32c(superblock)</summary>
public uint checksum; public readonly uint checksum;
} }
} }
} }

View File

@@ -122,7 +122,7 @@ namespace DiscImageChef.Filesystems
FreeClusters = extSb.freecountblk, FreeClusters = extSb.freecountblk,
FreeClustersSpecified = true, FreeClustersSpecified = true,
ClusterSize = 1024, ClusterSize = 1024,
Clusters = (long)((partition.End - partition.Start + 1) * imagePlugin.Info.SectorSize / 1024) Clusters = (partition.End - partition.Start + 1) * imagePlugin.Info.SectorSize / 1024
}; };
information = sb.ToString(); information = sb.ToString();

View File

@@ -48,7 +48,7 @@ namespace DiscImageChef.Commands
{ {
class CreateSidecarCommand : Command class CreateSidecarCommand : Command
{ {
int blockSize; uint blockSize;
string encodingName; string encodingName;
string inputFile; string inputFile;
bool showHelp; bool showHelp;
@@ -67,7 +67,7 @@ namespace DiscImageChef.Commands
{ {
"block-size|b=", "block-size|b=",
"Only used for tapes, indicates block size. Files in the folder whose size is not a multiple of this value will simply be ignored.", "Only used for tapes, indicates block size. Files in the folder whose size is not a multiple of this value will simply be ignored.",
(int i) => blockSize = i (uint i) => blockSize = i
}, },
{"encoding|e=", "Name of character encoding to use.", s => encodingName = s}, {"encoding|e=", "Name of character encoding to use.", s => encodingName = s},
{ {