REFACTOR: Remove unneeded code.

This commit is contained in:
2017-12-21 14:30:38 +00:00
parent 35ce7db892
commit dcd053b20d
343 changed files with 2842 additions and 2588 deletions

View File

@@ -36,9 +36,9 @@ using System.Text;
using DiscImageChef.CommonTypes;
using DiscImageChef.Console;
using DiscImageChef.Core;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.DiscImages;
namespace DiscImageChef.Commands
{

View File

@@ -34,8 +34,8 @@ using System;
using System.Collections.Generic;
using DiscImageChef.Console;
using DiscImageChef.Core;
using DiscImageChef.Filters;
using DiscImageChef.DiscImages;
using DiscImageChef.Filters;
using Schemas;
namespace DiscImageChef.Commands

View File

@@ -35,8 +35,8 @@ using System.Collections.Generic;
using System.Text;
using DiscImageChef.Console;
using DiscImageChef.Core;
using DiscImageChef.Filters;
using DiscImageChef.DiscImages;
using DiscImageChef.Filters;
namespace DiscImageChef.Commands
{

View File

@@ -35,10 +35,11 @@ using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml.Serialization;
using DiscImageChef.Console;
using DiscImageChef.Core;
using DiscImageChef.Filters;
using DiscImageChef.DiscImages;
using DiscImageChef.Filters;
using Schemas;
namespace DiscImageChef.Commands
@@ -135,8 +136,8 @@ namespace DiscImageChef.Commands
FileStream(Path.Combine(Path.GetDirectoryName(options.InputFile), Path.GetFileNameWithoutExtension(options.InputFile) + ".cicm.xml"),
FileMode.CreateNew);
System.Xml.Serialization.XmlSerializer xmlSer =
new System.Xml.Serialization.XmlSerializer(typeof(CICMMetadataType));
XmlSerializer xmlSer =
new XmlSerializer(typeof(CICMMetadataType));
xmlSer.Serialize(xmlFs, sidecar);
xmlFs.Close();
@@ -171,8 +172,8 @@ namespace DiscImageChef.Commands
FileStream(Path.Combine(Path.GetDirectoryName(options.InputFile), Path.GetFileNameWithoutExtension(options.InputFile) + ".cicm.xml"),
FileMode.CreateNew);
System.Xml.Serialization.XmlSerializer xmlSer =
new System.Xml.Serialization.XmlSerializer(typeof(CICMMetadataType));
XmlSerializer xmlSer =
new XmlSerializer(typeof(CICMMetadataType));
xmlSer.Serialize(xmlFs, sidecar);
xmlFs.Close();
@@ -181,7 +182,6 @@ namespace DiscImageChef.Commands
else
{
DicConsole.ErrorWriteLine("The specified input file cannot be found.");
return;
}
}
}

View File

@@ -32,8 +32,12 @@
using DiscImageChef.Console;
using DiscImageChef.Core;
using DiscImageChef.Filters;
using DiscImageChef.Decoders.ATA;
using DiscImageChef.Decoders.CD;
using DiscImageChef.Decoders.SCSI;
using DiscImageChef.DiscImages;
using DiscImageChef.Filters;
using Session = DiscImageChef.Decoders.CD.Session;
namespace DiscImageChef.Commands
{
@@ -88,7 +92,7 @@ namespace DiscImageChef.Commands
DicConsole.WriteLine("SCSI INQUIRY command response:");
DicConsole
.WriteLine("================================================================================");
DicConsole.WriteLine(Decoders.SCSI.Inquiry.Prettify(inquiry));
DicConsole.WriteLine(Inquiry.Prettify(inquiry));
DicConsole
.WriteLine("================================================================================");
}
@@ -104,7 +108,7 @@ namespace DiscImageChef.Commands
DicConsole.WriteLine("ATA IDENTIFY DEVICE command response:");
DicConsole
.WriteLine("================================================================================");
DicConsole.WriteLine(Decoders.ATA.Identify.Prettify(identify));
DicConsole.WriteLine(Identify.Prettify(identify));
DicConsole
.WriteLine("================================================================================");
}
@@ -121,7 +125,7 @@ namespace DiscImageChef.Commands
DicConsole.WriteLine("ATA IDENTIFY PACKET DEVICE command response:");
DicConsole
.WriteLine("================================================================================");
DicConsole.WriteLine(Decoders.ATA.Identify.Prettify(identify));
DicConsole.WriteLine(Identify.Prettify(identify));
DicConsole
.WriteLine("================================================================================");
}
@@ -136,7 +140,7 @@ namespace DiscImageChef.Commands
DicConsole.WriteLine("CD ATIP:");
DicConsole
.WriteLine("================================================================================");
DicConsole.WriteLine(Decoders.CD.ATIP.Prettify(atip));
DicConsole.WriteLine(ATIP.Prettify(atip));
DicConsole
.WriteLine("================================================================================");
}
@@ -151,7 +155,7 @@ namespace DiscImageChef.Commands
DicConsole.WriteLine("CD full TOC:");
DicConsole
.WriteLine("================================================================================");
DicConsole.WriteLine(Decoders.CD.FullTOC.Prettify(fulltoc));
DicConsole.WriteLine(FullTOC.Prettify(fulltoc));
DicConsole
.WriteLine("================================================================================");
}
@@ -166,7 +170,7 @@ namespace DiscImageChef.Commands
DicConsole.WriteLine("CD PMA:");
DicConsole
.WriteLine("================================================================================");
DicConsole.WriteLine(Decoders.CD.PMA.Prettify(pma));
DicConsole.WriteLine(PMA.Prettify(pma));
DicConsole
.WriteLine("================================================================================");
}
@@ -182,7 +186,7 @@ namespace DiscImageChef.Commands
DicConsole.WriteLine("CD session information:");
DicConsole
.WriteLine("================================================================================");
DicConsole.WriteLine(Decoders.CD.Session.Prettify(sessioninfo));
DicConsole.WriteLine(Session.Prettify(sessioninfo));
DicConsole
.WriteLine("================================================================================");
}
@@ -197,7 +201,7 @@ namespace DiscImageChef.Commands
DicConsole.WriteLine("CD-TEXT:");
DicConsole
.WriteLine("================================================================================");
DicConsole.WriteLine(Decoders.CD.CDTextOnLeadIn.Prettify(cdtext));
DicConsole.WriteLine(CDTextOnLeadIn.Prettify(cdtext));
DicConsole
.WriteLine("================================================================================");
}
@@ -212,7 +216,7 @@ namespace DiscImageChef.Commands
DicConsole.WriteLine("CD TOC:");
DicConsole
.WriteLine("================================================================================");
DicConsole.WriteLine(Decoders.CD.TOC.Prettify(toc));
DicConsole.WriteLine(TOC.Prettify(toc));
DicConsole
.WriteLine("================================================================================");
}

View File

@@ -34,7 +34,12 @@ using System;
using DiscImageChef.Console;
using DiscImageChef.Core;
using DiscImageChef.Decoders.ATA;
using DiscImageChef.Decoders.PCMCIA;
using DiscImageChef.Decoders.SCSI;
using DiscImageChef.Decoders.SCSI.MMC;
using DiscImageChef.Decoders.SCSI.SSC;
using DiscImageChef.Devices;
using Tuple = DiscImageChef.Decoders.PCMCIA.Tuple;
namespace DiscImageChef.Commands
{
@@ -88,59 +93,59 @@ namespace DiscImageChef.Commands
{
DicConsole.WriteLine("PCMCIA device");
DicConsole.WriteLine("PCMCIA CIS is {0} bytes", dev.Cis.Length);
Decoders.PCMCIA.Tuple[] tuples = Decoders.PCMCIA.CIS.GetTuples(dev.Cis);
Tuple[] tuples = CIS.GetTuples(dev.Cis);
if(tuples != null)
foreach(Decoders.PCMCIA.Tuple tuple in tuples)
foreach(Tuple tuple in tuples)
switch(tuple.Code)
{
case Decoders.PCMCIA.TupleCodes.CISTPL_NULL:
case Decoders.PCMCIA.TupleCodes.CISTPL_END: break;
case Decoders.PCMCIA.TupleCodes.CISTPL_DEVICEGEO:
case Decoders.PCMCIA.TupleCodes.CISTPL_DEVICEGEO_A:
DicConsole.WriteLine("{0}", Decoders.PCMCIA.CIS.PrettifyDeviceGeometryTuple(tuple));
case TupleCodes.CISTPL_NULL:
case TupleCodes.CISTPL_END: break;
case TupleCodes.CISTPL_DEVICEGEO:
case TupleCodes.CISTPL_DEVICEGEO_A:
DicConsole.WriteLine("{0}", CIS.PrettifyDeviceGeometryTuple(tuple));
break;
case Decoders.PCMCIA.TupleCodes.CISTPL_MANFID:
case TupleCodes.CISTPL_MANFID:
DicConsole.WriteLine("{0}",
Decoders.PCMCIA.CIS
CIS
.PrettifyManufacturerIdentificationTuple(tuple));
break;
case Decoders.PCMCIA.TupleCodes.CISTPL_VERS_1:
DicConsole.WriteLine("{0}", Decoders.PCMCIA.CIS.PrettifyLevel1VersionTuple(tuple));
case TupleCodes.CISTPL_VERS_1:
DicConsole.WriteLine("{0}", CIS.PrettifyLevel1VersionTuple(tuple));
break;
case Decoders.PCMCIA.TupleCodes.CISTPL_ALTSTR:
case Decoders.PCMCIA.TupleCodes.CISTPL_BAR:
case Decoders.PCMCIA.TupleCodes.CISTPL_BATTERY:
case Decoders.PCMCIA.TupleCodes.CISTPL_BYTEORDER:
case Decoders.PCMCIA.TupleCodes.CISTPL_CFTABLE_ENTRY:
case Decoders.PCMCIA.TupleCodes.CISTPL_CFTABLE_ENTRY_CB:
case Decoders.PCMCIA.TupleCodes.CISTPL_CHECKSUM:
case Decoders.PCMCIA.TupleCodes.CISTPL_CONFIG:
case Decoders.PCMCIA.TupleCodes.CISTPL_CONFIG_CB:
case Decoders.PCMCIA.TupleCodes.CISTPL_DATE:
case Decoders.PCMCIA.TupleCodes.CISTPL_DEVICE:
case Decoders.PCMCIA.TupleCodes.CISTPL_DEVICE_A:
case Decoders.PCMCIA.TupleCodes.CISTPL_DEVICE_OA:
case Decoders.PCMCIA.TupleCodes.CISTPL_DEVICE_OC:
case Decoders.PCMCIA.TupleCodes.CISTPL_EXTDEVIC:
case Decoders.PCMCIA.TupleCodes.CISTPL_FORMAT:
case Decoders.PCMCIA.TupleCodes.CISTPL_FORMAT_A:
case Decoders.PCMCIA.TupleCodes.CISTPL_FUNCE:
case Decoders.PCMCIA.TupleCodes.CISTPL_FUNCID:
case Decoders.PCMCIA.TupleCodes.CISTPL_GEOMETRY:
case Decoders.PCMCIA.TupleCodes.CISTPL_INDIRECT:
case Decoders.PCMCIA.TupleCodes.CISTPL_JEDEC_A:
case Decoders.PCMCIA.TupleCodes.CISTPL_JEDEC_C:
case Decoders.PCMCIA.TupleCodes.CISTPL_LINKTARGET:
case Decoders.PCMCIA.TupleCodes.CISTPL_LONGLINK_A:
case Decoders.PCMCIA.TupleCodes.CISTPL_LONGLINK_C:
case Decoders.PCMCIA.TupleCodes.CISTPL_LONGLINK_CB:
case Decoders.PCMCIA.TupleCodes.CISTPL_LONGLINK_MFC:
case Decoders.PCMCIA.TupleCodes.CISTPL_NO_LINK:
case Decoders.PCMCIA.TupleCodes.CISTPL_ORG:
case Decoders.PCMCIA.TupleCodes.CISTPL_PWR_MGMNT:
case Decoders.PCMCIA.TupleCodes.CISTPL_SPCL:
case Decoders.PCMCIA.TupleCodes.CISTPL_SWIL:
case Decoders.PCMCIA.TupleCodes.CISTPL_VERS_2:
case TupleCodes.CISTPL_ALTSTR:
case TupleCodes.CISTPL_BAR:
case TupleCodes.CISTPL_BATTERY:
case TupleCodes.CISTPL_BYTEORDER:
case TupleCodes.CISTPL_CFTABLE_ENTRY:
case TupleCodes.CISTPL_CFTABLE_ENTRY_CB:
case TupleCodes.CISTPL_CHECKSUM:
case TupleCodes.CISTPL_CONFIG:
case TupleCodes.CISTPL_CONFIG_CB:
case TupleCodes.CISTPL_DATE:
case TupleCodes.CISTPL_DEVICE:
case TupleCodes.CISTPL_DEVICE_A:
case TupleCodes.CISTPL_DEVICE_OA:
case TupleCodes.CISTPL_DEVICE_OC:
case TupleCodes.CISTPL_EXTDEVIC:
case TupleCodes.CISTPL_FORMAT:
case TupleCodes.CISTPL_FORMAT_A:
case TupleCodes.CISTPL_FUNCE:
case TupleCodes.CISTPL_FUNCID:
case TupleCodes.CISTPL_GEOMETRY:
case TupleCodes.CISTPL_INDIRECT:
case TupleCodes.CISTPL_JEDEC_A:
case TupleCodes.CISTPL_JEDEC_C:
case TupleCodes.CISTPL_LINKTARGET:
case TupleCodes.CISTPL_LONGLINK_A:
case TupleCodes.CISTPL_LONGLINK_C:
case TupleCodes.CISTPL_LONGLINK_CB:
case TupleCodes.CISTPL_LONGLINK_MFC:
case TupleCodes.CISTPL_NO_LINK:
case TupleCodes.CISTPL_ORG:
case TupleCodes.CISTPL_PWR_MGMNT:
case TupleCodes.CISTPL_SPCL:
case TupleCodes.CISTPL_SWIL:
case TupleCodes.CISTPL_VERS_2:
DicConsole.DebugWriteLine("Device-Info command", "Found undecoded tuple ID {0}",
tuple.Code);
break;
@@ -265,7 +270,7 @@ namespace DiscImageChef.Commands
if(sense)
{
DicConsole.ErrorWriteLine("SCSI error:\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
DicConsole.ErrorWriteLine("SCSI error:\n{0}", Sense.PrettifySense(senseBuf));
break;
}
@@ -275,14 +280,14 @@ namespace DiscImageChef.Commands
DataFile.WriteTo("Device-Info command", options.OutputPrefix, "_scsi_inquiry.bin", "SCSI INQUIRY",
inqBuf);
Decoders.SCSI.Inquiry.SCSIInquiry? inq = Decoders.SCSI.Inquiry.Decode(inqBuf);
DicConsole.WriteLine(Decoders.SCSI.Inquiry.Prettify(inq));
Inquiry.SCSIInquiry? inq = Inquiry.Decode(inqBuf);
DicConsole.WriteLine(Inquiry.Prettify(inq));
sense = dev.ScsiInquiry(out inqBuf, out senseBuf, 0x00);
if(!sense)
{
byte[] pages = Decoders.SCSI.EVPD.DecodePage00(inqBuf);
byte[] pages = EVPD.DecodePage00(inqBuf);
if(pages != null)
foreach(byte page in pages)
@@ -292,7 +297,7 @@ namespace DiscImageChef.Commands
if(sense) continue;
DicConsole.WriteLine("ASCII Page {0:X2}h: {1}", page,
Decoders.SCSI.EVPD.DecodeASCIIPage(inqBuf));
EVPD.DecodeASCIIPage(inqBuf));
DataFile.WriteTo("Device-Info command", options.OutputPrefix,
string.Format("_scsi_evpd_{0:X2}h.bin", page),
@@ -304,7 +309,7 @@ namespace DiscImageChef.Commands
if(sense) continue;
DicConsole.WriteLine("Unit Serial Number: {0}",
Decoders.SCSI.EVPD.DecodePage80(inqBuf));
EVPD.DecodePage80(inqBuf));
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);
@@ -314,7 +319,7 @@ namespace DiscImageChef.Commands
sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page);
if(sense) continue;
DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_81(inqBuf));
DicConsole.WriteLine("{0}", EVPD.PrettifyPage_81(inqBuf));
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);
@@ -325,7 +330,7 @@ namespace DiscImageChef.Commands
if(sense) continue;
DicConsole.WriteLine("ASCII implemented operating definitions: {0}",
Decoders.SCSI.EVPD.DecodePage82(inqBuf));
EVPD.DecodePage82(inqBuf));
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);
@@ -335,7 +340,7 @@ namespace DiscImageChef.Commands
sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page);
if(sense) continue;
DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_83(inqBuf));
DicConsole.WriteLine("{0}", EVPD.PrettifyPage_83(inqBuf));
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);
@@ -345,7 +350,7 @@ namespace DiscImageChef.Commands
sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page);
if(sense) continue;
DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_84(inqBuf));
DicConsole.WriteLine("{0}", EVPD.PrettifyPage_84(inqBuf));
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);
@@ -355,7 +360,7 @@ namespace DiscImageChef.Commands
sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page);
if(sense) continue;
DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_85(inqBuf));
DicConsole.WriteLine("{0}", EVPD.PrettifyPage_85(inqBuf));
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);
@@ -365,7 +370,7 @@ namespace DiscImageChef.Commands
sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page);
if(sense) continue;
DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_86(inqBuf));
DicConsole.WriteLine("{0}", EVPD.PrettifyPage_86(inqBuf));
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);
@@ -375,7 +380,7 @@ namespace DiscImageChef.Commands
sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page);
if(sense) continue;
DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_89(inqBuf));
DicConsole.WriteLine("{0}", EVPD.PrettifyPage_89(inqBuf));
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);
@@ -385,7 +390,7 @@ namespace DiscImageChef.Commands
sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page);
if(sense) continue;
DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_B0(inqBuf));
DicConsole.WriteLine("{0}", EVPD.PrettifyPage_B0(inqBuf));
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);
@@ -396,7 +401,7 @@ namespace DiscImageChef.Commands
if(sense) continue;
DicConsole.WriteLine("Manufacturer-assigned Serial Number: {0}",
Decoders.SCSI.EVPD.DecodePageB1(inqBuf));
EVPD.DecodePageB1(inqBuf));
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);
@@ -407,7 +412,7 @@ namespace DiscImageChef.Commands
if(sense) continue;
DicConsole.WriteLine("TapeAlert Supported Flags Bitmap: 0x{0:X16}",
Decoders.SCSI.EVPD.DecodePageB2(inqBuf));
EVPD.DecodePageB2(inqBuf));
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);
@@ -418,7 +423,7 @@ namespace DiscImageChef.Commands
if(sense) continue;
DicConsole.WriteLine("Automation Device Serial Number: {0}",
Decoders.SCSI.EVPD.DecodePageB3(inqBuf));
EVPD.DecodePageB3(inqBuf));
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);
@@ -429,7 +434,7 @@ namespace DiscImageChef.Commands
if(sense) continue;
DicConsole.WriteLine("Data Transfer Device Element Address: 0x{0}",
Decoders.SCSI.EVPD.DecodePageB4(inqBuf));
EVPD.DecodePageB4(inqBuf));
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);
@@ -442,7 +447,7 @@ namespace DiscImageChef.Commands
sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page);
if(sense) continue;
DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_C0_Quantum(inqBuf));
DicConsole.WriteLine("{0}", EVPD.PrettifyPage_C0_Quantum(inqBuf));
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);
@@ -455,7 +460,7 @@ namespace DiscImageChef.Commands
sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page);
if(sense) continue;
DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_C0_Seagate(inqBuf));
DicConsole.WriteLine("{0}", EVPD.PrettifyPage_C0_Seagate(inqBuf));
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);
@@ -468,7 +473,7 @@ namespace DiscImageChef.Commands
sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page);
if(sense) continue;
DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_C0_IBM(inqBuf));
DicConsole.WriteLine("{0}", EVPD.PrettifyPage_C0_IBM(inqBuf));
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);
@@ -481,7 +486,7 @@ namespace DiscImageChef.Commands
sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page);
if(sense) continue;
DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_C1_IBM(inqBuf));
DicConsole.WriteLine("{0}", EVPD.PrettifyPage_C1_IBM(inqBuf));
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);
@@ -495,7 +500,7 @@ namespace DiscImageChef.Commands
if(sense) continue;
DicConsole.WriteLine("{0}",
Decoders.SCSI.EVPD.PrettifyPage_C0_C1_Certance(inqBuf));
EVPD.PrettifyPage_C0_C1_Certance(inqBuf));
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);
@@ -509,8 +514,7 @@ namespace DiscImageChef.Commands
if(sense) continue;
DicConsole.WriteLine("{0}",
Decoders
.SCSI.EVPD
EVPD
.PrettifyPage_C2_C3_C4_C5_C6_Certance(inqBuf));
DataFile.WriteTo("Device-Info command", options.OutputPrefix,
string.Format("_scsi_evpd_{0:X2}h.bin", page),
@@ -526,7 +530,7 @@ namespace DiscImageChef.Commands
if(sense) continue;
DicConsole.WriteLine("{0}",
Decoders.SCSI.EVPD.PrettifyPage_C0_to_C5_HP(inqBuf));
EVPD.PrettifyPage_C0_to_C5_HP(inqBuf));
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);
@@ -540,7 +544,7 @@ namespace DiscImageChef.Commands
if(sense) continue;
DicConsole.WriteLine("{0}",
Decoders.SCSI.EVPD.PrettifyPage_DF_Certance(inqBuf));
EVPD.PrettifyPage_DF_Certance(inqBuf));
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);
@@ -562,9 +566,9 @@ namespace DiscImageChef.Commands
byte[] modeBuf;
double duration;
Decoders.SCSI.Modes.DecodedMode? decMode = null;
Decoders.SCSI.PeripheralDeviceTypes devType =
(Decoders.SCSI.PeripheralDeviceTypes)inq.Value.PeripheralDeviceType;
Modes.DecodedMode? decMode = null;
PeripheralDeviceTypes devType =
(PeripheralDeviceTypes)inq.Value.PeripheralDeviceType;
sense = dev.ModeSense10(out modeBuf, out senseBuf, false, true, ScsiModeSensePageControl.Current,
0x3F, 0xFF, 5, out duration);
@@ -572,7 +576,7 @@ namespace DiscImageChef.Commands
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);
if(!sense && !dev.Error) decMode = Modes.DecodeMode10(modeBuf, devType);
if(sense || dev.Error || !decMode.HasValue)
{
@@ -583,7 +587,7 @@ namespace DiscImageChef.Commands
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 && !dev.Error) decMode = Modes.DecodeMode6(modeBuf, devType);
}
if(!sense)
@@ -592,18 +596,18 @@ namespace DiscImageChef.Commands
if(decMode.HasValue)
{
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModeHeader(decMode.Value.Header, devType));
DicConsole.WriteLine(Modes.PrettifyModeHeader(decMode.Value.Header, devType));
if(decMode.Value.Pages != null)
foreach(Decoders.SCSI.Modes.ModePage page in decMode.Value.Pages)
foreach(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)
{
case 0x00:
{
if(devType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice &&
if(devType == PeripheralDeviceTypes.MultiMediaDevice &&
page.Subpage == 0)
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyModePage_00_SFF(page.PageResponse));
else
{
@@ -620,12 +624,12 @@ namespace DiscImageChef.Commands
case 0x01:
{
if(page.Subpage == 0)
if(devType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
DicConsole.WriteLine(Decoders.SCSI.Modes
if(devType == PeripheralDeviceTypes.MultiMediaDevice)
DicConsole.WriteLine(Modes
.PrettifyModePage_01_MMC(page
.PageResponse));
else
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyModePage_01(page.PageResponse));
else goto default;
@@ -634,7 +638,7 @@ namespace DiscImageChef.Commands
case 0x02:
{
if(page.Subpage == 0)
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyModePage_02(page.PageResponse));
else goto default;
@@ -643,7 +647,7 @@ namespace DiscImageChef.Commands
case 0x03:
{
if(page.Subpage == 0)
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyModePage_03(page.PageResponse));
else goto default;
@@ -652,7 +656,7 @@ namespace DiscImageChef.Commands
case 0x04:
{
if(page.Subpage == 0)
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyModePage_04(page.PageResponse));
else goto default;
@@ -661,7 +665,7 @@ namespace DiscImageChef.Commands
case 0x05:
{
if(page.Subpage == 0)
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyModePage_05(page.PageResponse));
else goto default;
@@ -670,7 +674,7 @@ namespace DiscImageChef.Commands
case 0x06:
{
if(page.Subpage == 0)
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyModePage_06(page.PageResponse));
else goto default;
@@ -679,12 +683,12 @@ namespace DiscImageChef.Commands
case 0x07:
{
if(page.Subpage == 0)
if(devType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
DicConsole.WriteLine(Decoders.SCSI.Modes
if(devType == PeripheralDeviceTypes.MultiMediaDevice)
DicConsole.WriteLine(Modes
.PrettifyModePage_07_MMC(page
.PageResponse));
else
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyModePage_07(page.PageResponse));
else goto default;
@@ -693,7 +697,7 @@ namespace DiscImageChef.Commands
case 0x08:
{
if(page.Subpage == 0)
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyModePage_08(page.PageResponse));
else goto default;
@@ -702,10 +706,10 @@ namespace DiscImageChef.Commands
case 0x0A:
{
if(page.Subpage == 0)
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyModePage_0A(page.PageResponse));
else if(page.Subpage == 1)
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyModePage_0A_S01(page.PageResponse));
else goto default;
@@ -714,7 +718,7 @@ namespace DiscImageChef.Commands
case 0x0B:
{
if(page.Subpage == 0)
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyModePage_0B(page.PageResponse));
else goto default;
@@ -723,7 +727,7 @@ namespace DiscImageChef.Commands
case 0x0D:
{
if(page.Subpage == 0)
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyModePage_0D(page.PageResponse));
else goto default;
@@ -732,7 +736,7 @@ namespace DiscImageChef.Commands
case 0x0E:
{
if(page.Subpage == 0)
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyModePage_0E(page.PageResponse));
else goto default;
@@ -741,7 +745,7 @@ namespace DiscImageChef.Commands
case 0x0F:
{
if(page.Subpage == 0)
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyModePage_0F(page.PageResponse));
else goto default;
@@ -750,12 +754,12 @@ namespace DiscImageChef.Commands
case 0x10:
{
if(page.Subpage == 0)
if(devType == Decoders.SCSI.PeripheralDeviceTypes.SequentialAccess)
DicConsole.WriteLine(Decoders.SCSI.Modes
if(devType == PeripheralDeviceTypes.SequentialAccess)
DicConsole.WriteLine(Modes
.PrettifyModePage_10_SSC(page
.PageResponse));
else
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyModePage_10(page.PageResponse));
else goto default;
@@ -764,7 +768,7 @@ namespace DiscImageChef.Commands
case 0x11:
{
if(page.Subpage == 0)
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyModePage_11(page.PageResponse));
else goto default;
@@ -775,7 +779,7 @@ namespace DiscImageChef.Commands
case 0x14:
{
if(page.Subpage == 0)
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyModePage_12_13_14(page
.PageResponse));
else goto default;
@@ -785,10 +789,10 @@ namespace DiscImageChef.Commands
case 0x1A:
{
if(page.Subpage == 0)
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyModePage_1A(page.PageResponse));
else if(page.Subpage == 1)
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyModePage_1A_S01(page.PageResponse));
else goto default;
@@ -797,7 +801,7 @@ namespace DiscImageChef.Commands
case 0x1B:
{
if(page.Subpage == 0)
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyModePage_1B(page.PageResponse));
else goto default;
@@ -806,15 +810,15 @@ namespace DiscImageChef.Commands
case 0x1C:
{
if(page.Subpage == 0)
if(devType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
DicConsole.WriteLine(Decoders.SCSI.Modes
if(devType == PeripheralDeviceTypes.MultiMediaDevice)
DicConsole.WriteLine(Modes
.PrettifyModePage_1C_SFF(page
.PageResponse));
else
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyModePage_1C(page.PageResponse));
else if(page.Subpage == 1)
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyModePage_1C_S01(page.PageResponse));
else goto default;
@@ -823,7 +827,7 @@ namespace DiscImageChef.Commands
case 0x1D:
{
if(page.Subpage == 0)
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyModePage_1D(page.PageResponse));
else goto default;
@@ -833,7 +837,7 @@ namespace DiscImageChef.Commands
{
if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "CERTANCE"
)
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyCertanceModePage_21(page
.PageResponse));
else goto default;
@@ -844,7 +848,7 @@ namespace DiscImageChef.Commands
{
if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "CERTANCE"
)
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyCertanceModePage_22(page
.PageResponse));
else goto default;
@@ -854,7 +858,7 @@ namespace DiscImageChef.Commands
case 0x24:
{
if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "IBM")
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyIBMModePage_24(page.PageResponse));
else goto default;
@@ -863,7 +867,7 @@ namespace DiscImageChef.Commands
case 0x2A:
{
if(page.Subpage == 0)
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyModePage_2A(page.PageResponse));
else goto default;
@@ -872,7 +876,7 @@ namespace DiscImageChef.Commands
case 0x2F:
{
if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "IBM")
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyIBMModePage_2F(page.PageResponse));
else goto default;
@@ -880,7 +884,7 @@ namespace DiscImageChef.Commands
}
case 0x30:
{
if(Decoders.SCSI.Modes.IsAppleModePage_30(page.PageResponse))
if(Modes.IsAppleModePage_30(page.PageResponse))
DicConsole.WriteLine("Drive identifies as Apple OEM drive");
else goto default;
@@ -889,7 +893,7 @@ namespace DiscImageChef.Commands
case 0x3B:
{
if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "HP")
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyHPModePage_3B(page.PageResponse));
else goto default;
@@ -898,7 +902,7 @@ namespace DiscImageChef.Commands
case 0x3C:
{
if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "HP")
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyHPModePage_3C(page.PageResponse));
else goto default;
@@ -907,10 +911,10 @@ namespace DiscImageChef.Commands
case 0x3D:
{
if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "IBM")
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyIBMModePage_3D(page.PageResponse));
else if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "HP")
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyHPModePage_3D(page.PageResponse));
else goto default;
@@ -919,11 +923,11 @@ namespace DiscImageChef.Commands
case 0x3E:
{
if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "FUJITSU")
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyFujitsuModePage_3E(page
.PageResponse));
else if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "HP")
DicConsole.WriteLine(Decoders.SCSI.Modes
DicConsole.WriteLine(Modes
.PrettifyHPModePage_3E(page.PageResponse));
else goto default;
@@ -941,7 +945,7 @@ namespace DiscImageChef.Commands
}
switch(devType) {
case Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice:
case PeripheralDeviceTypes.MultiMediaDevice:
byte[] confBuf;
sense = dev.GetConfiguration(out confBuf, out senseBuf, dev.Timeout, out duration);
@@ -950,8 +954,8 @@ namespace DiscImageChef.Commands
DataFile.WriteTo("Device-Info command", options.OutputPrefix, "_mmc_getconfiguration.bin",
"MMC GET CONFIGURATION", confBuf);
Decoders.SCSI.MMC.Features.SeparatedFeatures ftr =
Decoders.SCSI.MMC.Features.Separate(confBuf);
Features.SeparatedFeatures ftr =
Features.Separate(confBuf);
DicConsole.DebugWriteLine("Device-Info command", "GET CONFIGURATION length is {0} bytes",
ftr.DataLength);
@@ -961,185 +965,185 @@ namespace DiscImageChef.Commands
if(ftr.Descriptors != null)
{
DicConsole.WriteLine("SCSI MMC GET CONFIGURATION Features:");
foreach(Decoders.SCSI.MMC.Features.FeatureDescriptor desc in ftr.Descriptors)
foreach(Features.FeatureDescriptor desc in ftr.Descriptors)
{
DicConsole.DebugWriteLine("Device-Info command", "Feature {0:X4}h", desc.Code);
switch(desc.Code)
{
case 0x0000:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0000(desc.Data));
DicConsole.WriteLine(Features.Prettify_0000(desc.Data));
break;
case 0x0001:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0001(desc.Data));
DicConsole.WriteLine(Features.Prettify_0001(desc.Data));
break;
case 0x0002:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0002(desc.Data));
DicConsole.WriteLine(Features.Prettify_0002(desc.Data));
break;
case 0x0003:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0003(desc.Data));
DicConsole.WriteLine(Features.Prettify_0003(desc.Data));
break;
case 0x0004:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0004(desc.Data));
DicConsole.WriteLine(Features.Prettify_0004(desc.Data));
break;
case 0x0010:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0010(desc.Data));
DicConsole.WriteLine(Features.Prettify_0010(desc.Data));
break;
case 0x001D:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_001D(desc.Data));
DicConsole.WriteLine(Features.Prettify_001D(desc.Data));
break;
case 0x001E:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_001E(desc.Data));
DicConsole.WriteLine(Features.Prettify_001E(desc.Data));
break;
case 0x001F:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_001F(desc.Data));
DicConsole.WriteLine(Features.Prettify_001F(desc.Data));
break;
case 0x0020:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0020(desc.Data));
DicConsole.WriteLine(Features.Prettify_0020(desc.Data));
break;
case 0x0021:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0021(desc.Data));
DicConsole.WriteLine(Features.Prettify_0021(desc.Data));
break;
case 0x0022:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0022(desc.Data));
DicConsole.WriteLine(Features.Prettify_0022(desc.Data));
break;
case 0x0023:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0023(desc.Data));
DicConsole.WriteLine(Features.Prettify_0023(desc.Data));
break;
case 0x0024:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0024(desc.Data));
DicConsole.WriteLine(Features.Prettify_0024(desc.Data));
break;
case 0x0025:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0025(desc.Data));
DicConsole.WriteLine(Features.Prettify_0025(desc.Data));
break;
case 0x0026:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0026(desc.Data));
DicConsole.WriteLine(Features.Prettify_0026(desc.Data));
break;
case 0x0027:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0027(desc.Data));
DicConsole.WriteLine(Features.Prettify_0027(desc.Data));
break;
case 0x0028:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0028(desc.Data));
DicConsole.WriteLine(Features.Prettify_0028(desc.Data));
break;
case 0x0029:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0029(desc.Data));
DicConsole.WriteLine(Features.Prettify_0029(desc.Data));
break;
case 0x002A:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002A(desc.Data));
DicConsole.WriteLine(Features.Prettify_002A(desc.Data));
break;
case 0x002B:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002B(desc.Data));
DicConsole.WriteLine(Features.Prettify_002B(desc.Data));
break;
case 0x002C:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002C(desc.Data));
DicConsole.WriteLine(Features.Prettify_002C(desc.Data));
break;
case 0x002D:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002D(desc.Data));
DicConsole.WriteLine(Features.Prettify_002D(desc.Data));
break;
case 0x002E:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002E(desc.Data));
DicConsole.WriteLine(Features.Prettify_002E(desc.Data));
break;
case 0x002F:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002F(desc.Data));
DicConsole.WriteLine(Features.Prettify_002F(desc.Data));
break;
case 0x0030:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0030(desc.Data));
DicConsole.WriteLine(Features.Prettify_0030(desc.Data));
break;
case 0x0031:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0031(desc.Data));
DicConsole.WriteLine(Features.Prettify_0031(desc.Data));
break;
case 0x0032:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0032(desc.Data));
DicConsole.WriteLine(Features.Prettify_0032(desc.Data));
break;
case 0x0033:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0033(desc.Data));
DicConsole.WriteLine(Features.Prettify_0033(desc.Data));
break;
case 0x0035:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0035(desc.Data));
DicConsole.WriteLine(Features.Prettify_0035(desc.Data));
break;
case 0x0037:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0037(desc.Data));
DicConsole.WriteLine(Features.Prettify_0037(desc.Data));
break;
case 0x0038:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0038(desc.Data));
DicConsole.WriteLine(Features.Prettify_0038(desc.Data));
break;
case 0x003A:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_003A(desc.Data));
DicConsole.WriteLine(Features.Prettify_003A(desc.Data));
break;
case 0x003B:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_003B(desc.Data));
DicConsole.WriteLine(Features.Prettify_003B(desc.Data));
break;
case 0x0040:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0040(desc.Data));
DicConsole.WriteLine(Features.Prettify_0040(desc.Data));
break;
case 0x0041:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0041(desc.Data));
DicConsole.WriteLine(Features.Prettify_0041(desc.Data));
break;
case 0x0042:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0042(desc.Data));
DicConsole.WriteLine(Features.Prettify_0042(desc.Data));
break;
case 0x0050:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0050(desc.Data));
DicConsole.WriteLine(Features.Prettify_0050(desc.Data));
break;
case 0x0051:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0051(desc.Data));
DicConsole.WriteLine(Features.Prettify_0051(desc.Data));
break;
case 0x0080:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0080(desc.Data));
DicConsole.WriteLine(Features.Prettify_0080(desc.Data));
break;
case 0x0100:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0100(desc.Data));
DicConsole.WriteLine(Features.Prettify_0100(desc.Data));
break;
case 0x0101:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0101(desc.Data));
DicConsole.WriteLine(Features.Prettify_0101(desc.Data));
break;
case 0x0102:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0102(desc.Data));
DicConsole.WriteLine(Features.Prettify_0102(desc.Data));
break;
case 0x0103:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0103(desc.Data));
DicConsole.WriteLine(Features.Prettify_0103(desc.Data));
break;
case 0x0104:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0104(desc.Data));
DicConsole.WriteLine(Features.Prettify_0104(desc.Data));
break;
case 0x0105:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0105(desc.Data));
DicConsole.WriteLine(Features.Prettify_0105(desc.Data));
break;
case 0x0106:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0106(desc.Data));
DicConsole.WriteLine(Features.Prettify_0106(desc.Data));
break;
case 0x0107:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0107(desc.Data));
DicConsole.WriteLine(Features.Prettify_0107(desc.Data));
break;
case 0x0108:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0108(desc.Data));
DicConsole.WriteLine(Features.Prettify_0108(desc.Data));
break;
case 0x0109:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0109(desc.Data));
DicConsole.WriteLine(Features.Prettify_0109(desc.Data));
break;
case 0x010A:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_010A(desc.Data));
DicConsole.WriteLine(Features.Prettify_010A(desc.Data));
break;
case 0x010B:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_010B(desc.Data));
DicConsole.WriteLine(Features.Prettify_010B(desc.Data));
break;
case 0x010C:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_010C(desc.Data));
DicConsole.WriteLine(Features.Prettify_010C(desc.Data));
break;
case 0x010D:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_010D(desc.Data));
DicConsole.WriteLine(Features.Prettify_010D(desc.Data));
break;
case 0x010E:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_010E(desc.Data));
DicConsole.WriteLine(Features.Prettify_010E(desc.Data));
break;
case 0x0110:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0110(desc.Data));
DicConsole.WriteLine(Features.Prettify_0110(desc.Data));
break;
case 0x0113:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0113(desc.Data));
DicConsole.WriteLine(Features.Prettify_0113(desc.Data));
break;
case 0x0142:
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0142(desc.Data));
DicConsole.WriteLine(Features.Prettify_0142(desc.Data));
break;
default:
DicConsole.WriteLine("Found unknown feature code {0:X4}h", desc.Code);
@@ -1422,35 +1426,35 @@ namespace DiscImageChef.Commands
}
}
break;
case Decoders.SCSI.PeripheralDeviceTypes.SequentialAccess:
case PeripheralDeviceTypes.SequentialAccess:
byte[] seqBuf;
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));
Sense.PrettifySense(senseBuf));
else
{
DataFile.WriteTo("Device-Info command", options.OutputPrefix, "_ssc_readblocklimits.bin",
"SSC READ BLOCK LIMITS", seqBuf);
DicConsole.WriteLine("Block limits for device:");
DicConsole.WriteLine(Decoders.SCSI.SSC.BlockLimits.Prettify(seqBuf));
DicConsole.WriteLine(BlockLimits.Prettify(seqBuf));
}
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));
Sense.PrettifySense(senseBuf));
else
{
DataFile.WriteTo("Device-Info command", options.OutputPrefix,
"_ssc_reportdensitysupport.bin", "SSC REPORT DENSITY SUPPORT", seqBuf);
Decoders.SCSI.SSC.DensitySupport.DensitySupportHeader? dens =
Decoders.SCSI.SSC.DensitySupport.DecodeDensity(seqBuf);
DensitySupport.DensitySupportHeader? dens =
DensitySupport.DecodeDensity(seqBuf);
if(dens.HasValue)
{
DicConsole.WriteLine("Densities supported by device:");
DicConsole.WriteLine(Decoders.SCSI.SSC.DensitySupport.PrettifyDensity(dens));
DicConsole.WriteLine(DensitySupport.PrettifyDensity(dens));
}
}
@@ -1458,20 +1462,20 @@ namespace DiscImageChef.Commands
out duration);
if(sense)
DicConsole.ErrorWriteLine("REPORT DENSITY SUPPORT (MEDIUM):\n{0}",
Decoders.SCSI.Sense.PrettifySense(senseBuf));
Sense.PrettifySense(senseBuf));
else
{
DataFile.WriteTo("Device-Info command", options.OutputPrefix,
"_ssc_reportdensitysupport_medium.bin",
"SSC REPORT DENSITY SUPPORT (MEDIUM)", seqBuf);
Decoders.SCSI.SSC.DensitySupport.MediaTypeSupportHeader? meds =
Decoders.SCSI.SSC.DensitySupport.DecodeMediumType(seqBuf);
DensitySupport.MediaTypeSupportHeader? meds =
DensitySupport.DecodeMediumType(seqBuf);
if(meds.HasValue)
{
DicConsole.WriteLine("Medium types supported by device:");
DicConsole.WriteLine(Decoders.SCSI.SSC.DensitySupport.PrettifyMediumType(meds));
DicConsole.WriteLine(DensitySupport.PrettifyMediumType(meds));
}
DicConsole.WriteLine(Decoders.SCSI.SSC.DensitySupport.PrettifyMediumType(seqBuf));
DicConsole.WriteLine(DensitySupport.PrettifyMediumType(seqBuf));
}
break;
}

View File

@@ -32,8 +32,11 @@
using System;
using System.IO;
using System.Xml.Serialization;
using DiscImageChef.Console;
using DiscImageChef.Core;
using DiscImageChef.Core.Devices.Report;
using DiscImageChef.Core.Devices.Report.SCSI;
using DiscImageChef.Devices;
namespace DiscImageChef.Commands
@@ -73,26 +76,26 @@ namespace DiscImageChef.Commands
switch(dev.Type)
{
case DeviceType.ATA:
Core.Devices.Report.Ata.Report(dev, ref report, options.Debug, ref removable);
Ata.Report(dev, ref report, options.Debug, ref removable);
break;
case DeviceType.MMC:
case DeviceType.SecureDigital:
Core.Devices.Report.SecureDigital.Report(dev, ref report, options.Debug, ref removable);
SecureDigital.Report(dev, ref report, options.Debug, ref removable);
break;
case DeviceType.NVMe:
Core.Devices.Report.Nvme.Report(dev, ref report, options.Debug, ref removable);
Nvme.Report(dev, ref report, options.Debug, ref removable);
break;
case DeviceType.ATAPI:
case DeviceType.SCSI:
Core.Devices.Report.SCSI.General.Report(dev, ref report, options.Debug, ref removable);
General.Report(dev, ref report, options.Debug, ref removable);
break;
default: throw new NotSupportedException("Unknown device type.");
}
FileStream xmlFs = new FileStream(xmlFile, FileMode.Create);
System.Xml.Serialization.XmlSerializer xmlSer =
new System.Xml.Serialization.XmlSerializer(typeof(Metadata.DeviceReport));
XmlSerializer xmlSer =
new XmlSerializer(typeof(Metadata.DeviceReport));
xmlSer.Serialize(xmlFs, report);
xmlFs.Close();
Core.Statistics.AddCommand("device-report");

View File

@@ -36,8 +36,8 @@ using System.Linq;
using DiscImageChef.Checksums;
using DiscImageChef.Console;
using DiscImageChef.Core;
using DiscImageChef.Filters;
using DiscImageChef.DiscImages;
using DiscImageChef.Filters;
namespace DiscImageChef.Commands
{

View File

@@ -37,9 +37,9 @@ using System.Text;
using DiscImageChef.CommonTypes;
using DiscImageChef.Console;
using DiscImageChef.Core;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.DiscImages;
namespace DiscImageChef.Commands
{
@@ -163,9 +163,9 @@ namespace DiscImageChef.Commands
{
DicConsole.WriteLine(string.Format("As identified by {0}.", plugin.Name));
Filesystem fs = (Filesystem)plugin
.GetType().GetConstructor(new Type[]
.GetType().GetConstructor(new[]
{
typeof(ImagePlugin), typeof(Partition), typeof(System.Text.Encoding)
typeof(ImagePlugin), typeof(Partition), typeof(Encoding)
}).Invoke(new object[] {imageFormat, partitions[i], null});
error = fs.Mount(options.Debug);
@@ -311,9 +311,9 @@ namespace DiscImageChef.Commands
plugins.PluginsList.TryGetValue(idPlugins[0], out plugin);
DicConsole.WriteLine(string.Format("Identified by {0}.", plugin.Name));
Filesystem fs = (Filesystem)plugin
.GetType().GetConstructor(new Type[]
.GetType().GetConstructor(new[]
{
typeof(ImagePlugin), typeof(Partition), typeof(System.Text.Encoding)
typeof(ImagePlugin), typeof(Partition), typeof(Encoding)
}).Invoke(new object[] {imageFormat, partitions[i], null});
error = fs.Mount(options.Debug);
if(error == Errno.NoError)
@@ -453,9 +453,9 @@ namespace DiscImageChef.Commands
{
DicConsole.WriteLine(string.Format("As identified by {0}.", plugin.Name));
Filesystem fs = (Filesystem)plugin
.GetType().GetConstructor(new Type[]
.GetType().GetConstructor(new[]
{
typeof(ImagePlugin), typeof(Partition), typeof(System.Text.Encoding)
typeof(ImagePlugin), typeof(Partition), typeof(Encoding)
}).Invoke(new object[] {imageFormat, wholePart, null});
error = fs.Mount(options.Debug);
if(error == Errno.NoError)
@@ -580,9 +580,9 @@ namespace DiscImageChef.Commands
plugins.PluginsList.TryGetValue(idPlugins[0], out plugin);
DicConsole.WriteLine(string.Format("Identified by {0}.", plugin.Name));
Filesystem fs = (Filesystem)plugin
.GetType().GetConstructor(new Type[]
.GetType().GetConstructor(new[]
{
typeof(ImagePlugin), typeof(Partition), typeof(System.Text.Encoding)
typeof(ImagePlugin), typeof(Partition), typeof(Encoding)
}).Invoke(new object[] {imageFormat, wholePart, null});
error = fs.Mount(options.Debug);
if(error == Errno.NoError)

View File

@@ -33,9 +33,9 @@
using System.Collections.Generic;
using DiscImageChef.Console;
using DiscImageChef.Core;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.DiscImages;
using DiscImageChef.Partitions;
namespace DiscImageChef.Commands

View File

@@ -32,6 +32,7 @@
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DiscImageChef.Console;
namespace DiscImageChef.Commands
@@ -46,7 +47,7 @@ namespace DiscImageChef.Commands
internal static void DoList(ListEncodingsOptions encodingOptions)
{
List<CommonEncodingInfo> encodings = System.Text.Encoding.GetEncodings().Select(info => new CommonEncodingInfo {Name = info.Name, DisplayName = info.GetEncoding().EncodingName}).ToList();
List<CommonEncodingInfo> encodings = Encoding.GetEncodings().Select(info => new CommonEncodingInfo {Name = info.Name, DisplayName = info.GetEncoding().EncodingName}).ToList();
encodings.AddRange(Claunia.Encoding.Encoding.GetEncodings().Select(info => new CommonEncodingInfo {Name = info.Name, DisplayName = info.DisplayName}));
DicConsole.WriteLine("{0,-16} {1,-8}", "Name", "Description");

View File

@@ -36,9 +36,9 @@ using System.Text;
using DiscImageChef.CommonTypes;
using DiscImageChef.Console;
using DiscImageChef.Core;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.DiscImages;
namespace DiscImageChef.Commands
{
@@ -150,9 +150,9 @@ namespace DiscImageChef.Commands
{
DicConsole.WriteLine(string.Format("As identified by {0}.", plugin.Name));
Filesystem fs = (Filesystem)plugin
.GetType().GetConstructor(new Type[]
.GetType().GetConstructor(new[]
{
typeof(ImagePlugin), typeof(Partition), typeof(System.Text.Encoding)
typeof(ImagePlugin), typeof(Partition), typeof(Encoding)
}).Invoke(new object[] {imageFormat, partitions[i], null});
error = fs.Mount(options.Debug);
@@ -177,9 +177,9 @@ namespace DiscImageChef.Commands
plugins.PluginsList.TryGetValue(idPlugins[0], out plugin);
DicConsole.WriteLine(string.Format("Identified by {0}.", plugin.Name));
Filesystem fs = (Filesystem)plugin
.GetType().GetConstructor(new Type[]
.GetType().GetConstructor(new[]
{
typeof(ImagePlugin), typeof(Partition), typeof(System.Text.Encoding)
typeof(ImagePlugin), typeof(Partition), typeof(Encoding)
}).Invoke(new object[] {imageFormat, partitions[i], null});
error = fs.Mount(options.Debug);
if(error == Errno.NoError)
@@ -215,9 +215,9 @@ namespace DiscImageChef.Commands
{
DicConsole.WriteLine(string.Format("As identified by {0}.", plugin.Name));
Filesystem fs = (Filesystem)plugin
.GetType().GetConstructor(new Type[]
.GetType().GetConstructor(new[]
{
typeof(ImagePlugin), typeof(Partition), typeof(System.Text.Encoding)
typeof(ImagePlugin), typeof(Partition), typeof(Encoding)
}).Invoke(new object[] {imageFormat, wholePart, null});
error = fs.Mount(options.Debug);
if(error == Errno.NoError)
@@ -238,9 +238,9 @@ namespace DiscImageChef.Commands
plugins.PluginsList.TryGetValue(idPlugins[0], out plugin);
DicConsole.WriteLine(string.Format("Identified by {0}.", plugin.Name));
Filesystem fs = (Filesystem)plugin
.GetType().GetConstructor(new Type[]
.GetType().GetConstructor(new[]
{
typeof(ImagePlugin), typeof(Partition), typeof(System.Text.Encoding)
typeof(ImagePlugin), typeof(Partition), typeof(Encoding)
}).Invoke(new object[] {imageFormat, wholePart, null});
error = fs.Mount(options.Debug);
if(error == Errno.NoError)

View File

@@ -32,10 +32,23 @@
using System;
using System.Linq;
using System.Threading;
using DiscImageChef.CommonTypes;
using DiscImageChef.Console;
using DiscImageChef.Core;
using DiscImageChef.Decoders.Bluray;
using DiscImageChef.Decoders.CD;
using DiscImageChef.Decoders.DVD;
using DiscImageChef.Decoders.SCSI;
using DiscImageChef.Decoders.SCSI.MMC;
using DiscImageChef.Decoders.SCSI.SSC;
using DiscImageChef.Decoders.Xbox;
using DiscImageChef.Devices;
using BCA = DiscImageChef.Decoders.Bluray.BCA;
using Cartridge = DiscImageChef.Decoders.DVD.Cartridge;
using DDS = DiscImageChef.Decoders.DVD.DDS;
using DMI = DiscImageChef.Decoders.Xbox.DMI;
using Spare = DiscImageChef.Decoders.DVD.Spare;
namespace DiscImageChef.Commands
{
@@ -115,7 +128,7 @@ namespace DiscImageChef.Commands
sense = dev.ScsiTestUnitReady(out senseBuf, dev.Timeout, out duration);
if(sense)
{
Decoders.SCSI.FixedSense? decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf);
FixedSense? decSense = Sense.DecodeFixed(senseBuf);
if(decSense.HasValue)
{
// Just retry, for 5 times
@@ -131,7 +144,7 @@ namespace DiscImageChef.Commands
while(leftRetries > 0)
{
DicConsole.WriteLine("\rWaiting for drive to become ready");
System.Threading.Thread.Sleep(2000);
Thread.Sleep(2000);
sense = dev.ScsiTestUnitReady(out senseBuf, dev.Timeout, out duration);
if(!sense) break;
@@ -150,7 +163,7 @@ namespace DiscImageChef.Commands
while(leftRetries > 0)
{
DicConsole.WriteLine("\rWaiting for drive to become ready");
System.Threading.Thread.Sleep(2000);
Thread.Sleep(2000);
sense = dev.ScsiTestUnitReady(out senseBuf, dev.Timeout, out duration);
if(!sense) break;
@@ -160,14 +173,14 @@ namespace DiscImageChef.Commands
if(sense)
{
DicConsole.ErrorWriteLine("Error testing unit was ready:\n{0}",
Decoders.SCSI.Sense.PrettifySense(senseBuf));
Sense.PrettifySense(senseBuf));
return;
}
}
else
{
DicConsole.ErrorWriteLine("Error testing unit was ready:\n{0}",
Decoders.SCSI.Sense.PrettifySense(senseBuf));
Sense.PrettifySense(senseBuf));
return;
}
}
@@ -180,8 +193,8 @@ namespace DiscImageChef.Commands
}
byte[] modeBuf;
Decoders.SCSI.Modes.DecodedMode? decMode = null;
Decoders.SCSI.PeripheralDeviceTypes devType = dev.ScsiType;
Modes.DecodedMode? decMode = null;
PeripheralDeviceTypes devType = dev.ScsiType;
sense = dev.ModeSense10(out modeBuf, out senseBuf, false, true, ScsiModeSensePageControl.Current, 0x3F,
0xFF, 5, out duration);
@@ -189,7 +202,7 @@ namespace DiscImageChef.Commands
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);
if(!sense && !dev.Error) decMode = Modes.DecodeMode10(modeBuf, devType);
if(sense || dev.Error || !decMode.HasValue)
{
@@ -200,7 +213,7 @@ namespace DiscImageChef.Commands
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 && !dev.Error) decMode = Modes.DecodeMode6(modeBuf, devType);
}
if(!sense)
@@ -220,12 +233,12 @@ namespace DiscImageChef.Commands
}
switch(dev.ScsiType) {
case Decoders.SCSI.PeripheralDeviceTypes.DirectAccess:
case Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice:
case Decoders.SCSI.PeripheralDeviceTypes.OCRWDevice:
case Decoders.SCSI.PeripheralDeviceTypes.OpticalDevice:
case Decoders.SCSI.PeripheralDeviceTypes.SimplifiedDevice:
case Decoders.SCSI.PeripheralDeviceTypes.WriteOnceDevice:
case PeripheralDeviceTypes.DirectAccess:
case PeripheralDeviceTypes.MultiMediaDevice:
case PeripheralDeviceTypes.OCRWDevice:
case PeripheralDeviceTypes.OpticalDevice:
case PeripheralDeviceTypes.SimplifiedDevice:
case PeripheralDeviceTypes.WriteOnceDevice:
sense = dev.ReadCapacity(out cmdBuf, out senseBuf, dev.Timeout, out duration);
if(!sense)
{
@@ -240,10 +253,10 @@ namespace DiscImageChef.Commands
sense = dev.ReadCapacity16(out cmdBuf, out senseBuf, dev.Timeout, out duration);
if(sense && blocks == 0)
if(dev.ScsiType != Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
if(dev.ScsiType != PeripheralDeviceTypes.MultiMediaDevice)
{
DicConsole.ErrorWriteLine("Unable to get media capacity");
DicConsole.ErrorWriteLine("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
DicConsole.ErrorWriteLine("{0}", Sense.PrettifySense(senseBuf));
}
if(!sense)
@@ -266,7 +279,7 @@ namespace DiscImageChef.Commands
blockSize, blocks * blockSize);
}
break;
case Decoders.SCSI.PeripheralDeviceTypes.SequentialAccess:
case PeripheralDeviceTypes.SequentialAccess:
byte[] seqBuf;
byte[] medBuf;
@@ -279,12 +292,12 @@ namespace DiscImageChef.Commands
{
DataFile.WriteTo("Media-Info command", outputPrefix, "_ssc_reportdensitysupport_media.bin",
"SSC REPORT DENSITY SUPPORT (MEDIA)", seqBuf);
Decoders.SCSI.SSC.DensitySupport.DensitySupportHeader? dens =
Decoders.SCSI.SSC.DensitySupport.DecodeDensity(seqBuf);
DensitySupport.DensitySupportHeader? dens =
DensitySupport.DecodeDensity(seqBuf);
if(dens.HasValue)
{
DicConsole.WriteLine("Densities supported by currently inserted media:");
DicConsole.WriteLine(Decoders.SCSI.SSC.DensitySupport.PrettifyDensity(dens));
DicConsole.WriteLine(DensitySupport.PrettifyDensity(dens));
}
}
}
@@ -299,14 +312,14 @@ namespace DiscImageChef.Commands
DataFile.WriteTo("Media-Info command", outputPrefix,
"_ssc_reportdensitysupport_medium_media.bin",
"SSC REPORT DENSITY SUPPORT (MEDIUM & MEDIA)", seqBuf);
Decoders.SCSI.SSC.DensitySupport.MediaTypeSupportHeader? meds =
Decoders.SCSI.SSC.DensitySupport.DecodeMediumType(seqBuf);
DensitySupport.MediaTypeSupportHeader? meds =
DensitySupport.DecodeMediumType(seqBuf);
if(meds.HasValue)
{
DicConsole.WriteLine("Medium types currently inserted in device:");
DicConsole.WriteLine(Decoders.SCSI.SSC.DensitySupport.PrettifyMediumType(meds));
DicConsole.WriteLine(DensitySupport.PrettifyMediumType(meds));
}
DicConsole.WriteLine(Decoders.SCSI.SSC.DensitySupport.PrettifyMediumType(seqBuf));
DicConsole.WriteLine(DensitySupport.PrettifyMediumType(seqBuf));
}
}
@@ -323,19 +336,19 @@ namespace DiscImageChef.Commands
break;
}
if(dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
if(dev.ScsiType == PeripheralDeviceTypes.MultiMediaDevice)
{
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));
Sense.PrettifySense(senseBuf));
else
{
DataFile.WriteTo("Media-Info command", outputPrefix, "_getconfiguration_current.bin",
"SCSI GET CONFIGURATION", cmdBuf);
Decoders.SCSI.MMC.Features.SeparatedFeatures ftr = Decoders.SCSI.MMC.Features.Separate(cmdBuf);
Features.SeparatedFeatures ftr = Features.Separate(cmdBuf);
DicConsole.DebugWriteLine("Media-Info command", "GET CONFIGURATION current profile is {0:X4}h",
ftr.CurrentProfile);
@@ -438,7 +451,7 @@ namespace DiscImageChef.Commands
if(sense)
DicConsole.DebugWriteLine("Media-Info command",
"READ DISC STRUCTURE: Recognized Format Layers\n{0}",
Decoders.SCSI.Sense.PrettifySense(senseBuf));
Sense.PrettifySense(senseBuf));
else
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_formatlayers.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
@@ -447,7 +460,7 @@ namespace DiscImageChef.Commands
out duration);
if(sense)
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Write Protection Status\n{0}",
Decoders.SCSI.Sense.PrettifySense(senseBuf));
Sense.PrettifySense(senseBuf));
else
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_writeprotection.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
@@ -474,64 +487,64 @@ namespace DiscImageChef.Commands
out duration);
if(sense)
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: PFI\n{0}",
Decoders.SCSI.Sense.PrettifySense(senseBuf));
Sense.PrettifySense(senseBuf));
else
{
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_pfi.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
Decoders.DVD.PFI.PhysicalFormatInformation? decPfi = Decoders.DVD.PFI.Decode(cmdBuf);
PFI.PhysicalFormatInformation? decPfi = PFI.Decode(cmdBuf);
if(decPfi.HasValue)
{
DicConsole.WriteLine("PFI:\n{0}", Decoders.DVD.PFI.Prettify(decPfi));
DicConsole.WriteLine("PFI:\n{0}", PFI.Prettify(decPfi));
// False book types
if(dskType == MediaType.DVDROM)
switch(decPfi.Value.DiskCategory)
{
case Decoders.DVD.DiskCategory.DVDPR:
case DiskCategory.DVDPR:
dskType = MediaType.DVDPR;
break;
case Decoders.DVD.DiskCategory.DVDPRDL:
case DiskCategory.DVDPRDL:
dskType = MediaType.DVDPRDL;
break;
case Decoders.DVD.DiskCategory.DVDPRW:
case DiskCategory.DVDPRW:
dskType = MediaType.DVDPRW;
break;
case Decoders.DVD.DiskCategory.DVDPRWDL:
case DiskCategory.DVDPRWDL:
dskType = MediaType.DVDPRWDL;
break;
case Decoders.DVD.DiskCategory.DVDR:
case DiskCategory.DVDR:
if(decPfi.Value.PartVersion == 6) dskType = MediaType.DVDRDL;
else dskType = MediaType.DVDR;
break;
case Decoders.DVD.DiskCategory.DVDRAM:
case DiskCategory.DVDRAM:
dskType = MediaType.DVDRAM;
break;
default:
dskType = MediaType.DVDROM;
break;
case Decoders.DVD.DiskCategory.DVDRW:
case DiskCategory.DVDRW:
if(decPfi.Value.PartVersion == 3) dskType = MediaType.DVDRWDL;
else dskType = MediaType.DVDRW;
break;
case Decoders.DVD.DiskCategory.HDDVDR:
case DiskCategory.HDDVDR:
dskType = MediaType.HDDVDR;
break;
case Decoders.DVD.DiskCategory.HDDVDRAM:
case DiskCategory.HDDVDRAM:
dskType = MediaType.HDDVDRAM;
break;
case Decoders.DVD.DiskCategory.HDDVDROM:
case DiskCategory.HDDVDROM:
dskType = MediaType.HDDVDROM;
break;
case Decoders.DVD.DiskCategory.HDDVDRW:
case DiskCategory.HDDVDRW:
dskType = MediaType.HDDVDRW;
break;
case Decoders.DVD.DiskCategory.Nintendo:
if(decPfi.Value.DiscSize == Decoders.DVD.DVDSize.Eighty)
case DiskCategory.Nintendo:
if(decPfi.Value.DiscSize == DVDSize.Eighty)
dskType = MediaType.GOD;
else dskType = MediaType.WOD;
break;
case Decoders.DVD.DiskCategory.UMD:
case DiskCategory.UMD:
dskType = MediaType.UMD;
break;
}
@@ -543,20 +556,20 @@ namespace DiscImageChef.Commands
out duration);
if(sense)
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DMI\n{0}",
Decoders.SCSI.Sense.PrettifySense(senseBuf));
Sense.PrettifySense(senseBuf));
else
{
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_dmi.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
if(Decoders.Xbox.DMI.IsXbox(cmdBuf))
if(DMI.IsXbox(cmdBuf))
{
dskType = MediaType.XGD;
DicConsole.WriteLine("Xbox DMI:\n{0}", Decoders.Xbox.DMI.PrettifyXbox(cmdBuf));
DicConsole.WriteLine("Xbox DMI:\n{0}", DMI.PrettifyXbox(cmdBuf));
}
else if(Decoders.Xbox.DMI.IsXbox360(cmdBuf))
else if(DMI.IsXbox360(cmdBuf))
{
dskType = MediaType.XGD2;
DicConsole.WriteLine("Xbox 360 DMI:\n{0}", Decoders.Xbox.DMI.PrettifyXbox360(cmdBuf));
DicConsole.WriteLine("Xbox 360 DMI:\n{0}", DMI.PrettifyXbox360(cmdBuf));
// All XGD3 all have the same number of blocks
if(blocks == 25063 || // Locked (or non compatible drive)
@@ -576,13 +589,13 @@ namespace DiscImageChef.Commands
out duration);
if(sense)
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: CMI\n{0}",
Decoders.SCSI.Sense.PrettifySense(senseBuf));
Sense.PrettifySense(senseBuf));
else
{
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_cmi.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
DicConsole.WriteLine("Lead-In CMI:\n{0}",
Decoders.DVD.CSS_CPRM.PrettifyLeadInCopyright(cmdBuf));
CSS_CPRM.PrettifyLeadInCopyright(cmdBuf));
}
}
#endregion DVD-ROM
@@ -597,7 +610,7 @@ namespace DiscImageChef.Commands
out duration);
if(sense)
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: BCA\n{0}",
Decoders.SCSI.Sense.PrettifySense(senseBuf));
Sense.PrettifySense(senseBuf));
else
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_bca.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
@@ -605,7 +618,7 @@ namespace DiscImageChef.Commands
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));
Sense.PrettifySense(senseBuf));
else
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_aacs.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
@@ -616,36 +629,36 @@ namespace DiscImageChef.Commands
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));
Sense.PrettifySense(senseBuf));
else
{
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdram_dds.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
DicConsole.WriteLine("Disc Definition Structure:\n{0}", Decoders.DVD.DDS.Prettify(cmdBuf));
DicConsole.WriteLine("Disc Definition Structure:\n{0}", DDS.Prettify(cmdBuf));
}
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
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));
Sense.PrettifySense(senseBuf));
else
{
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdram_status.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
DicConsole.WriteLine("Medium Status:\n{0}", Decoders.DVD.Cartridge.Prettify(cmdBuf));
DicConsole.WriteLine("Medium Status:\n{0}", Cartridge.Prettify(cmdBuf));
}
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
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));
Sense.PrettifySense(senseBuf));
else
{
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdram_spare.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
DicConsole.WriteLine("Spare Area Information:\n{0}", Decoders.DVD.Spare.Prettify(cmdBuf));
DicConsole.WriteLine("Spare Area Information:\n{0}", Spare.Prettify(cmdBuf));
}
break;
case MediaType.DVDR:
@@ -655,7 +668,7 @@ namespace DiscImageChef.Commands
out duration);
if(sense)
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Last-Out Border RMD\n{0}",
Decoders.SCSI.Sense.PrettifySense(senseBuf));
Sense.PrettifySense(senseBuf));
else
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_lastrmd.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
@@ -736,7 +749,7 @@ namespace DiscImageChef.Commands
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));
Sense.PrettifySense(senseBuf));
else
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_pri.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
@@ -753,7 +766,7 @@ namespace DiscImageChef.Commands
out duration);
if(sense)
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DVD-R Media ID\n{0}",
Decoders.SCSI.Sense.PrettifySense(senseBuf));
Sense.PrettifySense(senseBuf));
else
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdr_mediaid.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
@@ -762,7 +775,7 @@ namespace DiscImageChef.Commands
out duration);
if(sense)
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DVD-R PFI\n{0}",
Decoders.SCSI.Sense.PrettifySense(senseBuf));
Sense.PrettifySense(senseBuf));
else
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdr_pfi.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
@@ -777,7 +790,7 @@ namespace DiscImageChef.Commands
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));
Sense.PrettifySense(senseBuf));
else
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd+_adip.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
@@ -786,7 +799,7 @@ namespace DiscImageChef.Commands
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));
Sense.PrettifySense(senseBuf));
else
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd+_dcb.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
@@ -799,7 +812,7 @@ namespace DiscImageChef.Commands
out duration);
if(sense)
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: HDDVD CMI\n{0}",
Decoders.SCSI.Sense.PrettifySense(senseBuf));
Sense.PrettifySense(senseBuf));
else
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_hddvd_cmi.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
@@ -816,7 +829,7 @@ namespace DiscImageChef.Commands
if(sense)
DicConsole.DebugWriteLine("Media-Info command",
"READ DISC STRUCTURE: HDDVD-R Medium Status\n{0}",
Decoders.SCSI.Sense.PrettifySense(senseBuf));
Sense.PrettifySense(senseBuf));
else
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_hddvdr_status.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
@@ -824,7 +837,7 @@ namespace DiscImageChef.Commands
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));
Sense.PrettifySense(senseBuf));
else
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_hddvdr_lastrmd.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
@@ -840,7 +853,7 @@ namespace DiscImageChef.Commands
out duration);
if(sense)
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Layer Capacity\n{0}",
Decoders.SCSI.Sense.PrettifySense(senseBuf));
Sense.PrettifySense(senseBuf));
else
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdr_layercap.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
@@ -854,7 +867,7 @@ namespace DiscImageChef.Commands
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));
Sense.PrettifySense(senseBuf));
else
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_mzs.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
@@ -863,7 +876,7 @@ namespace DiscImageChef.Commands
out duration);
if(sense)
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Jump Interval Size\n{0}",
Decoders.SCSI.Sense.PrettifySense(senseBuf));
Sense.PrettifySense(senseBuf));
else
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_jis.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
@@ -873,7 +886,7 @@ namespace DiscImageChef.Commands
if(sense)
DicConsole.DebugWriteLine("Media-Info command",
"READ DISC STRUCTURE: Manual Layer Jump Start LBA\n{0}",
Decoders.SCSI.Sense.PrettifySense(senseBuf));
Sense.PrettifySense(senseBuf));
else
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_manuallj.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
@@ -882,7 +895,7 @@ namespace DiscImageChef.Commands
out duration);
if(sense)
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Remap Anchor Point\n{0}",
Decoders.SCSI.Sense.PrettifySense(senseBuf));
Sense.PrettifySense(senseBuf));
else
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_remapanchor.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
@@ -898,18 +911,18 @@ namespace DiscImageChef.Commands
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));
Sense.PrettifySense(senseBuf));
else
{
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_di.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
DicConsole.WriteLine("Blu-ray Disc Information:\n{0}", Decoders.Bluray.DI.Prettify(cmdBuf));
DicConsole.WriteLine("Blu-ray Disc Information:\n{0}", DI.Prettify(cmdBuf));
}
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));
Sense.PrettifySense(senseBuf));
else
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_pac.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
@@ -926,12 +939,12 @@ namespace DiscImageChef.Commands
out duration);
if(sense)
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: BCA\n{0}",
Decoders.SCSI.Sense.PrettifySense(senseBuf));
Sense.PrettifySense(senseBuf));
else
{
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_bca.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
DicConsole.WriteLine("Blu-ray Burst Cutting Area:\n{0}", Decoders.Bluray.BCA.Prettify(cmdBuf));
DicConsole.WriteLine("Blu-ray Burst Cutting Area:\n{0}", BCA.Prettify(cmdBuf));
}
break;
#endregion BD-ROM only
@@ -944,7 +957,7 @@ namespace DiscImageChef.Commands
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));
Sense.PrettifySense(senseBuf));
else
{
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_dds.bin",
@@ -956,12 +969,12 @@ namespace DiscImageChef.Commands
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));
Sense.PrettifySense(senseBuf));
else
{
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_cartstatus.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
DicConsole.WriteLine("Blu-ray Cartridge Status:\n{0}", Decoders.Bluray.DI.Prettify(cmdBuf));
DicConsole.WriteLine("Blu-ray Cartridge Status:\n{0}", DI.Prettify(cmdBuf));
}
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
MmcDiscStructureFormat.BdSpareAreaInformation, 0, dev.Timeout,
@@ -969,19 +982,19 @@ namespace DiscImageChef.Commands
if(sense)
DicConsole.DebugWriteLine("Media-Info command",
"READ DISC STRUCTURE: Spare Area Information\n{0}",
Decoders.SCSI.Sense.PrettifySense(senseBuf));
Sense.PrettifySense(senseBuf));
else
{
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_spare.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
DicConsole.WriteLine("Blu-ray Spare Area Information:\n{0}",
Decoders.Bluray.DI.Prettify(cmdBuf));
DI.Prettify(cmdBuf));
}
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));
Sense.PrettifySense(senseBuf));
else
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_dfl.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
@@ -990,11 +1003,11 @@ namespace DiscImageChef.Commands
out duration);
if(sense)
DicConsole.DebugWriteLine("Media-Info command", "READ DISC INFORMATION 001b\n{0}",
Decoders.SCSI.Sense.PrettifySense(senseBuf));
Sense.PrettifySense(senseBuf));
else
{
DicConsole.WriteLine("Track Resources Information:\n{0}",
Decoders.SCSI.MMC.DiscInformation.Prettify(cmdBuf));
DiscInformation.Prettify(cmdBuf));
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscinformation_001b.bin",
"SCSI READ DISC INFORMATION", cmdBuf);
}
@@ -1002,11 +1015,11 @@ namespace DiscImageChef.Commands
dev.Timeout, out duration);
if(sense)
DicConsole.DebugWriteLine("Media-Info command", "READ DISC INFORMATION 010b\n{0}",
Decoders.SCSI.Sense.PrettifySense(senseBuf));
Sense.PrettifySense(senseBuf));
else
{
DicConsole.WriteLine("POW Resources Information:\n{0}",
Decoders.SCSI.MMC.DiscInformation.Prettify(cmdBuf));
DiscInformation.Prettify(cmdBuf));
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscinformation_010b.bin",
"SCSI READ DISC INFORMATION", cmdBuf);
}
@@ -1018,7 +1031,7 @@ namespace DiscImageChef.Commands
case MediaType.CDROM:
case MediaType.CDRW:
case MediaType.Unknown:
Decoders.CD.TOC.CDTOC? toc = null;
TOC.CDTOC? toc = null;
// We discarded all discs that falsify a TOC before requesting a real TOC
// No TOC, no CD (or an empty one)
@@ -1026,11 +1039,11 @@ namespace DiscImageChef.Commands
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));
Sense.PrettifySense(senseBuf));
else
{
toc = Decoders.CD.TOC.Decode(cmdBuf);
DicConsole.WriteLine("TOC:\n{0}", Decoders.CD.TOC.Prettify(toc));
toc = TOC.Decode(cmdBuf);
DicConsole.WriteLine("TOC:\n{0}", TOC.Prettify(toc));
DataFile.WriteTo("Media-Info command", outputPrefix, "_toc.bin", "SCSI READ TOC/PMA/ATIP",
cmdBuf);
@@ -1042,15 +1055,15 @@ namespace DiscImageChef.Commands
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));
Sense.PrettifySense(senseBuf));
else
{
DataFile.WriteTo("Media-Info command", outputPrefix, "_atip.bin", "SCSI READ TOC/PMA/ATIP",
cmdBuf);
Decoders.CD.ATIP.CDATIP? atip = Decoders.CD.ATIP.Decode(cmdBuf);
ATIP.CDATIP? atip = ATIP.Decode(cmdBuf);
if(atip.HasValue)
{
DicConsole.WriteLine("ATIP:\n{0}", Decoders.CD.ATIP.Prettify(atip));
DicConsole.WriteLine("ATIP:\n{0}", ATIP.Prettify(atip));
// Only CD-R and CD-RW have ATIP
dskType = atip.Value.DiscType ? MediaType.CDRW : MediaType.CDR;
}
@@ -1064,15 +1077,15 @@ namespace DiscImageChef.Commands
out duration);
if(sense)
DicConsole.DebugWriteLine("Media-Info command", "READ DISC INFORMATION 000b\n{0}",
Decoders.SCSI.Sense.PrettifySense(senseBuf));
Sense.PrettifySense(senseBuf));
else
{
Decoders.SCSI.MMC.DiscInformation.StandardDiscInformation? discInfo =
Decoders.SCSI.MMC.DiscInformation.Decode000b(cmdBuf);
DiscInformation.StandardDiscInformation? discInfo =
DiscInformation.Decode000b(cmdBuf);
if(discInfo.HasValue)
{
DicConsole.WriteLine("Standard Disc Information:\n{0}",
Decoders.SCSI.MMC.DiscInformation.Prettify000b(discInfo));
DiscInformation.Prettify000b(discInfo));
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscinformation_000b.bin",
"SCSI READ DISC INFORMATION", cmdBuf);
@@ -1096,13 +1109,13 @@ 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));
Sense.PrettifySense(senseBuf));
else
{
DataFile.WriteTo("Media-Info command", outputPrefix, "_session.bin",
"SCSI READ TOC/PMA/ATIP", cmdBuf);
Decoders.CD.Session.CDSessionInfo? session = Decoders.CD.Session.Decode(cmdBuf);
DicConsole.WriteLine("Session information:\n{0}", Decoders.CD.Session.Prettify(session));
Session.CDSessionInfo? session = Session.Decode(cmdBuf);
DicConsole.WriteLine("Session information:\n{0}", Session.Prettify(session));
if(session.HasValue)
{
sessions = session.Value.LastCompleteSession;
@@ -1118,18 +1131,18 @@ namespace DiscImageChef.Commands
bool hasVideoTrack = false;
if(toc.HasValue)
foreach(Decoders.CD.TOC.CDTOCTrackDataDescriptor track in toc.Value.TrackDescriptors)
foreach(TOC.CDTOCTrackDataDescriptor track in toc.Value.TrackDescriptors)
{
if(track.TrackNumber == 1 &&
((Decoders.CD.TOC_CONTROL)(track.CONTROL & 0x0D) ==
Decoders.CD.TOC_CONTROL.DataTrack ||
(Decoders.CD.TOC_CONTROL)(track.CONTROL & 0x0D) ==
Decoders.CD.TOC_CONTROL.DataTrackIncremental)) allFirstSessionTracksAreAudio &= firstTrackLastSession != 1;
((TOC_CONTROL)(track.CONTROL & 0x0D) ==
TOC_CONTROL.DataTrack ||
(TOC_CONTROL)(track.CONTROL & 0x0D) ==
TOC_CONTROL.DataTrackIncremental)) allFirstSessionTracksAreAudio &= firstTrackLastSession != 1;
if((Decoders.CD.TOC_CONTROL)(track.CONTROL & 0x0D) ==
Decoders.CD.TOC_CONTROL.DataTrack ||
(Decoders.CD.TOC_CONTROL)(track.CONTROL & 0x0D) ==
Decoders.CD.TOC_CONTROL.DataTrackIncremental)
if((TOC_CONTROL)(track.CONTROL & 0x0D) ==
TOC_CONTROL.DataTrack ||
(TOC_CONTROL)(track.CONTROL & 0x0D) ==
TOC_CONTROL.DataTrackIncremental)
{
hasDataTrack = true;
allFirstSessionTracksAreAudio &= track.TrackNumber >= firstTrackLastSession;
@@ -1149,35 +1162,35 @@ 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));
Sense.PrettifySense(senseBuf));
else
{
DataFile.WriteTo("Media-Info command", outputPrefix, "_rawtoc.bin",
"SCSI READ TOC/PMA/ATIP", cmdBuf);
DicConsole.WriteLine("Raw TOC:\n{0}", Decoders.CD.FullTOC.Prettify(cmdBuf));
DicConsole.WriteLine("Raw TOC:\n{0}", FullTOC.Prettify(cmdBuf));
}
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));
Sense.PrettifySense(senseBuf));
else
{
DataFile.WriteTo("Media-Info command", outputPrefix, "_pma.bin", "SCSI READ TOC/PMA/ATIP",
cmdBuf);
DicConsole.WriteLine("PMA:\n{0}", Decoders.CD.PMA.Prettify(cmdBuf));
DicConsole.WriteLine("PMA:\n{0}", PMA.Prettify(cmdBuf));
}
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));
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)
if(CDTextOnLeadIn.Decode(cmdBuf).HasValue)
DicConsole.WriteLine("CD-TEXT on Lead-In:\n{0}",
Decoders.CD.CDTextOnLeadIn.Prettify(cmdBuf));
CDTextOnLeadIn.Prettify(cmdBuf));
}
}
@@ -1193,21 +1206,21 @@ namespace DiscImageChef.Commands
out duration);
if(sense)
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: PFI\n{0}",
Decoders.SCSI.Sense.PrettifySense(senseBuf));
Sense.PrettifySense(senseBuf));
else
{
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_pfi.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
Decoders.DVD.PFI.PhysicalFormatInformation? nintendoPfi = Decoders.DVD.PFI.Decode(cmdBuf);
PFI.PhysicalFormatInformation? nintendoPfi = PFI.Decode(cmdBuf);
if(nintendoPfi != null)
{
DicConsole.WriteLine("PFI:\n{0}", Decoders.DVD.PFI.Prettify(cmdBuf));
if(nintendoPfi.Value.DiskCategory == Decoders.DVD.DiskCategory.Nintendo &&
DicConsole.WriteLine("PFI:\n{0}", PFI.Prettify(cmdBuf));
if(nintendoPfi.Value.DiskCategory == DiskCategory.Nintendo &&
nintendoPfi.Value.PartVersion == 15)
switch(nintendoPfi.Value.DiscSize) {
case Decoders.DVD.DVDSize.Eighty: dskType = MediaType.GOD;
case DVDSize.Eighty: dskType = MediaType.GOD;
break;
case Decoders.DVD.DVDSize.OneTwenty: dskType = MediaType.WOD;
case DVDSize.OneTwenty: dskType = MediaType.WOD;
break;
}
}
@@ -1217,7 +1230,7 @@ namespace DiscImageChef.Commands
out duration);
if(sense)
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DMI\n{0}",
Decoders.SCSI.Sense.PrettifySense(senseBuf));
Sense.PrettifySense(senseBuf));
else
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_dmi.bin",
"SCSI READ DISC STRUCTURE", cmdBuf);
@@ -1232,24 +1245,24 @@ namespace DiscImageChef.Commands
case MediaType.XGD3:
// We need to get INQUIRY to know if it is a Kreon drive
byte[] inqBuffer;
Decoders.SCSI.Inquiry.SCSIInquiry? inq;
Inquiry.SCSIInquiry? inq;
sense = dev.ScsiInquiry(out inqBuffer, out senseBuf);
if(!sense)
{
inq = Decoders.SCSI.Inquiry.Decode(inqBuffer);
inq = Inquiry.Decode(inqBuffer);
if(inq.HasValue && inq.Value.KreonPresent)
{
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));
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));
if(SS.Decode(cmdBuf).HasValue)
DicConsole.WriteLine("Xbox Security Sector:\n{0}", SS.Prettify(cmdBuf));
ulong l0Video, l1Video, middleZone, gameSize, totalSize, layerBreak;
@@ -1280,8 +1293,8 @@ namespace DiscImageChef.Commands
DicConsole.DebugWriteLine("Dump-media command", "Video partition total size: {0} sectors",
totalSize);
l0Video = Decoders.DVD.PFI.Decode(cmdBuf).Value.Layer0EndPSN -
Decoders.DVD.PFI.Decode(cmdBuf).Value.DataAreaStartPSN + 1;
l0Video = PFI.Decode(cmdBuf).Value.Layer0EndPSN -
PFI.Decode(cmdBuf).Value.DataAreaStartPSN + 1;
l1Video = totalSize - l0Video + 1;
// Get game partition size
@@ -1331,8 +1344,8 @@ namespace DiscImageChef.Commands
DicConsole.DebugWriteLine("Dump-media command", "Unlocked total size: {0} sectors", totalSize);
middleZone =
totalSize - (Decoders.DVD.PFI.Decode(cmdBuf).Value.Layer0EndPSN -
Decoders.DVD.PFI.Decode(cmdBuf).Value.DataAreaStartPSN + 1) - gameSize + 1;
totalSize - (PFI.Decode(cmdBuf).Value.Layer0EndPSN -
PFI.Decode(cmdBuf).Value.DataAreaStartPSN + 1) - gameSize + 1;
totalSize = l0Video + l1Video + middleZone * 2 + gameSize;
layerBreak = l0Video + middleZone + gameSize / 2;
@@ -1363,7 +1376,7 @@ 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));
Sense.PrettifySense(senseBuf));
else
{
DataFile.WriteTo("Media-Info command", outputPrefix, "_mediaserialnumber.bin",

View File

@@ -32,8 +32,8 @@
using DiscImageChef.Console;
using DiscImageChef.Core;
using DiscImageChef.Filters;
using DiscImageChef.DiscImages;
using DiscImageChef.Filters;
namespace DiscImageChef.Commands
{

View File

@@ -34,8 +34,8 @@ using System;
using System.Collections.Generic;
using DiscImageChef.Console;
using DiscImageChef.Core;
using DiscImageChef.Filters;
using DiscImageChef.DiscImages;
using DiscImageChef.Filters;
namespace DiscImageChef.Commands
{

View File

@@ -33,7 +33,9 @@
using System;
using System.Reflection;
using CommandLine;
using DiscImageChef.Commands;
using DiscImageChef.Console;
using Statistics = DiscImageChef.Core.Statistics;
namespace DiscImageChef
{
@@ -46,51 +48,40 @@ namespace DiscImageChef
DicConsole.ErrorWriteLineEvent += System.Console.Error.WriteLine;
Settings.Settings.LoadSettings();
Core.Statistics.LoadStats();
if(Settings.Settings.Current.Stats.ShareStats) Core.Statistics.SubmitStats();
Statistics.LoadStats();
if(Settings.Settings.Current.Stats.ShareStats) Statistics.SubmitStats();
Parser.Default
.ParseArguments(args,
new[]
{
typeof(AnalyzeOptions), typeof(CompareOptions), typeof(ChecksumOptions),
typeof(EntropyOptions), typeof(VerifyOptions), typeof(PrintHexOptions),
typeof(DecodeOptions), typeof(DeviceInfoOptions), typeof(MediaInfoOptions),
typeof(MediaScanOptions), typeof(FormatsOptions), typeof(BenchmarkOptions),
typeof(CreateSidecarOptions), typeof(DumpMediaOptions),
typeof(DeviceReportOptions), typeof(ConfigureOptions), typeof(StatsOptions),
typeof(LsOptions), typeof(ExtractFilesOptions), typeof(ListDevicesOptions),
typeof(ListEncodingsOptions)
}).WithParsed<AnalyzeOptions>(opts =>
.ParseArguments(args, typeof(AnalyzeOptions), typeof(CompareOptions), typeof(ChecksumOptions), typeof(EntropyOptions), typeof(VerifyOptions), typeof(PrintHexOptions), typeof(DecodeOptions), typeof(DeviceInfoOptions), typeof(MediaInfoOptions), typeof(MediaScanOptions), typeof(FormatsOptions), typeof(BenchmarkOptions), typeof(CreateSidecarOptions), typeof(DumpMediaOptions), typeof(DeviceReportOptions), typeof(ConfigureOptions), typeof(StatsOptions), typeof(LsOptions), typeof(ExtractFilesOptions), typeof(ListDevicesOptions), typeof(ListEncodingsOptions)).WithParsed<AnalyzeOptions>(opts =>
{
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
PrintCopyright();
Commands.Analyze.DoAnalyze(opts);
Analyze.DoAnalyze(opts);
}).WithParsed<CompareOptions>(opts =>
{
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
PrintCopyright();
Commands.Compare.DoCompare(opts);
Compare.DoCompare(opts);
}).WithParsed<ChecksumOptions>(opts =>
{
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
PrintCopyright();
Commands.Checksum.DoChecksum(opts);
Checksum.DoChecksum(opts);
}).WithParsed<EntropyOptions>(opts =>
{
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
PrintCopyright();
Commands.Entropy.DoEntropy(opts);
Entropy.DoEntropy(opts);
}).WithParsed<VerifyOptions>(opts =>
{
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
PrintCopyright();
Commands.Verify.DoVerify(opts);
Verify.DoVerify(opts);
}).WithParsed<PrintHexOptions>(opts =>
{
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
@@ -102,90 +93,90 @@ namespace DiscImageChef
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
PrintCopyright();
Commands.Decode.DoDecode(opts);
Decode.DoDecode(opts);
}).WithParsed<DeviceInfoOptions>(opts =>
{
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
PrintCopyright();
Commands.DeviceInfo.DoDeviceInfo(opts);
DeviceInfo.DoDeviceInfo(opts);
}).WithParsed<MediaInfoOptions>(opts =>
{
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
PrintCopyright();
Commands.MediaInfo.DoMediaInfo(opts);
MediaInfo.DoMediaInfo(opts);
}).WithParsed<MediaScanOptions>(opts =>
{
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
PrintCopyright();
Commands.MediaScan.DoMediaScan(opts);
MediaScan.DoMediaScan(opts);
}).WithParsed<FormatsOptions>(opts =>
{
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
PrintCopyright();
Commands.Formats.ListFormats(opts);
Formats.ListFormats(opts);
}).WithParsed<BenchmarkOptions>(opts =>
{
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
PrintCopyright();
Commands.Benchmark.DoBenchmark(opts);
Benchmark.DoBenchmark(opts);
}).WithParsed<CreateSidecarOptions>(opts =>
{
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
PrintCopyright();
Commands.CreateSidecar.DoSidecar(opts);
CreateSidecar.DoSidecar(opts);
}).WithParsed<DumpMediaOptions>(opts =>
{
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
PrintCopyright();
Commands.DumpMedia.DoDumpMedia(opts);
DumpMedia.DoDumpMedia(opts);
}).WithParsed<DeviceReportOptions>(opts =>
{
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
PrintCopyright();
Commands.DeviceReport.DoDeviceReport(opts);
DeviceReport.DoDeviceReport(opts);
}).WithParsed<LsOptions>(opts =>
{
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
PrintCopyright();
Commands.Ls.DoLs(opts);
Ls.DoLs(opts);
}).WithParsed<ExtractFilesOptions>(opts =>
{
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
PrintCopyright();
Commands.ExtractFiles.DoExtractFiles(opts);
ExtractFiles.DoExtractFiles(opts);
}).WithParsed<ListDevicesOptions>(opts =>
{
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
PrintCopyright();
Commands.ListDevices.DoListDevices(opts);
ListDevices.DoListDevices(opts);
}).WithParsed<ListEncodingsOptions>(opts =>
{
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
PrintCopyright();
Commands.ListEncodings.DoList(opts);
ListEncodings.DoList(opts);
}).WithParsed<ConfigureOptions>(opts =>
{
PrintCopyright();
Commands.Configure.DoConfigure();
Configure.DoConfigure();
}).WithParsed<StatsOptions>(opts =>
{
PrintCopyright();
Commands.Statistics.ShowStats();
}).WithNotParsed(errs => Environment.Exit(1));
Core.Statistics.SaveStats();
Statistics.SaveStats();
}
static void PrintCopyright()

View File

@@ -31,6 +31,7 @@
// ****************************************************************************/
using CommandLine;
// ReSharper disable MemberCanBeInternal
// ReSharper disable UnusedAutoPropertyAccessor.Global