Preliminary Support for DiscImageChef (#188)

* Professional cook

* Accuracy improvements

* Better yet

* Spicy

* Simplify and reduce

* You eye note

* More info for validation

* Read you

* Verbose

* Typo

* Custom fix

* Of note

* Clearly the same

* Creator update

* Creator MCN flag gone

* Missed a spot

* Fix issues after code walkthrough
This commit is contained in:
Matt Nadareski
2020-02-03 14:02:24 -08:00
committed by GitHub
parent 59040ae0f0
commit 89db32dd53
19 changed files with 3480 additions and 304 deletions

View File

@@ -1,5 +1,457 @@
namespace DICUI.Data
{
/// <summary>
/// Top-level commands for DiscImageChef
/// </summary>
public static class ChefCommandStrings
{
// Database Family
public const string DatabasePrefixShort = "db";
public const string DatabasePrefixLong = "database";
public const string DatabaseStats = "stats";
public const string DatabaseUpdate = "update";
// Device Family
public const string DevicePrefixShort = "dev";
public const string DevicePrefixLong = "device";
public const string DeviceInfo = "info";
public const string DeviceList = "list";
public const string DeviceReport = "report";
// Filesystem Family
public const string FilesystemPrefixShort = "fi";
public const string FilesystemPrefixShortAlt = "fs";
public const string FilesystemPrefixLong = "filesystem";
public const string FilesystemExtract = "extract";
public const string FilesystemListShort = "ls";
public const string FilesystemListLong = "list";
public const string FilesystemOptions = "options";
// Image Family
public const string ImagePrefixShort = "i";
public const string ImagePrefixLong = "image";
public const string ImageAnalyze = "analyze";
public const string ImageChecksumShort = "chk";
public const string ImageChecksumLong = "checksum";
public const string ImageCompareShort = "cmp";
public const string ImageCompareLong = "compare";
public const string ImageConvert = "convert";
public const string ImageCreateSidecar = "create-sidecar";
public const string ImageDecode = "decode";
public const string ImageEntropy = "entropy";
public const string ImageInfo = "info";
public const string ImageOptions = "options";
public const string ImagePrint = "print";
public const string ImageVerify = "verify";
// Media Family
public const string MediaPrefixShort = "m";
public const string MediaPrefixLong = "media";
public const string MediaDump = "dump";
public const string MediaInfo = "info";
public const string MediaScan = "scan";
// Standalone Commands
public const string Configure = "configure";
public const string Formats = "formats";
public const string ListEncodings = "list-encodings";
public const string ListNamespaces = "list-namespaces";
public const string Remote = "remote";
}
/// <summary>
/// Supported encodings for DiscImageChef
/// </summary>
public static class ChefEncodingStrings
{
public static string ArabicMac = "x-mac-arabic";
public static string AtariASCII = "atascii";
public static string CentralEuropeanMac = "x-mac-ce";
public static string CommodorePETSCII = "petscii";
public static string CroatianMac = "x-mac-croatian";
public static string CyrillicMac = "x-mac-cryillic";
public static string FarsiMac = "x-mac-farsi";
public static string GreekMac = "x-mac-greek";
public static string HebrewMac = "x-mac-hebrew";
public static string RomanianMac = "x-mac-romanian";
public static string SinclairZXSpectrum = "spectrum";
public static string SinclairZX80 = "zx80";
public static string SinclairZX81 = "zx81";
public static string TurkishMac = "x-mac-turkish";
public static string UkrainianMac = "x-mac-ukrainian";
public static string Unicode = "utf-16";
public static string UnicodeBigEndian = "utf-16BE";
public static string UnicodeUTF32BigEndian = "utf-32BE";
public static string UnicodeUTF32 = "utf-32";
public static string UnicodeUTF7 = "utf-7";
public static string UnicodeUTF8 = "utf-8";
public static string USASCII = "us-ascii";
public static string WesternEuropeanAppleII = "apple2";
public static string WesternEuropeanAppleIIc = "apple2c";
public static string WesternEuropeanAppleIIe = "apple2e";
public static string WesternEuropeanAppleIIgs = "apple2gs";
public static string WesternEuropeanAppleLisa = "lisa";
public static string WesternEuropeanAtariST = "atarist";
public static string WesternEuropeanGEM = "gem";
public static string WesternEuropeanGEOS = "geos";
public static string WesternEuropeanISO = "iso-8859-1";
public static string WesternEuropeanMac = "macintosh";
public static string WesternEuropeanRadix50 = "radix50";
}
/// <summary>
/// Dumping flags for DiscImageChef
/// </summary>
public static class ChefFlagStrings
{
// Boolean flags
public const string Adler32Short = "-a";
public const string Adler32Long = "--adler32";
public const string ClearLong = "--clear";
public const string ClearAllLong = "--clear-all";
public const string CRC16Long = "--crc16";
public const string CRC32Short = "-c";
public const string CRC32Long = "--crc32";
public const string CRC64Long = "--crc64";
public const string DebugShort = "-d";
public const string DebugLong = "--debug";
public const string DiskTagsShort = "-f";
public const string DiskTagsLong = "--disk-tags";
public const string DuplicatedSectorsShort = "-p";
public const string DuplicatedSectorsLong = "--duplicated-sectors";
public const string ExtendedAttributesShort = "-x";
public const string ExtendedAttributesLong = "--xattrs";
public const string FilesystemsShort = "-f";
public const string FilesystemsLong = "--filesystems";
public const string FirstPregapLong = "--first-pregap";
public const string FixOffsetLong = "--fix-offset";
public const string Fletcher16Long = "--fletcher16";
public const string Fletcher32Long = "--fletcher32";
public const string ForceShort = "-f";
public const string ForceLong = "--force";
public const string LongFormatShort = "-l";
public const string LongFormatLong = "--long-format";
public const string LongSectorsShort = "-r";
public const string LongSectorsLong = "--long-sectors";
public const string MD5Short = "-m";
public const string MD5Long = "--md5";
public const string MetadataLong = "--metadata";
public const string PartitionsShort = "-p";
public const string PartitionsLong = "--partitions";
public const string PersistentLong = "--persistent";
public const string ResumeShort = "-r";
public const string ResumeLong = "--resume";
public const string SectorTagsShort = "-p";
public const string SectorTagsLong = "--sector-tags";
public const string SeparatedTracksShort = "-t";
public const string SeparatedTracksLong = "--separated-tracks";
public const string SHA1Short = "-s";
public const string SHA1Long = "--sha1";
public const string SHA256Long = "--sha256";
public const string SHA384Long = "--sha384";
public const string SHA512Long = "--sha512";
public const string SpamSumShort = "-f";
public const string SpamSumLong = "--spamsum";
public const string StopOnErrorShort = "-s";
public const string StopOnErrorLong = "--stop-on-error";
public const string TapeShort = "-t";
public const string TapeLong = "--tape";
public const string TrimLong = "--trim";
public const string VerboseShort = "-v";
public const string VerboseLong = "--verbose";
public const string VerifyDiscShort = "-w";
public const string VerifyDiscLong = "--verify-disc";
public const string VerifySectorsShort = "-s";
public const string VerifySectorsLong = "--verify-sectors";
public const string WholeDiscShort = "-w";
public const string WholeDiscLong = "--whole-disc";
// Int8 flags
public const string SpeedLong = "--speed";
// Int16 flags
public const string RetryPassesShort = "-p";
public const string RetryPassesLong = "--retry-passes";
public const string WidthShort = "-w";
public const string WidthLong = "--width";
// Int32 flags
public const string BlockSizeShort = "-b";
public const string BlockSizeLong = "--block-size";
public const string CountShort = "-c";
public const string CountLong = "--count";
public const string MediaLastSequenceLong = "--media-lastsequence";
public const string MediaSequenceLong = "--media-sequence";
public const string SkipShort = "-k";
public const string SkipLong = "--skip";
// Int64 flags
public const string LengthShort = "-l"; // or "all"
public const string LengthLong = "--length"; // or "all"
public const string StartShort = "-s";
public const string StartLong = "--start";
// String flags
public const string CommentsLong = "--comments";
public const string CreatorLong = "--creator";
public const string DriveManufacturerLong = "--drive-manufacturer";
public const string DriveModelLong = "--drive-model";
public const string DriveRevisionLong = "--drive-revision";
public const string DriveSerialLong = "--drive-serial";
public const string EncodingShort = "-e";
public const string EncodingLong = "--encoding";
public const string FormatConvertShort = "-p";
public const string FormatConvertLong = "--format";
public const string FormatDumpShort = "-t";
public const string FormatDumpLong = "--format";
public const string ImgBurnLogShort = "-b";
public const string ImgBurnLogLong = "--ibg-log";
public const string MediaBarcodeLong = "--media-barcode";
public const string MediaManufacturerLong = "--media-manufacturer";
public const string MediaModelLong = "--media-model";
public const string MediaPartNumberLong = "--media-partnumber";
public const string MediaSerialLong = "--media-serial";
public const string MediaTitleLong = "--media-title";
public const string MHDDLogShort = "-m";
public const string MHDDLogLong = "--mhdd-log";
public const string NamespaceShort = "-n";
public const string NamespaceLong = "--namespace";
public const string OptionsShort = "-O";
public const string OptionsLong = "--options";
public const string OutputPrefixShort = "-w";
public const string OutputPrefixLong = "--output-prefix";
public const string ResumeFileShort = "-r";
public const string ResumeFileLong = "--resume-file";
public const string SubchannelLong = "--subchannel";
public const string XMLSidecarShort = "-x";
public const string XMLSidecarLong = "--cicm-xml";
}
/// <summary>
/// Supported formats for DiscImageChef
/// </summary>
public static class ChefFormatStrings
{
// Supported filters
public static string AppleDouble = "AppleDouble";
public static string AppleSingle = "AppleSingle";
public static string BZip2 = "BZip2";
public static string GZip = "GZip";
public static string LZip = "LZip";
public static string MacBinary = "MacBinary";
public static string NoFilter = "No filter";
public static string PCExchange = "PCExchange";
public static string XZ = "XZ";
// Read-only media image formats
public static string AppleDiskArchivalRetrievalTool = "Apple Disk Archival/Retrieval Tool";
public static string AppleNewDiskImageFormat = "Apple New Disk Image Format";
public static string AppleNIB = "Apple NIB";
public static string BlindWrite4 = "BlindWrite 4";
public static string BlindWrite5 = "BlindWrite 5";
public static string CPCEMUDiskFileAndExtendedCPCDiskFile = "CPCEMU Disk-File and Extended CPC Disk-File";
public static string D2FDiskImage = "d2f disk image";
public static string D88DiskImage = "D88 Disk Image";
public static string DIMDiskImage = "DIM Disk Image";
public static string DiscFerret = "DiscFerret";
public static string DiscJuggler = "DiscJuggler";
public static string DreamcastGDIImage = "Dreamcast GDI image";
public static string DunfieldsIMD = "Dunfield's IMD";
public static string HDCopyDiskImage = "HD-Copy disk image";
public static string KryoFluxSTREAM = "KryoFlux STREAM";
public static string MAMECompressedHunksOfData = "MAME Compressed Hunks of Data";
public static string MicrosoftVHDX = "Microsoft VHDX";
public static string NeroBurningROMImage = "Nero Burning ROM image";
public static string PartCloneDiskImage = "PartClone disk image";
public static string PartimageDiskImage = "Partimage disk image";
public static string SpectrumFloppyDiskImage = "Spectrum Floppy Disk Image";
public static string SuperCardPro = "SuperCardPro";
public static string SydexCopyQM = "Sydex CopyQM";
public static string SydexTeleDisk = "Sydex TeleDisk";
// Read/write media image formats
public static string ACTApricotDiskImage = "ACT Apricot Disk Image";
public static string Alcohol120MediaDescriptorStructure = "Alcohol 120% Media Descriptor Structure";
public static string Anex86DiskImage = "Anex86 Disk Image";
public static string Apple2InterleavedDiskImage = "Apple ][Interleaved Disk Image";
public static string Apple2IMG = "Apple 2IMG";
public static string AppleDiskCopy42 = "Apple DiskCopy 4.2";
public static string AppleUniversalDiskImageFormat = "Apple Universal Disk Image Format";
public static string BasicLisaUtility = "Basic Lisa Utility";
public static string CDRDAOTocfile = "CDRDAO tocfile";
public static string CDRWinCuesheet = "CDRWin cuesheet";
public static string CisCopyDiskImageDCFile = "CisCopy Disk Image(DC-File)";
public static string CloneCD = "CloneCD";
public static string CopyTape = "CopyTape";
public static string DigitalResearchDiskCopy = "Digital Research DiskCopy";
public static string DiscImageChefFormat = "DiscImageChef format";
public static string IBMSaveDskF = "IBM SaveDskF";
public static string MAXIDiskImage = "MAXI Disk image";
public static string ParallelsDiskImage = "Parallels disk image";
public static string QEMUCopyOnWriteDiskImage = "QEMU Copy-On-Write disk image";
public static string QEMUCopyOnWriteDiskImageV2 = "QEMU Copy-On-Write disk image v2";
public static string QEMUEnhancedDiskImage = "QEMU Enhanced Disk image";
public static string RawDiskImage = "Raw Disk Image";
public static string RayAracheliansDiskIMage = "Ray Arachelian's Disk IMage";
public static string RSIDEHardDiskImage = "RS-IDE Hard Disk Image";
public static string T98HardDiskImage = "T98 Hard Disk Image";
public static string T98NextNHDr0DiskImage = "T98-Next NHD r0 Disk Image";
public static string Virtual98DiskImage = "Virtual98 Disk Image";
public static string VirtualBoxDiskImage = "VirtualBox Disk Image";
public static string VirtualPC = "VirtualPC";
public static string VMwareDiskImage = "VMware disk image";
// Supported filesystems for identification and information only
public static string AcornAdvancedDiscFilingSystem = "Acorn Advanced Disc Filing System";
public static string AlexanderOsipovDOSFileSystem = "Alexander Osipov DOS file system";
public static string AmigaDOSFilesystem = "Amiga DOS filesystem";
public static string AppleFileSystem = "Apple File System";
public static string AppleHFSPlusFilesystem = "Apple HFS+ filesystem";
public static string AppleHierarchicalFileSystem = "Apple Hierarchical File System";
public static string AppleProDOSFilesystem = "Apple ProDOS filesystem";
public static string AtheOSFilesystem = "AtheOS Filesystem";
public static string BeFilesystem = "Be Filesystem";
public static string BSDFastFileSystem = "BSD Fast File System(aka UNIX File System, UFS)";
public static string BTreeFileSystem = "B-tree file system";
public static string CommodoreFileSystem = "Commodore file system";
public static string CramFilesystem = "Cram filesystem";
public static string DumpEightPlugin = "dump(8) Plugin";
public static string ECMA67 = "ECMA-67";
public static string ExtentFileSystemPlugin = "Extent File System Plugin";
public static string F2FSPlugin = "F2FS Plugin";
public static string Files11OnDiskStructure = "Files-11 On-Disk Structure";
public static string FossilFilesystemPlugin = "Fossil Filesystem Plugin";
public static string HAMMERFilesystem = "HAMMER Filesystem";
public static string HighPerformanceOpticalFileSystem = "High Performance Optical File System";
public static string HPLogicalInterchangeFormatPlugin = "HP Logical Interchange Format Plugin";
public static string JFSPlugin = "JFS Plugin";
public static string LinuxExtendedFilesystem = "Linux extended Filesystem";
public static string LinuxExtendedFilesystem234 = "Linux extended Filesystem 2, 3 and 4";
public static string LocusFilesystemPlugin = "Locus Filesystem Plugin";
public static string MicroDOSFileSystem = "MicroDOS file system";
public static string MicrosoftExtendedFileAllocationTable = "Microsoft Extended File Allocation Table";
public static string MinixFilesystem = "Minix Filesystem";
public static string NewTechnologyFileSystem = "New Technology File System(NTFS)";
public static string NILFS2Plugin = "NILFS2 Plugin";
public static string NintendoOpticalFilesystems = "Nintendo optical filesystems";
public static string OS2HighPerformanceFileSystem = "OS/2 High Performance File System";
public static string OS9RandomBlockFilePlugin = "OS-9 Random Block File Plugin";
public static string PCEngineCDPlugin = "PC Engine CD Plugin";
public static string PCFXPlugin = "PC-FX Plugin";
public static string ProfessionalFileSystem = "Professional File System";
public static string QNX4Plugin = "QNX4 Plugin";
public static string QNX6Plugin = "QNX6 Plugin";
public static string ReiserFilesystemPlugin = "Reiser Filesystem Plugin";
public static string Reiser4FilesystemPlugin = "Reiser4 Filesystem Plugin";
public static string ResilientFileSystemPlugin = "Resilient File System plugin";
public static string RT11FileSystem = "RT-11 file system";
public static string SmartFileSystem = "SmartFileSystem";
public static string SolarOSFilesystem = "Solar_OS filesystem";
public static string SquashFilesystem = "Squash filesystem";
public static string UNICOSFilesystemPlugin = "UNICOS Filesystem Plugin";
public static string UniversalDiskFormat = "Universal Disk Format";
public static string UNIXBootFilesystem = "UNIX Boot filesystem";
public static string UNIXSystemVFilesystem = "UNIX System V filesystem";
public static string VeritasFilesystem = "Veritas filesystem";
public static string VMwareFilesystem = "VMware filesystem";
public static string XFSFilesystemPlugin = "XFS Filesystem Plugin";
public static string XiaFilesystem = "Xia filesystem";
public static string ZFSFilesystemPlugin = "ZFS Filesystem Plugin";
// Supported filesystems that can read their contents
public static string AppleDOSFileSystem = "Apple DOS File System";
public static string AppleLisaFileSystem = "Apple Lisa File System";
public static string AppleMacintoshFileSystem = "Apple Macintosh File System";
public static string CPMFileSystem = "CP/M File System";
public static string FATXFilesystemPlugin = "FATX Filesystem Plugin";
public static string ISO9660Filesystem = "ISO9660 Filesystem";
public static string MicrosoftFileAllocationTable = "Microsoft File Allocation Table";
public static string OperaFilesystemPlugin = "Opera Filesystem Plugin";
public static string UCSDPascalFilesystem = "U.C.S.D.Pascal filesystem";
// Supported partitioning schemes
public static string AcornFileCorePartitions = "Acorn FileCore partitions";
public static string ACTApricotPartitions = "ACT Apricot partitions";
public static string AmigaRigidDiskBlock = "Amiga Rigid Disk Block";
public static string ApplePartitionMap = "Apple Partition Map";
public static string AtariPartitions = "Atari partitions";
public static string BSDDisklabel = "BSD disklabel";
public static string DECDisklabel = "DEC disklabel";
public static string DragonFlyBSD64bitDisklabel = "DragonFly BSD 64-bit disklabel";
public static string GUIDPartitionTable = "GUID Partition Table";
public static string Human68kPartitions = "Human 68k partitions";
public static string MasterBootRecord = "Master Boot Record";
public static string NECPC9800PartitionTable = "NEC PC-9800 partition table";
public static string NeXTDisklabel = "NeXT Disklabel";
public static string Plan9PartitionTable = "Plan9 partition table";
public static string RioKarmaPartitioning = "Rio Karma partitioning";
public static string SGIDiskVolumeHeader = "SGI Disk Volume Header";
public static string SunDisklabel = "Sun Disklabel";
public static string UNIXHardwired = "UNIX hardwired";
public static string UNIXVTOC = "UNIX VTOC";
public static string XboxPartitioning = "Xbox partitioning";
public static string XENIX = "XENIX";
}
/// <summary>
/// Supported namespaces for DiscImageChef
/// </summary>
public static class ChefNamespaceStrings
{
// Namespaces for Apple Lisa File System
public static string LisaOfficeSystem = "office";
public static string LisaPascalWorkshop = "workshop";
// Namespaces for ISO9660 Filesystem
public static string JolietVolumeDescriptor = "joliet";
public static string PrimaryVolumeDescriptor = "normal";
public static string PrimaryVolumeDescriptorwithEncoding = "romeo";
public static string RockRidge = "rrip";
public static string PrimaryVolumeDescriptorVersionSuffix = "vms";
// Namespaces for Microsoft File Allocation Table
public static string DOS = "dos";
public static string LFNWhenAvailable = "ecs";
public static string LongFileNames = "lfn";
public static string WindowsNT = "nt";
public static string OS2Extended = "os2";
}
/// <summary>
/// Supported options for DiscImageChef
/// </summary>
public static class ChefOptionStrings
{
// ACT Apricot Disk Image
public static string ACTApricotDiskImageCompress = "compress"; // boolean, default false
// Apple DiskCopy 4.2
public static string AppleDiskCopyMacOSX = "macosx"; // boolean, default false
// CDRDAO tocfile
public static string CDRDAOTocfileSeparate = "separate"; // boolean, default false
// CDRWin cuesheet
public static string CDRWinCuesheetSeparate = "separate"; // boolean, default false
// DiscImageChef format
public static string DiscImageChefDeduplicate = "deduplicate"; // boolean, default true
public static string DiscImageChefDictionary = "dictionary"; // number, default 33554432
public static string DiscImageChefMaxDDTSize = "max_ddt_size"; // number, default 256
public static string DiscImageChefMD5 = "md5"; // boolean, default false
public static string DiscImageChefNoCompress = "nocompress"; // boolean, default false
public static string DiscImageChefSectorsPerBlock = "sectors_per_block"; // number, default 4096
public static string DiscImageChefSHA1 = "sha1"; // boolean, default false
public static string DiscImageChefSHA256 = "sha256"; // boolean, default false
public static string DiscImageChefSpamSum = "spamsum"; // boolean, default false
// VMware disk image
public static string VMwareDiskImageAdapterType = "adapter_type"; // string, default ide
public static string VMwareDiskImageHWVersion = "hwversion"; // number, default 4
public static string VMwareDiskImageSparse = "sparse"; // boolean, default false
public static string VMwareDiskImageSplit = "split"; // boolean, default false
}
/// <summary>
/// Top-level commands for DiscImageCreator
/// </summary>
@@ -44,7 +496,6 @@
public const string D8Opcode = "/d8";
public const string DisableBeep = "/q";
public const string ForceUnitAccess = "/f";
public const string MCN = "/m";
public const string MultiSession = "/ms";
public const string NoFixSubP = "/np";
public const string NoFixSubQ = "/nq";

View File

@@ -18,6 +18,143 @@
AddOns = 11,
}
/// <summary>
/// Supported DiscImageChef commands
/// </summary>
public enum ChefCommand
{
NONE = 0,
// Database Family
DatabaseStats,
DatabaseUpdate,
// Device Family
DeviceInfo,
DeviceList,
DeviceReport,
// Filesystem Family
FilesystemExtract,
FilesystemList,
FilesystemOptions,
// Image Family
ImageAnalyze,
ImageChecksum,
ImageCompare,
ImageConvert,
ImageCreateSidecar,
ImageDecode,
ImageEntropy,
ImageInfo,
ImageOptions,
ImagePrint,
ImageVerify,
// Media Family
MediaDump,
MediaInfo,
MediaScan,
// Standalone Commands
Configure,
Formats,
ListEncodings,
ListNamespaces,
Remote,
}
/// <summary>
/// Supported DiscImageChef flags
/// </summary>
public enum ChefFlag
{
NONE = 0,
// Boolean flags
Adler32,
Clear,
ClearAll,
CRC16,
CRC32,
CRC64,
Debug,
DiskTags,
DuplicatedSectors,
ExtendedAttributes,
Filesystems,
FirstPregap,
FixOffset,
Fletcher16,
Fletcher32,
Force,
LongFormat,
LongSectors,
MD5,
Metadata,
Partitions,
Persistent,
Resume,
SectorTags,
SeparatedTracks,
SHA1,
SHA256,
SHA384,
SHA512,
SpamSum,
StopOnError,
Tape,
Trim,
Verbose,
VerifyDisc,
VerifySectors,
WholeDisc,
// Int8 flags
Speed,
// Int16 flags
RetryPasses,
Width,
// Int32 flags
BlockSize,
Count,
MediaLastSequence,
MediaSequence,
Skip,
// Int64 flags
Length,
Start,
// String flags
Comments,
Creator,
DriveManufacturer,
DriveModel,
DriveRevision,
DriveSerial,
Encoding,
FormatConvert,
FormatDump,
ImgBurnLog,
MediaBarcode,
MediaManufacturer,
MediaModel,
MediaPartNumber,
MediaSerial,
MediaTitle,
MHDDLog,
Namespace,
Options,
OutputPrefix,
ResumeFile,
Subchannel,
XMLSidecar,
}
/// <summary>
/// Supported DiscImageCreator commands
/// </summary>
@@ -64,7 +201,6 @@
D8Opcode,
DisableBeep,
ForceUnitAccess,
MCN,
MultiSession,
NoFixSubP,
NoFixSubQ,

File diff suppressed because it is too large Load Diff

View File

@@ -465,9 +465,14 @@ namespace DICUI.Utilities
/// Get the default extension for a given disc type
/// </summary>
/// <param name="type">MediaType value to check</param>
/// <param name="useChef">Whether or not DiscImageChef is being used</param>
/// <returns>Valid extension (with leading '.'), null on error</returns>
public static string Extension(this MediaType? type)
public static string Extension(this MediaType? type, bool useChef)
{
// DiscImageChef has a single, unified output format by default
if (useChef)
return ".dicf";
switch (type)
{
case MediaType.CDROM:
@@ -540,6 +545,254 @@ namespace DICUI.Utilities
}
}
/// <summary>
/// Get the string representation of the ChefCommand enum values
/// </summary>
/// <param name="command">ChefCommand value to convert</param>
/// <returns>String representing the value, if possible</returns>
public static string LongName(this ChefCommand command)
{
switch (command)
{
// Database Family
case ChefCommand.DatabaseStats:
return $"{ChefCommandStrings.DatabasePrefixLong} {ChefCommandStrings.DatabaseStats}";
case ChefCommand.DatabaseUpdate:
return $"{ChefCommandStrings.DatabasePrefixLong} {ChefCommandStrings.DatabaseUpdate}";
// Device Family
case ChefCommand.DeviceInfo:
return $"{ChefCommandStrings.DevicePrefixLong} {ChefCommandStrings.DeviceInfo}";
case ChefCommand.DeviceList:
return $"{ChefCommandStrings.DevicePrefixLong} {ChefCommandStrings.DeviceList}";
case ChefCommand.DeviceReport:
return $"{ChefCommandStrings.DevicePrefixLong} {ChefCommandStrings.DeviceReport}";
// Filesystem Family
case ChefCommand.FilesystemExtract:
return $"{ChefCommandStrings.FilesystemPrefixLong} {ChefCommandStrings.FilesystemExtract}";
case ChefCommand.FilesystemList:
return $"{ChefCommandStrings.FilesystemPrefixLong} {ChefCommandStrings.FilesystemListLong}";
case ChefCommand.FilesystemOptions:
return $"{ChefCommandStrings.FilesystemPrefixLong} {ChefCommandStrings.FilesystemOptions}";
// Image Family
case ChefCommand.ImageAnalyze:
return $"{ChefCommandStrings.ImagePrefixLong} {ChefCommandStrings.ImageAnalyze}";
case ChefCommand.ImageChecksum:
return $"{ChefCommandStrings.ImagePrefixLong} {ChefCommandStrings.ImageChecksumLong}";
case ChefCommand.ImageCompare:
return $"{ChefCommandStrings.ImagePrefixLong} {ChefCommandStrings.ImageCompareLong}";
case ChefCommand.ImageConvert:
return $"{ChefCommandStrings.ImagePrefixLong} {ChefCommandStrings.ImageConvert}";
case ChefCommand.ImageCreateSidecar:
return $"{ChefCommandStrings.ImagePrefixLong} {ChefCommandStrings.ImageCreateSidecar}";
case ChefCommand.ImageDecode:
return $"{ChefCommandStrings.ImagePrefixLong} {ChefCommandStrings.ImageDecode}";
case ChefCommand.ImageEntropy:
return $"{ChefCommandStrings.ImagePrefixLong} {ChefCommandStrings.ImageEntropy}";
case ChefCommand.ImageInfo:
return $"{ChefCommandStrings.ImagePrefixLong} {ChefCommandStrings.ImageInfo}";
case ChefCommand.ImageOptions:
return $"{ChefCommandStrings.ImagePrefixLong} {ChefCommandStrings.ImageOptions}";
case ChefCommand.ImagePrint:
return $"{ChefCommandStrings.ImagePrefixLong} {ChefCommandStrings.ImagePrint}";
case ChefCommand.ImageVerify:
return $"{ChefCommandStrings.ImagePrefixLong} {ChefCommandStrings.ImageVerify}";
// Media Family
case ChefCommand.MediaDump:
return $"{ChefCommandStrings.MediaPrefixLong} {ChefCommandStrings.MediaDump}";
case ChefCommand.MediaInfo:
return $"{ChefCommandStrings.MediaPrefixLong} {ChefCommandStrings.MediaInfo}";
case ChefCommand.MediaScan:
return $"{ChefCommandStrings.MediaPrefixLong} {ChefCommandStrings.MediaScan}";
// Standalone Commands
case ChefCommand.Configure:
return ChefCommandStrings.Configure;
case ChefCommand.Formats:
return ChefCommandStrings.Formats;
case ChefCommand.ListEncodings:
return ChefCommandStrings.ListEncodings;
case ChefCommand.ListNamespaces:
return ChefCommandStrings.ListNamespaces;
case ChefCommand.Remote:
return ChefCommandStrings.Remote;
case ChefCommand.NONE:
default:
return "";
}
}
/// <summary>
/// Get the string representation of the ChefFlag enum values
/// </summary>
/// <param name="command">ChefFlag value to convert</param>
/// <returns>String representing the value, if possible</returns>
public static string LongName(this ChefFlag flag)
{
switch (flag)
{
// Boolean flags
case ChefFlag.Adler32:
return ChefFlagStrings.Adler32Long;
case ChefFlag.Clear:
return ChefFlagStrings.ClearLong;
case ChefFlag.ClearAll:
return ChefFlagStrings.ClearAllLong;
case ChefFlag.CRC16:
return ChefFlagStrings.CRC16Long;
case ChefFlag.CRC32:
return ChefFlagStrings.CRC32Long;
case ChefFlag.CRC64:
return ChefFlagStrings.CRC64Long;
case ChefFlag.Debug:
return ChefFlagStrings.DebugLong;
case ChefFlag.DiskTags:
return ChefFlagStrings.DiskTagsLong;
case ChefFlag.DuplicatedSectors:
return ChefFlagStrings.DuplicatedSectorsLong;
case ChefFlag.ExtendedAttributes:
return ChefFlagStrings.ExtendedAttributesLong;
case ChefFlag.Filesystems:
return ChefFlagStrings.FilesystemsLong;
case ChefFlag.FirstPregap:
return ChefFlagStrings.FirstPregapLong;
case ChefFlag.FixOffset:
return ChefFlagStrings.FixOffsetLong;
case ChefFlag.Fletcher16:
return ChefFlagStrings.Fletcher16Long;
case ChefFlag.Fletcher32:
return ChefFlagStrings.Fletcher32Long;
case ChefFlag.Force:
return ChefFlagStrings.ForceLong;
case ChefFlag.LongFormat:
return ChefFlagStrings.LongFormatLong;
case ChefFlag.LongSectors:
return ChefFlagStrings.LongSectorsLong;
case ChefFlag.MD5:
return ChefFlagStrings.MD5Long;
case ChefFlag.Metadata:
return ChefFlagStrings.MetadataLong;
case ChefFlag.Partitions:
return ChefFlagStrings.PartitionsLong;
case ChefFlag.Persistent:
return ChefFlagStrings.PersistentLong;
case ChefFlag.Resume:
return ChefFlagStrings.ResumeLong;
case ChefFlag.SectorTags:
return ChefFlagStrings.SectorTagsLong;
case ChefFlag.SeparatedTracks:
return ChefFlagStrings.SeparatedTracksLong;
case ChefFlag.SHA1:
return ChefFlagStrings.SHA1Long;
case ChefFlag.SHA256:
return ChefFlagStrings.SHA256Long;
case ChefFlag.SHA384:
return ChefFlagStrings.SHA384Long;
case ChefFlag.SHA512:
return ChefFlagStrings.SHA512Long;
case ChefFlag.SpamSum:
return ChefFlagStrings.SpamSumLong;
case ChefFlag.StopOnError:
return ChefFlagStrings.StopOnErrorLong;
case ChefFlag.Tape:
return ChefFlagStrings.TapeLong;
case ChefFlag.Trim:
return ChefFlagStrings.TrimLong;
case ChefFlag.Verbose:
return ChefFlagStrings.VerboseLong;
case ChefFlag.VerifyDisc:
return ChefFlagStrings.VerifyDiscLong;
case ChefFlag.VerifySectors:
return ChefFlagStrings.VerifySectorsLong;
case ChefFlag.WholeDisc:
return ChefFlagStrings.WholeDiscLong;
// Int8 flags
case ChefFlag.Speed:
return ChefFlagStrings.SpeedLong;
// Int16 flags
case ChefFlag.RetryPasses:
return ChefFlagStrings.RetryPassesLong;
case ChefFlag.Width:
return ChefFlagStrings.WidthLong;
// Int32 flags
case ChefFlag.BlockSize:
return ChefFlagStrings.BlockSizeLong;
case ChefFlag.Count:
return ChefFlagStrings.CountLong;
case ChefFlag.MediaLastSequence:
return ChefFlagStrings.MediaLastSequenceLong;
case ChefFlag.MediaSequence:
return ChefFlagStrings.MediaSequenceLong;
case ChefFlag.Skip:
return ChefFlagStrings.SkipLong;
// Int64 flags
case ChefFlag.Length:
return ChefFlagStrings.LengthLong;
case ChefFlag.Start:
return ChefFlagStrings.StartLong;
// String flags
case ChefFlag.Comments:
return ChefFlagStrings.CommentsLong;
case ChefFlag.Creator:
return ChefFlagStrings.CreatorLong;
case ChefFlag.DriveManufacturer:
return ChefFlagStrings.DriveManufacturerLong;
case ChefFlag.DriveModel:
return ChefFlagStrings.DriveModelLong;
case ChefFlag.DriveRevision:
return ChefFlagStrings.DriveRevisionLong;
case ChefFlag.DriveSerial:
return ChefFlagStrings.DriveSerialLong;
case ChefFlag.Encoding:
return ChefFlagStrings.EncodingLong;
case ChefFlag.FormatConvert:
return ChefFlagStrings.FormatConvertLong;
case ChefFlag.FormatDump:
return ChefFlagStrings.FormatDumpLong;
case ChefFlag.ImgBurnLog:
return ChefFlagStrings.ImgBurnLogLong;
case ChefFlag.MediaBarcode:
return ChefFlagStrings.MediaBarcodeLong;
case ChefFlag.MediaManufacturer:
return ChefFlagStrings.MediaManufacturerLong;
case ChefFlag.MediaModel:
return ChefFlagStrings.MediaModelLong;
case ChefFlag.MediaPartNumber:
return ChefFlagStrings.MediaPartNumberLong;
case ChefFlag.MediaSerial:
return ChefFlagStrings.MediaSerialLong;
case ChefFlag.MediaTitle:
return ChefFlagStrings.MediaTitleLong;
case ChefFlag.MHDDLog:
return ChefFlagStrings.MHDDLogLong;
case ChefFlag.Namespace:
return ChefFlagStrings.NamespaceLong;
case ChefFlag.Options:
return ChefFlagStrings.OptionsLong;
case ChefFlag.OutputPrefix:
return ChefFlagStrings.OutputPrefixLong;
case ChefFlag.ResumeFile:
return ChefFlagStrings.ResumeFileLong;
case ChefFlag.Subchannel:
return ChefFlagStrings.SubchannelLong;
case ChefFlag.XMLSidecar:
return ChefFlagStrings.XMLSidecarLong;
case ChefFlag.NONE:
default:
return "";
}
}
/// <summary>
/// Get the string representation of the CreatorCommand enum values
/// </summary>
@@ -629,8 +882,6 @@ namespace DICUI.Utilities
return CreatorFlagStrings.DisableBeep;
case CreatorFlag.ForceUnitAccess:
return CreatorFlagStrings.ForceUnitAccess;
case CreatorFlag.MCN:
return CreatorFlagStrings.MCN;
case CreatorFlag.MultiSession:
return CreatorFlagStrings.MultiSession;
case CreatorFlag.NoFixSubP:
@@ -2263,6 +2514,132 @@ namespace DICUI.Utilities
}
}
/// <summary>
/// Get the ChefCommand enum value for a given string
/// </summary>
/// <param name="commandOne">First part of String value to convert</param>
/// <param name="commandTwo">Second part of String value to convert</param>
/// <param name="useSecond">Output bool if the second command was used</param>
/// <returns>ChefCommand represented by the string(s), if possible</returns>
public static ChefCommand StringToChefCommand(string commandOne, string commandTwo, out bool useSecond)
{
useSecond = false;
switch (commandOne)
{
// Database Family
case ChefCommandStrings.DatabasePrefixShort:
case ChefCommandStrings.DatabasePrefixLong:
useSecond = true;
switch (commandTwo)
{
case ChefCommandStrings.DatabaseStats:
return ChefCommand.DatabaseStats;
case ChefCommandStrings.DatabaseUpdate:
return ChefCommand.DatabaseUpdate;
}
break;
// Device Family
case ChefCommandStrings.DevicePrefixShort:
case ChefCommandStrings.DevicePrefixLong:
useSecond = true;
switch (commandTwo)
{
case ChefCommandStrings.DeviceInfo:
return ChefCommand.DeviceInfo;
case ChefCommandStrings.DeviceList:
return ChefCommand.DeviceList;
case ChefCommandStrings.DeviceReport:
return ChefCommand.DeviceReport;
}
break;
// Filesystem Family
case ChefCommandStrings.FilesystemPrefixShort:
case ChefCommandStrings.FilesystemPrefixShortAlt:
case ChefCommandStrings.FilesystemPrefixLong:
useSecond = true;
switch (commandTwo)
{
case ChefCommandStrings.FilesystemExtract:
return ChefCommand.FilesystemExtract;
case ChefCommandStrings.FilesystemListShort:
case ChefCommandStrings.FilesystemListLong:
return ChefCommand.FilesystemList;
case ChefCommandStrings.DatabaseStats:
return ChefCommand.FilesystemOptions;
}
break;
// Image Family
case ChefCommandStrings.ImagePrefixShort:
case ChefCommandStrings.ImagePrefixLong:
useSecond = true;
switch (commandTwo)
{
case ChefCommandStrings.ImageAnalyze:
return ChefCommand.ImageAnalyze;
case ChefCommandStrings.ImageChecksumShort:
case ChefCommandStrings.ImageChecksumLong:
return ChefCommand.ImageChecksum;
case ChefCommandStrings.ImageCompareShort:
case ChefCommandStrings.ImageCompareLong:
return ChefCommand.ImageCompare;
case ChefCommandStrings.ImageConvert:
return ChefCommand.ImageConvert;
case ChefCommandStrings.ImageCreateSidecar:
return ChefCommand.ImageCreateSidecar;
case ChefCommandStrings.ImageDecode:
return ChefCommand.ImageDecode;
case ChefCommandStrings.ImageEntropy:
return ChefCommand.ImageEntropy;
case ChefCommandStrings.ImageInfo:
return ChefCommand.ImageInfo;
case ChefCommandStrings.ImageOptions:
return ChefCommand.ImageOptions;
case ChefCommandStrings.ImagePrint:
return ChefCommand.ImagePrint;
case ChefCommandStrings.ImageVerify:
return ChefCommand.ImageVerify;
}
break;
// Media Family
case ChefCommandStrings.MediaPrefixShort:
case ChefCommandStrings.MediaPrefixLong:
useSecond = true;
switch (commandTwo)
{
case ChefCommandStrings.MediaDump:
return ChefCommand.MediaDump;
case ChefCommandStrings.MediaInfo:
return ChefCommand.MediaInfo;
case ChefCommandStrings.MediaScan:
return ChefCommand.MediaScan;
}
break;
// Standalone Commands
case ChefCommandStrings.Configure:
return ChefCommand.Configure;
case ChefCommandStrings.Formats:
return ChefCommand.Formats;
case ChefCommandStrings.ListEncodings:
return ChefCommand.ListEncodings;
case ChefCommandStrings.ListNamespaces:
return ChefCommand.ListNamespaces;
case ChefCommandStrings.Remote:
return ChefCommand.Remote;
}
return ChefCommand.NONE;
}
/// <summary>
/// Get the KnownSystem enum value for a given string
/// </summary>

View File

@@ -8,7 +8,7 @@ using DICUI.Data;
namespace DICUI.Utilities
{
/// <summary>
/// Represents a generic set of DiscImageCreator parameters
/// Represents a generic set of DiscImageCreator parameters
/// </summary>
public class CreatorParameters
{
@@ -66,7 +66,7 @@ namespace DICUI.Utilities
}
internal IEnumerable<CreatorFlag> Keys => _flags.Keys;
#region DIC Flag Values
#region DiscImageCreator Flag Values
/// <summary>
/// Manual offset for Audio CD
@@ -122,7 +122,7 @@ namespace DICUI.Utilities
#endregion
/// <summary>
/// Populate a Parameters object from a param string
/// Populate a CreatorParameters object from a param string
/// </summary>
/// <param name="parameters">String possibly representing a set of parameters</param>
public CreatorParameters(string parameters)
@@ -342,8 +342,7 @@ namespace DICUI.Utilities
}
// Add Offset
if (Command == CreatorCommand.Audio
|| Command == CreatorCommand.CompactDisc)
if (GetSupportedCommands(CreatorFlag.AddOffset).Contains(Command))
{
if (this[CreatorFlag.AddOffset])
{
@@ -356,25 +355,21 @@ namespace DICUI.Utilities
}
// AMSF Dumping
if (Command == CreatorCommand.CompactDisc)
if (GetSupportedCommands(CreatorFlag.AMSF).Contains(Command))
{
if (this[CreatorFlag.AMSF])
parameters.Add(CreatorFlag.AMSF.LongName());
}
// Atari Jaguar CD
if (Command == CreatorCommand.CompactDisc)
if (GetSupportedCommands(CreatorFlag.AtariJaguar).Contains(Command))
{
if (this[CreatorFlag.AtariJaguar])
parameters.Add(CreatorFlag.AtariJaguar.LongName());
}
// BE Opcode
if (Command == CreatorCommand.Audio
|| Command == CreatorCommand.CompactDisc
|| Command == CreatorCommand.Data
|| Command == CreatorCommand.GDROM
|| Command == CreatorCommand.Swap)
if (GetSupportedCommands(CreatorFlag.BEOpcode).Contains(Command))
{
if (this[CreatorFlag.BEOpcode] && !this[CreatorFlag.D8Opcode])
{
@@ -386,11 +381,7 @@ namespace DICUI.Utilities
}
// C2 Opcode
if (Command == CreatorCommand.Audio
|| Command == CreatorCommand.CompactDisc
|| Command == CreatorCommand.Data
|| Command == CreatorCommand.GDROM
|| Command == CreatorCommand.Swap)
if (GetSupportedCommands(CreatorFlag.C2Opcode).Contains(Command))
{
if (this[CreatorFlag.C2Opcode])
{
@@ -427,45 +418,28 @@ namespace DICUI.Utilities
}
// Copyright Management Information
if (Command == CreatorCommand.DigitalVideoDisc)
if (GetSupportedCommands(CreatorFlag.CopyrightManagementInformation).Contains(Command))
{
if (this[CreatorFlag.CopyrightManagementInformation])
parameters.Add(CreatorFlag.CopyrightManagementInformation.LongName());
}
// D8 Opcode
if (Command == CreatorCommand.Audio
|| Command == CreatorCommand.CompactDisc
|| Command == CreatorCommand.Data
|| Command == CreatorCommand.GDROM
|| Command == CreatorCommand.Swap)
if (GetSupportedCommands(CreatorFlag.D8Opcode).Contains(Command))
{
if (this[CreatorFlag.D8Opcode])
parameters.Add(CreatorFlag.D8Opcode.LongName());
}
// Disable Beep
if (Command == CreatorCommand.Audio
|| Command == CreatorCommand.BluRay
|| Command == CreatorCommand.CompactDisc
|| Command == CreatorCommand.Data
|| Command == CreatorCommand.DigitalVideoDisc
|| Command == CreatorCommand.GDROM
|| Command == CreatorCommand.Swap
|| Command == CreatorCommand.XBOX)
if (GetSupportedCommands(CreatorFlag.DisableBeep).Contains(Command))
{
if (this[CreatorFlag.DisableBeep])
parameters.Add(CreatorFlag.DisableBeep.LongName());
}
// Force Unit Access
if (Command == CreatorCommand.Audio
|| Command == CreatorCommand.BluRay
|| Command == CreatorCommand.CompactDisc
|| Command == CreatorCommand.Data
|| Command == CreatorCommand.DigitalVideoDisc
|| Command == CreatorCommand.Swap
|| Command == CreatorCommand.XBOX)
if (GetSupportedCommands(CreatorFlag.ForceUnitAccess).Contains(Command))
{
if (this[CreatorFlag.ForceUnitAccess])
{
@@ -475,80 +449,50 @@ namespace DICUI.Utilities
}
}
// MCN
if (Command == CreatorCommand.CompactDisc)
{
if (this[CreatorFlag.MCN])
parameters.Add(CreatorFlag.MCN.LongName());
}
// Multi-Session
if (Command == CreatorCommand.CompactDisc)
if (GetSupportedCommands(CreatorFlag.MultiSession).Contains(Command))
{
if (this[CreatorFlag.MultiSession])
parameters.Add(CreatorFlag.MultiSession.LongName());
}
// Not fix SubP
if (Command == CreatorCommand.Audio
|| Command == CreatorCommand.CompactDisc
|| Command == CreatorCommand.Data
|| Command == CreatorCommand.GDROM
|| Command == CreatorCommand.Swap)
if (GetSupportedCommands(CreatorFlag.NoFixSubP).Contains(Command))
{
if (this[CreatorFlag.NoFixSubP])
parameters.Add(CreatorFlag.NoFixSubP.LongName());
}
// Not fix SubQ
if (Command == CreatorCommand.Audio
|| Command == CreatorCommand.CompactDisc
|| Command == CreatorCommand.Data
|| Command == CreatorCommand.GDROM
|| Command == CreatorCommand.Swap)
if (GetSupportedCommands(CreatorFlag.NoFixSubQ).Contains(Command))
{
if (this[CreatorFlag.NoFixSubQ])
parameters.Add(CreatorFlag.NoFixSubQ.LongName());
}
// Not fix SubQ (PlayStation LibCrypt)
if (Command == CreatorCommand.Audio
|| Command == CreatorCommand.CompactDisc
|| Command == CreatorCommand.Data
|| Command == CreatorCommand.GDROM
|| Command == CreatorCommand.Swap)
if (GetSupportedCommands(CreatorFlag.NoFixSubQLibCrypt).Contains(Command))
{
if (this[CreatorFlag.NoFixSubQLibCrypt])
parameters.Add(CreatorFlag.NoFixSubQLibCrypt.LongName());
}
// Not fix SubQ (SecuROM)
if (Command == CreatorCommand.Audio
|| Command == CreatorCommand.CompactDisc
|| Command == CreatorCommand.Data
|| Command == CreatorCommand.GDROM
|| Command == CreatorCommand.Swap)
if (GetSupportedCommands(CreatorFlag.NoFixSubQSecuROM).Contains(Command))
{
if (this[CreatorFlag.NoFixSubQSecuROM])
parameters.Add(CreatorFlag.NoFixSubQSecuROM.LongName());
}
// Not fix SubRtoW
if (Command == CreatorCommand.Audio
|| Command == CreatorCommand.CompactDisc
|| Command == CreatorCommand.Data
|| Command == CreatorCommand.GDROM
|| Command == CreatorCommand.Swap)
if (GetSupportedCommands(CreatorFlag.NoFixSubRtoW).Contains(Command))
{
if (this[CreatorFlag.NoFixSubRtoW])
parameters.Add(CreatorFlag.NoFixSubRtoW.LongName());
}
// Not skip security sectors
if (Command == CreatorCommand.XBOX
|| Command == CreatorCommand.XBOXSwap
|| Command == CreatorCommand.XGD2Swap
|| Command == CreatorCommand.XGD3Swap)
if (GetSupportedCommands(CreatorFlag.NoSkipSS).Contains(Command))
{
if (this[CreatorFlag.NoSkipSS])
{
@@ -559,35 +503,28 @@ namespace DICUI.Utilities
}
// Raw read (2064 byte/sector)
if (Command == CreatorCommand.DigitalVideoDisc)
if (GetSupportedCommands(CreatorFlag.Raw).Contains(Command))
{
if (this[CreatorFlag.Raw])
parameters.Add(CreatorFlag.Raw.LongName());
}
// Reverse read
if (Command == CreatorCommand.CompactDisc
|| Command == CreatorCommand.Data
|| Command == CreatorCommand.DigitalVideoDisc)
if (GetSupportedCommands(CreatorFlag.Reverse).Contains(Command))
{
if (this[CreatorFlag.Reverse])
parameters.Add(CreatorFlag.Reverse.LongName());
}
// Scan PlayStation anti-mod strings
if (Command == CreatorCommand.CompactDisc
|| Command == CreatorCommand.Data)
if (GetSupportedCommands(CreatorFlag.ScanAntiMod).Contains(Command))
{
if (this[CreatorFlag.ScanAntiMod])
parameters.Add(CreatorFlag.ScanAntiMod.LongName());
}
// Scan file to detect protect
if (Command == CreatorCommand.Audio
|| Command == CreatorCommand.CompactDisc
|| Command == CreatorCommand.Data
|| Command == CreatorCommand.DigitalVideoDisc
|| Command == CreatorCommand.Swap)
if (GetSupportedCommands(CreatorFlag.ScanFileProtect).Contains(Command))
{
if (this[CreatorFlag.ScanFileProtect])
{
@@ -603,23 +540,21 @@ namespace DICUI.Utilities
}
// Scan file to detect protect
if (Command == CreatorCommand.CompactDisc
|| Command == CreatorCommand.Data
|| Command == CreatorCommand.Swap)
if (GetSupportedCommands(CreatorFlag.ScanSectorProtect).Contains(Command))
{
if (this[CreatorFlag.ScanSectorProtect])
parameters.Add(CreatorFlag.ScanSectorProtect.LongName());
}
// Scan 74:00:00 (Saturn)
if (Command == CreatorCommand.Swap)
if (GetSupportedCommands(CreatorFlag.SeventyFour).Contains(Command))
{
if (this[CreatorFlag.SeventyFour])
parameters.Add(CreatorFlag.SeventyFour.LongName());
}
// Skip sectors
if (Command == CreatorCommand.Data)
if (GetSupportedCommands(CreatorFlag.SkipSector).Contains(Command))
{
if (this[CreatorFlag.SkipSector])
{
@@ -640,11 +575,7 @@ namespace DICUI.Utilities
}
// Set Subchannel read level
if (Command == CreatorCommand.Audio
|| Command == CreatorCommand.CompactDisc
|| Command == CreatorCommand.Data
|| Command == CreatorCommand.GDROM
|| Command == CreatorCommand.Swap)
if (GetSupportedCommands(CreatorFlag.SubchannelReadLevel).Contains(Command))
{
if (this[CreatorFlag.SubchannelReadLevel])
{
@@ -660,7 +591,7 @@ namespace DICUI.Utilities
}
// VideoNow
if (Command == CreatorCommand.CompactDisc)
if (GetSupportedCommands(CreatorFlag.VideoNow).Contains(Command))
{
if (this[CreatorFlag.VideoNow])
{
@@ -676,7 +607,7 @@ namespace DICUI.Utilities
}
// VideoNow Color
if (Command == CreatorCommand.CompactDisc)
if (GetSupportedCommands(CreatorFlag.VideoNowColor).Contains(Command))
{
if (this[CreatorFlag.VideoNowColor])
parameters.Add(CreatorFlag.VideoNowColor.LongName());
@@ -1103,8 +1034,7 @@ namespace DICUI.Utilities
switch (parts[i])
{
case CreatorFlagStrings.AddOffset:
if (parts[0] != CreatorCommandStrings.Audio
&& parts[0] != CreatorCommandStrings.CompactDisc)
if (!GetSupportedCommands(CreatorFlag.AddOffset).Contains(Command))
return false;
else if (!DoesExist(parts, i + 1))
return false;
@@ -1117,24 +1047,21 @@ namespace DICUI.Utilities
break;
case CreatorFlagStrings.AMSF:
if (parts[0] != CreatorCommandStrings.CompactDisc)
if (!GetSupportedCommands(CreatorFlag.AMSF).Contains(Command))
return false;
this[CreatorFlag.AMSF] = true;
break;
case CreatorFlagStrings.AtariJaguar:
if (parts[0] != CreatorCommandStrings.CompactDisc)
if (!GetSupportedCommands(CreatorFlag.AtariJaguar).Contains(Command))
return false;
this[CreatorFlag.AtariJaguar] = true;
break;
case CreatorFlagStrings.BEOpcode:
if (parts[0] != CreatorCommandStrings.Audio
&& parts[0] != CreatorCommandStrings.CompactDisc
&& parts[0] != CreatorCommandStrings.Data
&& parts[0] != CreatorCommandStrings.GDROM)
if (!GetSupportedCommands(CreatorFlag.BEOpcode).Contains(Command))
return false;
else if (!DoesExist(parts, i + 1))
{
@@ -1155,10 +1082,7 @@ namespace DICUI.Utilities
break;
case CreatorFlagStrings.C2Opcode:
if (parts[0] != CreatorCommandStrings.Audio
&& parts[0] != CreatorCommandStrings.CompactDisc
&& parts[0] != CreatorCommandStrings.Data
&& parts[0] != CreatorCommandStrings.GDROM)
if (!GetSupportedCommands(CreatorFlag.C2Opcode).Contains(Command))
return false;
this[CreatorFlag.C2Opcode] = true;
@@ -1180,43 +1104,28 @@ namespace DICUI.Utilities
break;
case CreatorFlagStrings.CopyrightManagementInformation:
if (parts[0] != CreatorCommandStrings.DigitalVideoDisc)
if (!GetSupportedCommands(CreatorFlag.CopyrightManagementInformation).Contains(Command))
return false;
this[CreatorFlag.CopyrightManagementInformation] = true;
break;
case CreatorFlagStrings.D8Opcode:
if (parts[0] != CreatorCommandStrings.Audio
&& parts[0] != CreatorCommandStrings.CompactDisc
&& parts[0] != CreatorCommandStrings.Data
&& parts[0] != CreatorCommandStrings.GDROM)
if (!GetSupportedCommands(CreatorFlag.D8Opcode).Contains(Command))
return false;
this[CreatorFlag.D8Opcode] = true;
break;
case CreatorFlagStrings.DisableBeep:
if (parts[0] != CreatorCommandStrings.Audio
&& parts[0] != CreatorCommandStrings.BluRay
&& parts[0] != CreatorCommandStrings.CompactDisc
&& parts[0] != CreatorCommandStrings.Data
&& parts[0] != CreatorCommandStrings.DigitalVideoDisc
&& parts[0] != CreatorCommandStrings.GDROM
&& parts[0] != CreatorCommandStrings.XBOX)
if (!GetSupportedCommands(CreatorFlag.DisableBeep).Contains(Command))
return false;
this[CreatorFlag.DisableBeep] = true;
break;
case CreatorFlagStrings.ForceUnitAccess:
if (parts[0] != CreatorCommandStrings.Audio
&& parts[0] != CreatorCommandStrings.BluRay
&& parts[0] != CreatorCommandStrings.CompactDisc
&& parts[0] != CreatorCommandStrings.DigitalVideoDisc
&& parts[0] != CreatorCommandStrings.Data
&& parts[0] != CreatorCommandStrings.GDROM
&& parts[0] != CreatorCommandStrings.XBOX)
if (!GetSupportedCommands(CreatorFlag.ForceUnitAccess).Contains(Command))
return false;
else if (!DoesExist(parts, i + 1))
{
@@ -1236,72 +1145,50 @@ namespace DICUI.Utilities
i++;
break;
case CreatorFlagStrings.MCN:
if (parts[0] != CreatorCommandStrings.CompactDisc)
return false;
this[CreatorFlag.MCN] = true;
break;
case CreatorFlagStrings.MultiSession:
if (parts[0] != CreatorCommandStrings.CompactDisc)
if (!GetSupportedCommands(CreatorFlag.MultiSession).Contains(Command))
return false;
this[CreatorFlag.MultiSession] = true;
break;
case CreatorFlagStrings.NoFixSubP:
if (parts[0] != CreatorCommandStrings.Audio
&& parts[0] != CreatorCommandStrings.CompactDisc
&& parts[0] != CreatorCommandStrings.Data
&& parts[0] != CreatorCommandStrings.GDROM)
if (!GetSupportedCommands(CreatorFlag.NoFixSubP).Contains(Command))
return false;
this[CreatorFlag.NoFixSubP] = true;
break;
case CreatorFlagStrings.NoFixSubQ:
if (parts[0] != CreatorCommandStrings.Audio
&& parts[0] != CreatorCommandStrings.CompactDisc
&& parts[0] != CreatorCommandStrings.Data
&& parts[0] != CreatorCommandStrings.GDROM)
if (!GetSupportedCommands(CreatorFlag.NoFixSubQ).Contains(Command))
return false;
this[CreatorFlag.NoFixSubQ] = true;
break;
case CreatorFlagStrings.NoFixSubQLibCrypt:
if (parts[0] != CreatorCommandStrings.CompactDisc)
if (!GetSupportedCommands(CreatorFlag.NoFixSubQLibCrypt).Contains(Command))
return false;
this[CreatorFlag.NoFixSubQLibCrypt] = true;
break;
case CreatorFlagStrings.NoFixSubRtoW:
if (parts[0] != CreatorCommandStrings.Audio
&& parts[0] != CreatorCommandStrings.CompactDisc
&& parts[0] != CreatorCommandStrings.Data
&& parts[0] != CreatorCommandStrings.GDROM)
if (!GetSupportedCommands(CreatorFlag.NoFixSubRtoW).Contains(Command))
return false;
this[CreatorFlag.NoFixSubRtoW] = true;
break;
case CreatorFlagStrings.NoFixSubQSecuROM:
if (parts[0] != CreatorCommandStrings.Audio
&& parts[0] != CreatorCommandStrings.CompactDisc
&& parts[0] != CreatorCommandStrings.Data
&& parts[0] != CreatorCommandStrings.GDROM)
if (!GetSupportedCommands(CreatorFlag.NoFixSubQSecuROM).Contains(Command))
return false;
this[CreatorFlag.NoFixSubQSecuROM] = true;
break;
case CreatorFlagStrings.NoSkipSS:
if (parts[0] != CreatorCommandStrings.XBOX
&& parts[0] != CreatorCommandStrings.XBOXSwap
&& parts[0] != CreatorCommandStrings.XGD2Swap
&& parts[0] != CreatorCommandStrings.XGD3Swap)
if (!GetSupportedCommands(CreatorFlag.NoSkipSS).Contains(Command))
return false;
else if (!DoesExist(parts, i + 1))
{
@@ -1322,32 +1209,28 @@ namespace DICUI.Utilities
break;
case CreatorFlagStrings.Raw:
if (parts[0] != CreatorCommandStrings.DigitalVideoDisc)
if (!GetSupportedCommands(CreatorFlag.Raw).Contains(Command))
return false;
this[CreatorFlag.Raw] = true;
break;
case CreatorFlagStrings.Reverse:
if (parts[0] != CreatorCommandStrings.CompactDisc
&& parts[0] != CreatorCommandStrings.Data
&& parts[0] != CreatorCommandStrings.DigitalVideoDisc)
if (!GetSupportedCommands(CreatorFlag.Reverse).Contains(Command))
return false;
this[CreatorFlag.Reverse] = true;
break;
case CreatorFlagStrings.ScanAntiMod:
if (parts[0] != CreatorCommandStrings.CompactDisc)
if (!GetSupportedCommands(CreatorFlag.ScanAntiMod).Contains(Command))
return false;
this[CreatorFlag.ScanAntiMod] = true;
break;
case CreatorFlagStrings.ScanFileProtect:
if (parts[0] != CreatorCommandStrings.CompactDisc
&& parts[0] != CreatorCommandStrings.Data
&& parts[0] != CreatorCommandStrings.DigitalVideoDisc)
if (!GetSupportedCommands(CreatorFlag.ScanFileProtect).Contains(Command))
return false;
else if (!DoesExist(parts, i + 1))
{
@@ -1368,22 +1251,21 @@ namespace DICUI.Utilities
break;
case CreatorFlagStrings.ScanSectorProtect:
if (parts[0] != CreatorCommandStrings.CompactDisc
&& parts[0] != CreatorCommandStrings.Data)
if (!GetSupportedCommands(CreatorFlag.ScanSectorProtect).Contains(Command))
return false;
this[CreatorFlag.ScanSectorProtect] = true;
break;
case CreatorFlagStrings.SeventyFour:
if (parts[0] != CreatorCommandStrings.Swap)
if (!GetSupportedCommands(CreatorFlag.SeventyFour).Contains(Command))
return false;
this[CreatorFlag.SeventyFour] = true;
break;
case CreatorFlagStrings.SkipSector:
if (parts[0] != CreatorCommandStrings.Data)
if (!GetSupportedCommands(CreatorFlag.SkipSector).Contains(Command))
return false;
else if (!DoesExist(parts, i + 1) || !DoesExist(parts, i + 2))
return false;
@@ -1399,10 +1281,7 @@ namespace DICUI.Utilities
break;
case CreatorFlagStrings.SubchannelReadLevel:
if (parts[0] != CreatorCommandStrings.Audio
&& parts[0] != CreatorCommandStrings.CompactDisc
&& parts[0] != CreatorCommandStrings.Data
&& parts[0] != CreatorCommandStrings.GDROM)
if (!GetSupportedCommands(CreatorFlag.SubchannelReadLevel).Contains(Command))
return false;
else if (!DoesExist(parts, i + 1))
{
@@ -1423,7 +1302,7 @@ namespace DICUI.Utilities
break;
case CreatorFlagStrings.VideoNow:
if (parts[0] != CreatorCommandStrings.CompactDisc)
if (!GetSupportedCommands(CreatorFlag.VideoNow).Contains(Command))
return false;
else if (!DoesExist(parts, i + 1))
{
@@ -1444,7 +1323,7 @@ namespace DICUI.Utilities
break;
case CreatorFlagStrings.VideoNowColor:
if (parts[0] != CreatorCommandStrings.CompactDisc)
if (!GetSupportedCommands(CreatorFlag.VideoNowColor).Contains(Command))
return false;
this[CreatorFlag.VideoNowColor] = true;
@@ -1460,18 +1339,174 @@ namespace DICUI.Utilities
}
/// <summary>
/// Returns whether a string is a valid drive letter
/// Returns whether or not the selected item exists
/// </summary>
/// <param name="parameter">String value to check</param>
/// <returns>True if it's a valid drive letter, false otherwise</returns>
private bool IsValidDriveLetter(string parameter)
/// <param name="parameters">List of parameters to check against</param>
/// <param name="index">Current index</param>
/// <returns>True if the next item exists, false otherwise</returns>
private bool DoesExist(List<string> parameters, int index)
{
if (!Regex.IsMatch(parameter, @"^[A-Z]:?\\?$"))
if (index >= parameters.Count)
return false;
return true;
}
/// <summary>
/// Get the list of commands that use a given flag
/// </summary>
/// <param name="flag">Flag value to get commands for</param>
/// <returns>List of ChefCommands, if possible</returns>
private List<CreatorCommand> GetSupportedCommands(CreatorFlag flag)
{
var commands = new List<CreatorCommand>();
switch (flag)
{
case CreatorFlag.AMSF:
commands.Add(CreatorCommand.CompactDisc);
break;
case CreatorFlag.AtariJaguar:
commands.Add(CreatorCommand.CompactDisc);
break;
case CreatorFlag.BEOpcode:
commands.Add(CreatorCommand.Audio);
commands.Add(CreatorCommand.CompactDisc);
commands.Add(CreatorCommand.Data);
commands.Add(CreatorCommand.GDROM);
commands.Add(CreatorCommand.Swap);
break;
case CreatorFlag.C2Opcode:
commands.Add(CreatorCommand.Audio);
commands.Add(CreatorCommand.CompactDisc);
commands.Add(CreatorCommand.Data);
commands.Add(CreatorCommand.GDROM);
commands.Add(CreatorCommand.Swap);
break;
case CreatorFlag.CopyrightManagementInformation:
commands.Add(CreatorCommand.DigitalVideoDisc);
break;
case CreatorFlag.D8Opcode:
commands.Add(CreatorCommand.Audio);
commands.Add(CreatorCommand.CompactDisc);
commands.Add(CreatorCommand.Data);
commands.Add(CreatorCommand.GDROM);
commands.Add(CreatorCommand.Swap);
break;
case CreatorFlag.DisableBeep:
commands.Add(CreatorCommand.Audio);
commands.Add(CreatorCommand.BluRay);
commands.Add(CreatorCommand.CompactDisc);
commands.Add(CreatorCommand.Data);
commands.Add(CreatorCommand.DigitalVideoDisc);
commands.Add(CreatorCommand.GDROM);
commands.Add(CreatorCommand.Swap);
commands.Add(CreatorCommand.XBOX);
break;
case CreatorFlag.ForceUnitAccess:
commands.Add(CreatorCommand.Audio);
commands.Add(CreatorCommand.BluRay);
commands.Add(CreatorCommand.CompactDisc);
commands.Add(CreatorCommand.Data);
commands.Add(CreatorCommand.DigitalVideoDisc);
commands.Add(CreatorCommand.Swap);
commands.Add(CreatorCommand.XBOX);
break;
case CreatorFlag.MultiSession:
commands.Add(CreatorCommand.CompactDisc);
break;
case CreatorFlag.NoFixSubP:
commands.Add(CreatorCommand.Audio);
commands.Add(CreatorCommand.CompactDisc);
commands.Add(CreatorCommand.Data);
commands.Add(CreatorCommand.GDROM);
commands.Add(CreatorCommand.Swap);
break;
case CreatorFlag.NoFixSubQ:
commands.Add(CreatorCommand.Audio);
commands.Add(CreatorCommand.CompactDisc);
commands.Add(CreatorCommand.Data);
commands.Add(CreatorCommand.GDROM);
commands.Add(CreatorCommand.Swap);
break;
case CreatorFlag.NoFixSubQLibCrypt:
commands.Add(CreatorCommand.Audio);
commands.Add(CreatorCommand.CompactDisc);
commands.Add(CreatorCommand.Data);
commands.Add(CreatorCommand.GDROM);
commands.Add(CreatorCommand.Swap);
break;
case CreatorFlag.NoFixSubQSecuROM:
commands.Add(CreatorCommand.Audio);
commands.Add(CreatorCommand.CompactDisc);
commands.Add(CreatorCommand.Data);
commands.Add(CreatorCommand.GDROM);
commands.Add(CreatorCommand.Swap);
break;
case CreatorFlag.NoFixSubRtoW:
commands.Add(CreatorCommand.Audio);
commands.Add(CreatorCommand.CompactDisc);
commands.Add(CreatorCommand.Data);
commands.Add(CreatorCommand.GDROM);
commands.Add(CreatorCommand.Swap);
break;
case CreatorFlag.NoSkipSS:
commands.Add(CreatorCommand.XBOX);
commands.Add(CreatorCommand.XBOXSwap);
commands.Add(CreatorCommand.XGD2Swap);
commands.Add(CreatorCommand.XGD3Swap);
break;
case CreatorFlag.Raw:
commands.Add(CreatorCommand.DigitalVideoDisc);
break;
case CreatorFlag.Reverse:
commands.Add(CreatorCommand.CompactDisc);
commands.Add(CreatorCommand.Data);
commands.Add(CreatorCommand.DigitalVideoDisc);
break;
case CreatorFlag.ScanAntiMod:
commands.Add(CreatorCommand.CompactDisc);
commands.Add(CreatorCommand.Data);
break;
case CreatorFlag.ScanFileProtect:
commands.Add(CreatorCommand.Audio);
commands.Add(CreatorCommand.CompactDisc);
commands.Add(CreatorCommand.Data);
commands.Add(CreatorCommand.DigitalVideoDisc);
commands.Add(CreatorCommand.Swap);
break;
case CreatorFlag.ScanSectorProtect:
commands.Add(CreatorCommand.CompactDisc);
commands.Add(CreatorCommand.Data);
commands.Add(CreatorCommand.Swap);
break;
case CreatorFlag.SeventyFour:
commands.Add(CreatorCommand.Swap);
break;
case CreatorFlag.SkipSector:
commands.Add(CreatorCommand.Data);
break;
case CreatorFlag.SubchannelReadLevel:
commands.Add(CreatorCommand.Audio);
commands.Add(CreatorCommand.CompactDisc);
commands.Add(CreatorCommand.Data);
commands.Add(CreatorCommand.GDROM);
commands.Add(CreatorCommand.Swap);
break;
case CreatorFlag.VideoNow:
commands.Add(CreatorCommand.CompactDisc);
break;
case CreatorFlag.VideoNowColor:
commands.Add(CreatorCommand.CompactDisc);
break;
case CreatorFlag.NONE:
default:
return commands;
}
return commands;
}
/// <summary>
/// Returns whether a string is a flag (starts with '/')
/// </summary>
@@ -1486,14 +1521,13 @@ namespace DICUI.Utilities
}
/// <summary>
/// Returns whether or not the selected item exists
/// Returns whether a string is a valid drive letter
/// </summary>
/// <param name="parameters">List of parameters to check against</param>
/// <param name="index">Current index</param>
/// <returns>True if the next item exists, false otherwise</returns>
private bool DoesExist(List<string> parameters, int index)
/// <param name="parameter">String value to check</param>
/// <returns>True if it's a valid drive letter, false otherwise</returns>
private bool IsValidDriveLetter(string parameter)
{
if (index >= parameters.Count)
if (!Regex.IsMatch(parameter, @"^[A-Z]:?\\?$"))
return false;
return true;
@@ -1640,9 +1674,6 @@ namespace DICUI.Utilities
this[CreatorFlag.VideoNow] = true;
this.VideoNowValue = 20832;
break;
case KnownSystem.NECPCEngineTurboGrafxCD:
this[CreatorFlag.MCN] = true;
break;
case KnownSystem.SonyPlayStation:
this[CreatorFlag.ScanAntiMod] = true;
this[CreatorFlag.NoFixSubQLibCrypt] = true;

View File

@@ -20,16 +20,26 @@ namespace DICUI.Utilities
{
#region Tool paths
/// <summary>
/// Path to DiscImageChef executable
/// </summary>
public string ChefPath { get; set; }
/// <summary>
/// Path to DiscImageCreator executable
/// </summary>
public string DICPath { get; set; }
public string CreatorPath { get; set; }
/// <summary>
/// Path to Subdump executable
/// </summary>
public string SubdumpPath { get; set; }
/// <summary>
/// Use DiscImageChef instead of DiscImageCreator
/// </summary>
public bool UseChef { get; set; }
#endregion
#region Output paths
@@ -63,11 +73,21 @@ namespace DICUI.Utilities
/// </summary>
public MediaType? Type { get; set; }
/// <summary>
/// Parameters object representing what to send to DiscImageChef
/// </summary>
public ChefParameters ChefParameters { get; set; }
/// <summary>
/// Parameters object representing what to send to DiscImageCreator
/// </summary>
public CreatorParameters CreatorParameters { get; set; }
/// <summary>
/// Scan for copy protection, where applicable
/// </summary>
public bool ScanForProtection { get; set; }
/// <summary>
/// Determines if placeholder values should be set for fields
/// </summary>
@@ -80,7 +100,7 @@ namespace DICUI.Utilities
#endregion
#region Extra DIC arguments
#region Extra DiscImageCreator arguments
/// <summary>
/// Enable quiet mode (no beeps)
@@ -92,11 +112,6 @@ namespace DICUI.Utilities
/// </summary>
public bool ParanoidMode { get; set; }
/// <summary>
/// Scan for copy protection, where applicable
/// </summary>
public bool ScanForProtection { get; set; }
/// <summary>
/// Number of C2 error reread attempts
/// </summary>
@@ -155,7 +170,7 @@ namespace DICUI.Utilities
public async Task<bool> DriveHasLatestFimrware()
{
// Validate that the required program exists
if (!File.Exists(DICPath))
if (!File.Exists(CreatorPath))
return false;
CreatorParameters parameters = new CreatorParameters(string.Empty)
@@ -180,7 +195,7 @@ namespace DICUI.Utilities
public async void EjectDisc()
{
// Validate that the required program exists
if (!File.Exists(DICPath))
if (!File.Exists(CreatorPath))
return;
CancelDumping();
@@ -272,6 +287,18 @@ namespace DICUI.Utilities
// Now ensure that all required files exist
string combinedBase = Path.Combine(OutputDirectory, outputFilename);
// If we're using DiscImageChef, the outputs are consistent
if (UseChef)
{
return File.Exists(combinedBase + ".cicm.xml")
&& File.Exists(combinedBase + ".dicf")
&& File.Exists(combinedBase + ".ibg")
&& File.Exists(combinedBase + ".log")
&& File.Exists(combinedBase + ".mhddlog.bin")
&& File.Exists(combinedBase + ".resume.xml");
}
switch (Type)
{
case MediaType.CDROM:
@@ -327,7 +354,7 @@ namespace DICUI.Utilities
}
/// <summary>
/// Get the full parameter string for DIC
/// Get the full parameter string for either DiscImageCreator or DiscImageChef
/// </summary>
/// <param name="driveSpeed">Nullable int representing the drive speed</param>
/// <returns>String representing the params, null on error</returns>
@@ -342,12 +369,23 @@ namespace DICUI.Utilities
// Set the proper parameters
string filename = OutputDirectory + Path.DirectorySeparatorChar + OutputFilename;
CreatorParameters = new CreatorParameters(System, Type, Drive.Letter, filename, driveSpeed, ParanoidMode, RereadAmountC2);
if (QuietMode)
CreatorParameters[CreatorFlag.DisableBeep] = true;
// Generate and return the param string
return CreatorParameters.GenerateParameters();
if (UseChef)
{
ChefParameters = new ChefParameters(System, Type, Drive.Letter, filename, driveSpeed, ParanoidMode, RereadAmountC2);
// Generate and return the param string
return ChefParameters.GenerateParameters();
}
else
{
CreatorParameters = new CreatorParameters(System, Type, Drive.Letter, filename, driveSpeed, ParanoidMode, RereadAmountC2);
if (QuietMode)
CreatorParameters[CreatorFlag.DisableBeep] = true;
// Generate and return the param string
return CreatorParameters.GenerateParameters();
}
}
return null;
@@ -359,7 +397,7 @@ namespace DICUI.Utilities
public async void ResetDrive()
{
// Validate that the required program exists
if (!File.Exists(DICPath))
if (!File.Exists(CreatorPath))
return;
// Precautionary check for dumping, just in case
@@ -385,7 +423,7 @@ namespace DICUI.Utilities
{
Result result = IsValidForDump();
// Execute DIC and external tools, if needed
// Execute dumping program and external tools, if needed
if (Validators.GetSupportStatus(System, Type)
&& !result.Message.Contains("not supported") // Completely unsupported media
&& !result.Message.Contains("submission info")) // Submission info-only media
@@ -394,13 +432,22 @@ namespace DICUI.Utilities
if (!result)
return result;
progress?.Report(Result.Success("Executing DiscImageCreator... please wait!"));
await Task.Run(() => ExecuteDiskImageCreator());
progress?.Report(Result.Success("DiscImageCreator has finished!"));
if (UseChef)
{
progress?.Report(Result.Success("Executing DiscImageChef... please wait!"));
await Task.Run(() => ExecuteDiscImageChef());
progress?.Report(Result.Success("DiscImageChef has finished!"));
}
else
{
progress?.Report(Result.Success("Executing DiscImageCreator... please wait!"));
await Task.Run(() => ExecuteDiscImageCreator());
progress?.Report(Result.Success("DiscImageCreator has finished!"));
}
// Execute additional tools
progress?.Report(Result.Success("Running any additional tools... please wait!"));
result = await Task.Run(() => ExecuteAdditionalToolsAfterDIC());
result = await Task.Run(() => ExecuteAdditionalTools());
progress?.Report(result);
}
@@ -470,7 +517,13 @@ namespace DICUI.Utilities
/// <returns>True if the configuration is valid, false otherwise</returns>
internal bool ParametersValid()
{
return CreatorParameters.IsValid()
bool parametersValid = false;
if (UseChef)
parametersValid = ChefParameters.IsValid();
else
parametersValid = CreatorParameters.IsValid();
return parametersValid
&& !(Drive.InternalDriveType == InternalDriveType.Floppy ^ Type == MediaType.FloppyDisk)
&& !(Drive.InternalDriveType == InternalDriveType.HardDisk ^ Type == MediaType.HardDisk)
&& !(Drive.InternalDriveType == InternalDriveType.Removable ^ (Type == MediaType.CompactFlash || Type == MediaType.SDCard || Type == MediaType.FlashDrive));
@@ -484,7 +537,7 @@ namespace DICUI.Utilities
/// Run any additional tools given a DumpEnvironment
/// </summary>
/// <returns>Result instance with the outcome</returns>
private Result ExecuteAdditionalToolsAfterDIC()
private Result ExecuteAdditionalTools()
{
// Special cases
switch (System)
@@ -500,16 +553,72 @@ namespace DICUI.Utilities
return Result.Success("No external tools needed!");
}
/// <summary>
/// Run DiscImageChef
/// </summary>
private void ExecuteDiscImageChef()
{
Directory.CreateDirectory(OutputDirectory);
dicProcess = new Process()
{
StartInfo = new ProcessStartInfo()
{
FileName = ChefPath,
Arguments = ChefParameters.GenerateParameters() ?? "",
},
};
dicProcess.Start();
dicProcess.WaitForExit();
}
/// <summary>
/// Run DiscImageChef async with an input set of parameters
/// </summary>
/// <param name="parameters"></param>
/// <returns>Standard output from commandline window</returns>
private async Task<string> ExecuteDiscImageChefWithParameters(ChefParameters parameters)
{
Process childProcess;
string output = await Task.Run(() =>
{
childProcess = new Process()
{
StartInfo = new ProcessStartInfo()
{
FileName = ChefPath,
Arguments = parameters.GenerateParameters(),
CreateNoWindow = true,
UseShellExecute = false,
RedirectStandardInput = true,
RedirectStandardOutput = true,
},
};
childProcess.Start();
childProcess.WaitForExit(1000);
// Just in case, we want to push a button 5 times to clear any errors
for (int i = 0; i < 5; i++)
childProcess.StandardInput.WriteLine("Y");
string stdout = childProcess.StandardOutput.ReadToEnd();
childProcess.Dispose();
return stdout;
});
return output;
}
/// <summary>
/// Run DiscImageCreator
/// </summary>
private void ExecuteDiskImageCreator()
private void ExecuteDiscImageCreator()
{
dicProcess = new Process()
{
StartInfo = new ProcessStartInfo()
{
FileName = DICPath,
FileName = CreatorPath,
Arguments = CreatorParameters.GenerateParameters() ?? "",
},
};
@@ -518,7 +627,7 @@ namespace DICUI.Utilities
}
/// <summary>
/// Run DIC async with an input set of parameters
/// Run DiscImageCreator async with an input set of parameters
/// </summary>
/// <param name="parameters"></param>
/// <returns>Standard output from commandline window</returns>
@@ -531,7 +640,7 @@ namespace DICUI.Utilities
{
StartInfo = new ProcessStartInfo()
{
FileName = DICPath,
FileName = CreatorPath,
Arguments = parameters.GenerateParameters(),
CreateNoWindow = true,
UseShellExecute = false,
@@ -588,6 +697,21 @@ namespace DICUI.Utilities
// Sanitize the output filename to strip off any potential extension
string outputFilename = Path.GetFileNameWithoutExtension(OutputFilename);
// TODO: Notes about DiscImageChef outputs:
// - All hash data is stored in the CICM XML sidecar
// - The path to all track hashes is CICMMetadata.OpticalDisc.Track()
// - Each track has a billion hashes under a Checksums.Checksum() element
// - Checksum type is defined as type="x" - use crc32, md, sha1
// - Track sizes are under a Size() element
// - Also cotnains a Sequence() element that has TrackNumber() and Session()
// - Currently does not automatically output a CUE, see if this data
// can be used to generate a CUE?
// - When using DICF, Tracks are not named, just numbered. Will need
// to be generated when creating the pseudo-dat
// - `image convert` might be able to help generate CUE, CCD, SUB?
// - CICMMetadata.OpticalDisc.Tracks() and .Sessions() might both be helpful
// - NEED CONFIRMATION OF TRACK SPLITTING ON CD
// Check that all of the relevant files are there
if (!FoundAllFiles())
return null;
@@ -1338,7 +1462,9 @@ namespace DICUI.Utilities
FixOutputPaths();
// Validate that the required program exists
if (!File.Exists(DICPath))
if (UseChef && !File.Exists(ChefPath))
return Result.Failure("Error! Could not find DiscImageChef!");
else if (!UseChef && !File.Exists(CreatorPath))
return Result.Failure("Error! Could not find DiscImageCreator!");
// TODO: Ensure output path not the same as input drive OR DIC/DICUI location

View File

@@ -188,6 +188,15 @@ namespace DICUI.Utilities
RedumpSystem.SonyPlayStation3,
};
/// <summary>
/// List of systems that has an LSD pack
/// </summary>
public static readonly RedumpSystem[] HasLsd = new RedumpSystem[]
{
RedumpSystem.IBMPCcompatible,
RedumpSystem.SonyPlayStation,
};
/// <summary>
/// List of systems that has an SBI pack
/// </summary>

View File

@@ -65,7 +65,7 @@ namespace DICUI.Test.Utilities
[InlineData(MediaType.NONE, null)]
public void MediaTypeToExtensionTest(MediaType? mediaType, string expected)
{
string actual = Converters.Extension(mediaType);
string actual = Converters.Extension(mediaType, false);
Assert.Equal(expected, actual);
}

View File

@@ -26,7 +26,7 @@ namespace DICUI.Test.Utilities
[InlineData(MediaType.NONE, null)]
public void ExtensionTest(MediaType? mediaType, string expected)
{
string actual = mediaType.Extension();
string actual = mediaType.Extension(false);
Assert.Equal(expected, actual);
}

View File

@@ -1,9 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
<add key="DICPath" value="Programs\DiscImageCreator.exe"/>
<add key="SubDumpPath" value="subdump.exe"/>
<add key="ChefPath" value="Programs\Chef\DiscImageChef.exe"/>
<add key="CreatorPath" value="Programs\Creator\DiscImageCreator.exe"/>
<add key="SubDumpPath" value="Programs\Subdump\subdump.exe"/>
<add key="DefaultOutputPath" value="ISO"/>
<add key="UseChef" value="false"/>
<add key="PreferredDumpSpeedCD" value="48"/>
<add key="PreferredDumpSpeedDVD" value="24"/>

View File

@@ -13,7 +13,11 @@ namespace DICUI
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is CreatorCommand)
if (value is ChefCommand)
return ((ChefCommand)value).LongName();
else if (value is ChefFlag)
return ((ChefFlag)value).LongName();
else if (value is CreatorCommand)
return ((CreatorCommand)value).LongName();
else if (value is CreatorFlag)
return ((CreatorFlag)value).LongName();

View File

@@ -9,9 +9,14 @@ namespace DICUI
public class Options
{
public string DefaultOutputPath { get; private set; }
public string DICPath { get; private set; }
public string ChefPath { get; private set; }
public string CreatorPath { get; private set; }
public string SubDumpPath { get; private set; }
// TODO: Change to string setting eventually to better support more tools
// TODO: Add to UI either as checkbox next to DiscImageChef or by making it a single select between both paths
public bool UseChef { get; set; }
public int PreferredDumpSpeedCD { get; set; }
public int PreferredDumpSpeedDVD { get; set; }
public int PreferredDumpSpeedBD { get; set; }
@@ -56,9 +61,11 @@ namespace DICUI
Configuration configFile = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);
//TODO: hardcoded, we should find a better way
this.DICPath = GetStringSetting(configFile, "DICPath", "Programs\\DiscImageCreator.exe");
this.ChefPath = GetStringSetting(configFile, "ChefPath", "Programs\\DiscImageChef.exe");
this.CreatorPath = GetStringSetting(configFile, "CreatorPath", "Programs\\DiscImageCreator.exe");
this.SubDumpPath = GetStringSetting(configFile, "SubDumpPath", "subdump.exe");
this.DefaultOutputPath = GetStringSetting(configFile, "DefaultOutputPath", "ISO");
this.UseChef = GetBooleanSetting(configFile, "UseChef", false);
this.PreferredDumpSpeedCD = GetInt32Setting(configFile, "PreferredDumpSpeedCD", 72);
this.PreferredDumpSpeedDVD = GetInt32Setting(configFile, "PreferredDumpSpeedDVD", 24);

View File

@@ -13,6 +13,12 @@ namespace DICUI
this._options = options;
}
public bool UseChef
{
get { return _options.UseChef; }
set { _options.UseChef = value; }
}
public bool QuietMode
{
get { return _options.QuietMode; }

View File

@@ -5,7 +5,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:DICUI"
mc:Ignorable="d"
Title="Disc Image Creator GUI" Height="450" Width="600" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize"
Title="DICUI" Height="450" Width="600" WindowStartupLocation="CenterScreen" ResizeMode="CanMinimize"
LocationChanged="MainWindowLocationChanged" Activated="MainWindowActivated" Closing="MainWindowClosing">
<Window.Resources>

View File

@@ -444,8 +444,10 @@ namespace DICUI.Windows
var env = new DumpEnvironment()
{
// Paths to tools
ChefPath = _options.ChefPath,
CreatorPath = _options.CreatorPath,
SubdumpPath = _options.SubDumpPath,
DICPath = _options.DICPath,
UseChef = _options.UseChef,
OutputDirectory = OutputDirectoryTextBox.Text,
OutputFilename = OutputFilenameTextBox.Text,
@@ -453,8 +455,6 @@ namespace DICUI.Windows
// Get the currently selected options
Drive = DriveLetterComboBox.SelectedItem as Drive,
CreatorParameters = new CreatorParameters(ParametersTextBox.Text),
QuietMode = _options.QuietMode,
ParanoidMode = _options.ParanoidMode,
ScanForProtection = _options.ScanForProtection,
@@ -462,6 +462,9 @@ namespace DICUI.Windows
AddPlaceholders = _options.AddPlaceholders,
PromptForDiscInformation = _options.PromptForDiscInformation,
ChefParameters = new ChefParameters(ParametersTextBox.Text),
CreatorParameters = new CreatorParameters(ParametersTextBox.Text),
Username = _options.Username,
Password = _options.Password,
@@ -510,9 +513,9 @@ namespace DICUI.Windows
try
{
// Check for the firmware first
// Check for the firmware first for DiscImageCreator
// TODO: Remove this (and method) once DIC end-to-end logging becomes a thing
if (!await _env.DriveHasLatestFimrware())
if (!_env.UseChef && !await _env.DriveHasLatestFimrware())
{
MessageBox.Show($"DiscImageCreator has reported that drive {_env.Drive.Letter} is not updated to the most recent firmware. Please update the firmware for your drive and try again.", "Outdated Firmware", MessageBoxButton.OK, MessageBoxImage.Error);
return;
@@ -551,28 +554,37 @@ namespace DICUI.Windows
if (result)
{
// Verify dump output and save it
result = _env.VerifyAndSaveDumpOutput(progress,
EjectWhenDoneCheckBox.IsChecked,
_options.ResetDriveAfterDump,
(si) =>
{
// TODO: Remove Chef handling when irrelevant
if (_env.UseChef)
{
ViewModels.LoggerViewModel.VerboseLogLn("DiscImageChef does not support split tracks or DiscImageCreator-compatible outputs");
ViewModels.LoggerViewModel.VerboseLogLn("No automatic submission information will be gathered for this disc");
}
else
{
// Verify dump output and save it
result = _env.VerifyAndSaveDumpOutput(progress,
EjectWhenDoneCheckBox.IsChecked,
_options.ResetDriveAfterDump,
(si) =>
{
// lazy initialization
if (_discInformationWindow == null)
{
_discInformationWindow = new DiscInformationWindow(this, si);
_discInformationWindow.Closed += delegate
{
_discInformationWindow = null;
};
}
_discInformationWindow = new DiscInformationWindow(this, si);
_discInformationWindow.Closed += delegate
{
_discInformationWindow = null;
};
}
_discInformationWindow.Owner = this;
_discInformationWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
_discInformationWindow.Refresh();
return _discInformationWindow.ShowDialog();
}
);
_discInformationWindow.Owner = this;
_discInformationWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
_discInformationWindow.Refresh();
return _discInformationWindow.ShowDialog();
}
);
}
}
StatusLabel.Content = result ? "Dumping complete!" : result.Message;
@@ -640,11 +652,11 @@ namespace DICUI.Windows
// Set the output filename, if we changed drives or it's not already
if (driveChanged || string.IsNullOrEmpty(OutputFilenameTextBox.Text))
OutputFilenameTextBox.Text = (drive?.VolumeLabel ?? systemType.LongName()) + (mediaType.Extension() ?? ".bin");
OutputFilenameTextBox.Text = (drive?.VolumeLabel ?? systemType.LongName()) + (mediaType.Extension(_options.UseChef) ?? ".bin");
// If the extension for the file changed, update that automatically
else if (Path.GetExtension(OutputFilenameTextBox.Text) != mediaType.Extension())
OutputFilenameTextBox.Text = Path.GetFileNameWithoutExtension(OutputFilenameTextBox.Text) + (mediaType.Extension() ?? ".bin");
else if (Path.GetExtension(OutputFilenameTextBox.Text) != mediaType.Extension(_options.UseChef))
OutputFilenameTextBox.Text = Path.GetFileNameWithoutExtension(OutputFilenameTextBox.Text) + (mediaType.Extension(_options.UseChef) ?? ".bin");
}
/// <summary>
@@ -763,34 +775,63 @@ namespace DICUI.Windows
/// </summary>
private void ProcessCustomParameters()
{
_env.CreatorParameters = new CreatorParameters(ParametersTextBox.Text);
if (_options.UseChef)
{
_env.ChefParameters = new ChefParameters(ParametersTextBox.Text);
int driveIndex = _drives.Select(d => d.Letter).ToList().IndexOf(_env.CreatorParameters.DriveLetter[0]);
if (driveIndex > -1)
DriveLetterComboBox.SelectedIndex = driveIndex;
if (_env.ChefParameters == null)
return;
int driveSpeed = _env.CreatorParameters.DriveSpeed ?? -1;
if (driveSpeed > 0)
DriveSpeedComboBox.SelectedValue = driveSpeed;
int driveIndex = _drives.Select(d => d.Letter).ToList().IndexOf(_env.ChefParameters.InputValue[0]);
if (driveIndex > -1)
DriveLetterComboBox.SelectedIndex = driveIndex;
string trimmedPath = _env.ChefParameters.OutputValue?.Trim('"') ?? string.Empty;
string outputDirectory = Path.GetDirectoryName(trimmedPath);
string outputFilename = Path.GetFileName(trimmedPath);
if (!string.IsNullOrWhiteSpace(outputDirectory))
OutputDirectoryTextBox.Text = outputDirectory;
else
outputDirectory = OutputDirectoryTextBox.Text;
if (!string.IsNullOrWhiteSpace(outputFilename))
OutputFilenameTextBox.Text = outputFilename;
else
outputFilename = OutputFilenameTextBox.Text;
}
else
_env.CreatorParameters.DriveSpeed = (int?)DriveSpeedComboBox.SelectedValue;
{
_env.CreatorParameters = new CreatorParameters(ParametersTextBox.Text);
string trimmedPath = _env.CreatorParameters.Filename?.Trim('"') ?? string.Empty;
string outputDirectory = Path.GetDirectoryName(trimmedPath);
string outputFilename = Path.GetFileName(trimmedPath);
if (!string.IsNullOrWhiteSpace(outputDirectory))
OutputDirectoryTextBox.Text = outputDirectory;
else
outputDirectory = OutputDirectoryTextBox.Text;
if (!string.IsNullOrWhiteSpace(outputFilename))
OutputFilenameTextBox.Text = outputFilename;
else
outputFilename = OutputFilenameTextBox.Text;
if (_env.CreatorParameters == null)
return;
MediaType? mediaType = _env.CreatorParameters.Command.ToMediaType();
int mediaTypeIndex = _mediaTypes.IndexOf(mediaType);
if (mediaTypeIndex > -1)
MediaTypeComboBox.SelectedIndex = mediaTypeIndex;
int driveIndex = _drives.Select(d => d.Letter).ToList().IndexOf(_env.CreatorParameters.DriveLetter[0]);
if (driveIndex > -1)
DriveLetterComboBox.SelectedIndex = driveIndex;
int driveSpeed = _env.CreatorParameters.DriveSpeed ?? -1;
if (driveSpeed > 0)
DriveSpeedComboBox.SelectedValue = driveSpeed;
else
_env.CreatorParameters.DriveSpeed = (int?)DriveSpeedComboBox.SelectedValue;
string trimmedPath = _env.CreatorParameters.Filename?.Trim('"') ?? string.Empty;
string outputDirectory = Path.GetDirectoryName(trimmedPath);
string outputFilename = Path.GetFileName(trimmedPath);
if (!string.IsNullOrWhiteSpace(outputDirectory))
OutputDirectoryTextBox.Text = outputDirectory;
else
outputDirectory = OutputDirectoryTextBox.Text;
if (!string.IsNullOrWhiteSpace(outputFilename))
OutputFilenameTextBox.Text = outputFilename;
else
outputFilename = OutputFilenameTextBox.Text;
MediaType? mediaType = _env.CreatorParameters.Command.ToMediaType();
int mediaTypeIndex = _mediaTypes.IndexOf(mediaType);
if (mediaTypeIndex > -1)
MediaTypeComboBox.SelectedIndex = mediaTypeIndex;
}
}
#endregion

View File

@@ -5,11 +5,11 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:DICUI"
mc:Ignorable="d"
Title="Options" Width="515.132" Height="552">
Title="Options" Width="515.132" Height="605">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="100"/>
<RowDefinition Height="150"/>
<RowDefinition Height="150"/>
<RowDefinition Height="150"/>
<RowDefinition Height="80"/>
@@ -29,19 +29,24 @@
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
<RowDefinition/>
</Grid.RowDefinitions>
<Label Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right" Content="DiscImageCreator Path" />
<TextBox x:Name="DICPathTextBox" Grid.Row="0" Grid.Column="1" Height="22" HorizontalAlignment="Stretch" />
<Button x:Name="DICPathButton" Grid.Row="0" Grid.Column="2" Height="22" Width="22" Content="..." Click="BrowseForPathClick" />
<Label Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right" Content="DiscImageChef Path" />
<TextBox x:Name="ChefPathTextBox" Grid.Row="0" Grid.Column="1" Height="22" HorizontalAlignment="Stretch" />
<Button x:Name="ChefPathButton" Grid.Row="0" Grid.Column="2" Height="22" Width="22" Content="..." Click="BrowseForPathClick" />
<Label Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right" Content="subdump Path" />
<TextBox x:Name="SubDumpPathTextBox" Grid.Row="1" Grid.Column="1" Height="22" HorizontalAlignment="Stretch" />
<Button x:Name="SubDumpPathButton" Grid.Row="1" Grid.Column="2" Height="22" Width="22" Content="..." Click="BrowseForPathClick"/>
<Label Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right" Content="DiscImageCreator Path" />
<TextBox x:Name="CreatorPathTextBox" Grid.Row="1" Grid.Column="1" Height="22" HorizontalAlignment="Stretch" />
<Button x:Name="CreatorPathButton" Grid.Row="1" Grid.Column="2" Height="22" Width="22" Content="..." Click="BrowseForPathClick" />
<Label Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right" Content="Default Output Path" />
<TextBox x:Name="DefaultOutputPathTextBox" Grid.Row="2" Grid.Column="1" Height="22" HorizontalAlignment="Stretch" />
<Button x:Name="DefaultOutputPathButton" Grid.Row="2" Grid.Column="2" Height="22" Width="22" Content="..." Click="BrowseForPathClick" />
<Label Grid.Row="2" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right" Content="subdump Path" />
<TextBox x:Name="SubDumpPathTextBox" Grid.Row="2" Grid.Column="1" Height="22" HorizontalAlignment="Stretch" />
<Button x:Name="SubDumpPathButton" Grid.Row="2" Grid.Column="2" Height="22" Width="22" Content="..." Click="BrowseForPathClick"/>
<Label Grid.Row="3" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Right" Content="Default Output Path" />
<TextBox x:Name="DefaultOutputPathTextBox" Grid.Row="3" Grid.Column="1" Height="22" HorizontalAlignment="Stretch" />
<Button x:Name="DefaultOutputPathButton" Grid.Row="3" Grid.Column="2" Height="22" Width="22" Content="..." Click="BrowseForPathClick" />
</Grid>
<GroupBox Grid.Row="1" Margin="5,5,5,5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Header="Preferred Dump Speed">
@@ -101,7 +106,7 @@
ToolTip="Enable pedantic and super-safe flags" Margin="0,4"
/>
<Label Grid.Row="0" Grid.Column="2" Content="C2 Reread Tries:" VerticalAlignment="Center" HorizontalAlignment="Right"/>
<Label Grid.Row="0" Grid.Column="2" Content="Reread Tries:" VerticalAlignment="Center" HorizontalAlignment="Right"/>
<TextBox Grid.Row="0" Grid.Column="3" VerticalAlignment="Center"
DataContext="{Binding Source={x:Static local:ViewModels.OptionsViewModel}}"
Text="{Binding Path=RereadAmountForC2}"

View File

@@ -43,7 +43,7 @@ namespace DICUI.Windows
private string[] PathSettings()
{
string[] pathSettings = { "DefaultOutputPath", "DICPath", "SubDumpPath" };
string[] pathSettings = { "ChefPath", "CreatorPath", "DefaultOutputPath", "SubDumpPath" };
return pathSettings;
}

View File

@@ -1,18 +1,22 @@
# DICUI
DiscImageCreator UI in C#
DiscImageCreator/DiscimageChef UI in C#
[![Build status](https://ci.appveyor.com/api/projects/status/3ldav3v0c373jeqa?svg=true)](https://ci.appveyor.com/project/mnadareski/dicui/build/artifacts)
This is a community project, so if you have some time and knowledge to give, we'll be glad to add you to the contributor of this project :)
We are using DiscImageCreator (DIC), created by Sarami, and we would like to thanks him for his great software. The latest release of DIC can be found on [the GitHub page](https://github.com/saramibreak/DiscImageCreator)
DICUI relies on the following projects:
- **DiscImageCreator** by Sarami - Dumping - [GitHub](https://github.com/saramibreak/DiscImageCreator)
- **DiscImageChef** by Claunia - Dumping - [GitHub](https://github.com/discimagechef/DiscImageChef)
- **BurnOutSharp** - Protection scanning - [GitHub](https://github.com/mnadareski/BurnOutSharp)
- **UnshieldSharp** - Protection scanning - [GitHub](https://github.com/mnadareski/UnshieldSharp)
This project relies on two open-source code ports to help perform copy protection scanning: [BurnOutSharp](https://github.com/mnadareski/BurnOutSharp) and [UnshieldSharp](https://github.com/mnadareski/UnshieldSharp)
**Note:** Both DiscImageCreator and DiscImageChef have WIP builds. In general, WIP builds are not supported with new flags or features until they make it into the stable release. The exception to this rule is currently DiscImageChef, due to the very old last stable release. It is recommended that you either download or build the latest version of DiscImageChef for use with DICUI.
## System Requirements
Even though this is written in C#, this program can only be used on Windows systems due to the base program, DiscImageCreator, being Windows-only. There is some preliminary support for Linux underway, and we will try to integrate with that when the time comes.
Even though this is written in C#, this program can only be used on Windows systems due to one of the base programs, DiscImageCreator, being Windows-only. There is some preliminary support for Linux underway, and we will try to integrate with that when the time comes.
- Windows 7 (newest version of Windows recommended)
- .NET Framework 4.6.2, .NET Framework 4.7.2, or .NET Core 3.0 Runtimes (.NET Core 3.0 is not currently functional due to a dependency, please do not use it)

View File

@@ -32,17 +32,24 @@ build:
# post-build step
after_build:
- ps: appveyor DownloadFile https://github.com/saramibreak/DiscImageCreator/files/3995191/DiscImageCreator_20191223.zip
- ps: appveyor DownloadFile https://github.com/discimagechef/DiscImageChef/releases/download/v4.5.1.1692/DiscImageChef-4.5.1.1692-debug.zip
- ps: appveyor DownloadFile https://github.com/saramibreak/DiscImageCreator/files/4148432/DiscImageCreator_20200203.zip
- ps: appveyor DownloadFile https://archive.org/download/subdump_fua_0x28/subdump_fua_0x28.zip
- 7z e DiscImageCreator_20191223.zip -oDICUI\bin\Debug\net462\Programs Release_ANSI\*
- 7z e DiscImageCreator_20191223.zip -oDICUI\bin\Debug\net472\Programs Release_ANSI\*
- 7z e DiscImageCreator_20191223.zip -oDICUI\bin\Debug\netcoreapp3.0\Programs Release_ANSI\*
- 7z e DiscImageChef-4.5.1.1692-debug.zip -oDICUI\bin\Debug\net462\Programs\Chef *
- 7z e DiscImageChef-4.5.1.1692-debug.zip -oDICUI\bin\Debug\net472\Programs\Chef *
- 7z e DiscImageChef-4.5.1.1692-debug.zip -oDICUI\bin\Debug\netcoreapp3.0\Programs\Chef *
- 7z e DiscImageCreator_20200203.zip -oDICUI\bin\Debug\net462\Programs\Creator Release_ANSI\*
- 7z e DiscImageCreator_20200203.zip -oDICUI\bin\Debug\net472\Programs\Creator Release_ANSI\*
- 7z e DiscImageCreator_20200203.zip -oDICUI\bin\Debug\netcoreapp3.0\Programs\Creator Release_ANSI\*
- 7z e subdump_fua_0x28.zip -oDICUI\bin\Debug\net462 *
- mv DICUI\bin\Debug\net462\subdump_fua_0x28.exe DICUI\bin\Debug\net462\subdump.exe
- mkdir DICUI\bin\Debug\net462\Programs\Subdump
- mv DICUI\bin\Debug\net462\subdump_fua_0x28.exe DICUI\bin\Debug\net462\Programs\Subdump\subdump.exe
- 7z e subdump_fua_0x28.zip -oDICUI\bin\Debug\net472 *
- mv DICUI\bin\Debug\net472\subdump_fua_0x28.exe DICUI\bin\Debug\net472\subdump.exe
- mkdir DICUI\bin\Debug\net472\Programs\Subdump
- mv DICUI\bin\Debug\net472\subdump_fua_0x28.exe DICUI\bin\Debug\net472\Programs\Subdump\subdump.exe
- 7z e subdump_fua_0x28.zip -oDICUI\bin\Debug\netcoreapp3.0 *
- mv DICUI\bin\Debug\netcoreapp3.0\subdump_fua_0x28.exe DICUI\bin\Debug\netcoreapp3.0\subdump.exe
- mkdir DICUI\bin\Debug\netcoreapp3.0\Programs\Subdump
- mv DICUI\bin\Debug\netcoreapp3.0\subdump_fua_0x28.exe DICUI\bin\Debug\netcoreapp3.0\Programs\Subdump\subdump.exe
- 7z a DICUI.zip DICUI\bin\Debug\*
- 7z a DICUI-Check.zip DICUI.Check\bin\Debug\*