diff --git a/DiscImageChef.Core/Devices/Dumping/ATA.cs b/DiscImageChef.Core/Devices/Dumping/ATA.cs index 85afc2c6..e6b07423 100644 --- a/DiscImageChef.Core/Devices/Dumping/ATA.cs +++ b/DiscImageChef.Core/Devices/Dumping/ATA.cs @@ -418,8 +418,7 @@ namespace DiscImageChef.Core.Devices.Dumping (double)blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000)); } - foreach(ulong bad in resume.BadBlocks) - dumpLog.WriteLine("Sector {0} could not be read.", bad); + foreach(ulong bad in resume.BadBlocks) dumpLog.WriteLine("Sector {0} could not be read.", bad); outputPlugin.SetDumpHardware(resume.Tries); if(preSidecar != null) outputPlugin.SetCicmMetadata(preSidecar); dumpLog.WriteLine("Closing output file."); @@ -538,6 +537,17 @@ namespace DiscImageChef.Core.Devices.Dumping dumpLog.WriteLine("Average checksum speed {0:F3} KiB/sec.", (double)blockSize * (double)(blocks + 1) / 1024 / (totalChkDuration / 1000)); + List<(ulong start, string type)> filesystems = new List<(ulong start, string type)>(); + if(sidecar.BlockMedia[0].FileSystemInformation != null) + filesystems.AddRange(from partition in sidecar.BlockMedia[0].FileSystemInformation + where partition.FileSystems != null + from fileSystem in partition.FileSystems + select ((ulong)partition.StartSector, fileSystem.Type)); + + if(filesystems.Count > 0) + foreach(var filesystem in filesystems.Select(o => new {o.start, o.type}).Distinct()) + dumpLog.WriteLine("Found filesystem {0} at sector {1}", filesystem.type, filesystem.start); + DicConsole.WriteLine(); string xmlDskTyp, xmlDskSubTyp; if(dev.IsCompactFlash) diff --git a/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs b/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs index c217a2db..b3a2bdfe 100644 --- a/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs +++ b/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs @@ -728,7 +728,7 @@ namespace DiscImageChef.Core.Devices.Dumping if(supportedSubchannel != MmcSubchannel.None) { outputPlugin.WriteSectorsLong(new byte[SECTOR_SIZE * blocksToRead], i, blocksToRead); - outputPlugin.WriteSectorsTag(new byte[subSize * blocksToRead], i, blocksToRead, + outputPlugin.WriteSectorsTag(new byte[subSize * blocksToRead], i, blocksToRead, SectorTagType.CdSectorSubchannel); } else outputPlugin.WriteSectorsLong(new byte[blockSize * blocksToRead], i, blocksToRead); @@ -889,8 +889,7 @@ namespace DiscImageChef.Core.Devices.Dumping } resume.BadBlocks.Sort(); - foreach(ulong bad in resume.BadBlocks) - dumpLog.WriteLine("Sector {0} could not be read.", bad); + foreach(ulong bad in resume.BadBlocks) dumpLog.WriteLine("Sector {0} could not be read.", bad); currentTry.Extents = ExtentsConverter.ToMetadata(extents); outputPlugin.SetDumpHardware(resume.Tries); @@ -926,6 +925,19 @@ namespace DiscImageChef.Core.Devices.Dumping sidecar = preSidecar; } + List<(ulong start, string type)> filesystems = new List<(ulong start, string type)>(); + if(sidecar.OpticalDisc[0].Track != null) + filesystems.AddRange(from xmlTrack in sidecar.OpticalDisc[0].Track + where xmlTrack.FileSystemInformation != null + from partition in xmlTrack.FileSystemInformation + where partition.FileSystems != null + from fileSystem in partition.FileSystems + select ((ulong)partition.StartSector, fileSystem.Type)); + + if(filesystems.Count > 0) + foreach(var filesystem in filesystems.Select(o => new {o.start, o.type}).Distinct()) + dumpLog.WriteLine("Found filesystem {0} at sector {1}", filesystem.type, filesystem.start); + sidecar.OpticalDisc[0].Dimensions = Dimensions.DimensionsFromMediaType(dskType); Metadata.MediaType.MediaTypeToString(dskType, out string xmlDskTyp, out string xmlDskSubTyp); sidecar.OpticalDisc[0].DiscType = xmlDskTyp; diff --git a/DiscImageChef.Core/Devices/Dumping/SBC.cs b/DiscImageChef.Core/Devices/Dumping/SBC.cs index 1d346b4c..0d2c3f39 100644 --- a/DiscImageChef.Core/Devices/Dumping/SBC.cs +++ b/DiscImageChef.Core/Devices/Dumping/SBC.cs @@ -647,8 +647,7 @@ namespace DiscImageChef.Core.Devices.Dumping } resume.BadBlocks.Sort(); - foreach(ulong bad in resume.BadBlocks) - dumpLog.WriteLine("Sector {0} could not be read.", bad); + foreach(ulong bad in resume.BadBlocks) dumpLog.WriteLine("Sector {0} could not be read.", bad); currentTry.Extents = ExtentsConverter.ToMetadata(extents); outputPlugin.SetDumpHardware(resume.Tries); @@ -686,6 +685,18 @@ namespace DiscImageChef.Core.Devices.Dumping sidecar = preSidecar; } + List<(ulong start, string type)> filesystems = new List<(ulong start, string type)>(); + if(sidecar.OpticalDisc[0].Track != null) + filesystems.AddRange(from xmlTrack in sidecar.OpticalDisc[0].Track + where xmlTrack.FileSystemInformation != null + from partition in xmlTrack.FileSystemInformation + where partition.FileSystems != null + from fileSystem in partition.FileSystems + select ((ulong)partition.StartSector, fileSystem.Type)); + + if(filesystems.Count > 0) + foreach(var filesystem in filesystems.Select(o => new {o.start, o.type}).Distinct()) + dumpLog.WriteLine("Found filesystem {0} at sector {1}", filesystem.type, filesystem.start); // TODO: Implement layers sidecar.OpticalDisc[0].Dimensions = Dimensions.DimensionsFromMediaType(dskType); Metadata.MediaType.MediaTypeToString(dskType, out string xmlDskTyp, out string xmlDskSubTyp); @@ -825,6 +836,16 @@ namespace DiscImageChef.Core.Devices.Dumping } } + List<(ulong start, string type)> filesystems = new List<(ulong start, string type)>(); + if(sidecar.BlockMedia[0].FileSystemInformation != null) + filesystems.AddRange(from partition in sidecar.BlockMedia[0].FileSystemInformation + where partition.FileSystems != null + from fileSystem in partition.FileSystems + select ((ulong)partition.StartSector, fileSystem.Type)); + + if(filesystems.Count > 0) + foreach(var filesystem in filesystems.Select(o => new {o.start, o.type}).Distinct()) + dumpLog.WriteLine("Found filesystem {0} at sector {1}", filesystem.type, filesystem.start); sidecar.BlockMedia[0].Dimensions = Dimensions.DimensionsFromMediaType(dskType); Metadata.MediaType.MediaTypeToString(dskType, out string xmlDskTyp, out string xmlDskSubTyp); sidecar.BlockMedia[0].DiskType = xmlDskTyp; diff --git a/DiscImageChef.Core/Devices/Dumping/XGD.cs b/DiscImageChef.Core/Devices/Dumping/XGD.cs index fc9da25b..43e1c190 100644 --- a/DiscImageChef.Core/Devices/Dumping/XGD.cs +++ b/DiscImageChef.Core/Devices/Dumping/XGD.cs @@ -772,8 +772,7 @@ namespace DiscImageChef.Core.Devices.Dumping } resume.BadBlocks.Sort(); - foreach(ulong bad in resume.BadBlocks) - dumpLog.WriteLine("Sector {0} could not be read.", bad); + foreach(ulong bad in resume.BadBlocks) dumpLog.WriteLine("Sector {0} could not be read.", bad); currentTry.Extents = ExtentsConverter.ToMetadata(extents); outputPlugin.SetDumpHardware(resume.Tries); @@ -812,6 +811,19 @@ namespace DiscImageChef.Core.Devices.Dumping foreach(KeyValuePair tag in mediaTags) Mmc.AddMediaTagToSidecar(outputPath, tag, ref sidecar); + List<(ulong start, string type)> filesystems = new List<(ulong start, string type)>(); + if(sidecar.OpticalDisc[0].Track != null) + filesystems.AddRange(from xmlTrack in sidecar.OpticalDisc[0].Track + where xmlTrack.FileSystemInformation != null + from partition in xmlTrack.FileSystemInformation + where partition.FileSystems != null + from fileSystem in partition.FileSystems + select ((ulong)partition.StartSector, fileSystem.Type)); + + if(filesystems.Count > 0) + foreach(var filesystem in filesystems.Select(o => new {o.start, o.type}).Distinct()) + dumpLog.WriteLine("Found filesystem {0} at sector {1}", filesystem.type, filesystem.start); + sidecar.OpticalDisc[0].Layers = new LayersType { type = LayersTypeType.OTP,