mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Refactor: Move dumping code, and misc file writing code, to
Core.
This commit is contained in:
@@ -36,6 +36,7 @@ using System.IO;
|
||||
using DiscImageChef.Console;
|
||||
using System.Text;
|
||||
using DiscImageChef.Decoders.ATA;
|
||||
using DiscImageChef.Core;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
@@ -187,7 +188,7 @@ namespace DiscImageChef.Commands
|
||||
break;
|
||||
}
|
||||
|
||||
doWriteFile(options.OutputPrefix, "_ata_identify.bin", "ATA IDENTIFY", ataBuf);
|
||||
DataFile.WriteTo("Device-Info command", options.OutputPrefix, "_ata_identify.bin", "ATA IDENTIFY", ataBuf);
|
||||
|
||||
DicConsole.WriteLine(Identify.Prettify(ataBuf));
|
||||
|
||||
@@ -250,7 +251,7 @@ namespace DiscImageChef.Commands
|
||||
break;
|
||||
}
|
||||
|
||||
doWriteFile(options.OutputPrefix, "_atapi_identify.bin", "ATAPI IDENTIFY", ataBuf);
|
||||
DataFile.WriteTo("Device-Info command", options.OutputPrefix, "_atapi_identify.bin", "ATAPI IDENTIFY", ataBuf);
|
||||
|
||||
DicConsole.WriteLine(Identify.Prettify(ataBuf));
|
||||
|
||||
@@ -274,7 +275,7 @@ namespace DiscImageChef.Commands
|
||||
if(dev.Type != DeviceType.ATAPI)
|
||||
DicConsole.WriteLine("SCSI device");
|
||||
|
||||
doWriteFile(options.OutputPrefix, "_scsi_inquiry.bin", "SCSI INQUIRY", inqBuf);
|
||||
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));
|
||||
@@ -296,7 +297,7 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
DicConsole.WriteLine("ASCII Page {0:X2}h: {1}", page, Decoders.SCSI.EVPD.DecodeASCIIPage(inqBuf));
|
||||
|
||||
doWriteFile(options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), 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);
|
||||
}
|
||||
}
|
||||
else if(page == 0x80)
|
||||
@@ -305,7 +306,7 @@ namespace DiscImageChef.Commands
|
||||
if(!sense)
|
||||
{
|
||||
DicConsole.WriteLine("Unit Serial Number: {0}", Decoders.SCSI.EVPD.DecodePage80(inqBuf));
|
||||
doWriteFile(options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), 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);
|
||||
}
|
||||
}
|
||||
else if(page == 0x81)
|
||||
@@ -314,7 +315,7 @@ namespace DiscImageChef.Commands
|
||||
if(!sense)
|
||||
{
|
||||
DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_81(inqBuf));
|
||||
doWriteFile(options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), 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);
|
||||
}
|
||||
}
|
||||
else if(page == 0x82)
|
||||
@@ -323,7 +324,7 @@ namespace DiscImageChef.Commands
|
||||
if(!sense)
|
||||
{
|
||||
DicConsole.WriteLine("ASCII implemented operating definitions: {0}", Decoders.SCSI.EVPD.DecodePage82(inqBuf));
|
||||
doWriteFile(options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), 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);
|
||||
}
|
||||
}
|
||||
else if(page == 0x83)
|
||||
@@ -332,7 +333,7 @@ namespace DiscImageChef.Commands
|
||||
if(!sense)
|
||||
{
|
||||
DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_83(inqBuf));
|
||||
doWriteFile(options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), 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);
|
||||
}
|
||||
}
|
||||
else if(page == 0x84)
|
||||
@@ -341,7 +342,7 @@ namespace DiscImageChef.Commands
|
||||
if(!sense)
|
||||
{
|
||||
DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_84(inqBuf));
|
||||
doWriteFile(options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), 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);
|
||||
}
|
||||
}
|
||||
else if(page == 0x85)
|
||||
@@ -350,7 +351,7 @@ namespace DiscImageChef.Commands
|
||||
if(!sense)
|
||||
{
|
||||
DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_85(inqBuf));
|
||||
doWriteFile(options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), 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);
|
||||
}
|
||||
}
|
||||
else if(page == 0x86)
|
||||
@@ -359,7 +360,7 @@ namespace DiscImageChef.Commands
|
||||
if(!sense)
|
||||
{
|
||||
DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_86(inqBuf));
|
||||
doWriteFile(options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), 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);
|
||||
}
|
||||
}
|
||||
else if(page == 0x89)
|
||||
@@ -368,7 +369,7 @@ namespace DiscImageChef.Commands
|
||||
if(!sense)
|
||||
{
|
||||
DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_89(inqBuf));
|
||||
doWriteFile(options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), 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);
|
||||
}
|
||||
}
|
||||
else if(page == 0xB0)
|
||||
@@ -377,7 +378,7 @@ namespace DiscImageChef.Commands
|
||||
if(!sense)
|
||||
{
|
||||
DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_B0(inqBuf));
|
||||
doWriteFile(options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), 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);
|
||||
}
|
||||
}
|
||||
else if(page == 0xB1)
|
||||
@@ -386,7 +387,7 @@ namespace DiscImageChef.Commands
|
||||
if(!sense)
|
||||
{
|
||||
DicConsole.WriteLine("Manufacturer-assigned Serial Number: {0}", Decoders.SCSI.EVPD.DecodePageB1(inqBuf));
|
||||
doWriteFile(options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), 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);
|
||||
}
|
||||
}
|
||||
else if(page == 0xB2)
|
||||
@@ -395,7 +396,7 @@ namespace DiscImageChef.Commands
|
||||
if(!sense)
|
||||
{
|
||||
DicConsole.WriteLine("TapeAlert Supported Flags Bitmap: 0x{0:X16}", Decoders.SCSI.EVPD.DecodePageB2(inqBuf));
|
||||
doWriteFile(options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), 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);
|
||||
}
|
||||
}
|
||||
else if(page == 0xB3)
|
||||
@@ -404,7 +405,7 @@ namespace DiscImageChef.Commands
|
||||
if(!sense)
|
||||
{
|
||||
DicConsole.WriteLine("Automation Device Serial Number: {0}", Decoders.SCSI.EVPD.DecodePageB3(inqBuf));
|
||||
doWriteFile(options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), 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);
|
||||
}
|
||||
}
|
||||
else if(page == 0xB4)
|
||||
@@ -413,7 +414,7 @@ namespace DiscImageChef.Commands
|
||||
if(!sense)
|
||||
{
|
||||
DicConsole.WriteLine("Data Transfer Device Element Address: 0x{0}", Decoders.SCSI.EVPD.DecodePageB4(inqBuf));
|
||||
doWriteFile(options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), 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);
|
||||
}
|
||||
}
|
||||
else if(page == 0xC0 && StringHandlers.CToString(inq.Value.VendorIdentification).ToLowerInvariant().Trim() == "quantum")
|
||||
@@ -422,7 +423,7 @@ namespace DiscImageChef.Commands
|
||||
if(!sense)
|
||||
{
|
||||
DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_C0_Quantum(inqBuf));
|
||||
doWriteFile(options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), 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);
|
||||
}
|
||||
}
|
||||
else if(page == 0xC0 && StringHandlers.CToString(inq.Value.VendorIdentification).ToLowerInvariant().Trim() == "seagate")
|
||||
@@ -431,7 +432,7 @@ namespace DiscImageChef.Commands
|
||||
if(!sense)
|
||||
{
|
||||
DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_C0_Seagate(inqBuf));
|
||||
doWriteFile(options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), 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);
|
||||
}
|
||||
}
|
||||
else if(page == 0xC0 && StringHandlers.CToString(inq.Value.VendorIdentification).ToLowerInvariant().Trim() == "ibm")
|
||||
@@ -440,7 +441,7 @@ namespace DiscImageChef.Commands
|
||||
if(!sense)
|
||||
{
|
||||
DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_C0_IBM(inqBuf));
|
||||
doWriteFile(options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), 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);
|
||||
}
|
||||
}
|
||||
else if(page == 0xC1 && StringHandlers.CToString(inq.Value.VendorIdentification).ToLowerInvariant().Trim() == "ibm")
|
||||
@@ -449,7 +450,7 @@ namespace DiscImageChef.Commands
|
||||
if(!sense)
|
||||
{
|
||||
DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_C1_IBM(inqBuf));
|
||||
doWriteFile(options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), 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);
|
||||
}
|
||||
}
|
||||
else if((page == 0xC0 || page == 0xC1) && StringHandlers.CToString(inq.Value.VendorIdentification).ToLowerInvariant().Trim() == "certance")
|
||||
@@ -458,7 +459,7 @@ namespace DiscImageChef.Commands
|
||||
if(!sense)
|
||||
{
|
||||
DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_C0_C1_Certance(inqBuf));
|
||||
doWriteFile(options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), 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);
|
||||
}
|
||||
}
|
||||
else if((page == 0xC2 || page == 0xC3 || page == 0xC4 || page == 0xC5 || page == 0xC6) &&
|
||||
@@ -468,7 +469,7 @@ namespace DiscImageChef.Commands
|
||||
if(!sense)
|
||||
{
|
||||
DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_C2_C3_C4_C5_C6_Certance(inqBuf));
|
||||
doWriteFile(options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), 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);
|
||||
}
|
||||
}
|
||||
else if((page == 0xC0 || page == 0xC1 || page == 0xC2 || page == 0xC3 || page == 0xC4 || page == 0xC5) &&
|
||||
@@ -478,7 +479,7 @@ namespace DiscImageChef.Commands
|
||||
if(!sense)
|
||||
{
|
||||
DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_C0_to_C5_HP(inqBuf));
|
||||
doWriteFile(options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), 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);
|
||||
}
|
||||
}
|
||||
else if(page == 0xDF && StringHandlers.CToString(inq.Value.VendorIdentification).ToLowerInvariant().Trim() == "certance")
|
||||
@@ -487,7 +488,7 @@ namespace DiscImageChef.Commands
|
||||
if(!sense)
|
||||
{
|
||||
DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_DF_Certance(inqBuf));
|
||||
doWriteFile(options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), 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);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -499,7 +500,7 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page);
|
||||
if(!sense)
|
||||
{
|
||||
doWriteFile(options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -532,7 +533,7 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
|
||||
if(!sense)
|
||||
doWriteFile(options.OutputPrefix, "_scsi_modesense.bin", "SCSI MODE SENSE", modeBuf);
|
||||
DataFile.WriteTo("Device-Info command", options.OutputPrefix, "_scsi_modesense.bin", "SCSI MODE SENSE", modeBuf);
|
||||
|
||||
if(decMode.HasValue)
|
||||
{
|
||||
@@ -881,7 +882,7 @@ namespace DiscImageChef.Commands
|
||||
|
||||
if(!sense)
|
||||
{
|
||||
doWriteFile(options.OutputPrefix, "_mmc_getconfiguration.bin", "MMC GET CONFIGURATION", confBuf);
|
||||
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);
|
||||
|
||||
@@ -1170,7 +1171,7 @@ namespace DiscImageChef.Commands
|
||||
|
||||
if(!plxtSense)
|
||||
{
|
||||
doWriteFile(options.OutputPrefix, "_plextor_eeprom.bin", "PLEXTOR READ EEPROM", plxtBuf);
|
||||
DataFile.WriteTo("Device-Info command", options.OutputPrefix, "_plextor_eeprom.bin", "PLEXTOR READ EEPROM", plxtBuf);
|
||||
|
||||
ushort discs;
|
||||
uint cdReadTime, cdWriteTime, dvdReadTime = 0, dvdWriteTime = 0;
|
||||
@@ -1366,7 +1367,7 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.ErrorWriteLine("READ BLOCK LIMITS:\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
{
|
||||
doWriteFile(options.OutputPrefix, "_ssc_readblocklimits.bin", "SSC READ BLOCK LIMITS", seqBuf);
|
||||
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));
|
||||
}
|
||||
@@ -1376,7 +1377,7 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.ErrorWriteLine("REPORT DENSITY SUPPORT:\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
{
|
||||
doWriteFile(options.OutputPrefix, "_ssc_reportdensitysupport.bin", "SSC REPORT DENSITY SUPPORT", seqBuf);
|
||||
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);
|
||||
if(dens.HasValue)
|
||||
{
|
||||
@@ -1390,7 +1391,7 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.ErrorWriteLine("REPORT DENSITY SUPPORT (MEDIUM):\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
{
|
||||
doWriteFile(options.OutputPrefix, "_ssc_reportdensitysupport_medium.bin", "SSC REPORT DENSITY SUPPORT (MEDIUM)", seqBuf);
|
||||
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);
|
||||
if(meds.HasValue)
|
||||
{
|
||||
@@ -1410,29 +1411,6 @@ namespace DiscImageChef.Commands
|
||||
|
||||
Core.Statistics.AddCommand("device-info");
|
||||
}
|
||||
|
||||
static void doWriteFile(string outputPrefix, string outputSuffix, string whatWriting, byte[] data)
|
||||
{
|
||||
if(!string.IsNullOrEmpty(outputPrefix))
|
||||
{
|
||||
if(!File.Exists(outputPrefix + outputSuffix))
|
||||
{
|
||||
try
|
||||
{
|
||||
DicConsole.DebugWriteLine("Device-Info command", "Writing " + whatWriting + " to {0}{1}", outputPrefix, outputSuffix);
|
||||
FileStream outputFs = new FileStream(outputPrefix + outputSuffix, FileMode.CreateNew);
|
||||
outputFs.Write(data, 0, data.Length);
|
||||
outputFs.Close();
|
||||
}
|
||||
catch
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Unable to write file {0}{1}", outputPrefix, outputSuffix);
|
||||
}
|
||||
}
|
||||
else
|
||||
DicConsole.ErrorWriteLine("Not overwriting file {0}{1}", outputPrefix, outputSuffix);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -36,6 +36,7 @@ using System.IO;
|
||||
using DiscImageChef.Devices;
|
||||
using DiscImageChef.CommonTypes;
|
||||
using System.Linq;
|
||||
using DiscImageChef.Core;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
@@ -208,7 +209,7 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
|
||||
if(!sense)
|
||||
doWriteFile(outputPrefix, "_scsi_modesense.bin", "SCSI MODE SENSE", modeBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_scsi_modesense.bin", "SCSI MODE SENSE", modeBuf);
|
||||
|
||||
byte scsiMediumType = 0;
|
||||
byte scsiDensityCode = 0;
|
||||
@@ -234,7 +235,7 @@ namespace DiscImageChef.Commands
|
||||
sense = dev.ReadCapacity(out cmdBuf, out senseBuf, dev.Timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
doWriteFile(outputPrefix, "_readcapacity.bin", "SCSI READ CAPACITY", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readcapacity.bin", "SCSI READ CAPACITY", cmdBuf);
|
||||
blocks = (ulong)((cmdBuf[0] << 24) + (cmdBuf[1] << 16) + (cmdBuf[2] << 8) + (cmdBuf[3]));
|
||||
blockSize = (uint)((cmdBuf[5] << 24) + (cmdBuf[5] << 16) + (cmdBuf[6] << 8) + (cmdBuf[7]));
|
||||
}
|
||||
@@ -255,7 +256,7 @@ namespace DiscImageChef.Commands
|
||||
|
||||
if(!sense)
|
||||
{
|
||||
doWriteFile(outputPrefix, "_readcapacity16.bin", "SCSI READ CAPACITY(16)", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readcapacity16.bin", "SCSI READ CAPACITY(16)", cmdBuf);
|
||||
byte[] temp = new byte[8];
|
||||
|
||||
Array.Copy(cmdBuf, 0, temp, 0, 8);
|
||||
@@ -285,7 +286,7 @@ namespace DiscImageChef.Commands
|
||||
|
||||
if(!sense && !seqBuf.SequenceEqual(medBuf))
|
||||
{
|
||||
doWriteFile(outputPrefix, "_ssc_reportdensitysupport_media.bin", "SSC REPORT DENSITY SUPPORT (MEDIA)", seqBuf);
|
||||
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);
|
||||
if(dens.HasValue)
|
||||
{
|
||||
@@ -302,7 +303,7 @@ namespace DiscImageChef.Commands
|
||||
|
||||
if(!sense && !seqBuf.SequenceEqual(medBuf))
|
||||
{
|
||||
doWriteFile(outputPrefix, "_ssc_reportdensitysupport_medium_media.bin", "SSC REPORT DENSITY SUPPORT (MEDIUM & MEDIA)", seqBuf);
|
||||
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);
|
||||
if(meds.HasValue)
|
||||
{
|
||||
@@ -320,7 +321,7 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.ErrorWriteLine("SCSI READ ATTRIBUTE:\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
{
|
||||
doWriteFile(outputPrefix, "_scsi_readattribute.bin", "SCSI READ ATTRIBUTE", seqBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_scsi_readattribute.bin", "SCSI READ ATTRIBUTE", seqBuf);
|
||||
}
|
||||
*/
|
||||
}
|
||||
@@ -332,7 +333,7 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ GET CONFIGURATION:\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
{
|
||||
doWriteFile(outputPrefix, "_getconfiguration_current.bin", "SCSI GET CONFIGURATION", cmdBuf);
|
||||
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);
|
||||
|
||||
@@ -434,12 +435,12 @@ namespace DiscImageChef.Commands
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Recognized Format Layers\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_formatlayers.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_formatlayers.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0, MmcDiscStructureFormat.WriteProtectionStatus, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Write Protection Status\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_writeprotection.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_writeprotection.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
|
||||
// More like a drive information
|
||||
/*
|
||||
@@ -447,7 +448,7 @@ namespace DiscImageChef.Commands
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Capability List\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_capabilitylist.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_capabilitylist.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
*/
|
||||
|
||||
#region All DVD and HD DVD types
|
||||
@@ -467,7 +468,7 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: PFI\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
{
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_dvd_pfi.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
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);
|
||||
if(decPfi.HasValue)
|
||||
{
|
||||
@@ -538,7 +539,7 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DMI\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
{
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_dvd_dmi.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_dmi.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
if(Decoders.Xbox.DMI.IsXbox(cmdBuf))
|
||||
{
|
||||
dskType = MediaType.XGD;
|
||||
@@ -567,7 +568,7 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: CMI\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
{
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_dvd_cmi.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
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));
|
||||
}
|
||||
}
|
||||
@@ -581,12 +582,12 @@ namespace DiscImageChef.Commands
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: BCA\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_dvd_bca.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_bca.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0, MmcDiscStructureFormat.DVD_AACS, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DVD AACS\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_dvd_aacs.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_aacs.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
#endregion DVD-ROM and HD DVD-ROM
|
||||
|
||||
@@ -596,57 +597,57 @@ namespace DiscImageChef.Commands
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Disc Key\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_dvd_disckey.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_disckey.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0, MmcDiscStructureFormat.SectorCopyrightInformation, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Sector CMI\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_dvd_sectorcmi.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_sectorcmi.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0, MmcDiscStructureFormat.MediaIdentifier, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Media ID\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_dvd_mediaid.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_mediaid.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0, MmcDiscStructureFormat.MediaKeyBlock, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: MKB\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_dvd_mkb.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_mkb.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0, MmcDiscStructureFormat.AACSVolId, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: AACS Volume ID\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_aacsvolid.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_aacsvolid.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0, MmcDiscStructureFormat.AACSMediaSerial, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: AACS Media Serial Number\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_aacssn.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_aacssn.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0, MmcDiscStructureFormat.AACSMediaId, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: AACS Media ID\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_aacsmediaid.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_aacsmediaid.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0, MmcDiscStructureFormat.AACSMKB, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: AACS MKB\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_aacsmkb.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_aacsmkb.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0, MmcDiscStructureFormat.AACSLBAExtents, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: AACS LBA Extents\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_aacslbaextents.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_aacslbaextents.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0, MmcDiscStructureFormat.AACSMKBCPRM, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: AACS CPRM MKB\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_aacscprmmkb.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_aacscprmmkb.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0, MmcDiscStructureFormat.AACSDataKeys, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: AACS Data Keys\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_aacsdatakeys.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_aacsdatakeys.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
*/
|
||||
#endregion Require drive authentication, won't work
|
||||
|
||||
@@ -658,7 +659,7 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DDS\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
{
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_dvdram_dds.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
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));
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0, MmcDiscStructureFormat.DVDRAM_MediumStatus, 0, dev.Timeout, out duration);
|
||||
@@ -666,7 +667,7 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Medium Status\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
{
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_dvdram_status.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
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));
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0, MmcDiscStructureFormat.DVDRAM_SpareAreaInformation, 0, dev.Timeout, out duration);
|
||||
@@ -674,7 +675,7 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: SAI\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
{
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_dvdram_spare.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
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));
|
||||
}
|
||||
}
|
||||
@@ -687,7 +688,7 @@ namespace DiscImageChef.Commands
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Last-Out Border RMD\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_dvd_lastrmd.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_lastrmd.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
#endregion DVD-R and HD DVD-R
|
||||
|
||||
@@ -698,7 +699,7 @@ namespace DiscImageChef.Commands
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Pre-Recorded Info\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_dvd_pri.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_pri.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
#endregion DVD-R and DVD-RW
|
||||
|
||||
@@ -709,12 +710,12 @@ namespace DiscImageChef.Commands
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DVD-R Media ID\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_dvdr_mediaid.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdr_mediaid.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0, MmcDiscStructureFormat.DVDR_PhysicalInformation, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DVD-R PFI\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_dvdr_pfi.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdr_pfi.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
#endregion DVD-R, DVD-RW and HD DVD-R
|
||||
|
||||
@@ -726,13 +727,13 @@ namespace DiscImageChef.Commands
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: ADIP\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_dvd+_adip.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd+_adip.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0, MmcDiscStructureFormat.DCB, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DCB\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_dvd+_dcb.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd+_dcb.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
#endregion All DVD+
|
||||
|
||||
@@ -743,7 +744,7 @@ namespace DiscImageChef.Commands
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: HDDVD CMI\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_hddvd_cmi.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_hddvd_cmi.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
#endregion HD DVD-ROM
|
||||
|
||||
@@ -754,12 +755,12 @@ namespace DiscImageChef.Commands
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: HDDVD-R Medium Status\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_hddvdr_status.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_hddvdr_status.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0, MmcDiscStructureFormat.HDDVDR_LastRMD, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Last RMD\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_hddvdr_lastrmd.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_hddvdr_lastrmd.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
#endregion HD DVD-R
|
||||
|
||||
@@ -771,7 +772,7 @@ namespace DiscImageChef.Commands
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Layer Capacity\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_dvdr_layercap.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdr_layercap.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
#endregion DVD-R DL, DVD-RW DL, DVD+R DL, DVD+RW DL
|
||||
|
||||
@@ -782,22 +783,22 @@ namespace DiscImageChef.Commands
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Middle Zone Start\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_dvd_mzs.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_mzs.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0, MmcDiscStructureFormat.JumpIntervalSize, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Jump Interval Size\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_dvd_jis.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_jis.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0, MmcDiscStructureFormat.ManualLayerJumpStartLBA, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Manual Layer Jump Start LBA\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_dvd_manuallj.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_manuallj.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0, MmcDiscStructureFormat.RemapAnchorPoint, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Remap Anchor Point\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_dvd_remapanchor.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_remapanchor.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
#endregion DVD-R DL
|
||||
|
||||
@@ -810,14 +811,14 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DI\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
{
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_bd_di.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
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));
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.BD, 0, 0, MmcDiscStructureFormat.PAC, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: PAC\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_bd_pac.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_pac.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
#endregion All Blu-ray
|
||||
|
||||
@@ -829,7 +830,7 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: BCA\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
{
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_bd_bca.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
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));
|
||||
}
|
||||
}
|
||||
@@ -844,7 +845,7 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DDS\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
{
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_bd_dds.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_dds.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DicConsole.WriteLine("Blu-ray Disc Definition Structure:\n{0}", Decoders.Bluray.DDS.Prettify(cmdBuf));
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.BD, 0, 0, MmcDiscStructureFormat.CartridgeStatus, 0, dev.Timeout, out duration);
|
||||
@@ -852,7 +853,7 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Cartridge Status\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
{
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_bd_cartstatus.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
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));
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.BD, 0, 0, MmcDiscStructureFormat.BD_SpareAreaInformation, 0, dev.Timeout, out duration);
|
||||
@@ -860,21 +861,21 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Spare Area Information\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
{
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_bd_spare.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
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));
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.BD, 0, 0, MmcDiscStructureFormat.RawDFL, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Raw DFL\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_bd_dfl.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_dfl.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
sense = dev.ReadDiscInformation(out cmdBuf, out senseBuf, MmcDiscInformationDataTypes.TrackResources, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC INFORMATION 001b\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
{
|
||||
DicConsole.WriteLine("Track Resources Information:\n{0}", Decoders.SCSI.MMC.DiscInformation.Prettify(cmdBuf));
|
||||
doWriteFile(outputPrefix, "_readdiscinformation_001b.bin", "SCSI READ DISC INFORMATION", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscinformation_001b.bin", "SCSI READ DISC INFORMATION", cmdBuf);
|
||||
}
|
||||
sense = dev.ReadDiscInformation(out cmdBuf, out senseBuf, MmcDiscInformationDataTypes.POWResources, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
@@ -882,7 +883,7 @@ namespace DiscImageChef.Commands
|
||||
else
|
||||
{
|
||||
DicConsole.WriteLine("POW Resources Information:\n{0}", Decoders.SCSI.MMC.DiscInformation.Prettify(cmdBuf));
|
||||
doWriteFile(outputPrefix, "_readdiscinformation_010b.bin", "SCSI READ DISC INFORMATION", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscinformation_010b.bin", "SCSI READ DISC INFORMATION", cmdBuf);
|
||||
}
|
||||
}
|
||||
#endregion Writable Blu-ray only
|
||||
@@ -905,7 +906,7 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
toc = Decoders.CD.TOC.Decode(cmdBuf);
|
||||
DicConsole.WriteLine("TOC:\n{0}", Decoders.CD.TOC.Prettify(toc));
|
||||
doWriteFile(outputPrefix, "_toc.bin", "SCSI READ TOC/PMA/ATIP", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_toc.bin", "SCSI READ TOC/PMA/ATIP", cmdBuf);
|
||||
|
||||
// As we have a TOC we know it is a CD
|
||||
if(dskType == MediaType.Unknown)
|
||||
@@ -918,7 +919,7 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ TOC/PMA/ATIP: ATIP\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
{
|
||||
doWriteFile(outputPrefix, "_atip.bin", "SCSI READ TOC/PMA/ATIP", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_atip.bin", "SCSI READ TOC/PMA/ATIP", cmdBuf);
|
||||
Decoders.CD.ATIP.CDATIP? atip = Decoders.CD.ATIP.Decode(cmdBuf);
|
||||
if(atip.HasValue)
|
||||
{
|
||||
@@ -940,7 +941,7 @@ namespace DiscImageChef.Commands
|
||||
if(discInfo.HasValue)
|
||||
{
|
||||
DicConsole.WriteLine("Standard Disc Information:\n{0}", Decoders.SCSI.MMC.DiscInformation.Prettify000b(discInfo));
|
||||
doWriteFile(outputPrefix, "_readdiscinformation_000b.bin", "SCSI READ DISC INFORMATION", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscinformation_000b.bin", "SCSI READ DISC INFORMATION", cmdBuf);
|
||||
|
||||
// If it is a read-only CD, check CD type if available
|
||||
if(dskType == MediaType.CD)
|
||||
@@ -966,7 +967,7 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ TOC/PMA/ATIP: Session info\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
{
|
||||
doWriteFile(outputPrefix, "_session.bin", "SCSI READ TOC/PMA/ATIP", cmdBuf);
|
||||
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));
|
||||
if(session.HasValue)
|
||||
@@ -1022,7 +1023,7 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ TOC/PMA/ATIP: Raw TOC\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
{
|
||||
doWriteFile(outputPrefix, "_rawtoc.bin", "SCSI READ TOC/PMA/ATIP", cmdBuf);
|
||||
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));
|
||||
}
|
||||
sense = dev.ReadPma(out cmdBuf, out senseBuf, dev.Timeout, out duration);
|
||||
@@ -1030,7 +1031,7 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ TOC/PMA/ATIP: PMA\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
{
|
||||
doWriteFile(outputPrefix, "_pma.bin", "SCSI READ TOC/PMA/ATIP", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_pma.bin", "SCSI READ TOC/PMA/ATIP", cmdBuf);
|
||||
DicConsole.WriteLine("PMA:\n{0}", Decoders.CD.PMA.Prettify(cmdBuf));
|
||||
}
|
||||
|
||||
@@ -1039,7 +1040,7 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ TOC/PMA/ATIP: CD-TEXT\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
{
|
||||
doWriteFile(outputPrefix, "_cdtext.bin", "SCSI READ TOC/PMA/ATIP", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_cdtext.bin", "SCSI READ TOC/PMA/ATIP", cmdBuf);
|
||||
if(Decoders.CD.CDTextOnLeadIn.Decode(cmdBuf).HasValue)
|
||||
DicConsole.WriteLine("CD-TEXT on Lead-In:\n{0}", Decoders.CD.CDTextOnLeadIn.Prettify(cmdBuf));
|
||||
}
|
||||
@@ -1055,7 +1056,7 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: PFI\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
{
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_dvd_pfi.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
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);
|
||||
if(nintendoPfi != null)
|
||||
{
|
||||
@@ -1074,7 +1075,7 @@ namespace DiscImageChef.Commands
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DMI\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_readdiscstructure_dvd_dmi.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_dmi.bin", "SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
}
|
||||
#endregion Nintendo
|
||||
}
|
||||
@@ -1096,7 +1097,7 @@ namespace DiscImageChef.Commands
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "KREON EXTRACT SS:\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
doWriteFile(outputPrefix, "_xbox_ss.bin", "KREON EXTRACT SS", cmdBuf);
|
||||
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));
|
||||
@@ -1198,7 +1199,7 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ MEDIA SERIAL NUMBER\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
else
|
||||
{
|
||||
doWriteFile(outputPrefix, "_mediaserialnumber.bin", "SCSI READ MEDIA SERIAL NUMBER", cmdBuf);
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_mediaserialnumber.bin", "SCSI READ MEDIA SERIAL NUMBER", cmdBuf);
|
||||
if(cmdBuf.Length >= 4)
|
||||
{
|
||||
DicConsole.Write("Media Serial Number: ");
|
||||
@@ -1208,29 +1209,6 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void doWriteFile(string outputPrefix, string outputSuffix, string whatWriting, byte[] data)
|
||||
{
|
||||
if(!string.IsNullOrEmpty(outputPrefix))
|
||||
{
|
||||
if(!File.Exists(outputPrefix + outputSuffix))
|
||||
{
|
||||
try
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "Writing " + whatWriting + " to {0}{1}", outputPrefix, outputSuffix);
|
||||
FileStream outputFs = new FileStream(outputPrefix + outputSuffix, FileMode.CreateNew);
|
||||
outputFs.Write(data, 0, data.Length);
|
||||
outputFs.Close();
|
||||
}
|
||||
catch
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Unable to write file {0}{1}", outputPrefix, outputSuffix);
|
||||
}
|
||||
}
|
||||
else
|
||||
DicConsole.ErrorWriteLine("Not overwriting file {0}{1}", outputPrefix, outputSuffix);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user