mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
REFACTOR: Fixed MOST name inconsistencies.
This commit is contained in:
@@ -41,22 +41,22 @@ using DiscImageChef.Decoders.PCMCIA;
|
||||
using DiscImageChef.Devices;
|
||||
using DiscImageChef.Filesystems;
|
||||
using DiscImageChef.Filters;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.PartPlugins;
|
||||
using DiscImageChef.DiscImages;
|
||||
using DiscImageChef.Partitions;
|
||||
using Schemas;
|
||||
using Extents;
|
||||
|
||||
namespace DiscImageChef.Core.Devices.Dumping
|
||||
{
|
||||
public class ATA
|
||||
public class Ata
|
||||
{
|
||||
public static void Dump(Device dev, string devicePath, string outputPrefix, ushort retryPasses, bool force,
|
||||
bool dumpRaw, bool persistent, bool stopOnError, ref Metadata.Resume resume,
|
||||
ref DumpLog dumpLog, Encoding encoding)
|
||||
{
|
||||
bool aborted;
|
||||
MHDDLog mhddLog;
|
||||
IBGLog ibgLog;
|
||||
MhddLog mhddLog;
|
||||
IbgLog ibgLog;
|
||||
|
||||
if(dumpRaw)
|
||||
{
|
||||
@@ -84,24 +84,24 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
CICMMetadataType sidecar =
|
||||
new CICMMetadataType() {BlockMedia = new BlockMediaType[] {new BlockMediaType()}};
|
||||
|
||||
if(dev.IsUSB)
|
||||
if(dev.IsUsb)
|
||||
{
|
||||
dumpLog.WriteLine("Reading USB descriptors.");
|
||||
sidecar.BlockMedia[0].USB = new USBType
|
||||
{
|
||||
ProductID = dev.USBProductID,
|
||||
VendorID = dev.USBVendorID,
|
||||
ProductID = dev.UsbProductId,
|
||||
VendorID = dev.UsbVendorId,
|
||||
Descriptors = new DumpType
|
||||
{
|
||||
Image = outputPrefix + ".usbdescriptors.bin",
|
||||
Size = dev.USBDescriptors.Length,
|
||||
Checksums = Checksum.GetChecksums(dev.USBDescriptors).ToArray()
|
||||
Size = dev.UsbDescriptors.Length,
|
||||
Checksums = Checksum.GetChecksums(dev.UsbDescriptors).ToArray()
|
||||
}
|
||||
};
|
||||
DataFile.WriteTo("ATA Dump", sidecar.BlockMedia[0].USB.Descriptors.Image, dev.USBDescriptors);
|
||||
DataFile.WriteTo("ATA Dump", sidecar.BlockMedia[0].USB.Descriptors.Image, dev.UsbDescriptors);
|
||||
}
|
||||
|
||||
if(dev.IsPCMCIA)
|
||||
if(dev.IsPcmcia)
|
||||
{
|
||||
dumpLog.WriteLine("Reading PCMCIA CIS.");
|
||||
sidecar.BlockMedia[0].PCMCIA = new PCMCIAType
|
||||
@@ -109,13 +109,13 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
CIS = new DumpType
|
||||
{
|
||||
Image = outputPrefix + ".cis.bin",
|
||||
Size = dev.CIS.Length,
|
||||
Checksums = Checksum.GetChecksums(dev.CIS).ToArray()
|
||||
Size = dev.Cis.Length,
|
||||
Checksums = Checksum.GetChecksums(dev.Cis).ToArray()
|
||||
}
|
||||
};
|
||||
DataFile.WriteTo("ATA Dump", sidecar.BlockMedia[0].PCMCIA.CIS.Image, dev.CIS);
|
||||
DataFile.WriteTo("ATA Dump", sidecar.BlockMedia[0].PCMCIA.CIS.Image, dev.Cis);
|
||||
dumpLog.WriteLine("Decoding PCMCIA CIS.");
|
||||
Decoders.PCMCIA.Tuple[] tuples = CIS.GetTuples(dev.CIS);
|
||||
Decoders.PCMCIA.Tuple[] tuples = CIS.GetTuples(dev.Cis);
|
||||
if(tuples != null)
|
||||
{
|
||||
foreach(Decoders.PCMCIA.Tuple tuple in tuples)
|
||||
@@ -222,17 +222,17 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
.Removable));
|
||||
DumpHardwareType currentTry = null;
|
||||
ExtentsULong extents = null;
|
||||
ResumeSupport.Process(ataReader.IsLBA, removable, blocks, dev.Manufacturer, dev.Model, dev.Serial,
|
||||
dev.PlatformID, ref resume, ref currentTry, ref extents);
|
||||
ResumeSupport.Process(ataReader.IsLba, removable, blocks, dev.Manufacturer, dev.Model, dev.Serial,
|
||||
dev.PlatformId, ref resume, ref currentTry, ref extents);
|
||||
if(currentTry == null || extents == null)
|
||||
throw new Exception("Could not process resume file, not continuing...");
|
||||
|
||||
if(ataReader.IsLBA)
|
||||
if(ataReader.IsLba)
|
||||
{
|
||||
DicConsole.WriteLine("Reading {0} sectors at a time.", blocksToRead);
|
||||
|
||||
mhddLog = new MHDDLog(outputPrefix + ".mhddlog.bin", dev, blocks, blockSize, blocksToRead);
|
||||
ibgLog = new IBGLog(outputPrefix + ".ibg", currentProfile);
|
||||
mhddLog = new MhddLog(outputPrefix + ".mhddlog.bin", dev, blocks, blockSize, blocksToRead);
|
||||
ibgLog = new IbgLog(outputPrefix + ".ibg", currentProfile);
|
||||
dumpFile = new DataFile(outputPrefix + ".bin");
|
||||
if(resume.NextBlock > 0) dumpLog.WriteLine("Resuming from block {0}.", resume.NextBlock);
|
||||
|
||||
@@ -350,18 +350,18 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
}
|
||||
else
|
||||
{
|
||||
mhddLog = new MHDDLog(outputPrefix + ".mhddlog.bin", dev, blocks, blockSize, blocksToRead);
|
||||
ibgLog = new IBGLog(outputPrefix + ".ibg", currentProfile);
|
||||
mhddLog = new MhddLog(outputPrefix + ".mhddlog.bin", dev, blocks, blockSize, blocksToRead);
|
||||
ibgLog = new IbgLog(outputPrefix + ".ibg", currentProfile);
|
||||
dumpFile = new DataFile(outputPrefix + ".bin");
|
||||
|
||||
ulong currentBlock = 0;
|
||||
blocks = (ulong)(cylinders * heads * sectors);
|
||||
start = DateTime.UtcNow;
|
||||
for(ushort Cy = 0; Cy < cylinders; Cy++)
|
||||
for(ushort cy = 0; cy < cylinders; cy++)
|
||||
{
|
||||
for(byte Hd = 0; Hd < heads; Hd++)
|
||||
for(byte hd = 0; hd < heads; hd++)
|
||||
{
|
||||
for(byte Sc = 1; Sc < sectors; Sc++)
|
||||
for(byte sc = 1; sc < sectors; sc++)
|
||||
{
|
||||
if(aborted)
|
||||
{
|
||||
@@ -375,10 +375,10 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
if(currentSpeed < minSpeed && currentSpeed != 0) minSpeed = currentSpeed;
|
||||
#pragma warning restore RECS0018 // Comparison of floating point numbers with equality operator
|
||||
|
||||
DicConsole.Write("\rReading cylinder {0} head {1} sector {2} ({3:F3} MiB/sec.)", Cy, Hd,
|
||||
Sc, currentSpeed);
|
||||
DicConsole.Write("\rReading cylinder {0} head {1} sector {2} ({3:F3} MiB/sec.)", cy, hd,
|
||||
sc, currentSpeed);
|
||||
|
||||
bool error = ataReader.ReadCHS(out cmdBuf, Cy, Hd, Sc, out duration);
|
||||
bool error = ataReader.ReadChs(out cmdBuf, cy, hd, sc, out duration);
|
||||
|
||||
totalDuration += duration;
|
||||
|
||||
@@ -388,7 +388,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
ibgLog.Write(currentBlock, currentSpeed * 1024);
|
||||
dumpFile.Write(cmdBuf);
|
||||
extents.Add(currentBlock);
|
||||
dumpLog.WriteLine("Error reading cylinder {0} head {1} sector {2}.", Cy, Hd, Sc);
|
||||
dumpLog.WriteLine("Error reading cylinder {0} head {1} sector {2}.", cy, hd, sc);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -461,7 +461,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
|
||||
PluginBase plugins = new PluginBase();
|
||||
plugins.RegisterAllPlugins(encoding);
|
||||
ImagePlugin _imageFormat;
|
||||
ImagePlugin imageFormat;
|
||||
|
||||
FiltersList filtersList = new FiltersList();
|
||||
Filter inputFilter = filtersList.GetFilter(outputPrefix + ".bin");
|
||||
@@ -472,16 +472,16 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
return;
|
||||
}
|
||||
|
||||
_imageFormat = ImageFormat.Detect(inputFilter);
|
||||
imageFormat = ImageFormat.Detect(inputFilter);
|
||||
PartitionType[] xmlFileSysInfo = null;
|
||||
|
||||
try { if(!_imageFormat.OpenImage(inputFilter)) _imageFormat = null; }
|
||||
catch { _imageFormat = null; }
|
||||
try { if(!imageFormat.OpenImage(inputFilter)) imageFormat = null; }
|
||||
catch { imageFormat = null; }
|
||||
|
||||
if(_imageFormat != null)
|
||||
if(imageFormat != null)
|
||||
{
|
||||
dumpLog.WriteLine("Getting partitions.");
|
||||
List<Partition> partitions = Partitions.GetAll(_imageFormat);
|
||||
List<Partition> partitions = Partitions.GetAll(imageFormat);
|
||||
Partitions.AddSchemesToStats(partitions);
|
||||
dumpLog.WriteLine("Found {0} partitions.", partitions.Count);
|
||||
|
||||
@@ -505,16 +505,16 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
i, partitions[i].Start, partitions[i].End, partitions[i].Type,
|
||||
partitions[i].Scheme);
|
||||
|
||||
foreach(Filesystem _plugin in plugins.PluginsList.Values)
|
||||
foreach(Filesystem plugin in plugins.PluginsList.Values)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(_plugin.Identify(_imageFormat, partitions[i]))
|
||||
if(plugin.Identify(imageFormat, partitions[i]))
|
||||
{
|
||||
_plugin.GetInformation(_imageFormat, partitions[i], out string foo);
|
||||
lstFs.Add(_plugin.XmlFSType);
|
||||
Statistics.AddFilesystem(_plugin.XmlFSType.Type);
|
||||
dumpLog.WriteLine("Filesystem {0} found.", _plugin.XmlFSType.Type);
|
||||
plugin.GetInformation(imageFormat, partitions[i], out string foo);
|
||||
lstFs.Add(plugin.XmlFSType);
|
||||
Statistics.AddFilesystem(plugin.XmlFSType.Type);
|
||||
dumpLog.WriteLine("Filesystem {0} found.", plugin.XmlFSType.Type);
|
||||
}
|
||||
}
|
||||
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
|
||||
@@ -543,16 +543,16 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
Size = blocks * blockSize
|
||||
};
|
||||
|
||||
foreach(Filesystem _plugin in plugins.PluginsList.Values)
|
||||
foreach(Filesystem plugin in plugins.PluginsList.Values)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(_plugin.Identify(_imageFormat, wholePart))
|
||||
if(plugin.Identify(imageFormat, wholePart))
|
||||
{
|
||||
_plugin.GetInformation(_imageFormat, wholePart, out string foo);
|
||||
lstFs.Add(_plugin.XmlFSType);
|
||||
Statistics.AddFilesystem(_plugin.XmlFSType.Type);
|
||||
dumpLog.WriteLine("Filesystem {0} found.", _plugin.XmlFSType.Type);
|
||||
plugin.GetInformation(imageFormat, wholePart, out string foo);
|
||||
lstFs.Add(plugin.XmlFSType);
|
||||
Statistics.AddFilesystem(plugin.XmlFSType.Type);
|
||||
dumpLog.WriteLine("Filesystem {0} found.", plugin.XmlFSType.Type);
|
||||
}
|
||||
}
|
||||
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
|
||||
@@ -571,7 +571,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
string xmlDskTyp, xmlDskSubTyp;
|
||||
if(dev.IsCompactFlash)
|
||||
Metadata.MediaType.MediaTypeToString(MediaType.CompactFlash, out xmlDskTyp, out xmlDskSubTyp);
|
||||
else if(dev.IsPCMCIA)
|
||||
else if(dev.IsPcmcia)
|
||||
Metadata.MediaType.MediaTypeToString(MediaType.PCCardTypeI, out xmlDskTyp, out xmlDskSubTyp);
|
||||
else Metadata.MediaType.MediaTypeToString(MediaType.GENERIC_HDD, out xmlDskTyp, out xmlDskSubTyp);
|
||||
sidecar.BlockMedia[0].DiskType = xmlDskTyp;
|
||||
|
||||
@@ -36,7 +36,7 @@ using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
using DiscImageChef.CommonTypes;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.DiscImages;
|
||||
|
||||
namespace DiscImageChef.Core.Devices.Dumping
|
||||
{
|
||||
@@ -121,17 +121,17 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
#region Internal enumerations
|
||||
enum AlcoholMediumType : ushort
|
||||
{
|
||||
CD = 0x00,
|
||||
CDR = 0x01,
|
||||
CDRW = 0x02,
|
||||
DVD = 0x10,
|
||||
DVDR = 0x12
|
||||
Cd = 0x00,
|
||||
Cdr = 0x01,
|
||||
Cdrw = 0x02,
|
||||
Dvd = 0x10,
|
||||
Dvdr = 0x12
|
||||
}
|
||||
|
||||
enum AlcoholTrackMode : byte
|
||||
{
|
||||
NoData = 0x00,
|
||||
DVD = 0x02,
|
||||
Dvd = 0x02,
|
||||
Audio = 0xA9,
|
||||
Mode1 = 0xAA,
|
||||
Mode2 = 0xAB,
|
||||
@@ -205,7 +205,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
if(tracksArray[i].point >= 0xA0) continue;
|
||||
if(!trackLengths.TryGetValue(tracksArray[i].point, out uint trkLen)) continue;
|
||||
|
||||
if(tracksArray[i].mode == AlcoholTrackMode.DVD) { tracksArray[i].extraOffset = trkLen; }
|
||||
if(tracksArray[i].mode == AlcoholTrackMode.Dvd) { tracksArray[i].extraOffset = trkLen; }
|
||||
else
|
||||
{
|
||||
AlcoholTrackExtra extra = new AlcoholTrackExtra();
|
||||
@@ -272,8 +272,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
Marshal.FreeHGlobal(trkPtr);
|
||||
}
|
||||
|
||||
if(header.type == AlcoholMediumType.CD || header.type == AlcoholMediumType.CDR ||
|
||||
header.type == AlcoholMediumType.CDRW)
|
||||
if(header.type == AlcoholMediumType.Cd || header.type == AlcoholMediumType.Cdr ||
|
||||
header.type == AlcoholMediumType.Cdrw)
|
||||
{
|
||||
foreach(AlcoholTrackExtra extra in extrasArray)
|
||||
{
|
||||
@@ -331,7 +331,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
case MediaType.DVDRDL:
|
||||
case MediaType.DVDRW:
|
||||
case MediaType.DVDRWDL:
|
||||
header.type = AlcoholMediumType.DVDR;
|
||||
header.type = AlcoholMediumType.Dvdr;
|
||||
break;
|
||||
case MediaType.CD:
|
||||
case MediaType.CDDA:
|
||||
@@ -357,21 +357,21 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
case MediaType.VCDHD:
|
||||
case MediaType.GDROM:
|
||||
case MediaType.ThreeDO:
|
||||
header.type = AlcoholMediumType.CD;
|
||||
header.type = AlcoholMediumType.Cd;
|
||||
break;
|
||||
case MediaType.CDR:
|
||||
case MediaType.DDCDR:
|
||||
case MediaType.GDR:
|
||||
header.type = AlcoholMediumType.CDR;
|
||||
header.type = AlcoholMediumType.Cdr;
|
||||
break;
|
||||
case MediaType.CDRW:
|
||||
case MediaType.DDCDRW:
|
||||
case MediaType.CDMO:
|
||||
case MediaType.CDMRW:
|
||||
header.type = AlcoholMediumType.CDRW;
|
||||
header.type = AlcoholMediumType.Cdrw;
|
||||
break;
|
||||
default:
|
||||
header.type = AlcoholMediumType.DVD;
|
||||
header.type = AlcoholMediumType.Dvd;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -404,18 +404,18 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
trkArray[i].mode = AlcoholTrackMode.Audio;
|
||||
break;
|
||||
case TrackType.Data:
|
||||
trkArray[i].mode = AlcoholTrackMode.DVD;
|
||||
trkArray[i].mode = AlcoholTrackMode.Dvd;
|
||||
break;
|
||||
case TrackType.CDMode1:
|
||||
case TrackType.CdMode1:
|
||||
trkArray[i].mode = AlcoholTrackMode.Mode1;
|
||||
break;
|
||||
case TrackType.CDMode2Formless:
|
||||
case TrackType.CdMode2Formless:
|
||||
trkArray[i].mode = AlcoholTrackMode.Mode2;
|
||||
break;
|
||||
case TrackType.CDMode2Form1:
|
||||
case TrackType.CdMode2Form1:
|
||||
trkArray[i].mode = AlcoholTrackMode.Mode2F1;
|
||||
break;
|
||||
case TrackType.CDMode2Form2:
|
||||
case TrackType.CdMode2Form2:
|
||||
trkArray[i].mode = AlcoholTrackMode.Mode2F2;
|
||||
break;
|
||||
default: throw new ArgumentOutOfRangeException(nameof(mode), mode, null);
|
||||
@@ -507,12 +507,12 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
sessions = new List<AlcoholSession>(sess);
|
||||
}
|
||||
|
||||
internal void AddBCA(byte[] bca)
|
||||
internal void AddBca(byte[] bca)
|
||||
{
|
||||
this.bca = bca;
|
||||
}
|
||||
|
||||
internal void AddPFI(byte[] pfi)
|
||||
internal void AddPfi(byte[] pfi)
|
||||
{
|
||||
if(pfi.Length == 2052)
|
||||
{
|
||||
@@ -522,7 +522,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
else this.pfi = pfi;
|
||||
}
|
||||
|
||||
internal void AddDMI(byte[] dmi)
|
||||
internal void AddDmi(byte[] dmi)
|
||||
{
|
||||
if(dmi.Length == 2052)
|
||||
{
|
||||
|
||||
@@ -43,7 +43,7 @@ using Extents;
|
||||
|
||||
namespace DiscImageChef.Core.Devices.Dumping
|
||||
{
|
||||
using ImagePlugins;
|
||||
using DiscImages;
|
||||
using Metadata;
|
||||
using MediaType = CommonTypes.MediaType;
|
||||
using Session = Decoders.CD.Session;
|
||||
@@ -56,8 +56,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
ref MediaType dskType, bool separateSubchannel, ref Resume resume,
|
||||
ref DumpLog dumpLog, Alcohol120 alcohol, bool dumpLeadIn)
|
||||
{
|
||||
MHDDLog mhddLog;
|
||||
IBGLog ibgLog;
|
||||
MhddLog mhddLog;
|
||||
IbgLog ibgLog;
|
||||
bool sense = false;
|
||||
ulong blocks = 0;
|
||||
// TODO: Check subchannel support
|
||||
@@ -252,7 +252,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
return;
|
||||
}
|
||||
|
||||
ImagePlugins.Session[] sessionsForAlcohol = new ImagePlugins.Session[toc.Value.LastCompleteSession];
|
||||
DiscImages.Session[] sessionsForAlcohol = new DiscImages.Session[toc.Value.LastCompleteSession];
|
||||
for(int i = 0; i < sessionsForAlcohol.Length; i++)
|
||||
{
|
||||
sessionsForAlcohol[i].SessionSequence = (ushort)(i + 1);
|
||||
@@ -281,7 +281,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
toc.Value.TrackDescriptors.OrderBy(track => track.POINT).ToArray();
|
||||
List<TrackType> trackList = new List<TrackType>();
|
||||
long lastSector = 0;
|
||||
string lastMSF = null;
|
||||
string lastMsf = null;
|
||||
foreach(FullTOC.TrackDataDescriptor trk in sortedTracks)
|
||||
{
|
||||
if(trk.ADR == 1 || trk.ADR == 4)
|
||||
@@ -341,8 +341,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
phour = trk.PHOUR;
|
||||
}
|
||||
|
||||
if(phour > 0) lastMSF = string.Format("{3:D2}:{0:D2}:{1:D2}:{2:D2}", pmin, psec, pframe, phour);
|
||||
else lastMSF = string.Format("{0:D2}:{1:D2}:{2:D2}", pmin, psec, pframe);
|
||||
if(phour > 0) lastMsf = string.Format("{3:D2}:{0:D2}:{1:D2}:{2:D2}", pmin, psec, pframe, phour);
|
||||
else lastMsf = string.Format("{0:D2}:{1:D2}:{2:D2}", pmin, psec, pframe);
|
||||
lastSector = phour * 3600 * 75 + pmin * 60 * 75 + psec * 75 + pframe - 150;
|
||||
}
|
||||
}
|
||||
@@ -376,7 +376,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
else tracks[t - 1].EndMSF = string.Format("{0:D2}:{1:D2}:{2:D2}", pmin, psec, pframe);
|
||||
}
|
||||
|
||||
tracks[tracks.Length - 1].EndMSF = lastMSF;
|
||||
tracks[tracks.Length - 1].EndMSF = lastMsf;
|
||||
tracks[tracks.Length - 1].EndSector = lastSector;
|
||||
blocks = (ulong)(lastSector + 1);
|
||||
|
||||
@@ -399,7 +399,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
|
||||
DumpHardwareType currentTry = null;
|
||||
ExtentsULong extents = null;
|
||||
ResumeSupport.Process(true, true, blocks, dev.Manufacturer, dev.Model, dev.Serial, dev.PlatformID,
|
||||
ResumeSupport.Process(true, true, blocks, dev.Manufacturer, dev.Model, dev.Serial, dev.PlatformId,
|
||||
ref resume, ref currentTry, ref extents);
|
||||
if(currentTry == null || extents == null)
|
||||
throw new Exception("Could not process resume file, not continuing...");
|
||||
@@ -420,7 +420,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
dumpLog.WriteLine("Reading Lead-in");
|
||||
for(int leadInBlock = -150; leadInBlock < 0 && resume.NextBlock == 0; leadInBlock++)
|
||||
{
|
||||
if(dev.PlatformID == Interop.PlatformID.FreeBSD)
|
||||
if(dev.PlatformId == Interop.PlatformID.FreeBSD)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Dump-Media",
|
||||
"FreeBSD panics when reading CD Lead-in, see upstream bug #224253.");
|
||||
@@ -515,7 +515,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
dumpLog.WriteLine("Device reports {0} blocks ({1} bytes).", blocks, blocks * blockSize);
|
||||
dumpLog.WriteLine("Device can read {0} blocks at a time.", blocksToRead);
|
||||
dumpLog.WriteLine("Device reports {0} bytes per logical block.", blockSize);
|
||||
dumpLog.WriteLine("SCSI device type: {0}.", dev.SCSIType);
|
||||
dumpLog.WriteLine("SCSI device type: {0}.", dev.ScsiType);
|
||||
dumpLog.WriteLine("Media identified as {0}.", dskType);
|
||||
alcohol.SetMediaType(dskType);
|
||||
|
||||
@@ -523,8 +523,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
alcohol.SetExtension(".bin");
|
||||
DataFile subFile = null;
|
||||
if(separateSubchannel) subFile = new DataFile(outputPrefix + ".sub");
|
||||
mhddLog = new MHDDLog(outputPrefix + ".mhddlog.bin", dev, blocks, blockSize, blocksToRead);
|
||||
ibgLog = new IBGLog(outputPrefix + ".ibg", 0x0008);
|
||||
mhddLog = new MhddLog(outputPrefix + ".mhddlog.bin", dev, blocks, blockSize, blocksToRead);
|
||||
ibgLog = new IbgLog(outputPrefix + ".ibg", 0x0008);
|
||||
|
||||
dumpFile.Seek(resume.NextBlock, (ulong)sectorSize);
|
||||
if(separateSubchannel) subFile.Seek(resume.NextBlock, subSize);
|
||||
@@ -669,30 +669,30 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
resume.NextBlock = i + blocksToRead;
|
||||
}
|
||||
|
||||
ImagePlugins.TrackType trkType;
|
||||
DiscImages.TrackType trkType;
|
||||
switch(tracks[t].TrackType1)
|
||||
{
|
||||
case TrackTypeTrackType.audio:
|
||||
trkType = ImagePlugins.TrackType.Audio;
|
||||
trkType = DiscImages.TrackType.Audio;
|
||||
break;
|
||||
case TrackTypeTrackType.mode1:
|
||||
trkType = ImagePlugins.TrackType.CDMode1;
|
||||
trkType = DiscImages.TrackType.CdMode1;
|
||||
break;
|
||||
case TrackTypeTrackType.mode2:
|
||||
trkType = ImagePlugins.TrackType.CDMode2Formless;
|
||||
trkType = DiscImages.TrackType.CdMode2Formless;
|
||||
break;
|
||||
case TrackTypeTrackType.m2f1:
|
||||
trkType = ImagePlugins.TrackType.CDMode2Form1;
|
||||
trkType = DiscImages.TrackType.CdMode2Form1;
|
||||
break;
|
||||
case TrackTypeTrackType.m2f2:
|
||||
trkType = ImagePlugins.TrackType.CDMode2Form2;
|
||||
trkType = DiscImages.TrackType.CdMode2Form2;
|
||||
break;
|
||||
case TrackTypeTrackType.dvd:
|
||||
case TrackTypeTrackType.hddvd:
|
||||
case TrackTypeTrackType.bluray:
|
||||
case TrackTypeTrackType.ddcd:
|
||||
case TrackTypeTrackType.mode0:
|
||||
trkType = ImagePlugins.TrackType.Data;
|
||||
trkType = DiscImages.TrackType.Data;
|
||||
break;
|
||||
default: throw new ArgumentOutOfRangeException();
|
||||
}
|
||||
@@ -786,13 +786,13 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
{
|
||||
sense = dev.ModeSense10(out readBuffer, out senseBuf, false, ScsiModeSensePageControl.Current,
|
||||
0x01, dev.Timeout, out duration);
|
||||
if(!sense) currentMode = Decoders.SCSI.Modes.DecodeMode10(readBuffer, dev.SCSIType);
|
||||
if(!sense) currentMode = Decoders.SCSI.Modes.DecodeMode10(readBuffer, dev.ScsiType);
|
||||
}
|
||||
else currentMode = Decoders.SCSI.Modes.DecodeMode6(readBuffer, dev.SCSIType);
|
||||
else currentMode = Decoders.SCSI.Modes.DecodeMode6(readBuffer, dev.ScsiType);
|
||||
|
||||
if(currentMode.HasValue) currentModePage = currentMode.Value.Pages[0];
|
||||
|
||||
Decoders.SCSI.Modes.ModePage_01_MMC pgMMC =
|
||||
Decoders.SCSI.Modes.ModePage_01_MMC pgMmc =
|
||||
new Decoders.SCSI.Modes.ModePage_01_MMC {PS = false, ReadRetryCount = 255, Parameter = 0x20};
|
||||
Decoders.SCSI.Modes.DecodedMode md = new Decoders.SCSI.Modes.DecodedMode
|
||||
{
|
||||
@@ -803,12 +803,12 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
{
|
||||
Page = 0x01,
|
||||
Subpage = 0x00,
|
||||
PageResponse = Decoders.SCSI.Modes.EncodeModePage_01_MMC(pgMMC)
|
||||
PageResponse = Decoders.SCSI.Modes.EncodeModePage_01_MMC(pgMmc)
|
||||
}
|
||||
}
|
||||
};
|
||||
md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.SCSIType);
|
||||
md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.SCSIType);
|
||||
md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.ScsiType);
|
||||
md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.ScsiType);
|
||||
|
||||
dumpLog.WriteLine("Sending MODE SELECT to drive.");
|
||||
sense = dev.ModeSelect(md6, out senseBuf, true, false, dev.Timeout, out duration);
|
||||
@@ -828,8 +828,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
Header = new Decoders.SCSI.Modes.ModeHeader(),
|
||||
Pages = new Decoders.SCSI.Modes.ModePage[] {currentModePage.Value}
|
||||
};
|
||||
md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.SCSIType);
|
||||
md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.SCSIType);
|
||||
md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.ScsiType);
|
||||
md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.ScsiType);
|
||||
|
||||
dumpLog.WriteLine("Sending MODE SELECT to drive.");
|
||||
sense = dev.ModeSelect(md6, out senseBuf, true, false, dev.Timeout, out duration);
|
||||
|
||||
@@ -40,7 +40,7 @@ using Schemas;
|
||||
|
||||
namespace DiscImageChef.Core.Devices.Dumping
|
||||
{
|
||||
internal static class MMC
|
||||
internal static class Mmc
|
||||
{
|
||||
internal static void Dump(Device dev, string devicePath, string outputPrefix, ushort retryPasses, bool force,
|
||||
bool dumpRaw, bool persistent, bool stopOnError, ref CICMMetadataType sidecar,
|
||||
@@ -182,7 +182,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
if(dskType == MediaType.Unknown && blocks > 0)
|
||||
{
|
||||
dumpLog.WriteLine("Reading Physical Format Information");
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.PhysicalInformation, 0, dev.Timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
@@ -210,11 +210,11 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
dskType == MediaType.HDDVDRW || dskType == MediaType.HDDVDRWDL)
|
||||
{
|
||||
dumpLog.WriteLine("Reading Physical Format Information");
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.PhysicalInformation, 0, dev.Timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
alcohol.AddPFI(cmdBuf);
|
||||
alcohol.AddPfi(cmdBuf);
|
||||
if(Decoders.DVD.PFI.Decode(cmdBuf).HasValue)
|
||||
{
|
||||
tmpBuf = new byte[cmdBuf.Length - 4];
|
||||
@@ -286,7 +286,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
}
|
||||
|
||||
dumpLog.WriteLine("Reading Disc Manufacturing Information");
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DiscManufacturingInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(!sense)
|
||||
@@ -327,7 +327,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
isXbox = true;
|
||||
}
|
||||
|
||||
alcohol.AddDMI(cmdBuf);
|
||||
alcohol.AddDmi(cmdBuf);
|
||||
|
||||
if(cmdBuf.Length == 2052)
|
||||
{
|
||||
@@ -349,7 +349,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
if(dskType == MediaType.DVDDownload || dskType == MediaType.DVDROM)
|
||||
{
|
||||
dumpLog.WriteLine("Reading Lead-in Copyright Information.");
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.CopyrightInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(!sense)
|
||||
@@ -379,13 +379,13 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
if(dskType == MediaType.DVDDownload || dskType == MediaType.DVDROM || dskType == MediaType.HDDVDROM)
|
||||
{
|
||||
dumpLog.WriteLine("Reading Burst Cutting Area.");
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.BurstCuttingArea, 0, dev.Timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
tmpBuf = new byte[cmdBuf.Length - 4];
|
||||
Array.Copy(cmdBuf, 4, tmpBuf, 0, cmdBuf.Length - 4);
|
||||
alcohol.AddBCA(tmpBuf);
|
||||
alcohol.AddBca(tmpBuf);
|
||||
sidecar.OpticalDisc[0].BCA = new DumpType
|
||||
{
|
||||
Image = outputPrefix + ".bca.bin",
|
||||
@@ -401,8 +401,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
if(dskType == MediaType.DVDRAM || dskType == MediaType.HDDVDRAM)
|
||||
{
|
||||
dumpLog.WriteLine("Reading Disc Description Structure.");
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.DVDRAM_DDS, 0, dev.Timeout, out duration);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DvdramDds, 0, dev.Timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
if(Decoders.DVD.DDS.Decode(cmdBuf).HasValue)
|
||||
@@ -420,8 +420,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
}
|
||||
|
||||
dumpLog.WriteLine("Reading Spare Area Information.");
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.DVDRAM_SpareAreaInformation, 0, dev.Timeout,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DvdramSpareAreaInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(!sense)
|
||||
{
|
||||
@@ -445,7 +445,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
if(dskType == MediaType.DVDR || dskType == MediaType.DVDRW)
|
||||
{
|
||||
dumpLog.WriteLine("Reading Pre-Recorded Information.");
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.PreRecordedInfo, 0, dev.Timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
@@ -466,8 +466,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
if(dskType == MediaType.DVDR || dskType == MediaType.DVDRW || dskType == MediaType.HDDVDR)
|
||||
{
|
||||
dumpLog.WriteLine("Reading Media Identifier.");
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.DVDR_MediaIdentifier, 0, dev.Timeout,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DvdrMediaIdentifier, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(!sense)
|
||||
{
|
||||
@@ -483,8 +483,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
}
|
||||
|
||||
dumpLog.WriteLine("Reading Recordable Physical Information.");
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.DVDR_PhysicalInformation, 0, dev.Timeout,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DvdrPhysicalInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(!sense)
|
||||
{
|
||||
@@ -506,8 +506,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
dskType == MediaType.DVDPRWDL)
|
||||
{
|
||||
dumpLog.WriteLine("Reading ADdress In Pregroove.");
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.ADIP, 0, dev.Timeout, out duration);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.Adip, 0, dev.Timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
tmpBuf = new byte[cmdBuf.Length - 4];
|
||||
@@ -522,8 +522,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
}
|
||||
|
||||
dumpLog.WriteLine("Reading Disc Control Blocks.");
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.DCB, 0, dev.Timeout, out duration);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.Dcb, 0, dev.Timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
tmpBuf = new byte[cmdBuf.Length - 4];
|
||||
@@ -543,8 +543,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
if(dskType == MediaType.HDDVDROM)
|
||||
{
|
||||
dumpLog.WriteLine("Reading Lead-in Copyright Information.");
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.HDDVD_CopyrightInformation, 0, dev.Timeout,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.HddvdCopyrightInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(!sense)
|
||||
{
|
||||
@@ -566,7 +566,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
dskType == MediaType.BDRXL || dskType == MediaType.BDREXL)
|
||||
{
|
||||
dumpLog.WriteLine("Reading Disc Information.");
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.BD, 0, 0,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
MmcDiscStructureFormat.DiscInformation, 0, dev.Timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
@@ -585,8 +585,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
}
|
||||
|
||||
dumpLog.WriteLine("Reading PAC.");
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.BD, 0, 0,
|
||||
MmcDiscStructureFormat.PAC, 0, dev.Timeout, out duration);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
MmcDiscStructureFormat.Pac, 0, dev.Timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
tmpBuf = new byte[cmdBuf.Length - 4];
|
||||
@@ -606,13 +606,13 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
if(dskType == MediaType.BDROM)
|
||||
{
|
||||
dumpLog.WriteLine("Reading Burst Cutting Area.");
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.BD, 0, 0,
|
||||
MmcDiscStructureFormat.BD_BurstCuttingArea, 0, dev.Timeout, out duration);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
MmcDiscStructureFormat.BdBurstCuttingArea, 0, dev.Timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
tmpBuf = new byte[cmdBuf.Length - 4];
|
||||
Array.Copy(cmdBuf, 4, tmpBuf, 0, cmdBuf.Length - 4);
|
||||
alcohol.AddBCA(tmpBuf);
|
||||
alcohol.AddBca(tmpBuf);
|
||||
sidecar.OpticalDisc[0].BCA = new DumpType
|
||||
{
|
||||
Image = outputPrefix + ".bca.bin",
|
||||
@@ -629,8 +629,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
dskType == MediaType.BDREXL)
|
||||
{
|
||||
dumpLog.WriteLine("Reading Disc Definition Structure.");
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.BD, 0, 0,
|
||||
MmcDiscStructureFormat.BD_DDS, 0, dev.Timeout, out duration);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
MmcDiscStructureFormat.BdDds, 0, dev.Timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
tmpBuf = new byte[cmdBuf.Length - 4];
|
||||
@@ -645,8 +645,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
}
|
||||
|
||||
dumpLog.WriteLine("Reading Spare Area Information.");
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.BD, 0, 0,
|
||||
MmcDiscStructureFormat.BD_SpareAreaInformation, 0, dev.Timeout,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
MmcDiscStructureFormat.BdSpareAreaInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(!sense)
|
||||
{
|
||||
@@ -665,12 +665,12 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
|
||||
if(isXbox)
|
||||
{
|
||||
XGD.Dump(dev, devicePath, outputPrefix, retryPasses, force, dumpRaw, persistent, stopOnError,
|
||||
Xgd.Dump(dev, devicePath, outputPrefix, retryPasses, force, dumpRaw, persistent, stopOnError,
|
||||
ref sidecar, ref dskType, ref resume, ref dumpLog, encoding);
|
||||
return;
|
||||
}
|
||||
|
||||
SBC.Dump(dev, devicePath, outputPrefix, retryPasses, force, dumpRaw, persistent, stopOnError, ref sidecar,
|
||||
Sbc.Dump(dev, devicePath, outputPrefix, retryPasses, force, dumpRaw, persistent, stopOnError, ref sidecar,
|
||||
ref dskType, true, ref resume, ref dumpLog, encoding, alcohol);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ using DiscImageChef.Core.Logging;
|
||||
|
||||
namespace DiscImageChef.Core.Devices.Dumping
|
||||
{
|
||||
public static class NVMe
|
||||
public static class NvMe
|
||||
{
|
||||
public static void Dump(Device dev, string devicePath, string outputPrefix, ushort retryPasses, bool force,
|
||||
bool dumpRaw, bool persistent, bool stopOnError, ref Metadata.Resume resume,
|
||||
|
||||
@@ -40,8 +40,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
{
|
||||
static class ResumeSupport
|
||||
{
|
||||
internal static void Process(bool isLba, bool removable, ulong blocks, string Manufacturer, string Model,
|
||||
string Serial, Interop.PlatformID platform, ref Resume resume,
|
||||
internal static void Process(bool isLba, bool removable, ulong blocks, string manufacturer, string model,
|
||||
string serial, Interop.PlatformID platform, ref Resume resume,
|
||||
ref DumpHardwareType currentTry, ref ExtentsULong extents)
|
||||
{
|
||||
if(resume != null)
|
||||
@@ -61,20 +61,20 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
|
||||
foreach(DumpHardwareType oldtry in resume.Tries)
|
||||
{
|
||||
if(oldtry.Manufacturer != Manufacturer && !removable)
|
||||
if(oldtry.Manufacturer != manufacturer && !removable)
|
||||
throw new
|
||||
Exception(string.Format("Resume file specifies a device manufactured by {0} but you're requesting to dump one by {1}, not continuing...",
|
||||
oldtry.Manufacturer, Manufacturer));
|
||||
oldtry.Manufacturer, manufacturer));
|
||||
|
||||
if(oldtry.Model != Model && !removable)
|
||||
if(oldtry.Model != model && !removable)
|
||||
throw new
|
||||
Exception(string.Format("Resume file specifies a device model {0} but you're requesting to dump model {1}, not continuing...",
|
||||
oldtry.Model, Model));
|
||||
oldtry.Model, model));
|
||||
|
||||
if(oldtry.Serial != Serial && !removable)
|
||||
if(oldtry.Serial != serial && !removable)
|
||||
throw new
|
||||
Exception(string.Format("Resume file specifies a device with serial {0} but you're requesting to dump one with serial {1}, not continuing...",
|
||||
oldtry.Serial, Serial));
|
||||
oldtry.Serial, serial));
|
||||
|
||||
if(oldtry.Software == null) throw new Exception("Found corrupt resume file, cannot continue...");
|
||||
|
||||
@@ -82,8 +82,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
oldtry.Software.OperatingSystem == platform.ToString() &&
|
||||
oldtry.Software.Version == Version.GetVersion())
|
||||
{
|
||||
if(removable && (oldtry.Manufacturer != Manufacturer || oldtry.Model != Model ||
|
||||
oldtry.Serial != Serial)) continue;
|
||||
if(removable && (oldtry.Manufacturer != manufacturer || oldtry.Model != model ||
|
||||
oldtry.Serial != serial)) continue;
|
||||
|
||||
currentTry = oldtry;
|
||||
extents = ExtentsConverter.FromMetadata(currentTry.Extents);
|
||||
@@ -96,9 +96,9 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
currentTry = new DumpHardwareType
|
||||
{
|
||||
Software = Version.GetSoftwareType(platform),
|
||||
Manufacturer = Manufacturer,
|
||||
Model = Model,
|
||||
Serial = Serial,
|
||||
Manufacturer = manufacturer,
|
||||
Model = model,
|
||||
Serial = serial,
|
||||
};
|
||||
resume.Tries.Add(currentTry);
|
||||
extents = new ExtentsULong();
|
||||
@@ -116,9 +116,9 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
currentTry = new DumpHardwareType
|
||||
{
|
||||
Software = Version.GetSoftwareType(platform),
|
||||
Manufacturer = Manufacturer,
|
||||
Model = Model,
|
||||
Serial = Serial
|
||||
Manufacturer = manufacturer,
|
||||
Model = model,
|
||||
Serial = serial
|
||||
};
|
||||
resume.Tries.Add(currentTry);
|
||||
extents = new ExtentsULong();
|
||||
|
||||
@@ -40,24 +40,24 @@ using DiscImageChef.Core.Logging;
|
||||
using DiscImageChef.Devices;
|
||||
using DiscImageChef.Filesystems;
|
||||
using DiscImageChef.Filters;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.PartPlugins;
|
||||
using DiscImageChef.DiscImages;
|
||||
using DiscImageChef.Partitions;
|
||||
using Schemas;
|
||||
using Extents;
|
||||
|
||||
namespace DiscImageChef.Core.Devices.Dumping
|
||||
{
|
||||
using TrackType = ImagePlugins.TrackType;
|
||||
using TrackType = DiscImages.TrackType;
|
||||
|
||||
internal static class SBC
|
||||
internal static class Sbc
|
||||
{
|
||||
internal static void Dump(Device dev, string devicePath, string outputPrefix, ushort retryPasses, bool force,
|
||||
bool dumpRaw, bool persistent, bool stopOnError, ref CICMMetadataType sidecar,
|
||||
ref MediaType dskType, bool opticalDisc, ref Metadata.Resume resume,
|
||||
ref DumpLog dumpLog, Encoding encoding, Alcohol120 alcohol = null)
|
||||
{
|
||||
MHDDLog mhddLog;
|
||||
IBGLog ibgLog;
|
||||
MhddLog mhddLog;
|
||||
IbgLog ibgLog;
|
||||
byte[] cmdBuf = null;
|
||||
byte[] senseBuf = null;
|
||||
bool sense = false;
|
||||
@@ -122,10 +122,10 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
}
|
||||
|
||||
if(dskType == MediaType.Unknown)
|
||||
dskType = MediaTypeFromSCSI.Get((byte)dev.SCSIType, dev.Manufacturer, dev.Model, scsiMediumType,
|
||||
dskType = MediaTypeFromScsi.Get((byte)dev.ScsiType, dev.Manufacturer, dev.Model, scsiMediumType,
|
||||
scsiDensityCode, blocks, blockSize);
|
||||
|
||||
if(dskType == MediaType.Unknown && dev.IsUSB && containsFloppyPage) dskType = MediaType.FlashDrive;
|
||||
if(dskType == MediaType.Unknown && dev.IsUsb && containsFloppyPage) dskType = MediaType.FlashDrive;
|
||||
|
||||
DicConsole.WriteLine("Media identified as {0}", dskType);
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
dumpLog.WriteLine("Device can read {0} blocks at a time.", blocksToRead);
|
||||
dumpLog.WriteLine("Device reports {0} bytes per logical block.", blockSize);
|
||||
dumpLog.WriteLine("Device reports {0} bytes per physical block.", scsiReader.LongBlockSize);
|
||||
dumpLog.WriteLine("SCSI device type: {0}.", dev.SCSIType);
|
||||
dumpLog.WriteLine("SCSI device type: {0}.", dev.ScsiType);
|
||||
dumpLog.WriteLine("SCSI medium type: {0}.", scsiMediumType);
|
||||
dumpLog.WriteLine("SCSI density type: {0}.", scsiDensityCode);
|
||||
dumpLog.WriteLine("SCSI floppy mode page present: {0}.", containsFloppyPage);
|
||||
@@ -145,23 +145,23 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
sidecar.BlockMedia[0] = new BlockMediaType();
|
||||
|
||||
// All USB flash drives report as removable, even if the media is not removable
|
||||
if(!dev.IsRemovable || dev.IsUSB)
|
||||
if(!dev.IsRemovable || dev.IsUsb)
|
||||
{
|
||||
if(dev.IsUSB)
|
||||
if(dev.IsUsb)
|
||||
{
|
||||
dumpLog.WriteLine("Reading USB descriptors.");
|
||||
sidecar.BlockMedia[0].USB = new USBType
|
||||
{
|
||||
ProductID = dev.USBProductID,
|
||||
VendorID = dev.USBVendorID,
|
||||
ProductID = dev.UsbProductId,
|
||||
VendorID = dev.UsbVendorId,
|
||||
Descriptors = new DumpType()
|
||||
{
|
||||
Image = outputPrefix + ".usbdescriptors.bin",
|
||||
Size = dev.USBDescriptors.Length,
|
||||
Checksums = Checksum.GetChecksums(dev.USBDescriptors).ToArray()
|
||||
Size = dev.UsbDescriptors.Length,
|
||||
Checksums = Checksum.GetChecksums(dev.UsbDescriptors).ToArray()
|
||||
}
|
||||
};
|
||||
DataFile.WriteTo("SCSI Dump", sidecar.BlockMedia[0].USB.Descriptors.Image, dev.USBDescriptors);
|
||||
DataFile.WriteTo("SCSI Dump", sidecar.BlockMedia[0].USB.Descriptors.Image, dev.UsbDescriptors);
|
||||
}
|
||||
|
||||
if(dev.Type == DeviceType.ATAPI)
|
||||
@@ -242,9 +242,9 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
|
||||
if(!sense && !dev.Error)
|
||||
{
|
||||
if(Decoders.SCSI.Modes.DecodeMode10(cmdBuf, dev.SCSIType).HasValue)
|
||||
if(Decoders.SCSI.Modes.DecodeMode10(cmdBuf, dev.ScsiType).HasValue)
|
||||
{
|
||||
decMode = Decoders.SCSI.Modes.DecodeMode10(cmdBuf, dev.SCSIType);
|
||||
decMode = Decoders.SCSI.Modes.DecodeMode10(cmdBuf, dev.ScsiType);
|
||||
sidecar.BlockMedia[0].SCSI.ModeSense10 = new DumpType
|
||||
{
|
||||
Image = outputPrefix + ".modesense10.bin",
|
||||
@@ -265,9 +265,9 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
|
||||
if(!sense && !dev.Error)
|
||||
{
|
||||
if(Decoders.SCSI.Modes.DecodeMode6(cmdBuf, dev.SCSIType).HasValue)
|
||||
if(Decoders.SCSI.Modes.DecodeMode6(cmdBuf, dev.ScsiType).HasValue)
|
||||
{
|
||||
decMode = Decoders.SCSI.Modes.DecodeMode6(cmdBuf, dev.SCSIType);
|
||||
decMode = Decoders.SCSI.Modes.DecodeMode6(cmdBuf, dev.ScsiType);
|
||||
sidecar.BlockMedia[0].SCSI.ModeSense = new DumpType
|
||||
{
|
||||
Image = outputPrefix + ".modesense.bin",
|
||||
@@ -336,8 +336,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
|
||||
string outputExtension = ".bin";
|
||||
if(opticalDisc && blockSize == 2048) outputExtension = ".iso";
|
||||
mhddLog = new MHDDLog(outputPrefix + ".mhddlog.bin", dev, blocks, blockSize, blocksToRead);
|
||||
ibgLog = new IBGLog(outputPrefix + ".ibg", currentProfile);
|
||||
mhddLog = new MhddLog(outputPrefix + ".mhddlog.bin", dev, blocks, blockSize, blocksToRead);
|
||||
ibgLog = new IbgLog(outputPrefix + ".ibg", currentProfile);
|
||||
dumpFile = new DataFile(outputPrefix + outputExtension);
|
||||
|
||||
start = DateTime.UtcNow;
|
||||
@@ -356,7 +356,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
DumpHardwareType currentTry = null;
|
||||
ExtentsULong extents = null;
|
||||
ResumeSupport.Process(true, dev.IsRemovable, blocks, dev.Manufacturer, dev.Model, dev.Serial,
|
||||
dev.PlatformID, ref resume, ref currentTry, ref extents);
|
||||
dev.PlatformId, ref resume, ref currentTry, ref extents);
|
||||
if(currentTry == null || extents == null)
|
||||
throw new Exception("Could not process resume file, not continuing...");
|
||||
|
||||
@@ -483,15 +483,15 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
{
|
||||
sense = dev.ModeSense10(out readBuffer, out senseBuf, false, ScsiModeSensePageControl.Current,
|
||||
0x01, dev.Timeout, out duration);
|
||||
if(!sense) currentMode = Decoders.SCSI.Modes.DecodeMode10(readBuffer, dev.SCSIType);
|
||||
if(!sense) currentMode = Decoders.SCSI.Modes.DecodeMode10(readBuffer, dev.ScsiType);
|
||||
}
|
||||
else currentMode = Decoders.SCSI.Modes.DecodeMode6(readBuffer, dev.SCSIType);
|
||||
else currentMode = Decoders.SCSI.Modes.DecodeMode6(readBuffer, dev.ScsiType);
|
||||
|
||||
if(currentMode.HasValue) currentModePage = currentMode.Value.Pages[0];
|
||||
|
||||
if(dev.SCSIType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
||||
if(dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
||||
{
|
||||
Decoders.SCSI.Modes.ModePage_01_MMC pgMMC =
|
||||
Decoders.SCSI.Modes.ModePage_01_MMC pgMmc =
|
||||
new Decoders.SCSI.Modes.ModePage_01_MMC
|
||||
{
|
||||
PS = false,
|
||||
@@ -507,12 +507,12 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
{
|
||||
Page = 0x01,
|
||||
Subpage = 0x00,
|
||||
PageResponse = Decoders.SCSI.Modes.EncodeModePage_01_MMC(pgMMC)
|
||||
PageResponse = Decoders.SCSI.Modes.EncodeModePage_01_MMC(pgMmc)
|
||||
}
|
||||
}
|
||||
};
|
||||
md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.SCSIType);
|
||||
md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.SCSIType);
|
||||
md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.ScsiType);
|
||||
md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.ScsiType);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -542,8 +542,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
}
|
||||
}
|
||||
};
|
||||
md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.SCSIType);
|
||||
md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.SCSIType);
|
||||
md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.ScsiType);
|
||||
md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.ScsiType);
|
||||
}
|
||||
|
||||
dumpLog.WriteLine("Sending MODE SELECT to drive.");
|
||||
@@ -564,8 +564,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
Header = new Decoders.SCSI.Modes.ModeHeader(),
|
||||
Pages = new Decoders.SCSI.Modes.ModePage[] {currentModePage.Value}
|
||||
};
|
||||
md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.SCSIType);
|
||||
md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.SCSIType);
|
||||
md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.ScsiType);
|
||||
md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.ScsiType);
|
||||
|
||||
dumpLog.WriteLine("Sending MODE SELECT to drive.");
|
||||
sense = dev.ModeSelect(md6, out senseBuf, true, false, dev.Timeout, out duration);
|
||||
@@ -619,7 +619,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
|
||||
PluginBase plugins = new PluginBase();
|
||||
plugins.RegisterAllPlugins(encoding);
|
||||
ImagePlugin _imageFormat;
|
||||
ImagePlugin imageFormat;
|
||||
FiltersList filtersList = new FiltersList();
|
||||
Filter inputFilter = filtersList.GetFilter(outputPrefix + outputExtension);
|
||||
|
||||
@@ -629,16 +629,16 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
return;
|
||||
}
|
||||
|
||||
_imageFormat = ImageFormat.Detect(inputFilter);
|
||||
imageFormat = ImageFormat.Detect(inputFilter);
|
||||
PartitionType[] xmlFileSysInfo = null;
|
||||
|
||||
try { if(!_imageFormat.OpenImage(inputFilter)) _imageFormat = null; }
|
||||
catch { _imageFormat = null; }
|
||||
try { if(!imageFormat.OpenImage(inputFilter)) imageFormat = null; }
|
||||
catch { imageFormat = null; }
|
||||
|
||||
if(_imageFormat != null)
|
||||
if(imageFormat != null)
|
||||
{
|
||||
dumpLog.WriteLine("Getting partitions.");
|
||||
List<Partition> partitions = Partitions.GetAll(_imageFormat);
|
||||
List<Partition> partitions = Partitions.GetAll(imageFormat);
|
||||
Partitions.AddSchemesToStats(partitions);
|
||||
dumpLog.WriteLine("Found {0} partitions.", partitions.Count);
|
||||
|
||||
@@ -661,22 +661,22 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
i, partitions[i].Start, partitions[i].End, partitions[i].Type,
|
||||
partitions[i].Scheme);
|
||||
|
||||
foreach(Filesystem _plugin in plugins.PluginsList.Values)
|
||||
foreach(Filesystem plugin in plugins.PluginsList.Values)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(_plugin.Identify(_imageFormat, partitions[i]))
|
||||
if(plugin.Identify(imageFormat, partitions[i]))
|
||||
{
|
||||
_plugin.GetInformation(_imageFormat, partitions[i], out string foo);
|
||||
lstFs.Add(_plugin.XmlFSType);
|
||||
Statistics.AddFilesystem(_plugin.XmlFSType.Type);
|
||||
dumpLog.WriteLine("Filesystem {0} found.", _plugin.XmlFSType.Type);
|
||||
plugin.GetInformation(imageFormat, partitions[i], out string foo);
|
||||
lstFs.Add(plugin.XmlFSType);
|
||||
Statistics.AddFilesystem(plugin.XmlFSType.Type);
|
||||
dumpLog.WriteLine("Filesystem {0} found.", plugin.XmlFSType.Type);
|
||||
|
||||
if(_plugin.XmlFSType.Type == "Opera") dskType = MediaType.ThreeDO;
|
||||
if(_plugin.XmlFSType.Type == "PC Engine filesystem")
|
||||
if(plugin.XmlFSType.Type == "Opera") dskType = MediaType.ThreeDO;
|
||||
if(plugin.XmlFSType.Type == "PC Engine filesystem")
|
||||
dskType = MediaType.SuperCDROM2;
|
||||
if(_plugin.XmlFSType.Type == "Nintendo Wii filesystem") dskType = MediaType.WOD;
|
||||
if(_plugin.XmlFSType.Type == "Nintendo Gamecube filesystem")
|
||||
if(plugin.XmlFSType.Type == "Nintendo Wii filesystem") dskType = MediaType.WOD;
|
||||
if(plugin.XmlFSType.Type == "Nintendo Gamecube filesystem")
|
||||
dskType = MediaType.GOD;
|
||||
}
|
||||
}
|
||||
@@ -701,21 +701,21 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
Partition wholePart =
|
||||
new Partition {Name = "Whole device", Length = blocks, Size = blocks * blockSize};
|
||||
|
||||
foreach(Filesystem _plugin in plugins.PluginsList.Values)
|
||||
foreach(Filesystem plugin in plugins.PluginsList.Values)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(_plugin.Identify(_imageFormat, wholePart))
|
||||
if(plugin.Identify(imageFormat, wholePart))
|
||||
{
|
||||
_plugin.GetInformation(_imageFormat, wholePart, out string foo);
|
||||
lstFs.Add(_plugin.XmlFSType);
|
||||
Statistics.AddFilesystem(_plugin.XmlFSType.Type);
|
||||
dumpLog.WriteLine("Filesystem {0} found.", _plugin.XmlFSType.Type);
|
||||
plugin.GetInformation(imageFormat, wholePart, out string foo);
|
||||
lstFs.Add(plugin.XmlFSType);
|
||||
Statistics.AddFilesystem(plugin.XmlFSType.Type);
|
||||
dumpLog.WriteLine("Filesystem {0} found.", plugin.XmlFSType.Type);
|
||||
|
||||
if(_plugin.XmlFSType.Type == "Opera") dskType = MediaType.ThreeDO;
|
||||
if(_plugin.XmlFSType.Type == "PC Engine filesystem") dskType = MediaType.SuperCDROM2;
|
||||
if(_plugin.XmlFSType.Type == "Nintendo Wii filesystem") dskType = MediaType.WOD;
|
||||
if(_plugin.XmlFSType.Type == "Nintendo Gamecube filesystem") dskType = MediaType.GOD;
|
||||
if(plugin.XmlFSType.Type == "Opera") dskType = MediaType.ThreeDO;
|
||||
if(plugin.XmlFSType.Type == "PC Engine filesystem") dskType = MediaType.SuperCDROM2;
|
||||
if(plugin.XmlFSType.Type == "Nintendo Wii filesystem") dskType = MediaType.WOD;
|
||||
if(plugin.XmlFSType.Type == "Nintendo Gamecube filesystem") dskType = MediaType.GOD;
|
||||
}
|
||||
}
|
||||
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
|
||||
@@ -819,10 +819,10 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
format = "Raw disk image (sector by sector copy)",
|
||||
Value = outputPrefix + ".bin"
|
||||
};
|
||||
if(!dev.IsRemovable || dev.IsUSB)
|
||||
if(!dev.IsRemovable || dev.IsUsb)
|
||||
{
|
||||
if(dev.Type == DeviceType.ATAPI) sidecar.BlockMedia[0].Interface = "ATAPI";
|
||||
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 sidecar.BlockMedia[0].Interface = "SCSI";
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ using Schemas;
|
||||
|
||||
namespace DiscImageChef.Core.Devices.Dumping
|
||||
{
|
||||
public class SCSI
|
||||
public class Scsi
|
||||
{
|
||||
// TODO: Get cartridge serial number from Certance vendor EVPD
|
||||
public static void Dump(Device dev, string devicePath, string outputPrefix, ushort retryPasses, bool force,
|
||||
@@ -173,22 +173,22 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
|
||||
CICMMetadataType sidecar = new CICMMetadataType();
|
||||
|
||||
if(dev.SCSIType == Decoders.SCSI.PeripheralDeviceTypes.SequentialAccess)
|
||||
if(dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.SequentialAccess)
|
||||
{
|
||||
if(dumpRaw) throw new ArgumentException("Tapes cannot be dumped raw.");
|
||||
|
||||
SSC.Dump(dev, outputPrefix, devicePath, ref sidecar, ref resume, ref dumpLog);
|
||||
Ssc.Dump(dev, outputPrefix, devicePath, ref sidecar, ref resume, ref dumpLog);
|
||||
return;
|
||||
}
|
||||
|
||||
if(dev.SCSIType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
||||
if(dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
||||
{
|
||||
MMC.Dump(dev, devicePath, outputPrefix, retryPasses, force, dumpRaw, persistent, stopOnError,
|
||||
Mmc.Dump(dev, devicePath, outputPrefix, retryPasses, force, dumpRaw, persistent, stopOnError,
|
||||
ref sidecar, ref dskType, separateSubchannel, ref resume, ref dumpLog, dumpLeadIn, encoding);
|
||||
return;
|
||||
}
|
||||
|
||||
SBC.Dump(dev, devicePath, outputPrefix, retryPasses, force, dumpRaw, persistent, stopOnError, ref sidecar,
|
||||
Sbc.Dump(dev, devicePath, outputPrefix, retryPasses, force, dumpRaw, persistent, stopOnError, ref sidecar,
|
||||
ref dskType, false, ref resume, ref dumpLog, encoding);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,15 +42,15 @@ using Schemas;
|
||||
|
||||
namespace DiscImageChef.Core.Devices.Dumping
|
||||
{
|
||||
internal static class SSC
|
||||
internal static class Ssc
|
||||
{
|
||||
internal static void Dump(Device dev, string outputPrefix, string devicePath, ref CICMMetadataType sidecar,
|
||||
ref Metadata.Resume resume, ref DumpLog dumpLog)
|
||||
{
|
||||
Decoders.SCSI.FixedSense? fxSense;
|
||||
bool aborted;
|
||||
MHDDLog mhddLog;
|
||||
IBGLog ibgLog;
|
||||
MhddLog mhddLog;
|
||||
IbgLog ibgLog;
|
||||
bool sense = false;
|
||||
ulong blocks = 0;
|
||||
uint blockSize = 0;
|
||||
@@ -226,9 +226,9 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
|
||||
if(!sense && !dev.Error)
|
||||
{
|
||||
if(Decoders.SCSI.Modes.DecodeMode10(cmdBuf, dev.SCSIType).HasValue)
|
||||
if(Decoders.SCSI.Modes.DecodeMode10(cmdBuf, dev.ScsiType).HasValue)
|
||||
{
|
||||
decMode = Decoders.SCSI.Modes.DecodeMode10(cmdBuf, dev.SCSIType);
|
||||
decMode = Decoders.SCSI.Modes.DecodeMode10(cmdBuf, dev.ScsiType);
|
||||
sidecar.BlockMedia[0].SCSI.ModeSense10 = new DumpType
|
||||
{
|
||||
Image = outputPrefix + ".modesense10.bin",
|
||||
@@ -249,9 +249,9 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
|
||||
if(!sense && !dev.Error)
|
||||
{
|
||||
if(Decoders.SCSI.Modes.DecodeMode6(cmdBuf, dev.SCSIType).HasValue)
|
||||
if(Decoders.SCSI.Modes.DecodeMode6(cmdBuf, dev.ScsiType).HasValue)
|
||||
{
|
||||
decMode = Decoders.SCSI.Modes.DecodeMode6(cmdBuf, dev.SCSIType);
|
||||
decMode = Decoders.SCSI.Modes.DecodeMode6(cmdBuf, dev.ScsiType);
|
||||
sidecar.BlockMedia[0].SCSI.ModeSense = new DumpType
|
||||
{
|
||||
Image = outputPrefix + ".modesense.bin",
|
||||
@@ -274,12 +274,12 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
else blockSize = 1;
|
||||
|
||||
if(dskType == MediaType.Unknown)
|
||||
dskType = MediaTypeFromSCSI.Get((byte)dev.SCSIType, dev.Manufacturer, dev.Model, scsiMediumTypeTape,
|
||||
dskType = MediaTypeFromScsi.Get((byte)dev.ScsiType, dev.Manufacturer, dev.Model, scsiMediumTypeTape,
|
||||
scsiDensityCodeTape, blocks, blockSize);
|
||||
|
||||
DicConsole.WriteLine("Media identified as {0}", dskType);
|
||||
|
||||
dumpLog.WriteLine("SCSI device type: {0}.", dev.SCSIType);
|
||||
dumpLog.WriteLine("SCSI device type: {0}.", dev.ScsiType);
|
||||
dumpLog.WriteLine("SCSI medium type: {0}.", scsiMediumTypeTape);
|
||||
dumpLog.WriteLine("SCSI density type: {0}.", scsiDensityCodeTape);
|
||||
dumpLog.WriteLine("Media identified as {0}.", dskType);
|
||||
@@ -383,8 +383,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
DataFile dumpFile = new DataFile(outputPrefix + ".bin");
|
||||
dataChk = new Checksum();
|
||||
start = DateTime.UtcNow;
|
||||
mhddLog = new MHDDLog(outputPrefix + ".mhddlog.bin", dev, blocks, blockSize, 1);
|
||||
ibgLog = new IBGLog(outputPrefix + ".ibg", 0x0008);
|
||||
mhddLog = new MhddLog(outputPrefix + ".mhddlog.bin", dev, blocks, blockSize, 1);
|
||||
ibgLog = new IbgLog(outputPrefix + ".ibg", 0x0008);
|
||||
|
||||
currentTapeFile = new TapeFileType
|
||||
{
|
||||
@@ -664,7 +664,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
sidecar.BlockMedia[0].DumpHardwareArray[0].Model = dev.Model;
|
||||
sidecar.BlockMedia[0].DumpHardwareArray[0].Revision = dev.Revision;
|
||||
sidecar.BlockMedia[0].DumpHardwareArray[0].Serial = dev.Serial;
|
||||
sidecar.BlockMedia[0].DumpHardwareArray[0].Software = Version.GetSoftwareType(dev.PlatformID);
|
||||
sidecar.BlockMedia[0].DumpHardwareArray[0].Software = Version.GetSoftwareType(dev.PlatformId);
|
||||
sidecar.BlockMedia[0].TapeInformation = partitions.ToArray();
|
||||
|
||||
if(!aborted)
|
||||
|
||||
@@ -41,7 +41,7 @@ using DiscImageChef.Decoders.MMC;
|
||||
using DiscImageChef.Devices;
|
||||
using DiscImageChef.Filesystems;
|
||||
using DiscImageChef.Filters;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.DiscImages;
|
||||
using Extents;
|
||||
using Schemas;
|
||||
|
||||
@@ -54,8 +54,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
ref DumpLog dumpLog, Encoding encoding)
|
||||
{
|
||||
bool aborted;
|
||||
MHDDLog mhddLog;
|
||||
IBGLog ibgLog;
|
||||
MhddLog mhddLog;
|
||||
IbgLog ibgLog;
|
||||
|
||||
if(dumpRaw)
|
||||
{
|
||||
@@ -95,7 +95,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
CSD csdDecoded = new CSD();
|
||||
|
||||
dumpLog.WriteLine("Reading Extended CSD");
|
||||
sense = dev.ReadExtendedCSD(out ecsd, out response, timeout, out duration);
|
||||
sense = dev.ReadExtendedCsd(out ecsd, out response, timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
ecsdDecoded = Decoders.MMC.Decoders.DecodeExtendedCSD(ecsd);
|
||||
@@ -110,7 +110,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
else ecsd = null;
|
||||
|
||||
dumpLog.WriteLine("Reading CSD");
|
||||
sense = dev.ReadCSD(out csd, out response, timeout, out duration);
|
||||
sense = dev.ReadCsd(out csd, out response, timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
if(blocks == 0)
|
||||
@@ -123,7 +123,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
else csd = null;
|
||||
|
||||
dumpLog.WriteLine("Reading OCR");
|
||||
sense = dev.ReadOCR(out ocr, out response, timeout, out duration);
|
||||
sense = dev.ReadOcr(out ocr, out response, timeout, out duration);
|
||||
if(sense) ocr = null;
|
||||
|
||||
sidecar.BlockMedia[0].MultiMediaCard = new MultiMediaCardType();
|
||||
@@ -133,7 +133,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
Decoders.SecureDigital.CSD csdDecoded = new Decoders.SecureDigital.CSD();
|
||||
|
||||
dumpLog.WriteLine("Reading CSD");
|
||||
sense = dev.ReadCSD(out csd, out response, timeout, out duration);
|
||||
sense = dev.ReadCsd(out csd, out response, timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
csdDecoded = Decoders.SecureDigital.Decoders.DecodeCSD(csd);
|
||||
@@ -147,18 +147,18 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
else csd = null;
|
||||
|
||||
dumpLog.WriteLine("Reading OCR");
|
||||
sense = dev.ReadSDOCR(out ocr, out response, timeout, out duration);
|
||||
sense = dev.ReadSdocr(out ocr, out response, timeout, out duration);
|
||||
if(sense) ocr = null;
|
||||
|
||||
dumpLog.WriteLine("Reading SCR");
|
||||
sense = dev.ReadSCR(out scr, out response, timeout, out duration);
|
||||
sense = dev.ReadScr(out scr, out response, timeout, out duration);
|
||||
if(sense) scr = null;
|
||||
|
||||
sidecar.BlockMedia[0].SecureDigital = new SecureDigitalType();
|
||||
}
|
||||
|
||||
dumpLog.WriteLine("Reading CID");
|
||||
sense = dev.ReadCID(out cid, out response, timeout, out duration);
|
||||
sense = dev.ReadCid(out cid, out response, timeout, out duration);
|
||||
if(sense) cid = null;
|
||||
|
||||
DumpType cidDump = null;
|
||||
@@ -283,15 +283,15 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
|
||||
DumpHardwareType currentTry = null;
|
||||
ExtentsULong extents = null;
|
||||
ResumeSupport.Process(true, false, blocks, dev.Manufacturer, dev.Model, dev.Serial, dev.PlatformID,
|
||||
ResumeSupport.Process(true, false, blocks, dev.Manufacturer, dev.Model, dev.Serial, dev.PlatformId,
|
||||
ref resume, ref currentTry, ref extents);
|
||||
if(currentTry == null || extents == null)
|
||||
throw new Exception("Could not process resume file, not continuing...");
|
||||
|
||||
DicConsole.WriteLine("Reading {0} sectors at a time.", blocksToRead);
|
||||
|
||||
mhddLog = new MHDDLog(outputPrefix + ".mhddlog.bin", dev, blocks, blockSize, blocksToRead);
|
||||
ibgLog = new IBGLog(outputPrefix + ".ibg", currentProfile);
|
||||
mhddLog = new MhddLog(outputPrefix + ".mhddlog.bin", dev, blocks, blockSize, blocksToRead);
|
||||
ibgLog = new IbgLog(outputPrefix + ".ibg", currentProfile);
|
||||
dumpFile = new DataFile(outputPrefix + ".bin");
|
||||
dumpFile.Seek(resume.NextBlock, blockSize);
|
||||
if(resume.NextBlock > 0) dumpLog.WriteLine("Resuming from block {0}.", resume.NextBlock);
|
||||
@@ -445,7 +445,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
|
||||
PluginBase plugins = new PluginBase();
|
||||
plugins.RegisterAllPlugins(encoding);
|
||||
ImagePlugin _imageFormat;
|
||||
ImagePlugin imageFormat;
|
||||
|
||||
FiltersList filtersList = new FiltersList();
|
||||
Filter inputFilter = filtersList.GetFilter(outputPrefix + ".bin");
|
||||
@@ -456,16 +456,16 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
return;
|
||||
}
|
||||
|
||||
_imageFormat = ImageFormat.Detect(inputFilter);
|
||||
imageFormat = ImageFormat.Detect(inputFilter);
|
||||
PartitionType[] xmlFileSysInfo = null;
|
||||
|
||||
try { if(!_imageFormat.OpenImage(inputFilter)) _imageFormat = null; }
|
||||
catch { _imageFormat = null; }
|
||||
try { if(!imageFormat.OpenImage(inputFilter)) imageFormat = null; }
|
||||
catch { imageFormat = null; }
|
||||
|
||||
if(_imageFormat != null)
|
||||
if(imageFormat != null)
|
||||
{
|
||||
dumpLog.WriteLine("Getting partitions.");
|
||||
List<Partition> partitions = Partitions.GetAll(_imageFormat);
|
||||
List<Partition> partitions = Partitions.GetAll(imageFormat);
|
||||
Partitions.AddSchemesToStats(partitions);
|
||||
dumpLog.WriteLine("Found {0} partitions.", partitions.Count);
|
||||
|
||||
@@ -488,16 +488,16 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
i, partitions[i].Start, partitions[i].End, partitions[i].Type,
|
||||
partitions[i].Scheme);
|
||||
|
||||
foreach(Filesystem _plugin in plugins.PluginsList.Values)
|
||||
foreach(Filesystem plugin in plugins.PluginsList.Values)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(_plugin.Identify(_imageFormat, partitions[i]))
|
||||
if(plugin.Identify(imageFormat, partitions[i]))
|
||||
{
|
||||
_plugin.GetInformation(_imageFormat, partitions[i], out string foo);
|
||||
lstFs.Add(_plugin.XmlFSType);
|
||||
Statistics.AddFilesystem(_plugin.XmlFSType.Type);
|
||||
dumpLog.WriteLine("Filesystem {0} found.", _plugin.XmlFSType.Type);
|
||||
plugin.GetInformation(imageFormat, partitions[i], out string foo);
|
||||
lstFs.Add(plugin.XmlFSType);
|
||||
Statistics.AddFilesystem(plugin.XmlFSType.Type);
|
||||
dumpLog.WriteLine("Filesystem {0} found.", plugin.XmlFSType.Type);
|
||||
}
|
||||
}
|
||||
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
|
||||
@@ -522,16 +522,16 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
Partition wholePart =
|
||||
new Partition {Name = "Whole device", Length = blocks, Size = blocks * blockSize};
|
||||
|
||||
foreach(Filesystem _plugin in plugins.PluginsList.Values)
|
||||
foreach(Filesystem plugin in plugins.PluginsList.Values)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(_plugin.Identify(_imageFormat, wholePart))
|
||||
if(plugin.Identify(imageFormat, wholePart))
|
||||
{
|
||||
_plugin.GetInformation(_imageFormat, wholePart, out string foo);
|
||||
lstFs.Add(_plugin.XmlFSType);
|
||||
Statistics.AddFilesystem(_plugin.XmlFSType.Type);
|
||||
dumpLog.WriteLine("Filesystem {0} found.", _plugin.XmlFSType.Type);
|
||||
plugin.GetInformation(imageFormat, wholePart, out string foo);
|
||||
lstFs.Add(plugin.XmlFSType);
|
||||
Statistics.AddFilesystem(plugin.XmlFSType.Type);
|
||||
dumpLog.WriteLine("Filesystem {0} found.", plugin.XmlFSType.Type);
|
||||
}
|
||||
}
|
||||
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
|
||||
|
||||
@@ -40,22 +40,22 @@ using DiscImageChef.Core.Logging;
|
||||
using DiscImageChef.Devices;
|
||||
using DiscImageChef.Filesystems;
|
||||
using DiscImageChef.Filters;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.PartPlugins;
|
||||
using DiscImageChef.DiscImages;
|
||||
using DiscImageChef.Partitions;
|
||||
using Extents;
|
||||
using Schemas;
|
||||
|
||||
namespace DiscImageChef.Core.Devices.Dumping
|
||||
{
|
||||
internal static class XGD
|
||||
internal static class Xgd
|
||||
{
|
||||
internal static void Dump(Device dev, string devicePath, string outputPrefix, ushort retryPasses, bool force,
|
||||
bool dumpRaw, bool persistent, bool stopOnError, ref CICMMetadataType sidecar,
|
||||
ref MediaType dskType, ref Metadata.Resume resume, ref DumpLog dumpLog,
|
||||
Encoding encoding)
|
||||
{
|
||||
MHDDLog mhddLog;
|
||||
IBGLog ibgLog;
|
||||
MhddLog mhddLog;
|
||||
IbgLog ibgLog;
|
||||
bool sense = false;
|
||||
ulong blocks = 0;
|
||||
uint blockSize = 2048;
|
||||
@@ -74,7 +74,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
System.Console.CancelKeyPress += (sender, e) => { e.Cancel = aborted = true; };
|
||||
|
||||
dumpLog.WriteLine("Reading Xbox Security Sector.");
|
||||
sense = dev.KreonExtractSS(out byte[] ssBuf, out byte[] senseBuf, dev.Timeout, out double duration);
|
||||
sense = dev.KreonExtractSs(out byte[] ssBuf, out byte[] senseBuf, dev.Timeout, out double duration);
|
||||
if(sense)
|
||||
{
|
||||
dumpLog.WriteLine("Cannot get Xbox Security Sector, not continuing.");
|
||||
@@ -83,8 +83,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
}
|
||||
|
||||
dumpLog.WriteLine("Decoding Xbox Security Sector.");
|
||||
Decoders.Xbox.SS.SecuritySector? xboxSS = Decoders.Xbox.SS.Decode(ssBuf);
|
||||
if(!xboxSS.HasValue)
|
||||
Decoders.Xbox.SS.SecuritySector? xboxSs = Decoders.Xbox.SS.Decode(ssBuf);
|
||||
if(!xboxSs.HasValue)
|
||||
{
|
||||
dumpLog.WriteLine("Cannot decode Xbox Security Sector, not continuing.");
|
||||
DicConsole.ErrorWriteLine("Cannot decode Xbox Security Sector, not continuing.");
|
||||
@@ -136,7 +136,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
|
||||
totalSize = (ulong)((readBuffer[0] << 24) + (readBuffer[1] << 16) + (readBuffer[2] << 8) + (readBuffer[3]));
|
||||
dumpLog.WriteLine("Reading Physical Format Information.");
|
||||
sense = dev.ReadDiscStructure(out readBuffer, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
sense = dev.ReadDiscStructure(out readBuffer, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.PhysicalInformation, 0, 0, out duration);
|
||||
if(sense)
|
||||
{
|
||||
@@ -159,7 +159,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
Decoders.DVD.PFI.Decode(readBuffer).Value.DataAreaStartPSN + 1;
|
||||
l1Video = totalSize - l0Video + 1;
|
||||
dumpLog.WriteLine("Reading Disc Manufacturing Information.");
|
||||
sense = dev.ReadDiscStructure(out readBuffer, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
sense = dev.ReadDiscStructure(out readBuffer, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DiscManufacturingInformation, 0, 0, out duration);
|
||||
if(sense)
|
||||
{
|
||||
@@ -224,7 +224,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
|
||||
totalSize = (ulong)((readBuffer[0] << 24) + (readBuffer[1] << 16) + (readBuffer[2] << 8) + (readBuffer[3]));
|
||||
dumpLog.WriteLine("Reading Physical Format Information.");
|
||||
sense = dev.ReadDiscStructure(out readBuffer, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
sense = dev.ReadDiscStructure(out readBuffer, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.PhysicalInformation, 0, 0, out duration);
|
||||
if(sense)
|
||||
{
|
||||
@@ -249,7 +249,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
DataFile.WriteTo("SCSI Dump", sidecar.OpticalDisc[0].Xbox.PFI.Image, tmpBuf, "Unlocked PFI", true);
|
||||
|
||||
dumpLog.WriteLine("Reading Disc Manufacturing Information.");
|
||||
sense = dev.ReadDiscStructure(out readBuffer, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
sense = dev.ReadDiscStructure(out readBuffer, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DiscManufacturingInformation, 0, 0, out duration);
|
||||
if(sense)
|
||||
{
|
||||
@@ -320,8 +320,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
dumpLog.WriteLine("Reading {0} sectors at a time.", blocksToRead);
|
||||
DicConsole.WriteLine("Reading {0} sectors at a time.", blocksToRead);
|
||||
|
||||
mhddLog = new MHDDLog(outputPrefix + ".mhddlog.bin", dev, blocks, blockSize, blocksToRead);
|
||||
ibgLog = new IBGLog(outputPrefix + ".ibg", 0x0010);
|
||||
mhddLog = new MhddLog(outputPrefix + ".mhddlog.bin", dev, blocks, blockSize, blocksToRead);
|
||||
ibgLog = new IbgLog(outputPrefix + ".ibg", 0x0010);
|
||||
dumpFile = new DataFile(outputPrefix + ".iso");
|
||||
|
||||
start = DateTime.UtcNow;
|
||||
@@ -332,7 +332,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
uint saveBlocksToRead = blocksToRead;
|
||||
DumpHardwareType currentTry = null;
|
||||
ExtentsULong extents = null;
|
||||
ResumeSupport.Process(true, true, totalSize, dev.Manufacturer, dev.Model, dev.Serial, dev.PlatformID,
|
||||
ResumeSupport.Process(true, true, totalSize, dev.Manufacturer, dev.Model, dev.Serial, dev.PlatformId,
|
||||
ref resume, ref currentTry, ref extents);
|
||||
if(currentTry == null || extents == null)
|
||||
throw new Exception("Could not process resume file, not continuing...");
|
||||
@@ -358,16 +358,16 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
// Extents
|
||||
if(e < 16)
|
||||
{
|
||||
if(xboxSS.Value.Extents[e].StartPSN <= xboxSS.Value.Layer0EndPSN)
|
||||
extentStart = xboxSS.Value.Extents[e].StartPSN - 0x30000;
|
||||
if(xboxSs.Value.Extents[e].StartPSN <= xboxSs.Value.Layer0EndPSN)
|
||||
extentStart = xboxSs.Value.Extents[e].StartPSN - 0x30000;
|
||||
else
|
||||
extentStart = (xboxSS.Value.Layer0EndPSN + 1) * 2 -
|
||||
((xboxSS.Value.Extents[e].StartPSN ^ 0xFFFFFF) + 1) - 0x30000;
|
||||
if(xboxSS.Value.Extents[e].EndPSN <= xboxSS.Value.Layer0EndPSN)
|
||||
extentEnd = xboxSS.Value.Extents[e].EndPSN - 0x30000;
|
||||
extentStart = (xboxSs.Value.Layer0EndPSN + 1) * 2 -
|
||||
((xboxSs.Value.Extents[e].StartPSN ^ 0xFFFFFF) + 1) - 0x30000;
|
||||
if(xboxSs.Value.Extents[e].EndPSN <= xboxSs.Value.Layer0EndPSN)
|
||||
extentEnd = xboxSs.Value.Extents[e].EndPSN - 0x30000;
|
||||
else
|
||||
extentEnd = (xboxSS.Value.Layer0EndPSN + 1) * 2 -
|
||||
((xboxSS.Value.Extents[e].EndPSN ^ 0xFFFFFF) + 1) - 0x30000;
|
||||
extentEnd = (xboxSs.Value.Layer0EndPSN + 1) * 2 -
|
||||
((xboxSs.Value.Extents[e].EndPSN ^ 0xFFFFFF) + 1) - 0x30000;
|
||||
}
|
||||
// After last extent
|
||||
else
|
||||
@@ -667,15 +667,15 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
{
|
||||
sense = dev.ModeSense10(out readBuffer, out senseBuf, false, ScsiModeSensePageControl.Current,
|
||||
0x01, dev.Timeout, out duration);
|
||||
if(!sense) currentMode = Decoders.SCSI.Modes.DecodeMode10(readBuffer, dev.SCSIType);
|
||||
if(!sense) currentMode = Decoders.SCSI.Modes.DecodeMode10(readBuffer, dev.ScsiType);
|
||||
}
|
||||
else currentMode = Decoders.SCSI.Modes.DecodeMode6(readBuffer, dev.SCSIType);
|
||||
else currentMode = Decoders.SCSI.Modes.DecodeMode6(readBuffer, dev.ScsiType);
|
||||
|
||||
if(currentMode.HasValue) currentModePage = currentMode.Value.Pages[0];
|
||||
|
||||
if(dev.SCSIType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
||||
if(dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
||||
{
|
||||
Decoders.SCSI.Modes.ModePage_01_MMC pgMMC =
|
||||
Decoders.SCSI.Modes.ModePage_01_MMC pgMmc =
|
||||
new Decoders.SCSI.Modes.ModePage_01_MMC
|
||||
{
|
||||
PS = false,
|
||||
@@ -691,12 +691,12 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
{
|
||||
Page = 0x01,
|
||||
Subpage = 0x00,
|
||||
PageResponse = Decoders.SCSI.Modes.EncodeModePage_01_MMC(pgMMC)
|
||||
PageResponse = Decoders.SCSI.Modes.EncodeModePage_01_MMC(pgMmc)
|
||||
}
|
||||
}
|
||||
};
|
||||
md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.SCSIType);
|
||||
md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.SCSIType);
|
||||
md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.ScsiType);
|
||||
md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.ScsiType);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -726,8 +726,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
}
|
||||
}
|
||||
};
|
||||
md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.SCSIType);
|
||||
md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.SCSIType);
|
||||
md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.ScsiType);
|
||||
md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.ScsiType);
|
||||
}
|
||||
|
||||
dumpLog.WriteLine("Sending MODE SELECT to drive.");
|
||||
@@ -748,8 +748,8 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
Header = new Decoders.SCSI.Modes.ModeHeader(),
|
||||
Pages = new Decoders.SCSI.Modes.ModePage[] {currentModePage.Value}
|
||||
};
|
||||
md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.SCSIType);
|
||||
md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.SCSIType);
|
||||
md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.ScsiType);
|
||||
md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.ScsiType);
|
||||
|
||||
dumpLog.WriteLine("Sending MODE SELECT to drive.");
|
||||
sense = dev.ModeSelect(md6, out senseBuf, true, false, dev.Timeout, out duration);
|
||||
@@ -805,7 +805,7 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
|
||||
PluginBase plugins = new PluginBase();
|
||||
plugins.RegisterAllPlugins(encoding);
|
||||
ImagePlugin _imageFormat;
|
||||
ImagePlugin imageFormat;
|
||||
FiltersList filtersList = new FiltersList();
|
||||
Filter inputFilter = filtersList.GetFilter(outputPrefix + ".iso");
|
||||
|
||||
@@ -815,16 +815,16 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
return;
|
||||
}
|
||||
|
||||
_imageFormat = ImageFormat.Detect(inputFilter);
|
||||
imageFormat = ImageFormat.Detect(inputFilter);
|
||||
PartitionType[] xmlFileSysInfo = null;
|
||||
|
||||
try { if(!_imageFormat.OpenImage(inputFilter)) _imageFormat = null; }
|
||||
catch { _imageFormat = null; }
|
||||
try { if(!imageFormat.OpenImage(inputFilter)) imageFormat = null; }
|
||||
catch { imageFormat = null; }
|
||||
|
||||
if(_imageFormat != null)
|
||||
if(imageFormat != null)
|
||||
{
|
||||
dumpLog.WriteLine("Getting partitions.");
|
||||
List<Partition> partitions = Partitions.GetAll(_imageFormat);
|
||||
List<Partition> partitions = Partitions.GetAll(imageFormat);
|
||||
Partitions.AddSchemesToStats(partitions);
|
||||
dumpLog.WriteLine("Found {0} partitions.", partitions.Count);
|
||||
|
||||
@@ -847,22 +847,22 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
i, partitions[i].Start, partitions[i].End, partitions[i].Type,
|
||||
partitions[i].Scheme);
|
||||
|
||||
foreach(Filesystem _plugin in plugins.PluginsList.Values)
|
||||
foreach(Filesystem plugin in plugins.PluginsList.Values)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(_plugin.Identify(_imageFormat, partitions[i]))
|
||||
if(plugin.Identify(imageFormat, partitions[i]))
|
||||
{
|
||||
_plugin.GetInformation(_imageFormat, partitions[i], out string foo);
|
||||
lstFs.Add(_plugin.XmlFSType);
|
||||
Statistics.AddFilesystem(_plugin.XmlFSType.Type);
|
||||
dumpLog.WriteLine("Filesystem {0} found.", _plugin.XmlFSType.Type);
|
||||
plugin.GetInformation(imageFormat, partitions[i], out string foo);
|
||||
lstFs.Add(plugin.XmlFSType);
|
||||
Statistics.AddFilesystem(plugin.XmlFSType.Type);
|
||||
dumpLog.WriteLine("Filesystem {0} found.", plugin.XmlFSType.Type);
|
||||
|
||||
if(_plugin.XmlFSType.Type == "Opera") dskType = MediaType.ThreeDO;
|
||||
if(_plugin.XmlFSType.Type == "PC Engine filesystem")
|
||||
if(plugin.XmlFSType.Type == "Opera") dskType = MediaType.ThreeDO;
|
||||
if(plugin.XmlFSType.Type == "PC Engine filesystem")
|
||||
dskType = MediaType.SuperCDROM2;
|
||||
if(_plugin.XmlFSType.Type == "Nintendo Wii filesystem") dskType = MediaType.WOD;
|
||||
if(_plugin.XmlFSType.Type == "Nintendo Gamecube filesystem")
|
||||
if(plugin.XmlFSType.Type == "Nintendo Wii filesystem") dskType = MediaType.WOD;
|
||||
if(plugin.XmlFSType.Type == "Nintendo Gamecube filesystem")
|
||||
dskType = MediaType.GOD;
|
||||
}
|
||||
}
|
||||
@@ -887,21 +887,21 @@ namespace DiscImageChef.Core.Devices.Dumping
|
||||
Partition wholePart =
|
||||
new Partition {Name = "Whole device", Length = blocks, Size = blocks * blockSize};
|
||||
|
||||
foreach(Filesystem _plugin in plugins.PluginsList.Values)
|
||||
foreach(Filesystem plugin in plugins.PluginsList.Values)
|
||||
{
|
||||
try
|
||||
{
|
||||
if(_plugin.Identify(_imageFormat, wholePart))
|
||||
if(plugin.Identify(imageFormat, wholePart))
|
||||
{
|
||||
_plugin.GetInformation(_imageFormat, wholePart, out string foo);
|
||||
lstFs.Add(_plugin.XmlFSType);
|
||||
Statistics.AddFilesystem(_plugin.XmlFSType.Type);
|
||||
dumpLog.WriteLine("Filesystem {0} found.", _plugin.XmlFSType.Type);
|
||||
plugin.GetInformation(imageFormat, wholePart, out string foo);
|
||||
lstFs.Add(plugin.XmlFSType);
|
||||
Statistics.AddFilesystem(plugin.XmlFSType.Type);
|
||||
dumpLog.WriteLine("Filesystem {0} found.", plugin.XmlFSType.Type);
|
||||
|
||||
if(_plugin.XmlFSType.Type == "Opera") dskType = MediaType.ThreeDO;
|
||||
if(_plugin.XmlFSType.Type == "PC Engine filesystem") dskType = MediaType.SuperCDROM2;
|
||||
if(_plugin.XmlFSType.Type == "Nintendo Wii filesystem") dskType = MediaType.WOD;
|
||||
if(_plugin.XmlFSType.Type == "Nintendo Gamecube filesystem") dskType = MediaType.GOD;
|
||||
if(plugin.XmlFSType.Type == "Opera") dskType = MediaType.ThreeDO;
|
||||
if(plugin.XmlFSType.Type == "PC Engine filesystem") dskType = MediaType.SuperCDROM2;
|
||||
if(plugin.XmlFSType.Type == "Nintendo Wii filesystem") dskType = MediaType.WOD;
|
||||
if(plugin.XmlFSType.Type == "Nintendo Gamecube filesystem") dskType = MediaType.GOD;
|
||||
}
|
||||
}
|
||||
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
|
||||
|
||||
@@ -80,7 +80,7 @@ namespace DiscImageChef.Core.Devices
|
||||
{
|
||||
get { return ataSeek || seek6 || seek10; }
|
||||
}
|
||||
internal bool CanSeekLBA
|
||||
internal bool CanSeekLba
|
||||
{
|
||||
get { return ataSeekLba || seek6 || seek10; }
|
||||
}
|
||||
@@ -177,11 +177,11 @@ namespace DiscImageChef.Core.Devices
|
||||
}
|
||||
}
|
||||
|
||||
internal bool ReadCHS(out byte[] buffer, ushort cylinder, byte head, byte sector, out double duration)
|
||||
internal bool ReadChs(out byte[] buffer, ushort cylinder, byte head, byte sector, out double duration)
|
||||
{
|
||||
switch(dev.Type)
|
||||
{
|
||||
case DeviceType.ATA: return AtaReadCHS(out buffer, cylinder, head, sector, out duration);
|
||||
case DeviceType.ATA: return AtaReadChs(out buffer, cylinder, head, sector, out duration);
|
||||
default:
|
||||
buffer = null;
|
||||
duration = 0d;
|
||||
@@ -202,11 +202,11 @@ namespace DiscImageChef.Core.Devices
|
||||
}
|
||||
}
|
||||
|
||||
internal bool SeekCHS(ushort cylinder, byte head, byte sector, out double duration)
|
||||
internal bool SeekChs(ushort cylinder, byte head, byte sector, out double duration)
|
||||
{
|
||||
switch(dev.Type)
|
||||
{
|
||||
case DeviceType.ATA: return AtaSeekCHS(cylinder, head, sector, out duration);
|
||||
case DeviceType.ATA: return AtaSeekChs(cylinder, head, sector, out duration);
|
||||
default:
|
||||
duration = 0;
|
||||
return true;
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace DiscImageChef.Core.Devices
|
||||
|
||||
Identify.IdentifyDevice ataId;
|
||||
|
||||
internal bool IsLBA
|
||||
internal bool IsLba
|
||||
{
|
||||
get { return lbaMode; }
|
||||
}
|
||||
@@ -74,7 +74,7 @@ namespace DiscImageChef.Core.Devices
|
||||
get { return sectors; }
|
||||
}
|
||||
|
||||
(uint, byte, byte) GetDeviceCHS()
|
||||
(uint, byte, byte) GetDeviceChs()
|
||||
{
|
||||
if(dev.Type != DeviceType.ATA) return (0, 0, 0);
|
||||
|
||||
@@ -100,7 +100,7 @@ namespace DiscImageChef.Core.Devices
|
||||
|
||||
ulong AtaGetBlocks()
|
||||
{
|
||||
GetDeviceCHS();
|
||||
GetDeviceChs();
|
||||
|
||||
if(ataId.Capabilities.HasFlag(Identify.CapabilitiesBit.LBASupport))
|
||||
{
|
||||
@@ -350,7 +350,7 @@ namespace DiscImageChef.Core.Devices
|
||||
return error;
|
||||
}
|
||||
|
||||
bool AtaReadCHS(out byte[] buffer, ushort cylinder, byte head, byte sectir, out double duration)
|
||||
bool AtaReadChs(out byte[] buffer, ushort cylinder, byte head, byte sectir, out double duration)
|
||||
{
|
||||
bool error = true;
|
||||
bool sense;
|
||||
@@ -401,7 +401,7 @@ namespace DiscImageChef.Core.Devices
|
||||
return !(!sense && (errorLba.status & 0x27) == 0 && errorLba.error == 0);
|
||||
}
|
||||
|
||||
bool AtaSeekCHS(ushort cylinder, byte head, byte sector, out double duration)
|
||||
bool AtaSeekChs(ushort cylinder, byte head, byte sector, out double duration)
|
||||
{
|
||||
AtaErrorRegistersCHS errorChs;
|
||||
|
||||
|
||||
@@ -110,7 +110,7 @@ namespace DiscImageChef.Core.Devices
|
||||
Decoders.SCSI.FixedSense? decSense;
|
||||
readRaw = false;
|
||||
|
||||
if(dev.SCSIType != Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
||||
if(dev.ScsiType != Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
||||
{
|
||||
/*testSense = dev.ReadLong16(out readBuffer, out senseBuf, false, 0, 0xFFFF, timeout, out duration);
|
||||
if (testSense && !dev.Error)
|
||||
@@ -417,7 +417,7 @@ namespace DiscImageChef.Core.Devices
|
||||
if(sense && blocks == 0)
|
||||
{
|
||||
// Not all MMC devices support READ CAPACITY, as they have READ TOC
|
||||
if(dev.SCSIType != Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
||||
if(dev.ScsiType != Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
||||
{
|
||||
errorMessage = string.Format("Unable to get media capacity\n" + "{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
|
||||
@@ -38,7 +38,7 @@ using DiscImageChef.Metadata;
|
||||
|
||||
namespace DiscImageChef.Core.Devices.Report
|
||||
{
|
||||
public static class ATA
|
||||
public static class Ata
|
||||
{
|
||||
public static void Report(Device dev, ref DeviceReport report, bool debug, ref bool removable)
|
||||
{
|
||||
@@ -50,11 +50,11 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
uint timeout = 5;
|
||||
ConsoleKeyInfo pressedKey;
|
||||
|
||||
if(dev.IsUSB) USB.Report(dev, ref report, debug, ref removable);
|
||||
if(dev.IsUsb) Usb.Report(dev, ref report, debug, ref removable);
|
||||
|
||||
if(dev.IsFireWire) FireWire.Report(dev, ref report, debug, ref removable);
|
||||
|
||||
if(dev.IsPCMCIA) PCMCIA.Report(dev, ref report, debug, ref removable);
|
||||
if(dev.IsPcmcia) Pcmcia.Report(dev, ref report, debug, ref removable);
|
||||
|
||||
DicConsole.WriteLine("Querying ATA IDENTIFY...");
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ using DiscImageChef.Metadata;
|
||||
|
||||
namespace DiscImageChef.Core.Devices.Report
|
||||
{
|
||||
static class ATAPI
|
||||
static class Atapi
|
||||
{
|
||||
internal static void Report(Device dev, ref DeviceReport report, bool debug, ref bool removable)
|
||||
{
|
||||
|
||||
@@ -36,7 +36,7 @@ using DiscImageChef.Metadata;
|
||||
|
||||
namespace DiscImageChef.Core.Devices.Report
|
||||
{
|
||||
public static class NVMe
|
||||
public static class Nvme
|
||||
{
|
||||
public static void Report(Device dev, ref DeviceReport report, bool debug, ref bool removable)
|
||||
{
|
||||
|
||||
@@ -36,13 +36,13 @@ using DiscImageChef.Metadata;
|
||||
|
||||
namespace DiscImageChef.Core.Devices.Report
|
||||
{
|
||||
static class PCMCIA
|
||||
static class Pcmcia
|
||||
{
|
||||
internal static void Report(Device dev, ref DeviceReport report, bool debug, ref bool removable)
|
||||
{
|
||||
report.PCMCIA = new pcmciaType();
|
||||
report.PCMCIA.CIS = dev.CIS;
|
||||
Tuple[] tuples = CIS.GetTuples(dev.CIS);
|
||||
report.PCMCIA.CIS = dev.Cis;
|
||||
Tuple[] tuples = CIS.GetTuples(dev.Cis);
|
||||
if(tuples != null)
|
||||
{
|
||||
foreach(Tuple tuple in tuples)
|
||||
|
||||
@@ -52,13 +52,13 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
uint timeout = 5;
|
||||
ConsoleKeyInfo pressedKey;
|
||||
|
||||
if(dev.IsUSB) USB.Report(dev, ref report, debug, ref removable);
|
||||
if(dev.IsUsb) Usb.Report(dev, ref report, debug, ref removable);
|
||||
|
||||
if(dev.IsFireWire) FireWire.Report(dev, ref report, debug, ref removable);
|
||||
|
||||
if(dev.IsPCMCIA) PCMCIA.Report(dev, ref report, debug, ref removable);
|
||||
if(dev.IsPcmcia) Pcmcia.Report(dev, ref report, debug, ref removable);
|
||||
|
||||
if(!dev.IsUSB && !dev.IsFireWire && dev.IsRemovable)
|
||||
if(!dev.IsUsb && !dev.IsFireWire && dev.IsRemovable)
|
||||
{
|
||||
pressedKey = new ConsoleKeyInfo();
|
||||
while(pressedKey.Key != ConsoleKey.Y && pressedKey.Key != ConsoleKey.N)
|
||||
@@ -71,7 +71,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
removable = pressedKey.Key == ConsoleKey.Y;
|
||||
}
|
||||
|
||||
if(dev.Type == DeviceType.ATAPI) ATAPI.Report(dev, ref report, debug, ref removable);
|
||||
if(dev.Type == DeviceType.ATAPI) Atapi.Report(dev, ref report, debug, ref removable);
|
||||
|
||||
DicConsole.WriteLine("Querying SCSI INQUIRY...");
|
||||
sense = dev.ScsiInquiry(out buffer, out senseBuffer);
|
||||
@@ -209,12 +209,12 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
|
||||
if(removable)
|
||||
{
|
||||
if(dev.SCSIType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
||||
if(dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
||||
{
|
||||
dev.AllowMediumRemoval(out senseBuffer, timeout, out duration);
|
||||
dev.EjectTray(out senseBuffer, timeout, out duration);
|
||||
}
|
||||
else if(dev.SCSIType == Decoders.SCSI.PeripheralDeviceTypes.SequentialAccess)
|
||||
else if(dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.SequentialAccess)
|
||||
{
|
||||
dev.SpcAllowMediumRemoval(out senseBuffer, timeout, out duration);
|
||||
DicConsole.WriteLine("Asking drive to unload tape (can take a few minutes)...");
|
||||
@@ -225,7 +225,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
}
|
||||
|
||||
Decoders.SCSI.Modes.DecodedMode? decMode = null;
|
||||
Decoders.SCSI.PeripheralDeviceTypes devType = dev.SCSIType;
|
||||
Decoders.SCSI.PeripheralDeviceTypes devType = dev.ScsiType;
|
||||
|
||||
DicConsole.WriteLine("Querying all mode pages and subpages using SCSI MODE SENSE (10)...");
|
||||
sense = dev.ModeSense10(out byte[] mode10Buffer, out senseBuffer, false, true,
|
||||
@@ -317,10 +317,10 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
|
||||
List<string> mediaTypes = new List<string>();
|
||||
|
||||
if(dev.SCSIType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
||||
MMC.Report(dev, ref report, debug, ref cdromMode, ref mediaTypes);
|
||||
else if(dev.SCSIType == Decoders.SCSI.PeripheralDeviceTypes.SequentialAccess)
|
||||
SSC.Report(dev, ref report, debug);
|
||||
if(dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
||||
Mmc.Report(dev, ref report, debug, ref cdromMode, ref mediaTypes);
|
||||
else if(dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.SequentialAccess)
|
||||
Ssc.Report(dev, ref report, debug);
|
||||
else
|
||||
{
|
||||
if(removable)
|
||||
@@ -440,7 +440,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
if(!sense && !dev.Error)
|
||||
{
|
||||
report.SCSI.SupportsModeSense10 = true;
|
||||
decMode = Decoders.SCSI.Modes.DecodeMode10(buffer, dev.SCSIType);
|
||||
decMode = Decoders.SCSI.Modes.DecodeMode10(buffer, dev.ScsiType);
|
||||
if(debug) mediaTest.ModeSense10Data = buffer;
|
||||
}
|
||||
|
||||
@@ -450,7 +450,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
{
|
||||
report.SCSI.SupportsModeSense6 = true;
|
||||
if(!decMode.HasValue)
|
||||
decMode = Decoders.SCSI.Modes.DecodeMode6(buffer, dev.SCSIType);
|
||||
decMode = Decoders.SCSI.Modes.DecodeMode6(buffer, dev.ScsiType);
|
||||
if(debug) mediaTest.ModeSense6Data = buffer;
|
||||
}
|
||||
|
||||
@@ -715,7 +715,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
if(!sense && !dev.Error)
|
||||
{
|
||||
report.SCSI.SupportsModeSense10 = true;
|
||||
decMode = Decoders.SCSI.Modes.DecodeMode10(buffer, dev.SCSIType);
|
||||
decMode = Decoders.SCSI.Modes.DecodeMode10(buffer, dev.ScsiType);
|
||||
if(debug) report.SCSI.ReadCapabilities.ModeSense10Data = buffer;
|
||||
}
|
||||
|
||||
@@ -724,7 +724,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
if(!sense && !dev.Error)
|
||||
{
|
||||
report.SCSI.SupportsModeSense6 = true;
|
||||
if(!decMode.HasValue) decMode = Decoders.SCSI.Modes.DecodeMode6(buffer, dev.SCSIType);
|
||||
if(!decMode.HasValue) decMode = Decoders.SCSI.Modes.DecodeMode6(buffer, dev.ScsiType);
|
||||
if(debug) report.SCSI.ReadCapabilities.ModeSense6Data = buffer;
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ using DiscImageChef.Metadata;
|
||||
|
||||
namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
{
|
||||
internal static class MMC
|
||||
internal static class Mmc
|
||||
{
|
||||
internal static void Report(Device dev, ref DeviceReport report, bool debug,
|
||||
ref Decoders.SCSI.Modes.ModePage_2A? cdromMode, ref List<string> mediaTypes)
|
||||
@@ -733,12 +733,12 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
}
|
||||
}
|
||||
|
||||
bool tryPlextor = false, tryHLDTST = false, tryPioneer = false, tryNEC = false;
|
||||
bool tryPlextor = false, tryHldtst = false, tryPioneer = false, tryNec = false;
|
||||
|
||||
tryPlextor |= dev.Manufacturer.ToLowerInvariant() == "plextor";
|
||||
tryHLDTST |= dev.Manufacturer.ToLowerInvariant() == "hl-dt-st";
|
||||
tryHldtst |= dev.Manufacturer.ToLowerInvariant() == "hl-dt-st";
|
||||
tryPioneer |= dev.Manufacturer.ToLowerInvariant() == "pioneer";
|
||||
tryNEC |= dev.Manufacturer.ToLowerInvariant() == "nec";
|
||||
tryNec |= dev.Manufacturer.ToLowerInvariant() == "nec";
|
||||
|
||||
// Very old CD drives do not contain mode page 2Ah neither GET CONFIGURATION, so just try all CDs on them
|
||||
// Also don't get confident, some drives didn't know CD-RW but are able to read them
|
||||
@@ -871,7 +871,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
if(!sense && !dev.Error)
|
||||
{
|
||||
report.SCSI.SupportsModeSense10 = true;
|
||||
decMode = Decoders.SCSI.Modes.DecodeMode10(buffer, dev.SCSIType);
|
||||
decMode = Decoders.SCSI.Modes.DecodeMode10(buffer, dev.ScsiType);
|
||||
if(debug) mediaTest.ModeSense10Data = buffer;
|
||||
}
|
||||
DicConsole.WriteLine("Querying SCSI MODE SENSE...");
|
||||
@@ -879,7 +879,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
if(!sense && !dev.Error)
|
||||
{
|
||||
report.SCSI.SupportsModeSense6 = true;
|
||||
if(!decMode.HasValue) decMode = Decoders.SCSI.Modes.DecodeMode6(buffer, dev.SCSIType);
|
||||
if(!decMode.HasValue) decMode = Decoders.SCSI.Modes.DecodeMode6(buffer, dev.ScsiType);
|
||||
if(debug) mediaTest.ModeSense6Data = buffer;
|
||||
}
|
||||
|
||||
@@ -947,7 +947,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
mediaTest.CanReadDMISpecified = true;
|
||||
DicConsole.WriteLine("Querying DVD PFI...");
|
||||
mediaTest.CanReadPFI =
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.PhysicalInformation, 0, timeout,
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadPFI);
|
||||
@@ -957,7 +957,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
DicConsole.WriteLine("Querying DVD DMI...");
|
||||
mediaTest.CanReadDMI =
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DiscManufacturingInformation, 0, timeout,
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadDMI);
|
||||
@@ -972,7 +972,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
mediaTest.CanReadCMISpecified = true;
|
||||
DicConsole.WriteLine("Querying DVD CMI...");
|
||||
mediaTest.CanReadCMI =
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.CopyrightInformation, 0, timeout,
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadCMI);
|
||||
@@ -987,7 +987,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
mediaTest.CanReadBCASpecified = true;
|
||||
DicConsole.WriteLine("Querying DVD BCA...");
|
||||
mediaTest.CanReadBCA =
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.BurstCuttingArea, 0, timeout,
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadBCA);
|
||||
@@ -998,8 +998,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
mediaTest.CanReadAACSSpecified = true;
|
||||
DicConsole.WriteLine("Querying DVD AACS...");
|
||||
mediaTest.CanReadAACS =
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.DVD_AACS, 0, timeout, out duration);
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DvdAacs, 0, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadAACS);
|
||||
if(debug)
|
||||
DataFile.WriteTo("SCSI Report", "aacs",
|
||||
@@ -1012,8 +1012,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
mediaTest.CanReadBCASpecified = true;
|
||||
DicConsole.WriteLine("Querying BD BCA...");
|
||||
mediaTest.CanReadBCA =
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.BD, 0, 0,
|
||||
MmcDiscStructureFormat.BD_BurstCuttingArea, 0, timeout,
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
MmcDiscStructureFormat.BdBurstCuttingArea, 0, timeout,
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadBCA);
|
||||
if(debug)
|
||||
@@ -1027,16 +1027,16 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
mediaTest.CanReadDDSSpecified = true;
|
||||
mediaTest.CanReadSpareAreaInformationSpecified = true;
|
||||
mediaTest.CanReadDDS =
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.DVDRAM_DDS, 0, timeout, out duration);
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DvdramDds, 0, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadDDS);
|
||||
if(debug)
|
||||
DataFile.WriteTo("SCSI Report", "dds",
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
mediaTest.CanReadSpareAreaInformation =
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.DVDRAM_SpareAreaInformation, 0, timeout,
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DvdramSpareAreaInformation, 0, timeout,
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!mediaTest.CanReadSpareAreaInformation);
|
||||
@@ -1052,8 +1052,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
mediaTest.CanReadSpareAreaInformationSpecified = true;
|
||||
DicConsole.WriteLine("Querying BD DDS...");
|
||||
mediaTest.CanReadDDS =
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.BD, 0, 0,
|
||||
MmcDiscStructureFormat.BD_DDS, 0, timeout, out duration);
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
MmcDiscStructureFormat.BdDds, 0, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadDDS);
|
||||
if(debug)
|
||||
DataFile.WriteTo("SCSI Report", "bddds",
|
||||
@@ -1061,8 +1061,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
DicConsole.WriteLine("Querying BD SAI...");
|
||||
mediaTest.CanReadSpareAreaInformation =
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.BD, 0, 0,
|
||||
MmcDiscStructureFormat.BD_SpareAreaInformation, 0, timeout,
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
MmcDiscStructureFormat.BdSpareAreaInformation, 0, timeout,
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!mediaTest.CanReadSpareAreaInformation);
|
||||
@@ -1077,7 +1077,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
mediaTest.CanReadPRISpecified = true;
|
||||
DicConsole.WriteLine("Querying DVD PRI...");
|
||||
mediaTest.CanReadPRI =
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.PreRecordedInfo, 0, timeout,
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadPRI);
|
||||
@@ -1093,8 +1093,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
mediaTest.CanReadRecordablePFISpecified = true;
|
||||
DicConsole.WriteLine("Querying DVD Media ID...");
|
||||
mediaTest.CanReadMediaID =
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.DVDR_MediaIdentifier, 0, timeout,
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DvdrMediaIdentifier, 0, timeout,
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadMediaID);
|
||||
if(debug)
|
||||
@@ -1103,8 +1103,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
DicConsole.WriteLine("Querying DVD Embossed PFI...");
|
||||
mediaTest.CanReadRecordablePFI =
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.DVDR_PhysicalInformation, 0, timeout,
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DvdrPhysicalInformation, 0, timeout,
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadRecordablePFI);
|
||||
if(debug)
|
||||
@@ -1119,8 +1119,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
mediaTest.CanReadDCBSpecified = true;
|
||||
DicConsole.WriteLine("Querying DVD ADIP...");
|
||||
mediaTest.CanReadADIP =
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.ADIP, 0, timeout, out duration);
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.Adip, 0, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadADIP);
|
||||
if(debug)
|
||||
DataFile.WriteTo("SCSI Report", "adip",
|
||||
@@ -1128,8 +1128,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
DicConsole.WriteLine("Querying DVD DCB...");
|
||||
mediaTest.CanReadDCB =
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.DCB, 0, timeout, out duration);
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.Dcb, 0, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadDCB);
|
||||
if(debug)
|
||||
DataFile.WriteTo("SCSI Report", "dcb",
|
||||
@@ -1142,8 +1142,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
mediaTest.CanReadHDCMISpecified = true;
|
||||
DicConsole.WriteLine("Querying HD DVD CMI...");
|
||||
mediaTest.CanReadHDCMI =
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.HDDVD_CopyrightInformation, 0, timeout,
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.HddvdCopyrightInformation, 0, timeout,
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadHDCMI);
|
||||
if(debug)
|
||||
@@ -1157,8 +1157,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
mediaTest.CanReadLayerCapacitySpecified = true;
|
||||
DicConsole.WriteLine("Querying DVD Layer Capacity...");
|
||||
mediaTest.CanReadLayerCapacity =
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.DVDR_LayerCapacity, 0, timeout,
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DvdrLayerCapacity, 0, timeout,
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadLayerCapacity);
|
||||
if(debug)
|
||||
@@ -1173,7 +1173,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
mediaTest.CanReadPACSpecified = true;
|
||||
DicConsole.WriteLine("Querying BD Disc Information...");
|
||||
mediaTest.CanReadDiscInformation =
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.BD, 0, 0,
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
MmcDiscStructureFormat.DiscInformation, 0, timeout,
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadDiscInformation);
|
||||
@@ -1183,8 +1183,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
DicConsole.WriteLine("Querying BD PAC...");
|
||||
mediaTest.CanReadPAC =
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.BD, 0, 0,
|
||||
MmcDiscStructureFormat.PAC, 0, timeout, out duration);
|
||||
!dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
MmcDiscStructureFormat.Pac, 0, timeout, out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadPAC);
|
||||
if(debug)
|
||||
DataFile.WriteTo("SCSI Report", "pac",
|
||||
@@ -1268,7 +1268,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
{
|
||||
DicConsole.WriteLine("Trying SCSI READ CD...");
|
||||
mediaTest.SupportsReadCd = !dev.ReadCd(out buffer, out senseBuffer, 0, 2352, 1,
|
||||
MmcSectorTypes.CDDA, false, false, false,
|
||||
MmcSectorTypes.Cdda, false, false, false,
|
||||
MmcHeaderCodes.None, true, false,
|
||||
MmcErrorField.None, MmcSubchannel.None, timeout,
|
||||
out duration);
|
||||
@@ -1279,7 +1279,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
DicConsole.WriteLine("Trying SCSI READ CD MSF...");
|
||||
mediaTest.SupportsReadCdMsf = !dev.ReadCdMsf(out buffer, out senseBuffer, 0x00000200,
|
||||
0x00000201, 2352, MmcSectorTypes.CDDA,
|
||||
0x00000201, 2352, MmcSectorTypes.Cdda,
|
||||
false, false, MmcHeaderCodes.None, true,
|
||||
false, MmcErrorField.None,
|
||||
MmcSubchannel.None, timeout, out duration);
|
||||
@@ -1346,7 +1346,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
{
|
||||
if(mediaType == "Audio CD")
|
||||
sense = dev.ReadCd(out buffer, out senseBuffer, (uint)i, 2352, 1,
|
||||
MmcSectorTypes.CDDA, false, false, false,
|
||||
MmcSectorTypes.Cdda, false, false, false,
|
||||
MmcHeaderCodes.None, true, false, MmcErrorField.None,
|
||||
MmcSubchannel.None, timeout, out duration);
|
||||
else
|
||||
@@ -1370,7 +1370,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
if(mediaType == "Audio CD")
|
||||
mediaTest.CanReadLeadOut = !dev.ReadCd(out buffer, out senseBuffer,
|
||||
(uint)(mediaTest.Blocks + 1), 2352, 1,
|
||||
MmcSectorTypes.CDDA, false, false, false,
|
||||
MmcSectorTypes.Cdda, false, false, false,
|
||||
MmcHeaderCodes.None, true, false,
|
||||
MmcErrorField.None, MmcSubchannel.None,
|
||||
timeout, out duration);
|
||||
@@ -1392,13 +1392,13 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
{
|
||||
DicConsole.WriteLine("Trying to read C2 Pointers...");
|
||||
mediaTest.CanReadC2Pointers = !dev.ReadCd(out buffer, out senseBuffer, 0, 2646, 1,
|
||||
MmcSectorTypes.CDDA, false, false, false,
|
||||
MmcSectorTypes.Cdda, false, false, false,
|
||||
MmcHeaderCodes.None, true, false,
|
||||
MmcErrorField.C2Pointers, MmcSubchannel.None,
|
||||
timeout, out duration);
|
||||
if(!mediaTest.CanReadC2Pointers)
|
||||
mediaTest.CanReadC2Pointers = !dev.ReadCd(out buffer, out senseBuffer, 0, 2648, 1,
|
||||
MmcSectorTypes.CDDA, false, false, false,
|
||||
MmcSectorTypes.Cdda, false, false, false,
|
||||
MmcHeaderCodes.None, true, false,
|
||||
MmcErrorField.C2PointersAndBlock,
|
||||
MmcSubchannel.None, timeout,
|
||||
@@ -1411,7 +1411,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
|
||||
DicConsole.WriteLine("Trying to read subchannels...");
|
||||
mediaTest.CanReadPQSubchannel = !dev.ReadCd(out buffer, out senseBuffer, 0, 2368, 1,
|
||||
MmcSectorTypes.CDDA, false, false, false,
|
||||
MmcSectorTypes.Cdda, false, false, false,
|
||||
MmcHeaderCodes.None, true, false,
|
||||
MmcErrorField.None, MmcSubchannel.Q16,
|
||||
timeout, out duration);
|
||||
@@ -1421,7 +1421,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
mediaTest.CanReadRWSubchannel = !dev.ReadCd(out buffer, out senseBuffer, 0, 2448, 1,
|
||||
MmcSectorTypes.CDDA, false, false, false,
|
||||
MmcSectorTypes.Cdda, false, false, false,
|
||||
MmcHeaderCodes.None, true, false,
|
||||
MmcErrorField.None, MmcSubchannel.Raw,
|
||||
timeout, out duration);
|
||||
@@ -1431,10 +1431,10 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
"_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" +
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
mediaTest.CanReadCorrectedSubchannel = !dev.ReadCd(out buffer, out senseBuffer, 0, 2448,
|
||||
1, MmcSectorTypes.CDDA, false, false,
|
||||
1, MmcSectorTypes.Cdda, false, false,
|
||||
false, MmcHeaderCodes.None, true,
|
||||
false, MmcErrorField.None,
|
||||
MmcSubchannel.RW, timeout,
|
||||
MmcSubchannel.Rw, timeout,
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!mediaTest.CanReadCorrectedSubchannel);
|
||||
@@ -1445,14 +1445,14 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
|
||||
DicConsole.WriteLine("Trying to read subchannels with C2 Pointers...");
|
||||
mediaTest.CanReadPQSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0, 2662,
|
||||
1, MmcSectorTypes.CDDA, false, false,
|
||||
1, MmcSectorTypes.Cdda, false, false,
|
||||
false, MmcHeaderCodes.None, true,
|
||||
false, MmcErrorField.C2Pointers,
|
||||
MmcSubchannel.Q16, timeout,
|
||||
out duration);
|
||||
if(!mediaTest.CanReadPQSubchannelWithC2)
|
||||
mediaTest.CanReadPQSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0,
|
||||
2664, 1, MmcSectorTypes.CDDA,
|
||||
2664, 1, MmcSectorTypes.Cdda,
|
||||
false, false, false,
|
||||
MmcHeaderCodes.None, true, false,
|
||||
MmcErrorField.C2PointersAndBlock,
|
||||
@@ -1466,14 +1466,14 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
|
||||
mediaTest.CanReadRWSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0, 2712,
|
||||
1, MmcSectorTypes.CDDA, false, false,
|
||||
1, MmcSectorTypes.Cdda, false, false,
|
||||
false, MmcHeaderCodes.None, true,
|
||||
false, MmcErrorField.C2Pointers,
|
||||
MmcSubchannel.Raw, timeout,
|
||||
out duration);
|
||||
if(!mediaTest.CanReadRWSubchannelWithC2)
|
||||
mediaTest.CanReadRWSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0,
|
||||
2714, 1, MmcSectorTypes.CDDA,
|
||||
2714, 1, MmcSectorTypes.Cdda,
|
||||
false, false, false,
|
||||
MmcHeaderCodes.None, true, false,
|
||||
MmcErrorField.C2PointersAndBlock,
|
||||
@@ -1487,18 +1487,18 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
|
||||
mediaTest.CanReadCorrectedSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0,
|
||||
2712, 1, MmcSectorTypes.CDDA,
|
||||
2712, 1, MmcSectorTypes.Cdda,
|
||||
false, false, false,
|
||||
MmcHeaderCodes.None, true,
|
||||
false,
|
||||
MmcErrorField.C2Pointers,
|
||||
MmcSubchannel.RW, timeout,
|
||||
MmcSubchannel.Rw, timeout,
|
||||
out duration);
|
||||
if(!mediaTest.CanReadCorrectedSubchannelWithC2)
|
||||
mediaTest.CanReadCorrectedSubchannelWithC2 =
|
||||
!dev.ReadCd(out buffer, out senseBuffer, 0, 2714, 1, MmcSectorTypes.CDDA, false,
|
||||
!dev.ReadCd(out buffer, out senseBuffer, 0, 2714, 1, MmcSectorTypes.Cdda, false,
|
||||
false, false, MmcHeaderCodes.None, true, false,
|
||||
MmcErrorField.C2PointersAndBlock, MmcSubchannel.RW, timeout,
|
||||
MmcErrorField.C2PointersAndBlock, MmcSubchannel.Rw, timeout,
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!mediaTest.CanReadCorrectedSubchannelWithC2);
|
||||
@@ -1554,7 +1554,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
false, true,
|
||||
MmcHeaderCodes.AllHeaders, true,
|
||||
true, MmcErrorField.None,
|
||||
MmcSubchannel.RW, timeout,
|
||||
MmcSubchannel.Rw, timeout,
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!mediaTest.CanReadCorrectedSubchannel);
|
||||
@@ -1617,13 +1617,13 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
MmcHeaderCodes.AllHeaders,
|
||||
true, true,
|
||||
MmcErrorField.C2Pointers,
|
||||
MmcSubchannel.RW, timeout,
|
||||
MmcSubchannel.Rw, timeout,
|
||||
out duration);
|
||||
if(!mediaTest.CanReadCorrectedSubchannelWithC2)
|
||||
mediaTest.CanReadCorrectedSubchannelWithC2 =
|
||||
!dev.ReadCd(out buffer, out senseBuffer, 0, 2714, 1, MmcSectorTypes.AllTypes,
|
||||
false, false, true, MmcHeaderCodes.AllHeaders, true, true,
|
||||
MmcErrorField.C2PointersAndBlock, MmcSubchannel.RW, timeout,
|
||||
MmcErrorField.C2PointersAndBlock, MmcSubchannel.Rw, timeout,
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!mediaTest.CanReadCorrectedSubchannelWithC2);
|
||||
@@ -1678,7 +1678,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
1, MmcSectorTypes.AllTypes, false,
|
||||
false, false, MmcHeaderCodes.None,
|
||||
true, false, MmcErrorField.None,
|
||||
MmcSubchannel.RW, timeout,
|
||||
MmcSubchannel.Rw, timeout,
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!mediaTest.CanReadCorrectedSubchannel);
|
||||
@@ -1737,13 +1737,13 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
MmcHeaderCodes.None, true,
|
||||
false,
|
||||
MmcErrorField.C2Pointers,
|
||||
MmcSubchannel.RW, timeout,
|
||||
MmcSubchannel.Rw, timeout,
|
||||
out duration);
|
||||
if(!mediaTest.CanReadCorrectedSubchannelWithC2)
|
||||
mediaTest.CanReadCorrectedSubchannelWithC2 =
|
||||
!dev.ReadCd(out buffer, out senseBuffer, 0, 2440, 1, MmcSectorTypes.AllTypes,
|
||||
false, false, false, MmcHeaderCodes.None, true, false,
|
||||
MmcErrorField.C2PointersAndBlock, MmcSubchannel.RW, timeout,
|
||||
MmcErrorField.C2PointersAndBlock, MmcSubchannel.Rw, timeout,
|
||||
out duration);
|
||||
DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}",
|
||||
!mediaTest.CanReadCorrectedSubchannelWithC2);
|
||||
@@ -1755,7 +1755,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
|
||||
if(debug)
|
||||
{
|
||||
if(!tryNEC)
|
||||
if(!tryNec)
|
||||
{
|
||||
pressedKey = new ConsoleKeyInfo();
|
||||
while(pressedKey.Key != ConsoleKey.Y && pressedKey.Key != ConsoleKey.N)
|
||||
@@ -1766,7 +1766,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
DicConsole.WriteLine();
|
||||
}
|
||||
|
||||
tryNEC |= pressedKey.Key == ConsoleKey.Y;
|
||||
tryNec |= pressedKey.Key == ConsoleKey.Y;
|
||||
}
|
||||
|
||||
if(!tryPioneer)
|
||||
@@ -1825,7 +1825,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
mediaType + ".bin", "read results", buffer);
|
||||
}
|
||||
|
||||
if(tryNEC)
|
||||
if(tryNec)
|
||||
{
|
||||
mediaTest.SupportsNECReadCDDASpecified = true;
|
||||
DicConsole.WriteLine("Trying NEC READ CD-DA...");
|
||||
@@ -1863,7 +1863,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
|
||||
if(debug)
|
||||
{
|
||||
if(!tryHLDTST)
|
||||
if(!tryHldtst)
|
||||
{
|
||||
pressedKey = new ConsoleKeyInfo();
|
||||
while(pressedKey.Key != ConsoleKey.Y && pressedKey.Key != ConsoleKey.N)
|
||||
@@ -1874,7 +1874,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
DicConsole.WriteLine();
|
||||
}
|
||||
|
||||
tryHLDTST |= pressedKey.Key == ConsoleKey.Y;
|
||||
tryHldtst |= pressedKey.Key == ConsoleKey.Y;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1907,7 +1907,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
mediaTest.SupportsPlextorReadRawDVD = !ArrayHelpers.ArrayIsNullOrEmpty(buffer);
|
||||
}
|
||||
|
||||
if(tryHLDTST)
|
||||
if(tryHldtst)
|
||||
{
|
||||
mediaTest.SupportsHLDTSTReadRawDVDSpecified = true;
|
||||
DicConsole.WriteLine("Trying HL-DT-ST (aka LG) trick to raw read DVDs...");
|
||||
|
||||
@@ -38,7 +38,7 @@ using DiscImageChef.Metadata;
|
||||
|
||||
namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
{
|
||||
internal static class SSC
|
||||
internal static class Ssc
|
||||
{
|
||||
internal static void Report(Device dev, ref DeviceReport report, bool debug)
|
||||
{
|
||||
@@ -57,23 +57,23 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
sense = dev.ReadBlockLimits(out buffer, out senseBuffer, timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
Decoders.SCSI.SSC.BlockLimits.BlockLimitsData? decBL = Decoders.SCSI.SSC.BlockLimits.Decode(buffer);
|
||||
if(decBL.HasValue)
|
||||
Decoders.SCSI.SSC.BlockLimits.BlockLimitsData? decBl = Decoders.SCSI.SSC.BlockLimits.Decode(buffer);
|
||||
if(decBl.HasValue)
|
||||
{
|
||||
if(decBL.Value.granularity > 0)
|
||||
if(decBl.Value.granularity > 0)
|
||||
{
|
||||
report.SCSI.SequentialDevice.BlockSizeGranularitySpecified = true;
|
||||
report.SCSI.SequentialDevice.BlockSizeGranularity = decBL.Value.granularity;
|
||||
report.SCSI.SequentialDevice.BlockSizeGranularity = decBl.Value.granularity;
|
||||
}
|
||||
if(decBL.Value.maxBlockLen > 0)
|
||||
if(decBl.Value.maxBlockLen > 0)
|
||||
{
|
||||
report.SCSI.SequentialDevice.MaxBlockLengthSpecified = true;
|
||||
report.SCSI.SequentialDevice.MaxBlockLength = decBL.Value.maxBlockLen;
|
||||
report.SCSI.SequentialDevice.MaxBlockLength = decBl.Value.maxBlockLen;
|
||||
}
|
||||
if(decBL.Value.minBlockLen > 0)
|
||||
if(decBl.Value.minBlockLen > 0)
|
||||
{
|
||||
report.SCSI.SequentialDevice.MinBlockLengthSpecified = true;
|
||||
report.SCSI.SequentialDevice.MinBlockLength = decBL.Value.minBlockLen;
|
||||
report.SCSI.SequentialDevice.MinBlockLength = decBl.Value.minBlockLen;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -225,7 +225,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
if(!sense && !dev.Error)
|
||||
{
|
||||
report.SCSI.SupportsModeSense10 = true;
|
||||
decMode = Decoders.SCSI.Modes.DecodeMode10(buffer, dev.SCSIType);
|
||||
decMode = Decoders.SCSI.Modes.DecodeMode10(buffer, dev.ScsiType);
|
||||
if(debug) seqTest.ModeSense10Data = buffer;
|
||||
}
|
||||
|
||||
@@ -234,7 +234,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI
|
||||
if(!sense && !dev.Error)
|
||||
{
|
||||
report.SCSI.SupportsModeSense6 = true;
|
||||
if(!decMode.HasValue) decMode = Decoders.SCSI.Modes.DecodeMode6(buffer, dev.SCSIType);
|
||||
if(!decMode.HasValue) decMode = Decoders.SCSI.Modes.DecodeMode6(buffer, dev.ScsiType);
|
||||
if(debug) seqTest.ModeSense6Data = buffer;
|
||||
}
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
else if(dev.Type == DeviceType.SecureDigital) report.SecureDigital = new mmcsdType();
|
||||
|
||||
DicConsole.WriteLine("Trying to get CID...");
|
||||
bool sense = dev.ReadCID(out byte[] cid, out uint[] response, dev.Timeout, out double duration);
|
||||
bool sense = dev.ReadCid(out byte[] cid, out uint[] response, dev.Timeout, out double duration);
|
||||
|
||||
if(!sense)
|
||||
{
|
||||
@@ -77,7 +77,7 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
else DicConsole.WriteLine("Could not read CID...");
|
||||
|
||||
DicConsole.WriteLine("Trying to get CSD...");
|
||||
sense = dev.ReadCSD(out byte[] csd, out response, dev.Timeout, out duration);
|
||||
sense = dev.ReadCsd(out byte[] csd, out response, dev.Timeout, out duration);
|
||||
|
||||
if(!sense)
|
||||
{
|
||||
@@ -91,7 +91,7 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
if(dev.Type == DeviceType.MMC)
|
||||
{
|
||||
DicConsole.WriteLine("Trying to get OCR...");
|
||||
sense = dev.ReadOCR(out byte[] ocr, out response, dev.Timeout, out duration);
|
||||
sense = dev.ReadOcr(out byte[] ocr, out response, dev.Timeout, out duration);
|
||||
|
||||
if(!sense)
|
||||
{
|
||||
@@ -101,7 +101,7 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
else DicConsole.WriteLine("Could not read OCR...");
|
||||
|
||||
DicConsole.WriteLine("Trying to get Extended CSD...");
|
||||
sense = dev.ReadExtendedCSD(out byte[] ecsd, out response, dev.Timeout, out duration);
|
||||
sense = dev.ReadExtendedCsd(out byte[] ecsd, out response, dev.Timeout, out duration);
|
||||
|
||||
if(!sense)
|
||||
{
|
||||
@@ -113,7 +113,7 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
else if(dev.Type == DeviceType.SecureDigital)
|
||||
{
|
||||
DicConsole.WriteLine("Trying to get OCR...");
|
||||
sense = dev.ReadSDOCR(out byte[] ocr, out response, dev.Timeout, out duration);
|
||||
sense = dev.ReadSdocr(out byte[] ocr, out response, dev.Timeout, out duration);
|
||||
|
||||
if(!sense)
|
||||
{
|
||||
@@ -123,7 +123,7 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
else DicConsole.WriteLine("Could not read OCR...");
|
||||
|
||||
DicConsole.WriteLine("Trying to get SCR...");
|
||||
sense = dev.ReadSCR(out byte[] scr, out response, dev.Timeout, out duration);
|
||||
sense = dev.ReadScr(out byte[] scr, out response, dev.Timeout, out duration);
|
||||
|
||||
if(!sense)
|
||||
{
|
||||
|
||||
@@ -37,7 +37,7 @@ using DiscImageChef.Metadata;
|
||||
|
||||
namespace DiscImageChef.Core.Devices.Report
|
||||
{
|
||||
static class USB
|
||||
static class Usb
|
||||
{
|
||||
internal static void Report(Device dev, ref DeviceReport report, bool debug, ref bool removable)
|
||||
{
|
||||
@@ -54,10 +54,10 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
if(pressedKey.Key == ConsoleKey.Y)
|
||||
{
|
||||
report.USB = new usbType();
|
||||
report.USB.Manufacturer = dev.USBManufacturerString;
|
||||
report.USB.Product = dev.USBProductString;
|
||||
report.USB.ProductID = dev.USBProductID;
|
||||
report.USB.VendorID = dev.USBVendorID;
|
||||
report.USB.Manufacturer = dev.UsbManufacturerString;
|
||||
report.USB.Product = dev.UsbProductString;
|
||||
report.USB.ProductID = dev.UsbProductId;
|
||||
report.USB.VendorID = dev.UsbVendorId;
|
||||
|
||||
pressedKey = new ConsoleKeyInfo();
|
||||
while(pressedKey.Key != ConsoleKey.Y && pressedKey.Key != ConsoleKey.N)
|
||||
@@ -69,7 +69,7 @@ namespace DiscImageChef.Core.Devices.Report
|
||||
|
||||
report.USB.RemovableMedia = pressedKey.Key == ConsoleKey.Y;
|
||||
removable = report.USB.RemovableMedia;
|
||||
if(debug) report.USB.Descriptors = dev.USBDescriptors;
|
||||
if(debug) report.USB.Descriptors = dev.UsbDescriptors;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,17 +38,17 @@ using DiscImageChef.Devices;
|
||||
|
||||
namespace DiscImageChef.Core.Devices.Scanning
|
||||
{
|
||||
public static class ATA
|
||||
public static class Ata
|
||||
{
|
||||
public static ScanResults Scan(string MHDDLogPath, string IBGLogPath, string devicePath, Device dev)
|
||||
public static ScanResults Scan(string mhddLogPath, string ibgLogPath, string devicePath, Device dev)
|
||||
{
|
||||
ScanResults results = new ScanResults();
|
||||
bool aborted;
|
||||
MHDDLog mhddLog;
|
||||
IBGLog ibgLog;
|
||||
MhddLog mhddLog;
|
||||
IbgLog ibgLog;
|
||||
byte[] cmdBuf;
|
||||
bool sense;
|
||||
results.blocks = 0;
|
||||
results.Blocks = 0;
|
||||
ushort currentProfile = 0x0001;
|
||||
Decoders.ATA.AtaErrorRegistersCHS errorChs;
|
||||
uint timeout = 5;
|
||||
@@ -62,7 +62,7 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
// Initializate reader
|
||||
Reader ataReader = new Reader(dev, timeout, cmdBuf);
|
||||
// Fill reader blocks
|
||||
results.blocks = ataReader.GetDeviceBlocks();
|
||||
results.Blocks = ataReader.GetDeviceBlocks();
|
||||
if(ataReader.FindReadCommand())
|
||||
{
|
||||
DicConsole.ErrorWriteLine(ataReader.ErrorMessage);
|
||||
@@ -94,24 +94,24 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
results.D = 0; // >=50ms, <150ms
|
||||
results.E = 0; // >=150ms, <500ms
|
||||
results.F = 0; // >=500ms
|
||||
results.errored = 0;
|
||||
results.Errored = 0;
|
||||
DateTime start;
|
||||
DateTime end;
|
||||
results.processingTime = 0;
|
||||
results.ProcessingTime = 0;
|
||||
double currentSpeed = 0;
|
||||
results.maxSpeed = double.MinValue;
|
||||
results.minSpeed = double.MaxValue;
|
||||
results.unreadableSectors = new List<ulong>();
|
||||
results.seekMax = double.MinValue;
|
||||
results.seekMin = double.MaxValue;
|
||||
results.seekTotal = 0;
|
||||
const int seekTimes = 1000;
|
||||
results.MaxSpeed = double.MinValue;
|
||||
results.MinSpeed = double.MaxValue;
|
||||
results.UnreadableSectors = new List<ulong>();
|
||||
results.SeekMax = double.MinValue;
|
||||
results.SeekMin = double.MaxValue;
|
||||
results.SeekTotal = 0;
|
||||
const int SEEK_TIMES = 1000;
|
||||
|
||||
double seekCur = 0;
|
||||
|
||||
Random rnd = new Random();
|
||||
|
||||
uint seekPos = (uint)rnd.Next((int)results.blocks);
|
||||
uint seekPos = (uint)rnd.Next((int)results.Blocks);
|
||||
ushort seekCy = (ushort)rnd.Next(cylinders);
|
||||
byte seekHd = (byte)rnd.Next(heads);
|
||||
byte seekSc = (byte)rnd.Next(sectors);
|
||||
@@ -119,26 +119,26 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
aborted = false;
|
||||
System.Console.CancelKeyPress += (sender, e) => { e.Cancel = aborted = true; };
|
||||
|
||||
if(ataReader.IsLBA)
|
||||
if(ataReader.IsLba)
|
||||
{
|
||||
DicConsole.WriteLine("Reading {0} sectors at a time.", blocksToRead);
|
||||
|
||||
mhddLog = new MHDDLog(MHDDLogPath, dev, results.blocks, blockSize, blocksToRead);
|
||||
ibgLog = new IBGLog(IBGLogPath, currentProfile);
|
||||
mhddLog = new MhddLog(mhddLogPath, dev, results.Blocks, blockSize, blocksToRead);
|
||||
ibgLog = new IbgLog(ibgLogPath, currentProfile);
|
||||
|
||||
start = DateTime.UtcNow;
|
||||
for(ulong i = 0; i < results.blocks; i += blocksToRead)
|
||||
for(ulong i = 0; i < results.Blocks; i += blocksToRead)
|
||||
{
|
||||
if(aborted) break;
|
||||
|
||||
if((results.blocks - i) < blocksToRead) blocksToRead = (byte)(results.blocks - i);
|
||||
if((results.Blocks - i) < blocksToRead) blocksToRead = (byte)(results.Blocks - i);
|
||||
|
||||
#pragma warning disable RECS0018 // Comparison of floating point numbers with equality operator
|
||||
if(currentSpeed > results.maxSpeed && currentSpeed != 0) results.maxSpeed = currentSpeed;
|
||||
if(currentSpeed < results.minSpeed && currentSpeed != 0) results.minSpeed = currentSpeed;
|
||||
if(currentSpeed > results.MaxSpeed && currentSpeed != 0) results.MaxSpeed = currentSpeed;
|
||||
if(currentSpeed < results.MinSpeed && currentSpeed != 0) results.MinSpeed = currentSpeed;
|
||||
#pragma warning restore RECS0018 // Comparison of floating point numbers with equality operator
|
||||
|
||||
DicConsole.Write("\rReading sector {0} of {1} ({2:F3} MiB/sec.)", i, results.blocks,
|
||||
DicConsole.Write("\rReading sector {0} of {1} ({2:F3} MiB/sec.)", i, results.Blocks,
|
||||
currentSpeed);
|
||||
|
||||
bool error = ataReader.ReadBlocks(out cmdBuf, i, blocksToRead, out duration);
|
||||
@@ -157,8 +157,8 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
}
|
||||
else
|
||||
{
|
||||
results.errored += blocksToRead;
|
||||
for(ulong b = i; b < i + blocksToRead; b++) results.unreadableSectors.Add(b);
|
||||
results.Errored += blocksToRead;
|
||||
for(ulong b = i; b < i + blocksToRead; b++) results.UnreadableSectors.Add(b);
|
||||
|
||||
if(duration < 500) mhddLog.Write(i, 65535);
|
||||
else mhddLog.Write(i, duration);
|
||||
@@ -176,60 +176,60 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
DicConsole.WriteLine();
|
||||
mhddLog.Close();
|
||||
#pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values
|
||||
ibgLog.Close(dev, results.blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
|
||||
(((double)blockSize * (double)(results.blocks + 1)) / 1024) /
|
||||
(results.processingTime / 1000), devicePath);
|
||||
ibgLog.Close(dev, results.Blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
|
||||
(((double)blockSize * (double)(results.Blocks + 1)) / 1024) /
|
||||
(results.ProcessingTime / 1000), devicePath);
|
||||
#pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values
|
||||
|
||||
if(ataReader.CanSeekLBA)
|
||||
if(ataReader.CanSeekLba)
|
||||
{
|
||||
for(int i = 0; i < seekTimes; i++)
|
||||
for(int i = 0; i < SEEK_TIMES; i++)
|
||||
{
|
||||
if(aborted) break;
|
||||
|
||||
seekPos = (uint)rnd.Next((int)results.blocks);
|
||||
seekPos = (uint)rnd.Next((int)results.Blocks);
|
||||
|
||||
DicConsole.Write("\rSeeking to sector {0}...\t\t", seekPos);
|
||||
|
||||
ataReader.Seek(seekPos, out seekCur);
|
||||
|
||||
#pragma warning disable RECS0018 // Comparison of floating point numbers with equality operator
|
||||
if(seekCur > results.seekMax && seekCur != 0) results.seekMax = seekCur;
|
||||
if(seekCur < results.seekMin && seekCur != 0) results.seekMin = seekCur;
|
||||
if(seekCur > results.SeekMax && seekCur != 0) results.SeekMax = seekCur;
|
||||
if(seekCur < results.SeekMin && seekCur != 0) results.SeekMin = seekCur;
|
||||
#pragma warning restore RECS0018 // Comparison of floating point numbers with equality operator
|
||||
|
||||
results.seekTotal += seekCur;
|
||||
results.SeekTotal += seekCur;
|
||||
GC.Collect();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mhddLog = new MHDDLog(MHDDLogPath, dev, results.blocks, blockSize, blocksToRead);
|
||||
ibgLog = new IBGLog(IBGLogPath, currentProfile);
|
||||
mhddLog = new MhddLog(mhddLogPath, dev, results.Blocks, blockSize, blocksToRead);
|
||||
ibgLog = new IbgLog(ibgLogPath, currentProfile);
|
||||
|
||||
ulong currentBlock = 0;
|
||||
results.blocks = (ulong)(cylinders * heads * sectors);
|
||||
results.Blocks = (ulong)(cylinders * heads * sectors);
|
||||
start = DateTime.UtcNow;
|
||||
for(ushort Cy = 0; Cy < cylinders; Cy++)
|
||||
for(ushort cy = 0; cy < cylinders; cy++)
|
||||
{
|
||||
for(byte Hd = 0; Hd < heads; Hd++)
|
||||
for(byte hd = 0; hd < heads; hd++)
|
||||
{
|
||||
for(byte Sc = 1; Sc < sectors; Sc++)
|
||||
for(byte sc = 1; sc < sectors; sc++)
|
||||
{
|
||||
if(aborted) break;
|
||||
|
||||
#pragma warning disable RECS0018 // Comparison of floating point numbers with equality operator
|
||||
if(currentSpeed > results.maxSpeed && currentSpeed != 0)
|
||||
results.maxSpeed = currentSpeed;
|
||||
if(currentSpeed < results.minSpeed && currentSpeed != 0)
|
||||
results.minSpeed = currentSpeed;
|
||||
if(currentSpeed > results.MaxSpeed && currentSpeed != 0)
|
||||
results.MaxSpeed = currentSpeed;
|
||||
if(currentSpeed < results.MinSpeed && currentSpeed != 0)
|
||||
results.MinSpeed = currentSpeed;
|
||||
#pragma warning restore RECS0018 // Comparison of floating point numbers with equality operator
|
||||
|
||||
DicConsole.Write("\rReading cylinder {0} head {1} sector {2} ({3:F3} MiB/sec.)", Cy, Hd,
|
||||
Sc, currentSpeed);
|
||||
DicConsole.Write("\rReading cylinder {0} head {1} sector {2} ({3:F3} MiB/sec.)", cy, hd,
|
||||
sc, currentSpeed);
|
||||
|
||||
bool error = ataReader.ReadCHS(out cmdBuf, Cy, Hd, Sc, out duration);
|
||||
bool error = ataReader.ReadChs(out cmdBuf, cy, hd, sc, out duration);
|
||||
|
||||
if(!error)
|
||||
{
|
||||
@@ -245,8 +245,8 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
}
|
||||
else
|
||||
{
|
||||
results.errored += blocksToRead;
|
||||
results.unreadableSectors.Add(currentBlock);
|
||||
results.Errored += blocksToRead;
|
||||
results.UnreadableSectors.Add(currentBlock);
|
||||
if(duration < 500) mhddLog.Write(currentBlock, 65535);
|
||||
else mhddLog.Write(currentBlock, duration);
|
||||
|
||||
@@ -267,14 +267,14 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
DicConsole.WriteLine();
|
||||
mhddLog.Close();
|
||||
#pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values
|
||||
ibgLog.Close(dev, results.blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
|
||||
(((double)blockSize * (double)(results.blocks + 1)) / 1024) /
|
||||
(results.processingTime / 1000), devicePath);
|
||||
ibgLog.Close(dev, results.Blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
|
||||
(((double)blockSize * (double)(results.Blocks + 1)) / 1024) /
|
||||
(results.ProcessingTime / 1000), devicePath);
|
||||
#pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values
|
||||
|
||||
if(ataReader.CanSeek)
|
||||
{
|
||||
for(int i = 0; i < seekTimes; i++)
|
||||
for(int i = 0; i < SEEK_TIMES; i++)
|
||||
{
|
||||
if(aborted) break;
|
||||
|
||||
@@ -285,14 +285,14 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
DicConsole.Write("\rSeeking to cylinder {0}, head {1}, sector {2}...\t\t", seekCy, seekHd,
|
||||
seekSc);
|
||||
|
||||
ataReader.SeekCHS(seekCy, seekHd, seekSc, out seekCur);
|
||||
ataReader.SeekChs(seekCy, seekHd, seekSc, out seekCur);
|
||||
|
||||
#pragma warning disable RECS0018 // Comparison of floating point numbers with equality operator
|
||||
if(seekCur > results.seekMax && seekCur != 0) results.seekMax = seekCur;
|
||||
if(seekCur < results.seekMin && seekCur != 0) results.seekMin = seekCur;
|
||||
if(seekCur > results.SeekMax && seekCur != 0) results.SeekMax = seekCur;
|
||||
if(seekCur < results.SeekMin && seekCur != 0) results.SeekMin = seekCur;
|
||||
#pragma warning restore RECS0018 // Comparison of floating point numbers with equality operator
|
||||
|
||||
results.seekTotal += seekCur;
|
||||
results.SeekTotal += seekCur;
|
||||
GC.Collect();
|
||||
}
|
||||
}
|
||||
@@ -300,13 +300,13 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
|
||||
DicConsole.WriteLine();
|
||||
|
||||
results.processingTime /= 1000;
|
||||
results.totalTime = (end - start).TotalSeconds;
|
||||
results.ProcessingTime /= 1000;
|
||||
results.TotalTime = (end - start).TotalSeconds;
|
||||
#pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values
|
||||
results.avgSpeed = (((double)blockSize * (double)(results.blocks + 1)) / 1048576) /
|
||||
results.processingTime;
|
||||
results.AvgSpeed = (((double)blockSize * (double)(results.Blocks + 1)) / 1048576) /
|
||||
results.ProcessingTime;
|
||||
#pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values
|
||||
results.seekTimes = seekTimes;
|
||||
results.SeekTimes = SEEK_TIMES;
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
@@ -35,9 +35,9 @@ using DiscImageChef.Devices;
|
||||
|
||||
namespace DiscImageChef.Core.Devices.Scanning
|
||||
{
|
||||
public static class NVMe
|
||||
public static class Nvme
|
||||
{
|
||||
public static ScanResults Scan(string MHDDLogPath, string IBGLogPath, string devicePath, Device dev)
|
||||
public static ScanResults Scan(string mhddLogPath, string ibgLogPath, string devicePath, Device dev)
|
||||
{
|
||||
throw new NotImplementedException("NVMe devices not yet supported.");
|
||||
}
|
||||
|
||||
@@ -38,19 +38,19 @@ using DiscImageChef.Devices;
|
||||
|
||||
namespace DiscImageChef.Core.Devices.Scanning
|
||||
{
|
||||
public static class SCSI
|
||||
public static class Scsi
|
||||
{
|
||||
public static ScanResults Scan(string MHDDLogPath, string IBGLogPath, string devicePath, Device dev)
|
||||
public static ScanResults Scan(string mhddLogPath, string ibgLogPath, string devicePath, Device dev)
|
||||
{
|
||||
ScanResults results = new ScanResults();
|
||||
bool aborted;
|
||||
MHDDLog mhddLog;
|
||||
IBGLog ibgLog;
|
||||
MhddLog mhddLog;
|
||||
IbgLog ibgLog;
|
||||
byte[] cmdBuf;
|
||||
byte[] senseBuf;
|
||||
bool sense = false;
|
||||
double duration;
|
||||
results.blocks = 0;
|
||||
results.Blocks = 0;
|
||||
uint blockSize = 0;
|
||||
ushort currentProfile = 0x0001;
|
||||
|
||||
@@ -139,15 +139,15 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
|
||||
Reader scsiReader = null;
|
||||
|
||||
if(dev.SCSIType == Decoders.SCSI.PeripheralDeviceTypes.DirectAccess ||
|
||||
dev.SCSIType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice ||
|
||||
dev.SCSIType == Decoders.SCSI.PeripheralDeviceTypes.OCRWDevice ||
|
||||
dev.SCSIType == Decoders.SCSI.PeripheralDeviceTypes.OpticalDevice ||
|
||||
dev.SCSIType == Decoders.SCSI.PeripheralDeviceTypes.SimplifiedDevice ||
|
||||
dev.SCSIType == Decoders.SCSI.PeripheralDeviceTypes.WriteOnceDevice)
|
||||
if(dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.DirectAccess ||
|
||||
dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice ||
|
||||
dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.OCRWDevice ||
|
||||
dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.OpticalDevice ||
|
||||
dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.SimplifiedDevice ||
|
||||
dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.WriteOnceDevice)
|
||||
{
|
||||
scsiReader = new Reader(dev, dev.Timeout, null, false);
|
||||
results.blocks = scsiReader.GetDeviceBlocks();
|
||||
results.Blocks = scsiReader.GetDeviceBlocks();
|
||||
if(scsiReader.FindReadCommand())
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Unable to read medium.");
|
||||
@@ -156,24 +156,24 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
|
||||
blockSize = scsiReader.LogicalBlockSize;
|
||||
|
||||
if(results.blocks != 0 && blockSize != 0)
|
||||
if(results.Blocks != 0 && blockSize != 0)
|
||||
{
|
||||
results.blocks++;
|
||||
results.Blocks++;
|
||||
#pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values
|
||||
DicConsole.WriteLine("Media has {0} blocks of {1} bytes/each. (for a total of {2} bytes)",
|
||||
results.blocks, blockSize, results.blocks * (ulong)blockSize);
|
||||
results.Blocks, blockSize, results.Blocks * (ulong)blockSize);
|
||||
#pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values
|
||||
}
|
||||
}
|
||||
|
||||
if(dev.SCSIType == Decoders.SCSI.PeripheralDeviceTypes.SequentialAccess)
|
||||
if(dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.SequentialAccess)
|
||||
{
|
||||
DicConsole.WriteLine("Scanning will never be supported on SCSI Streaming Devices.");
|
||||
DicConsole.WriteLine("It has no sense to do it, and it will put too much strain on the tape.");
|
||||
return results;
|
||||
}
|
||||
|
||||
if(results.blocks == 0)
|
||||
if(results.Blocks == 0)
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Unable to read medium or empty medium present...");
|
||||
return results;
|
||||
@@ -182,7 +182,7 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
bool compactDisc = true;
|
||||
Decoders.CD.FullTOC.CDFullTOC? toc = null;
|
||||
|
||||
if(dev.SCSIType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
||||
if(dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
||||
{
|
||||
sense = dev.GetConfiguration(out cmdBuf, out senseBuf, 0, MmcGetConfigurationRt.Current, dev.Timeout,
|
||||
out duration);
|
||||
@@ -227,15 +227,15 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
results.D = 0; // >=50ms, <150ms
|
||||
results.E = 0; // >=150ms, <500ms
|
||||
results.F = 0; // >=500ms
|
||||
results.errored = 0;
|
||||
results.Errored = 0;
|
||||
DateTime start;
|
||||
DateTime end;
|
||||
results.processingTime = 0;
|
||||
results.totalTime = 0;
|
||||
results.ProcessingTime = 0;
|
||||
results.TotalTime = 0;
|
||||
double currentSpeed = 0;
|
||||
results.maxSpeed = double.MinValue;
|
||||
results.minSpeed = double.MaxValue;
|
||||
results.unreadableSectors = new List<ulong>();
|
||||
results.MaxSpeed = double.MinValue;
|
||||
results.MinSpeed = double.MaxValue;
|
||||
results.UnreadableSectors = new List<ulong>();
|
||||
|
||||
aborted = false;
|
||||
System.Console.CancelKeyPress += (sender, e) => { e.Cancel = aborted = true; };
|
||||
@@ -279,30 +279,30 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
|
||||
DicConsole.WriteLine("Reading {0} sectors at a time.", blocksToRead);
|
||||
|
||||
mhddLog = new MHDDLog(MHDDLogPath, dev, results.blocks, blockSize, blocksToRead);
|
||||
ibgLog = new IBGLog(IBGLogPath, currentProfile);
|
||||
mhddLog = new MhddLog(mhddLogPath, dev, results.Blocks, blockSize, blocksToRead);
|
||||
ibgLog = new IbgLog(ibgLogPath, currentProfile);
|
||||
|
||||
for(ulong i = 0; i < results.blocks; i += blocksToRead)
|
||||
for(ulong i = 0; i < results.Blocks; i += blocksToRead)
|
||||
{
|
||||
if(aborted) break;
|
||||
|
||||
double cmdDuration = 0;
|
||||
|
||||
if((results.blocks - i) < blocksToRead) blocksToRead = (uint)(results.blocks - i);
|
||||
if((results.Blocks - i) < blocksToRead) blocksToRead = (uint)(results.Blocks - i);
|
||||
|
||||
#pragma warning disable RECS0018 // Comparison of floating point numbers with equality operator
|
||||
if(currentSpeed > results.maxSpeed && currentSpeed != 0) results.maxSpeed = currentSpeed;
|
||||
if(currentSpeed < results.minSpeed && currentSpeed != 0) results.minSpeed = currentSpeed;
|
||||
if(currentSpeed > results.MaxSpeed && currentSpeed != 0) results.MaxSpeed = currentSpeed;
|
||||
if(currentSpeed < results.MinSpeed && currentSpeed != 0) results.MinSpeed = currentSpeed;
|
||||
#pragma warning restore RECS0018 // Comparison of floating point numbers with equality operator
|
||||
|
||||
DicConsole.Write("\rReading sector {0} of {1} ({2:F3} MiB/sec.)", i, results.blocks, currentSpeed);
|
||||
DicConsole.Write("\rReading sector {0} of {1} ({2:F3} MiB/sec.)", i, results.Blocks, currentSpeed);
|
||||
|
||||
if(readcd)
|
||||
{
|
||||
sense = dev.ReadCd(out readBuffer, out senseBuf, (uint)i, 2352, blocksToRead,
|
||||
MmcSectorTypes.AllTypes, false, false, true, MmcHeaderCodes.AllHeaders, true,
|
||||
true, MmcErrorField.None, MmcSubchannel.None, dev.Timeout, out cmdDuration);
|
||||
results.processingTime += cmdDuration;
|
||||
results.ProcessingTime += cmdDuration;
|
||||
}
|
||||
|
||||
if(!sense)
|
||||
@@ -332,8 +332,8 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
// are in a track where subchannel indicates data)
|
||||
(senseDecoded.Value.ASC != 0x64 || senseDecoded.Value.ASCQ != 0x00))
|
||||
{
|
||||
results.errored += blocksToRead;
|
||||
for(ulong b = i; b < i + blocksToRead; b++) results.unreadableSectors.Add(b);
|
||||
results.Errored += blocksToRead;
|
||||
for(ulong b = i; b < i + blocksToRead; b++) results.UnreadableSectors.Add(b);
|
||||
|
||||
if(cmdDuration < 500) mhddLog.Write(i, 65535);
|
||||
else mhddLog.Write(i, cmdDuration);
|
||||
@@ -343,8 +343,8 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
}
|
||||
else
|
||||
{
|
||||
results.errored += blocksToRead;
|
||||
for(ulong b = i; b < i + blocksToRead; b++) results.unreadableSectors.Add(b);
|
||||
results.Errored += blocksToRead;
|
||||
for(ulong b = i; b < i + blocksToRead; b++) results.UnreadableSectors.Add(b);
|
||||
|
||||
if(cmdDuration < 500) mhddLog.Write(i, 65535);
|
||||
else mhddLog.Write(i, cmdDuration);
|
||||
@@ -363,9 +363,9 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
DicConsole.WriteLine();
|
||||
mhddLog.Close();
|
||||
#pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values
|
||||
ibgLog.Close(dev, results.blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
|
||||
(((double)blockSize * (double)(results.blocks + 1)) / 1024) /
|
||||
(results.processingTime / 1000), devicePath);
|
||||
ibgLog.Close(dev, results.Blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
|
||||
(((double)blockSize * (double)(results.Blocks + 1)) / 1024) /
|
||||
(results.ProcessingTime / 1000), devicePath);
|
||||
#pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values
|
||||
}
|
||||
else
|
||||
@@ -374,26 +374,26 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
|
||||
DicConsole.WriteLine("Reading {0} sectors at a time.", blocksToRead);
|
||||
|
||||
mhddLog = new MHDDLog(MHDDLogPath, dev, results.blocks, blockSize, blocksToRead);
|
||||
ibgLog = new IBGLog(IBGLogPath, currentProfile);
|
||||
mhddLog = new MhddLog(mhddLogPath, dev, results.Blocks, blockSize, blocksToRead);
|
||||
ibgLog = new IbgLog(ibgLogPath, currentProfile);
|
||||
|
||||
for(ulong i = 0; i < results.blocks; i += blocksToRead)
|
||||
for(ulong i = 0; i < results.Blocks; i += blocksToRead)
|
||||
{
|
||||
if(aborted) break;
|
||||
|
||||
double cmdDuration = 0;
|
||||
|
||||
if((results.blocks - i) < blocksToRead) blocksToRead = (uint)(results.blocks - i);
|
||||
if((results.Blocks - i) < blocksToRead) blocksToRead = (uint)(results.Blocks - i);
|
||||
|
||||
#pragma warning disable RECS0018 // Comparison of floating point numbers with equality operator
|
||||
if(currentSpeed > results.maxSpeed && currentSpeed != 0) results.maxSpeed = currentSpeed;
|
||||
if(currentSpeed < results.minSpeed && currentSpeed != 0) results.minSpeed = currentSpeed;
|
||||
if(currentSpeed > results.MaxSpeed && currentSpeed != 0) results.MaxSpeed = currentSpeed;
|
||||
if(currentSpeed < results.MinSpeed && currentSpeed != 0) results.MinSpeed = currentSpeed;
|
||||
#pragma warning restore RECS0018 // Comparison of floating point numbers with equality operator
|
||||
|
||||
DicConsole.Write("\rReading sector {0} of {1} ({2:F3} MiB/sec.)", i, results.blocks, currentSpeed);
|
||||
DicConsole.Write("\rReading sector {0} of {1} ({2:F3} MiB/sec.)", i, results.Blocks, currentSpeed);
|
||||
|
||||
sense = scsiReader.ReadBlocks(out readBuffer, i, blocksToRead, out cmdDuration);
|
||||
results.processingTime += cmdDuration;
|
||||
results.ProcessingTime += cmdDuration;
|
||||
|
||||
if(!sense && !dev.Error)
|
||||
{
|
||||
@@ -410,8 +410,8 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
// TODO: Separate errors on kind of errors.
|
||||
else
|
||||
{
|
||||
results.errored += blocksToRead;
|
||||
for(ulong b = i; b < i + blocksToRead; b++) results.unreadableSectors.Add(b);
|
||||
results.Errored += blocksToRead;
|
||||
for(ulong b = i; b < i + blocksToRead; b++) results.UnreadableSectors.Add(b);
|
||||
|
||||
if(cmdDuration < 500) mhddLog.Write(i, 65535);
|
||||
else mhddLog.Write(i, cmdDuration);
|
||||
@@ -427,28 +427,28 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
DicConsole.WriteLine();
|
||||
mhddLog.Close();
|
||||
#pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values
|
||||
ibgLog.Close(dev, results.blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
|
||||
(((double)blockSize * (double)(results.blocks + 1)) / 1024) /
|
||||
(results.processingTime / 1000), devicePath);
|
||||
ibgLog.Close(dev, results.Blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
|
||||
(((double)blockSize * (double)(results.Blocks + 1)) / 1024) /
|
||||
(results.ProcessingTime / 1000), devicePath);
|
||||
#pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values
|
||||
}
|
||||
|
||||
results.seekMax = double.MinValue;
|
||||
results.seekMin = double.MaxValue;
|
||||
results.seekTotal = 0;
|
||||
const int seekTimes = 1000;
|
||||
results.SeekMax = double.MinValue;
|
||||
results.SeekMin = double.MaxValue;
|
||||
results.SeekTotal = 0;
|
||||
const int SEEK_TIMES = 1000;
|
||||
|
||||
double seekCur = 0;
|
||||
|
||||
Random rnd = new Random();
|
||||
|
||||
uint seekPos = (uint)rnd.Next((int)results.blocks);
|
||||
uint seekPos = (uint)rnd.Next((int)results.Blocks);
|
||||
|
||||
for(int i = 0; i < seekTimes; i++)
|
||||
for(int i = 0; i < SEEK_TIMES; i++)
|
||||
{
|
||||
if(aborted) break;
|
||||
|
||||
seekPos = (uint)rnd.Next((int)results.blocks);
|
||||
seekPos = (uint)rnd.Next((int)results.Blocks);
|
||||
|
||||
DicConsole.Write("\rSeeking to sector {0}...\t\t", seekPos);
|
||||
|
||||
@@ -456,22 +456,22 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
else scsiReader.ReadBlock(out readBuffer, seekPos, out seekCur);
|
||||
|
||||
#pragma warning disable RECS0018 // Comparison of floating point numbers with equality operator
|
||||
if(seekCur > results.seekMax && seekCur != 0) results.seekMax = seekCur;
|
||||
if(seekCur < results.seekMin && seekCur != 0) results.seekMin = seekCur;
|
||||
if(seekCur > results.SeekMax && seekCur != 0) results.SeekMax = seekCur;
|
||||
if(seekCur < results.SeekMin && seekCur != 0) results.SeekMin = seekCur;
|
||||
#pragma warning restore RECS0018 // Comparison of floating point numbers with equality operator
|
||||
|
||||
results.seekTotal += seekCur;
|
||||
results.SeekTotal += seekCur;
|
||||
GC.Collect();
|
||||
}
|
||||
|
||||
DicConsole.WriteLine();
|
||||
|
||||
results.processingTime /= 1000;
|
||||
results.totalTime = (end - start).TotalSeconds;
|
||||
results.ProcessingTime /= 1000;
|
||||
results.TotalTime = (end - start).TotalSeconds;
|
||||
#pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values
|
||||
results.avgSpeed = (((double)blockSize * (double)(results.blocks + 1)) / 1048576) / results.processingTime;
|
||||
results.AvgSpeed = (((double)blockSize * (double)(results.Blocks + 1)) / 1048576) / results.ProcessingTime;
|
||||
#pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values
|
||||
results.seekTimes = seekTimes;
|
||||
results.SeekTimes = SEEK_TIMES;
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
@@ -36,23 +36,23 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
{
|
||||
public struct ScanResults
|
||||
{
|
||||
public double totalTime;
|
||||
public double processingTime;
|
||||
public double avgSpeed;
|
||||
public double maxSpeed;
|
||||
public double minSpeed;
|
||||
public double TotalTime;
|
||||
public double ProcessingTime;
|
||||
public double AvgSpeed;
|
||||
public double MaxSpeed;
|
||||
public double MinSpeed;
|
||||
public ulong A;
|
||||
public ulong B;
|
||||
public ulong C;
|
||||
public ulong D;
|
||||
public ulong E;
|
||||
public ulong F;
|
||||
public List<ulong> unreadableSectors;
|
||||
public double seekMax;
|
||||
public double seekMin;
|
||||
public double seekTotal;
|
||||
public int seekTimes;
|
||||
public ulong blocks;
|
||||
public ulong errored;
|
||||
public List<ulong> UnreadableSectors;
|
||||
public double SeekMax;
|
||||
public double SeekMin;
|
||||
public double SeekTotal;
|
||||
public int SeekTimes;
|
||||
public ulong Blocks;
|
||||
public ulong Errored;
|
||||
}
|
||||
}
|
||||
@@ -41,15 +41,15 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
{
|
||||
public static class SecureDigital
|
||||
{
|
||||
public static ScanResults Scan(string MHDDLogPath, string IBGLogPath, string devicePath, Device dev)
|
||||
public static ScanResults Scan(string mhddLogPath, string ibgLogPath, string devicePath, Device dev)
|
||||
{
|
||||
ScanResults results = new ScanResults();
|
||||
bool aborted;
|
||||
MHDDLog mhddLog;
|
||||
IBGLog ibgLog;
|
||||
MhddLog mhddLog;
|
||||
IbgLog ibgLog;
|
||||
byte[] cmdBuf;
|
||||
bool sense;
|
||||
results.blocks = 0;
|
||||
results.Blocks = 0;
|
||||
uint[] response;
|
||||
uint timeout = 5;
|
||||
double duration = 0;
|
||||
@@ -63,24 +63,24 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
ExtendedCSD ecsd = new ExtendedCSD();
|
||||
CSD csd = new CSD();
|
||||
|
||||
sense = dev.ReadExtendedCSD(out cmdBuf, out response, timeout, out duration);
|
||||
sense = dev.ReadExtendedCsd(out cmdBuf, out response, timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
ecsd = Decoders.MMC.Decoders.DecodeExtendedCSD(cmdBuf);
|
||||
blocksToRead = ecsd.OptimalReadSize;
|
||||
results.blocks = ecsd.SectorCount;
|
||||
results.Blocks = ecsd.SectorCount;
|
||||
blockSize = (uint)(ecsd.SectorSize == 1 ? 4096 : 512);
|
||||
// Supposing it's high-capacity MMC if it has Extended CSD...
|
||||
byteAddressed = false;
|
||||
}
|
||||
|
||||
if(sense || results.blocks == 0)
|
||||
if(sense || results.Blocks == 0)
|
||||
{
|
||||
sense = dev.ReadCSD(out cmdBuf, out response, timeout, out duration);
|
||||
sense = dev.ReadCsd(out cmdBuf, out response, timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
csd = Decoders.MMC.Decoders.DecodeCSD(cmdBuf);
|
||||
results.blocks = (ulong)((csd.Size + 1) * Math.Pow(2, csd.SizeMultiplier + 2));
|
||||
results.Blocks = (ulong)((csd.Size + 1) * Math.Pow(2, csd.SizeMultiplier + 2));
|
||||
blockSize = (uint)Math.Pow(2, csd.ReadBlockLength);
|
||||
}
|
||||
}
|
||||
@@ -89,11 +89,11 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
{
|
||||
Decoders.SecureDigital.CSD csd = new Decoders.SecureDigital.CSD();
|
||||
|
||||
sense = dev.ReadCSD(out cmdBuf, out response, timeout, out duration);
|
||||
sense = dev.ReadCsd(out cmdBuf, out response, timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
csd = Decoders.SecureDigital.Decoders.DecodeCSD(cmdBuf);
|
||||
results.blocks = (ulong)(csd.Structure == 0
|
||||
results.Blocks = (ulong)(csd.Structure == 0
|
||||
? (csd.Size + 1) * Math.Pow(2, csd.SizeMultiplier + 2)
|
||||
: (csd.Size + 1) * 1024);
|
||||
blockSize = (uint)Math.Pow(2, csd.ReadBlockLength);
|
||||
@@ -102,7 +102,7 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
}
|
||||
}
|
||||
|
||||
if(results.blocks == 0)
|
||||
if(results.Blocks == 0)
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Unable to get device size.");
|
||||
return results;
|
||||
@@ -133,46 +133,46 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
results.D = 0; // >=50ms, <150ms
|
||||
results.E = 0; // >=150ms, <500ms
|
||||
results.F = 0; // >=500ms
|
||||
results.errored = 0;
|
||||
results.Errored = 0;
|
||||
DateTime start;
|
||||
DateTime end;
|
||||
results.processingTime = 0;
|
||||
results.ProcessingTime = 0;
|
||||
double currentSpeed = 0;
|
||||
results.maxSpeed = double.MinValue;
|
||||
results.minSpeed = double.MaxValue;
|
||||
results.unreadableSectors = new List<ulong>();
|
||||
results.seekMax = double.MinValue;
|
||||
results.seekMin = double.MaxValue;
|
||||
results.seekTotal = 0;
|
||||
const int seekTimes = 1000;
|
||||
results.MaxSpeed = double.MinValue;
|
||||
results.MinSpeed = double.MaxValue;
|
||||
results.UnreadableSectors = new List<ulong>();
|
||||
results.SeekMax = double.MinValue;
|
||||
results.SeekMin = double.MaxValue;
|
||||
results.SeekTotal = 0;
|
||||
const int SEEK_TIMES = 1000;
|
||||
|
||||
double seekCur = 0;
|
||||
|
||||
Random rnd = new Random();
|
||||
|
||||
uint seekPos = (uint)rnd.Next((int)results.blocks);
|
||||
uint seekPos = (uint)rnd.Next((int)results.Blocks);
|
||||
|
||||
aborted = false;
|
||||
System.Console.CancelKeyPress += (sender, e) => { e.Cancel = aborted = true; };
|
||||
|
||||
DicConsole.WriteLine("Reading {0} sectors at a time.", blocksToRead);
|
||||
|
||||
mhddLog = new MHDDLog(MHDDLogPath, dev, results.blocks, blockSize, blocksToRead);
|
||||
ibgLog = new IBGLog(IBGLogPath, currentProfile);
|
||||
mhddLog = new MhddLog(mhddLogPath, dev, results.Blocks, blockSize, blocksToRead);
|
||||
ibgLog = new IbgLog(ibgLogPath, currentProfile);
|
||||
|
||||
start = DateTime.UtcNow;
|
||||
for(ulong i = 0; i < results.blocks; i += blocksToRead)
|
||||
for(ulong i = 0; i < results.Blocks; i += blocksToRead)
|
||||
{
|
||||
if(aborted) break;
|
||||
|
||||
if((results.blocks - i) < blocksToRead) blocksToRead = (byte)(results.blocks - i);
|
||||
if((results.Blocks - i) < blocksToRead) blocksToRead = (byte)(results.Blocks - i);
|
||||
|
||||
#pragma warning disable RECS0018 // Comparison of floating point numbers with equality operator
|
||||
if(currentSpeed > results.maxSpeed && currentSpeed != 0) results.maxSpeed = currentSpeed;
|
||||
if(currentSpeed < results.minSpeed && currentSpeed != 0) results.minSpeed = currentSpeed;
|
||||
if(currentSpeed > results.MaxSpeed && currentSpeed != 0) results.MaxSpeed = currentSpeed;
|
||||
if(currentSpeed < results.MinSpeed && currentSpeed != 0) results.MinSpeed = currentSpeed;
|
||||
#pragma warning restore RECS0018 // Comparison of floating point numbers with equality operator
|
||||
|
||||
DicConsole.Write("\rReading sector {0} of {1} ({2:F3} MiB/sec.)", i, results.blocks, currentSpeed);
|
||||
DicConsole.Write("\rReading sector {0} of {1} ({2:F3} MiB/sec.)", i, results.Blocks, currentSpeed);
|
||||
|
||||
bool error = dev.Read(out cmdBuf, out response, (uint)i, blockSize, blocksToRead, byteAddressed,
|
||||
timeout, out duration);
|
||||
@@ -191,8 +191,8 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
}
|
||||
else
|
||||
{
|
||||
results.errored += blocksToRead;
|
||||
for(ulong b = i; b < i + blocksToRead; b++) results.unreadableSectors.Add(b);
|
||||
results.Errored += blocksToRead;
|
||||
for(ulong b = i; b < i + blocksToRead; b++) results.UnreadableSectors.Add(b);
|
||||
|
||||
if(duration < 500) mhddLog.Write(i, 65535);
|
||||
else mhddLog.Write(i, duration);
|
||||
@@ -210,16 +210,16 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
DicConsole.WriteLine();
|
||||
mhddLog.Close();
|
||||
#pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values
|
||||
ibgLog.Close(dev, results.blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
|
||||
(((double)blockSize * (double)(results.blocks + 1)) / 1024) / (results.processingTime / 1000),
|
||||
ibgLog.Close(dev, results.Blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024,
|
||||
(((double)blockSize * (double)(results.Blocks + 1)) / 1024) / (results.ProcessingTime / 1000),
|
||||
devicePath);
|
||||
#pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values
|
||||
|
||||
for(int i = 0; i < seekTimes; i++)
|
||||
for(int i = 0; i < SEEK_TIMES; i++)
|
||||
{
|
||||
if(aborted) break;
|
||||
|
||||
seekPos = (uint)rnd.Next((int)results.blocks);
|
||||
seekPos = (uint)rnd.Next((int)results.Blocks);
|
||||
|
||||
DicConsole.Write("\rSeeking to sector {0}...\t\t", seekPos);
|
||||
|
||||
@@ -227,22 +227,22 @@ namespace DiscImageChef.Core.Devices.Scanning
|
||||
out seekCur);
|
||||
|
||||
#pragma warning disable RECS0018 // Comparison of floating point numbers with equality operator
|
||||
if(seekCur > results.seekMax && seekCur != 0) results.seekMax = seekCur;
|
||||
if(seekCur < results.seekMin && seekCur != 0) results.seekMin = seekCur;
|
||||
if(seekCur > results.SeekMax && seekCur != 0) results.SeekMax = seekCur;
|
||||
if(seekCur < results.SeekMin && seekCur != 0) results.SeekMin = seekCur;
|
||||
#pragma warning restore RECS0018 // Comparison of floating point numbers with equality operator
|
||||
|
||||
results.seekTotal += seekCur;
|
||||
results.SeekTotal += seekCur;
|
||||
GC.Collect();
|
||||
}
|
||||
|
||||
DicConsole.WriteLine();
|
||||
|
||||
results.processingTime /= 1000;
|
||||
results.totalTime = (end - start).TotalSeconds;
|
||||
results.ProcessingTime /= 1000;
|
||||
results.TotalTime = (end - start).TotalSeconds;
|
||||
#pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values
|
||||
results.avgSpeed = (((double)blockSize * (double)(results.blocks + 1)) / 1048576) / results.processingTime;
|
||||
results.AvgSpeed = (((double)blockSize * (double)(results.Blocks + 1)) / 1048576) / results.ProcessingTime;
|
||||
#pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values
|
||||
results.seekTimes = seekTimes;
|
||||
results.SeekTimes = SEEK_TIMES;
|
||||
|
||||
return results;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user