REFACTOR: Fixed MOST name inconsistencies.

This commit is contained in:
2017-12-20 17:15:26 +00:00
parent 542520f5cd
commit a4650c61aa
428 changed files with 16205 additions and 16320 deletions

View File

@@ -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;

View File

@@ -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)
{

View File

@@ -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);

View File

@@ -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);
}
}

View File

@@ -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,

View File

@@ -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();

View File

@@ -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";
}

View File

@@ -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);
}
}

View File

@@ -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)

View File

@@ -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

View File

@@ -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