2014-07-03 18:36:14 +01:00
|
|
|
|
/***************************************************************************
|
|
|
|
|
|
The Disc Image Chef
|
|
|
|
|
|
----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
Filename : Options.cs
|
|
|
|
|
|
Version : 1.0
|
|
|
|
|
|
Author(s) : Natalia Portillo
|
|
|
|
|
|
|
|
|
|
|
|
Component : Main program loop.
|
|
|
|
|
|
|
|
|
|
|
|
Revision : $Revision$
|
|
|
|
|
|
Last change by : $Author$
|
|
|
|
|
|
Date : $Date$
|
|
|
|
|
|
|
|
|
|
|
|
--[ Description ] ----------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
Defines verbs and options.
|
|
|
|
|
|
|
|
|
|
|
|
--[ 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-2014 Claunia.com
|
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
//$Id$
|
|
|
|
|
|
using CommandLine;
|
2014-06-16 00:41:47 +01:00
|
|
|
|
using CommandLine.Text;
|
|
|
|
|
|
|
|
|
|
|
|
namespace DiscImageChef
|
|
|
|
|
|
{
|
2014-06-16 01:45:04 +01:00
|
|
|
|
public abstract class CommonSubOptions
|
2014-06-16 00:41:47 +01:00
|
|
|
|
{
|
|
|
|
|
|
[Option('v', "verbose", DefaultValue = false, HelpText = "Shows verbose output")]
|
|
|
|
|
|
public bool Verbose { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option('d', "debug", DefaultValue = false, HelpText = "Shows debug output from plugins")]
|
|
|
|
|
|
public bool Debug { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2014-06-16 01:45:04 +01:00
|
|
|
|
public class AnalyzeSubOptions : CommonSubOptions
|
2014-06-16 00:41:47 +01:00
|
|
|
|
{
|
|
|
|
|
|
[Option('p', "partitions", DefaultValue = true,
|
|
|
|
|
|
HelpText = "Searches and interprets partitions.")]
|
|
|
|
|
|
public bool SearchForPartitions { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option('f', "filesystems", DefaultValue = true,
|
|
|
|
|
|
HelpText = "Searches and interprets partitions.")]
|
|
|
|
|
|
public bool SearchForFilesystems { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option('i', "input", Required = true, HelpText = "Disc image.")]
|
|
|
|
|
|
public string InputFile { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2014-06-16 01:45:04 +01:00
|
|
|
|
public class CompareSubOptions : CommonSubOptions
|
2014-06-16 00:41:47 +01:00
|
|
|
|
{
|
|
|
|
|
|
[Option("input1", Required = true, HelpText = "First disc image.")]
|
|
|
|
|
|
public string InputFile1 { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option("input2", Required = true, HelpText = "Second disc image.")]
|
|
|
|
|
|
public string InputFile2 { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2014-06-16 01:45:04 +01:00
|
|
|
|
public class ChecksumSubOptions : CommonSubOptions
|
2014-06-16 00:41:47 +01:00
|
|
|
|
{
|
|
|
|
|
|
[Option('t', "separated-tracks", DefaultValue = true,
|
|
|
|
|
|
HelpText = "Checksums each track separately.")]
|
|
|
|
|
|
public bool SeparatedTracks { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option('w', "whole-disc", DefaultValue = true,
|
|
|
|
|
|
HelpText = "Checksums the whole disc.")]
|
|
|
|
|
|
public bool WholeDisc { get; set; }
|
|
|
|
|
|
|
2015-04-19 01:07:12 +01:00
|
|
|
|
[Option('a', "adler32", DefaultValue = true,
|
|
|
|
|
|
HelpText = "Calculates Adler-32.")]
|
|
|
|
|
|
public bool DoAdler32 { get; set; }
|
|
|
|
|
|
|
2015-04-19 01:10:32 +01:00
|
|
|
|
[Option("crc16", DefaultValue = true,
|
|
|
|
|
|
HelpText = "Calculates CRC16.")]
|
|
|
|
|
|
public bool DoCRC16 { get; set; }
|
|
|
|
|
|
|
2014-06-16 00:41:47 +01:00
|
|
|
|
[Option('c', "crc32", DefaultValue = true,
|
|
|
|
|
|
HelpText = "Calculates CRC32.")]
|
|
|
|
|
|
public bool DoCRC32 { get; set; }
|
|
|
|
|
|
|
2014-07-03 18:36:14 +01:00
|
|
|
|
[Option("crc64", DefaultValue = false,
|
|
|
|
|
|
HelpText = "Calculates CRC64 (ECMA).")]
|
|
|
|
|
|
public bool DoCRC64 { get; set; }
|
|
|
|
|
|
|
2015-11-30 23:00:47 +00:00
|
|
|
|
/*[Option("fletcher16", DefaultValue = false,
|
2015-04-19 01:18:36 +01:00
|
|
|
|
HelpText = "Calculates Fletcher-16.")]
|
|
|
|
|
|
public bool DoFletcher16 { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option("fletcher32", DefaultValue = false,
|
|
|
|
|
|
HelpText = "Calculates Fletcher-32.")]
|
2015-11-30 23:00:47 +00:00
|
|
|
|
public bool DoFletcher32 { get; set; }*/
|
2015-04-19 01:18:36 +01:00
|
|
|
|
|
2014-06-16 00:41:47 +01:00
|
|
|
|
[Option('m', "md5", DefaultValue = true,
|
|
|
|
|
|
HelpText = "Calculates MD5.")]
|
|
|
|
|
|
public bool DoMD5 { get; set; }
|
|
|
|
|
|
|
2014-07-03 18:36:14 +01:00
|
|
|
|
[Option("ripemd160", DefaultValue = false,
|
|
|
|
|
|
HelpText = "Calculates RIPEMD160.")]
|
|
|
|
|
|
public bool DoRIPEMD160 { get; set; }
|
|
|
|
|
|
|
2014-06-16 00:41:47 +01:00
|
|
|
|
[Option('s', "sha1", DefaultValue = true,
|
|
|
|
|
|
HelpText = "Calculates SHA1.")]
|
|
|
|
|
|
public bool DoSHA1 { get; set; }
|
|
|
|
|
|
|
2014-07-03 18:36:14 +01:00
|
|
|
|
[Option("sha256", DefaultValue = false,
|
|
|
|
|
|
HelpText = "Calculates SHA256.")]
|
|
|
|
|
|
public bool DoSHA256 { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option("sha384", DefaultValue = false,
|
|
|
|
|
|
HelpText = "Calculates SHA384.")]
|
|
|
|
|
|
public bool DoSHA384 { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option("sha512", DefaultValue = false,
|
|
|
|
|
|
HelpText = "Calculates SHA512.")]
|
|
|
|
|
|
public bool DoSHA512 { get; set; }
|
2014-06-16 00:41:47 +01:00
|
|
|
|
|
2015-04-19 01:27:17 +01:00
|
|
|
|
[Option('f', "spamsum", DefaultValue = true,
|
|
|
|
|
|
HelpText = "Calculates SpamSum fuzzy hash.")]
|
|
|
|
|
|
public bool DoSpamSum { get; set; }
|
|
|
|
|
|
|
2014-06-16 00:41:47 +01:00
|
|
|
|
[Option('i', "input", Required = true, HelpText = "Disc image.")]
|
|
|
|
|
|
public string InputFile { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2015-05-19 06:04:21 +01:00
|
|
|
|
public class EntropySubOptions : CommonSubOptions
|
|
|
|
|
|
{
|
|
|
|
|
|
[Option('p', "duplicated-sectors", DefaultValue = true,
|
|
|
|
|
|
HelpText = "Calculates how many sectors are duplicated (have same exact data in user area).")]
|
|
|
|
|
|
public bool DuplicatedSectors { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option('t', "separated-tracks", DefaultValue = true,
|
|
|
|
|
|
HelpText = "Calculates entropy for each track separately.")]
|
|
|
|
|
|
public bool SeparatedTracks { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option('w', "whole-disc", DefaultValue = true,
|
|
|
|
|
|
HelpText = "Calculates entropy for the whole disc.")]
|
|
|
|
|
|
public bool WholeDisc { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option('i', "input", Required = true, HelpText = "Disc image.")]
|
|
|
|
|
|
public string InputFile { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2014-06-16 01:45:04 +01:00
|
|
|
|
public class VerifySubOptions : CommonSubOptions
|
2014-06-16 00:41:47 +01:00
|
|
|
|
{
|
|
|
|
|
|
[Option('w', "verify-disc", DefaultValue = true,
|
|
|
|
|
|
HelpText = "Verify disc image if supported.")]
|
|
|
|
|
|
public bool VerifyDisc { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option('s', "verify-sectors", DefaultValue = true,
|
|
|
|
|
|
HelpText = "Verify all sectors if supported.")]
|
|
|
|
|
|
public bool VerifySectors { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option('i', "input", Required = true, HelpText = "Disc image.")]
|
|
|
|
|
|
public string InputFile { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2014-08-28 19:27:16 +01:00
|
|
|
|
public class PrintHexSubOptions : CommonSubOptions
|
|
|
|
|
|
{
|
|
|
|
|
|
[Option('s', "start", Required = true,
|
|
|
|
|
|
HelpText = "Start sector.")]
|
|
|
|
|
|
public ulong StartSector { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option('l', "length", DefaultValue = (ulong)1,
|
|
|
|
|
|
HelpText = "How many sectors to print.")]
|
|
|
|
|
|
public ulong Length { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option('r', "long-sectors", DefaultValue = false,
|
|
|
|
|
|
HelpText = "Print sectors with tags included.")]
|
|
|
|
|
|
public bool LongSectors { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option('w', "width", DefaultValue = (ushort)32,
|
|
|
|
|
|
HelpText = "How many bytes to print per line.")]
|
|
|
|
|
|
public ushort WidthBytes { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option('i', "input", Required = true, HelpText = "Disc image.")]
|
|
|
|
|
|
public string InputFile { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2014-09-01 03:44:39 +01:00
|
|
|
|
public class DecodeSubOptions : CommonSubOptions
|
|
|
|
|
|
{
|
|
|
|
|
|
[Option('s', "start", DefaultValue = (ulong)0,
|
|
|
|
|
|
HelpText = "Start sector.")]
|
|
|
|
|
|
public ulong StartSector { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option('l', "length", DefaultValue = "all",
|
|
|
|
|
|
HelpText = "How many sectors to decode, or \"all\".")]
|
|
|
|
|
|
public string Length { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option('k', "disk-tags", DefaultValue = true,
|
|
|
|
|
|
HelpText = "Decode disk tags.")]
|
|
|
|
|
|
public bool DiskTags { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option('t', "sector-tags", DefaultValue = true,
|
|
|
|
|
|
HelpText = "Decode sector tags.")]
|
|
|
|
|
|
public bool SectorTags { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option('i', "input", Required = true, HelpText = "Disc image.")]
|
|
|
|
|
|
public string InputFile { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2015-10-13 01:45:07 +01:00
|
|
|
|
public class DeviceInfoSubOptions : CommonSubOptions
|
|
|
|
|
|
{
|
|
|
|
|
|
[Option('i', "device", Required = true, HelpText = "Device path.")]
|
|
|
|
|
|
public string DevicePath { get; set; }
|
2015-11-02 21:08:38 +00:00
|
|
|
|
|
|
|
|
|
|
[Option('w', "output-prefix", Required = false, DefaultValue = "", HelpText = "Write binary responses from device with that prefix.")]
|
|
|
|
|
|
public string OutputPrefix { get; set; }
|
2015-10-13 01:45:07 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2015-11-23 21:44:58 +00:00
|
|
|
|
public class MediaInfoSubOptions : CommonSubOptions
|
|
|
|
|
|
{
|
|
|
|
|
|
[Option('i', "device", Required = true, HelpText = "Device path.")]
|
|
|
|
|
|
public string DevicePath { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option('w', "output-prefix", Required = false, DefaultValue = "", HelpText = "Write binary responses from device with that prefix.")]
|
|
|
|
|
|
public string OutputPrefix { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2015-12-30 11:45:27 +00:00
|
|
|
|
public class MediaScanSubOptions : CommonSubOptions
|
|
|
|
|
|
{
|
|
|
|
|
|
[Option('i', "device", Required = true, HelpText = "Device path.")]
|
|
|
|
|
|
public string DevicePath { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option('m', "mhdd-log", Required = false, DefaultValue = "", HelpText = "Write a log of the scan in the format used by MHDD.")]
|
|
|
|
|
|
public string MHDDLogPath { get; set; }
|
* 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
|
|
|
|
|
|
|
|
|
|
[Option('b', "ibg-log", Required = false, DefaultValue = "", HelpText = "Write a log of the scan in the format used by ImgBurn.")]
|
|
|
|
|
|
public string IBGLogPath { get; set; }
|
2015-12-30 11:45:27 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
2014-06-16 01:50:49 +01:00
|
|
|
|
public class FormatsSubOptions : CommonSubOptions
|
2014-06-16 00:41:47 +01:00
|
|
|
|
{
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2015-11-30 22:28:42 +00:00
|
|
|
|
public class BenchmarkSubOptions : CommonSubOptions
|
|
|
|
|
|
{
|
|
|
|
|
|
[Option('b', "block-size", Required = false, DefaultValue = (int)512, HelpText = "Block size.")]
|
|
|
|
|
|
public int BlockSize { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option('s', "buffer-size", Required = false, DefaultValue = (int)128, HelpText = "Buffer size in mebibytes.")]
|
|
|
|
|
|
public int BufferSize { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2015-12-06 05:09:31 +00:00
|
|
|
|
public class CreateSidecarSubOptions : CommonSubOptions
|
|
|
|
|
|
{
|
|
|
|
|
|
[Option('i', "input", Required = true, HelpText = "Disc image.")]
|
|
|
|
|
|
public string InputFile { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
* 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
|
|
|
|
// TODO: Add more options
|
|
|
|
|
|
public class DumpMediaSubOptions : CommonSubOptions
|
|
|
|
|
|
{
|
|
|
|
|
|
[Option('i', "device", Required = true, HelpText = "Device path.")]
|
|
|
|
|
|
public string DevicePath { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option('w', "output-prefix", Required = true, HelpText = "Prefix for media dump.")]
|
|
|
|
|
|
public string OutputPrefix { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option('r', "raw", DefaultValue = false,
|
|
|
|
|
|
HelpText = "Print sectors with tags included.")]
|
|
|
|
|
|
public bool Raw { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option('s', "stop-on-error", DefaultValue = false,
|
|
|
|
|
|
HelpText = "Print sectors with tags included.")]
|
|
|
|
|
|
public bool StopOnError { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option('f', "force", DefaultValue = false,
|
|
|
|
|
|
HelpText = "Continue dump whatever happens.")]
|
|
|
|
|
|
public bool Force { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[Option("reset", DefaultValue = (ushort)0,
|
|
|
|
|
|
HelpText = "Reset the device after these many errors. 0 to disable.")]
|
|
|
|
|
|
public ushort Reset { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public class DeviceReportSubOptions : CommonSubOptions
|
|
|
|
|
|
{
|
|
|
|
|
|
[Option('i', "device", Required = true, HelpText = "Device path.")]
|
|
|
|
|
|
public string DevicePath { get; set; }
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2014-06-16 01:45:04 +01:00
|
|
|
|
public class Options
|
2014-06-16 00:41:47 +01:00
|
|
|
|
{
|
|
|
|
|
|
public Options()
|
|
|
|
|
|
{
|
|
|
|
|
|
AnalyzeVerb = new AnalyzeSubOptions();
|
|
|
|
|
|
CompareVerb = new CompareSubOptions();
|
|
|
|
|
|
ChecksumVerb = new ChecksumSubOptions();
|
2015-05-19 06:04:21 +01:00
|
|
|
|
EntropyVerb = new EntropySubOptions();
|
2014-06-16 00:41:47 +01:00
|
|
|
|
VerifyVerb = new VerifySubOptions();
|
|
|
|
|
|
FormatsVerb = new FormatsSubOptions();
|
2014-08-28 19:27:16 +01:00
|
|
|
|
PrintHexVerb = new PrintHexSubOptions();
|
2014-09-01 03:44:39 +01:00
|
|
|
|
DecodeVerb = new DecodeSubOptions();
|
2015-10-13 01:45:07 +01:00
|
|
|
|
DeviceInfoVerb = new DeviceInfoSubOptions();
|
2015-11-23 21:44:58 +00:00
|
|
|
|
MediaInfoVerb = new MediaInfoSubOptions();
|
2015-12-06 05:09:31 +00:00
|
|
|
|
BenchmarkVerb = new BenchmarkSubOptions();
|
|
|
|
|
|
CreateSidecarVerb = new CreateSidecarSubOptions();
|
2015-12-30 11:45:27 +00:00
|
|
|
|
MediaScanVerb = new MediaScanSubOptions();
|
* 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
|
|
|
|
DumpMediaVerb = new DumpMediaSubOptions();
|
|
|
|
|
|
DeviceReportVerb = new DeviceReportSubOptions();
|
2014-06-16 00:41:47 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
[VerbOption("analyze", HelpText = "Analyzes a disc image and searches for partitions and/or filesystems.")]
|
|
|
|
|
|
public AnalyzeSubOptions AnalyzeVerb { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[VerbOption("compare", HelpText = "Compares two disc images.")]
|
|
|
|
|
|
public CompareSubOptions CompareVerb { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[VerbOption("checksum", HelpText = "Checksums an image.")]
|
|
|
|
|
|
public ChecksumSubOptions ChecksumVerb { get; set; }
|
|
|
|
|
|
|
2015-05-19 06:04:21 +01:00
|
|
|
|
[VerbOption("entropy", HelpText = "Calculates entropy and/or duplicated sectors of an image.")]
|
|
|
|
|
|
public EntropySubOptions EntropyVerb { get; set; }
|
|
|
|
|
|
|
2014-06-16 00:41:47 +01:00
|
|
|
|
[VerbOption("verify", HelpText = "Verifies a disc image integrity, and if supported, sector integrity.")]
|
|
|
|
|
|
public VerifySubOptions VerifyVerb { get; set; }
|
|
|
|
|
|
|
2014-08-28 19:27:16 +01:00
|
|
|
|
[VerbOption("printhex", HelpText = "Prints a sector, in hexadecimal values, to the console.")]
|
|
|
|
|
|
public PrintHexSubOptions PrintHexVerb { get; set; }
|
|
|
|
|
|
|
2014-09-01 03:44:39 +01:00
|
|
|
|
[VerbOption("decode", HelpText = "Decodes and pretty prints disk and/or sector tags.")]
|
|
|
|
|
|
public DecodeSubOptions DecodeVerb { get; set; }
|
|
|
|
|
|
|
2014-06-16 00:41:47 +01:00
|
|
|
|
[VerbOption("formats", HelpText = "Lists all supported disc images, partition schemes and file systems.")]
|
|
|
|
|
|
public FormatsSubOptions FormatsVerb { get; set; }
|
|
|
|
|
|
|
2015-10-13 01:45:07 +01:00
|
|
|
|
[VerbOption("device-info", HelpText = "Gets information about a device.")]
|
|
|
|
|
|
public DeviceInfoSubOptions DeviceInfoVerb { get; set; }
|
|
|
|
|
|
|
2015-11-23 21:44:58 +00:00
|
|
|
|
[VerbOption("media-info", HelpText = "Gets information about the media inserted on a device.")]
|
|
|
|
|
|
public MediaInfoSubOptions MediaInfoVerb { get; set; }
|
|
|
|
|
|
|
2015-11-30 22:28:42 +00:00
|
|
|
|
[VerbOption("benchmark", HelpText = "Benchmarks hashing and entropy calculation.")]
|
2015-12-06 05:09:31 +00:00
|
|
|
|
public BenchmarkSubOptions BenchmarkVerb { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[VerbOption("create-sidecar", HelpText = "Creates CICM Metadata XML sidecar.")]
|
|
|
|
|
|
public CreateSidecarSubOptions CreateSidecarVerb { get; set; }
|
2015-11-30 22:28:42 +00:00
|
|
|
|
|
2015-12-30 11:45:27 +00:00
|
|
|
|
[VerbOption("media-scan", HelpText = "Scans the media inserted on a device.")]
|
|
|
|
|
|
public MediaScanSubOptions MediaScanVerb { get; set; }
|
|
|
|
|
|
|
* 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
|
|
|
|
[VerbOption("dump-media", HelpText = "Dumps the media inserted on a device to a media image.")]
|
|
|
|
|
|
public DumpMediaSubOptions DumpMediaVerb { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
[VerbOption("device-report", HelpText = "Tests the device capabilities and creates an XML report of them.")]
|
|
|
|
|
|
public DeviceReportSubOptions DeviceReportVerb { get; set; }
|
|
|
|
|
|
|
2014-06-16 00:41:47 +01:00
|
|
|
|
[HelpVerbOption]
|
|
|
|
|
|
public string DoHelpForVerb(string verbName)
|
|
|
|
|
|
{
|
|
|
|
|
|
return HelpText.AutoBuild(this, verbName);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|