mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
* TODO:
* README.md: * DiscImageChef.sln: * DiscImageChef/Commands/Ls.cs: * DiscImageChef.Filters/GZip.cs: * DiscImageChef.DiscImages/BLU.cs: * DiscImageChef.DiscImages/VHD.cs: * DiscImageChef.DiscImages/VDI.cs: * DiscImageChef.DiscImages/QED.cs: * DiscImageChef.DiscImages/DIM.cs: * DiscImageChef.DiscImages/GDI.cs: * DiscImageChef.Filters/Filter.cs: * DiscImageChef/Commands/Decode.cs: * DiscImageChef.DiscImages/QCOW.cs: * DiscImageChef.Filters/Filters.cs: * DiscImageChef/Core/Statistics.cs: * DiscImageChef.DiscImages/VHDX.cs: * DiscImageChef.DiscImages/Nero.cs: * DiscImageChef/Commands/Verify.cs: * DiscImageChef.DiscImages/UDIF.cs: * DiscImageChef/Commands/Compare.cs: * DiscImageChef/Commands/Analyze.cs: * DiscImageChef.DiscImages/QCOW2.cs: * DiscImageChef/Commands/Entropy.cs: * DiscImageChef/Commands/Formats.cs: * DiscImageChef/Commands/PrintHex.cs: * DiscImageChef.DiscImages/VMware.cs: * DiscImageChef.Settings/Settings.cs: * DiscImageChef/DetectImageFormat.cs: * DiscImageChef/DiscImageChef.csproj: * DiscImageChef.DiscImages/CDRDAO.cs: * DiscImageChef.DiscImages/CPCDSK.cs: * DiscImageChef/Commands/Checksum.cs: * DiscImageChef.DiscImages/CopyQM.cs: * DiscImageChef.DiscImages/CDRWin.cs: * DiscImageChef/Commands/Configure.cs: * DiscImageChef/Commands/DumpMedia.cs: * DiscImageChef/Commands/Statistics.cs: * DiscImageChef.Filters/ZZZNoFilter.cs: * DiscImageChef.DiscImages/TeleDisk.cs: * DiscImageChef.DiscImages/Apple2MG.cs: * DiscImageChef.Filters/OffsetStream.cs: * DiscImageChef.DiscImages/Parallels.cs: * DiscImageChef/Commands/ExtractFiles.cs: * DiscImageChef.DiscImages/DiskCopy42.cs: * DiscImageChef.DiscImages/Alcohol120.cs: * DiscImageChef.DiscImages/ZZZRawImage.cs: * DiscImageChef/Commands/CreateSidecar.cs: * DiscImageChef.DiscImages/ImagePlugin.cs: * DiscImageChef.DiscImages/BlindWrite5.cs: * DiscImageChef.DiscImages/BlindWrite4.cs: * DiscImageChef.Filters/ForcedSeekStream.cs: * DiscImageChef.Filters/Properties/AssemblyInfo.cs: * DiscImageChef.Filters/DiscImageChef.Filters.csproj: * DiscImageChef.DiscImages/DiscImageChef.DiscImages.csproj: Added filters. * DiscImageChef.Filesystems/CPM/Info.cs: Do not throw identification exceptions. * DiscImageChef/Plugins.cs: Sorted plugins lists.
This commit is contained in:
@@ -1,3 +1,27 @@
|
||||
2016-09-05 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* Commands/Ls.cs:
|
||||
* Commands/Verify.cs:
|
||||
* Core/Statistics.cs:
|
||||
* Commands/Decode.cs:
|
||||
* Commands/Entropy.cs:
|
||||
* Commands/Analyze.cs:
|
||||
* Commands/Compare.cs:
|
||||
* Commands/Formats.cs:
|
||||
* Commands/PrintHex.cs:
|
||||
* DetectImageFormat.cs:
|
||||
* DiscImageChef.csproj:
|
||||
* Commands/Checksum.cs:
|
||||
* Commands/DumpMedia.cs:
|
||||
* Commands/Configure.cs:
|
||||
* Commands/Statistics.cs:
|
||||
* Commands/ExtractFiles.cs:
|
||||
* Commands/CreateSidecar.cs:
|
||||
Added filters.
|
||||
|
||||
* Plugins.cs:
|
||||
Sorted plugins lists.
|
||||
|
||||
2016-08-27 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* DetectImageFormat.cs:
|
||||
|
||||
@@ -36,6 +36,7 @@ using DiscImageChef.Filesystems;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.PartPlugins;
|
||||
using DiscImageChef.Console;
|
||||
using DiscImageChef.Filters;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
@@ -49,9 +50,12 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("Analyze command", "--filesystems={0}", options.SearchForFilesystems);
|
||||
DicConsole.DebugWriteLine("Analyze command", "--partitions={0}", options.SearchForPartitions);
|
||||
|
||||
if(!System.IO.File.Exists(options.InputFile))
|
||||
FiltersList filtersList = new FiltersList();
|
||||
Filter inputFilter = filtersList.GetFilter(options.InputFile);
|
||||
|
||||
if(inputFilter == null)
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Specified file does not exist.");
|
||||
DicConsole.ErrorWriteLine("Cannot open specified file.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -66,7 +70,7 @@ namespace DiscImageChef.Commands
|
||||
|
||||
try
|
||||
{
|
||||
_imageFormat = ImageFormat.Detect(options.InputFile);
|
||||
_imageFormat = ImageFormat.Detect(inputFilter);
|
||||
|
||||
if(_imageFormat == null)
|
||||
{
|
||||
@@ -83,7 +87,7 @@ namespace DiscImageChef.Commands
|
||||
|
||||
try
|
||||
{
|
||||
if(!_imageFormat.OpenImage(options.InputFile))
|
||||
if(!_imageFormat.OpenImage(inputFilter))
|
||||
{
|
||||
DicConsole.WriteLine("Unable to open image format");
|
||||
DicConsole.WriteLine("No error given");
|
||||
@@ -97,6 +101,7 @@ namespace DiscImageChef.Commands
|
||||
|
||||
Core.Statistics.AddMediaFormat(_imageFormat.GetImageFormat());
|
||||
Core.Statistics.AddMedia(_imageFormat.ImageInfo.mediaType, false);
|
||||
Core.Statistics.AddFilter(inputFilter.Name);
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
|
||||
@@ -36,6 +36,7 @@ using DiscImageChef.Checksums;
|
||||
using System.Collections.Generic;
|
||||
using DiscImageChef.Console;
|
||||
using System.Threading;
|
||||
using DiscImageChef.Filters;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
@@ -63,13 +64,16 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("Checksum command", "--sha512={0}", options.DoSHA512);
|
||||
DicConsole.DebugWriteLine("Checksum command", "--spamsum={0}", options.DoSpamSum);
|
||||
|
||||
if(!System.IO.File.Exists(options.InputFile))
|
||||
FiltersList filtersList = new FiltersList();
|
||||
Filter inputFilter = filtersList.GetFilter(options.InputFile);
|
||||
|
||||
if(inputFilter == null)
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Specified file does not exist.");
|
||||
DicConsole.ErrorWriteLine("Cannot open specified file.");
|
||||
return;
|
||||
}
|
||||
|
||||
ImagePlugin inputFormat = ImageFormat.Detect(options.InputFile);
|
||||
ImagePlugin inputFormat = ImageFormat.Detect(inputFilter);
|
||||
|
||||
if(inputFormat == null)
|
||||
{
|
||||
@@ -77,9 +81,10 @@ namespace DiscImageChef.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
inputFormat.OpenImage(options.InputFile);
|
||||
inputFormat.OpenImage(inputFilter);
|
||||
Core.Statistics.AddMediaFormat(inputFormat.GetImageFormat());
|
||||
Core.Statistics.AddMedia(inputFormat.ImageInfo.mediaType, false);
|
||||
Core.Statistics.AddFilter(inputFilter.Name);
|
||||
|
||||
if(inputFormat.ImageInfo.imageHasPartitions)
|
||||
{
|
||||
|
||||
@@ -35,6 +35,7 @@ using DiscImageChef.ImagePlugins;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using DiscImageChef.Console;
|
||||
using DiscImageChef.Filters;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
@@ -47,20 +48,24 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("Compare command", "--input1={0}", options.InputFile1);
|
||||
DicConsole.DebugWriteLine("Compare command", "--input2={0}", options.InputFile2);
|
||||
|
||||
if(!System.IO.File.Exists(options.InputFile1))
|
||||
FiltersList filtersList = new FiltersList();
|
||||
Filter inputFilter1 = filtersList.GetFilter(options.InputFile1);
|
||||
Filter inputFilter2 = filtersList.GetFilter(options.InputFile2);
|
||||
|
||||
if(inputFilter1 == null)
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Input file 1 does not exist.");
|
||||
DicConsole.ErrorWriteLine("Cannot open input file 1");
|
||||
return;
|
||||
}
|
||||
|
||||
if(!System.IO.File.Exists(options.InputFile2))
|
||||
if(inputFilter2 == null)
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Input file 2 does not exist.");
|
||||
DicConsole.ErrorWriteLine("Cannot open input file 2");
|
||||
return;
|
||||
}
|
||||
|
||||
ImagePlugin input1Format = ImageFormat.Detect(options.InputFile1);
|
||||
ImagePlugin input2Format = ImageFormat.Detect(options.InputFile2);
|
||||
ImagePlugin input1Format = ImageFormat.Detect(inputFilter1);
|
||||
ImagePlugin input2Format = ImageFormat.Detect(inputFilter2);
|
||||
|
||||
if(input1Format == null)
|
||||
{
|
||||
@@ -88,13 +93,15 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.WriteLine("Input file 2 format identified by {0}.", input2Format.Name);
|
||||
}
|
||||
|
||||
input1Format.OpenImage(options.InputFile1);
|
||||
input2Format.OpenImage(options.InputFile2);
|
||||
input1Format.OpenImage(inputFilter1);
|
||||
input2Format.OpenImage(inputFilter2);
|
||||
|
||||
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.AddFilter(inputFilter1.Name);
|
||||
Core.Statistics.AddFilter(inputFilter2.Name);
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
|
||||
@@ -109,6 +109,15 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
Settings.Settings.Current.Stats.FilesystemStats = pressedKey.Key == ConsoleKey.Y;
|
||||
|
||||
pressedKey = new ConsoleKeyInfo();
|
||||
while(pressedKey.Key != ConsoleKey.Y && pressedKey.Key != ConsoleKey.N)
|
||||
{
|
||||
DicConsole.Write("Do you want to gather statistics about found file filters? (Y/N): ");
|
||||
pressedKey = System.Console.ReadKey();
|
||||
DicConsole.WriteLine();
|
||||
}
|
||||
Settings.Settings.Current.Stats.FilterStats = pressedKey.Key == ConsoleKey.Y;
|
||||
|
||||
pressedKey = new ConsoleKeyInfo();
|
||||
while(pressedKey.Key != ConsoleKey.Y && pressedKey.Key != ConsoleKey.N)
|
||||
{
|
||||
|
||||
@@ -39,6 +39,7 @@ using DiscImageChef.Console;
|
||||
using System.IO;
|
||||
using DiscImageChef.CommonTypes;
|
||||
using DiscImageChef.PartPlugins;
|
||||
using DiscImageChef.Filters;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
@@ -51,15 +52,18 @@ namespace DiscImageChef.Commands
|
||||
plugins.RegisterAllPlugins();
|
||||
ImagePlugin _imageFormat;
|
||||
|
||||
if(!File.Exists(options.InputFile))
|
||||
FiltersList filtersList = new FiltersList();
|
||||
Filter inputFilter = filtersList.GetFilter(options.InputFile);
|
||||
|
||||
if(inputFilter == null)
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Specified file does not exist.");
|
||||
DicConsole.ErrorWriteLine("Cannot open specified file.");
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
_imageFormat = ImageFormat.Detect(options.InputFile);
|
||||
_imageFormat = ImageFormat.Detect(inputFilter);
|
||||
|
||||
if(_imageFormat == null)
|
||||
{
|
||||
@@ -76,7 +80,7 @@ namespace DiscImageChef.Commands
|
||||
|
||||
try
|
||||
{
|
||||
if(!_imageFormat.OpenImage(options.InputFile))
|
||||
if(!_imageFormat.OpenImage(inputFilter))
|
||||
{
|
||||
DicConsole.WriteLine("Unable to open image format");
|
||||
DicConsole.WriteLine("No error given");
|
||||
@@ -93,6 +97,7 @@ namespace DiscImageChef.Commands
|
||||
}
|
||||
|
||||
Core.Statistics.AddMediaFormat(_imageFormat.GetImageFormat());
|
||||
Core.Statistics.AddFilter(inputFilter.Name);
|
||||
|
||||
FileInfo fi = new FileInfo(options.InputFile);
|
||||
FileStream fs = new FileStream(options.InputFile, FileMode.Open, FileAccess.Read);
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.Console;
|
||||
using DiscImageChef.Filters;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
@@ -47,13 +48,16 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("Decode command", "--disk-tags={0}", options.DiskTags);
|
||||
DicConsole.DebugWriteLine("Decode command", "--sector-tags={0}", options.SectorTags);
|
||||
|
||||
if(!System.IO.File.Exists(options.InputFile))
|
||||
FiltersList filtersList = new FiltersList();
|
||||
Filter inputFilter = filtersList.GetFilter(options.InputFile);
|
||||
|
||||
if(inputFilter == null)
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Specified file does not exist.");
|
||||
DicConsole.ErrorWriteLine("Cannot open specified file.");
|
||||
return;
|
||||
}
|
||||
|
||||
ImagePlugin inputFormat = ImageFormat.Detect(options.InputFile);
|
||||
ImagePlugin inputFormat = ImageFormat.Detect(inputFilter);
|
||||
|
||||
if(inputFormat == null)
|
||||
{
|
||||
@@ -61,9 +65,10 @@ namespace DiscImageChef.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
inputFormat.OpenImage(options.InputFile);
|
||||
inputFormat.OpenImage(inputFilter);
|
||||
Core.Statistics.AddMediaFormat(inputFormat.GetImageFormat());
|
||||
Core.Statistics.AddMedia(inputFormat.ImageInfo.mediaType, false);
|
||||
Core.Statistics.AddFilter(inputFilter.Name);
|
||||
|
||||
if(options.DiskTags)
|
||||
{
|
||||
|
||||
@@ -40,6 +40,7 @@ using DiscImageChef.CommonTypes;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.PartPlugins;
|
||||
using DiscImageChef.Filesystems;
|
||||
using DiscImageChef.Filters;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
@@ -749,12 +750,22 @@ namespace DiscImageChef.Commands
|
||||
PluginBase plugins = new PluginBase();
|
||||
plugins.RegisterAllPlugins();
|
||||
ImagePlugin _imageFormat;
|
||||
_imageFormat = ImageFormat.Detect(options.OutputPrefix + ".bin");
|
||||
|
||||
FiltersList filtersList = new FiltersList();
|
||||
Filter inputFilter = filtersList.GetFilter(options.OutputPrefix + ".bin");
|
||||
|
||||
if(inputFilter == null)
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Cannot open file just created, this should not happen.");
|
||||
return;
|
||||
}
|
||||
|
||||
_imageFormat = ImageFormat.Detect(inputFilter);
|
||||
PartitionType[] xmlFileSysInfo = null;
|
||||
|
||||
try
|
||||
{
|
||||
if(!_imageFormat.OpenImage(options.OutputPrefix + ".bin"))
|
||||
if(!_imageFormat.OpenImage(inputFilter))
|
||||
_imageFormat = null;
|
||||
}
|
||||
catch
|
||||
@@ -2951,12 +2962,21 @@ namespace DiscImageChef.Commands
|
||||
PluginBase plugins = new PluginBase();
|
||||
plugins.RegisterAllPlugins();
|
||||
ImagePlugin _imageFormat;
|
||||
_imageFormat = ImageFormat.Detect(options.OutputPrefix + ".bin");
|
||||
FiltersList filtersList = new FiltersList();
|
||||
Filter inputFilter = filtersList.GetFilter(options.OutputPrefix + ".bin");
|
||||
|
||||
if(inputFilter == null)
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Cannot open file just created, this should not happen.");
|
||||
return;
|
||||
}
|
||||
|
||||
_imageFormat = ImageFormat.Detect(inputFilter);
|
||||
PartitionType[] xmlFileSysInfo = null;
|
||||
|
||||
try
|
||||
{
|
||||
if(!_imageFormat.OpenImage(options.OutputPrefix + ".bin"))
|
||||
if(!_imageFormat.OpenImage(inputFilter))
|
||||
_imageFormat = null;
|
||||
}
|
||||
catch
|
||||
|
||||
@@ -35,6 +35,7 @@ using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.Checksums;
|
||||
using System.Collections.Generic;
|
||||
using DiscImageChef.Console;
|
||||
using DiscImageChef.Filters;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
@@ -49,13 +50,16 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("Entropy command", "--input={0}", options.InputFile);
|
||||
DicConsole.DebugWriteLine("Entropy command", "--duplicated-sectors={0}", options.DuplicatedSectors);
|
||||
|
||||
if(!System.IO.File.Exists(options.InputFile))
|
||||
FiltersList filtersList = new FiltersList();
|
||||
Filter inputFilter = filtersList.GetFilter(options.InputFile);
|
||||
|
||||
if(inputFilter == null)
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Specified file does not exist.");
|
||||
DicConsole.ErrorWriteLine("Cannot open specified file.");
|
||||
return;
|
||||
}
|
||||
|
||||
ImagePlugin inputFormat = ImageFormat.Detect(options.InputFile);
|
||||
ImagePlugin inputFormat = ImageFormat.Detect(inputFilter);
|
||||
|
||||
if(inputFormat == null)
|
||||
{
|
||||
@@ -63,9 +67,10 @@ namespace DiscImageChef.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
inputFormat.OpenImage(options.InputFile);
|
||||
inputFormat.OpenImage(inputFilter);
|
||||
Core.Statistics.AddMediaFormat(inputFormat.GetImageFormat());
|
||||
Core.Statistics.AddMedia(inputFormat.ImageInfo.mediaType, false);
|
||||
Core.Statistics.AddFilter(inputFilter.Name);
|
||||
|
||||
if(options.SeparatedTracks)
|
||||
{
|
||||
|
||||
@@ -37,6 +37,7 @@ using DiscImageChef.Filesystems;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.PartPlugins;
|
||||
using System.IO;
|
||||
using DiscImageChef.Filters;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
@@ -50,9 +51,12 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("Extract-Files command", "--xattrs={0}", options.Xattrs);
|
||||
DicConsole.DebugWriteLine("Extract-Files command", "--output={0}", options.OutputDir);
|
||||
|
||||
if(!File.Exists(options.InputFile))
|
||||
FiltersList filtersList = new FiltersList();
|
||||
Filter inputFilter = filtersList.GetFilter(options.InputFile);
|
||||
|
||||
if(inputFilter == null)
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Specified file does not exist.");
|
||||
DicConsole.ErrorWriteLine("Cannot open specified file.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -66,7 +70,7 @@ namespace DiscImageChef.Commands
|
||||
|
||||
try
|
||||
{
|
||||
_imageFormat = ImageFormat.Detect(options.InputFile);
|
||||
_imageFormat = ImageFormat.Detect(inputFilter);
|
||||
|
||||
if(_imageFormat == null)
|
||||
{
|
||||
@@ -91,7 +95,7 @@ namespace DiscImageChef.Commands
|
||||
|
||||
try
|
||||
{
|
||||
if(!_imageFormat.OpenImage(options.InputFile))
|
||||
if(!_imageFormat.OpenImage(inputFilter))
|
||||
{
|
||||
DicConsole.WriteLine("Unable to open image format");
|
||||
DicConsole.WriteLine("No error given");
|
||||
@@ -105,6 +109,7 @@ namespace DiscImageChef.Commands
|
||||
|
||||
Core.Statistics.AddMediaFormat(_imageFormat.GetImageFormat());
|
||||
Core.Statistics.AddMedia(_imageFormat.ImageInfo.mediaType, false);
|
||||
Core.Statistics.AddFilter(inputFilter.Name);
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
|
||||
@@ -35,6 +35,7 @@ using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.PartPlugins;
|
||||
using DiscImageChef.Filesystems;
|
||||
using DiscImageChef.Console;
|
||||
using DiscImageChef.Filters;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
@@ -44,7 +45,19 @@ namespace DiscImageChef.Commands
|
||||
{
|
||||
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");
|
||||
foreach(KeyValuePair<string, Filter> kvp in filtersList.filtersList)
|
||||
{
|
||||
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");
|
||||
|
||||
@@ -34,6 +34,7 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using DiscImageChef.Console;
|
||||
using DiscImageChef.Filesystems;
|
||||
using DiscImageChef.Filters;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.PartPlugins;
|
||||
|
||||
@@ -47,12 +48,15 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("Ls command", "--verbose={0}", options.Verbose);
|
||||
DicConsole.DebugWriteLine("Ls command", "--input={0}", options.InputFile);
|
||||
|
||||
if(!System.IO.File.Exists(options.InputFile))
|
||||
FiltersList filtersList = new FiltersList();
|
||||
Filter inputFilter = filtersList.GetFilter(options.InputFile);
|
||||
|
||||
if(inputFilter == null)
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Specified file does not exist.");
|
||||
DicConsole.ErrorWriteLine("Cannot open specified file.");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
PluginBase plugins = new PluginBase();
|
||||
plugins.RegisterAllPlugins();
|
||||
|
||||
@@ -63,7 +67,7 @@ namespace DiscImageChef.Commands
|
||||
|
||||
try
|
||||
{
|
||||
_imageFormat = ImageFormat.Detect(options.InputFile);
|
||||
_imageFormat = ImageFormat.Detect(inputFilter);
|
||||
|
||||
if(_imageFormat == null)
|
||||
{
|
||||
@@ -80,7 +84,7 @@ namespace DiscImageChef.Commands
|
||||
|
||||
try
|
||||
{
|
||||
if(!_imageFormat.OpenImage(options.InputFile))
|
||||
if(!_imageFormat.OpenImage(inputFilter))
|
||||
{
|
||||
DicConsole.WriteLine("Unable to open image format");
|
||||
DicConsole.WriteLine("No error given");
|
||||
@@ -94,6 +98,7 @@ namespace DiscImageChef.Commands
|
||||
|
||||
Core.Statistics.AddMediaFormat(_imageFormat.GetImageFormat());
|
||||
Core.Statistics.AddMedia(_imageFormat.ImageInfo.mediaType, false);
|
||||
Core.Statistics.AddFilter(inputFilter.Name);
|
||||
}
|
||||
catch(Exception ex)
|
||||
{
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using DiscImageChef.Console;
|
||||
using DiscImageChef.Filters;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
@@ -47,13 +48,16 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("PrintHex command", "--long-sectors={0}", options.LongSectors);
|
||||
DicConsole.DebugWriteLine("PrintHex command", "--WidthBytes={0}", options.WidthBytes);
|
||||
|
||||
if(!System.IO.File.Exists(options.InputFile))
|
||||
FiltersList filtersList = new FiltersList();
|
||||
Filter inputFilter = filtersList.GetFilter(options.InputFile);
|
||||
|
||||
if(inputFilter == null)
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Specified file does not exist.");
|
||||
DicConsole.ErrorWriteLine("Cannot open specified file.");
|
||||
return;
|
||||
}
|
||||
|
||||
ImagePlugin inputFormat = ImageFormat.Detect(options.InputFile);
|
||||
ImagePlugin inputFormat = ImageFormat.Detect(inputFilter);
|
||||
|
||||
if(inputFormat == null)
|
||||
{
|
||||
@@ -61,7 +65,7 @@ namespace DiscImageChef.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
inputFormat.OpenImage(options.InputFile);
|
||||
inputFormat.OpenImage(inputFilter);
|
||||
|
||||
for(ulong i = 0; i < options.Length; i++)
|
||||
{
|
||||
|
||||
@@ -101,6 +101,16 @@ namespace DiscImageChef.Commands
|
||||
thereAreStats = true;
|
||||
}
|
||||
|
||||
if(Core.Statistics.AllStats.Filters != null && Core.Statistics.AllStats.Filters.Count > 0)
|
||||
{
|
||||
DicConsole.WriteLine("Filters statistics");
|
||||
DicConsole.WriteLine("==================");
|
||||
foreach(Core.NameValueStats nvs in Core.Statistics.AllStats.Filters)
|
||||
DicConsole.WriteLine("Filter {0} has been found {1} times.", nvs.name, nvs.Value);
|
||||
DicConsole.WriteLine();
|
||||
thereAreStats = true;
|
||||
}
|
||||
|
||||
if(Core.Statistics.AllStats.MediaImages != null && Core.Statistics.AllStats.MediaImages.Count > 0)
|
||||
{
|
||||
DicConsole.WriteLine("Media image statistics");
|
||||
|
||||
@@ -34,6 +34,7 @@ using System;
|
||||
using DiscImageChef.ImagePlugins;
|
||||
using System.Collections.Generic;
|
||||
using DiscImageChef.Console;
|
||||
using DiscImageChef.Filters;
|
||||
|
||||
namespace DiscImageChef.Commands
|
||||
{
|
||||
@@ -47,13 +48,16 @@ namespace DiscImageChef.Commands
|
||||
DicConsole.DebugWriteLine("Verify command", "--verify-disc={0}", options.VerifyDisc);
|
||||
DicConsole.DebugWriteLine("Verify command", "--verify-sectors={0}", options.VerifySectors);
|
||||
|
||||
if(!System.IO.File.Exists(options.InputFile))
|
||||
FiltersList filtersList = new FiltersList();
|
||||
Filter inputFilter = filtersList.GetFilter(options.InputFile);
|
||||
|
||||
if(inputFilter == null)
|
||||
{
|
||||
DicConsole.ErrorWriteLine("Specified file does not exist.");
|
||||
DicConsole.ErrorWriteLine("Cannot open specified file.");
|
||||
return;
|
||||
}
|
||||
|
||||
ImagePlugin inputFormat = ImageFormat.Detect(options.InputFile);
|
||||
ImagePlugin inputFormat = ImageFormat.Detect(inputFilter);
|
||||
|
||||
if(inputFormat == null)
|
||||
{
|
||||
@@ -61,9 +65,10 @@ namespace DiscImageChef.Commands
|
||||
return;
|
||||
}
|
||||
|
||||
inputFormat.OpenImage(options.InputFile);
|
||||
inputFormat.OpenImage(inputFilter);
|
||||
Core.Statistics.AddMediaFormat(inputFormat.GetImageFormat());
|
||||
Core.Statistics.AddMedia(inputFormat.ImageInfo.mediaType, false);
|
||||
Core.Statistics.AddFilter(inputFilter.Name);
|
||||
|
||||
bool? correctDisc = null;
|
||||
long totalSectors = 0;
|
||||
|
||||
@@ -47,6 +47,8 @@ namespace DiscImageChef.Core
|
||||
public List<NameValueStats> Partitions;
|
||||
[XmlArrayItem("Format")]
|
||||
public List<NameValueStats> MediaImages;
|
||||
[XmlArrayItem("Filter", IsNullable = true)]
|
||||
public List<NameValueStats> Filters;
|
||||
[XmlArrayItem("Device", IsNullable = true)]
|
||||
public List<DeviceStats> Devices;
|
||||
[XmlArrayItem("Media")]
|
||||
@@ -411,6 +413,65 @@ namespace DiscImageChef.Core
|
||||
}
|
||||
}
|
||||
|
||||
public static void AddFilter(string format)
|
||||
{
|
||||
if(Settings.Settings.Current.Stats != null && Settings.Settings.Current.Stats.FilterStats)
|
||||
{
|
||||
if(AllStats.Filters == null)
|
||||
AllStats.Filters = new List<NameValueStats>();
|
||||
if(CurrentStats.Filters == null)
|
||||
CurrentStats.Filters = new List<NameValueStats>();
|
||||
|
||||
NameValueStats old = null;
|
||||
foreach(NameValueStats nvs in AllStats.Filters)
|
||||
{
|
||||
if(nvs.name == format)
|
||||
{
|
||||
old = nvs;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
NameValueStats nw = new NameValueStats();
|
||||
if(old != null)
|
||||
{
|
||||
nw.name = old.name;
|
||||
nw.Value = old.Value + 1;
|
||||
AllStats.Filters.Remove(old);
|
||||
}
|
||||
else
|
||||
{
|
||||
nw.name = format;
|
||||
nw.Value = 1;
|
||||
}
|
||||
AllStats.Filters.Add(nw);
|
||||
|
||||
old = null;
|
||||
foreach(NameValueStats nvs in CurrentStats.Filters)
|
||||
{
|
||||
if(nvs.name == format)
|
||||
{
|
||||
old = nvs;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
nw = new NameValueStats();
|
||||
if(old != null)
|
||||
{
|
||||
nw.name = old.name;
|
||||
nw.Value = old.Value + 1;
|
||||
CurrentStats.Filters.Remove(old);
|
||||
}
|
||||
else
|
||||
{
|
||||
nw.name = format;
|
||||
nw.Value = 1;
|
||||
}
|
||||
CurrentStats.Filters.Add(nw);
|
||||
}
|
||||
}
|
||||
|
||||
public static void AddMediaFormat(string format)
|
||||
{
|
||||
if(Settings.Settings.Current.Stats != null && Settings.Settings.Current.Stats.MediaImageStats)
|
||||
|
||||
@@ -31,12 +31,13 @@
|
||||
// ****************************************************************************/
|
||||
|
||||
using System;
|
||||
using DiscImageChef.Filters;
|
||||
|
||||
namespace DiscImageChef.ImagePlugins
|
||||
{
|
||||
public static class ImageFormat
|
||||
{
|
||||
public static ImagePlugin Detect(string imagePath)
|
||||
public static ImagePlugin Detect(Filter imageFilter)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -53,7 +54,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
{
|
||||
try
|
||||
{
|
||||
if(_imageplugin.IdentifyImage(imagePath))
|
||||
if(_imageplugin.IdentifyImage(imageFilter))
|
||||
{
|
||||
_imageFormat = _imageplugin;
|
||||
break;
|
||||
@@ -76,7 +77,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
{
|
||||
try
|
||||
{
|
||||
if(_imageplugin.IdentifyImage(imagePath))
|
||||
if(_imageplugin.IdentifyImage(imageFilter))
|
||||
{
|
||||
_imageFormat = _imageplugin;
|
||||
break;
|
||||
|
||||
@@ -212,6 +212,10 @@
|
||||
<Project>{E1BD3C65-49C3-49E7-BABA-C60980CB3F20}</Project>
|
||||
<Name>CommandLine</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\DiscImageChef.Filters\DiscImageChef.Filters.csproj">
|
||||
<Project>{D571B8EF-903D-4353-BDD5-B834F9F029EF}</Project>
|
||||
<Name>DiscImageChef.Filters</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\LICENSE.MIT">
|
||||
|
||||
@@ -42,15 +42,15 @@ namespace DiscImageChef
|
||||
{
|
||||
public class PluginBase
|
||||
{
|
||||
public Dictionary<string, Filesystem> PluginsList;
|
||||
public Dictionary<string, PartPlugin> PartPluginsList;
|
||||
public Dictionary<string, ImagePlugin> ImagePluginsList;
|
||||
public SortedDictionary<string, Filesystem> PluginsList;
|
||||
public SortedDictionary<string, PartPlugin> PartPluginsList;
|
||||
public SortedDictionary<string, ImagePlugin> ImagePluginsList;
|
||||
|
||||
public PluginBase()
|
||||
{
|
||||
PluginsList = new Dictionary<string, Filesystem>();
|
||||
PartPluginsList = new Dictionary<string, PartPlugin>();
|
||||
ImagePluginsList = new Dictionary<string, ImagePlugin>();
|
||||
PluginsList = new SortedDictionary<string, Filesystem>();
|
||||
PartPluginsList = new SortedDictionary<string, PartPlugin>();
|
||||
ImagePluginsList = new SortedDictionary<string, ImagePlugin>();
|
||||
}
|
||||
|
||||
public void RegisterAllPlugins()
|
||||
|
||||
Reference in New Issue
Block a user