2015-10-13 01:45:07 +01:00
|
|
|
|
// /***************************************************************************
|
|
|
|
|
|
// The Disc Image Chef
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
//
|
|
|
|
|
|
// Filename : DeviceInfo.cs
|
|
|
|
|
|
// Version : 1.0
|
|
|
|
|
|
// Author(s) : Natalia Portillo
|
|
|
|
|
|
//
|
|
|
|
|
|
// Component : Component
|
|
|
|
|
|
//
|
|
|
|
|
|
// Revision : $Revision$
|
|
|
|
|
|
// Last change by : $Author$
|
|
|
|
|
|
// Date : $Date$
|
|
|
|
|
|
//
|
|
|
|
|
|
// --[ Description ] ----------------------------------------------------------
|
|
|
|
|
|
//
|
|
|
|
|
|
// Description
|
|
|
|
|
|
//
|
|
|
|
|
|
// --[ License ] --------------------------------------------------------------
|
|
|
|
|
|
//
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
|
|
// it under the terms of the GNU General Public License as
|
|
|
|
|
|
// published by the Free Software Foundation, either version 3 of the
|
|
|
|
|
|
// License, or (at your option) any later version.
|
|
|
|
|
|
//
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
|
//
|
|
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
//
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
// Copyright (C) 2011-2015 Claunia.com
|
|
|
|
|
|
// ****************************************************************************/
|
|
|
|
|
|
// //$Id$
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using DiscImageChef.Devices;
|
|
|
|
|
|
using System.IO;
|
2015-10-18 22:04:03 +01:00
|
|
|
|
using DiscImageChef.Console;
|
2015-10-19 04:32:16 +01:00
|
|
|
|
using System.Text;
|
2015-11-23 04:26:53 +00:00
|
|
|
|
using DiscImageChef.Decoders.ATA;
|
2015-10-13 01:45:07 +01:00
|
|
|
|
|
|
|
|
|
|
namespace DiscImageChef.Commands
|
|
|
|
|
|
{
|
|
|
|
|
|
public static class DeviceInfo
|
|
|
|
|
|
{
|
|
|
|
|
|
public static void doDeviceInfo(DeviceInfoSubOptions options)
|
|
|
|
|
|
{
|
2015-10-18 22:04:03 +01:00
|
|
|
|
DicConsole.DebugWriteLine("Device-Info command", "--debug={0}", options.Debug);
|
|
|
|
|
|
DicConsole.DebugWriteLine("Device-Info command", "--verbose={0}", options.Verbose);
|
|
|
|
|
|
DicConsole.DebugWriteLine("Device-Info command", "--device={0}", options.DevicePath);
|
2015-11-02 21:08:38 +00:00
|
|
|
|
DicConsole.DebugWriteLine("Device-Info command", "--output-prefix={0}", options.OutputPrefix);
|
2015-10-13 01:45:07 +01:00
|
|
|
|
|
2016-02-04 16:51:03 +00:00
|
|
|
|
if (!System.IO.File.Exists(options.DevicePath))
|
|
|
|
|
|
{
|
|
|
|
|
|
DicConsole.ErrorWriteLine("Specified device does not exist.");
|
|
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2015-10-13 01:45:07 +01:00
|
|
|
|
if (options.DevicePath.Length == 2 && options.DevicePath[1] == ':' &&
|
|
|
|
|
|
options.DevicePath[0] != '/' && Char.IsLetter(options.DevicePath[0]))
|
|
|
|
|
|
{
|
|
|
|
|
|
options.DevicePath = "\\\\.\\" + Char.ToUpper(options.DevicePath[0]) + ':';
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Device dev = new Device(options.DevicePath);
|
|
|
|
|
|
|
|
|
|
|
|
if (dev.Error)
|
|
|
|
|
|
{
|
2015-10-18 22:04:03 +01:00
|
|
|
|
DicConsole.ErrorWriteLine("Error {0} opening device.", dev.LastError);
|
2015-10-13 01:45:07 +01:00
|
|
|
|
return;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
* commandline:
* DiscImageChef.Settings/Settings.cs:
* DiscImageChef.Settings/docs/README.txt:
* DiscImageChef.Settings/packages.config:
* DiscImageChef.Settings/docs/LICENSE.txt:
* DiscImageChef.Settings/docs/ChangeLog.txt:
* DiscImageChef.Settings/docs/mono/index.xml:
* DiscImageChef.Settings/docs/html/index.html:
* DiscImageChef.Settings/Properties/AssemblyInfo.cs:
* DiscImageChef.Settings/DiscImageChef.Settings.csproj:
* DiscImageChef.Settings/docs/mono/ns-Claunia.PropertyList.xml:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/UID.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/UID.html:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSSet.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/index.html:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSSet.html:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSDate.xml:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSData.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSDate.html:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSData.html:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSArray.xml:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSNumber.xml:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSString.xml:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSObject.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSArray.html:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSNumber.html:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSString.html:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSObject.html:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSDictionary.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSDictionary.html:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/PropertyListParser.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/PropertyListParser.html:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/XmlPropertyListParser.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/XmlPropertyListParser.html:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/ASCIIPropertyListParser.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/ASCIIPropertyListParser.html:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/BinaryPropertyListParser.xml:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/BinaryPropertyListWriter.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/BinaryPropertyListWriter.html:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/BinaryPropertyListParser.html:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/PropertyListFormatException.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/PropertyListFormatException.html:
Added supports for settings
* DiscImageChef/Commands/Configure.cs:
Added support for settings.
* DiscImageChef/Core/Statistics.cs:
* DiscImageChef/Commands/Verify.cs:
* DiscImageChef/Commands/Entropy.cs:
* DiscImageChef/Commands/Formats.cs:
* DiscImageChef/Commands/PrintHex.cs:
* DiscImageChef/Commands/MediaInfo.cs:
* DiscImageChef/Commands/Statistics.cs:
Added statistics.
* DiscImageChef.Decoders/SCSI/Inquiry.cs:
Corrected bug on inquiry decoding.
* DiscImageChef.Decoders/SCSI/Modes.cs:
Corrected bug on decoding mode page 2Ah without write
performance descriptors.
Corrected bug when there is a vendor page 0 in mode sense
decoding.
* DiscImageChef.Devices/Device/Constructor.cs:
Corrected detecting USB or FireWire attached CD/DVD/BD and
tape drives.
Try ATA identify on USB or FireWire that don't have SCSI
INQUIRY.
* DiscImageChef.DiscImages/CDRWin.cs:
Corrected CD-ROM XA vs CD-ROM detection.
* DiscImageChef.Partitions/AppleMap.cs:
Corrected big endian working.
Added debug output.
* DiscImageChef.sln:
Added supports for settings.
* DiscImageChef/Commands/Decode.cs:
* DiscImageChef/Commands/Analyze.cs:
* DiscImageChef/Commands/Compare.cs:
* DiscImageChef/Commands/Checksum.cs:
* DiscImageChef/Commands/Benchmark.cs:
* DiscImageChef/Commands/DeviceInfo.cs:
* DiscImageChef/Commands/CreateSidecar.cs:
Added statistics.
* DiscImageChef/Commands/DeviceReport.cs:
Added statistics.
Correct handling empty inquiry string fields.
Suppose it is not removable, til proved wrong.
Corrected MODE SENSE (6/10) detection and calling order.
If device is MMC type but reports neither mode page 2Ah
neither GET CONFIGURATION, try all CDs (old drives work like
that).
Try reading Lead-In and Lead-Out in Audio CD using Audio READ
CD commands.
Corrected READ LONG information handling, some drives return
2s-complement in 32 bit. Upper 16 bits are ignored.
Added support for DVD raw block (37856 bytes).
Check READ LONG up to 36 times the cooked block size. That
should be enough to detect huge blocked media (like DVD and
BD) without taking ages.
If READ LONG size had to be bruteforced, and debug is
activated, save the result.
* DiscImageChef/Commands/DumpMedia.cs:
Added statistics.
Corrected READ LONG information handling, some drives return
2s-complement in 32 bit. Upper 16 bits are ignored.
Start trying with 64 blocks at a time. Some drives report to
be able to read 255 at a time, but they really don't, they
take a lot longer to read.
* DiscImageChef/Commands/MediaScan.cs:
Added statistics.
Start trying with 64 blocks at a time. Some drives report to
be able to read 255 at a time, but they really don't, they
take a lot longer to read.
* DiscImageChef/DiscImageChef.csproj:
Added support for settings.
Added statistics.
* DiscImageChef/Main.cs:
* DiscImageChef/Options.cs:
Added support for settings.
Added statistics.
2016-02-03 18:58:11 +00:00
|
|
|
|
Core.Statistics.AddDevice(dev);
|
|
|
|
|
|
|
2015-12-31 16:12:22 +00:00
|
|
|
|
if (dev.IsUSB)
|
|
|
|
|
|
{
|
|
|
|
|
|
DicConsole.WriteLine("USB device");
|
|
|
|
|
|
if(dev.USBDescriptors != null)
|
|
|
|
|
|
DicConsole.WriteLine("USB descriptor is {0} bytes", dev.USBDescriptors.Length);
|
|
|
|
|
|
DicConsole.WriteLine("USB Vendor ID: {0:X4}", dev.USBVendorID);
|
|
|
|
|
|
DicConsole.WriteLine("USB Product ID: {0:X4}", dev.USBProductID);
|
2015-12-31 16:33:20 +00:00
|
|
|
|
DicConsole.WriteLine("USB Manufacturer: {0}", dev.USBManufacturerString);
|
|
|
|
|
|
DicConsole.WriteLine("USB Product: {0}", dev.USBProductString);
|
|
|
|
|
|
DicConsole.WriteLine("USB Serial number: {0}", dev.USBSerialString);
|
|
|
|
|
|
DicConsole.WriteLine();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (dev.IsFireWire)
|
|
|
|
|
|
{
|
|
|
|
|
|
DicConsole.WriteLine("FireWire device");
|
|
|
|
|
|
DicConsole.WriteLine("FireWire Vendor ID: {0:X6}", dev.FireWireVendor);
|
|
|
|
|
|
DicConsole.WriteLine("FireWire Model ID: {0:X6}", dev.FireWireModel);
|
|
|
|
|
|
DicConsole.WriteLine("FireWire Manufacturer: {0}", dev.FireWireVendorName);
|
|
|
|
|
|
DicConsole.WriteLine("FireWire Model: {0}", dev.FireWireModelName);
|
|
|
|
|
|
DicConsole.WriteLine("FireWire GUID: {0:X16}", dev.FireWireGUID);
|
2015-12-31 16:12:22 +00:00
|
|
|
|
DicConsole.WriteLine();
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2015-10-19 05:11:28 +01:00
|
|
|
|
switch (dev.Type)
|
|
|
|
|
|
{
|
|
|
|
|
|
case DeviceType.ATA:
|
|
|
|
|
|
{
|
|
|
|
|
|
AtaErrorRegistersCHS errorRegisters;
|
2015-10-13 01:45:07 +01:00
|
|
|
|
|
2015-10-19 05:11:28 +01:00
|
|
|
|
byte[] ataBuf;
|
|
|
|
|
|
bool sense = dev.AtaIdentify(out ataBuf, out errorRegisters);
|
2015-10-13 01:45:07 +01:00
|
|
|
|
|
2015-10-19 05:11:28 +01:00
|
|
|
|
if (sense)
|
|
|
|
|
|
{
|
|
|
|
|
|
DicConsole.DebugWriteLine("Device-Info command", "STATUS = 0x{0:X2}", errorRegisters.status);
|
|
|
|
|
|
DicConsole.DebugWriteLine("Device-Info command", "ERROR = 0x{0:X2}", errorRegisters.error);
|
|
|
|
|
|
DicConsole.DebugWriteLine("Device-Info command", "NSECTOR = 0x{0:X2}", errorRegisters.sectorCount);
|
|
|
|
|
|
DicConsole.DebugWriteLine("Device-Info command", "SECTOR = 0x{0:X2}", errorRegisters.sector);
|
|
|
|
|
|
DicConsole.DebugWriteLine("Device-Info command", "CYLHIGH = 0x{0:X2}", errorRegisters.cylinderHigh);
|
|
|
|
|
|
DicConsole.DebugWriteLine("Device-Info command", "CYLLOW = 0x{0:X2}", errorRegisters.cylinderLow);
|
|
|
|
|
|
DicConsole.DebugWriteLine("Device-Info command", "DEVICE = 0x{0:X2}", errorRegisters.deviceHead);
|
|
|
|
|
|
DicConsole.DebugWriteLine("Device-Info command", "COMMAND = 0x{0:X2}", errorRegisters.command);
|
|
|
|
|
|
DicConsole.DebugWriteLine("Device-Info command", "Error code = {0}", dev.LastError);
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
2015-10-15 01:46:31 +01:00
|
|
|
|
|
2016-01-14 21:10:39 +00:00
|
|
|
|
doWriteFile(options.OutputPrefix, "_ata_identify.bin", "ATA IDENTIFY", ataBuf);
|
2015-11-02 21:08:38 +00:00
|
|
|
|
|
2015-10-19 05:11:28 +01:00
|
|
|
|
DicConsole.WriteLine(Decoders.ATA.Identify.Prettify(ataBuf));
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
case DeviceType.ATAPI:
|
|
|
|
|
|
{
|
|
|
|
|
|
AtaErrorRegistersCHS errorRegisters;
|
2015-10-15 01:46:31 +01:00
|
|
|
|
|
2015-10-19 05:11:28 +01:00
|
|
|
|
byte[] ataBuf;
|
|
|
|
|
|
bool sense = dev.AtapiIdentify(out ataBuf, out errorRegisters);
|
2015-10-15 01:46:31 +01:00
|
|
|
|
|
2015-10-19 05:11:28 +01:00
|
|
|
|
if (sense)
|
|
|
|
|
|
{
|
|
|
|
|
|
DicConsole.DebugWriteLine("Device-Info command", "STATUS = 0x{0:X2}", errorRegisters.status);
|
|
|
|
|
|
DicConsole.DebugWriteLine("Device-Info command", "ERROR = 0x{0:X2}", errorRegisters.error);
|
|
|
|
|
|
DicConsole.DebugWriteLine("Device-Info command", "NSECTOR = 0x{0:X2}", errorRegisters.sectorCount);
|
|
|
|
|
|
DicConsole.DebugWriteLine("Device-Info command", "SECTOR = 0x{0:X2}", errorRegisters.sector);
|
|
|
|
|
|
DicConsole.DebugWriteLine("Device-Info command", "CYLHIGH = 0x{0:X2}", errorRegisters.cylinderHigh);
|
|
|
|
|
|
DicConsole.DebugWriteLine("Device-Info command", "CYLLOW = 0x{0:X2}", errorRegisters.cylinderLow);
|
|
|
|
|
|
DicConsole.DebugWriteLine("Device-Info command", "DEVICE = 0x{0:X2}", errorRegisters.deviceHead);
|
|
|
|
|
|
DicConsole.DebugWriteLine("Device-Info command", "COMMAND = 0x{0:X2}", errorRegisters.command);
|
|
|
|
|
|
DicConsole.DebugWriteLine("Device-Info command", "Error code = {0}", dev.LastError);
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
2015-10-19 04:32:16 +01:00
|
|
|
|
|
2016-01-14 21:10:39 +00:00
|
|
|
|
doWriteFile(options.OutputPrefix, "_atapi_identify.bin", "ATAPI IDENTIFY", ataBuf);
|
2015-11-02 21:08:38 +00:00
|
|
|
|
|
2015-10-19 05:11:28 +01:00
|
|
|
|
DicConsole.WriteLine(Decoders.ATA.Identify.Prettify(ataBuf));
|
2015-10-15 01:46:31 +01:00
|
|
|
|
|
2015-10-19 05:11:28 +01:00
|
|
|
|
// ATAPI devices are also SCSI devices
|
|
|
|
|
|
goto case DeviceType.SCSI;
|
2015-10-15 01:46:31 +01:00
|
|
|
|
}
|
2015-10-19 05:11:28 +01:00
|
|
|
|
case DeviceType.SCSI:
|
2015-10-15 01:46:31 +01:00
|
|
|
|
{
|
2015-10-19 05:11:28 +01:00
|
|
|
|
byte[] senseBuf;
|
|
|
|
|
|
byte[] inqBuf;
|
2015-10-19 04:32:16 +01:00
|
|
|
|
|
2015-10-19 05:11:28 +01:00
|
|
|
|
bool sense = dev.ScsiInquiry(out inqBuf, out senseBuf);
|
2015-10-19 04:32:16 +01:00
|
|
|
|
|
2015-10-19 05:11:28 +01:00
|
|
|
|
if (sense)
|
|
|
|
|
|
{
|
2015-11-23 05:15:37 +00:00
|
|
|
|
DicConsole.ErrorWriteLine("SCSI error:\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
2015-10-19 04:32:16 +01:00
|
|
|
|
|
2015-10-19 05:11:28 +01:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
2015-10-19 04:32:16 +01:00
|
|
|
|
|
2015-10-19 05:11:28 +01:00
|
|
|
|
if (dev.Type != DeviceType.ATAPI)
|
|
|
|
|
|
DicConsole.WriteLine("SCSI device");
|
2015-10-19 04:32:16 +01:00
|
|
|
|
|
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs:
* DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
* DiscImageChef.Metadata/DeviceReport.cs:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DeviceReport.cs:
* DiscImageChef.Metadata/DiscImageChef.Metadata.csproj:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DumpMedia.cs:
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Core/Checksum.cs:
* DiscImageChef/Commands/CreateSidecar.cs:
Moved checksum generation to a separate class.
* CICMMetadata:
Added support for ADIP.
* DiscImageChef.CommonTypes/MediaType.cs:
Added parameters of UDO media.
Moved DataPlay outside of Iomega, as it's not from that
manufacturer.
Added missing Exatape media and corrected 160m XL one.
Added SyJet media.
Added all ECMA defined magneto-optical (sectors calculated
from specifications, unchecked).
Added PD media.
Added Imation 320Gb RDX.
Added generic USB flash drives.
* DiscImageChef.Decoders/SCSI/Enums.cs:
Make enumerations public.
* DiscImageChef.Decoders/SCSI/Inquiry.cs:
* DiscImageChef.Devices/Device/Constructor.cs:
Trim space padded strings on SCSI INQUIRY.
* DiscImageChef.Devices/Device/ScsiCommands/MMC.cs:
Added PREVENT ALLOW MEDIUM REMOVAL.
Added START STOP UNIT.
* DiscImageChef.Devices/Device/ScsiCommands/NEC.cs:
Rename NEC methods.
* DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs:
Corrected Pioneer transfer length calculation.
* DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs:
Renamed Plextor methods.
* DiscImageChef.Devices/Device/ScsiCommands/SPC.cs:
Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with
MMC same name but different command.
* DiscImageChef.Devices/DiscImageChef.Devices.csproj:
Set platform target to x86 (does it really matter?).
* DiscImageChef.Devices/Linux/Command.cs:
Reduced allocation for readlink() to current kernel
MAX_PATH.
* DiscImageChef.Devices/Linux/Enums.cs:
Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves
commands not working on 32-bit environments.
* DiscImageChef.DiscImages/ZZZRawImage.cs:
Changed ECMA-184 and ECMA-183 enums.
* DiscImageChef.Metadata/Dimensions.cs:
Added all ECMA defined magneto-opticals.
Added PD media.
Added 320Gb RDX.
Corrected Exatape 160m XL.
Added Exatape 22m and 28m.
* DiscImageChef.Metadata/MediaType.cs:
Added 356mm magneto-optical media.
Changed ECMA-184 and ECMA-183 enums.
Added USB generic flash drive.
* DiscImageChef/Commands/DeviceInfo.cs:
Corrected SCSI INQUIRY naming.
Corrected SCSI MODE SENSE (6) parameters.
Reduced SCSI MODE SENSE timeout, some devices just get stuck
with unsupported MODE SENSE commanda and must be left to
timeout.
Changed FUJITSU vendor string comparison.
* DiscImageChef/Commands/MediaInfo.cs:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
Changed some error WriteLine() to debug ones. Too much
verbosity.
Added DVD media type decoding from PFI.
Found a drive that dumps ADIP, enabling it again (not
decoded).
* DiscImageChef/Commands/MediaScan.cs:
Added option to generate ImgBurn compatible log to
media-scan command.
* DiscImageChef/DiscImageChef.csproj:
Moved checksum generation to a separate class.
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Main.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Options.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
Added option to generate ImgBurn compatible log to media-scan
command.
2016-01-31 08:05:56 +00:00
|
|
|
|
doWriteFile(options.OutputPrefix, "_scsi_inquiry.bin", "SCSI INQUIRY", inqBuf);
|
2015-11-02 21:08:38 +00:00
|
|
|
|
|
2015-10-31 21:03:18 +00:00
|
|
|
|
Decoders.SCSI.Inquiry.SCSIInquiry? inq = Decoders.SCSI.Inquiry.Decode(inqBuf);
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Inquiry.Prettify(inq));
|
2015-10-19 04:32:16 +01:00
|
|
|
|
|
2016-01-14 21:10:39 +00:00
|
|
|
|
bool scsi80 = false;
|
2015-10-19 05:11:28 +01:00
|
|
|
|
string scsiSerial = null;
|
|
|
|
|
|
StringBuilder sb = null;
|
|
|
|
|
|
|
|
|
|
|
|
sense = dev.ScsiInquiry(out inqBuf, out senseBuf, 0x00);
|
|
|
|
|
|
|
|
|
|
|
|
if (!sense)
|
2015-10-19 04:32:16 +01:00
|
|
|
|
{
|
2015-10-19 05:11:28 +01:00
|
|
|
|
byte[] pages = Decoders.SCSI.EVPD.DecodePage00(inqBuf);
|
|
|
|
|
|
|
2015-10-31 21:03:18 +00:00
|
|
|
|
if (pages != null)
|
2015-10-19 04:32:16 +01:00
|
|
|
|
{
|
2015-10-31 21:03:18 +00:00
|
|
|
|
foreach (byte page in pages)
|
2015-10-19 04:32:16 +01:00
|
|
|
|
{
|
2015-10-31 21:03:18 +00:00
|
|
|
|
if (page >= 0x01 && page <= 0x7F)
|
2015-10-19 05:11:28 +01:00
|
|
|
|
{
|
2015-10-31 21:03:18 +00:00
|
|
|
|
sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page);
|
|
|
|
|
|
if (!sense)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (sb == null)
|
|
|
|
|
|
sb = new StringBuilder();
|
|
|
|
|
|
sb.AppendFormat("Page 0x{0:X2}: ", Decoders.SCSI.EVPD.DecodeASCIIPage(inqBuf)).AppendLine();
|
2015-11-02 21:08:38 +00:00
|
|
|
|
|
2016-01-14 21:10:39 +00:00
|
|
|
|
doWriteFile(options.OutputPrefix, String.Format("_scsi_evpd_{0:X2}h.bin", page), String.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf);
|
2015-10-31 21:03:18 +00:00
|
|
|
|
}
|
2015-10-19 05:11:28 +01:00
|
|
|
|
}
|
2015-10-31 21:03:18 +00:00
|
|
|
|
else if (page == 0x80)
|
2015-10-19 05:11:28 +01:00
|
|
|
|
{
|
2015-10-31 21:03:18 +00:00
|
|
|
|
sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page);
|
|
|
|
|
|
if (!sense)
|
|
|
|
|
|
{
|
2016-01-14 21:10:39 +00:00
|
|
|
|
scsi80 = true;
|
2015-10-31 21:03:18 +00:00
|
|
|
|
scsiSerial = Decoders.SCSI.EVPD.DecodePage80(inqBuf);
|
2015-11-02 21:08:38 +00:00
|
|
|
|
|
2016-01-14 21:10:39 +00:00
|
|
|
|
doWriteFile(options.OutputPrefix, String.Format("_scsi_evpd_{0:X2}h.bin", page), String.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf);
|
2015-10-31 21:03:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (page != 0x00)
|
2015-11-02 21:08:38 +00:00
|
|
|
|
{
|
2015-10-31 21:03:18 +00:00
|
|
|
|
DicConsole.DebugWriteLine("Device-Info command", "Found undecoded SCSI VPD page 0x{0:X2}", page);
|
2015-11-02 21:08:38 +00:00
|
|
|
|
|
|
|
|
|
|
sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page);
|
|
|
|
|
|
if (!sense)
|
|
|
|
|
|
{
|
2016-01-14 21:10:39 +00:00
|
|
|
|
doWriteFile(options.OutputPrefix, String.Format("_scsi_evpd_{0:X2}h.bin", page), String.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf);
|
2015-11-02 21:08:38 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2015-10-19 05:11:28 +01:00
|
|
|
|
}
|
2015-10-19 04:32:16 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2016-01-14 21:10:39 +00:00
|
|
|
|
if (scsi80)
|
2015-10-19 05:11:28 +01:00
|
|
|
|
DicConsole.WriteLine("Unit Serial Number: {0}", scsiSerial);
|
2015-10-19 04:32:16 +01:00
|
|
|
|
|
2015-10-19 05:11:28 +01:00
|
|
|
|
if (sb != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
DicConsole.WriteLine("ASCII VPDs:");
|
|
|
|
|
|
DicConsole.WriteLine(sb.ToString());
|
|
|
|
|
|
}
|
2015-10-19 04:32:16 +01:00
|
|
|
|
|
2015-10-31 21:03:18 +00:00
|
|
|
|
byte[] modeBuf;
|
|
|
|
|
|
double duration;
|
|
|
|
|
|
Decoders.SCSI.Modes.DecodedMode? decMode = null;
|
|
|
|
|
|
Decoders.SCSI.PeripheralDeviceTypes devType = (DiscImageChef.Decoders.SCSI.PeripheralDeviceTypes)inq.Value.PeripheralDeviceType;
|
|
|
|
|
|
|
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs:
* DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
* DiscImageChef.Metadata/DeviceReport.cs:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DeviceReport.cs:
* DiscImageChef.Metadata/DiscImageChef.Metadata.csproj:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DumpMedia.cs:
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Core/Checksum.cs:
* DiscImageChef/Commands/CreateSidecar.cs:
Moved checksum generation to a separate class.
* CICMMetadata:
Added support for ADIP.
* DiscImageChef.CommonTypes/MediaType.cs:
Added parameters of UDO media.
Moved DataPlay outside of Iomega, as it's not from that
manufacturer.
Added missing Exatape media and corrected 160m XL one.
Added SyJet media.
Added all ECMA defined magneto-optical (sectors calculated
from specifications, unchecked).
Added PD media.
Added Imation 320Gb RDX.
Added generic USB flash drives.
* DiscImageChef.Decoders/SCSI/Enums.cs:
Make enumerations public.
* DiscImageChef.Decoders/SCSI/Inquiry.cs:
* DiscImageChef.Devices/Device/Constructor.cs:
Trim space padded strings on SCSI INQUIRY.
* DiscImageChef.Devices/Device/ScsiCommands/MMC.cs:
Added PREVENT ALLOW MEDIUM REMOVAL.
Added START STOP UNIT.
* DiscImageChef.Devices/Device/ScsiCommands/NEC.cs:
Rename NEC methods.
* DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs:
Corrected Pioneer transfer length calculation.
* DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs:
Renamed Plextor methods.
* DiscImageChef.Devices/Device/ScsiCommands/SPC.cs:
Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with
MMC same name but different command.
* DiscImageChef.Devices/DiscImageChef.Devices.csproj:
Set platform target to x86 (does it really matter?).
* DiscImageChef.Devices/Linux/Command.cs:
Reduced allocation for readlink() to current kernel
MAX_PATH.
* DiscImageChef.Devices/Linux/Enums.cs:
Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves
commands not working on 32-bit environments.
* DiscImageChef.DiscImages/ZZZRawImage.cs:
Changed ECMA-184 and ECMA-183 enums.
* DiscImageChef.Metadata/Dimensions.cs:
Added all ECMA defined magneto-opticals.
Added PD media.
Added 320Gb RDX.
Corrected Exatape 160m XL.
Added Exatape 22m and 28m.
* DiscImageChef.Metadata/MediaType.cs:
Added 356mm magneto-optical media.
Changed ECMA-184 and ECMA-183 enums.
Added USB generic flash drive.
* DiscImageChef/Commands/DeviceInfo.cs:
Corrected SCSI INQUIRY naming.
Corrected SCSI MODE SENSE (6) parameters.
Reduced SCSI MODE SENSE timeout, some devices just get stuck
with unsupported MODE SENSE commanda and must be left to
timeout.
Changed FUJITSU vendor string comparison.
* DiscImageChef/Commands/MediaInfo.cs:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
Changed some error WriteLine() to debug ones. Too much
verbosity.
Added DVD media type decoding from PFI.
Found a drive that dumps ADIP, enabling it again (not
decoded).
* DiscImageChef/Commands/MediaScan.cs:
Added option to generate ImgBurn compatible log to
media-scan command.
* DiscImageChef/DiscImageChef.csproj:
Moved checksum generation to a separate class.
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Main.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Options.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
Added option to generate ImgBurn compatible log to media-scan
command.
2016-01-31 08:05:56 +00:00
|
|
|
|
sense = dev.ModeSense10(out modeBuf, out senseBuf, false, true, ScsiModeSensePageControl.Current, 0x3F, 0xFF, 5, out duration);
|
2015-10-31 21:32:10 +00:00
|
|
|
|
if (sense || dev.Error)
|
2015-10-31 21:03:18 +00:00
|
|
|
|
{
|
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs:
* DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
* DiscImageChef.Metadata/DeviceReport.cs:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DeviceReport.cs:
* DiscImageChef.Metadata/DiscImageChef.Metadata.csproj:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DumpMedia.cs:
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Core/Checksum.cs:
* DiscImageChef/Commands/CreateSidecar.cs:
Moved checksum generation to a separate class.
* CICMMetadata:
Added support for ADIP.
* DiscImageChef.CommonTypes/MediaType.cs:
Added parameters of UDO media.
Moved DataPlay outside of Iomega, as it's not from that
manufacturer.
Added missing Exatape media and corrected 160m XL one.
Added SyJet media.
Added all ECMA defined magneto-optical (sectors calculated
from specifications, unchecked).
Added PD media.
Added Imation 320Gb RDX.
Added generic USB flash drives.
* DiscImageChef.Decoders/SCSI/Enums.cs:
Make enumerations public.
* DiscImageChef.Decoders/SCSI/Inquiry.cs:
* DiscImageChef.Devices/Device/Constructor.cs:
Trim space padded strings on SCSI INQUIRY.
* DiscImageChef.Devices/Device/ScsiCommands/MMC.cs:
Added PREVENT ALLOW MEDIUM REMOVAL.
Added START STOP UNIT.
* DiscImageChef.Devices/Device/ScsiCommands/NEC.cs:
Rename NEC methods.
* DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs:
Corrected Pioneer transfer length calculation.
* DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs:
Renamed Plextor methods.
* DiscImageChef.Devices/Device/ScsiCommands/SPC.cs:
Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with
MMC same name but different command.
* DiscImageChef.Devices/DiscImageChef.Devices.csproj:
Set platform target to x86 (does it really matter?).
* DiscImageChef.Devices/Linux/Command.cs:
Reduced allocation for readlink() to current kernel
MAX_PATH.
* DiscImageChef.Devices/Linux/Enums.cs:
Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves
commands not working on 32-bit environments.
* DiscImageChef.DiscImages/ZZZRawImage.cs:
Changed ECMA-184 and ECMA-183 enums.
* DiscImageChef.Metadata/Dimensions.cs:
Added all ECMA defined magneto-opticals.
Added PD media.
Added 320Gb RDX.
Corrected Exatape 160m XL.
Added Exatape 22m and 28m.
* DiscImageChef.Metadata/MediaType.cs:
Added 356mm magneto-optical media.
Changed ECMA-184 and ECMA-183 enums.
Added USB generic flash drive.
* DiscImageChef/Commands/DeviceInfo.cs:
Corrected SCSI INQUIRY naming.
Corrected SCSI MODE SENSE (6) parameters.
Reduced SCSI MODE SENSE timeout, some devices just get stuck
with unsupported MODE SENSE commanda and must be left to
timeout.
Changed FUJITSU vendor string comparison.
* DiscImageChef/Commands/MediaInfo.cs:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
Changed some error WriteLine() to debug ones. Too much
verbosity.
Added DVD media type decoding from PFI.
Found a drive that dumps ADIP, enabling it again (not
decoded).
* DiscImageChef/Commands/MediaScan.cs:
Added option to generate ImgBurn compatible log to
media-scan command.
* DiscImageChef/DiscImageChef.csproj:
Moved checksum generation to a separate class.
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Main.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Options.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
Added option to generate ImgBurn compatible log to media-scan
command.
2016-01-31 08:05:56 +00:00
|
|
|
|
sense = dev.ModeSense10(out modeBuf, out senseBuf, false, true, ScsiModeSensePageControl.Current, 0x3F, 0x00, 5, out duration);
|
2015-10-31 21:03:18 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2015-10-31 21:32:10 +00:00
|
|
|
|
if (!sense && !dev.Error)
|
2015-10-31 21:03:18 +00:00
|
|
|
|
{
|
|
|
|
|
|
decMode = Decoders.SCSI.Modes.DecodeMode10(modeBuf, devType);
|
|
|
|
|
|
}
|
2015-10-31 21:32:10 +00:00
|
|
|
|
|
|
|
|
|
|
if(sense || dev.Error || !decMode.HasValue)
|
2015-10-31 21:03:18 +00:00
|
|
|
|
{
|
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs:
* DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
* DiscImageChef.Metadata/DeviceReport.cs:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DeviceReport.cs:
* DiscImageChef.Metadata/DiscImageChef.Metadata.csproj:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DumpMedia.cs:
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Core/Checksum.cs:
* DiscImageChef/Commands/CreateSidecar.cs:
Moved checksum generation to a separate class.
* CICMMetadata:
Added support for ADIP.
* DiscImageChef.CommonTypes/MediaType.cs:
Added parameters of UDO media.
Moved DataPlay outside of Iomega, as it's not from that
manufacturer.
Added missing Exatape media and corrected 160m XL one.
Added SyJet media.
Added all ECMA defined magneto-optical (sectors calculated
from specifications, unchecked).
Added PD media.
Added Imation 320Gb RDX.
Added generic USB flash drives.
* DiscImageChef.Decoders/SCSI/Enums.cs:
Make enumerations public.
* DiscImageChef.Decoders/SCSI/Inquiry.cs:
* DiscImageChef.Devices/Device/Constructor.cs:
Trim space padded strings on SCSI INQUIRY.
* DiscImageChef.Devices/Device/ScsiCommands/MMC.cs:
Added PREVENT ALLOW MEDIUM REMOVAL.
Added START STOP UNIT.
* DiscImageChef.Devices/Device/ScsiCommands/NEC.cs:
Rename NEC methods.
* DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs:
Corrected Pioneer transfer length calculation.
* DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs:
Renamed Plextor methods.
* DiscImageChef.Devices/Device/ScsiCommands/SPC.cs:
Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with
MMC same name but different command.
* DiscImageChef.Devices/DiscImageChef.Devices.csproj:
Set platform target to x86 (does it really matter?).
* DiscImageChef.Devices/Linux/Command.cs:
Reduced allocation for readlink() to current kernel
MAX_PATH.
* DiscImageChef.Devices/Linux/Enums.cs:
Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves
commands not working on 32-bit environments.
* DiscImageChef.DiscImages/ZZZRawImage.cs:
Changed ECMA-184 and ECMA-183 enums.
* DiscImageChef.Metadata/Dimensions.cs:
Added all ECMA defined magneto-opticals.
Added PD media.
Added 320Gb RDX.
Corrected Exatape 160m XL.
Added Exatape 22m and 28m.
* DiscImageChef.Metadata/MediaType.cs:
Added 356mm magneto-optical media.
Changed ECMA-184 and ECMA-183 enums.
Added USB generic flash drive.
* DiscImageChef/Commands/DeviceInfo.cs:
Corrected SCSI INQUIRY naming.
Corrected SCSI MODE SENSE (6) parameters.
Reduced SCSI MODE SENSE timeout, some devices just get stuck
with unsupported MODE SENSE commanda and must be left to
timeout.
Changed FUJITSU vendor string comparison.
* DiscImageChef/Commands/MediaInfo.cs:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
Changed some error WriteLine() to debug ones. Too much
verbosity.
Added DVD media type decoding from PFI.
Found a drive that dumps ADIP, enabling it again (not
decoded).
* DiscImageChef/Commands/MediaScan.cs:
Added option to generate ImgBurn compatible log to
media-scan command.
* DiscImageChef/DiscImageChef.csproj:
Moved checksum generation to a separate class.
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Main.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Options.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
Added option to generate ImgBurn compatible log to media-scan
command.
2016-01-31 08:05:56 +00:00
|
|
|
|
sense = dev.ModeSense6(out modeBuf, out senseBuf, false, ScsiModeSensePageControl.Current, 0x3F, 0xFF, 5, out duration);
|
2015-10-31 21:32:10 +00:00
|
|
|
|
if (sense || dev.Error)
|
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs:
* DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
* DiscImageChef.Metadata/DeviceReport.cs:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DeviceReport.cs:
* DiscImageChef.Metadata/DiscImageChef.Metadata.csproj:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DumpMedia.cs:
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Core/Checksum.cs:
* DiscImageChef/Commands/CreateSidecar.cs:
Moved checksum generation to a separate class.
* CICMMetadata:
Added support for ADIP.
* DiscImageChef.CommonTypes/MediaType.cs:
Added parameters of UDO media.
Moved DataPlay outside of Iomega, as it's not from that
manufacturer.
Added missing Exatape media and corrected 160m XL one.
Added SyJet media.
Added all ECMA defined magneto-optical (sectors calculated
from specifications, unchecked).
Added PD media.
Added Imation 320Gb RDX.
Added generic USB flash drives.
* DiscImageChef.Decoders/SCSI/Enums.cs:
Make enumerations public.
* DiscImageChef.Decoders/SCSI/Inquiry.cs:
* DiscImageChef.Devices/Device/Constructor.cs:
Trim space padded strings on SCSI INQUIRY.
* DiscImageChef.Devices/Device/ScsiCommands/MMC.cs:
Added PREVENT ALLOW MEDIUM REMOVAL.
Added START STOP UNIT.
* DiscImageChef.Devices/Device/ScsiCommands/NEC.cs:
Rename NEC methods.
* DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs:
Corrected Pioneer transfer length calculation.
* DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs:
Renamed Plextor methods.
* DiscImageChef.Devices/Device/ScsiCommands/SPC.cs:
Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with
MMC same name but different command.
* DiscImageChef.Devices/DiscImageChef.Devices.csproj:
Set platform target to x86 (does it really matter?).
* DiscImageChef.Devices/Linux/Command.cs:
Reduced allocation for readlink() to current kernel
MAX_PATH.
* DiscImageChef.Devices/Linux/Enums.cs:
Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves
commands not working on 32-bit environments.
* DiscImageChef.DiscImages/ZZZRawImage.cs:
Changed ECMA-184 and ECMA-183 enums.
* DiscImageChef.Metadata/Dimensions.cs:
Added all ECMA defined magneto-opticals.
Added PD media.
Added 320Gb RDX.
Corrected Exatape 160m XL.
Added Exatape 22m and 28m.
* DiscImageChef.Metadata/MediaType.cs:
Added 356mm magneto-optical media.
Changed ECMA-184 and ECMA-183 enums.
Added USB generic flash drive.
* DiscImageChef/Commands/DeviceInfo.cs:
Corrected SCSI INQUIRY naming.
Corrected SCSI MODE SENSE (6) parameters.
Reduced SCSI MODE SENSE timeout, some devices just get stuck
with unsupported MODE SENSE commanda and must be left to
timeout.
Changed FUJITSU vendor string comparison.
* DiscImageChef/Commands/MediaInfo.cs:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
Changed some error WriteLine() to debug ones. Too much
verbosity.
Added DVD media type decoding from PFI.
Found a drive that dumps ADIP, enabling it again (not
decoded).
* DiscImageChef/Commands/MediaScan.cs:
Added option to generate ImgBurn compatible log to
media-scan command.
* DiscImageChef/DiscImageChef.csproj:
Moved checksum generation to a separate class.
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Main.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Options.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
Added option to generate ImgBurn compatible log to media-scan
command.
2016-01-31 08:05:56 +00:00
|
|
|
|
sense = dev.ModeSense6(out modeBuf, out senseBuf, false, ScsiModeSensePageControl.Current, 0x3F, 0x00, 5, out duration);
|
2015-10-31 21:32:10 +00:00
|
|
|
|
if (sense || dev.Error)
|
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs:
* DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
* DiscImageChef.Metadata/DeviceReport.cs:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DeviceReport.cs:
* DiscImageChef.Metadata/DiscImageChef.Metadata.csproj:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DumpMedia.cs:
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Core/Checksum.cs:
* DiscImageChef/Commands/CreateSidecar.cs:
Moved checksum generation to a separate class.
* CICMMetadata:
Added support for ADIP.
* DiscImageChef.CommonTypes/MediaType.cs:
Added parameters of UDO media.
Moved DataPlay outside of Iomega, as it's not from that
manufacturer.
Added missing Exatape media and corrected 160m XL one.
Added SyJet media.
Added all ECMA defined magneto-optical (sectors calculated
from specifications, unchecked).
Added PD media.
Added Imation 320Gb RDX.
Added generic USB flash drives.
* DiscImageChef.Decoders/SCSI/Enums.cs:
Make enumerations public.
* DiscImageChef.Decoders/SCSI/Inquiry.cs:
* DiscImageChef.Devices/Device/Constructor.cs:
Trim space padded strings on SCSI INQUIRY.
* DiscImageChef.Devices/Device/ScsiCommands/MMC.cs:
Added PREVENT ALLOW MEDIUM REMOVAL.
Added START STOP UNIT.
* DiscImageChef.Devices/Device/ScsiCommands/NEC.cs:
Rename NEC methods.
* DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs:
Corrected Pioneer transfer length calculation.
* DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs:
Renamed Plextor methods.
* DiscImageChef.Devices/Device/ScsiCommands/SPC.cs:
Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with
MMC same name but different command.
* DiscImageChef.Devices/DiscImageChef.Devices.csproj:
Set platform target to x86 (does it really matter?).
* DiscImageChef.Devices/Linux/Command.cs:
Reduced allocation for readlink() to current kernel
MAX_PATH.
* DiscImageChef.Devices/Linux/Enums.cs:
Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves
commands not working on 32-bit environments.
* DiscImageChef.DiscImages/ZZZRawImage.cs:
Changed ECMA-184 and ECMA-183 enums.
* DiscImageChef.Metadata/Dimensions.cs:
Added all ECMA defined magneto-opticals.
Added PD media.
Added 320Gb RDX.
Corrected Exatape 160m XL.
Added Exatape 22m and 28m.
* DiscImageChef.Metadata/MediaType.cs:
Added 356mm magneto-optical media.
Changed ECMA-184 and ECMA-183 enums.
Added USB generic flash drive.
* DiscImageChef/Commands/DeviceInfo.cs:
Corrected SCSI INQUIRY naming.
Corrected SCSI MODE SENSE (6) parameters.
Reduced SCSI MODE SENSE timeout, some devices just get stuck
with unsupported MODE SENSE commanda and must be left to
timeout.
Changed FUJITSU vendor string comparison.
* DiscImageChef/Commands/MediaInfo.cs:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
Changed some error WriteLine() to debug ones. Too much
verbosity.
Added DVD media type decoding from PFI.
Found a drive that dumps ADIP, enabling it again (not
decoded).
* DiscImageChef/Commands/MediaScan.cs:
Added option to generate ImgBurn compatible log to
media-scan command.
* DiscImageChef/DiscImageChef.csproj:
Moved checksum generation to a separate class.
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Main.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Options.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
Added option to generate ImgBurn compatible log to media-scan
command.
2016-01-31 08:05:56 +00:00
|
|
|
|
sense = dev.ModeSense(out modeBuf, out senseBuf, 5, out duration);
|
2015-10-31 21:03:18 +00:00
|
|
|
|
|
2015-10-31 21:32:10 +00:00
|
|
|
|
if (!sense && !dev.Error)
|
2015-10-31 21:03:18 +00:00
|
|
|
|
decMode = Decoders.SCSI.Modes.DecodeMode6(modeBuf, devType);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2015-11-05 06:50:02 +00:00
|
|
|
|
if (!sense)
|
2016-01-14 21:10:39 +00:00
|
|
|
|
doWriteFile(options.OutputPrefix, "_scsi_modesense.bin", "SCSI MODE SENSE", modeBuf);
|
2015-11-02 21:08:38 +00:00
|
|
|
|
|
2015-11-05 06:50:02 +00:00
|
|
|
|
if (decMode.HasValue)
|
|
|
|
|
|
{
|
2015-10-31 21:03:18 +00:00
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModeHeader(decMode.Value.Header, devType));
|
|
|
|
|
|
|
|
|
|
|
|
if (decMode.Value.Pages != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (Decoders.SCSI.Modes.ModePage page in decMode.Value.Pages)
|
|
|
|
|
|
{
|
|
|
|
|
|
//DicConsole.WriteLine("Page {0:X2}h subpage {1:X2}h is {2} bytes long", page.Page, page.Subpage, page.PageResponse.Length);
|
|
|
|
|
|
switch (page.Page)
|
|
|
|
|
|
{
|
|
|
|
|
|
case 0x00:
|
|
|
|
|
|
{
|
|
|
|
|
|
if (devType == DiscImageChef.Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice && page.Subpage == 0)
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModePage_00_SFF(page.PageResponse));
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
if (page.Subpage != 0)
|
|
|
|
|
|
DicConsole.WriteLine("Found unknown vendor mode page {0:X2}h subpage {1:X2}h", page.Page, page.Subpage);
|
|
|
|
|
|
else
|
|
|
|
|
|
DicConsole.WriteLine("Found unknown vendor mode page {0:X2}h", page.Page);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
case 0x01:
|
|
|
|
|
|
{
|
|
|
|
|
|
if (page.Subpage == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (devType == DiscImageChef.Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModePage_01_MMC(page.PageResponse));
|
|
|
|
|
|
else
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModePage_01(page.PageResponse));
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
goto default;
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
case 0x02:
|
|
|
|
|
|
{
|
|
|
|
|
|
if (page.Subpage == 0)
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModePage_02(page.PageResponse));
|
|
|
|
|
|
else
|
|
|
|
|
|
goto default;
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
case 0x03:
|
|
|
|
|
|
{
|
|
|
|
|
|
if (page.Subpage == 0)
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModePage_03(page.PageResponse));
|
|
|
|
|
|
else
|
|
|
|
|
|
goto default;
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
case 0x04:
|
|
|
|
|
|
{
|
|
|
|
|
|
if (page.Subpage == 0)
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModePage_04(page.PageResponse));
|
|
|
|
|
|
else
|
|
|
|
|
|
goto default;
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
case 0x05:
|
|
|
|
|
|
{
|
|
|
|
|
|
if (page.Subpage == 0)
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModePage_05(page.PageResponse));
|
|
|
|
|
|
else
|
|
|
|
|
|
goto default;
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
case 0x06:
|
|
|
|
|
|
{
|
|
|
|
|
|
if (page.Subpage == 0)
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModePage_06(page.PageResponse));
|
|
|
|
|
|
else
|
|
|
|
|
|
goto default;
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
case 0x07:
|
|
|
|
|
|
{
|
|
|
|
|
|
if (page.Subpage == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (devType == DiscImageChef.Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModePage_07_MMC(page.PageResponse));
|
|
|
|
|
|
else
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModePage_07(page.PageResponse));
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
goto default;
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
case 0x08:
|
|
|
|
|
|
{
|
|
|
|
|
|
if (page.Subpage == 0)
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModePage_08(page.PageResponse));
|
|
|
|
|
|
else
|
|
|
|
|
|
goto default;
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
case 0x0A:
|
|
|
|
|
|
{
|
|
|
|
|
|
if (page.Subpage == 0)
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModePage_0A(page.PageResponse));
|
|
|
|
|
|
else if (page.Subpage == 1)
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModePage_0A_S01(page.PageResponse));
|
|
|
|
|
|
else
|
|
|
|
|
|
goto default;
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
case 0x0B:
|
|
|
|
|
|
{
|
|
|
|
|
|
if (page.Subpage == 0)
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModePage_0B(page.PageResponse));
|
|
|
|
|
|
else
|
|
|
|
|
|
goto default;
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
case 0x0D:
|
|
|
|
|
|
{
|
|
|
|
|
|
if (page.Subpage == 0)
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModePage_0D(page.PageResponse));
|
|
|
|
|
|
else
|
|
|
|
|
|
goto default;
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
case 0x0E:
|
|
|
|
|
|
{
|
|
|
|
|
|
if (page.Subpage == 0)
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModePage_0E(page.PageResponse));
|
|
|
|
|
|
else
|
|
|
|
|
|
goto default;
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
case 0x0F:
|
|
|
|
|
|
{
|
|
|
|
|
|
if (page.Subpage == 0)
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModePage_0F(page.PageResponse));
|
|
|
|
|
|
else
|
|
|
|
|
|
goto default;
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
case 0x10:
|
|
|
|
|
|
{
|
|
|
|
|
|
if (page.Subpage == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (devType == DiscImageChef.Decoders.SCSI.PeripheralDeviceTypes.SequentialAccess)
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModePage_10_SSC(page.PageResponse));
|
|
|
|
|
|
else
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModePage_10(page.PageResponse));
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
goto default;
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
case 0x1A:
|
|
|
|
|
|
{
|
|
|
|
|
|
if (page.Subpage == 0)
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModePage_1A(page.PageResponse));
|
|
|
|
|
|
else if (page.Subpage == 1)
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModePage_1A_S01(page.PageResponse));
|
|
|
|
|
|
else
|
|
|
|
|
|
goto default;
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
case 0x1B:
|
|
|
|
|
|
{
|
|
|
|
|
|
if (page.Subpage == 0)
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModePage_1B(page.PageResponse));
|
|
|
|
|
|
else
|
|
|
|
|
|
goto default;
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
case 0x1C:
|
|
|
|
|
|
{
|
|
|
|
|
|
if (page.Subpage == 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (devType == DiscImageChef.Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModePage_1C_SFF(page.PageResponse));
|
|
|
|
|
|
else
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModePage_1C(page.PageResponse));
|
|
|
|
|
|
}
|
|
|
|
|
|
else if (page.Subpage == 1)
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModePage_1C_S01(page.PageResponse));
|
|
|
|
|
|
else
|
|
|
|
|
|
goto default;
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
case 0x2A:
|
|
|
|
|
|
{
|
|
|
|
|
|
if (page.Subpage == 0)
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModePage_2A(page.PageResponse));
|
|
|
|
|
|
else
|
|
|
|
|
|
goto default;
|
|
|
|
|
|
|
2016-01-15 22:42:33 +00:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
case 0x3E:
|
|
|
|
|
|
{
|
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs:
* DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
* DiscImageChef.Metadata/DeviceReport.cs:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DeviceReport.cs:
* DiscImageChef.Metadata/DiscImageChef.Metadata.csproj:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DumpMedia.cs:
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Core/Checksum.cs:
* DiscImageChef/Commands/CreateSidecar.cs:
Moved checksum generation to a separate class.
* CICMMetadata:
Added support for ADIP.
* DiscImageChef.CommonTypes/MediaType.cs:
Added parameters of UDO media.
Moved DataPlay outside of Iomega, as it's not from that
manufacturer.
Added missing Exatape media and corrected 160m XL one.
Added SyJet media.
Added all ECMA defined magneto-optical (sectors calculated
from specifications, unchecked).
Added PD media.
Added Imation 320Gb RDX.
Added generic USB flash drives.
* DiscImageChef.Decoders/SCSI/Enums.cs:
Make enumerations public.
* DiscImageChef.Decoders/SCSI/Inquiry.cs:
* DiscImageChef.Devices/Device/Constructor.cs:
Trim space padded strings on SCSI INQUIRY.
* DiscImageChef.Devices/Device/ScsiCommands/MMC.cs:
Added PREVENT ALLOW MEDIUM REMOVAL.
Added START STOP UNIT.
* DiscImageChef.Devices/Device/ScsiCommands/NEC.cs:
Rename NEC methods.
* DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs:
Corrected Pioneer transfer length calculation.
* DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs:
Renamed Plextor methods.
* DiscImageChef.Devices/Device/ScsiCommands/SPC.cs:
Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with
MMC same name but different command.
* DiscImageChef.Devices/DiscImageChef.Devices.csproj:
Set platform target to x86 (does it really matter?).
* DiscImageChef.Devices/Linux/Command.cs:
Reduced allocation for readlink() to current kernel
MAX_PATH.
* DiscImageChef.Devices/Linux/Enums.cs:
Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves
commands not working on 32-bit environments.
* DiscImageChef.DiscImages/ZZZRawImage.cs:
Changed ECMA-184 and ECMA-183 enums.
* DiscImageChef.Metadata/Dimensions.cs:
Added all ECMA defined magneto-opticals.
Added PD media.
Added 320Gb RDX.
Corrected Exatape 160m XL.
Added Exatape 22m and 28m.
* DiscImageChef.Metadata/MediaType.cs:
Added 356mm magneto-optical media.
Changed ECMA-184 and ECMA-183 enums.
Added USB generic flash drive.
* DiscImageChef/Commands/DeviceInfo.cs:
Corrected SCSI INQUIRY naming.
Corrected SCSI MODE SENSE (6) parameters.
Reduced SCSI MODE SENSE timeout, some devices just get stuck
with unsupported MODE SENSE commanda and must be left to
timeout.
Changed FUJITSU vendor string comparison.
* DiscImageChef/Commands/MediaInfo.cs:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
Changed some error WriteLine() to debug ones. Too much
verbosity.
Added DVD media type decoding from PFI.
Found a drive that dumps ADIP, enabling it again (not
decoded).
* DiscImageChef/Commands/MediaScan.cs:
Added option to generate ImgBurn compatible log to
media-scan command.
* DiscImageChef/DiscImageChef.csproj:
Moved checksum generation to a separate class.
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Main.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Options.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
Added option to generate ImgBurn compatible log to media-scan
command.
2016-01-31 08:05:56 +00:00
|
|
|
|
if (StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "FUJITSU")
|
2016-01-15 22:42:33 +00:00
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyFujitsuModePage_3E(page.PageResponse));
|
|
|
|
|
|
else
|
|
|
|
|
|
goto default;
|
|
|
|
|
|
|
2015-10-31 21:03:18 +00:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
default:
|
|
|
|
|
|
{
|
|
|
|
|
|
if (page.Subpage != 0)
|
|
|
|
|
|
DicConsole.WriteLine("Found unknown mode page {0:X2}h subpage {1:X2}h", page.Page, page.Subpage);
|
|
|
|
|
|
else
|
|
|
|
|
|
DicConsole.WriteLine("Found unknown mode page {0:X2}h", page.Page);
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2015-11-01 22:09:10 +00:00
|
|
|
|
if (devType == DiscImageChef.Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
|
|
|
|
|
{
|
|
|
|
|
|
|
2015-11-02 19:12:19 +00:00
|
|
|
|
byte[] confBuf;
|
|
|
|
|
|
sense = dev.GetConfiguration(out confBuf, out senseBuf, dev.Timeout, out duration);
|
2015-11-01 22:09:10 +00:00
|
|
|
|
|
2015-11-02 19:12:19 +00:00
|
|
|
|
if (!sense)
|
|
|
|
|
|
{
|
2016-01-14 21:10:39 +00:00
|
|
|
|
doWriteFile(options.OutputPrefix, "_mmc_getconfiguration.bin", "MMC GET CONFIGURATION", confBuf);
|
2015-11-02 21:08:38 +00:00
|
|
|
|
|
2015-11-02 19:12:19 +00:00
|
|
|
|
Decoders.SCSI.MMC.Features.SeparatedFeatures ftr = Decoders.SCSI.MMC.Features.Separate(confBuf);
|
2015-11-01 22:09:10 +00:00
|
|
|
|
|
2015-11-02 19:12:19 +00:00
|
|
|
|
DicConsole.DebugWriteLine("Device-Info command", "GET CONFIGURATION length is {0} bytes", ftr.DataLength);
|
|
|
|
|
|
DicConsole.DebugWriteLine("Device-Info command", "GET CONFIGURATION current profile is {0:X4}h", ftr.CurrentProfile);
|
|
|
|
|
|
if (ftr.Descriptors != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
DicConsole.WriteLine("SCSI MMC GET CONFIGURATION Features:");
|
|
|
|
|
|
foreach (Decoders.SCSI.MMC.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));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0001:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0001(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0002:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0002(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0003:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0003(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0004:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0004(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0010:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0010(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x001D:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_001D(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x001E:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_001E(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x001F:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_001F(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0020:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0020(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0021:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0021(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0022:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0022(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0023:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0023(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0024:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0024(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0025:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0025(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0026:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0026(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0027:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0027(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0028:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0028(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0029:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0029(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x002A:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002A(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x002B:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002B(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x002C:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002C(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x002D:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002D(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x002E:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002E(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x002F:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002F(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0030:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0030(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0031:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0031(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0032:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0032(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0033:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0033(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0035:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0035(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0037:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0037(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0038:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0038(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x003A:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_003A(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x003B:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_003B(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0040:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0040(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0041:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0041(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0042:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0042(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0050:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0050(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0051:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0051(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0080:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0080(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0100:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0100(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0101:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0101(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0102:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0102(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0103:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0103(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0104:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0104(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0105:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0105(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0106:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0106(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0107:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0107(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0108:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0108(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0109:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0109(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x010A:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_010A(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x010B:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_010B(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x010C:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_010C(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x010D:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_010D(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x010E:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_010E(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0110:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0110(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0113:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0113(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 0x0142:
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0142(desc.Data));
|
|
|
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
|
|
|
DicConsole.WriteLine("Found unknown feature code {0:X4}h", desc.Code);
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
DicConsole.DebugWriteLine("Device-Info command", "GET CONFIGURATION returned no feature descriptors");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: DVD drives respond correctly to BD status.
|
|
|
|
|
|
// While specification says if no medium is present
|
|
|
|
|
|
// it should inform all possible capabilities,
|
|
|
|
|
|
// testing drives show only supported media capabilities.
|
|
|
|
|
|
/*
|
|
|
|
|
|
byte[] strBuf;
|
|
|
|
|
|
sense = dev.ReadDiscStructure(out strBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0, MmcDiscStructureFormat.CapabilityList, 0, dev.Timeout, out duration);
|
2015-11-01 22:09:10 +00:00
|
|
|
|
|
2015-11-02 19:12:19 +00:00
|
|
|
|
if (!sense)
|
2015-11-01 22:09:10 +00:00
|
|
|
|
{
|
2015-11-02 19:12:19 +00:00
|
|
|
|
Decoders.SCSI.DiscStructureCapabilities.Capability[] caps = Decoders.SCSI.DiscStructureCapabilities.Decode(strBuf);
|
|
|
|
|
|
if (caps != null)
|
2015-11-01 22:09:10 +00:00
|
|
|
|
{
|
2015-11-02 19:12:19 +00:00
|
|
|
|
foreach (Decoders.SCSI.DiscStructureCapabilities.Capability cap in caps)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (cap.SDS && cap.RDS)
|
|
|
|
|
|
DicConsole.WriteLine("Drive can READ/SEND DISC STRUCTURE format {0:X2}h", cap.FormatCode);
|
|
|
|
|
|
else if (cap.SDS)
|
|
|
|
|
|
DicConsole.WriteLine("Drive can SEND DISC STRUCTURE format {0:X2}h", cap.FormatCode);
|
|
|
|
|
|
else if (cap.RDS)
|
|
|
|
|
|
DicConsole.WriteLine("Drive can READ DISC STRUCTURE format {0:X2}h", cap.FormatCode);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sense = dev.ReadDiscStructure(out strBuf, out senseBuf, MmcDiscStructureMediaType.BD, 0, 0, MmcDiscStructureFormat.CapabilityList, 0, dev.Timeout, out duration);
|
2015-11-01 22:09:10 +00:00
|
|
|
|
|
2015-11-02 19:12:19 +00:00
|
|
|
|
if (!sense)
|
|
|
|
|
|
{
|
|
|
|
|
|
Decoders.SCSI.DiscStructureCapabilities.Capability[] caps = Decoders.SCSI.DiscStructureCapabilities.Decode(strBuf);
|
|
|
|
|
|
if (caps != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
foreach (Decoders.SCSI.DiscStructureCapabilities.Capability cap in caps)
|
2015-11-01 22:09:10 +00:00
|
|
|
|
{
|
2015-11-02 19:12:19 +00:00
|
|
|
|
if (cap.SDS && cap.RDS)
|
|
|
|
|
|
DicConsole.WriteLine("Drive can READ/SEND DISC STRUCTURE format {0:X2}h", cap.FormatCode);
|
|
|
|
|
|
else if (cap.SDS)
|
|
|
|
|
|
DicConsole.WriteLine("Drive can SEND DISC STRUCTURE format {0:X2}h", cap.FormatCode);
|
|
|
|
|
|
else if (cap.RDS)
|
|
|
|
|
|
DicConsole.WriteLine("Drive can READ DISC STRUCTURE format {0:X2}h", cap.FormatCode);
|
2015-11-01 22:09:10 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2015-11-02 19:12:19 +00:00
|
|
|
|
*/
|
2015-11-01 22:09:10 +00:00
|
|
|
|
|
2016-01-14 21:10:39 +00:00
|
|
|
|
#region Plextor
|
|
|
|
|
|
if (dev.Manufacturer == "PLEXTOR")
|
2016-01-11 19:24:17 +00:00
|
|
|
|
{
|
2016-01-14 21:10:39 +00:00
|
|
|
|
bool plxtSense = true;
|
|
|
|
|
|
bool plxtDvd = false;
|
|
|
|
|
|
byte[] plxtBuf = null;
|
|
|
|
|
|
|
|
|
|
|
|
switch (dev.Model)
|
|
|
|
|
|
{
|
|
|
|
|
|
case "DVDR PX-708A":
|
|
|
|
|
|
case "DVDR PX-708A2":
|
|
|
|
|
|
case "DVDR PX-712A":
|
2016-01-11 19:24:17 +00:00
|
|
|
|
plxtDvd = true;
|
2016-01-14 21:10:39 +00:00
|
|
|
|
plxtSense = dev.PlextorReadEeprom(out plxtBuf, out senseBuf, dev.Timeout, out duration);
|
2016-01-11 19:24:17 +00:00
|
|
|
|
break;
|
2016-01-14 21:10:39 +00:00
|
|
|
|
case "DVDR PX-714A":
|
|
|
|
|
|
case "DVDR PX-716A":
|
|
|
|
|
|
case "DVDR PX-716AL":
|
|
|
|
|
|
case "DVDR PX-755A":
|
|
|
|
|
|
case "DVDR PX-760A":
|
2016-01-11 19:24:17 +00:00
|
|
|
|
{
|
2016-01-14 21:10:39 +00:00
|
|
|
|
byte[] plxtBufSmall;
|
|
|
|
|
|
plxtBuf = new byte[256 * 4];
|
|
|
|
|
|
for (byte i = 0; i < 4; i++)
|
|
|
|
|
|
{
|
|
|
|
|
|
plxtSense = dev.PlextorReadEepromBlock(out plxtBufSmall, out senseBuf, i, 256, dev.Timeout, out duration);
|
|
|
|
|
|
if (plxtSense)
|
|
|
|
|
|
break;
|
|
|
|
|
|
Array.Copy(plxtBufSmall, 0, plxtBuf, i * 256, 256);
|
|
|
|
|
|
}
|
|
|
|
|
|
plxtDvd = true;
|
|
|
|
|
|
break;
|
2016-01-11 19:24:17 +00:00
|
|
|
|
}
|
2016-01-14 21:10:39 +00:00
|
|
|
|
default:
|
|
|
|
|
|
{
|
|
|
|
|
|
if (dev.Model.StartsWith("CD-R "))
|
|
|
|
|
|
{
|
|
|
|
|
|
plxtSense = dev.PlextorReadEepromCDR(out plxtBuf, out senseBuf, dev.Timeout, out duration);
|
|
|
|
|
|
}
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!plxtSense)
|
|
|
|
|
|
{
|
|
|
|
|
|
doWriteFile(options.OutputPrefix, "_plextor_eeprom.bin", "PLEXTOR READ EEPROM", plxtBuf);
|
|
|
|
|
|
|
|
|
|
|
|
ushort discs;
|
|
|
|
|
|
uint cdReadTime, cdWriteTime, dvdReadTime = 0, dvdWriteTime = 0;
|
|
|
|
|
|
|
|
|
|
|
|
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
|
|
|
|
|
|
if (plxtDvd)
|
|
|
|
|
|
{
|
|
|
|
|
|
discs = BigEndianBitConverter.ToUInt16(plxtBuf, 0x0120);
|
|
|
|
|
|
cdReadTime = BigEndianBitConverter.ToUInt32(plxtBuf, 0x0122);
|
|
|
|
|
|
cdWriteTime = BigEndianBitConverter.ToUInt32(plxtBuf, 0x0126);
|
|
|
|
|
|
dvdReadTime = BigEndianBitConverter.ToUInt32(plxtBuf, 0x012A);
|
|
|
|
|
|
dvdWriteTime = BigEndianBitConverter.ToUInt32(plxtBuf, 0x012E);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
discs = BigEndianBitConverter.ToUInt16(plxtBuf, 0x0078);
|
|
|
|
|
|
cdReadTime = BigEndianBitConverter.ToUInt32(plxtBuf, 0x006C);
|
|
|
|
|
|
cdWriteTime = BigEndianBitConverter.ToUInt32(plxtBuf, 0x007A);
|
2016-01-11 19:24:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2016-01-14 21:10:39 +00:00
|
|
|
|
DicConsole.WriteLine("Drive has loaded a total of {0} discs", discs);
|
|
|
|
|
|
DicConsole.WriteLine("Drive has spent {0} hours, {1} minutes and {2} seconds reading CDs",
|
|
|
|
|
|
cdReadTime / 3600, (cdReadTime / 60) % 60, cdReadTime % 60);
|
|
|
|
|
|
DicConsole.WriteLine("Drive has spent {0} hours, {1} minutes and {2} seconds writing CDs",
|
|
|
|
|
|
cdWriteTime / 3600, (cdWriteTime / 60) % 60, cdWriteTime % 60);
|
|
|
|
|
|
if (plxtDvd)
|
|
|
|
|
|
{
|
|
|
|
|
|
DicConsole.WriteLine("Drive has spent {0} hours, {1} minutes and {2} seconds reading DVDs",
|
|
|
|
|
|
dvdReadTime / 3600, (dvdReadTime / 60) % 60, dvdReadTime % 60);
|
|
|
|
|
|
DicConsole.WriteLine("Drive has spent {0} hours, {1} minutes and {2} seconds writing DVDs",
|
|
|
|
|
|
dvdWriteTime / 3600, (dvdWriteTime / 60) % 60, dvdWriteTime % 60);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool plxtPwrRecEnabled;
|
|
|
|
|
|
ushort plxtPwrRecSpeed;
|
|
|
|
|
|
plxtSense = dev.PlextorGetPoweRec(out senseBuf, out plxtPwrRecEnabled, out plxtPwrRecSpeed, dev.Timeout, out duration);
|
|
|
|
|
|
if (!plxtSense)
|
2016-01-11 19:24:17 +00:00
|
|
|
|
{
|
2016-01-14 21:10:39 +00:00
|
|
|
|
DicConsole.Write("Drive supports PoweRec");
|
|
|
|
|
|
if (plxtPwrRecEnabled)
|
2016-01-11 19:24:17 +00:00
|
|
|
|
{
|
2016-01-14 21:10:39 +00:00
|
|
|
|
DicConsole.Write(", has it enabled");
|
|
|
|
|
|
|
|
|
|
|
|
if (plxtPwrRecSpeed > 0)
|
|
|
|
|
|
DicConsole.WriteLine(" and recommends {0} Kb/sec.", plxtPwrRecSpeed);
|
|
|
|
|
|
else
|
|
|
|
|
|
DicConsole.WriteLine(".");
|
|
|
|
|
|
|
|
|
|
|
|
ushort plxtPwrRecSelected, plxtPwrRecMax, plxtPwrRecLast;
|
|
|
|
|
|
plxtSense = dev.PlextorGetSpeeds(out senseBuf, out plxtPwrRecSelected, out plxtPwrRecMax, out plxtPwrRecLast, dev.Timeout, out duration);
|
|
|
|
|
|
|
|
|
|
|
|
if (!plxtSense)
|
2016-01-11 19:24:17 +00:00
|
|
|
|
{
|
2016-01-14 21:10:39 +00:00
|
|
|
|
if (plxtPwrRecSelected > 0)
|
|
|
|
|
|
DicConsole.WriteLine("Selected PoweRec speed for currently inserted media is {0} Kb/sec ({1}x)", plxtPwrRecSelected, plxtPwrRecSelected / 177);
|
|
|
|
|
|
if (plxtPwrRecMax > 0)
|
|
|
|
|
|
DicConsole.WriteLine("Maximum PoweRec speed for currently inserted media is {0} Kb/sec ({1}x)", plxtPwrRecMax, plxtPwrRecMax / 177);
|
|
|
|
|
|
if (plxtPwrRecLast > 0)
|
|
|
|
|
|
DicConsole.WriteLine("Last used PoweRec was {0} Kb/sec ({1}x)", plxtPwrRecLast, plxtPwrRecLast / 177);
|
2016-01-11 19:24:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
2016-01-14 21:10:39 +00:00
|
|
|
|
DicConsole.WriteLine("PoweRec is disabled");
|
2016-01-11 19:24:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2016-01-14 21:10:39 +00:00
|
|
|
|
// TODO: Check it with a drive
|
|
|
|
|
|
plxtSense = dev.PlextorGetSilentMode(out plxtBuf, out senseBuf, dev.Timeout, out duration);
|
|
|
|
|
|
if (!plxtSense)
|
2016-01-11 19:24:17 +00:00
|
|
|
|
{
|
2016-01-14 21:10:39 +00:00
|
|
|
|
DicConsole.WriteLine("Drive supports Plextor SilentMode");
|
|
|
|
|
|
if (plxtBuf[0] == 1)
|
|
|
|
|
|
{
|
|
|
|
|
|
DicConsole.WriteLine("Plextor SilentMode is enabled:");
|
|
|
|
|
|
if (plxtBuf[1] == 2)
|
|
|
|
|
|
DicConsole.WriteLine("\tAccess time is slow");
|
|
|
|
|
|
else
|
|
|
|
|
|
DicConsole.WriteLine("\tAccess time is fast");
|
|
|
|
|
|
|
|
|
|
|
|
if (plxtBuf[2] > 0)
|
|
|
|
|
|
DicConsole.WriteLine("\tCD read speed limited to {0}x", plxtBuf[2]);
|
|
|
|
|
|
if (plxtBuf[3] > 0 && plxtDvd)
|
|
|
|
|
|
DicConsole.WriteLine("\tDVD read speed limited to {0}x", plxtBuf[3]);
|
|
|
|
|
|
if (plxtBuf[4] > 0)
|
|
|
|
|
|
DicConsole.WriteLine("\tCD write speed limited to {0}x", plxtBuf[4]);
|
|
|
|
|
|
if (plxtBuf[6] > 0)
|
|
|
|
|
|
DicConsole.WriteLine("\tTray eject speed limited to {0}", -(plxtBuf[6] + 48));
|
|
|
|
|
|
if (plxtBuf[7] > 0)
|
|
|
|
|
|
DicConsole.WriteLine("\tTray eject speed limited to {0}", plxtBuf[7] - 47);
|
|
|
|
|
|
}
|
2016-01-11 19:24:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2016-01-14 21:10:39 +00:00
|
|
|
|
plxtSense = dev.PlextorGetGigaRec(out plxtBuf, out senseBuf, dev.Timeout, out duration);
|
|
|
|
|
|
if (!plxtSense)
|
2016-01-11 19:24:17 +00:00
|
|
|
|
{
|
2016-01-14 21:10:39 +00:00
|
|
|
|
DicConsole.WriteLine("Drive supports Plextor GigaRec");
|
|
|
|
|
|
// TODO: Pretty print it
|
2016-01-11 19:24:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2016-01-14 21:10:39 +00:00
|
|
|
|
plxtSense = dev.PlextorGetSecuRec(out plxtBuf, out senseBuf, dev.Timeout, out duration);
|
|
|
|
|
|
if (!plxtSense)
|
2016-01-11 19:24:17 +00:00
|
|
|
|
{
|
2016-01-14 21:10:39 +00:00
|
|
|
|
DicConsole.WriteLine("Drive supports Plextor SecuRec");
|
|
|
|
|
|
// TODO: Pretty print it
|
2016-01-11 19:24:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2016-01-14 21:10:39 +00:00
|
|
|
|
plxtSense = dev.PlextorGetSpeedRead(out plxtBuf, out senseBuf, dev.Timeout, out duration);
|
|
|
|
|
|
if (!plxtSense)
|
2016-01-11 19:24:17 +00:00
|
|
|
|
{
|
2016-01-14 21:10:39 +00:00
|
|
|
|
DicConsole.Write("Drive supports Plextor SpeedRead");
|
|
|
|
|
|
if ((plxtBuf[2] & 0x01) == 0x01)
|
|
|
|
|
|
DicConsole.WriteLine("and has it enabled");
|
2016-01-11 19:24:17 +00:00
|
|
|
|
else
|
2016-01-14 21:10:39 +00:00
|
|
|
|
DicConsole.WriteLine();
|
2016-01-11 19:24:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2016-01-14 21:10:39 +00:00
|
|
|
|
plxtSense = dev.PlextorGetHiding(out plxtBuf, out senseBuf, dev.Timeout, out duration);
|
|
|
|
|
|
if (!plxtSense)
|
|
|
|
|
|
{
|
|
|
|
|
|
DicConsole.WriteLine("Drive supports hiding CD-Rs and forcing single session");
|
2016-01-11 19:24:17 +00:00
|
|
|
|
|
2016-01-14 21:10:39 +00:00
|
|
|
|
if ((plxtBuf[2] & 0x02) == 0x02)
|
|
|
|
|
|
DicConsole.WriteLine("Drive currently hides CD-Rs");
|
|
|
|
|
|
if ((plxtBuf[2] & 0x01) == 0x01)
|
|
|
|
|
|
DicConsole.WriteLine("Drive currently forces single session");
|
|
|
|
|
|
}
|
2016-01-11 19:24:17 +00:00
|
|
|
|
|
2016-01-14 21:10:39 +00:00
|
|
|
|
plxtSense = dev.PlextorGetVariRec(out plxtBuf, out senseBuf, false, dev.Timeout, out duration);
|
|
|
|
|
|
if (!plxtSense)
|
2016-01-11 19:24:17 +00:00
|
|
|
|
{
|
2016-01-14 21:10:39 +00:00
|
|
|
|
DicConsole.WriteLine("Drive supports Plextor VariRec");
|
2016-01-11 19:24:17 +00:00
|
|
|
|
// TODO: Pretty print it
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2016-01-14 21:10:39 +00:00
|
|
|
|
if (plxtDvd)
|
|
|
|
|
|
{
|
|
|
|
|
|
plxtSense = dev.PlextorGetVariRec(out plxtBuf, out senseBuf, true, dev.Timeout, out duration);
|
|
|
|
|
|
if (!plxtSense)
|
|
|
|
|
|
{
|
|
|
|
|
|
DicConsole.WriteLine("Drive supports Plextor VariRec for DVDs");
|
|
|
|
|
|
// TODO: Pretty print it
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
plxtSense = dev.PlextorGetBitsetting(out plxtBuf, out senseBuf, false, dev.Timeout, out duration);
|
|
|
|
|
|
if (!plxtSense)
|
|
|
|
|
|
DicConsole.WriteLine("Drive supports bitsetting DVD+R book type");
|
|
|
|
|
|
plxtSense = dev.PlextorGetBitsetting(out plxtBuf, out senseBuf, true, dev.Timeout, out duration);
|
|
|
|
|
|
if (!plxtSense)
|
|
|
|
|
|
DicConsole.WriteLine("Drive supports bitsetting DVD+R DL book type");
|
|
|
|
|
|
plxtSense = dev.PlextorGetTestWriteDvdPlus(out plxtBuf, out senseBuf, dev.Timeout, out duration);
|
|
|
|
|
|
if (!plxtSense)
|
|
|
|
|
|
DicConsole.WriteLine("Drive supports test writing DVD+");
|
|
|
|
|
|
}
|
2016-01-11 19:24:17 +00:00
|
|
|
|
}
|
2016-01-14 21:10:39 +00:00
|
|
|
|
#endregion Plextor
|
2016-01-11 19:24:17 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2016-01-15 07:00:43 +00:00
|
|
|
|
if (devType == DiscImageChef.Decoders.SCSI.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));
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
doWriteFile(options.OutputPrefix, "_ssc_readblocklimits.bin", "SSC READ BLOCK LIMITS", seqBuf);
|
|
|
|
|
|
DicConsole.WriteLine("Block limits for device:");
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.SSC.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));
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
doWriteFile(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)
|
|
|
|
|
|
{
|
|
|
|
|
|
DicConsole.WriteLine("Densities supported by device:");
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.SSC.DensitySupport.PrettifyDensity(dens));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
sense = dev.ReportDensitySupport(out seqBuf, out senseBuf, true, false, dev.Timeout, out duration);
|
|
|
|
|
|
if (sense)
|
|
|
|
|
|
DicConsole.ErrorWriteLine("REPORT DENSITY SUPPORT (MEDIUM):\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
doWriteFile(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)
|
|
|
|
|
|
{
|
|
|
|
|
|
DicConsole.WriteLine("Medium types supported by device:");
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.SSC.DensitySupport.PrettifyMediumType(meds));
|
|
|
|
|
|
}
|
|
|
|
|
|
DicConsole.WriteLine(Decoders.SCSI.SSC.DensitySupport.PrettifyMediumType(seqBuf));
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2015-10-19 05:11:28 +01:00
|
|
|
|
break;
|
2015-10-19 04:32:16 +01:00
|
|
|
|
}
|
2015-10-19 05:11:28 +01:00
|
|
|
|
default:
|
|
|
|
|
|
DicConsole.ErrorWriteLine("Unknown device type {0}, cannot get information.", dev.Type);
|
|
|
|
|
|
break;
|
2015-10-19 04:32:16 +01:00
|
|
|
|
}
|
* commandline:
* DiscImageChef.Settings/Settings.cs:
* DiscImageChef.Settings/docs/README.txt:
* DiscImageChef.Settings/packages.config:
* DiscImageChef.Settings/docs/LICENSE.txt:
* DiscImageChef.Settings/docs/ChangeLog.txt:
* DiscImageChef.Settings/docs/mono/index.xml:
* DiscImageChef.Settings/docs/html/index.html:
* DiscImageChef.Settings/Properties/AssemblyInfo.cs:
* DiscImageChef.Settings/DiscImageChef.Settings.csproj:
* DiscImageChef.Settings/docs/mono/ns-Claunia.PropertyList.xml:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/UID.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/UID.html:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSSet.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/index.html:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSSet.html:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSDate.xml:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSData.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSDate.html:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSData.html:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSArray.xml:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSNumber.xml:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSString.xml:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSObject.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSArray.html:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSNumber.html:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSString.html:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSObject.html:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/NSDictionary.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/NSDictionary.html:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/PropertyListParser.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/PropertyListParser.html:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/XmlPropertyListParser.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/XmlPropertyListParser.html:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/ASCIIPropertyListParser.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/ASCIIPropertyListParser.html:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/BinaryPropertyListParser.xml:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/BinaryPropertyListWriter.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/BinaryPropertyListWriter.html:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/BinaryPropertyListParser.html:
* DiscImageChef.Settings/docs/mono/Claunia.PropertyList/PropertyListFormatException.xml:
* DiscImageChef.Settings/docs/html/Claunia.PropertyList/PropertyListFormatException.html:
Added supports for settings
* DiscImageChef/Commands/Configure.cs:
Added support for settings.
* DiscImageChef/Core/Statistics.cs:
* DiscImageChef/Commands/Verify.cs:
* DiscImageChef/Commands/Entropy.cs:
* DiscImageChef/Commands/Formats.cs:
* DiscImageChef/Commands/PrintHex.cs:
* DiscImageChef/Commands/MediaInfo.cs:
* DiscImageChef/Commands/Statistics.cs:
Added statistics.
* DiscImageChef.Decoders/SCSI/Inquiry.cs:
Corrected bug on inquiry decoding.
* DiscImageChef.Decoders/SCSI/Modes.cs:
Corrected bug on decoding mode page 2Ah without write
performance descriptors.
Corrected bug when there is a vendor page 0 in mode sense
decoding.
* DiscImageChef.Devices/Device/Constructor.cs:
Corrected detecting USB or FireWire attached CD/DVD/BD and
tape drives.
Try ATA identify on USB or FireWire that don't have SCSI
INQUIRY.
* DiscImageChef.DiscImages/CDRWin.cs:
Corrected CD-ROM XA vs CD-ROM detection.
* DiscImageChef.Partitions/AppleMap.cs:
Corrected big endian working.
Added debug output.
* DiscImageChef.sln:
Added supports for settings.
* DiscImageChef/Commands/Decode.cs:
* DiscImageChef/Commands/Analyze.cs:
* DiscImageChef/Commands/Compare.cs:
* DiscImageChef/Commands/Checksum.cs:
* DiscImageChef/Commands/Benchmark.cs:
* DiscImageChef/Commands/DeviceInfo.cs:
* DiscImageChef/Commands/CreateSidecar.cs:
Added statistics.
* DiscImageChef/Commands/DeviceReport.cs:
Added statistics.
Correct handling empty inquiry string fields.
Suppose it is not removable, til proved wrong.
Corrected MODE SENSE (6/10) detection and calling order.
If device is MMC type but reports neither mode page 2Ah
neither GET CONFIGURATION, try all CDs (old drives work like
that).
Try reading Lead-In and Lead-Out in Audio CD using Audio READ
CD commands.
Corrected READ LONG information handling, some drives return
2s-complement in 32 bit. Upper 16 bits are ignored.
Added support for DVD raw block (37856 bytes).
Check READ LONG up to 36 times the cooked block size. That
should be enough to detect huge blocked media (like DVD and
BD) without taking ages.
If READ LONG size had to be bruteforced, and debug is
activated, save the result.
* DiscImageChef/Commands/DumpMedia.cs:
Added statistics.
Corrected READ LONG information handling, some drives return
2s-complement in 32 bit. Upper 16 bits are ignored.
Start trying with 64 blocks at a time. Some drives report to
be able to read 255 at a time, but they really don't, they
take a lot longer to read.
* DiscImageChef/Commands/MediaScan.cs:
Added statistics.
Start trying with 64 blocks at a time. Some drives report to
be able to read 255 at a time, but they really don't, they
take a lot longer to read.
* DiscImageChef/DiscImageChef.csproj:
Added support for settings.
Added statistics.
* DiscImageChef/Main.cs:
* DiscImageChef/Options.cs:
Added support for settings.
Added statistics.
2016-02-03 18:58:11 +00:00
|
|
|
|
|
|
|
|
|
|
Core.Statistics.AddCommand("device-info");
|
2015-10-13 01:45:07 +01:00
|
|
|
|
}
|
2016-01-14 21:10:39 +00:00
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2015-10-13 01:45:07 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|