mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
REFACTOR: Fixed MOST name inconsistencies.
This commit is contained in:
@@ -38,13 +38,13 @@ using DiscImageChef.Console;
|
||||
using DiscImageChef.Core;
|
||||
using DiscImageChef.Filesystems;
|
||||
using DiscImageChef.Filters;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.DiscImages;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
static class Analyze
|
||||
{
|
||||
internal static void doAnalyze(AnalyzeOptions options)
|
||||
internal static void DoAnalyze(AnalyzeOptions options)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Analyze command", "--debug={0}", options.Debug);
|
||||
DicConsole.DebugWriteLine("Analyze command", "--verbose={0}", options.Verbose);
|
||||
@@ -81,17 +81,17 @@ namespace DiscImageChef.Commands
|
||||
PluginBase plugins = new PluginBase();
|
||||
plugins.RegisterAllPlugins(encoding);
|
||||
|
||||
List<string> id_plugins;
|
||||
Filesystem _plugin;
|
||||
List<string> idPlugins;
|
||||
Filesystem plugin;
|
||||
string information;
|
||||
bool checkraw = false;
|
||||
ImagePlugin _imageFormat;
|
||||
ImagePlugin imageFormat;
|
||||
|
||||
try
|
||||
{
|
||||
_imageFormat = ImageFormat.Detect(inputFilter);
|
||||
imageFormat = ImageFormat.Detect(inputFilter);
|
||||
|
||||
if(_imageFormat == null)
|
||||
if(imageFormat == null)
|
||||
{
|
||||
DicConsole.WriteLine("Image format not identified, not proceeding with analysis.");
|
||||
return;
|
||||
@@ -99,14 +99,14 @@ namespace DiscImageChef.Commands
|
||||
else
|
||||
{
|
||||
if(options.Verbose)
|
||||
DicConsole.VerboseWriteLine("Image format identified by {0} ({1}).", _imageFormat.Name,
|
||||
_imageFormat.PluginUUID);
|
||||
else DicConsole.WriteLine("Image format identified by {0}.", _imageFormat.Name);
|
||||
DicConsole.VerboseWriteLine("Image format identified by {0} ({1}).", imageFormat.Name,
|
||||
imageFormat.PluginUuid);
|
||||
else DicConsole.WriteLine("Image format identified by {0}.", imageFormat.Name);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if(!_imageFormat.OpenImage(inputFilter))
|
||||
if(!imageFormat.OpenImage(inputFilter))
|
||||
{
|
||||
DicConsole.WriteLine("Unable to open image format");
|
||||
DicConsole.WriteLine("No error given");
|
||||
@@ -115,13 +115,13 @@ namespace DiscImageChef.Commands
|
||||
|
||||
DicConsole.DebugWriteLine("Analyze command", "Correctly opened image file.");
|
||||
DicConsole.DebugWriteLine("Analyze command", "Image without headers is {0} bytes.",
|
||||
_imageFormat.GetImageSize());
|
||||
DicConsole.DebugWriteLine("Analyze command", "Image has {0} sectors.", _imageFormat.GetSectors());
|
||||
imageFormat.GetImageSize());
|
||||
DicConsole.DebugWriteLine("Analyze command", "Image has {0} sectors.", imageFormat.GetSectors());
|
||||
DicConsole.DebugWriteLine("Analyze command", "Image identifies disk type as {0}.",
|
||||
_imageFormat.GetMediaType());
|
||||
imageFormat.GetMediaType());
|
||||
|
||||
Core.Statistics.AddMediaFormat(_imageFormat.GetImageFormat());
|
||||
Core.Statistics.AddMedia(_imageFormat.ImageInfo.mediaType, false);
|
||||
Core.Statistics.AddMediaFormat(imageFormat.GetImageFormat());
|
||||
Core.Statistics.AddMedia(imageFormat.ImageInfo.MediaType, false);
|
||||
Core.Statistics.AddFilter(inputFilter.Name);
|
||||
}
|
||||
catch(Exception ex)
|
||||
@@ -134,8 +134,8 @@ namespace DiscImageChef.Commands
|
||||
|
||||
if(options.SearchForPartitions)
|
||||
{
|
||||
List<Partition> partitions = Partitions.GetAll(_imageFormat);
|
||||
Partitions.AddSchemesToStats(partitions);
|
||||
List<Partition> partitions = Core.Partitions.GetAll(imageFormat);
|
||||
Core.Partitions.AddSchemesToStats(partitions);
|
||||
|
||||
if(partitions.Count == 0)
|
||||
{
|
||||
@@ -170,30 +170,30 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
DicConsole.WriteLine("Identifying filesystem on partition");
|
||||
|
||||
Core.Filesystems.Identify(_imageFormat, out id_plugins, partitions[i]);
|
||||
if(id_plugins.Count == 0) DicConsole.WriteLine("Filesystem not identified");
|
||||
else if(id_plugins.Count > 1)
|
||||
Core.Filesystems.Identify(imageFormat, out idPlugins, partitions[i]);
|
||||
if(idPlugins.Count == 0) DicConsole.WriteLine("Filesystem not identified");
|
||||
else if(idPlugins.Count > 1)
|
||||
{
|
||||
DicConsole.WriteLine(string.Format("Identified by {0} plugins", id_plugins.Count));
|
||||
DicConsole.WriteLine(string.Format("Identified by {0} plugins", idPlugins.Count));
|
||||
|
||||
foreach(string plugin_name in id_plugins)
|
||||
foreach(string pluginName in idPlugins)
|
||||
{
|
||||
if(plugins.PluginsList.TryGetValue(plugin_name, out _plugin))
|
||||
if(plugins.PluginsList.TryGetValue(pluginName, out plugin))
|
||||
{
|
||||
DicConsole.WriteLine(string.Format("As identified by {0}.", _plugin.Name));
|
||||
_plugin.GetInformation(_imageFormat, partitions[i], out information);
|
||||
DicConsole.WriteLine(string.Format("As identified by {0}.", plugin.Name));
|
||||
plugin.GetInformation(imageFormat, partitions[i], out information);
|
||||
DicConsole.Write(information);
|
||||
Core.Statistics.AddFilesystem(_plugin.XmlFSType.Type);
|
||||
Core.Statistics.AddFilesystem(plugin.XmlFSType.Type);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
plugins.PluginsList.TryGetValue(id_plugins[0], out _plugin);
|
||||
DicConsole.WriteLine(string.Format("Identified by {0}.", _plugin.Name));
|
||||
_plugin.GetInformation(_imageFormat, partitions[i], out information);
|
||||
plugins.PluginsList.TryGetValue(idPlugins[0], out plugin);
|
||||
DicConsole.WriteLine(string.Format("Identified by {0}.", plugin.Name));
|
||||
plugin.GetInformation(imageFormat, partitions[i], out information);
|
||||
DicConsole.Write(information);
|
||||
Core.Statistics.AddFilesystem(_plugin.XmlFSType.Type);
|
||||
Core.Statistics.AddFilesystem(plugin.XmlFSType.Type);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -205,34 +205,34 @@ namespace DiscImageChef.Commands
|
||||
Partition wholePart = new Partition
|
||||
{
|
||||
Name = "Whole device",
|
||||
Length = _imageFormat.GetSectors(),
|
||||
Size = _imageFormat.GetSectors() * _imageFormat.GetSectorSize()
|
||||
Length = imageFormat.GetSectors(),
|
||||
Size = imageFormat.GetSectors() * imageFormat.GetSectorSize()
|
||||
};
|
||||
|
||||
Core.Filesystems.Identify(_imageFormat, out id_plugins, wholePart);
|
||||
if(id_plugins.Count == 0) DicConsole.WriteLine("Filesystem not identified");
|
||||
else if(id_plugins.Count > 1)
|
||||
Core.Filesystems.Identify(imageFormat, out idPlugins, wholePart);
|
||||
if(idPlugins.Count == 0) DicConsole.WriteLine("Filesystem not identified");
|
||||
else if(idPlugins.Count > 1)
|
||||
{
|
||||
DicConsole.WriteLine(string.Format("Identified by {0} plugins", id_plugins.Count));
|
||||
DicConsole.WriteLine(string.Format("Identified by {0} plugins", idPlugins.Count));
|
||||
|
||||
foreach(string plugin_name in id_plugins)
|
||||
foreach(string pluginName in idPlugins)
|
||||
{
|
||||
if(plugins.PluginsList.TryGetValue(plugin_name, out _plugin))
|
||||
if(plugins.PluginsList.TryGetValue(pluginName, out plugin))
|
||||
{
|
||||
DicConsole.WriteLine(string.Format("As identified by {0}.", _plugin.Name));
|
||||
_plugin.GetInformation(_imageFormat, wholePart, out information);
|
||||
DicConsole.WriteLine(string.Format("As identified by {0}.", plugin.Name));
|
||||
plugin.GetInformation(imageFormat, wholePart, out information);
|
||||
DicConsole.Write(information);
|
||||
Core.Statistics.AddFilesystem(_plugin.XmlFSType.Type);
|
||||
Core.Statistics.AddFilesystem(plugin.XmlFSType.Type);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
plugins.PluginsList.TryGetValue(id_plugins[0], out _plugin);
|
||||
DicConsole.WriteLine(string.Format("Identified by {0}.", _plugin.Name));
|
||||
_plugin.GetInformation(_imageFormat, wholePart, out information);
|
||||
plugins.PluginsList.TryGetValue(idPlugins[0], out plugin);
|
||||
DicConsole.WriteLine(string.Format("Identified by {0}.", plugin.Name));
|
||||
plugin.GetInformation(imageFormat, wholePart, out information);
|
||||
DicConsole.Write(information);
|
||||
Core.Statistics.AddFilesystem(_plugin.XmlFSType.Type);
|
||||
Core.Statistics.AddFilesystem(plugin.XmlFSType.Type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
static class Benchmark
|
||||
{
|
||||
internal static void doBenchmark(BenchmarkOptions options)
|
||||
internal static void DoBenchmark(BenchmarkOptions options)
|
||||
{
|
||||
Dictionary<string, double> checksumTimes = new Dictionary<string, double>();
|
||||
Core.Benchmark.InitProgressEvent += Progress.InitProgress;
|
||||
@@ -47,32 +47,32 @@ namespace DiscImageChef.Commands
|
||||
|
||||
BenchmarkResults results = Core.Benchmark.Do(options.BufferSize * 1024 * 1024, options.BlockSize);
|
||||
|
||||
DicConsole.WriteLine("Took {0} seconds to fill buffer, {1:F3} MiB/sec.", results.fillTime,
|
||||
results.fillSpeed);
|
||||
DicConsole.WriteLine("Took {0} seconds to read buffer, {1:F3} MiB/sec.", results.readTime,
|
||||
results.readSpeed);
|
||||
DicConsole.WriteLine("Took {0} seconds to entropy buffer, {1:F3} MiB/sec.", results.entropyTime,
|
||||
results.entropySpeed);
|
||||
DicConsole.WriteLine("Took {0} seconds to fill buffer, {1:F3} MiB/sec.", results.FillTime,
|
||||
results.FillSpeed);
|
||||
DicConsole.WriteLine("Took {0} seconds to read buffer, {1:F3} MiB/sec.", results.ReadTime,
|
||||
results.ReadSpeed);
|
||||
DicConsole.WriteLine("Took {0} seconds to entropy buffer, {1:F3} MiB/sec.", results.EntropyTime,
|
||||
results.EntropySpeed);
|
||||
|
||||
foreach(KeyValuePair<string, BenchmarkEntry> entry in results.entries)
|
||||
foreach(KeyValuePair<string, BenchmarkEntry> entry in results.Entries)
|
||||
{
|
||||
checksumTimes.Add(entry.Key, entry.Value.timeSpan);
|
||||
DicConsole.WriteLine("Took {0} seconds to {1} buffer, {2:F3} MiB/sec.", entry.Value.timeSpan, entry.Key,
|
||||
entry.Value.speed);
|
||||
checksumTimes.Add(entry.Key, entry.Value.TimeSpan);
|
||||
DicConsole.WriteLine("Took {0} seconds to {1} buffer, {2:F3} MiB/sec.", entry.Value.TimeSpan, entry.Key,
|
||||
entry.Value.Speed);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Took {0} seconds to do all algorithms at the same time, {1} MiB/sec.",
|
||||
results.totalTime, results.totalSpeed);
|
||||
results.TotalTime, results.TotalSpeed);
|
||||
DicConsole.WriteLine("Took {0} seconds to do all algorithms sequentially, {1} MiB/sec.",
|
||||
results.separateTime, results.separateSpeed);
|
||||
results.SeparateTime, results.SeparateSpeed);
|
||||
|
||||
DicConsole.WriteLine();
|
||||
DicConsole.WriteLine("Max memory used is {0} bytes", results.maxMemory);
|
||||
DicConsole.WriteLine("Min memory used is {0} bytes", results.minMemory);
|
||||
DicConsole.WriteLine("Max memory used is {0} bytes", results.MaxMemory);
|
||||
DicConsole.WriteLine("Min memory used is {0} bytes", results.MinMemory);
|
||||
|
||||
Core.Statistics.AddCommand("benchmark");
|
||||
Core.Statistics.AddBenchmark(checksumTimes, results.entropyTime, results.totalTime, results.separateTime,
|
||||
results.maxMemory, results.minMemory);
|
||||
Core.Statistics.AddBenchmark(checksumTimes, results.EntropyTime, results.TotalTime, results.SeparateTime,
|
||||
results.MaxMemory, results.MinMemory);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -35,7 +35,7 @@ using System.Collections.Generic;
|
||||
using DiscImageChef.Console;
|
||||
using DiscImageChef.Core;
|
||||
using DiscImageChef.Filters;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.DiscImages;
|
||||
using Schemas;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
@@ -43,9 +43,9 @@ namespace DiscImageChef.Commands
|
||||
static class Checksum
|
||||
{
|
||||
// How many sectors to read at once
|
||||
const uint sectorsToRead = 256;
|
||||
const uint SECTORS_TO_READ = 256;
|
||||
|
||||
internal static void doChecksum(ChecksumOptions options)
|
||||
internal static void DoChecksum(ChecksumOptions options)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Checksum command", "--debug={0}", options.Debug);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--verbose={0}", options.Verbose);
|
||||
@@ -53,15 +53,15 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("Checksum command", "--whole-disc={0}", options.WholeDisc);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--input={0}", options.InputFile);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--adler32={0}", options.DoAdler32);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--crc16={0}", options.DoCRC16);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--crc32={0}", options.DoCRC32);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--crc64={0}", options.DoCRC64);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--md5={0}", options.DoMD5);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--ripemd160={0}", options.DoRIPEMD160);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--sha1={0}", options.DoSHA1);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--sha256={0}", options.DoSHA256);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--sha384={0}", options.DoSHA384);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--sha512={0}", options.DoSHA512);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--crc16={0}", options.DoCrc16);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--crc32={0}", options.DoCrc32);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--crc64={0}", options.DoCrc64);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--md5={0}", options.DoMd5);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--ripemd160={0}", options.DoRipemd160);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--sha1={0}", options.DoSha1);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--sha256={0}", options.DoSha256);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--sha384={0}", options.DoSha384);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--sha512={0}", options.DoSha512);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--spamsum={0}", options.DoSpamSum);
|
||||
|
||||
FiltersList filtersList = new FiltersList();
|
||||
@@ -83,25 +83,25 @@ namespace DiscImageChef.Commands
|
||||
|
||||
inputFormat.OpenImage(inputFilter);
|
||||
Core.Statistics.AddMediaFormat(inputFormat.GetImageFormat());
|
||||
Core.Statistics.AddMedia(inputFormat.ImageInfo.mediaType, false);
|
||||
Core.Statistics.AddMedia(inputFormat.ImageInfo.MediaType, false);
|
||||
Core.Statistics.AddFilter(inputFilter.Name);
|
||||
EnableChecksum enabledChecksums = new EnableChecksum();
|
||||
|
||||
if(options.DoAdler32) enabledChecksums |= EnableChecksum.Adler32;
|
||||
if(options.DoCRC16) enabledChecksums |= EnableChecksum.CRC16;
|
||||
if(options.DoCRC32) enabledChecksums |= EnableChecksum.CRC32;
|
||||
if(options.DoCRC64) enabledChecksums |= EnableChecksum.CRC64;
|
||||
if(options.DoMD5) enabledChecksums |= EnableChecksum.MD5;
|
||||
if(options.DoRIPEMD160) enabledChecksums |= EnableChecksum.RIPEMD160;
|
||||
if(options.DoSHA1) enabledChecksums |= EnableChecksum.SHA1;
|
||||
if(options.DoSHA256) enabledChecksums |= EnableChecksum.SHA256;
|
||||
if(options.DoSHA384) enabledChecksums |= EnableChecksum.SHA384;
|
||||
if(options.DoSHA512) enabledChecksums |= EnableChecksum.SHA512;
|
||||
if(options.DoCrc16) enabledChecksums |= EnableChecksum.Crc16;
|
||||
if(options.DoCrc32) enabledChecksums |= EnableChecksum.Crc32;
|
||||
if(options.DoCrc64) enabledChecksums |= EnableChecksum.Crc64;
|
||||
if(options.DoMd5) enabledChecksums |= EnableChecksum.Md5;
|
||||
if(options.DoRipemd160) enabledChecksums |= EnableChecksum.Ripemd160;
|
||||
if(options.DoSha1) enabledChecksums |= EnableChecksum.Sha1;
|
||||
if(options.DoSha256) enabledChecksums |= EnableChecksum.Sha256;
|
||||
if(options.DoSha384) enabledChecksums |= EnableChecksum.Sha384;
|
||||
if(options.DoSha512) enabledChecksums |= EnableChecksum.Sha512;
|
||||
if(options.DoSpamSum) enabledChecksums |= EnableChecksum.SpamSum;
|
||||
|
||||
Core.Checksum mediaChecksum = null;
|
||||
|
||||
if(inputFormat.ImageInfo.imageHasPartitions)
|
||||
if(inputFormat.ImageInfo.ImageHasPartitions)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -141,13 +141,13 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
byte[] sector;
|
||||
|
||||
if((sectors - doneSectors) >= sectorsToRead)
|
||||
if((sectors - doneSectors) >= SECTORS_TO_READ)
|
||||
{
|
||||
sector = inputFormat.ReadSectors(doneSectors, sectorsToRead,
|
||||
sector = inputFormat.ReadSectors(doneSectors, SECTORS_TO_READ,
|
||||
currentTrack.TrackSequence);
|
||||
DicConsole.Write("\rHashings sectors {0} to {2} of track {1}", doneSectors,
|
||||
currentTrack.TrackSequence, doneSectors + sectorsToRead);
|
||||
doneSectors += sectorsToRead;
|
||||
currentTrack.TrackSequence, doneSectors + SECTORS_TO_READ);
|
||||
doneSectors += SECTORS_TO_READ;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -210,11 +210,11 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
byte[] sector;
|
||||
|
||||
if((sectors - doneSectors) >= sectorsToRead)
|
||||
if((sectors - doneSectors) >= SECTORS_TO_READ)
|
||||
{
|
||||
sector = inputFormat.ReadSectors(doneSectors, sectorsToRead);
|
||||
DicConsole.Write("\rHashings sectors {0} to {1}", doneSectors, doneSectors + sectorsToRead);
|
||||
doneSectors += sectorsToRead;
|
||||
sector = inputFormat.ReadSectors(doneSectors, SECTORS_TO_READ);
|
||||
DicConsole.Write("\rHashings sectors {0} to {1}", doneSectors, doneSectors + SECTORS_TO_READ);
|
||||
doneSectors += SECTORS_TO_READ;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -36,13 +36,13 @@ using System.Text;
|
||||
using DiscImageChef.Console;
|
||||
using DiscImageChef.Core;
|
||||
using DiscImageChef.Filters;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.DiscImages;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
static class Compare
|
||||
{
|
||||
internal static void doCompare(CompareOptions options)
|
||||
internal static void DoCompare(CompareOptions options)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Compare command", "--debug={0}", options.Debug);
|
||||
DicConsole.DebugWriteLine("Compare command", "--verbose={0}", options.Verbose);
|
||||
@@ -78,7 +78,7 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
if(options.Verbose)
|
||||
DicConsole.VerboseWriteLine("Input file 1 format identified by {0} ({1}).", input1Format.Name,
|
||||
input1Format.PluginUUID);
|
||||
input1Format.PluginUuid);
|
||||
else DicConsole.WriteLine("Input file 1 format identified by {0}.", input1Format.Name);
|
||||
}
|
||||
|
||||
@@ -91,7 +91,7 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
if(options.Verbose)
|
||||
DicConsole.VerboseWriteLine("Input file 2 format identified by {0} ({1}).", input2Format.Name,
|
||||
input2Format.PluginUUID);
|
||||
input2Format.PluginUuid);
|
||||
else DicConsole.WriteLine("Input file 2 format identified by {0}.", input2Format.Name);
|
||||
}
|
||||
|
||||
@@ -100,8 +100,8 @@ namespace DiscImageChef.Commands
|
||||
|
||||
Core.Statistics.AddMediaFormat(input1Format.GetImageFormat());
|
||||
Core.Statistics.AddMediaFormat(input2Format.GetImageFormat());
|
||||
Core.Statistics.AddMedia(input1Format.ImageInfo.mediaType, false);
|
||||
Core.Statistics.AddMedia(input2Format.ImageInfo.mediaType, false);
|
||||
Core.Statistics.AddMedia(input1Format.ImageInfo.MediaType, false);
|
||||
Core.Statistics.AddMedia(input2Format.ImageInfo.MediaType, false);
|
||||
Core.Statistics.AddFilter(inputFilter1.Name);
|
||||
Core.Statistics.AddFilter(inputFilter2.Name);
|
||||
|
||||
@@ -129,52 +129,52 @@ namespace DiscImageChef.Commands
|
||||
Dictionary<MediaTagType, byte[]> image1DiskTags = new Dictionary<MediaTagType, byte[]>();
|
||||
Dictionary<MediaTagType, byte[]> image2DiskTags = new Dictionary<MediaTagType, byte[]>();
|
||||
|
||||
image1Info.imageHasPartitions = input1Format.ImageHasPartitions();
|
||||
image1Info.ImageHasPartitions = input1Format.ImageHasPartitions();
|
||||
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
|
||||
try { image1Sessions = input1Format.GetSessions(); }
|
||||
catch { }
|
||||
#pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body
|
||||
image1Info.imageHasSessions |= image1Sessions.Count > 0;
|
||||
image1Info.imageSize = input1Format.GetImageSize();
|
||||
image1Info.sectors = input1Format.GetSectors();
|
||||
image1Info.sectorSize = input1Format.GetSectorSize();
|
||||
image1Info.imageCreationTime = input1Format.GetImageCreationTime();
|
||||
image1Info.imageLastModificationTime = input1Format.GetImageLastModificationTime();
|
||||
image1Info.mediaType = input1Format.GetMediaType();
|
||||
try { image1Info.imageVersion = input1Format.GetImageVersion(); }
|
||||
catch { image1Info.imageVersion = null; }
|
||||
try { image1Info.imageApplication = input1Format.GetImageApplication(); }
|
||||
catch { image1Info.imageApplication = null; }
|
||||
try { image1Info.imageApplicationVersion = input1Format.GetImageApplicationVersion(); }
|
||||
catch { image1Info.imageApplicationVersion = null; }
|
||||
try { image1Info.imageCreator = input1Format.GetImageCreator(); }
|
||||
catch { image1Info.imageCreator = null; }
|
||||
try { image1Info.imageName = input1Format.GetImageName(); }
|
||||
catch { image1Info.imageName = null; }
|
||||
try { image1Info.imageComments = input1Format.GetImageComments(); }
|
||||
catch { image1Info.imageComments = null; }
|
||||
try { image1Info.mediaManufacturer = input1Format.GetMediaManufacturer(); }
|
||||
catch { image1Info.mediaManufacturer = null; }
|
||||
try { image1Info.mediaModel = input1Format.GetMediaModel(); }
|
||||
catch { image1Info.mediaModel = null; }
|
||||
try { image1Info.mediaSerialNumber = input1Format.GetMediaSerialNumber(); }
|
||||
catch { image1Info.mediaSerialNumber = null; }
|
||||
try { image1Info.mediaBarcode = input1Format.GetMediaBarcode(); }
|
||||
catch { image1Info.mediaBarcode = null; }
|
||||
try { image1Info.mediaPartNumber = input1Format.GetMediaPartNumber(); }
|
||||
catch { image1Info.mediaPartNumber = null; }
|
||||
try { image1Info.mediaSequence = input1Format.GetMediaSequence(); }
|
||||
catch { image1Info.mediaSequence = 0; }
|
||||
try { image1Info.lastMediaSequence = input1Format.GetLastDiskSequence(); }
|
||||
catch { image1Info.lastMediaSequence = 0; }
|
||||
try { image1Info.driveManufacturer = input1Format.GetDriveManufacturer(); }
|
||||
catch { image1Info.driveManufacturer = null; }
|
||||
try { image1Info.driveModel = input1Format.GetDriveModel(); }
|
||||
catch { image1Info.driveModel = null; }
|
||||
try { image1Info.driveSerialNumber = input1Format.GetDriveSerialNumber(); }
|
||||
catch { image1Info.driveSerialNumber = null; }
|
||||
try { image1Info.driveFirmwareRevision = input1Format.ImageInfo.driveFirmwareRevision; }
|
||||
catch { image1Info.driveFirmwareRevision = null; }
|
||||
image1Info.ImageHasSessions |= image1Sessions.Count > 0;
|
||||
image1Info.ImageSize = input1Format.GetImageSize();
|
||||
image1Info.Sectors = input1Format.GetSectors();
|
||||
image1Info.SectorSize = input1Format.GetSectorSize();
|
||||
image1Info.ImageCreationTime = input1Format.GetImageCreationTime();
|
||||
image1Info.ImageLastModificationTime = input1Format.GetImageLastModificationTime();
|
||||
image1Info.MediaType = input1Format.GetMediaType();
|
||||
try { image1Info.ImageVersion = input1Format.GetImageVersion(); }
|
||||
catch { image1Info.ImageVersion = null; }
|
||||
try { image1Info.ImageApplication = input1Format.GetImageApplication(); }
|
||||
catch { image1Info.ImageApplication = null; }
|
||||
try { image1Info.ImageApplicationVersion = input1Format.GetImageApplicationVersion(); }
|
||||
catch { image1Info.ImageApplicationVersion = null; }
|
||||
try { image1Info.ImageCreator = input1Format.GetImageCreator(); }
|
||||
catch { image1Info.ImageCreator = null; }
|
||||
try { image1Info.ImageName = input1Format.GetImageName(); }
|
||||
catch { image1Info.ImageName = null; }
|
||||
try { image1Info.ImageComments = input1Format.GetImageComments(); }
|
||||
catch { image1Info.ImageComments = null; }
|
||||
try { image1Info.MediaManufacturer = input1Format.GetMediaManufacturer(); }
|
||||
catch { image1Info.MediaManufacturer = null; }
|
||||
try { image1Info.MediaModel = input1Format.GetMediaModel(); }
|
||||
catch { image1Info.MediaModel = null; }
|
||||
try { image1Info.MediaSerialNumber = input1Format.GetMediaSerialNumber(); }
|
||||
catch { image1Info.MediaSerialNumber = null; }
|
||||
try { image1Info.MediaBarcode = input1Format.GetMediaBarcode(); }
|
||||
catch { image1Info.MediaBarcode = null; }
|
||||
try { image1Info.MediaPartNumber = input1Format.GetMediaPartNumber(); }
|
||||
catch { image1Info.MediaPartNumber = null; }
|
||||
try { image1Info.MediaSequence = input1Format.GetMediaSequence(); }
|
||||
catch { image1Info.MediaSequence = 0; }
|
||||
try { image1Info.LastMediaSequence = input1Format.GetLastDiskSequence(); }
|
||||
catch { image1Info.LastMediaSequence = 0; }
|
||||
try { image1Info.DriveManufacturer = input1Format.GetDriveManufacturer(); }
|
||||
catch { image1Info.DriveManufacturer = null; }
|
||||
try { image1Info.DriveModel = input1Format.GetDriveModel(); }
|
||||
catch { image1Info.DriveModel = null; }
|
||||
try { image1Info.DriveSerialNumber = input1Format.GetDriveSerialNumber(); }
|
||||
catch { image1Info.DriveSerialNumber = null; }
|
||||
try { image1Info.DriveFirmwareRevision = input1Format.ImageInfo.DriveFirmwareRevision; }
|
||||
catch { image1Info.DriveFirmwareRevision = null; }
|
||||
foreach(MediaTagType disktag in Enum.GetValues(typeof(MediaTagType)))
|
||||
{
|
||||
try
|
||||
@@ -187,52 +187,52 @@ namespace DiscImageChef.Commands
|
||||
#pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body
|
||||
}
|
||||
|
||||
image2Info.imageHasPartitions = input2Format.ImageHasPartitions();
|
||||
image2Info.ImageHasPartitions = input2Format.ImageHasPartitions();
|
||||
#pragma warning disable RECS0022 // A catch clause that catches System.Exception and has an empty body
|
||||
try { image2Sessions = input2Format.GetSessions(); }
|
||||
catch { }
|
||||
#pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body
|
||||
image2Info.imageHasSessions |= image2Sessions.Count > 0;
|
||||
image2Info.imageSize = input2Format.GetImageSize();
|
||||
image2Info.sectors = input2Format.GetSectors();
|
||||
image2Info.sectorSize = input2Format.GetSectorSize();
|
||||
image2Info.imageCreationTime = input2Format.GetImageCreationTime();
|
||||
image2Info.imageLastModificationTime = input2Format.GetImageLastModificationTime();
|
||||
image2Info.mediaType = input2Format.GetMediaType();
|
||||
try { image2Info.imageVersion = input2Format.GetImageVersion(); }
|
||||
catch { image2Info.imageVersion = null; }
|
||||
try { image2Info.imageApplication = input2Format.GetImageApplication(); }
|
||||
catch { image2Info.imageApplication = null; }
|
||||
try { image2Info.imageApplicationVersion = input2Format.GetImageApplicationVersion(); }
|
||||
catch { image2Info.imageApplicationVersion = null; }
|
||||
try { image2Info.imageCreator = input2Format.GetImageCreator(); }
|
||||
catch { image2Info.imageCreator = null; }
|
||||
try { image2Info.imageName = input2Format.GetImageName(); }
|
||||
catch { image2Info.imageName = null; }
|
||||
try { image2Info.imageComments = input2Format.GetImageComments(); }
|
||||
catch { image2Info.imageComments = null; }
|
||||
try { image2Info.mediaManufacturer = input2Format.GetMediaManufacturer(); }
|
||||
catch { image2Info.mediaManufacturer = null; }
|
||||
try { image2Info.mediaModel = input2Format.GetMediaModel(); }
|
||||
catch { image2Info.mediaModel = null; }
|
||||
try { image2Info.mediaSerialNumber = input2Format.GetMediaSerialNumber(); }
|
||||
catch { image2Info.mediaSerialNumber = null; }
|
||||
try { image2Info.mediaBarcode = input2Format.GetMediaBarcode(); }
|
||||
catch { image2Info.mediaBarcode = null; }
|
||||
try { image2Info.mediaPartNumber = input2Format.GetMediaPartNumber(); }
|
||||
catch { image2Info.mediaPartNumber = null; }
|
||||
try { image2Info.mediaSequence = input2Format.GetMediaSequence(); }
|
||||
catch { image2Info.mediaSequence = 0; }
|
||||
try { image2Info.lastMediaSequence = input2Format.GetLastDiskSequence(); }
|
||||
catch { image2Info.lastMediaSequence = 0; }
|
||||
try { image2Info.driveManufacturer = input2Format.GetDriveManufacturer(); }
|
||||
catch { image2Info.driveManufacturer = null; }
|
||||
try { image2Info.driveModel = input2Format.GetDriveModel(); }
|
||||
catch { image2Info.driveModel = null; }
|
||||
try { image2Info.driveSerialNumber = input2Format.GetDriveSerialNumber(); }
|
||||
catch { image2Info.driveSerialNumber = null; }
|
||||
try { image2Info.driveFirmwareRevision = input2Format.ImageInfo.driveFirmwareRevision; }
|
||||
catch { image2Info.driveFirmwareRevision = null; }
|
||||
image2Info.ImageHasSessions |= image2Sessions.Count > 0;
|
||||
image2Info.ImageSize = input2Format.GetImageSize();
|
||||
image2Info.Sectors = input2Format.GetSectors();
|
||||
image2Info.SectorSize = input2Format.GetSectorSize();
|
||||
image2Info.ImageCreationTime = input2Format.GetImageCreationTime();
|
||||
image2Info.ImageLastModificationTime = input2Format.GetImageLastModificationTime();
|
||||
image2Info.MediaType = input2Format.GetMediaType();
|
||||
try { image2Info.ImageVersion = input2Format.GetImageVersion(); }
|
||||
catch { image2Info.ImageVersion = null; }
|
||||
try { image2Info.ImageApplication = input2Format.GetImageApplication(); }
|
||||
catch { image2Info.ImageApplication = null; }
|
||||
try { image2Info.ImageApplicationVersion = input2Format.GetImageApplicationVersion(); }
|
||||
catch { image2Info.ImageApplicationVersion = null; }
|
||||
try { image2Info.ImageCreator = input2Format.GetImageCreator(); }
|
||||
catch { image2Info.ImageCreator = null; }
|
||||
try { image2Info.ImageName = input2Format.GetImageName(); }
|
||||
catch { image2Info.ImageName = null; }
|
||||
try { image2Info.ImageComments = input2Format.GetImageComments(); }
|
||||
catch { image2Info.ImageComments = null; }
|
||||
try { image2Info.MediaManufacturer = input2Format.GetMediaManufacturer(); }
|
||||
catch { image2Info.MediaManufacturer = null; }
|
||||
try { image2Info.MediaModel = input2Format.GetMediaModel(); }
|
||||
catch { image2Info.MediaModel = null; }
|
||||
try { image2Info.MediaSerialNumber = input2Format.GetMediaSerialNumber(); }
|
||||
catch { image2Info.MediaSerialNumber = null; }
|
||||
try { image2Info.MediaBarcode = input2Format.GetMediaBarcode(); }
|
||||
catch { image2Info.MediaBarcode = null; }
|
||||
try { image2Info.MediaPartNumber = input2Format.GetMediaPartNumber(); }
|
||||
catch { image2Info.MediaPartNumber = null; }
|
||||
try { image2Info.MediaSequence = input2Format.GetMediaSequence(); }
|
||||
catch { image2Info.MediaSequence = 0; }
|
||||
try { image2Info.LastMediaSequence = input2Format.GetLastDiskSequence(); }
|
||||
catch { image2Info.LastMediaSequence = 0; }
|
||||
try { image2Info.DriveManufacturer = input2Format.GetDriveManufacturer(); }
|
||||
catch { image2Info.DriveManufacturer = null; }
|
||||
try { image2Info.DriveModel = input2Format.GetDriveModel(); }
|
||||
catch { image2Info.DriveModel = null; }
|
||||
try { image2Info.DriveSerialNumber = input2Format.GetDriveSerialNumber(); }
|
||||
catch { image2Info.DriveSerialNumber = null; }
|
||||
try { image2Info.DriveFirmwareRevision = input2Format.ImageInfo.DriveFirmwareRevision; }
|
||||
catch { image2Info.DriveFirmwareRevision = null; }
|
||||
foreach(MediaTagType disktag in Enum.GetValues(typeof(MediaTagType)))
|
||||
{
|
||||
try
|
||||
@@ -247,49 +247,49 @@ namespace DiscImageChef.Commands
|
||||
|
||||
if(options.Verbose)
|
||||
{
|
||||
sb.AppendFormat("Has partitions?\t{0}\t{1}", image1Info.imageHasPartitions,
|
||||
image2Info.imageHasPartitions).AppendLine();
|
||||
sb.AppendFormat("Has sessions?\t{0}\t{1}", image1Info.imageHasSessions, image2Info.imageHasSessions)
|
||||
sb.AppendFormat("Has partitions?\t{0}\t{1}", image1Info.ImageHasPartitions,
|
||||
image2Info.ImageHasPartitions).AppendLine();
|
||||
sb.AppendFormat("Has sessions?\t{0}\t{1}", image1Info.ImageHasSessions, image2Info.ImageHasSessions)
|
||||
.AppendLine();
|
||||
sb.AppendFormat("Image size\t{0}\t{1}", image1Info.imageSize, image2Info.imageSize).AppendLine();
|
||||
sb.AppendFormat("Sectors\t{0}\t{1}", image1Info.sectors, image2Info.sectors).AppendLine();
|
||||
sb.AppendFormat("Sector size\t{0}\t{1}", image1Info.sectorSize, image2Info.sectorSize).AppendLine();
|
||||
sb.AppendFormat("Creation time\t{0}\t{1}", image1Info.imageCreationTime, image2Info.imageCreationTime)
|
||||
sb.AppendFormat("Image size\t{0}\t{1}", image1Info.ImageSize, image2Info.ImageSize).AppendLine();
|
||||
sb.AppendFormat("Sectors\t{0}\t{1}", image1Info.Sectors, image2Info.Sectors).AppendLine();
|
||||
sb.AppendFormat("Sector size\t{0}\t{1}", image1Info.SectorSize, image2Info.SectorSize).AppendLine();
|
||||
sb.AppendFormat("Creation time\t{0}\t{1}", image1Info.ImageCreationTime, image2Info.ImageCreationTime)
|
||||
.AppendLine();
|
||||
sb.AppendFormat("Last modification time\t{0}\t{1}", image1Info.imageLastModificationTime,
|
||||
image2Info.imageLastModificationTime).AppendLine();
|
||||
sb.AppendFormat("Disk type\t{0}\t{1}", image1Info.mediaType, image2Info.mediaType).AppendLine();
|
||||
sb.AppendFormat("Image version\t{0}\t{1}", image1Info.imageVersion, image2Info.imageVersion)
|
||||
sb.AppendFormat("Last modification time\t{0}\t{1}", image1Info.ImageLastModificationTime,
|
||||
image2Info.ImageLastModificationTime).AppendLine();
|
||||
sb.AppendFormat("Disk type\t{0}\t{1}", image1Info.MediaType, image2Info.MediaType).AppendLine();
|
||||
sb.AppendFormat("Image version\t{0}\t{1}", image1Info.ImageVersion, image2Info.ImageVersion)
|
||||
.AppendLine();
|
||||
sb.AppendFormat("Image application\t{0}\t{1}", image1Info.imageApplication, image2Info.imageApplication)
|
||||
sb.AppendFormat("Image application\t{0}\t{1}", image1Info.ImageApplication, image2Info.ImageApplication)
|
||||
.AppendLine();
|
||||
sb.AppendFormat("Image application version\t{0}\t{1}", image1Info.imageApplicationVersion,
|
||||
image2Info.imageApplicationVersion).AppendLine();
|
||||
sb.AppendFormat("Image creator\t{0}\t{1}", image1Info.imageCreator, image2Info.imageCreator)
|
||||
sb.AppendFormat("Image application version\t{0}\t{1}", image1Info.ImageApplicationVersion,
|
||||
image2Info.ImageApplicationVersion).AppendLine();
|
||||
sb.AppendFormat("Image creator\t{0}\t{1}", image1Info.ImageCreator, image2Info.ImageCreator)
|
||||
.AppendLine();
|
||||
sb.AppendFormat("Image name\t{0}\t{1}", image1Info.imageName, image2Info.imageName).AppendLine();
|
||||
sb.AppendFormat("Image comments\t{0}\t{1}", image1Info.imageComments, image2Info.imageComments)
|
||||
sb.AppendFormat("Image name\t{0}\t{1}", image1Info.ImageName, image2Info.ImageName).AppendLine();
|
||||
sb.AppendFormat("Image comments\t{0}\t{1}", image1Info.ImageComments, image2Info.ImageComments)
|
||||
.AppendLine();
|
||||
sb.AppendFormat("Disk manufacturer\t{0}\t{1}", image1Info.mediaManufacturer,
|
||||
image2Info.mediaManufacturer).AppendLine();
|
||||
sb.AppendFormat("Disk model\t{0}\t{1}", image1Info.mediaModel, image2Info.mediaModel).AppendLine();
|
||||
sb.AppendFormat("Disk serial number\t{0}\t{1}", image1Info.mediaSerialNumber,
|
||||
image2Info.mediaSerialNumber).AppendLine();
|
||||
sb.AppendFormat("Disk barcode\t{0}\t{1}", image1Info.mediaBarcode, image2Info.mediaBarcode)
|
||||
sb.AppendFormat("Disk manufacturer\t{0}\t{1}", image1Info.MediaManufacturer,
|
||||
image2Info.MediaManufacturer).AppendLine();
|
||||
sb.AppendFormat("Disk model\t{0}\t{1}", image1Info.MediaModel, image2Info.MediaModel).AppendLine();
|
||||
sb.AppendFormat("Disk serial number\t{0}\t{1}", image1Info.MediaSerialNumber,
|
||||
image2Info.MediaSerialNumber).AppendLine();
|
||||
sb.AppendFormat("Disk barcode\t{0}\t{1}", image1Info.MediaBarcode, image2Info.MediaBarcode)
|
||||
.AppendLine();
|
||||
sb.AppendFormat("Disk part no.\t{0}\t{1}", image1Info.mediaPartNumber, image2Info.mediaPartNumber)
|
||||
sb.AppendFormat("Disk part no.\t{0}\t{1}", image1Info.MediaPartNumber, image2Info.MediaPartNumber)
|
||||
.AppendLine();
|
||||
sb.AppendFormat("Disk sequence\t{0}\t{1}", image1Info.mediaSequence, image2Info.mediaSequence)
|
||||
sb.AppendFormat("Disk sequence\t{0}\t{1}", image1Info.MediaSequence, image2Info.MediaSequence)
|
||||
.AppendLine();
|
||||
sb.AppendFormat("Last disk on sequence\t{0}\t{1}", image1Info.lastMediaSequence,
|
||||
image2Info.lastMediaSequence).AppendLine();
|
||||
sb.AppendFormat("Drive manufacturer\t{0}\t{1}", image1Info.driveManufacturer,
|
||||
image2Info.driveManufacturer).AppendLine();
|
||||
sb.AppendFormat("Drive firmware revision\t{0}\t{1}", image1Info.driveFirmwareRevision,
|
||||
image2Info.driveFirmwareRevision).AppendLine();
|
||||
sb.AppendFormat("Drive model\t{0}\t{1}", image1Info.driveModel, image2Info.driveModel).AppendLine();
|
||||
sb.AppendFormat("Drive serial number\t{0}\t{1}", image1Info.driveSerialNumber,
|
||||
image2Info.driveSerialNumber).AppendLine();
|
||||
sb.AppendFormat("Last disk on sequence\t{0}\t{1}", image1Info.LastMediaSequence,
|
||||
image2Info.LastMediaSequence).AppendLine();
|
||||
sb.AppendFormat("Drive manufacturer\t{0}\t{1}", image1Info.DriveManufacturer,
|
||||
image2Info.DriveManufacturer).AppendLine();
|
||||
sb.AppendFormat("Drive firmware revision\t{0}\t{1}", image1Info.DriveFirmwareRevision,
|
||||
image2Info.DriveFirmwareRevision).AppendLine();
|
||||
sb.AppendFormat("Drive model\t{0}\t{1}", image1Info.DriveModel, image2Info.DriveModel).AppendLine();
|
||||
sb.AppendFormat("Drive serial number\t{0}\t{1}", image1Info.DriveSerialNumber,
|
||||
image2Info.DriveSerialNumber).AppendLine();
|
||||
foreach(MediaTagType disktag in Enum.GetValues(typeof(MediaTagType)))
|
||||
{
|
||||
sb.AppendFormat("Has {0}?\t{1}\t{2}", disktag, image1DiskTags.ContainsKey(disktag),
|
||||
@@ -299,146 +299,146 @@ namespace DiscImageChef.Commands
|
||||
|
||||
DicConsole.WriteLine("Comparing disk image characteristics");
|
||||
|
||||
if(image1Info.imageHasPartitions != image2Info.imageHasPartitions)
|
||||
if(image1Info.ImageHasPartitions != image2Info.ImageHasPartitions)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if(!options.Verbose) sb.AppendLine("Image partitioned status differ");
|
||||
}
|
||||
if(image1Info.imageHasSessions != image2Info.imageHasSessions)
|
||||
if(image1Info.ImageHasSessions != image2Info.ImageHasSessions)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if(!options.Verbose) sb.AppendLine("Image session status differ");
|
||||
}
|
||||
if(image1Info.imageSize != image2Info.imageSize)
|
||||
if(image1Info.ImageSize != image2Info.ImageSize)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if(!options.Verbose) sb.AppendLine("Image size differ");
|
||||
}
|
||||
if(image1Info.sectors != image2Info.sectors)
|
||||
if(image1Info.Sectors != image2Info.Sectors)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if(!options.Verbose) sb.AppendLine("Image sectors differ");
|
||||
}
|
||||
if(image1Info.sectorSize != image2Info.sectorSize)
|
||||
if(image1Info.SectorSize != image2Info.SectorSize)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if(!options.Verbose) sb.AppendLine("Image sector size differ");
|
||||
}
|
||||
if(image1Info.imageCreationTime != image2Info.imageCreationTime)
|
||||
if(image1Info.ImageCreationTime != image2Info.ImageCreationTime)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if(!options.Verbose) sb.AppendLine("Image creation time differ");
|
||||
}
|
||||
if(image1Info.imageLastModificationTime != image2Info.imageLastModificationTime)
|
||||
if(image1Info.ImageLastModificationTime != image2Info.ImageLastModificationTime)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if(!options.Verbose) sb.AppendLine("Image last modification time differ");
|
||||
}
|
||||
if(image1Info.mediaType != image2Info.mediaType)
|
||||
if(image1Info.MediaType != image2Info.MediaType)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if(!options.Verbose) sb.AppendLine("Disk type differ");
|
||||
}
|
||||
if(image1Info.imageVersion != image2Info.imageVersion)
|
||||
if(image1Info.ImageVersion != image2Info.ImageVersion)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if(!options.Verbose) sb.AppendLine("Image version differ");
|
||||
}
|
||||
if(image1Info.imageApplication != image2Info.imageApplication)
|
||||
if(image1Info.ImageApplication != image2Info.ImageApplication)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if(!options.Verbose) sb.AppendLine("Image application differ");
|
||||
}
|
||||
if(image1Info.imageApplicationVersion != image2Info.imageApplicationVersion)
|
||||
if(image1Info.ImageApplicationVersion != image2Info.ImageApplicationVersion)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if(!options.Verbose) sb.AppendLine("Image application version differ");
|
||||
}
|
||||
if(image1Info.imageCreator != image2Info.imageCreator)
|
||||
if(image1Info.ImageCreator != image2Info.ImageCreator)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if(!options.Verbose) sb.AppendLine("Image creator differ");
|
||||
}
|
||||
if(image1Info.imageName != image2Info.imageName)
|
||||
if(image1Info.ImageName != image2Info.ImageName)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if(!options.Verbose) sb.AppendLine("Image name differ");
|
||||
}
|
||||
if(image1Info.imageComments != image2Info.imageComments)
|
||||
if(image1Info.ImageComments != image2Info.ImageComments)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if(!options.Verbose) sb.AppendLine("Image comments differ");
|
||||
}
|
||||
if(image1Info.mediaManufacturer != image2Info.mediaManufacturer)
|
||||
if(image1Info.MediaManufacturer != image2Info.MediaManufacturer)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if(!options.Verbose) sb.AppendLine("Disk manufacturer differ");
|
||||
}
|
||||
if(image1Info.mediaModel != image2Info.mediaModel)
|
||||
if(image1Info.MediaModel != image2Info.MediaModel)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if(!options.Verbose) sb.AppendLine("Disk model differ");
|
||||
}
|
||||
if(image1Info.mediaSerialNumber != image2Info.mediaSerialNumber)
|
||||
if(image1Info.MediaSerialNumber != image2Info.MediaSerialNumber)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if(!options.Verbose) sb.AppendLine("Disk serial number differ");
|
||||
}
|
||||
if(image1Info.mediaBarcode != image2Info.mediaBarcode)
|
||||
if(image1Info.MediaBarcode != image2Info.MediaBarcode)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if(!options.Verbose) sb.AppendLine("Disk barcode differ");
|
||||
}
|
||||
if(image1Info.mediaPartNumber != image2Info.mediaPartNumber)
|
||||
if(image1Info.MediaPartNumber != image2Info.MediaPartNumber)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if(!options.Verbose) sb.AppendLine("Disk part number differ");
|
||||
}
|
||||
if(image1Info.mediaSequence != image2Info.mediaSequence)
|
||||
if(image1Info.MediaSequence != image2Info.MediaSequence)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if(!options.Verbose) sb.AppendLine("Disk sequence differ");
|
||||
}
|
||||
if(image1Info.lastMediaSequence != image2Info.lastMediaSequence)
|
||||
if(image1Info.LastMediaSequence != image2Info.LastMediaSequence)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if(!options.Verbose) sb.AppendLine("Last disk in sequence differ");
|
||||
}
|
||||
if(image1Info.driveManufacturer != image2Info.driveManufacturer)
|
||||
if(image1Info.DriveManufacturer != image2Info.DriveManufacturer)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if(!options.Verbose) sb.AppendLine("Drive manufacturer differ");
|
||||
}
|
||||
if(image1Info.driveModel != image2Info.driveModel)
|
||||
if(image1Info.DriveModel != image2Info.DriveModel)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if(!options.Verbose) sb.AppendLine("Drive model differ");
|
||||
}
|
||||
if(image1Info.driveSerialNumber != image2Info.driveSerialNumber)
|
||||
if(image1Info.DriveSerialNumber != image2Info.DriveSerialNumber)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if(!options.Verbose) sb.AppendLine("Drive serial number differ");
|
||||
}
|
||||
if(image1Info.driveFirmwareRevision != image2Info.driveFirmwareRevision)
|
||||
if(image1Info.DriveFirmwareRevision != image2Info.DriveFirmwareRevision)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
if(!options.Verbose) sb.AppendLine("Drive firmware revision differ");
|
||||
}
|
||||
|
||||
ulong leastSectors;
|
||||
if(image1Info.sectors < image2Info.sectors)
|
||||
if(image1Info.Sectors < image2Info.Sectors)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
leastSectors = image1Info.sectors;
|
||||
leastSectors = image1Info.Sectors;
|
||||
if(!options.Verbose) sb.AppendLine("Image 2 has more sectors");
|
||||
}
|
||||
else if(image1Info.sectors > image2Info.sectors)
|
||||
else if(image1Info.Sectors > image2Info.Sectors)
|
||||
{
|
||||
imagesDiffer = true;
|
||||
leastSectors = image2Info.sectors;
|
||||
leastSectors = image2Info.Sectors;
|
||||
if(!options.Verbose) sb.AppendLine("Image 1 has more sectors");
|
||||
}
|
||||
else leastSectors = image1Info.sectors;
|
||||
else leastSectors = image1Info.Sectors;
|
||||
|
||||
DicConsole.WriteLine("Comparing sectors...");
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
static class Configure
|
||||
{
|
||||
internal static void doConfigure()
|
||||
internal static void DoConfigure()
|
||||
{
|
||||
ConsoleKeyInfo pressedKey = new ConsoleKeyInfo();
|
||||
|
||||
|
||||
@@ -37,14 +37,14 @@ using System.Text;
|
||||
using DiscImageChef.Console;
|
||||
using DiscImageChef.Core;
|
||||
using DiscImageChef.Filters;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.DiscImages;
|
||||
using Schemas;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
static class CreateSidecar
|
||||
{
|
||||
internal static void doSidecar(CreateSidecarOptions options)
|
||||
internal static void DoSidecar(CreateSidecarOptions options)
|
||||
{
|
||||
Sidecar.InitProgressEvent += Progress.InitProgress;
|
||||
Sidecar.UpdateProgressEvent += Progress.UpdateProgress;
|
||||
@@ -79,7 +79,7 @@ namespace DiscImageChef.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
ImagePlugin _imageFormat;
|
||||
ImagePlugin imageFormat;
|
||||
|
||||
FiltersList filtersList = new FiltersList();
|
||||
Filter inputFilter = filtersList.GetFilter(options.InputFile);
|
||||
@@ -92,9 +92,9 @@ namespace DiscImageChef.Commands
|
||||
|
||||
try
|
||||
{
|
||||
_imageFormat = ImageFormat.Detect(inputFilter);
|
||||
imageFormat = ImageFormat.Detect(inputFilter);
|
||||
|
||||
if(_imageFormat == null)
|
||||
if(imageFormat == null)
|
||||
{
|
||||
DicConsole.WriteLine("Image format not identified, not proceeding with analysis.");
|
||||
return;
|
||||
@@ -102,14 +102,14 @@ namespace DiscImageChef.Commands
|
||||
else
|
||||
{
|
||||
if(options.Verbose)
|
||||
DicConsole.VerboseWriteLine("Image format identified by {0} ({1}).", _imageFormat.Name,
|
||||
_imageFormat.PluginUUID);
|
||||
else DicConsole.WriteLine("Image format identified by {0}.", _imageFormat.Name);
|
||||
DicConsole.VerboseWriteLine("Image format identified by {0} ({1}).", imageFormat.Name,
|
||||
imageFormat.PluginUuid);
|
||||
else DicConsole.WriteLine("Image format identified by {0}.", imageFormat.Name);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if(!_imageFormat.OpenImage(inputFilter))
|
||||
if(!imageFormat.OpenImage(inputFilter))
|
||||
{
|
||||
DicConsole.WriteLine("Unable to open image format");
|
||||
DicConsole.WriteLine("No error given");
|
||||
@@ -125,11 +125,11 @@ namespace DiscImageChef.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
Core.Statistics.AddMediaFormat(_imageFormat.GetImageFormat());
|
||||
Core.Statistics.AddMediaFormat(imageFormat.GetImageFormat());
|
||||
Core.Statistics.AddFilter(inputFilter.Name);
|
||||
|
||||
CICMMetadataType sidecar =
|
||||
Sidecar.Create(_imageFormat, options.InputFile, inputFilter.UUID, encoding);
|
||||
Sidecar.Create(imageFormat, options.InputFile, inputFilter.UUID, encoding);
|
||||
|
||||
DicConsole.WriteLine("Writing metadata sidecar");
|
||||
|
||||
|
||||
@@ -33,13 +33,13 @@
|
||||
using DiscImageChef.Console;
|
||||
using DiscImageChef.Core;
|
||||
using DiscImageChef.Filters;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.DiscImages;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
static class Decode
|
||||
{
|
||||
internal static void doDecode(DecodeOptions options)
|
||||
internal static void DoDecode(DecodeOptions options)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Decode command", "--debug={0}", options.Debug);
|
||||
DicConsole.DebugWriteLine("Decode command", "--verbose={0}", options.Verbose);
|
||||
@@ -68,16 +68,16 @@ namespace DiscImageChef.Commands
|
||||
|
||||
inputFormat.OpenImage(inputFilter);
|
||||
Core.Statistics.AddMediaFormat(inputFormat.GetImageFormat());
|
||||
Core.Statistics.AddMedia(inputFormat.ImageInfo.mediaType, false);
|
||||
Core.Statistics.AddMedia(inputFormat.ImageInfo.MediaType, false);
|
||||
Core.Statistics.AddFilter(inputFilter.Name);
|
||||
|
||||
if(options.DiskTags)
|
||||
{
|
||||
if(inputFormat.ImageInfo.readableMediaTags.Count == 0)
|
||||
if(inputFormat.ImageInfo.ReadableMediaTags.Count == 0)
|
||||
DicConsole.WriteLine("There are no disk tags in chosen disc image.");
|
||||
else
|
||||
{
|
||||
foreach(MediaTagType tag in inputFormat.ImageInfo.readableMediaTags)
|
||||
foreach(MediaTagType tag in inputFormat.ImageInfo.ReadableMediaTags)
|
||||
{
|
||||
switch(tag)
|
||||
{
|
||||
@@ -245,11 +245,11 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
}
|
||||
|
||||
if(inputFormat.ImageInfo.readableSectorTags.Count == 0)
|
||||
if(inputFormat.ImageInfo.ReadableSectorTags.Count == 0)
|
||||
DicConsole.WriteLine("There are no sector tags in chosen disc image.");
|
||||
else
|
||||
{
|
||||
foreach(SectorTagType tag in inputFormat.ImageInfo.readableSectorTags)
|
||||
foreach(SectorTagType tag in inputFormat.ImageInfo.ReadableSectorTags)
|
||||
{
|
||||
switch(tag)
|
||||
{
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
static class DeviceInfo
|
||||
{
|
||||
internal static void doDeviceInfo(DeviceInfoOptions options)
|
||||
internal static void DoDeviceInfo(DeviceInfoOptions options)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Device-Info command", "--debug={0}", options.Debug);
|
||||
DicConsole.DebugWriteLine("Device-Info command", "--verbose={0}", options.Verbose);
|
||||
@@ -63,16 +63,16 @@ namespace DiscImageChef.Commands
|
||||
|
||||
Core.Statistics.AddDevice(dev);
|
||||
|
||||
if(dev.IsUSB)
|
||||
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);
|
||||
DicConsole.WriteLine("USB Manufacturer: {0}", dev.USBManufacturerString);
|
||||
DicConsole.WriteLine("USB Product: {0}", dev.USBProductString);
|
||||
DicConsole.WriteLine("USB Serial number: {0}", dev.USBSerialString);
|
||||
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);
|
||||
DicConsole.WriteLine("USB Manufacturer: {0}", dev.UsbManufacturerString);
|
||||
DicConsole.WriteLine("USB Product: {0}", dev.UsbProductString);
|
||||
DicConsole.WriteLine("USB Serial number: {0}", dev.UsbSerialString);
|
||||
DicConsole.WriteLine();
|
||||
}
|
||||
|
||||
@@ -83,15 +83,15 @@ namespace DiscImageChef.Commands
|
||||
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);
|
||||
DicConsole.WriteLine("FireWire GUID: {0:X16}", dev.FireWireGuid);
|
||||
DicConsole.WriteLine();
|
||||
}
|
||||
|
||||
if(dev.IsPCMCIA)
|
||||
if(dev.IsPcmcia)
|
||||
{
|
||||
DicConsole.WriteLine("PCMCIA device");
|
||||
DicConsole.WriteLine("PCMCIA CIS is {0} bytes", dev.CIS.Length);
|
||||
Decoders.PCMCIA.Tuple[] tuples = Decoders.PCMCIA.CIS.GetTuples(dev.CIS);
|
||||
DicConsole.WriteLine("PCMCIA CIS is {0} bytes", dev.Cis.Length);
|
||||
Decoders.PCMCIA.Tuple[] tuples = Decoders.PCMCIA.CIS.GetTuples(dev.Cis);
|
||||
if(tuples != null)
|
||||
{
|
||||
foreach(Decoders.PCMCIA.Tuple tuple in tuples)
|
||||
@@ -1285,7 +1285,7 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
if(dev.Model.StartsWith("CD-R ", StringComparison.Ordinal))
|
||||
{
|
||||
plxtSense = dev.PlextorReadEepromCDR(out plxtBuf, out senseBuf, dev.Timeout,
|
||||
plxtSense = dev.PlextorReadEepromCdr(out plxtBuf, out senseBuf, dev.Timeout,
|
||||
out duration);
|
||||
}
|
||||
break;
|
||||
@@ -1467,7 +1467,7 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.WriteLine("Drive has kreon firmware:");
|
||||
if(krFeatures.HasFlag(KreonFeatures.ChallengeResponse))
|
||||
DicConsole.WriteLine("\tCan do challenge/response with Xbox discs");
|
||||
if(krFeatures.HasFlag(KreonFeatures.DecryptSS))
|
||||
if(krFeatures.HasFlag(KreonFeatures.DecryptSs))
|
||||
DicConsole.WriteLine("\tCan read and descrypt SS from Xbox discs");
|
||||
if(krFeatures.HasFlag(KreonFeatures.XtremeUnlock))
|
||||
DicConsole.WriteLine("\tCan set xtreme unlock state with Xbox discs");
|
||||
@@ -1475,7 +1475,7 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.WriteLine("\tCan set wxripper unlock state with Xbox discs");
|
||||
if(krFeatures.HasFlag(KreonFeatures.ChallengeResponse360))
|
||||
DicConsole.WriteLine("\tCan do challenge/response with Xbox 360 discs");
|
||||
if(krFeatures.HasFlag(KreonFeatures.DecryptSS360))
|
||||
if(krFeatures.HasFlag(KreonFeatures.DecryptSs360))
|
||||
DicConsole.WriteLine("\tCan read and descrypt SS from Xbox 360 discs");
|
||||
if(krFeatures.HasFlag(KreonFeatures.XtremeUnlock360))
|
||||
DicConsole.WriteLine("\tCan set xtreme unlock state with Xbox 360 discs");
|
||||
@@ -1549,7 +1549,7 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
bool noInfo = true;
|
||||
|
||||
bool sense = dev.ReadCID(out byte[] mmcBuf, out uint[] response, dev.Timeout, out double duration);
|
||||
bool sense = dev.ReadCid(out byte[] mmcBuf, out uint[] response, dev.Timeout, out double duration);
|
||||
if(!sense)
|
||||
{
|
||||
noInfo = false;
|
||||
@@ -1557,7 +1557,7 @@ namespace DiscImageChef.Commands
|
||||
mmcBuf);
|
||||
DicConsole.WriteLine("{0}", Decoders.MMC.Decoders.PrettifyCID(mmcBuf));
|
||||
}
|
||||
sense = dev.ReadCSD(out mmcBuf, out response, dev.Timeout, out duration);
|
||||
sense = dev.ReadCsd(out mmcBuf, out response, dev.Timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
noInfo = false;
|
||||
@@ -1565,7 +1565,7 @@ namespace DiscImageChef.Commands
|
||||
mmcBuf);
|
||||
DicConsole.WriteLine("{0}", Decoders.MMC.Decoders.PrettifyCSD(mmcBuf));
|
||||
}
|
||||
sense = dev.ReadOCR(out mmcBuf, out response, dev.Timeout, out duration);
|
||||
sense = dev.ReadOcr(out mmcBuf, out response, dev.Timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
noInfo = false;
|
||||
@@ -1573,7 +1573,7 @@ namespace DiscImageChef.Commands
|
||||
mmcBuf);
|
||||
DicConsole.WriteLine("{0}", Decoders.MMC.Decoders.PrettifyOCR(mmcBuf));
|
||||
}
|
||||
sense = dev.ReadExtendedCSD(out mmcBuf, out response, dev.Timeout, out duration);
|
||||
sense = dev.ReadExtendedCsd(out mmcBuf, out response, dev.Timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
noInfo = false;
|
||||
@@ -1589,7 +1589,7 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
bool noInfo = true;
|
||||
|
||||
bool sense = dev.ReadCID(out byte[] sdBuf, out uint[] response, dev.Timeout, out double duration);
|
||||
bool sense = dev.ReadCid(out byte[] sdBuf, out uint[] response, dev.Timeout, out double duration);
|
||||
if(!sense)
|
||||
{
|
||||
noInfo = false;
|
||||
@@ -1597,7 +1597,7 @@ namespace DiscImageChef.Commands
|
||||
"SecureDigital CID", sdBuf);
|
||||
DicConsole.WriteLine("{0}", Decoders.SecureDigital.Decoders.PrettifyCID(sdBuf));
|
||||
}
|
||||
sense = dev.ReadCSD(out sdBuf, out response, dev.Timeout, out duration);
|
||||
sense = dev.ReadCsd(out sdBuf, out response, dev.Timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
noInfo = false;
|
||||
@@ -1605,7 +1605,7 @@ namespace DiscImageChef.Commands
|
||||
"SecureDigital CSD", sdBuf);
|
||||
DicConsole.WriteLine("{0}", Decoders.SecureDigital.Decoders.PrettifyCSD(sdBuf));
|
||||
}
|
||||
sense = dev.ReadSDOCR(out sdBuf, out response, dev.Timeout, out duration);
|
||||
sense = dev.ReadSdocr(out sdBuf, out response, dev.Timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
noInfo = false;
|
||||
@@ -1613,7 +1613,7 @@ namespace DiscImageChef.Commands
|
||||
"SecureDigital OCR", sdBuf);
|
||||
DicConsole.WriteLine("{0}", Decoders.SecureDigital.Decoders.PrettifyOCR(sdBuf));
|
||||
}
|
||||
sense = dev.ReadSCR(out sdBuf, out response, dev.Timeout, out duration);
|
||||
sense = dev.ReadScr(out sdBuf, out response, dev.Timeout, out duration);
|
||||
if(!sense)
|
||||
{
|
||||
noInfo = false;
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
static class DeviceReport
|
||||
{
|
||||
internal static void doDeviceReport(DeviceReportOptions options)
|
||||
internal static void DoDeviceReport(DeviceReportOptions options)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Device-Report command", "--debug={0}", options.Debug);
|
||||
DicConsole.DebugWriteLine("Device-Report command", "--verbose={0}", options.Verbose);
|
||||
@@ -76,14 +76,14 @@ namespace DiscImageChef.Commands
|
||||
switch(dev.Type)
|
||||
{
|
||||
case DeviceType.ATA:
|
||||
Core.Devices.Report.ATA.Report(dev, ref report, options.Debug, ref removable);
|
||||
Core.Devices.Report.Ata.Report(dev, ref report, options.Debug, ref removable);
|
||||
break;
|
||||
case DeviceType.MMC:
|
||||
case DeviceType.SecureDigital:
|
||||
Core.Devices.Report.SecureDigital.Report(dev, ref report, options.Debug, ref removable);
|
||||
break;
|
||||
case DeviceType.NVMe:
|
||||
Core.Devices.Report.NVMe.Report(dev, ref report, options.Debug, ref removable);
|
||||
Core.Devices.Report.Nvme.Report(dev, ref report, options.Debug, ref removable);
|
||||
break;
|
||||
case DeviceType.ATAPI:
|
||||
case DeviceType.SCSI:
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
static class DumpMedia
|
||||
{
|
||||
internal static void doDumpMedia(DumpMediaOptions options)
|
||||
internal static void DoDumpMedia(DumpMediaOptions options)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Dump-Media command", "--debug={0}", options.Debug);
|
||||
DicConsole.DebugWriteLine("Dump-Media command", "--verbose={0}", options.Verbose);
|
||||
@@ -121,7 +121,7 @@ namespace DiscImageChef.Commands
|
||||
switch(dev.Type)
|
||||
{
|
||||
case DeviceType.ATA:
|
||||
ATA.Dump(dev, options.DevicePath, options.OutputPrefix, options.RetryPasses, options.Force,
|
||||
Ata.Dump(dev, options.DevicePath, options.OutputPrefix, options.RetryPasses, options.Force,
|
||||
options.Raw, options.Persistent, options.StopOnError, ref resume, ref dumpLog, encoding);
|
||||
break;
|
||||
case DeviceType.MMC:
|
||||
@@ -131,12 +131,12 @@ namespace DiscImageChef.Commands
|
||||
ref dumpLog, encoding);
|
||||
break;
|
||||
case DeviceType.NVMe:
|
||||
NVMe.Dump(dev, options.DevicePath, options.OutputPrefix, options.RetryPasses, options.Force,
|
||||
NvMe.Dump(dev, options.DevicePath, options.OutputPrefix, options.RetryPasses, options.Force,
|
||||
options.Raw, options.Persistent, options.StopOnError, ref resume, ref dumpLog, encoding);
|
||||
break;
|
||||
case DeviceType.ATAPI:
|
||||
case DeviceType.SCSI:
|
||||
SCSI.Dump(dev, options.DevicePath, options.OutputPrefix, options.RetryPasses, options.Force,
|
||||
Scsi.Dump(dev, options.DevicePath, options.OutputPrefix, options.RetryPasses, options.Force,
|
||||
options.Raw, options.Persistent, options.StopOnError, options.SeparateSubchannel,
|
||||
ref resume, ref dumpLog, options.LeadIn, encoding);
|
||||
break;
|
||||
|
||||
@@ -36,13 +36,13 @@ using DiscImageChef.Checksums;
|
||||
using DiscImageChef.Console;
|
||||
using DiscImageChef.Core;
|
||||
using DiscImageChef.Filters;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.DiscImages;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
static class Entropy
|
||||
{
|
||||
internal static void doEntropy(EntropyOptions options)
|
||||
internal static void DoEntropy(EntropyOptions options)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Entropy command", "--debug={0}", options.Debug);
|
||||
DicConsole.DebugWriteLine("Entropy command", "--verbose={0}", options.Verbose);
|
||||
@@ -70,7 +70,7 @@ namespace DiscImageChef.Commands
|
||||
|
||||
inputFormat.OpenImage(inputFilter);
|
||||
Core.Statistics.AddMediaFormat(inputFormat.GetImageFormat());
|
||||
Core.Statistics.AddMedia(inputFormat.ImageInfo.mediaType, false);
|
||||
Core.Statistics.AddMedia(inputFormat.ImageInfo.MediaType, false);
|
||||
Core.Statistics.AddFilter(inputFilter.Name);
|
||||
|
||||
if(options.SeparatedTracks)
|
||||
@@ -81,7 +81,7 @@ namespace DiscImageChef.Commands
|
||||
|
||||
foreach(Track currentTrack in inputTracks)
|
||||
{
|
||||
SHA1Context sha1ctxTrack = new SHA1Context();
|
||||
Sha1Context sha1CtxTrack = new Sha1Context();
|
||||
ulong[] entTable = new ulong[256];
|
||||
ulong trackSize = 0;
|
||||
List<string> uniqueSectorsPerTrack = new List<string>();
|
||||
@@ -97,7 +97,7 @@ namespace DiscImageChef.Commands
|
||||
if(options.DuplicatedSectors)
|
||||
{
|
||||
byte[] garbage;
|
||||
string sectorHash = sha1ctxTrack.Data(sector, out garbage);
|
||||
string sectorHash = sha1CtxTrack.Data(sector, out garbage);
|
||||
if(!uniqueSectorsPerTrack.Contains(sectorHash)) uniqueSectorsPerTrack.Add(sectorHash);
|
||||
}
|
||||
|
||||
@@ -136,7 +136,7 @@ namespace DiscImageChef.Commands
|
||||
|
||||
if(options.WholeDisc)
|
||||
{
|
||||
SHA1Context sha1Ctx = new SHA1Context();
|
||||
Sha1Context sha1Ctx = new Sha1Context();
|
||||
ulong[] entTable = new ulong[256];
|
||||
ulong diskSize = 0;
|
||||
List<string> uniqueSectors = new List<string>();
|
||||
|
||||
@@ -39,14 +39,14 @@ using DiscImageChef.Console;
|
||||
using DiscImageChef.Core;
|
||||
using DiscImageChef.Filesystems;
|
||||
using DiscImageChef.Filters;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.DiscImages;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
// TODO: Rewrite this, has an insane amount of repeating code ;)
|
||||
static class ExtractFiles
|
||||
{
|
||||
internal static void doExtractFiles(ExtractFilesOptions options)
|
||||
internal static void DoExtractFiles(ExtractFilesOptions options)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Extract-Files command", "--debug={0}", options.Debug);
|
||||
DicConsole.DebugWriteLine("Extract-Files command", "--verbose={0}", options.Verbose);
|
||||
@@ -83,16 +83,16 @@ namespace DiscImageChef.Commands
|
||||
PluginBase plugins = new PluginBase();
|
||||
plugins.RegisterAllPlugins(encoding);
|
||||
|
||||
List<string> id_plugins;
|
||||
Filesystem _plugin;
|
||||
ImagePlugin _imageFormat;
|
||||
List<string> idPlugins;
|
||||
Filesystem plugin;
|
||||
ImagePlugin imageFormat;
|
||||
Errno error;
|
||||
|
||||
try
|
||||
{
|
||||
_imageFormat = ImageFormat.Detect(inputFilter);
|
||||
imageFormat = ImageFormat.Detect(inputFilter);
|
||||
|
||||
if(_imageFormat == null)
|
||||
if(imageFormat == null)
|
||||
{
|
||||
DicConsole.WriteLine("Image format not identified, not proceeding with analysis.");
|
||||
return;
|
||||
@@ -100,9 +100,9 @@ namespace DiscImageChef.Commands
|
||||
else
|
||||
{
|
||||
if(options.Verbose)
|
||||
DicConsole.VerboseWriteLine("Image format identified by {0} ({1}).", _imageFormat.Name,
|
||||
_imageFormat.PluginUUID);
|
||||
else DicConsole.WriteLine("Image format identified by {0}.", _imageFormat.Name);
|
||||
DicConsole.VerboseWriteLine("Image format identified by {0} ({1}).", imageFormat.Name,
|
||||
imageFormat.PluginUuid);
|
||||
else DicConsole.WriteLine("Image format identified by {0}.", imageFormat.Name);
|
||||
}
|
||||
|
||||
if(Directory.Exists(options.OutputDir) || File.Exists(options.OutputDir))
|
||||
@@ -115,7 +115,7 @@ namespace DiscImageChef.Commands
|
||||
|
||||
try
|
||||
{
|
||||
if(!_imageFormat.OpenImage(inputFilter))
|
||||
if(!imageFormat.OpenImage(inputFilter))
|
||||
{
|
||||
DicConsole.WriteLine("Unable to open image format");
|
||||
DicConsole.WriteLine("No error given");
|
||||
@@ -124,14 +124,14 @@ namespace DiscImageChef.Commands
|
||||
|
||||
DicConsole.DebugWriteLine("Extract-Files command", "Correctly opened image file.");
|
||||
DicConsole.DebugWriteLine("Extract-Files command", "Image without headers is {0} bytes.",
|
||||
_imageFormat.GetImageSize());
|
||||
imageFormat.GetImageSize());
|
||||
DicConsole.DebugWriteLine("Extract-Files command", "Image has {0} sectors.",
|
||||
_imageFormat.GetSectors());
|
||||
imageFormat.GetSectors());
|
||||
DicConsole.DebugWriteLine("Extract-Files command", "Image identifies disk type as {0}.",
|
||||
_imageFormat.GetMediaType());
|
||||
imageFormat.GetMediaType());
|
||||
|
||||
Core.Statistics.AddMediaFormat(_imageFormat.GetImageFormat());
|
||||
Core.Statistics.AddMedia(_imageFormat.ImageInfo.mediaType, false);
|
||||
Core.Statistics.AddMediaFormat(imageFormat.GetImageFormat());
|
||||
Core.Statistics.AddMedia(imageFormat.ImageInfo.MediaType, false);
|
||||
Core.Statistics.AddFilter(inputFilter.Name);
|
||||
}
|
||||
catch(Exception ex)
|
||||
@@ -141,8 +141,8 @@ namespace DiscImageChef.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
List<Partition> partitions = Partitions.GetAll(_imageFormat);
|
||||
Partitions.AddSchemesToStats(partitions);
|
||||
List<Partition> partitions = Core.Partitions.GetAll(imageFormat);
|
||||
Core.Partitions.AddSchemesToStats(partitions);
|
||||
|
||||
if(partitions.Count == 0) DicConsole.DebugWriteLine("Extract-Files command", "No partitions found");
|
||||
else
|
||||
@@ -156,22 +156,22 @@ namespace DiscImageChef.Commands
|
||||
|
||||
DicConsole.WriteLine("Identifying filesystem on partition");
|
||||
|
||||
Core.Filesystems.Identify(_imageFormat, out id_plugins, partitions[i]);
|
||||
if(id_plugins.Count == 0) DicConsole.WriteLine("Filesystem not identified");
|
||||
else if(id_plugins.Count > 1)
|
||||
Core.Filesystems.Identify(imageFormat, out idPlugins, partitions[i]);
|
||||
if(idPlugins.Count == 0) DicConsole.WriteLine("Filesystem not identified");
|
||||
else if(idPlugins.Count > 1)
|
||||
{
|
||||
DicConsole.WriteLine(string.Format("Identified by {0} plugins", id_plugins.Count));
|
||||
DicConsole.WriteLine(string.Format("Identified by {0} plugins", idPlugins.Count));
|
||||
|
||||
foreach(string plugin_name in id_plugins)
|
||||
foreach(string pluginName in idPlugins)
|
||||
{
|
||||
if(plugins.PluginsList.TryGetValue(plugin_name, out _plugin))
|
||||
if(plugins.PluginsList.TryGetValue(pluginName, out plugin))
|
||||
{
|
||||
DicConsole.WriteLine(string.Format("As identified by {0}.", _plugin.Name));
|
||||
Filesystem fs = (Filesystem)_plugin
|
||||
DicConsole.WriteLine(string.Format("As identified by {0}.", plugin.Name));
|
||||
Filesystem fs = (Filesystem)plugin
|
||||
.GetType().GetConstructor(new Type[]
|
||||
{
|
||||
typeof(ImagePlugin), typeof(Partition), typeof(System.Text.Encoding)
|
||||
}).Invoke(new object[] {_imageFormat, partitions[i], null});
|
||||
}).Invoke(new object[] {imageFormat, partitions[i], null});
|
||||
|
||||
error = fs.Mount(options.Debug);
|
||||
if(error == Errno.NoError)
|
||||
@@ -319,13 +319,13 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
else
|
||||
{
|
||||
plugins.PluginsList.TryGetValue(id_plugins[0], out _plugin);
|
||||
DicConsole.WriteLine(string.Format("Identified by {0}.", _plugin.Name));
|
||||
Filesystem fs = (Filesystem)_plugin
|
||||
plugins.PluginsList.TryGetValue(idPlugins[0], out plugin);
|
||||
DicConsole.WriteLine(string.Format("Identified by {0}.", plugin.Name));
|
||||
Filesystem fs = (Filesystem)plugin
|
||||
.GetType().GetConstructor(new Type[]
|
||||
{
|
||||
typeof(ImagePlugin), typeof(Partition), typeof(System.Text.Encoding)
|
||||
}).Invoke(new object[] {_imageFormat, partitions[i], null});
|
||||
}).Invoke(new object[] {imageFormat, partitions[i], null});
|
||||
error = fs.Mount(options.Debug);
|
||||
if(error == Errno.NoError)
|
||||
{
|
||||
@@ -454,26 +454,26 @@ namespace DiscImageChef.Commands
|
||||
Partition wholePart = new Partition
|
||||
{
|
||||
Name = "Whole device",
|
||||
Length = _imageFormat.GetSectors(),
|
||||
Size = _imageFormat.GetSectors() * _imageFormat.GetSectorSize()
|
||||
Length = imageFormat.GetSectors(),
|
||||
Size = imageFormat.GetSectors() * imageFormat.GetSectorSize()
|
||||
};
|
||||
|
||||
Core.Filesystems.Identify(_imageFormat, out id_plugins, wholePart);
|
||||
if(id_plugins.Count == 0) DicConsole.WriteLine("Filesystem not identified");
|
||||
else if(id_plugins.Count > 1)
|
||||
Core.Filesystems.Identify(imageFormat, out idPlugins, wholePart);
|
||||
if(idPlugins.Count == 0) DicConsole.WriteLine("Filesystem not identified");
|
||||
else if(idPlugins.Count > 1)
|
||||
{
|
||||
DicConsole.WriteLine(string.Format("Identified by {0} plugins", id_plugins.Count));
|
||||
DicConsole.WriteLine(string.Format("Identified by {0} plugins", idPlugins.Count));
|
||||
|
||||
foreach(string plugin_name in id_plugins)
|
||||
foreach(string pluginName in idPlugins)
|
||||
{
|
||||
if(plugins.PluginsList.TryGetValue(plugin_name, out _plugin))
|
||||
if(plugins.PluginsList.TryGetValue(pluginName, out plugin))
|
||||
{
|
||||
DicConsole.WriteLine(string.Format("As identified by {0}.", _plugin.Name));
|
||||
Filesystem fs = (Filesystem)_plugin
|
||||
DicConsole.WriteLine(string.Format("As identified by {0}.", plugin.Name));
|
||||
Filesystem fs = (Filesystem)plugin
|
||||
.GetType().GetConstructor(new Type[]
|
||||
{
|
||||
typeof(ImagePlugin), typeof(Partition), typeof(System.Text.Encoding)
|
||||
}).Invoke(new object[] {_imageFormat, wholePart, null});
|
||||
}).Invoke(new object[] {imageFormat, wholePart, null});
|
||||
error = fs.Mount(options.Debug);
|
||||
if(error == Errno.NoError)
|
||||
{
|
||||
@@ -600,13 +600,13 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
else
|
||||
{
|
||||
plugins.PluginsList.TryGetValue(id_plugins[0], out _plugin);
|
||||
DicConsole.WriteLine(string.Format("Identified by {0}.", _plugin.Name));
|
||||
Filesystem fs = (Filesystem)_plugin
|
||||
plugins.PluginsList.TryGetValue(idPlugins[0], out plugin);
|
||||
DicConsole.WriteLine(string.Format("Identified by {0}.", plugin.Name));
|
||||
Filesystem fs = (Filesystem)plugin
|
||||
.GetType().GetConstructor(new Type[]
|
||||
{
|
||||
typeof(ImagePlugin), typeof(Partition), typeof(System.Text.Encoding)
|
||||
}).Invoke(new object[] {_imageFormat, wholePart, null});
|
||||
}).Invoke(new object[] {imageFormat, wholePart, null});
|
||||
error = fs.Mount(options.Debug);
|
||||
if(error == Errno.NoError)
|
||||
{
|
||||
|
||||
@@ -35,54 +35,54 @@ using DiscImageChef.Console;
|
||||
using DiscImageChef.Core;
|
||||
using DiscImageChef.Filesystems;
|
||||
using DiscImageChef.Filters;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.PartPlugins;
|
||||
using DiscImageChef.DiscImages;
|
||||
using DiscImageChef.Partitions;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
static class Formats
|
||||
{
|
||||
internal static void ListFormats(FormatsOptions FormatsOptions)
|
||||
internal static void ListFormats(FormatsOptions formatsOptions)
|
||||
{
|
||||
PluginBase plugins = new PluginBase();
|
||||
plugins.RegisterAllPlugins();
|
||||
FiltersList filtersList = new FiltersList();
|
||||
|
||||
DicConsole.WriteLine("Supported filters:");
|
||||
if(FormatsOptions.Verbose) DicConsole.VerboseWriteLine("GUID\t\t\t\t\tFilter");
|
||||
if(formatsOptions.Verbose) DicConsole.VerboseWriteLine("GUID\t\t\t\t\tFilter");
|
||||
foreach(KeyValuePair<string, Filter> kvp in filtersList.filtersList)
|
||||
{
|
||||
if(FormatsOptions.Verbose) DicConsole.VerboseWriteLine("{0}\t{1}", kvp.Value.UUID, kvp.Value.Name);
|
||||
if(formatsOptions.Verbose) DicConsole.VerboseWriteLine("{0}\t{1}", kvp.Value.UUID, kvp.Value.Name);
|
||||
else DicConsole.WriteLine(kvp.Value.Name);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine();
|
||||
DicConsole.WriteLine("Supported disc image formats:");
|
||||
if(FormatsOptions.Verbose) DicConsole.VerboseWriteLine("GUID\t\t\t\t\tPlugin");
|
||||
if(formatsOptions.Verbose) DicConsole.VerboseWriteLine("GUID\t\t\t\t\tPlugin");
|
||||
foreach(KeyValuePair<string, ImagePlugin> kvp in plugins.ImagePluginsList)
|
||||
{
|
||||
if(FormatsOptions.Verbose)
|
||||
DicConsole.VerboseWriteLine("{0}\t{1}", kvp.Value.PluginUUID, kvp.Value.Name);
|
||||
if(formatsOptions.Verbose)
|
||||
DicConsole.VerboseWriteLine("{0}\t{1}", kvp.Value.PluginUuid, kvp.Value.Name);
|
||||
else DicConsole.WriteLine(kvp.Value.Name);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine();
|
||||
DicConsole.WriteLine("Supported filesystems:");
|
||||
if(FormatsOptions.Verbose) DicConsole.VerboseWriteLine("GUID\t\t\t\t\tPlugin");
|
||||
if(formatsOptions.Verbose) DicConsole.VerboseWriteLine("GUID\t\t\t\t\tPlugin");
|
||||
foreach(KeyValuePair<string, Filesystem> kvp in plugins.PluginsList)
|
||||
{
|
||||
if(FormatsOptions.Verbose)
|
||||
if(formatsOptions.Verbose)
|
||||
DicConsole.VerboseWriteLine("{0}\t{1}", kvp.Value.PluginUUID, kvp.Value.Name);
|
||||
else DicConsole.WriteLine(kvp.Value.Name);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine();
|
||||
DicConsole.WriteLine("Supported partitioning schemes:");
|
||||
if(FormatsOptions.Verbose) DicConsole.VerboseWriteLine("GUID\t\t\t\t\tPlugin");
|
||||
foreach(KeyValuePair<string, PartPlugin> kvp in plugins.PartPluginsList)
|
||||
if(formatsOptions.Verbose) DicConsole.VerboseWriteLine("GUID\t\t\t\t\tPlugin");
|
||||
foreach(KeyValuePair<string, PartitionPlugin> kvp in plugins.PartPluginsList)
|
||||
{
|
||||
if(FormatsOptions.Verbose)
|
||||
DicConsole.VerboseWriteLine("{0}\t{1}", kvp.Value.PluginUUID, kvp.Value.Name);
|
||||
if(formatsOptions.Verbose)
|
||||
DicConsole.VerboseWriteLine("{0}\t{1}", kvp.Value.PluginUuid, kvp.Value.Name);
|
||||
else DicConsole.WriteLine(kvp.Value.Name);
|
||||
}
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
static class ListDevices
|
||||
{
|
||||
internal static void doListDevices(ListDevicesOptions options)
|
||||
internal static void DoListDevices(ListDevicesOptions options)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "--debug={0}", options.Debug);
|
||||
DicConsole.DebugWriteLine("Media-Info command", "--verbose={0}", options.Verbose);
|
||||
@@ -48,7 +48,7 @@ namespace DiscImageChef.Commands
|
||||
if(devices == null || devices.Length == 0) DicConsole.WriteLine("No known devices attached.");
|
||||
else
|
||||
{
|
||||
devices = devices.OrderBy(d => d.path).ToArray();
|
||||
devices = devices.OrderBy(d => d.Path).ToArray();
|
||||
|
||||
DicConsole.WriteLine("{0,-22}|{1,-16}|{2,-24}|{3,-24}|{4,-10}|{5,-10}", "Path", "Vendor", "Model",
|
||||
"Serial", "Bus", "Supported?");
|
||||
@@ -56,8 +56,8 @@ namespace DiscImageChef.Commands
|
||||
"----------------", "------------------------", "------------------------",
|
||||
"----------", "----------");
|
||||
foreach(Devices.DeviceInfo dev in devices)
|
||||
DicConsole.WriteLine("{0,-22}|{1,-16}|{2,-24}|{3,-24}|{4,-10}|{5,-10}", dev.path, dev.vendor,
|
||||
dev.model, dev.serial, dev.bus, dev.supported);
|
||||
DicConsole.WriteLine("{0,-22}|{1,-16}|{2,-24}|{3,-24}|{4,-10}|{5,-10}", dev.Path, dev.Vendor,
|
||||
dev.Model, dev.Serial, dev.Bus, dev.Supported);
|
||||
}
|
||||
|
||||
Core.Statistics.AddCommand("list-devices");
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace DiscImageChef.Commands
|
||||
public string DisplayName;
|
||||
}
|
||||
|
||||
internal static void DoList(ListEncodingsOptions EncodingOptions)
|
||||
internal static void DoList(ListEncodingsOptions encodingOptions)
|
||||
{
|
||||
List<CommonEncodingInfo> encodings = new List<CommonEncodingInfo>();
|
||||
|
||||
|
||||
@@ -38,13 +38,13 @@ using DiscImageChef.Console;
|
||||
using DiscImageChef.Core;
|
||||
using DiscImageChef.Filesystems;
|
||||
using DiscImageChef.Filters;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.DiscImages;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
static class Ls
|
||||
{
|
||||
internal static void doLs(LsOptions options)
|
||||
internal static void DoLs(LsOptions options)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Ls command", "--debug={0}", options.Debug);
|
||||
DicConsole.DebugWriteLine("Ls command", "--verbose={0}", options.Verbose);
|
||||
@@ -79,16 +79,16 @@ namespace DiscImageChef.Commands
|
||||
PluginBase plugins = new PluginBase();
|
||||
plugins.RegisterAllPlugins(encoding);
|
||||
|
||||
List<string> id_plugins;
|
||||
Filesystem _plugin;
|
||||
ImagePlugin _imageFormat;
|
||||
List<string> idPlugins;
|
||||
Filesystem plugin;
|
||||
ImagePlugin imageFormat;
|
||||
Errno error;
|
||||
|
||||
try
|
||||
{
|
||||
_imageFormat = ImageFormat.Detect(inputFilter);
|
||||
imageFormat = ImageFormat.Detect(inputFilter);
|
||||
|
||||
if(_imageFormat == null)
|
||||
if(imageFormat == null)
|
||||
{
|
||||
DicConsole.WriteLine("Image format not identified, not proceeding with analysis.");
|
||||
return;
|
||||
@@ -96,14 +96,14 @@ namespace DiscImageChef.Commands
|
||||
else
|
||||
{
|
||||
if(options.Verbose)
|
||||
DicConsole.VerboseWriteLine("Image format identified by {0} ({1}).", _imageFormat.Name,
|
||||
_imageFormat.PluginUUID);
|
||||
else DicConsole.WriteLine("Image format identified by {0}.", _imageFormat.Name);
|
||||
DicConsole.VerboseWriteLine("Image format identified by {0} ({1}).", imageFormat.Name,
|
||||
imageFormat.PluginUuid);
|
||||
else DicConsole.WriteLine("Image format identified by {0}.", imageFormat.Name);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if(!_imageFormat.OpenImage(inputFilter))
|
||||
if(!imageFormat.OpenImage(inputFilter))
|
||||
{
|
||||
DicConsole.WriteLine("Unable to open image format");
|
||||
DicConsole.WriteLine("No error given");
|
||||
@@ -112,13 +112,13 @@ namespace DiscImageChef.Commands
|
||||
|
||||
DicConsole.DebugWriteLine("Ls command", "Correctly opened image file.");
|
||||
DicConsole.DebugWriteLine("Ls command", "Image without headers is {0} bytes.",
|
||||
_imageFormat.GetImageSize());
|
||||
DicConsole.DebugWriteLine("Ls command", "Image has {0} sectors.", _imageFormat.GetSectors());
|
||||
imageFormat.GetImageSize());
|
||||
DicConsole.DebugWriteLine("Ls command", "Image has {0} sectors.", imageFormat.GetSectors());
|
||||
DicConsole.DebugWriteLine("Ls command", "Image identifies disk type as {0}.",
|
||||
_imageFormat.GetMediaType());
|
||||
imageFormat.GetMediaType());
|
||||
|
||||
Core.Statistics.AddMediaFormat(_imageFormat.GetImageFormat());
|
||||
Core.Statistics.AddMedia(_imageFormat.ImageInfo.mediaType, false);
|
||||
Core.Statistics.AddMediaFormat(imageFormat.GetImageFormat());
|
||||
Core.Statistics.AddMedia(imageFormat.ImageInfo.MediaType, false);
|
||||
Core.Statistics.AddFilter(inputFilter.Name);
|
||||
}
|
||||
catch(Exception ex)
|
||||
@@ -128,8 +128,8 @@ namespace DiscImageChef.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
List<Partition> partitions = Partitions.GetAll(_imageFormat);
|
||||
Partitions.AddSchemesToStats(partitions);
|
||||
List<Partition> partitions = Core.Partitions.GetAll(imageFormat);
|
||||
Core.Partitions.AddSchemesToStats(partitions);
|
||||
|
||||
if(partitions.Count == 0) DicConsole.DebugWriteLine("Ls command", "No partitions found");
|
||||
else
|
||||
@@ -143,22 +143,22 @@ namespace DiscImageChef.Commands
|
||||
|
||||
DicConsole.WriteLine("Identifying filesystem on partition");
|
||||
|
||||
Core.Filesystems.Identify(_imageFormat, out id_plugins, partitions[i]);
|
||||
if(id_plugins.Count == 0) DicConsole.WriteLine("Filesystem not identified");
|
||||
else if(id_plugins.Count > 1)
|
||||
Core.Filesystems.Identify(imageFormat, out idPlugins, partitions[i]);
|
||||
if(idPlugins.Count == 0) DicConsole.WriteLine("Filesystem not identified");
|
||||
else if(idPlugins.Count > 1)
|
||||
{
|
||||
DicConsole.WriteLine(string.Format("Identified by {0} plugins", id_plugins.Count));
|
||||
DicConsole.WriteLine(string.Format("Identified by {0} plugins", idPlugins.Count));
|
||||
|
||||
foreach(string plugin_name in id_plugins)
|
||||
foreach(string pluginName in idPlugins)
|
||||
{
|
||||
if(plugins.PluginsList.TryGetValue(plugin_name, out _plugin))
|
||||
if(plugins.PluginsList.TryGetValue(pluginName, out plugin))
|
||||
{
|
||||
DicConsole.WriteLine(string.Format("As identified by {0}.", _plugin.Name));
|
||||
Filesystem fs = (Filesystem)_plugin
|
||||
DicConsole.WriteLine(string.Format("As identified by {0}.", plugin.Name));
|
||||
Filesystem fs = (Filesystem)plugin
|
||||
.GetType().GetConstructor(new Type[]
|
||||
{
|
||||
typeof(ImagePlugin), typeof(Partition), typeof(System.Text.Encoding)
|
||||
}).Invoke(new object[] {_imageFormat, partitions[i], null});
|
||||
}).Invoke(new object[] {imageFormat, partitions[i], null});
|
||||
|
||||
error = fs.Mount(options.Debug);
|
||||
if(error == Errno.NoError)
|
||||
@@ -183,13 +183,13 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
else
|
||||
{
|
||||
plugins.PluginsList.TryGetValue(id_plugins[0], out _plugin);
|
||||
DicConsole.WriteLine(string.Format("Identified by {0}.", _plugin.Name));
|
||||
Filesystem fs = (Filesystem)_plugin
|
||||
plugins.PluginsList.TryGetValue(idPlugins[0], out plugin);
|
||||
DicConsole.WriteLine(string.Format("Identified by {0}.", plugin.Name));
|
||||
Filesystem fs = (Filesystem)plugin
|
||||
.GetType().GetConstructor(new Type[]
|
||||
{
|
||||
typeof(ImagePlugin), typeof(Partition), typeof(System.Text.Encoding)
|
||||
}).Invoke(new object[] {_imageFormat, partitions[i], null});
|
||||
}).Invoke(new object[] {imageFormat, partitions[i], null});
|
||||
error = fs.Mount(options.Debug);
|
||||
if(error == Errno.NoError)
|
||||
{
|
||||
@@ -212,26 +212,26 @@ namespace DiscImageChef.Commands
|
||||
Partition wholePart = new Partition
|
||||
{
|
||||
Name = "Whole device",
|
||||
Length = _imageFormat.GetSectors(),
|
||||
Size = _imageFormat.GetSectors() * _imageFormat.GetSectorSize()
|
||||
Length = imageFormat.GetSectors(),
|
||||
Size = imageFormat.GetSectors() * imageFormat.GetSectorSize()
|
||||
};
|
||||
|
||||
Core.Filesystems.Identify(_imageFormat, out id_plugins, wholePart);
|
||||
if(id_plugins.Count == 0) DicConsole.WriteLine("Filesystem not identified");
|
||||
else if(id_plugins.Count > 1)
|
||||
Core.Filesystems.Identify(imageFormat, out idPlugins, wholePart);
|
||||
if(idPlugins.Count == 0) DicConsole.WriteLine("Filesystem not identified");
|
||||
else if(idPlugins.Count > 1)
|
||||
{
|
||||
DicConsole.WriteLine(string.Format("Identified by {0} plugins", id_plugins.Count));
|
||||
DicConsole.WriteLine(string.Format("Identified by {0} plugins", idPlugins.Count));
|
||||
|
||||
foreach(string plugin_name in id_plugins)
|
||||
foreach(string pluginName in idPlugins)
|
||||
{
|
||||
if(plugins.PluginsList.TryGetValue(plugin_name, out _plugin))
|
||||
if(plugins.PluginsList.TryGetValue(pluginName, out plugin))
|
||||
{
|
||||
DicConsole.WriteLine(string.Format("As identified by {0}.", _plugin.Name));
|
||||
Filesystem fs = (Filesystem)_plugin
|
||||
DicConsole.WriteLine(string.Format("As identified by {0}.", plugin.Name));
|
||||
Filesystem fs = (Filesystem)plugin
|
||||
.GetType().GetConstructor(new Type[]
|
||||
{
|
||||
typeof(ImagePlugin), typeof(Partition), typeof(System.Text.Encoding)
|
||||
}).Invoke(new object[] {_imageFormat, wholePart, null});
|
||||
}).Invoke(new object[] {imageFormat, wholePart, null});
|
||||
error = fs.Mount(options.Debug);
|
||||
if(error == Errno.NoError)
|
||||
{
|
||||
@@ -252,13 +252,13 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
else
|
||||
{
|
||||
plugins.PluginsList.TryGetValue(id_plugins[0], out _plugin);
|
||||
DicConsole.WriteLine(string.Format("Identified by {0}.", _plugin.Name));
|
||||
Filesystem fs = (Filesystem)_plugin
|
||||
plugins.PluginsList.TryGetValue(idPlugins[0], out plugin);
|
||||
DicConsole.WriteLine(string.Format("Identified by {0}.", plugin.Name));
|
||||
Filesystem fs = (Filesystem)plugin
|
||||
.GetType().GetConstructor(new Type[]
|
||||
{
|
||||
typeof(ImagePlugin), typeof(Partition), typeof(System.Text.Encoding)
|
||||
}).Invoke(new object[] {_imageFormat, wholePart, null});
|
||||
}).Invoke(new object[] {imageFormat, wholePart, null});
|
||||
error = fs.Mount(options.Debug);
|
||||
if(error == Errno.NoError)
|
||||
{
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
static class MediaInfo
|
||||
{
|
||||
internal static void doMediaInfo(MediaInfoOptions options)
|
||||
internal static void DoMediaInfo(MediaInfoOptions options)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Info command", "--debug={0}", options.Debug);
|
||||
DicConsole.DebugWriteLine("Media-Info command", "--verbose={0}", options.Verbose);
|
||||
@@ -67,18 +67,18 @@ namespace DiscImageChef.Commands
|
||||
switch(dev.Type)
|
||||
{
|
||||
case DeviceType.ATA:
|
||||
doATAMediaInfo(options.OutputPrefix, dev);
|
||||
DoAtaMediaInfo(options.OutputPrefix, dev);
|
||||
break;
|
||||
case DeviceType.MMC:
|
||||
case DeviceType.SecureDigital:
|
||||
doSDMediaInfo(options.OutputPrefix, dev);
|
||||
DoSdMediaInfo(options.OutputPrefix, dev);
|
||||
break;
|
||||
case DeviceType.NVMe:
|
||||
doNVMeMediaInfo(options.OutputPrefix, dev);
|
||||
DoNvmeMediaInfo(options.OutputPrefix, dev);
|
||||
break;
|
||||
case DeviceType.ATAPI:
|
||||
case DeviceType.SCSI:
|
||||
doSCSIMediaInfo(options.OutputPrefix, dev);
|
||||
DoScsiMediaInfo(options.OutputPrefix, dev);
|
||||
break;
|
||||
default: throw new NotSupportedException("Unknown device type.");
|
||||
}
|
||||
@@ -86,22 +86,22 @@ namespace DiscImageChef.Commands
|
||||
Core.Statistics.AddCommand("media-info");
|
||||
}
|
||||
|
||||
static void doATAMediaInfo(string outputPrefix, Device dev)
|
||||
static void DoAtaMediaInfo(string outputPrefix, Device dev)
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Please use device-info command for ATA devices.");
|
||||
}
|
||||
|
||||
static void doNVMeMediaInfo(string outputPrefix, Device dev)
|
||||
static void DoNvmeMediaInfo(string outputPrefix, Device dev)
|
||||
{
|
||||
throw new NotImplementedException("NVMe devices not yet supported.");
|
||||
}
|
||||
|
||||
static void doSDMediaInfo(string outputPrefix, Device dev)
|
||||
static void DoSdMediaInfo(string outputPrefix, Device dev)
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Please use device-info command for MMC/SD devices.");
|
||||
}
|
||||
|
||||
static void doSCSIMediaInfo(string outputPrefix, Device dev)
|
||||
static void DoScsiMediaInfo(string outputPrefix, Device dev)
|
||||
{
|
||||
byte[] cmdBuf;
|
||||
byte[] senseBuf;
|
||||
@@ -184,7 +184,7 @@ namespace DiscImageChef.Commands
|
||||
|
||||
byte[] modeBuf;
|
||||
Decoders.SCSI.Modes.DecodedMode? decMode = null;
|
||||
Decoders.SCSI.PeripheralDeviceTypes devType = dev.SCSIType;
|
||||
Decoders.SCSI.PeripheralDeviceTypes devType = dev.ScsiType;
|
||||
|
||||
sense = dev.ModeSense10(out modeBuf, out senseBuf, false, true, ScsiModeSensePageControl.Current, 0x3F,
|
||||
0xFF, 5, out duration);
|
||||
@@ -225,12 +225,12 @@ namespace DiscImageChef.Commands
|
||||
containsFloppyPage |= modePage.Page == 0x05;
|
||||
}
|
||||
|
||||
if(dev.SCSIType == Decoders.SCSI.PeripheralDeviceTypes.DirectAccess ||
|
||||
dev.SCSIType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice ||
|
||||
dev.SCSIType == Decoders.SCSI.PeripheralDeviceTypes.OCRWDevice ||
|
||||
dev.SCSIType == Decoders.SCSI.PeripheralDeviceTypes.OpticalDevice ||
|
||||
dev.SCSIType == Decoders.SCSI.PeripheralDeviceTypes.SimplifiedDevice ||
|
||||
dev.SCSIType == Decoders.SCSI.PeripheralDeviceTypes.WriteOnceDevice)
|
||||
if(dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.DirectAccess ||
|
||||
dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice ||
|
||||
dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.OCRWDevice ||
|
||||
dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.OpticalDevice ||
|
||||
dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.SimplifiedDevice ||
|
||||
dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.WriteOnceDevice)
|
||||
{
|
||||
sense = dev.ReadCapacity(out cmdBuf, out senseBuf, dev.Timeout, out duration);
|
||||
if(!sense)
|
||||
@@ -248,7 +248,7 @@ namespace DiscImageChef.Commands
|
||||
if(sense && blocks == 0)
|
||||
{
|
||||
// Not all MMC devices support READ CAPACITY, as they have READ TOC
|
||||
if(dev.SCSIType != Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
||||
if(dev.ScsiType != Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Unable to get media capacity");
|
||||
DicConsole.ErrorWriteLine("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
@@ -276,7 +276,7 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
}
|
||||
|
||||
if(dev.SCSIType == Decoders.SCSI.PeripheralDeviceTypes.SequentialAccess)
|
||||
if(dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.SequentialAccess)
|
||||
{
|
||||
byte[] seqBuf;
|
||||
byte[] medBuf;
|
||||
@@ -333,7 +333,7 @@ namespace DiscImageChef.Commands
|
||||
*/
|
||||
}
|
||||
|
||||
if(dev.SCSIType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
||||
if(dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice)
|
||||
{
|
||||
sense = dev.GetConfiguration(out cmdBuf, out senseBuf, 0, MmcGetConfigurationRt.Current, dev.Timeout,
|
||||
out duration);
|
||||
@@ -442,7 +442,7 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
}
|
||||
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.RecognizedFormatLayers, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
@@ -452,7 +452,7 @@ namespace DiscImageChef.Commands
|
||||
else
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_formatlayers.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.WriteProtectionStatus, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
@@ -479,7 +479,7 @@ namespace DiscImageChef.Commands
|
||||
dskType == MediaType.HDDVDRAM || dskType == MediaType.HDDVDRDL || dskType == MediaType.HDDVDROM ||
|
||||
dskType == MediaType.HDDVDRW || dskType == MediaType.HDDVDRWDL)
|
||||
{
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.PhysicalInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
@@ -550,7 +550,7 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
}
|
||||
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DiscManufacturingInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
@@ -583,7 +583,7 @@ namespace DiscImageChef.Commands
|
||||
#region DVD-ROM
|
||||
if(dskType == MediaType.DVDDownload || dskType == MediaType.DVDROM)
|
||||
{
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.CopyrightInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
@@ -602,7 +602,7 @@ namespace DiscImageChef.Commands
|
||||
#region DVD-ROM and HD DVD-ROM
|
||||
if(dskType == MediaType.DVDDownload || dskType == MediaType.DVDROM || dskType == MediaType.HDDVDROM)
|
||||
{
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.BurstCuttingArea, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
@@ -611,8 +611,8 @@ namespace DiscImageChef.Commands
|
||||
else
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_bca.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.DVD_AACS, 0, dev.Timeout, out duration);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DvdAacs, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DVD AACS\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
@@ -685,8 +685,8 @@ namespace DiscImageChef.Commands
|
||||
#region DVD-RAM and HD DVD-RAM
|
||||
if(dskType == MediaType.DVDRAM || dskType == MediaType.HDDVDRAM)
|
||||
{
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.DVDRAM_DDS, 0, dev.Timeout, out duration);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DvdramDds, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DDS\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
@@ -696,8 +696,8 @@ namespace DiscImageChef.Commands
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DicConsole.WriteLine("Disc Definition Structure:\n{0}", Decoders.DVD.DDS.Prettify(cmdBuf));
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.DVDRAM_MediumStatus, 0, dev.Timeout,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DvdramMediumStatus, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Medium Status\n{0}",
|
||||
@@ -708,8 +708,8 @@ namespace DiscImageChef.Commands
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DicConsole.WriteLine("Medium Status:\n{0}", Decoders.DVD.Cartridge.Prettify(cmdBuf));
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.DVDRAM_SpareAreaInformation, 0, dev.Timeout,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DvdramSpareAreaInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: SAI\n{0}",
|
||||
@@ -726,8 +726,8 @@ namespace DiscImageChef.Commands
|
||||
#region DVD-R and HD DVD-R
|
||||
if(dskType == MediaType.DVDR || dskType == MediaType.HDDVDR)
|
||||
{
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.LastBorderOutRMD, 0, dev.Timeout,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.LastBorderOutRmd, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Last-Out Border RMD\n{0}",
|
||||
@@ -741,7 +741,7 @@ namespace DiscImageChef.Commands
|
||||
#region DVD-R and DVD-RW
|
||||
if(dskType == MediaType.DVDR || dskType == MediaType.DVDRW)
|
||||
{
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.PreRecordedInfo, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Pre-Recorded Info\n{0}",
|
||||
@@ -755,8 +755,8 @@ namespace DiscImageChef.Commands
|
||||
#region DVD-R, DVD-RW and HD DVD-R
|
||||
if(dskType == MediaType.DVDR || dskType == MediaType.DVDRW || dskType == MediaType.HDDVDR)
|
||||
{
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.DVDR_MediaIdentifier, 0, dev.Timeout,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DvdrMediaIdentifier, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DVD-R Media ID\n{0}",
|
||||
@@ -764,8 +764,8 @@ namespace DiscImageChef.Commands
|
||||
else
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdr_mediaid.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.DVDR_PhysicalInformation, 0, dev.Timeout,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DvdrPhysicalInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DVD-R PFI\n{0}",
|
||||
@@ -780,8 +780,8 @@ namespace DiscImageChef.Commands
|
||||
if(dskType == MediaType.DVDPR || dskType == MediaType.DVDPRDL || dskType == MediaType.DVDPRW ||
|
||||
dskType == MediaType.DVDPRWDL)
|
||||
{
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.ADIP, 0, dev.Timeout, out duration);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.Adip, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: ADIP\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
@@ -789,8 +789,8 @@ namespace DiscImageChef.Commands
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd+_adip.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.DCB, 0, dev.Timeout, out duration);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.Dcb, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DCB\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
@@ -803,8 +803,8 @@ namespace DiscImageChef.Commands
|
||||
#region HD DVD-ROM
|
||||
if(dskType == MediaType.HDDVDROM)
|
||||
{
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.HDDVD_CopyrightInformation, 0, dev.Timeout,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.HddvdCopyrightInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: HDDVD CMI\n{0}",
|
||||
@@ -818,8 +818,8 @@ namespace DiscImageChef.Commands
|
||||
#region HD DVD-R
|
||||
if(dskType == MediaType.HDDVDR)
|
||||
{
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.HDDVDR_MediumStatus, 0, dev.Timeout,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.HddvdrMediumStatus, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command",
|
||||
@@ -828,8 +828,8 @@ namespace DiscImageChef.Commands
|
||||
else
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_hddvdr_status.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.HDDVDR_LastRMD, 0, dev.Timeout, out duration);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.HddvdrLastRmd, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Last RMD\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
@@ -843,8 +843,8 @@ namespace DiscImageChef.Commands
|
||||
if(dskType == MediaType.DVDPRDL || dskType == MediaType.DVDRDL || dskType == MediaType.DVDRWDL ||
|
||||
dskType == MediaType.DVDPRWDL)
|
||||
{
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.DVDR_LayerCapacity, 0, dev.Timeout,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DvdrLayerCapacity, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Layer Capacity\n{0}",
|
||||
@@ -858,7 +858,7 @@ namespace DiscImageChef.Commands
|
||||
#region DVD-R DL
|
||||
if(dskType == MediaType.DVDRDL)
|
||||
{
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.MiddleZoneStart, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Middle Zone Start\n{0}",
|
||||
@@ -866,7 +866,7 @@ namespace DiscImageChef.Commands
|
||||
else
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_mzs.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.JumpIntervalSize, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
@@ -875,8 +875,8 @@ namespace DiscImageChef.Commands
|
||||
else
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_jis.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
MmcDiscStructureFormat.ManualLayerJumpStartLBA, 0, dev.Timeout,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.ManualLayerJumpStartLba, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command",
|
||||
@@ -885,7 +885,7 @@ namespace DiscImageChef.Commands
|
||||
else
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_manuallj.bin",
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.RemapAnchorPoint, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
@@ -901,7 +901,7 @@ namespace DiscImageChef.Commands
|
||||
if(dskType == MediaType.BDR || dskType == MediaType.BDRE || dskType == MediaType.BDROM ||
|
||||
dskType == MediaType.BDRXL || dskType == MediaType.BDREXL)
|
||||
{
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.BD, 0, 0,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
MmcDiscStructureFormat.DiscInformation, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DI\n{0}",
|
||||
@@ -912,8 +912,8 @@ namespace DiscImageChef.Commands
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DicConsole.WriteLine("Blu-ray Disc Information:\n{0}", Decoders.Bluray.DI.Prettify(cmdBuf));
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.BD, 0, 0,
|
||||
MmcDiscStructureFormat.PAC, 0, dev.Timeout, out duration);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
MmcDiscStructureFormat.Pac, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: PAC\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
@@ -926,8 +926,8 @@ namespace DiscImageChef.Commands
|
||||
#region BD-ROM only
|
||||
if(dskType == MediaType.BDROM)
|
||||
{
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.BD, 0, 0,
|
||||
MmcDiscStructureFormat.BD_BurstCuttingArea, 0, dev.Timeout,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
MmcDiscStructureFormat.BdBurstCuttingArea, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: BCA\n{0}",
|
||||
@@ -945,8 +945,8 @@ namespace DiscImageChef.Commands
|
||||
if(dskType == MediaType.BDR || dskType == MediaType.BDRE || dskType == MediaType.BDRXL ||
|
||||
dskType == MediaType.BDREXL)
|
||||
{
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.BD, 0, 0,
|
||||
MmcDiscStructureFormat.BD_DDS, 0, dev.Timeout, out duration);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
MmcDiscStructureFormat.BdDds, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DDS\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
@@ -957,7 +957,7 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.WriteLine("Blu-ray Disc Definition Structure:\n{0}",
|
||||
Decoders.Bluray.DDS.Prettify(cmdBuf));
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.BD, 0, 0,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
MmcDiscStructureFormat.CartridgeStatus, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Cartridge Status\n{0}",
|
||||
@@ -968,8 +968,8 @@ namespace DiscImageChef.Commands
|
||||
"SCSI READ DISC STRUCTURE", cmdBuf);
|
||||
DicConsole.WriteLine("Blu-ray Cartridge Status:\n{0}", Decoders.Bluray.DI.Prettify(cmdBuf));
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.BD, 0, 0,
|
||||
MmcDiscStructureFormat.BD_SpareAreaInformation, 0, dev.Timeout,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
MmcDiscStructureFormat.BdSpareAreaInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command",
|
||||
@@ -982,8 +982,8 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.WriteLine("Blu-ray Spare Area Information:\n{0}",
|
||||
Decoders.Bluray.DI.Prettify(cmdBuf));
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.BD, 0, 0,
|
||||
MmcDiscStructureFormat.RawDFL, 0, dev.Timeout, out duration);
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0,
|
||||
MmcDiscStructureFormat.RawDfl, 0, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Raw DFL\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
@@ -1003,7 +1003,7 @@ namespace DiscImageChef.Commands
|
||||
DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscinformation_001b.bin",
|
||||
"SCSI READ DISC INFORMATION", cmdBuf);
|
||||
}
|
||||
sense = dev.ReadDiscInformation(out cmdBuf, out senseBuf, MmcDiscInformationDataTypes.POWResources,
|
||||
sense = dev.ReadDiscInformation(out cmdBuf, out senseBuf, MmcDiscInformationDataTypes.PowResources,
|
||||
dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "READ DISC INFORMATION 010b\n{0}",
|
||||
@@ -1197,7 +1197,7 @@ namespace DiscImageChef.Commands
|
||||
#region Nintendo
|
||||
if(dskType == MediaType.Unknown && blocks > 0)
|
||||
{
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.PhysicalInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
@@ -1220,7 +1220,7 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
}
|
||||
}
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.DiscManufacturingInformation, 0, dev.Timeout,
|
||||
out duration);
|
||||
if(sense)
|
||||
@@ -1246,7 +1246,7 @@ namespace DiscImageChef.Commands
|
||||
inq = Decoders.SCSI.Inquiry.Decode(inqBuffer);
|
||||
if(inq.HasValue && inq.Value.KreonPresent)
|
||||
{
|
||||
sense = dev.KreonExtractSS(out cmdBuf, out senseBuf, dev.Timeout, out duration);
|
||||
sense = dev.KreonExtractSs(out cmdBuf, out senseBuf, dev.Timeout, out duration);
|
||||
if(sense)
|
||||
DicConsole.DebugWriteLine("Media-Info command", "KREON EXTRACT SS:\n{0}",
|
||||
Decoders.SCSI.Sense.PrettifySense(senseBuf));
|
||||
@@ -1276,7 +1276,7 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
|
||||
totalSize = (ulong)((cmdBuf[0] << 24) + (cmdBuf[1] << 16) + (cmdBuf[2] << 8) + (cmdBuf[3]));
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.PhysicalInformation, 0, 0, out duration);
|
||||
if(sense)
|
||||
{
|
||||
@@ -1327,7 +1327,7 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
|
||||
totalSize = (ulong)((cmdBuf[0] << 24) + (cmdBuf[1] << 16) + (cmdBuf[2] << 8) + (cmdBuf[3]));
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.DVD, 0, 0,
|
||||
sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0,
|
||||
MmcDiscStructureFormat.PhysicalInformation, 0, 0, out duration);
|
||||
if(sense)
|
||||
{
|
||||
@@ -1356,10 +1356,10 @@ namespace DiscImageChef.Commands
|
||||
#endregion Xbox
|
||||
|
||||
if(dskType == MediaType.Unknown)
|
||||
dskType = MediaTypeFromSCSI.Get((byte)dev.SCSIType, dev.Manufacturer, dev.Model, scsiMediumType,
|
||||
dskType = MediaTypeFromScsi.Get((byte)dev.ScsiType, dev.Manufacturer, dev.Model, scsiMediumType,
|
||||
scsiDensityCode, blocks, blockSize);
|
||||
|
||||
if(dskType == MediaType.Unknown && dev.IsUSB && containsFloppyPage) dskType = MediaType.FlashDrive;
|
||||
if(dskType == MediaType.Unknown && dev.IsUsb && containsFloppyPage) dskType = MediaType.FlashDrive;
|
||||
|
||||
DicConsole.WriteLine("Media identified as {0}", dskType);
|
||||
Core.Statistics.AddMedia(dskType, true);
|
||||
|
||||
@@ -39,13 +39,13 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
static class MediaScan
|
||||
{
|
||||
internal static void doMediaScan(MediaScanOptions options)
|
||||
internal static void DoMediaScan(MediaScanOptions options)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Media-Scan command", "--debug={0}", options.Debug);
|
||||
DicConsole.DebugWriteLine("Media-Scan command", "--verbose={0}", options.Verbose);
|
||||
DicConsole.DebugWriteLine("Media-Scan command", "--device={0}", options.DevicePath);
|
||||
DicConsole.DebugWriteLine("Media-Scan command", "--mhdd-log={0}", options.MHDDLogPath);
|
||||
DicConsole.DebugWriteLine("Media-Scan command", "--ibg-log={0}", options.IBGLogPath);
|
||||
DicConsole.DebugWriteLine("Media-Scan command", "--mhdd-log={0}", options.MhddLogPath);
|
||||
DicConsole.DebugWriteLine("Media-Scan command", "--ibg-log={0}", options.IbgLogPath);
|
||||
|
||||
if(options.DevicePath.Length == 2 && options.DevicePath[1] == ':' && options.DevicePath[0] != '/' &&
|
||||
char.IsLetter(options.DevicePath[0]))
|
||||
@@ -68,27 +68,27 @@ namespace DiscImageChef.Commands
|
||||
switch(dev.Type)
|
||||
{
|
||||
case DeviceType.ATA:
|
||||
results = ATA.Scan(options.MHDDLogPath, options.IBGLogPath, options.DevicePath, dev);
|
||||
results = Ata.Scan(options.MhddLogPath, options.IbgLogPath, options.DevicePath, dev);
|
||||
break;
|
||||
case DeviceType.MMC:
|
||||
case DeviceType.SecureDigital:
|
||||
results = SecureDigital.Scan(options.MHDDLogPath, options.IBGLogPath, options.DevicePath, dev);
|
||||
results = SecureDigital.Scan(options.MhddLogPath, options.IbgLogPath, options.DevicePath, dev);
|
||||
break;
|
||||
case DeviceType.NVMe:
|
||||
results = NVMe.Scan(options.MHDDLogPath, options.IBGLogPath, options.DevicePath, dev);
|
||||
results = Nvme.Scan(options.MhddLogPath, options.IbgLogPath, options.DevicePath, dev);
|
||||
break;
|
||||
case DeviceType.ATAPI:
|
||||
case DeviceType.SCSI:
|
||||
results = SCSI.Scan(options.MHDDLogPath, options.IBGLogPath, options.DevicePath, dev);
|
||||
results = Scsi.Scan(options.MhddLogPath, options.IbgLogPath, options.DevicePath, dev);
|
||||
break;
|
||||
default: throw new NotSupportedException("Unknown device type.");
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Took a total of {0} seconds ({1} processing commands).", results.totalTime,
|
||||
results.processingTime);
|
||||
DicConsole.WriteLine("Avegare speed: {0:F3} MiB/sec.", results.avgSpeed);
|
||||
DicConsole.WriteLine("Fastest speed burst: {0:F3} MiB/sec.", results.maxSpeed);
|
||||
DicConsole.WriteLine("Slowest speed burst: {0:F3} MiB/sec.", results.minSpeed);
|
||||
DicConsole.WriteLine("Took a total of {0} seconds ({1} processing commands).", results.TotalTime,
|
||||
results.ProcessingTime);
|
||||
DicConsole.WriteLine("Avegare speed: {0:F3} MiB/sec.", results.AvgSpeed);
|
||||
DicConsole.WriteLine("Fastest speed burst: {0:F3} MiB/sec.", results.MaxSpeed);
|
||||
DicConsole.WriteLine("Slowest speed burst: {0:F3} MiB/sec.", results.MinSpeed);
|
||||
DicConsole.WriteLine("Summary:");
|
||||
DicConsole.WriteLine("{0} sectors took less than 3 ms.", results.A);
|
||||
DicConsole.WriteLine("{0} sectors took less than 10 ms but more than 3 ms.", results.B);
|
||||
@@ -96,24 +96,24 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.WriteLine("{0} sectors took less than 150 ms but more than 50 ms.", results.D);
|
||||
DicConsole.WriteLine("{0} sectors took less than 500 ms but more than 150 ms.", results.E);
|
||||
DicConsole.WriteLine("{0} sectors took more than 500 ms.", results.F);
|
||||
DicConsole.WriteLine("{0} sectors could not be read.", results.unreadableSectors.Count);
|
||||
if(results.unreadableSectors.Count > 0)
|
||||
DicConsole.WriteLine("{0} sectors could not be read.", results.UnreadableSectors.Count);
|
||||
if(results.UnreadableSectors.Count > 0)
|
||||
{
|
||||
foreach(ulong bad in results.unreadableSectors)
|
||||
foreach(ulong bad in results.UnreadableSectors)
|
||||
DicConsole.WriteLine("Sector {0} could not be read", bad);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine();
|
||||
|
||||
#pragma warning disable RECS0018 // Comparison of floating point numbers with equality operator
|
||||
if(results.seekTotal != 0 || results.seekMin != double.MaxValue || results.seekMax != double.MinValue)
|
||||
if(results.SeekTotal != 0 || results.SeekMin != double.MaxValue || results.SeekMax != double.MinValue)
|
||||
#pragma warning restore RECS0018 // Comparison of floating point numbers with equality operator
|
||||
DicConsole.WriteLine("Testing {0} seeks, longest seek took {1:F3} ms, fastest one took {2:F3} ms. ({3:F3} ms average)",
|
||||
results.seekTimes, results.seekMax, results.seekMin, results.seekTotal / 1000);
|
||||
results.SeekTimes, results.SeekMax, results.SeekMin, results.SeekTotal / 1000);
|
||||
|
||||
Core.Statistics.AddMediaScan((long)results.A, (long)results.B, (long)results.C, (long)results.D,
|
||||
(long)results.E, (long)results.F, (long)results.blocks, (long)results.errored,
|
||||
(long)(results.blocks - results.errored));
|
||||
(long)results.E, (long)results.F, (long)results.Blocks, (long)results.Errored,
|
||||
(long)(results.Blocks - results.Errored));
|
||||
Core.Statistics.AddCommand("media-scan");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,13 +33,13 @@
|
||||
using DiscImageChef.Console;
|
||||
using DiscImageChef.Core;
|
||||
using DiscImageChef.Filters;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.DiscImages;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
static class PrintHex
|
||||
{
|
||||
internal static void doPrintHex(PrintHexOptions options)
|
||||
internal static void DoPrintHex(PrintHexOptions options)
|
||||
{
|
||||
DicConsole.DebugWriteLine("PrintHex command", "--debug={0}", options.Debug);
|
||||
DicConsole.DebugWriteLine("PrintHex command", "--verbose={0}", options.Verbose);
|
||||
@@ -73,7 +73,7 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.WriteLine("Sector {0}", options.StartSector + i);
|
||||
byte[] sector;
|
||||
|
||||
if(inputFormat.ImageInfo.readableSectorTags == null)
|
||||
if(inputFormat.ImageInfo.ReadableSectorTags == null)
|
||||
{
|
||||
DicConsole
|
||||
.WriteLine("Requested sectors with tags, unsupported by underlying image format, printing only user data.");
|
||||
@@ -81,7 +81,7 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
else
|
||||
{
|
||||
if(inputFormat.ImageInfo.readableSectorTags.Count == 0)
|
||||
if(inputFormat.ImageInfo.ReadableSectorTags.Count == 0)
|
||||
{
|
||||
DicConsole
|
||||
.WriteLine("Requested sectors with tags, unsupported by underlying image format, printing only user data.");
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
static class Statistics
|
||||
{
|
||||
internal static void showStats()
|
||||
internal static void ShowStats()
|
||||
{
|
||||
if(Core.Statistics.AllStats == null)
|
||||
{
|
||||
|
||||
@@ -35,13 +35,13 @@ using System.Collections.Generic;
|
||||
using DiscImageChef.Console;
|
||||
using DiscImageChef.Core;
|
||||
using DiscImageChef.Filters;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.DiscImages;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
static class Verify
|
||||
{
|
||||
internal static void doVerify(VerifyOptions options)
|
||||
internal static void DoVerify(VerifyOptions options)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Verify command", "--debug={0}", options.Debug);
|
||||
DicConsole.DebugWriteLine("Verify command", "--verbose={0}", options.Verbose);
|
||||
@@ -68,7 +68,7 @@ namespace DiscImageChef.Commands
|
||||
|
||||
inputFormat.OpenImage(inputFilter);
|
||||
Core.Statistics.AddMediaFormat(inputFormat.GetImageFormat());
|
||||
Core.Statistics.AddMedia(inputFormat.ImageInfo.mediaType, false);
|
||||
Core.Statistics.AddMedia(inputFormat.ImageInfo.MediaType, false);
|
||||
Core.Statistics.AddFilter(inputFilter.Name);
|
||||
|
||||
bool? correctDisc = null;
|
||||
@@ -79,11 +79,11 @@ namespace DiscImageChef.Commands
|
||||
|
||||
if(options.VerifyDisc)
|
||||
{
|
||||
DateTime StartCheck = DateTime.UtcNow;
|
||||
DateTime startCheck = DateTime.UtcNow;
|
||||
bool? discCheckStatus = inputFormat.VerifyMediaImage();
|
||||
DateTime EndCheck = DateTime.UtcNow;
|
||||
DateTime endCheck = DateTime.UtcNow;
|
||||
|
||||
TimeSpan CheckTime = EndCheck - StartCheck;
|
||||
TimeSpan checkTime = endCheck - startCheck;
|
||||
|
||||
switch(discCheckStatus)
|
||||
{
|
||||
@@ -99,7 +99,7 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
|
||||
correctDisc = discCheckStatus;
|
||||
DicConsole.VerboseWriteLine("Checking disc image checksums took {0} seconds", CheckTime.TotalSeconds);
|
||||
DicConsole.VerboseWriteLine("Checking disc image checksums took {0} seconds", checkTime.TotalSeconds);
|
||||
}
|
||||
|
||||
if(options.VerifySectors)
|
||||
@@ -113,10 +113,10 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
catch { formatHasTracks = false; }
|
||||
|
||||
DateTime StartCheck;
|
||||
DateTime EndCheck;
|
||||
List<ulong> FailingLBAs = new List<ulong>();
|
||||
List<ulong> UnknownLBAs = new List<ulong>();
|
||||
DateTime startCheck;
|
||||
DateTime endCheck;
|
||||
List<ulong> failingLbas = new List<ulong>();
|
||||
List<ulong> unknownLbas = new List<ulong>();
|
||||
bool? checkStatus = null;
|
||||
|
||||
if(formatHasTracks)
|
||||
@@ -124,7 +124,7 @@ namespace DiscImageChef.Commands
|
||||
List<Track> inputTracks = inputFormat.GetTracks();
|
||||
ulong currentSectorAll = 0;
|
||||
|
||||
StartCheck = DateTime.UtcNow;
|
||||
startCheck = DateTime.UtcNow;
|
||||
foreach(Track currentTrack in inputTracks)
|
||||
{
|
||||
ulong remainingSectors = currentTrack.TrackEndSector - currentTrack.TrackStartSector;
|
||||
@@ -135,26 +135,26 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.Write("\rChecking sector {0} of {1}, on track {2}", currentSectorAll,
|
||||
inputFormat.GetSectors(), currentTrack.TrackSequence);
|
||||
|
||||
List<ulong> tempFailingLBAs;
|
||||
List<ulong> tempUnknownLBAs;
|
||||
List<ulong> tempfailingLbas;
|
||||
List<ulong> tempunknownLbas;
|
||||
bool? tempStatus;
|
||||
|
||||
if(remainingSectors < 512)
|
||||
tempStatus = inputFormat.VerifySectors(currentSector, (uint)remainingSectors,
|
||||
currentTrack.TrackSequence, out tempFailingLBAs,
|
||||
out tempUnknownLBAs);
|
||||
currentTrack.TrackSequence, out tempfailingLbas,
|
||||
out tempunknownLbas);
|
||||
else
|
||||
tempStatus = inputFormat.VerifySectors(currentSector, 512, currentTrack.TrackSequence,
|
||||
out tempFailingLBAs, out tempUnknownLBAs);
|
||||
out tempfailingLbas, out tempunknownLbas);
|
||||
|
||||
if(checkStatus == null || tempStatus == null) checkStatus = null;
|
||||
else if(checkStatus == false || tempStatus == false) checkStatus = false;
|
||||
else if(checkStatus == true && tempStatus == true) checkStatus = true;
|
||||
else checkStatus = null;
|
||||
|
||||
foreach(ulong failLBA in tempFailingLBAs) FailingLBAs.Add(failLBA);
|
||||
foreach(ulong failLba in tempfailingLbas) failingLbas.Add(failLba);
|
||||
|
||||
foreach(ulong unknownLBA in tempUnknownLBAs) UnknownLBAs.Add(unknownLBA);
|
||||
foreach(ulong unknownLba in tempunknownLbas) unknownLbas.Add(unknownLba);
|
||||
|
||||
if(remainingSectors < 512)
|
||||
{
|
||||
@@ -171,37 +171,37 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
}
|
||||
|
||||
EndCheck = DateTime.UtcNow;
|
||||
endCheck = DateTime.UtcNow;
|
||||
}
|
||||
else
|
||||
{
|
||||
ulong remainingSectors = inputFormat.GetSectors();
|
||||
ulong currentSector = 0;
|
||||
|
||||
StartCheck = DateTime.UtcNow;
|
||||
startCheck = DateTime.UtcNow;
|
||||
while(remainingSectors > 0)
|
||||
{
|
||||
DicConsole.Write("\rChecking sector {0} of {1}", currentSector, inputFormat.GetSectors());
|
||||
|
||||
List<ulong> tempFailingLBAs;
|
||||
List<ulong> tempUnknownLBAs;
|
||||
List<ulong> tempfailingLbas;
|
||||
List<ulong> tempunknownLbas;
|
||||
bool? tempStatus;
|
||||
|
||||
if(remainingSectors < 512)
|
||||
tempStatus = inputFormat.VerifySectors(currentSector, (uint)remainingSectors,
|
||||
out tempFailingLBAs, out tempUnknownLBAs);
|
||||
out tempfailingLbas, out tempunknownLbas);
|
||||
else
|
||||
tempStatus =
|
||||
inputFormat.VerifySectors(currentSector, 512, out tempFailingLBAs, out tempUnknownLBAs);
|
||||
inputFormat.VerifySectors(currentSector, 512, out tempfailingLbas, out tempunknownLbas);
|
||||
|
||||
if(checkStatus == null || tempStatus == null) checkStatus = null;
|
||||
else if(checkStatus == false || tempStatus == false) checkStatus = false;
|
||||
else if(checkStatus == true && tempStatus == true) checkStatus = true;
|
||||
else checkStatus = null;
|
||||
|
||||
foreach(ulong failLBA in tempFailingLBAs) FailingLBAs.Add(failLBA);
|
||||
foreach(ulong failLba in tempfailingLbas) failingLbas.Add(failLba);
|
||||
|
||||
foreach(ulong unknownLBA in tempUnknownLBAs) UnknownLBAs.Add(unknownLBA);
|
||||
foreach(ulong unknownLba in tempunknownLbas) unknownLbas.Add(unknownLba);
|
||||
|
||||
if(remainingSectors < 512)
|
||||
{
|
||||
@@ -215,10 +215,10 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
}
|
||||
|
||||
EndCheck = DateTime.UtcNow;
|
||||
endCheck = DateTime.UtcNow;
|
||||
}
|
||||
|
||||
TimeSpan CheckTime = EndCheck - StartCheck;
|
||||
TimeSpan checkTime = endCheck - startCheck;
|
||||
|
||||
DicConsole.Write("\r");
|
||||
|
||||
@@ -235,31 +235,31 @@ namespace DiscImageChef.Commands
|
||||
break;
|
||||
}
|
||||
|
||||
DicConsole.VerboseWriteLine("Checking sector checksums took {0} seconds", CheckTime.TotalSeconds);
|
||||
DicConsole.VerboseWriteLine("Checking sector checksums took {0} seconds", checkTime.TotalSeconds);
|
||||
|
||||
if(options.Verbose)
|
||||
{
|
||||
DicConsole.VerboseWriteLine("LBAs with error:");
|
||||
if(FailingLBAs.Count == (int)inputFormat.GetSectors())
|
||||
if(failingLbas.Count == (int)inputFormat.GetSectors())
|
||||
DicConsole.VerboseWriteLine("\tall sectors.");
|
||||
else
|
||||
for(int i = 0; i < FailingLBAs.Count; i++) DicConsole.VerboseWriteLine("\t{0}", FailingLBAs[i]);
|
||||
for(int i = 0; i < failingLbas.Count; i++) DicConsole.VerboseWriteLine("\t{0}", failingLbas[i]);
|
||||
|
||||
DicConsole.WriteLine("LBAs without checksum:");
|
||||
if(UnknownLBAs.Count == (int)inputFormat.GetSectors())
|
||||
if(unknownLbas.Count == (int)inputFormat.GetSectors())
|
||||
DicConsole.VerboseWriteLine("\tall sectors.");
|
||||
else
|
||||
for(int i = 0; i < UnknownLBAs.Count; i++) DicConsole.VerboseWriteLine("\t{0}", UnknownLBAs[i]);
|
||||
for(int i = 0; i < unknownLbas.Count; i++) DicConsole.VerboseWriteLine("\t{0}", unknownLbas[i]);
|
||||
}
|
||||
|
||||
DicConsole.WriteLine("Total sectors........... {0}", inputFormat.GetSectors());
|
||||
DicConsole.WriteLine("Total errors............ {0}", FailingLBAs.Count);
|
||||
DicConsole.WriteLine("Total unknowns.......... {0}", UnknownLBAs.Count);
|
||||
DicConsole.WriteLine("Total errors+unknowns... {0}", FailingLBAs.Count + UnknownLBAs.Count);
|
||||
DicConsole.WriteLine("Total errors............ {0}", failingLbas.Count);
|
||||
DicConsole.WriteLine("Total unknowns.......... {0}", unknownLbas.Count);
|
||||
DicConsole.WriteLine("Total errors+unknowns... {0}", failingLbas.Count + unknownLbas.Count);
|
||||
|
||||
totalSectors = (long)inputFormat.GetSectors();
|
||||
errorSectors = FailingLBAs.Count;
|
||||
unknownSectors = UnknownLBAs.Count;
|
||||
errorSectors = failingLbas.Count;
|
||||
unknownSectors = unknownLbas.Count;
|
||||
correctSectors = totalSectors - errorSectors - unknownSectors;
|
||||
}
|
||||
|
||||
|
||||
@@ -66,61 +66,61 @@ namespace DiscImageChef
|
||||
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
|
||||
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
|
||||
PrintCopyright();
|
||||
Commands.Analyze.doAnalyze(opts);
|
||||
Commands.Analyze.DoAnalyze(opts);
|
||||
}).WithParsed<CompareOptions>(opts =>
|
||||
{
|
||||
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
|
||||
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
|
||||
PrintCopyright();
|
||||
Commands.Compare.doCompare(opts);
|
||||
Commands.Compare.DoCompare(opts);
|
||||
}).WithParsed<ChecksumOptions>(opts =>
|
||||
{
|
||||
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
|
||||
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
|
||||
PrintCopyright();
|
||||
Commands.Checksum.doChecksum(opts);
|
||||
Commands.Checksum.DoChecksum(opts);
|
||||
}).WithParsed<EntropyOptions>(opts =>
|
||||
{
|
||||
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
|
||||
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
|
||||
PrintCopyright();
|
||||
Commands.Entropy.doEntropy(opts);
|
||||
Commands.Entropy.DoEntropy(opts);
|
||||
}).WithParsed<VerifyOptions>(opts =>
|
||||
{
|
||||
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
|
||||
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
|
||||
PrintCopyright();
|
||||
Commands.Verify.doVerify(opts);
|
||||
Commands.Verify.DoVerify(opts);
|
||||
}).WithParsed<PrintHexOptions>(opts =>
|
||||
{
|
||||
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
|
||||
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
|
||||
PrintCopyright();
|
||||
Commands.PrintHex.doPrintHex(opts);
|
||||
Commands.PrintHex.DoPrintHex(opts);
|
||||
}).WithParsed<DecodeOptions>(opts =>
|
||||
{
|
||||
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
|
||||
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
|
||||
PrintCopyright();
|
||||
Commands.Decode.doDecode(opts);
|
||||
Commands.Decode.DoDecode(opts);
|
||||
}).WithParsed<DeviceInfoOptions>(opts =>
|
||||
{
|
||||
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
|
||||
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
|
||||
PrintCopyright();
|
||||
Commands.DeviceInfo.doDeviceInfo(opts);
|
||||
Commands.DeviceInfo.DoDeviceInfo(opts);
|
||||
}).WithParsed<MediaInfoOptions>(opts =>
|
||||
{
|
||||
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
|
||||
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
|
||||
PrintCopyright();
|
||||
Commands.MediaInfo.doMediaInfo(opts);
|
||||
Commands.MediaInfo.DoMediaInfo(opts);
|
||||
}).WithParsed<MediaScanOptions>(opts =>
|
||||
{
|
||||
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
|
||||
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
|
||||
PrintCopyright();
|
||||
Commands.MediaScan.doMediaScan(opts);
|
||||
Commands.MediaScan.DoMediaScan(opts);
|
||||
}).WithParsed<FormatsOptions>(opts =>
|
||||
{
|
||||
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
|
||||
@@ -132,43 +132,43 @@ namespace DiscImageChef
|
||||
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
|
||||
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
|
||||
PrintCopyright();
|
||||
Commands.Benchmark.doBenchmark(opts);
|
||||
Commands.Benchmark.DoBenchmark(opts);
|
||||
}).WithParsed<CreateSidecarOptions>(opts =>
|
||||
{
|
||||
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
|
||||
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
|
||||
PrintCopyright();
|
||||
Commands.CreateSidecar.doSidecar(opts);
|
||||
Commands.CreateSidecar.DoSidecar(opts);
|
||||
}).WithParsed<DumpMediaOptions>(opts =>
|
||||
{
|
||||
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
|
||||
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
|
||||
PrintCopyright();
|
||||
Commands.DumpMedia.doDumpMedia(opts);
|
||||
Commands.DumpMedia.DoDumpMedia(opts);
|
||||
}).WithParsed<DeviceReportOptions>(opts =>
|
||||
{
|
||||
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
|
||||
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
|
||||
PrintCopyright();
|
||||
Commands.DeviceReport.doDeviceReport(opts);
|
||||
Commands.DeviceReport.DoDeviceReport(opts);
|
||||
}).WithParsed<LsOptions>(opts =>
|
||||
{
|
||||
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
|
||||
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
|
||||
PrintCopyright();
|
||||
Commands.Ls.doLs(opts);
|
||||
Commands.Ls.DoLs(opts);
|
||||
}).WithParsed<ExtractFilesOptions>(opts =>
|
||||
{
|
||||
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
|
||||
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
|
||||
PrintCopyright();
|
||||
Commands.ExtractFiles.doExtractFiles(opts);
|
||||
Commands.ExtractFiles.DoExtractFiles(opts);
|
||||
}).WithParsed<ListDevicesOptions>(opts =>
|
||||
{
|
||||
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
|
||||
if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine;
|
||||
PrintCopyright();
|
||||
Commands.ListDevices.doListDevices(opts);
|
||||
Commands.ListDevices.DoListDevices(opts);
|
||||
}).WithParsed<ListEncodingsOptions>(opts =>
|
||||
{
|
||||
if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine;
|
||||
@@ -178,11 +178,11 @@ namespace DiscImageChef
|
||||
}).WithParsed<ConfigureOptions>(opts =>
|
||||
{
|
||||
PrintCopyright();
|
||||
Commands.Configure.doConfigure();
|
||||
Commands.Configure.DoConfigure();
|
||||
}).WithParsed<StatsOptions>(opts =>
|
||||
{
|
||||
PrintCopyright();
|
||||
Commands.Statistics.showStats();
|
||||
Commands.Statistics.ShowStats();
|
||||
}).WithNotParsed(errs => Environment.Exit(1));
|
||||
|
||||
Core.Statistics.SaveStats();
|
||||
@@ -191,13 +191,13 @@ namespace DiscImageChef
|
||||
static void PrintCopyright()
|
||||
{
|
||||
object[] attributes = typeof(MainClass).Assembly.GetCustomAttributes(typeof(AssemblyTitleAttribute), false);
|
||||
string AssemblyTitle = ((AssemblyTitleAttribute)attributes[0]).Title;
|
||||
string assemblyTitle = ((AssemblyTitleAttribute)attributes[0]).Title;
|
||||
attributes = typeof(MainClass).Assembly.GetCustomAttributes(typeof(AssemblyCopyrightAttribute), false);
|
||||
Version AssemblyVersion = typeof(MainClass).Assembly.GetName().Version;
|
||||
string AssemblyCopyright = ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
|
||||
Version assemblyVersion = typeof(MainClass).Assembly.GetName().Version;
|
||||
string assemblyCopyright = ((AssemblyCopyrightAttribute)attributes[0]).Copyright;
|
||||
|
||||
DicConsole.WriteLine("{0} {1}", AssemblyTitle, AssemblyVersion);
|
||||
DicConsole.WriteLine("{0}", AssemblyCopyright);
|
||||
DicConsole.WriteLine("{0} {1}", assemblyTitle, assemblyVersion);
|
||||
DicConsole.WriteLine("{0}", assemblyCopyright);
|
||||
DicConsole.WriteLine();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,13 +84,13 @@ namespace DiscImageChef
|
||||
public bool DoAdler32 { get; set; }
|
||||
|
||||
[Option("crc16", Default = true, HelpText = "Calculates CRC16.")]
|
||||
public bool DoCRC16 { get; set; }
|
||||
public bool DoCrc16 { get; set; }
|
||||
|
||||
[Option('c', "crc32", Default = true, HelpText = "Calculates CRC32.")]
|
||||
public bool DoCRC32 { get; set; }
|
||||
public bool DoCrc32 { get; set; }
|
||||
|
||||
[Option("crc64", Default = false, HelpText = "Calculates CRC64 (ECMA).")]
|
||||
public bool DoCRC64 { get; set; }
|
||||
public bool DoCrc64 { get; set; }
|
||||
|
||||
/*[Option("fletcher16", Default = false,
|
||||
HelpText = "Calculates Fletcher-16.")]
|
||||
@@ -101,22 +101,22 @@ namespace DiscImageChef
|
||||
public bool DoFletcher32 { get; set; }*/
|
||||
|
||||
[Option('m', "md5", Default = true, HelpText = "Calculates MD5.")]
|
||||
public bool DoMD5 { get; set; }
|
||||
public bool DoMd5 { get; set; }
|
||||
|
||||
[Option("ripemd160", Default = false, HelpText = "Calculates RIPEMD160.")]
|
||||
public bool DoRIPEMD160 { get; set; }
|
||||
public bool DoRipemd160 { get; set; }
|
||||
|
||||
[Option('s', "sha1", Default = true, HelpText = "Calculates SHA1.")]
|
||||
public bool DoSHA1 { get; set; }
|
||||
public bool DoSha1 { get; set; }
|
||||
|
||||
[Option("sha256", Default = false, HelpText = "Calculates SHA256.")]
|
||||
public bool DoSHA256 { get; set; }
|
||||
public bool DoSha256 { get; set; }
|
||||
|
||||
[Option("sha384", Default = false, HelpText = "Calculates SHA384.")]
|
||||
public bool DoSHA384 { get; set; }
|
||||
public bool DoSha384 { get; set; }
|
||||
|
||||
[Option("sha512", Default = false, HelpText = "Calculates SHA512.")]
|
||||
public bool DoSHA512 { get; set; }
|
||||
public bool DoSha512 { get; set; }
|
||||
|
||||
[Option('f', "spamsum", Default = true, HelpText = "Calculates SpamSum fuzzy hash.")]
|
||||
public bool DoSpamSum { get; set; }
|
||||
@@ -223,11 +223,11 @@ namespace DiscImageChef
|
||||
|
||||
[Option('m', "mhdd-log", Required = false, Default = "",
|
||||
HelpText = "Write a log of the scan in the format used by MHDD.")]
|
||||
public string MHDDLogPath { get; set; }
|
||||
public string MhddLogPath { get; set; }
|
||||
|
||||
[Option('b', "ibg-log", Required = false, Default = "",
|
||||
HelpText = "Write a log of the scan in the format used by ImgBurn.")]
|
||||
public string IBGLogPath { get; set; }
|
||||
public string IbgLogPath { get; set; }
|
||||
}
|
||||
|
||||
[Verb("formats", HelpText = "Lists all supported disc images, partition schemes and file systems.")]
|
||||
|
||||
Reference in New Issue
Block a user