mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
REFACTOR: Use preferred braces style.
This commit is contained in:
@@ -64,7 +64,6 @@ namespace DiscImageChef.Commands
|
||||
Encoding encoding = null;
|
||||
|
||||
if(options.EncodingName != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
encoding = Claunia.Encoding.Encoding.GetEncoding(options.EncodingName);
|
||||
@@ -76,7 +75,6 @@ namespace DiscImageChef.Commands
|
||||
encoding = null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
PluginBase plugins = new PluginBase();
|
||||
plugins.RegisterAllPlugins(encoding);
|
||||
@@ -99,10 +97,8 @@ namespace DiscImageChef.Commands
|
||||
else
|
||||
{
|
||||
if(options.Verbose)
|
||||
{
|
||||
DicConsole.VerboseWriteLine("Image format identified by {0} ({1}).", imageFormat.Name,
|
||||
imageFormat.PluginUuid);
|
||||
}
|
||||
else DicConsole.WriteLine("Image format identified by {0}.", imageFormat.Name);
|
||||
}
|
||||
|
||||
@@ -179,7 +175,6 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.WriteLine(string.Format("Identified by {0} plugins", idPlugins.Count));
|
||||
|
||||
foreach(string pluginName in idPlugins)
|
||||
{
|
||||
if(plugins.PluginsList.TryGetValue(pluginName, out plugin))
|
||||
{
|
||||
DicConsole.WriteLine(string.Format("As identified by {0}.", plugin.Name));
|
||||
@@ -187,7 +182,6 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.Write(information);
|
||||
Core.Statistics.AddFilesystem(plugin.XmlFSType.Type);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -218,7 +212,6 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.WriteLine(string.Format("Identified by {0} plugins", idPlugins.Count));
|
||||
|
||||
foreach(string pluginName in idPlugins)
|
||||
{
|
||||
if(plugins.PluginsList.TryGetValue(pluginName, out plugin))
|
||||
{
|
||||
DicConsole.WriteLine(string.Format("As identified by {0}.", plugin.Name));
|
||||
@@ -226,7 +219,6 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.Write(information);
|
||||
Core.Statistics.AddFilesystem(plugin.XmlFSType.Type);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -102,7 +102,6 @@ namespace DiscImageChef.Commands
|
||||
Core.Checksum mediaChecksum = null;
|
||||
|
||||
if(inputFormat.ImageInfo.ImageHasPartitions)
|
||||
{
|
||||
try
|
||||
{
|
||||
Core.Checksum trackChecksum = null;
|
||||
@@ -115,7 +114,6 @@ namespace DiscImageChef.Commands
|
||||
foreach(Track currentTrack in inputTracks)
|
||||
{
|
||||
if(currentTrack.TrackStartSector - previousTrackEnd != 0 && options.WholeDisc)
|
||||
{
|
||||
for(ulong i = previousTrackEnd + 1; i < currentTrack.TrackStartSector; i++)
|
||||
{
|
||||
DicConsole.Write("\rHashing track-less sector {0}", i);
|
||||
@@ -124,7 +122,6 @@ namespace DiscImageChef.Commands
|
||||
|
||||
mediaChecksum.Update(hiddenSector);
|
||||
}
|
||||
}
|
||||
|
||||
DicConsole.DebugWriteLine("Checksum command",
|
||||
"Track {0} starts at sector {1} and ends at sector {2}",
|
||||
@@ -166,19 +163,14 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.WriteLine();
|
||||
|
||||
if(options.SeparatedTracks)
|
||||
{
|
||||
foreach(ChecksumType chk in trackChecksum.End())
|
||||
{
|
||||
DicConsole.WriteLine("Track {0}'s {1}: {2}", currentTrack.TrackSequence, chk.type,
|
||||
chk.Value);
|
||||
}
|
||||
}
|
||||
|
||||
previousTrackEnd = currentTrack.TrackEndSector;
|
||||
}
|
||||
|
||||
if(inputFormat.GetSectors() - previousTrackEnd != 0 && options.WholeDisc)
|
||||
{
|
||||
for(ulong i = previousTrackEnd + 1; i < inputFormat.GetSectors(); i++)
|
||||
{
|
||||
DicConsole.Write("\rHashing track-less sector {0}", i);
|
||||
@@ -186,20 +178,16 @@ namespace DiscImageChef.Commands
|
||||
byte[] hiddenSector = inputFormat.ReadSector(i);
|
||||
mediaChecksum.Update(hiddenSector);
|
||||
}
|
||||
}
|
||||
|
||||
if(options.WholeDisc)
|
||||
{
|
||||
foreach(ChecksumType chk in mediaChecksum.End())
|
||||
DicConsole.WriteLine("Disk's {0}: {1}", chk.type, chk.Value);
|
||||
}
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
if(options.Debug) DicConsole.DebugWriteLine("Could not get tracks because {0}", ex.Message);
|
||||
else DicConsole.WriteLine("Unable to get separate tracks, not checksumming them");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
mediaChecksum = new Core.Checksum(enabledChecksums);
|
||||
|
||||
@@ -77,10 +77,8 @@ namespace DiscImageChef.Commands
|
||||
else
|
||||
{
|
||||
if(options.Verbose)
|
||||
{
|
||||
DicConsole.VerboseWriteLine("Input file 1 format identified by {0} ({1}).", input1Format.Name,
|
||||
input1Format.PluginUuid);
|
||||
}
|
||||
else DicConsole.WriteLine("Input file 1 format identified by {0}.", input1Format.Name);
|
||||
}
|
||||
|
||||
@@ -92,10 +90,8 @@ namespace DiscImageChef.Commands
|
||||
else
|
||||
{
|
||||
if(options.Verbose)
|
||||
{
|
||||
DicConsole.VerboseWriteLine("Input file 2 format identified by {0} ({1}).", input2Format.Name,
|
||||
input2Format.PluginUuid);
|
||||
}
|
||||
else DicConsole.WriteLine("Input file 2 format identified by {0}.", input2Format.Name);
|
||||
}
|
||||
|
||||
@@ -295,10 +291,8 @@ namespace DiscImageChef.Commands
|
||||
sb.AppendFormat("Drive serial number\t{0}\t{1}", image1Info.DriveSerialNumber,
|
||||
image2Info.DriveSerialNumber).AppendLine();
|
||||
foreach(MediaTagType disktag in Enum.GetValues(typeof(MediaTagType)))
|
||||
{
|
||||
sb.AppendFormat("Has {0}?\t{1}\t{2}", disktag, image1DiskTags.ContainsKey(disktag),
|
||||
image2DiskTags.ContainsKey(disktag)).AppendLine();
|
||||
}
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Comparing disk image characteristics");
|
||||
|
||||
@@ -57,7 +57,6 @@ namespace DiscImageChef.Commands
|
||||
Encoding encoding = null;
|
||||
|
||||
if(options.EncodingName != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
encoding = Claunia.Encoding.Encoding.GetEncoding(options.EncodingName);
|
||||
@@ -69,7 +68,6 @@ namespace DiscImageChef.Commands
|
||||
encoding = null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(File.Exists(options.InputFile))
|
||||
{
|
||||
@@ -102,10 +100,8 @@ namespace DiscImageChef.Commands
|
||||
else
|
||||
{
|
||||
if(options.Verbose)
|
||||
{
|
||||
DicConsole.VerboseWriteLine("Image format identified by {0} ({1}).", imageFormat.Name,
|
||||
imageFormat.PluginUuid);
|
||||
}
|
||||
else DicConsole.WriteLine("Image format identified by {0}.", imageFormat.Name);
|
||||
}
|
||||
|
||||
|
||||
@@ -72,13 +72,10 @@ namespace DiscImageChef.Commands
|
||||
Core.Statistics.AddFilter(inputFilter.Name);
|
||||
|
||||
if(options.DiskTags)
|
||||
{
|
||||
if(inputFormat.ImageInfo.ReadableMediaTags.Count == 0)
|
||||
DicConsole.WriteLine("There are no disk tags in chosen disc image.");
|
||||
else
|
||||
{
|
||||
foreach(MediaTagType tag in inputFormat.ImageInfo.ReadableMediaTags)
|
||||
{
|
||||
switch(tag)
|
||||
{
|
||||
case MediaTagType.SCSI_INQUIRY:
|
||||
@@ -117,10 +114,8 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
byte[] identify = inputFormat.ReadDiskTag(MediaTagType.ATAPI_IDENTIFY);
|
||||
if(identify == null)
|
||||
{
|
||||
DicConsole
|
||||
.WriteLine("Error reading ATA IDENTIFY PACKET DEVICE response from disc image");
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole.WriteLine("ATA IDENTIFY PACKET DEVICE command response:");
|
||||
@@ -228,9 +223,6 @@ namespace DiscImageChef.Commands
|
||||
tag);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(options.SectorTags)
|
||||
{
|
||||
@@ -250,9 +242,7 @@ namespace DiscImageChef.Commands
|
||||
if(inputFormat.ImageInfo.ReadableSectorTags.Count == 0)
|
||||
DicConsole.WriteLine("There are no sector tags in chosen disc image.");
|
||||
else
|
||||
{
|
||||
foreach(SectorTagType tag in inputFormat.ImageInfo.ReadableSectorTags)
|
||||
{
|
||||
switch(tag)
|
||||
{
|
||||
default:
|
||||
@@ -260,8 +250,6 @@ namespace DiscImageChef.Commands
|
||||
tag);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Core.Statistics.AddCommand("decode");
|
||||
|
||||
@@ -90,9 +90,7 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.WriteLine("PCMCIA CIS is {0} bytes", dev.Cis.Length);
|
||||
Decoders.PCMCIA.Tuple[] tuples = Decoders.PCMCIA.CIS.GetTuples(dev.Cis);
|
||||
if(tuples != null)
|
||||
{
|
||||
foreach(Decoders.PCMCIA.Tuple tuple in tuples)
|
||||
{
|
||||
switch(tuple.Code)
|
||||
{
|
||||
case Decoders.PCMCIA.TupleCodes.CISTPL_NULL:
|
||||
@@ -151,8 +149,6 @@ namespace DiscImageChef.Commands
|
||||
(byte)tuple.Code);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else DicConsole.DebugWriteLine("Device-Info command", "Could not get tuples");
|
||||
}
|
||||
|
||||
@@ -289,9 +285,7 @@ namespace DiscImageChef.Commands
|
||||
byte[] pages = Decoders.SCSI.EVPD.DecodePage00(inqBuf);
|
||||
|
||||
if(pages != null)
|
||||
{
|
||||
foreach(byte page in pages)
|
||||
{
|
||||
if(page >= 0x01 && page <= 0x7F)
|
||||
{
|
||||
sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page);
|
||||
@@ -582,15 +576,11 @@ namespace DiscImageChef.Commands
|
||||
|
||||
sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page);
|
||||
if(!sense)
|
||||
{
|
||||
DataFile.WriteTo("Device-Info command", options.OutputPrefix,
|
||||
string.Format("_scsi_evpd_{0:X2}h.bin", page),
|
||||
string.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
byte[] modeBuf;
|
||||
@@ -602,10 +592,8 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ModeSense10(out modeBuf, out senseBuf, false, true, ScsiModeSensePageControl.Current,
|
||||
0x3F, 0xFF, 5, out duration);
|
||||
if(sense || dev.Error)
|
||||
{
|
||||
sense = dev.ModeSense10(out modeBuf, out senseBuf, false, true,
|
||||
ScsiModeSensePageControl.Current, 0x3F, 0x00, 5, out duration);
|
||||
}
|
||||
|
||||
if(!sense && !dev.Error) decMode = Decoders.SCSI.Modes.DecodeMode10(modeBuf, devType);
|
||||
|
||||
@@ -614,29 +602,23 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ModeSense6(out modeBuf, out senseBuf, false, ScsiModeSensePageControl.Current, 0x3F,
|
||||
0xFF, 5, out duration);
|
||||
if(sense || dev.Error)
|
||||
{
|
||||
sense = dev.ModeSense6(out modeBuf, out senseBuf, false, ScsiModeSensePageControl.Current,
|
||||
0x3F, 0x00, 5, out duration);
|
||||
}
|
||||
if(sense || dev.Error) sense = dev.ModeSense(out modeBuf, out senseBuf, 5, out duration);
|
||||
|
||||
if(!sense && !dev.Error) decMode = Decoders.SCSI.Modes.DecodeMode6(modeBuf, devType);
|
||||
}
|
||||
|
||||
if(!sense)
|
||||
{
|
||||
DataFile.WriteTo("Device-Info command", options.OutputPrefix, "_scsi_modesense.bin",
|
||||
"SCSI MODE SENSE", modeBuf);
|
||||
}
|
||||
|
||||
if(decMode.HasValue)
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModeHeader(decMode.Value.Header, devType));
|
||||
|
||||
if(decMode.Value.Pages != null)
|
||||
{
|
||||
foreach(Decoders.SCSI.Modes.ModePage page in decMode.Value.Pages)
|
||||
{
|
||||
//DicConsole.WriteLine("Page {0:X2}h subpage {1:X2}h is {2} bytes long", page.Page, page.Subpage, page.PageResponse.Length);
|
||||
switch(page.Page)
|
||||
{
|
||||
@@ -644,42 +626,30 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
if(devType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice &&
|
||||
page.Subpage == 0)
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_00_SFF(page.PageResponse));
|
||||
}
|
||||
else
|
||||
{
|
||||
if(page.Subpage != 0)
|
||||
{
|
||||
DicConsole
|
||||
.WriteLine("Found unknown vendor mode page {0:X2}h subpage {1:X2}h",
|
||||
page.Page, page.Subpage);
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole.WriteLine("Found unknown vendor mode page {0:X2}h",
|
||||
page.Page);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 0x01:
|
||||
{
|
||||
if(page.Subpage == 0)
|
||||
{
|
||||
if(devType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_01_MMC(page
|
||||
.PageResponse));
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_01(page.PageResponse));
|
||||
}
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -687,10 +657,8 @@ namespace DiscImageChef.Commands
|
||||
case 0x02:
|
||||
{
|
||||
if(page.Subpage == 0)
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_02(page.PageResponse));
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -698,10 +666,8 @@ namespace DiscImageChef.Commands
|
||||
case 0x03:
|
||||
{
|
||||
if(page.Subpage == 0)
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_03(page.PageResponse));
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -709,10 +675,8 @@ namespace DiscImageChef.Commands
|
||||
case 0x04:
|
||||
{
|
||||
if(page.Subpage == 0)
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_04(page.PageResponse));
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -720,10 +684,8 @@ namespace DiscImageChef.Commands
|
||||
case 0x05:
|
||||
{
|
||||
if(page.Subpage == 0)
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_05(page.PageResponse));
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -731,10 +693,8 @@ namespace DiscImageChef.Commands
|
||||
case 0x06:
|
||||
{
|
||||
if(page.Subpage == 0)
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_06(page.PageResponse));
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -742,19 +702,13 @@ namespace DiscImageChef.Commands
|
||||
case 0x07:
|
||||
{
|
||||
if(page.Subpage == 0)
|
||||
{
|
||||
if(devType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_07_MMC(page
|
||||
.PageResponse));
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_07(page.PageResponse));
|
||||
}
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -762,10 +716,8 @@ namespace DiscImageChef.Commands
|
||||
case 0x08:
|
||||
{
|
||||
if(page.Subpage == 0)
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_08(page.PageResponse));
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -773,15 +725,11 @@ namespace DiscImageChef.Commands
|
||||
case 0x0A:
|
||||
{
|
||||
if(page.Subpage == 0)
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_0A(page.PageResponse));
|
||||
}
|
||||
else if(page.Subpage == 1)
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_0A_S01(page.PageResponse));
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -789,10 +737,8 @@ namespace DiscImageChef.Commands
|
||||
case 0x0B:
|
||||
{
|
||||
if(page.Subpage == 0)
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_0B(page.PageResponse));
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -800,10 +746,8 @@ namespace DiscImageChef.Commands
|
||||
case 0x0D:
|
||||
{
|
||||
if(page.Subpage == 0)
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_0D(page.PageResponse));
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -811,10 +755,8 @@ namespace DiscImageChef.Commands
|
||||
case 0x0E:
|
||||
{
|
||||
if(page.Subpage == 0)
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_0E(page.PageResponse));
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -822,10 +764,8 @@ namespace DiscImageChef.Commands
|
||||
case 0x0F:
|
||||
{
|
||||
if(page.Subpage == 0)
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_0F(page.PageResponse));
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -833,19 +773,13 @@ namespace DiscImageChef.Commands
|
||||
case 0x10:
|
||||
{
|
||||
if(page.Subpage == 0)
|
||||
{
|
||||
if(devType == Decoders.SCSI.PeripheralDeviceTypes.SequentialAccess)
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_10_SSC(page
|
||||
.PageResponse));
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_10(page.PageResponse));
|
||||
}
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -853,10 +787,8 @@ namespace DiscImageChef.Commands
|
||||
case 0x11:
|
||||
{
|
||||
if(page.Subpage == 0)
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_11(page.PageResponse));
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -866,11 +798,9 @@ namespace DiscImageChef.Commands
|
||||
case 0x14:
|
||||
{
|
||||
if(page.Subpage == 0)
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_12_13_14(page
|
||||
.PageResponse));
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -878,15 +808,11 @@ namespace DiscImageChef.Commands
|
||||
case 0x1A:
|
||||
{
|
||||
if(page.Subpage == 0)
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_1A(page.PageResponse));
|
||||
}
|
||||
else if(page.Subpage == 1)
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_1A_S01(page.PageResponse));
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -894,10 +820,8 @@ namespace DiscImageChef.Commands
|
||||
case 0x1B:
|
||||
{
|
||||
if(page.Subpage == 0)
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_1B(page.PageResponse));
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -905,24 +829,16 @@ namespace DiscImageChef.Commands
|
||||
case 0x1C:
|
||||
{
|
||||
if(page.Subpage == 0)
|
||||
{
|
||||
if(devType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_1C_SFF(page
|
||||
.PageResponse));
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_1C(page.PageResponse));
|
||||
}
|
||||
}
|
||||
else if(page.Subpage == 1)
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_1C_S01(page.PageResponse));
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -930,10 +846,8 @@ namespace DiscImageChef.Commands
|
||||
case 0x1D:
|
||||
{
|
||||
if(page.Subpage == 0)
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_1D(page.PageResponse));
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -942,11 +856,9 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "CERTANCE"
|
||||
)
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyCertanceModePage_21(page
|
||||
.PageResponse));
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -955,11 +867,9 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "CERTANCE"
|
||||
)
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyCertanceModePage_22(page
|
||||
.PageResponse));
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -967,10 +877,8 @@ namespace DiscImageChef.Commands
|
||||
case 0x24:
|
||||
{
|
||||
if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "IBM")
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyIBMModePage_24(page.PageResponse));
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -978,10 +886,8 @@ namespace DiscImageChef.Commands
|
||||
case 0x2A:
|
||||
{
|
||||
if(page.Subpage == 0)
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyModePage_2A(page.PageResponse));
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -989,10 +895,8 @@ namespace DiscImageChef.Commands
|
||||
case 0x2F:
|
||||
{
|
||||
if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "IBM")
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyIBMModePage_2F(page.PageResponse));
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -1008,10 +912,8 @@ namespace DiscImageChef.Commands
|
||||
case 0x3B:
|
||||
{
|
||||
if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "HP")
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyHPModePage_3B(page.PageResponse));
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -1019,10 +921,8 @@ namespace DiscImageChef.Commands
|
||||
case 0x3C:
|
||||
{
|
||||
if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "HP")
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyHPModePage_3C(page.PageResponse));
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -1030,15 +930,11 @@ namespace DiscImageChef.Commands
|
||||
case 0x3D:
|
||||
{
|
||||
if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "IBM")
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyIBMModePage_3D(page.PageResponse));
|
||||
}
|
||||
else if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "HP")
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyHPModePage_3D(page.PageResponse));
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -1046,16 +942,12 @@ namespace DiscImageChef.Commands
|
||||
case 0x3E:
|
||||
{
|
||||
if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "FUJITSU")
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyFujitsuModePage_3E(page
|
||||
.PageResponse));
|
||||
}
|
||||
else if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "HP")
|
||||
{
|
||||
DicConsole.WriteLine(Decoders.SCSI.Modes
|
||||
.PrettifyHPModePage_3E(page.PageResponse));
|
||||
}
|
||||
else goto default;
|
||||
|
||||
break;
|
||||
@@ -1063,16 +955,12 @@ namespace DiscImageChef.Commands
|
||||
default:
|
||||
{
|
||||
if(page.Subpage != 0)
|
||||
{
|
||||
DicConsole.WriteLine("Found unknown mode page {0:X2}h subpage {1:X2}h",
|
||||
page.Page, page.Subpage);
|
||||
}
|
||||
else DicConsole.WriteLine("Found unknown mode page {0:X2}h", page.Page);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(devType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
||||
@@ -1283,10 +1171,8 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole.DebugWriteLine("Device-Info command",
|
||||
"GET CONFIGURATION returned no feature descriptors");
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: DVD drives respond correctly to BD status.
|
||||
@@ -1373,10 +1259,8 @@ namespace DiscImageChef.Commands
|
||||
default:
|
||||
{
|
||||
if(dev.Model.StartsWith("CD-R ", StringComparison.Ordinal))
|
||||
{
|
||||
plxtSense = dev.PlextorReadEepromCdr(out plxtBuf, out senseBuf, dev.Timeout,
|
||||
out duration);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -1446,22 +1330,16 @@ namespace DiscImageChef.Commands
|
||||
if(!plxtSense)
|
||||
{
|
||||
if(plxtPwrRecSelected > 0)
|
||||
{
|
||||
DicConsole
|
||||
.WriteLine("Selected PoweRec speed for currently inserted media is {0} Kb/sec ({1}x)",
|
||||
plxtPwrRecSelected, plxtPwrRecSelected / 177);
|
||||
}
|
||||
if(plxtPwrRecMax > 0)
|
||||
{
|
||||
DicConsole
|
||||
.WriteLine("Maximum PoweRec speed for currently inserted media is {0} Kb/sec ({1}x)",
|
||||
plxtPwrRecMax, plxtPwrRecMax / 177);
|
||||
}
|
||||
if(plxtPwrRecLast > 0)
|
||||
{
|
||||
DicConsole.WriteLine("Last used PoweRec was {0} Kb/sec ({1}x)",
|
||||
plxtPwrRecLast, plxtPwrRecLast / 177);
|
||||
}
|
||||
}
|
||||
}
|
||||
else DicConsole.WriteLine("PoweRec is disabled");
|
||||
@@ -1492,18 +1370,10 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
|
||||
plxtSense = dev.PlextorGetGigaRec(out plxtBuf, out senseBuf, dev.Timeout, out duration);
|
||||
if(!plxtSense)
|
||||
{
|
||||
DicConsole.WriteLine("Drive supports Plextor GigaRec");
|
||||
// TODO: Pretty print it
|
||||
}
|
||||
if(!plxtSense) DicConsole.WriteLine("Drive supports Plextor GigaRec");
|
||||
|
||||
plxtSense = dev.PlextorGetSecuRec(out plxtBuf, out senseBuf, dev.Timeout, out duration);
|
||||
if(!plxtSense)
|
||||
{
|
||||
DicConsole.WriteLine("Drive supports Plextor SecuRec");
|
||||
// TODO: Pretty print it
|
||||
}
|
||||
if(!plxtSense) DicConsole.WriteLine("Drive supports Plextor SecuRec");
|
||||
|
||||
plxtSense = dev.PlextorGetSpeedRead(out plxtBuf, out senseBuf, dev.Timeout, out duration);
|
||||
if(!plxtSense)
|
||||
@@ -1525,21 +1395,13 @@ namespace DiscImageChef.Commands
|
||||
|
||||
plxtSense = dev.PlextorGetVariRec(out plxtBuf, out senseBuf, false, dev.Timeout,
|
||||
out duration);
|
||||
if(!plxtSense)
|
||||
{
|
||||
DicConsole.WriteLine("Drive supports Plextor VariRec");
|
||||
// TODO: Pretty print it
|
||||
}
|
||||
if(!plxtSense) DicConsole.WriteLine("Drive supports Plextor VariRec");
|
||||
|
||||
if(plxtDvd)
|
||||
{
|
||||
plxtSense = dev.PlextorGetVariRec(out plxtBuf, out senseBuf, true, dev.Timeout,
|
||||
out duration);
|
||||
if(!plxtSense)
|
||||
{
|
||||
DicConsole.WriteLine("Drive supports Plextor VariRec for DVDs");
|
||||
// TODO: Pretty print it
|
||||
}
|
||||
if(!plxtSense) DicConsole.WriteLine("Drive supports Plextor VariRec for DVDs");
|
||||
|
||||
plxtSense = dev.PlextorGetBitsetting(out plxtBuf, out senseBuf, false, dev.Timeout,
|
||||
out duration);
|
||||
@@ -1590,10 +1452,8 @@ namespace DiscImageChef.Commands
|
||||
|
||||
sense = dev.ReadBlockLimits(out seqBuf, out senseBuf, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.ErrorWriteLine("READ BLOCK LIMITS:\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Device-Info command", options.OutputPrefix, "_ssc_readblocklimits.bin",
|
||||
@@ -1604,10 +1464,8 @@ namespace DiscImageChef.Commands
|
||||
|
||||
sense = dev.ReportDensitySupport(out seqBuf, out senseBuf, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.ErrorWriteLine("REPORT DENSITY SUPPORT:\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Device-Info command", options.OutputPrefix,
|
||||
@@ -1624,10 +1482,8 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ReportDensitySupport(out seqBuf, out senseBuf, true, false, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.ErrorWriteLine("REPORT DENSITY SUPPORT (MEDIUM):\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Device-Info command", options.OutputPrefix,
|
||||
|
||||
@@ -63,7 +63,6 @@ namespace DiscImageChef.Commands
|
||||
Encoding encoding = null;
|
||||
|
||||
if(options.EncodingName != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
encoding = Claunia.Encoding.Encoding.GetEncoding(options.EncodingName);
|
||||
@@ -75,7 +74,6 @@ namespace DiscImageChef.Commands
|
||||
encoding = null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(options.DevicePath.Length == 2 && options.DevicePath[1] == ':' && options.DevicePath[0] != '/' &&
|
||||
char.IsLetter(options.DevicePath[0])) options.DevicePath = "\\\\.\\" + char.ToUpper(options.DevicePath[0]) + ':';
|
||||
@@ -93,7 +91,6 @@ namespace DiscImageChef.Commands
|
||||
Resume resume = null;
|
||||
XmlSerializer xs = new XmlSerializer(typeof(Resume));
|
||||
if(File.Exists(options.OutputPrefix + ".resume.xml") && options.Resume)
|
||||
{
|
||||
try
|
||||
{
|
||||
StreamReader sr = new StreamReader(options.OutputPrefix + ".resume.xml");
|
||||
@@ -105,7 +102,6 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.ErrorWriteLine("Incorrect resume file, not continuing...");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if(resume != null && resume.NextBlock > resume.LastBlock && resume.BadBlocks.Count == 0)
|
||||
{
|
||||
|
||||
@@ -74,7 +74,6 @@ namespace DiscImageChef.Commands
|
||||
Core.Statistics.AddFilter(inputFilter.Name);
|
||||
|
||||
if(options.SeparatedTracks)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<Track> inputTracks = inputFormat.GetTracks();
|
||||
@@ -119,11 +118,9 @@ namespace DiscImageChef.Commands
|
||||
|
||||
#pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created
|
||||
if(options.DuplicatedSectors)
|
||||
{
|
||||
DicConsole.WriteLine("Track {0} has {1} unique sectors ({1:P3})",
|
||||
currentTrack.TrackSequence, uniqueSectorsPerTrack.Count,
|
||||
(double)uniqueSectorsPerTrack.Count / (double)sectors);
|
||||
}
|
||||
#pragma warning restore IDE0004 // Cast is necessary, otherwise incorrect value is created
|
||||
|
||||
DicConsole.WriteLine();
|
||||
@@ -134,7 +131,6 @@ namespace DiscImageChef.Commands
|
||||
if(options.Debug) DicConsole.DebugWriteLine("Could not get tracks because {0}", ex.Message);
|
||||
else DicConsole.ErrorWriteLine("Unable to get separate tracks, not calculating their entropy");
|
||||
}
|
||||
}
|
||||
|
||||
if(options.WholeDisc)
|
||||
{
|
||||
@@ -180,10 +176,8 @@ namespace DiscImageChef.Commands
|
||||
|
||||
if(options.DuplicatedSectors)
|
||||
#pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created
|
||||
{
|
||||
DicConsole.WriteLine("Disk has {0} unique sectors ({1:P3})", uniqueSectors.Count,
|
||||
(double)uniqueSectors.Count / (double)sectors);
|
||||
}
|
||||
#pragma warning restore IDE0004 // Cast is necessary, otherwise incorrect value is created
|
||||
|
||||
Core.Statistics.AddCommand("entropy");
|
||||
|
||||
@@ -66,7 +66,6 @@ namespace DiscImageChef.Commands
|
||||
Encoding encoding = null;
|
||||
|
||||
if(options.EncodingName != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
encoding = Claunia.Encoding.Encoding.GetEncoding(options.EncodingName);
|
||||
@@ -78,7 +77,6 @@ namespace DiscImageChef.Commands
|
||||
encoding = null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
PluginBase plugins = new PluginBase();
|
||||
plugins.RegisterAllPlugins(encoding);
|
||||
@@ -100,10 +98,8 @@ namespace DiscImageChef.Commands
|
||||
else
|
||||
{
|
||||
if(options.Verbose)
|
||||
{
|
||||
DicConsole.VerboseWriteLine("Image format identified by {0} ({1}).", imageFormat.Name,
|
||||
imageFormat.PluginUuid);
|
||||
}
|
||||
else DicConsole.WriteLine("Image format identified by {0}.", imageFormat.Name);
|
||||
}
|
||||
|
||||
@@ -165,7 +161,6 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.WriteLine(string.Format("Identified by {0} plugins", idPlugins.Count));
|
||||
|
||||
foreach(string pluginName in idPlugins)
|
||||
{
|
||||
if(plugins.PluginsList.TryGetValue(pluginName, out plugin))
|
||||
{
|
||||
DicConsole.WriteLine(string.Format("As identified by {0}.", plugin.Name));
|
||||
@@ -181,7 +176,6 @@ namespace DiscImageChef.Commands
|
||||
List<string> rootDir = new List<string>();
|
||||
error = fs.ReadDir("/", ref rootDir);
|
||||
if(error == Errno.NoError)
|
||||
{
|
||||
foreach(string entry in rootDir)
|
||||
{
|
||||
FileEntryInfo stat = new FileEntryInfo();
|
||||
@@ -202,7 +196,6 @@ namespace DiscImageChef.Commands
|
||||
|
||||
error = fs.ListXAttr(entry, ref xattrs);
|
||||
if(error == Errno.NoError)
|
||||
{
|
||||
foreach(string xattr in xattrs)
|
||||
{
|
||||
byte[] xattrBuf = new byte[0];
|
||||
@@ -254,14 +247,11 @@ namespace DiscImageChef.Commands
|
||||
outputPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole
|
||||
.ErrorWriteLine("Cannot write xattr {0} for {1}, output exists",
|
||||
xattr, entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Directory.CreateDirectory(Path.Combine(options.OutputDir,
|
||||
@@ -298,36 +288,26 @@ namespace DiscImageChef.Commands
|
||||
outBuf.Length, entry, outputPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Error {0} reading file {1}",
|
||||
error, entry);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole
|
||||
.ErrorWriteLine("Cannot write file {0}, output exists",
|
||||
entry);
|
||||
}
|
||||
}
|
||||
else DicConsole.ErrorWriteLine("Error reading file {0}", entry);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Error {0} reading root directory {0}",
|
||||
error.ToString());
|
||||
}
|
||||
|
||||
Core.Statistics.AddFilesystem(fs.XmlFSType.Type);
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Unable to mount device, error {0}",
|
||||
error.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -344,7 +324,6 @@ namespace DiscImageChef.Commands
|
||||
List<string> rootDir = new List<string>();
|
||||
error = fs.ReadDir("/", ref rootDir);
|
||||
if(error == Errno.NoError)
|
||||
{
|
||||
foreach(string entry in rootDir)
|
||||
{
|
||||
FileEntryInfo stat = new FileEntryInfo();
|
||||
@@ -364,7 +343,6 @@ namespace DiscImageChef.Commands
|
||||
|
||||
error = fs.ListXAttr(entry, ref xattrs);
|
||||
if(error == Errno.NoError)
|
||||
{
|
||||
foreach(string xattr in xattrs)
|
||||
{
|
||||
byte[] xattrBuf = new byte[0];
|
||||
@@ -403,14 +381,11 @@ namespace DiscImageChef.Commands
|
||||
outputPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole
|
||||
.ErrorWriteLine("Cannot write xattr {0} for {1}, output exists",
|
||||
xattr, entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Directory.CreateDirectory(Path.Combine(options.OutputDir, fs.XmlFSType.Type,
|
||||
@@ -445,20 +420,15 @@ namespace DiscImageChef.Commands
|
||||
outBuf.Length, entry, outputPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Error {0} reading file {1}", error,
|
||||
entry);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Cannot write file {0}, output exists",
|
||||
entry);
|
||||
}
|
||||
}
|
||||
else DicConsole.ErrorWriteLine("Error reading file {0}", entry);
|
||||
}
|
||||
}
|
||||
else
|
||||
DicConsole.ErrorWriteLine("Error {0} reading root directory {0}", error.ToString());
|
||||
|
||||
@@ -483,7 +453,6 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.WriteLine(string.Format("Identified by {0} plugins", idPlugins.Count));
|
||||
|
||||
foreach(string pluginName in idPlugins)
|
||||
{
|
||||
if(plugins.PluginsList.TryGetValue(pluginName, out plugin))
|
||||
{
|
||||
DicConsole.WriteLine(string.Format("As identified by {0}.", plugin.Name));
|
||||
@@ -498,7 +467,6 @@ namespace DiscImageChef.Commands
|
||||
List<string> rootDir = new List<string>();
|
||||
error = fs.ReadDir("/", ref rootDir);
|
||||
if(error == Errno.NoError)
|
||||
{
|
||||
foreach(string entry in rootDir)
|
||||
{
|
||||
FileEntryInfo stat = new FileEntryInfo();
|
||||
@@ -518,7 +486,6 @@ namespace DiscImageChef.Commands
|
||||
|
||||
error = fs.ListXAttr(entry, ref xattrs);
|
||||
if(error == Errno.NoError)
|
||||
{
|
||||
foreach(string xattr in xattrs)
|
||||
{
|
||||
byte[] xattrBuf = new byte[0];
|
||||
@@ -557,14 +524,11 @@ namespace DiscImageChef.Commands
|
||||
outputPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole
|
||||
.ErrorWriteLine("Cannot write xattr {0} for {1}, output exists",
|
||||
xattr, entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Directory.CreateDirectory(Path.Combine(options.OutputDir, fs.XmlFSType.Type,
|
||||
@@ -599,20 +563,15 @@ namespace DiscImageChef.Commands
|
||||
outBuf.Length, entry, outputPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Error {0} reading file {1}", error,
|
||||
entry);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Cannot write file {0}, output exists",
|
||||
entry);
|
||||
}
|
||||
}
|
||||
else DicConsole.ErrorWriteLine("Error reading file {0}", entry);
|
||||
}
|
||||
}
|
||||
else
|
||||
DicConsole.ErrorWriteLine("Error {0} reading root directory {0}", error.ToString());
|
||||
|
||||
@@ -620,7 +579,6 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
else DicConsole.ErrorWriteLine("Unable to mount device, error {0}", error.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -637,7 +595,6 @@ namespace DiscImageChef.Commands
|
||||
List<string> rootDir = new List<string>();
|
||||
error = fs.ReadDir("/", ref rootDir);
|
||||
if(error == Errno.NoError)
|
||||
{
|
||||
foreach(string entry in rootDir)
|
||||
{
|
||||
FileEntryInfo stat = new FileEntryInfo();
|
||||
@@ -657,7 +614,6 @@ namespace DiscImageChef.Commands
|
||||
|
||||
error = fs.ListXAttr(entry, ref xattrs);
|
||||
if(error == Errno.NoError)
|
||||
{
|
||||
foreach(string xattr in xattrs)
|
||||
{
|
||||
byte[] xattrBuf = new byte[0];
|
||||
@@ -694,14 +650,11 @@ namespace DiscImageChef.Commands
|
||||
xattrBuf.Length, xattr, entry, outputPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole
|
||||
.ErrorWriteLine("Cannot write xattr {0} for {1}, output exists",
|
||||
xattr, entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Directory.CreateDirectory(Path.Combine(options.OutputDir, fs.XmlFSType.Type,
|
||||
@@ -739,7 +692,6 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
else DicConsole.ErrorWriteLine("Error reading file {0}", entry);
|
||||
}
|
||||
}
|
||||
else DicConsole.ErrorWriteLine("Error {0} reading root directory {0}", error.ToString());
|
||||
|
||||
Core.Statistics.AddFilesystem(fs.XmlFSType.Type);
|
||||
|
||||
@@ -51,40 +51,32 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.WriteLine("Supported filters:");
|
||||
if(formatsOptions.Verbose) DicConsole.VerboseWriteLine("GUID\t\t\t\t\tFilter");
|
||||
foreach(KeyValuePair<string, Filter> kvp in filtersList.filtersList)
|
||||
{
|
||||
if(formatsOptions.Verbose) DicConsole.VerboseWriteLine("{0}\t{1}", kvp.Value.UUID, kvp.Value.Name);
|
||||
else DicConsole.WriteLine(kvp.Value.Name);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine();
|
||||
DicConsole.WriteLine("Supported disc image formats:");
|
||||
if(formatsOptions.Verbose) DicConsole.VerboseWriteLine("GUID\t\t\t\t\tPlugin");
|
||||
foreach(KeyValuePair<string, ImagePlugin> kvp in plugins.ImagePluginsList)
|
||||
{
|
||||
if(formatsOptions.Verbose)
|
||||
DicConsole.VerboseWriteLine("{0}\t{1}", kvp.Value.PluginUuid, kvp.Value.Name);
|
||||
else DicConsole.WriteLine(kvp.Value.Name);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine();
|
||||
DicConsole.WriteLine("Supported filesystems:");
|
||||
if(formatsOptions.Verbose) DicConsole.VerboseWriteLine("GUID\t\t\t\t\tPlugin");
|
||||
foreach(KeyValuePair<string, Filesystem> kvp in plugins.PluginsList)
|
||||
{
|
||||
if(formatsOptions.Verbose)
|
||||
DicConsole.VerboseWriteLine("{0}\t{1}", kvp.Value.PluginUUID, kvp.Value.Name);
|
||||
else DicConsole.WriteLine(kvp.Value.Name);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine();
|
||||
DicConsole.WriteLine("Supported partitioning schemes:");
|
||||
if(formatsOptions.Verbose) DicConsole.VerboseWriteLine("GUID\t\t\t\t\tPlugin");
|
||||
foreach(KeyValuePair<string, PartitionPlugin> kvp in plugins.PartPluginsList)
|
||||
{
|
||||
if(formatsOptions.Verbose)
|
||||
DicConsole.VerboseWriteLine("{0}\t{1}", kvp.Value.PluginUuid, kvp.Value.Name);
|
||||
else DicConsole.WriteLine(kvp.Value.Name);
|
||||
}
|
||||
|
||||
Core.Statistics.AddCommand("formats");
|
||||
}
|
||||
|
||||
@@ -62,7 +62,6 @@ namespace DiscImageChef.Commands
|
||||
Encoding encoding = null;
|
||||
|
||||
if(options.EncodingName != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
encoding = Claunia.Encoding.Encoding.GetEncoding(options.EncodingName);
|
||||
@@ -74,7 +73,6 @@ namespace DiscImageChef.Commands
|
||||
encoding = null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
PluginBase plugins = new PluginBase();
|
||||
plugins.RegisterAllPlugins(encoding);
|
||||
@@ -96,10 +94,8 @@ namespace DiscImageChef.Commands
|
||||
else
|
||||
{
|
||||
if(options.Verbose)
|
||||
{
|
||||
DicConsole.VerboseWriteLine("Image format identified by {0} ({1}).", imageFormat.Name,
|
||||
imageFormat.PluginUuid);
|
||||
}
|
||||
else DicConsole.WriteLine("Image format identified by {0}.", imageFormat.Name);
|
||||
}
|
||||
|
||||
@@ -152,7 +148,6 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.WriteLine(string.Format("Identified by {0} plugins", idPlugins.Count));
|
||||
|
||||
foreach(string pluginName in idPlugins)
|
||||
{
|
||||
if(plugins.PluginsList.TryGetValue(pluginName, out plugin))
|
||||
{
|
||||
DicConsole.WriteLine(string.Format("As identified by {0}.", plugin.Name));
|
||||
@@ -169,20 +164,15 @@ namespace DiscImageChef.Commands
|
||||
error = fs.ReadDir("/", ref rootDir);
|
||||
if(error == Errno.NoError) foreach(string entry in rootDir) DicConsole.WriteLine("{0}", entry);
|
||||
else
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Error {0} reading root directory {0}",
|
||||
error.ToString());
|
||||
}
|
||||
|
||||
Core.Statistics.AddFilesystem(fs.XmlFSType.Type);
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Unable to mount device, error {0}",
|
||||
error.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -223,7 +213,6 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.WriteLine(string.Format("Identified by {0} plugins", idPlugins.Count));
|
||||
|
||||
foreach(string pluginName in idPlugins)
|
||||
{
|
||||
if(plugins.PluginsList.TryGetValue(pluginName, out plugin))
|
||||
{
|
||||
DicConsole.WriteLine(string.Format("As identified by {0}.", plugin.Name));
|
||||
@@ -245,7 +234,6 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
else DicConsole.ErrorWriteLine("Unable to mount device, error {0}", error.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -262,9 +250,7 @@ namespace DiscImageChef.Commands
|
||||
List<string> rootDir = new List<string>();
|
||||
error = fs.ReadDir("/", ref rootDir);
|
||||
if(error == Errno.NoError)
|
||||
{
|
||||
foreach(string entry in rootDir)
|
||||
{
|
||||
if(options.Long)
|
||||
{
|
||||
FileEntryInfo stat = new FileEntryInfo();
|
||||
@@ -278,20 +264,16 @@ namespace DiscImageChef.Commands
|
||||
|
||||
error = fs.ListXAttr(entry, ref xattrs);
|
||||
if(error == Errno.NoError)
|
||||
{
|
||||
foreach(string xattr in xattrs)
|
||||
{
|
||||
byte[] xattrBuf = new byte[0];
|
||||
error = fs.GetXattr(entry, xattr, ref xattrBuf);
|
||||
if(error == Errno.NoError) DicConsole.WriteLine("\t\t{0}\t{1} bytes", xattr, xattrBuf.Length);
|
||||
}
|
||||
}
|
||||
}
|
||||
else DicConsole.WriteLine("{0}", entry);
|
||||
}
|
||||
else DicConsole.WriteLine("{0}", entry);
|
||||
}
|
||||
}
|
||||
else DicConsole.ErrorWriteLine("Error {0} reading root directory {0}", error.ToString());
|
||||
|
||||
Core.Statistics.AddFilesystem(fs.XmlFSType.Type);
|
||||
|
||||
@@ -186,10 +186,8 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ModeSense10(out modeBuf, out senseBuf, false, true, ScsiModeSensePageControl.Current, 0x3F,
|
||||
0xFF, 5, out duration);
|
||||
if(sense || dev.Error)
|
||||
{
|
||||
sense = dev.ModeSense10(out modeBuf, out senseBuf, false, true, ScsiModeSensePageControl.Current, 0x3F,
|
||||
0x00, 5, out duration);
|
||||
}
|
||||
|
||||
if(!sense && !dev.Error) decMode = Decoders.SCSI.Modes.DecodeMode10(modeBuf, devType);
|
||||
|
||||
@@ -198,10 +196,8 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ModeSense6(out modeBuf, out senseBuf, false, ScsiModeSensePageControl.Current, 0x3F, 0x00,
|
||||
5, out duration);
|
||||
if(sense || dev.Error)
|
||||
{
|
||||
sense = dev.ModeSense6(out modeBuf, out senseBuf, false, ScsiModeSensePageControl.Current, 0x3F,
|
||||
0x00, 5, out duration);
|
||||
}
|
||||
if(sense || dev.Error) sense = dev.ModeSense(out modeBuf, out senseBuf, 5, out duration);
|
||||
|
||||
if(!sense && !dev.Error) decMode = Decoders.SCSI.Modes.DecodeMode6(modeBuf, devType);
|
||||
@@ -245,14 +241,11 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ReadCapacity16(out cmdBuf, out senseBuf, dev.Timeout, out duration);
|
||||
|
||||
if(sense && blocks == 0)
|
||||
{
|
||||
// Not all MMC devices support READ CAPACITY, as they have READ TOC
|
||||
if(dev.ScsiType != Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Unable to get media capacity");
|
||||
DicConsole.ErrorWriteLine("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
}
|
||||
|
||||
if(!sense)
|
||||
{
|
||||
@@ -337,10 +330,8 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.GetConfiguration(out cmdBuf, out senseBuf, 0, MmcGetConfigurationRt.Current, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ GET CONFIGURATION:\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_getconfiguration_current.bin",
|
||||
@@ -447,29 +438,21 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.RecognizedFormatLayers, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command",
|
||||
"READ DISC STRUCTURE: Recognized Format Layers\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_formatlayers.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.WriteProtectionStatus, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Write Protection Status\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_writeprotection.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
|
||||
// More like a drive information
|
||||
/*
|
||||
@@ -492,10 +475,8 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.PhysicalInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: PFI\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_pfi.bin",
|
||||
@@ -507,7 +488,6 @@ namespace DiscImageChef.Commands
|
||||
|
||||
// False book types
|
||||
if(dskType == MediaType.DVDROM)
|
||||
{
|
||||
switch(decPfi.Value.DiskCategory)
|
||||
{
|
||||
case Decoders.DVD.DiskCategory.DVDPR:
|
||||
@@ -557,7 +537,6 @@ namespace DiscImageChef.Commands
|
||||
dskType = MediaType.UMD;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -565,10 +544,8 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.DiscManufacturingInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DMI\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_dmi.bin",
|
||||
@@ -600,10 +577,8 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.CopyrightInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: CMI\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_cmi.bin",
|
||||
@@ -621,27 +596,19 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.BurstCuttingArea, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: BCA\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_bca.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DvdAacs, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DVD AACS\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_aacs.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
}
|
||||
#endregion DVD-ROM and HD DVD-ROM
|
||||
|
||||
@@ -711,10 +678,8 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DvdramDds, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DDS\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdram_dds.bin",
|
||||
@@ -725,10 +690,8 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.DvdramMediumStatus, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Medium Status\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdram_status.bin",
|
||||
@@ -739,10 +702,8 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.DvdramSpareAreaInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: SAI\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdram_spare.bin",
|
||||
@@ -759,15 +720,11 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.LastBorderOutRmd, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Last-Out Border RMD\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_lastrmd.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
}
|
||||
#endregion DVD-R and HD DVD-R
|
||||
|
||||
@@ -777,15 +734,11 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.PreRecordedInfo, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Pre-Recorded Info\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_pri.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
}
|
||||
#endregion DVD-R and DVD-RW
|
||||
|
||||
@@ -796,28 +749,20 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.DvdrMediaIdentifier, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DVD-R Media ID\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdr_mediaid.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DvdrPhysicalInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DVD-R PFI\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdr_pfi.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
}
|
||||
#endregion DVD-R, DVD-RW and HD DVD-R
|
||||
|
||||
@@ -828,28 +773,20 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.Adip, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: ADIP\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd+_adip.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.Dcb, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DCB\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd+_dcb.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
}
|
||||
#endregion All DVD+
|
||||
|
||||
@@ -860,15 +797,11 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.HddvdCopyrightInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: HDDVD CMI\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_hddvd_cmi.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
}
|
||||
#endregion HD DVD-ROM
|
||||
|
||||
@@ -879,28 +812,20 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.HddvdrMediumStatus, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command",
|
||||
"READ DISC STRUCTURE: HDDVD-R Medium Status\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_hddvdr_status.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.HddvdrLastRmd, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Last RMD\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_hddvdr_lastrmd.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
}
|
||||
#endregion HD DVD-R
|
||||
|
||||
@@ -912,15 +837,11 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.DvdrLayerCapacity, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Layer Capacity\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdr_layercap.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
}
|
||||
#endregion DVD-R DL, DVD-RW DL, DVD+R DL, DVD+RW DL
|
||||
|
||||
@@ -930,55 +851,39 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.MiddleZoneStart, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Middle Zone Start\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_mzs.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.JumpIntervalSize, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Jump Interval Size\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_jis.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.ManualLayerJumpStartLba, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command",
|
||||
"READ DISC STRUCTURE: Manual Layer Jump Start LBA\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_manuallj.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.RemapAnchorPoint, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Remap Anchor Point\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_remapanchor.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
}
|
||||
#endregion DVD-R DL
|
||||
|
||||
@@ -989,10 +894,8 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
MmcDiscStructureFormat.DiscInformation, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DI\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_di.bin",
|
||||
@@ -1002,15 +905,11 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
MmcDiscStructureFormat.Pac, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: PAC\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_pac.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
}
|
||||
#endregion All Blu-ray
|
||||
|
||||
@@ -1021,10 +920,8 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.BdBurstCuttingArea, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: BCA\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_bca.bin",
|
||||
@@ -1041,10 +938,8 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
MmcDiscStructureFormat.BdDds, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DDS\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_dds.bin",
|
||||
@@ -1055,10 +950,8 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
MmcDiscStructureFormat.CartridgeStatus, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Cartridge Status\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_cartstatus.bin",
|
||||
@@ -1069,11 +962,9 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.BdSpareAreaInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command",
|
||||
"READ DISC STRUCTURE: Spare Area Information\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_spare.bin",
|
||||
@@ -1084,23 +975,17 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
MmcDiscStructureFormat.RawDfl, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Raw DFL\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_dfl.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
sense = dev.ReadDiscInformation(out cmdBuf, out senseBuf,
|
||||
MmcDiscInformationDataTypes.TrackResources, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC INFORMATION 001b\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole.WriteLine("Track Resources Information:\n{0}",
|
||||
@@ -1111,10 +996,8 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ReadDiscInformation(out cmdBuf, out senseBuf, MmcDiscInformationDataTypes.PowResources,
|
||||
dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC INFORMATION 010b\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole.WriteLine("POW Resources Information:\n{0}",
|
||||
@@ -1136,10 +1019,8 @@ namespace DiscImageChef.Commands
|
||||
bool tocSense =
|
||||
dev.ReadTocPmaAtip(out cmdBuf, out senseBuf, false, 0, 0, dev.Timeout, out duration);
|
||||
if(tocSense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ TOC/PMA/ATIP: TOC\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
toc = Decoders.CD.TOC.Decode(cmdBuf);
|
||||
@@ -1154,10 +1035,8 @@ namespace DiscImageChef.Commands
|
||||
// ATIP exists on blank CDs
|
||||
sense = dev.ReadAtip(out cmdBuf, out senseBuf, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ TOC/PMA/ATIP: ATIP\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_atip.bin", "SCSI READ TOC/PMA/ATIP",
|
||||
@@ -1178,10 +1057,8 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscInformationDataTypes.DiscInformation, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC INFORMATION 000b\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
Decoders.SCSI.MMC.DiscInformation.StandardDiscInformation? discInfo =
|
||||
@@ -1195,7 +1072,6 @@ namespace DiscImageChef.Commands
|
||||
|
||||
// If it is a read-only CD, check CD type if available
|
||||
if(dskType == MediaType.CD)
|
||||
{
|
||||
switch(discInfo.Value.DiscType)
|
||||
{
|
||||
case 0x10:
|
||||
@@ -1205,7 +1081,6 @@ namespace DiscImageChef.Commands
|
||||
dskType = MediaType.CDROMXA;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1214,10 +1089,8 @@ namespace DiscImageChef.Commands
|
||||
|
||||
sense = dev.ReadSessionInfo(out cmdBuf, out senseBuf, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ TOC/PMA/ATIP: Session info\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_session.bin",
|
||||
@@ -1239,7 +1112,6 @@ namespace DiscImageChef.Commands
|
||||
bool hasVideoTrack = false;
|
||||
|
||||
if(toc.HasValue)
|
||||
{
|
||||
foreach(Decoders.CD.TOC.CDTOCTrackDataDescriptor track in toc.Value.TrackDescriptors)
|
||||
{
|
||||
if(track.TrackNumber == 1 &&
|
||||
@@ -1260,7 +1132,6 @@ namespace DiscImageChef.Commands
|
||||
|
||||
hasVideoTrack |= track.ADR == 4;
|
||||
}
|
||||
}
|
||||
|
||||
if(hasDataTrack && hasAudioTrack && allFirstSessionTracksAreAudio && sessions == 2)
|
||||
dskType = MediaType.CDPLUS;
|
||||
@@ -1271,10 +1142,8 @@ namespace DiscImageChef.Commands
|
||||
|
||||
sense = dev.ReadRawToc(out cmdBuf, out senseBuf, 1, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ TOC/PMA/ATIP: Raw TOC\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_rawtoc.bin",
|
||||
@@ -1283,10 +1152,8 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
sense = dev.ReadPma(out cmdBuf, out senseBuf, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ TOC/PMA/ATIP: PMA\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_pma.bin", "SCSI READ TOC/PMA/ATIP",
|
||||
@@ -1296,19 +1163,15 @@ namespace DiscImageChef.Commands
|
||||
|
||||
sense = dev.ReadCdText(out cmdBuf, out senseBuf, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ TOC/PMA/ATIP: CD-TEXT\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_cdtext.bin",
|
||||
"SCSI READ TOC/PMA/ATIP", cmdBuf);
|
||||
if(Decoders.CD.CDTextOnLeadIn.Decode(cmdBuf).HasValue)
|
||||
{
|
||||
DicConsole.WriteLine("CD-TEXT on Lead-In:\n{0}",
|
||||
Decoders.CD.CDTextOnLeadIn.Prettify(cmdBuf));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1321,10 +1184,8 @@ namespace DiscImageChef.Commands
|
||||
MmcDiscStructureFormat.PhysicalInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: PFI\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_pfi.bin",
|
||||
@@ -1335,26 +1196,20 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.WriteLine("PFI:\n{0}", Decoders.DVD.PFI.Prettify(cmdBuf));
|
||||
if(nintendoPfi.Value.DiskCategory == Decoders.DVD.DiskCategory.Nintendo &&
|
||||
nintendoPfi.Value.PartVersion == 15)
|
||||
{
|
||||
if(nintendoPfi.Value.DiscSize == Decoders.DVD.DVDSize.Eighty) dskType = MediaType.GOD;
|
||||
else if(nintendoPfi.Value.DiscSize == Decoders.DVD.DVDSize.OneTwenty)
|
||||
dskType = MediaType.WOD;
|
||||
}
|
||||
}
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DiscManufacturingInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DMI\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_dmi.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
}
|
||||
#endregion Nintendo
|
||||
}
|
||||
@@ -1374,15 +1229,11 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
sense = dev.KreonExtractSs(out cmdBuf, out senseBuf, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "KREON EXTRACT SS:\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_xbox_ss.bin", "KREON EXTRACT SS",
|
||||
cmdBuf);
|
||||
}
|
||||
|
||||
if(Decoders.Xbox.SS.Decode(cmdBuf).HasValue)
|
||||
DicConsole.WriteLine("Xbox Security Sector:\n{0}", Decoders.Xbox.SS.Prettify(cmdBuf));
|
||||
@@ -1486,10 +1337,8 @@ namespace DiscImageChef.Commands
|
||||
#endregion Xbox
|
||||
|
||||
if(dskType == MediaType.Unknown)
|
||||
{
|
||||
dskType = MediaTypeFromScsi.Get((byte)dev.ScsiType, dev.Manufacturer, dev.Model, scsiMediumType,
|
||||
scsiDensityCode, blocks, blockSize);
|
||||
}
|
||||
|
||||
if(dskType == MediaType.Unknown && dev.IsUsb && containsFloppyPage) dskType = MediaType.FlashDrive;
|
||||
|
||||
@@ -1498,10 +1347,8 @@ namespace DiscImageChef.Commands
|
||||
|
||||
sense = dev.ReadMediaSerialNumber(out cmdBuf, out senseBuf, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ MEDIA SERIAL NUMBER\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
}
|
||||
else
|
||||
{
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_mediaserialnumber.bin",
|
||||
|
||||
@@ -95,20 +95,16 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.WriteLine("{0} sectors took more than 500 ms.", results.F);
|
||||
DicConsole.WriteLine("{0} sectors could not be read.", results.UnreadableSectors.Count);
|
||||
if(results.UnreadableSectors.Count > 0)
|
||||
{
|
||||
foreach(ulong bad in results.UnreadableSectors)
|
||||
DicConsole.WriteLine("Sector {0} could not be read", bad);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine();
|
||||
|
||||
#pragma warning disable RECS0018 // Comparison of floating point numbers with equality operator
|
||||
if(results.SeekTotal != 0 || results.SeekMin != double.MaxValue || results.SeekMax != double.MinValue)
|
||||
#pragma warning restore RECS0018 // Comparison of floating point numbers with equality operator
|
||||
{
|
||||
DicConsole.WriteLine("Testing {0} seeks, longest seek took {1:F3} ms, fastest one took {2:F3} ms. ({3:F3} ms average)",
|
||||
results.SeekTimes, results.SeekMax, results.SeekMin, results.SeekTotal / 1000);
|
||||
}
|
||||
|
||||
Core.Statistics.AddMediaScan((long)results.A, (long)results.B, (long)results.C, (long)results.D,
|
||||
(long)results.E, (long)results.F, (long)results.Blocks, (long)results.Errored,
|
||||
|
||||
@@ -52,80 +52,50 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.WriteLine("Commands statistics");
|
||||
DicConsole.WriteLine("===================");
|
||||
if(Core.Statistics.AllStats.Commands.Analyze > 0)
|
||||
{
|
||||
DicConsole.WriteLine("You have called the Analyze command {0} times",
|
||||
Core.Statistics.AllStats.Commands.Analyze);
|
||||
}
|
||||
if(Core.Statistics.AllStats.Commands.Benchmark > 0)
|
||||
{
|
||||
DicConsole.WriteLine("You have called the Benchmark command {0} times",
|
||||
Core.Statistics.AllStats.Commands.Benchmark);
|
||||
}
|
||||
if(Core.Statistics.AllStats.Commands.Checksum > 0)
|
||||
{
|
||||
DicConsole.WriteLine("You have called the Checksum command {0} times",
|
||||
Core.Statistics.AllStats.Commands.Checksum);
|
||||
}
|
||||
if(Core.Statistics.AllStats.Commands.Compare > 0)
|
||||
{
|
||||
DicConsole.WriteLine("You have called the Compare command {0} times",
|
||||
Core.Statistics.AllStats.Commands.Compare);
|
||||
}
|
||||
if(Core.Statistics.AllStats.Commands.CreateSidecar > 0)
|
||||
{
|
||||
DicConsole.WriteLine("You have called the Create-Sidecar command {0} times",
|
||||
Core.Statistics.AllStats.Commands.CreateSidecar);
|
||||
}
|
||||
if(Core.Statistics.AllStats.Commands.Decode > 0)
|
||||
{
|
||||
DicConsole.WriteLine("You have called the Decode command {0} times",
|
||||
Core.Statistics.AllStats.Commands.Decode);
|
||||
}
|
||||
if(Core.Statistics.AllStats.Commands.DeviceInfo > 0)
|
||||
{
|
||||
DicConsole.WriteLine("You have called the Device-Info command {0} times",
|
||||
Core.Statistics.AllStats.Commands.DeviceInfo);
|
||||
}
|
||||
if(Core.Statistics.AllStats.Commands.DeviceReport > 0)
|
||||
{
|
||||
DicConsole.WriteLine("You have called the Device-Report command {0} times",
|
||||
Core.Statistics.AllStats.Commands.DeviceReport);
|
||||
}
|
||||
if(Core.Statistics.AllStats.Commands.DumpMedia > 0)
|
||||
{
|
||||
DicConsole.WriteLine("You have called the Dump-Media command {0} times",
|
||||
Core.Statistics.AllStats.Commands.DumpMedia);
|
||||
}
|
||||
if(Core.Statistics.AllStats.Commands.Entropy > 0)
|
||||
{
|
||||
DicConsole.WriteLine("You have called the Entropy command {0} times",
|
||||
Core.Statistics.AllStats.Commands.Entropy);
|
||||
}
|
||||
if(Core.Statistics.AllStats.Commands.Formats > 0)
|
||||
{
|
||||
DicConsole.WriteLine("You have called the Formats command {0} times",
|
||||
Core.Statistics.AllStats.Commands.Formats);
|
||||
}
|
||||
if(Core.Statistics.AllStats.Commands.MediaInfo > 0)
|
||||
{
|
||||
DicConsole.WriteLine("You have called the Media-Info command {0} times",
|
||||
Core.Statistics.AllStats.Commands.MediaInfo);
|
||||
}
|
||||
if(Core.Statistics.AllStats.Commands.MediaScan > 0)
|
||||
{
|
||||
DicConsole.WriteLine("You have called the Media-Scan command {0} times",
|
||||
Core.Statistics.AllStats.Commands.MediaScan);
|
||||
}
|
||||
if(Core.Statistics.AllStats.Commands.PrintHex > 0)
|
||||
{
|
||||
DicConsole.WriteLine("You have called the Print-Hex command {0} times",
|
||||
Core.Statistics.AllStats.Commands.PrintHex);
|
||||
}
|
||||
if(Core.Statistics.AllStats.Commands.Verify > 0)
|
||||
{
|
||||
DicConsole.WriteLine("You have called the Verify command {0} times",
|
||||
Core.Statistics.AllStats.Commands.Verify);
|
||||
}
|
||||
DicConsole.WriteLine();
|
||||
thereAreStats = true;
|
||||
}
|
||||
@@ -199,11 +169,9 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.WriteLine("Device statistics");
|
||||
DicConsole.WriteLine("=================");
|
||||
foreach(DeviceStats ds in Core.Statistics.AllStats.Devices)
|
||||
{
|
||||
DicConsole
|
||||
.WriteLine("Device model {0}, manufactured by {1}, with revision {2} and attached via {3}.",
|
||||
ds.Model, ds.Manufacturer, ds.Revision, ds.Bus);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine();
|
||||
thereAreStats = true;
|
||||
@@ -214,18 +182,12 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.WriteLine("Media statistics");
|
||||
DicConsole.WriteLine("================");
|
||||
foreach(MediaStats ms in Core.Statistics.AllStats.Medias)
|
||||
{
|
||||
if(ms.real)
|
||||
{
|
||||
DicConsole.WriteLine("Media type {0} has been found {1} times in a real device.", ms.type,
|
||||
ms.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
DicConsole.WriteLine("Media type {0} has been found {1} times in a media image.", ms.type,
|
||||
ms.Value);
|
||||
}
|
||||
}
|
||||
|
||||
DicConsole.WriteLine();
|
||||
thereAreStats = true;
|
||||
|
||||
@@ -140,16 +140,12 @@ namespace DiscImageChef.Commands
|
||||
bool? tempStatus;
|
||||
|
||||
if(remainingSectors < 512)
|
||||
{
|
||||
tempStatus = inputFormat.VerifySectors(currentSector, (uint)remainingSectors,
|
||||
currentTrack.TrackSequence, out tempfailingLbas,
|
||||
out tempunknownLbas);
|
||||
}
|
||||
else
|
||||
{
|
||||
tempStatus = inputFormat.VerifySectors(currentSector, 512, currentTrack.TrackSequence,
|
||||
out tempfailingLbas, out tempunknownLbas);
|
||||
}
|
||||
|
||||
if(checkStatus == null || tempStatus == null) checkStatus = null;
|
||||
else if(checkStatus == false || tempStatus == false) checkStatus = false;
|
||||
@@ -192,15 +188,11 @@ namespace DiscImageChef.Commands
|
||||
bool? tempStatus;
|
||||
|
||||
if(remainingSectors < 512)
|
||||
{
|
||||
tempStatus = inputFormat.VerifySectors(currentSector, (uint)remainingSectors,
|
||||
out tempfailingLbas, out tempunknownLbas);
|
||||
}
|
||||
else
|
||||
{
|
||||
tempStatus =
|
||||
inputFormat.VerifySectors(currentSector, 512, out tempfailingLbas, out tempunknownLbas);
|
||||
}
|
||||
|
||||
if(checkStatus == null || tempStatus == null) checkStatus = null;
|
||||
else if(checkStatus == false || tempStatus == false) checkStatus = false;
|
||||
|
||||
Reference in New Issue
Block a user