diff --git a/DiscImageChef.Core/Devices/Dumping/ATA.cs b/DiscImageChef.Core/Devices/Dumping/ATA.cs index b055bfb02..d8ae8c0de 100644 --- a/DiscImageChef.Core/Devices/Dumping/ATA.cs +++ b/DiscImageChef.Core/Devices/Dumping/ATA.cs @@ -34,24 +34,28 @@ using System; using System.Collections.Generic; using System.IO; using System.Text; +using System.Xml.Serialization; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.Core.Logging; +using DiscImageChef.Decoders.ATA; using DiscImageChef.Decoders.PCMCIA; using DiscImageChef.Devices; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; -using DiscImageChef.Partitions; -using Schemas; +using DiscImageChef.Metadata; using Extents; +using Schemas; +using MediaType = DiscImageChef.Metadata.MediaType; +using Tuple = DiscImageChef.Decoders.PCMCIA.Tuple; namespace DiscImageChef.Core.Devices.Dumping { public class Ata { public static void Dump(Device dev, string devicePath, string outputPrefix, ushort retryPasses, bool force, - bool dumpRaw, bool persistent, bool stopOnError, ref Metadata.Resume resume, + bool dumpRaw, bool persistent, bool stopOnError, ref Resume resume, ref DumpLog dumpLog, Encoding encoding) { bool aborted; @@ -76,13 +80,13 @@ namespace DiscImageChef.Core.Devices.Dumping double duration; dumpLog.WriteLine("Requesting ATA IDENTIFY DEVICE."); - sense = dev.AtaIdentify(out byte[] cmdBuf, out Decoders.ATA.AtaErrorRegistersCHS errorChs); - if(!sense && Decoders.ATA.Identify.Decode(cmdBuf).HasValue) + sense = dev.AtaIdentify(out byte[] cmdBuf, out AtaErrorRegistersCHS errorChs); + if(!sense && Identify.Decode(cmdBuf).HasValue) { - Decoders.ATA.Identify.IdentifyDevice ataId = Decoders.ATA.Identify.Decode(cmdBuf).Value; + Identify.IdentifyDevice ataId = Identify.Decode(cmdBuf).Value; CICMMetadataType sidecar = - new CICMMetadataType {BlockMedia = new BlockMediaType[] {new BlockMediaType()}}; + new CICMMetadataType {BlockMedia = new[] {new BlockMediaType()}}; if(dev.IsUsb) { @@ -115,9 +119,9 @@ namespace DiscImageChef.Core.Devices.Dumping }; DataFile.WriteTo("ATA Dump", sidecar.BlockMedia[0].PCMCIA.CIS.Image, dev.Cis); dumpLog.WriteLine("Decoding PCMCIA CIS."); - Decoders.PCMCIA.Tuple[] tuples = CIS.GetTuples(dev.Cis); + Tuple[] tuples = CIS.GetTuples(dev.Cis); if(tuples != null) - foreach(Decoders.PCMCIA.Tuple tuple in tuples) + foreach(Tuple tuple in tuples) switch(tuple.Code) { case TupleCodes.CISTPL_MANFID: ManufacturerIdentificationTuple manfid = @@ -213,8 +217,7 @@ namespace DiscImageChef.Core.Devices.Dumping dumpLog.WriteLine("Device reports {0} bytes per physical block.", physicalsectorsize); bool removable = false || !dev.IsCompactFlash && - ataId.GeneralConfiguration.HasFlag(Decoders.ATA.Identify - .GeneralConfigurationBit + ataId.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit .Removable); DumpHardwareType currentTry = null; ExtentsULong extents = null; @@ -239,7 +242,7 @@ namespace DiscImageChef.Core.Devices.Dumping { if(aborted) { - currentTry.Extents = Metadata.ExtentsConverter.ToMetadata(extents); + currentTry.Extents = ExtentsConverter.ToMetadata(extents); dumpLog.WriteLine("Aborted!"); break; } @@ -275,7 +278,7 @@ namespace DiscImageChef.Core.Devices.Dumping } #pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created - currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (duration / (double)1000); + currentSpeed = (double)blockSize * blocksToRead / 1048576 / (duration / 1000); #pragma warning restore IDE0004 // Cast is necessary, otherwise incorrect value is created GC.Collect(); resume.NextBlock = i + blocksToRead; @@ -286,7 +289,7 @@ namespace DiscImageChef.Core.Devices.Dumping mhddLog.Close(); #pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created ibgLog.Close(dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024, - (double)blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), + blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), devicePath); #pragma warning restore IDE0004 // Cast is necessary, otherwise incorrect value is created dumpLog.WriteLine("Dump finished in {0} seconds.", (end - start).TotalSeconds); @@ -306,7 +309,7 @@ namespace DiscImageChef.Core.Devices.Dumping { if(aborted) { - currentTry.Extents = Metadata.ExtentsConverter.ToMetadata(extents); + currentTry.Extents = ExtentsConverter.ToMetadata(extents); dumpLog.WriteLine("Aborted!"); break; } @@ -342,7 +345,7 @@ namespace DiscImageChef.Core.Devices.Dumping } #endregion Error handling LBA - currentTry.Extents = Metadata.ExtentsConverter.ToMetadata(extents); + currentTry.Extents = ExtentsConverter.ToMetadata(extents); } else { @@ -361,7 +364,7 @@ namespace DiscImageChef.Core.Devices.Dumping { if(aborted) { - currentTry.Extents = Metadata.ExtentsConverter.ToMetadata(extents); + currentTry.Extents = ExtentsConverter.ToMetadata(extents); dumpLog.WriteLine("Aborted!"); break; } @@ -397,7 +400,7 @@ namespace DiscImageChef.Core.Devices.Dumping } #pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created - currentSpeed = (double)blockSize / (double)1048576 / (duration / (double)1000); + currentSpeed = blockSize / (double)1048576 / (duration / 1000); #pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created GC.Collect(); @@ -411,7 +414,7 @@ namespace DiscImageChef.Core.Devices.Dumping mhddLog.Close(); #pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created ibgLog.Close(dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024, - (double)blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), + blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), devicePath); #pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created dumpLog.WriteLine("Dump finished in {0} seconds.", (end - start).TotalSeconds); @@ -445,7 +448,7 @@ namespace DiscImageChef.Core.Devices.Dumping double chkDuration = (chkEnd - chkStart).TotalMilliseconds; totalChkDuration += chkDuration; - currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (chkDuration / (double)1000); + currentSpeed = (double)blockSize * blocksToRead / 1048576 / (chkDuration / 1000); } DicConsole.WriteLine(); @@ -560,10 +563,10 @@ namespace DiscImageChef.Core.Devices.Dumping sidecar.BlockMedia[0].Checksums = dataChk.End().ToArray(); string xmlDskTyp, xmlDskSubTyp; if(dev.IsCompactFlash) - Metadata.MediaType.MediaTypeToString(MediaType.CompactFlash, out xmlDskTyp, out xmlDskSubTyp); + MediaType.MediaTypeToString(CommonTypes.MediaType.CompactFlash, out xmlDskTyp, out xmlDskSubTyp); else if(dev.IsPcmcia) - Metadata.MediaType.MediaTypeToString(MediaType.PCCardTypeI, out xmlDskTyp, out xmlDskSubTyp); - else Metadata.MediaType.MediaTypeToString(MediaType.GENERIC_HDD, out xmlDskTyp, out xmlDskSubTyp); + MediaType.MediaTypeToString(CommonTypes.MediaType.PCCardTypeI, out xmlDskTyp, out xmlDskSubTyp); + else MediaType.MediaTypeToString(CommonTypes.MediaType.GENERIC_HDD, out xmlDskTyp, out xmlDskSubTyp); sidecar.BlockMedia[0].DiskType = xmlDskTyp; sidecar.BlockMedia[0].DiskSubType = xmlDskSubTyp; // TODO: Implement device firmware revision @@ -609,13 +612,13 @@ namespace DiscImageChef.Core.Devices.Dumping FileStream xmlFs = new FileStream(outputPrefix + ".cicm.xml", FileMode.Create); - System.Xml.Serialization.XmlSerializer xmlSer = - new System.Xml.Serialization.XmlSerializer(typeof(CICMMetadataType)); + XmlSerializer xmlSer = + new XmlSerializer(typeof(CICMMetadataType)); xmlSer.Serialize(xmlFs, sidecar); xmlFs.Close(); } - Statistics.AddMedia(MediaType.GENERIC_HDD, true); + Statistics.AddMedia(CommonTypes.MediaType.GENERIC_HDD, true); } else DicConsole.ErrorWriteLine("Unable to communicate with ATA device."); } diff --git a/DiscImageChef.Core/Devices/Dumping/Alcohol120.cs b/DiscImageChef.Core/Devices/Dumping/Alcohol120.cs index 053a0dcea..68f218707 100644 --- a/DiscImageChef.Core/Devices/Dumping/Alcohol120.cs +++ b/DiscImageChef.Core/Devices/Dumping/Alcohol120.cs @@ -31,10 +31,10 @@ // ****************************************************************************/ using System; -using System.Runtime.InteropServices; -using System.IO; using System.Collections.Generic; +using System.IO; using System.Linq; +using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.DiscImages; diff --git a/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs b/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs index 7e7f19c6d..9cc0cc594 100644 --- a/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs +++ b/DiscImageChef.Core/Devices/Dumping/CompactDisc.cs @@ -33,22 +33,25 @@ using System; using System.Collections.Generic; using System.IO; +using System.Linq; +using System.Xml.Serialization; using DiscImageChef.Console; using DiscImageChef.Core.Logging; -using DiscImageChef.Devices; -using Schemas; -using System.Linq; using DiscImageChef.Decoders.CD; +using DiscImageChef.Decoders.SCSI; +using DiscImageChef.Decoders.SCSI.MMC; +using DiscImageChef.Devices; +using DiscImageChef.DiscImages; +using DiscImageChef.Metadata; using Extents; +using Schemas; +using MediaType = DiscImageChef.CommonTypes.MediaType; +using PlatformID = DiscImageChef.Interop.PlatformID; +using Session = DiscImageChef.Decoders.CD.Session; +using TrackType = Schemas.TrackType; namespace DiscImageChef.Core.Devices.Dumping { - using DiscImages; - using Metadata; - using MediaType = CommonTypes.MediaType; - using Session = Decoders.CD.Session; - using TrackType = Schemas.TrackType; - class CompactDisc { internal static void Dump(Device dev, string devicePath, string outputPrefix, ushort retryPasses, bool force, @@ -129,8 +132,8 @@ namespace DiscImageChef.Core.Devices.Dumping out duration); if(!sense) { - Decoders.SCSI.MMC.DiscInformation.StandardDiscInformation? discInfo = - Decoders.SCSI.MMC.DiscInformation.Decode000b(cmdBuf); + DiscInformation.StandardDiscInformation? discInfo = + DiscInformation.Decode000b(cmdBuf); if(discInfo.HasValue) if(dskType == MediaType.CD) switch(discInfo.Value.DiscType) @@ -391,7 +394,7 @@ namespace DiscImageChef.Core.Devices.Dumping dumpLog.WriteLine("Reading Lead-in"); for(int leadInBlock = -150; leadInBlock < 0 && resume.NextBlock == 0; leadInBlock++) { - if(dev.PlatformId == Interop.PlatformID.FreeBSD) + if(dev.PlatformId == PlatformID.FreeBSD) { DicConsole.DebugWriteLine("Dump-Media", "FreeBSD panics when reading CD Lead-in, see upstream bug #224253."); @@ -437,13 +440,13 @@ namespace DiscImageChef.Core.Devices.Dumping } #pragma warning disable IDE0004 // Remove Unnecessary Cast - currentSpeed = (double)blockSize / (double)1048576 / (cmdDuration / (double)1000); + currentSpeed = blockSize / (double)1048576 / (cmdDuration / 1000); #pragma warning restore IDE0004 // Remove Unnecessary Cast } dumpFile.Close(); if(leadInSectorsGood > 0) - sidecar.OpticalDisc[0].LeadIn = new BorderType[] + sidecar.OpticalDisc[0].LeadIn = new[] { new BorderType { @@ -539,7 +542,7 @@ namespace DiscImageChef.Core.Devices.Dumping { if(aborted) { - currentTry.Extents = Metadata.ExtentsConverter.ToMetadata(extents); + currentTry.Extents = ExtentsConverter.ToMetadata(extents); dumpLog.WriteLine("Aborted!"); break; } @@ -595,7 +598,7 @@ namespace DiscImageChef.Core.Devices.Dumping for(ulong b = i; b < i + blocksToRead; b++) resume.BadBlocks.Add(b); DicConsole.DebugWriteLine("Dump-Media", "READ error:\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); if(cmdDuration < 500) mhddLog.Write(i, 65535); else mhddLog.Write(i, cmdDuration); @@ -629,7 +632,7 @@ namespace DiscImageChef.Core.Devices.Dumping } #pragma warning disable IDE0004 // Remove Unnecessary Cast - currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (cmdDuration / (double)1000); + currentSpeed = (double)blockSize * blocksToRead / 1048576 / (cmdDuration / 1000); #pragma warning restore IDE0004 // Remove Unnecessary Cast resume.NextBlock = i + blocksToRead; } @@ -673,7 +676,7 @@ namespace DiscImageChef.Core.Devices.Dumping mhddLog.Close(); #pragma warning disable IDE0004 // Remove Unnecessary Cast ibgLog.Close(dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024, - (double)blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), devicePath); + blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), devicePath); #pragma warning restore IDE0004 // Remove Unnecessary Cast dumpLog.WriteLine("Dump finished in {0} seconds.", (end - start).TotalSeconds); dumpLog.WriteLine("Average dump speed {0:F3} KiB/sec.", @@ -692,7 +695,7 @@ namespace DiscImageChef.Core.Devices.Dumping { if(aborted) { - currentTry.Extents = Metadata.ExtentsConverter.ToMetadata(extents); + currentTry.Extents = ExtentsConverter.ToMetadata(extents); dumpLog.WriteLine("Aborted!"); break; } @@ -737,8 +740,8 @@ namespace DiscImageChef.Core.Devices.Dumping goto cdRepeatRetry; } - Decoders.SCSI.Modes.DecodedMode? currentMode = null; - Decoders.SCSI.Modes.ModePage? currentModePage = null; + Modes.DecodedMode? currentMode = null; + Modes.ModePage? currentModePage = null; byte[] md6 = null; byte[] md10 = null; @@ -750,29 +753,29 @@ namespace DiscImageChef.Core.Devices.Dumping { sense = dev.ModeSense10(out readBuffer, out senseBuf, false, ScsiModeSensePageControl.Current, 0x01, dev.Timeout, out duration); - if(!sense) currentMode = Decoders.SCSI.Modes.DecodeMode10(readBuffer, dev.ScsiType); + if(!sense) currentMode = Modes.DecodeMode10(readBuffer, dev.ScsiType); } - else currentMode = Decoders.SCSI.Modes.DecodeMode6(readBuffer, dev.ScsiType); + else currentMode = Modes.DecodeMode6(readBuffer, dev.ScsiType); if(currentMode.HasValue) currentModePage = currentMode.Value.Pages[0]; - Decoders.SCSI.Modes.ModePage_01_MMC pgMmc = - new Decoders.SCSI.Modes.ModePage_01_MMC {PS = false, ReadRetryCount = 255, Parameter = 0x20}; - Decoders.SCSI.Modes.DecodedMode md = new Decoders.SCSI.Modes.DecodedMode + Modes.ModePage_01_MMC pgMmc = + new Modes.ModePage_01_MMC {PS = false, ReadRetryCount = 255, Parameter = 0x20}; + Modes.DecodedMode md = new Modes.DecodedMode { - Header = new Decoders.SCSI.Modes.ModeHeader(), - Pages = new Decoders.SCSI.Modes.ModePage[] + Header = new Modes.ModeHeader(), + Pages = new[] { - new Decoders.SCSI.Modes.ModePage + new Modes.ModePage { Page = 0x01, Subpage = 0x00, - PageResponse = Decoders.SCSI.Modes.EncodeModePage_01_MMC(pgMmc) + PageResponse = Modes.EncodeModePage_01_MMC(pgMmc) } } }; - md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.ScsiType); - md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.ScsiType); + md6 = Modes.EncodeMode6(md, dev.ScsiType); + md10 = Modes.EncodeMode10(md, dev.ScsiType); dumpLog.WriteLine("Sending MODE SELECT to drive."); sense = dev.ModeSelect(md6, out senseBuf, true, false, dev.Timeout, out duration); @@ -787,13 +790,13 @@ namespace DiscImageChef.Core.Devices.Dumping } else if(runningPersistent && persistent && currentModePage.HasValue) { - Decoders.SCSI.Modes.DecodedMode md = new Decoders.SCSI.Modes.DecodedMode + Modes.DecodedMode md = new Modes.DecodedMode { - Header = new Decoders.SCSI.Modes.ModeHeader(), - Pages = new Decoders.SCSI.Modes.ModePage[] {currentModePage.Value} + Header = new Modes.ModeHeader(), + Pages = new[] {currentModePage.Value} }; - md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.ScsiType); - md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.ScsiType); + md6 = Modes.EncodeMode6(md, dev.ScsiType); + md10 = Modes.EncodeMode10(md, dev.ScsiType); dumpLog.WriteLine("Sending MODE SELECT to drive."); sense = dev.ModeSelect(md6, out senseBuf, true, false, dev.Timeout, out duration); @@ -805,7 +808,7 @@ namespace DiscImageChef.Core.Devices.Dumping #endregion Compact Disc Error handling resume.BadBlocks.Sort(); - currentTry.Extents = Metadata.ExtentsConverter.ToMetadata(extents); + currentTry.Extents = ExtentsConverter.ToMetadata(extents); dataChk = new Checksum(); dumpFile.Seek(0, SeekOrigin.Begin); @@ -860,7 +863,7 @@ namespace DiscImageChef.Core.Devices.Dumping totalChkDuration += chkDuration; #pragma warning disable IDE0004 // Remove Unnecessary Cast - currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (chkDuration / (double)1000); + currentSpeed = (double)blockSize * blocksToRead / 1048576 / (chkDuration / 1000); #pragma warning restore IDE0004 // Remove Unnecessary Cast } @@ -887,7 +890,7 @@ namespace DiscImageChef.Core.Devices.Dumping sidecar.OpticalDisc[0].Sessions = toc.Value.LastCompleteSession; sidecar.OpticalDisc[0].Tracks = new[] {tracks.Count()}; sidecar.OpticalDisc[0].Track = tracks; - sidecar.OpticalDisc[0].Dimensions = Metadata.Dimensions.DimensionsFromMediaType(dskType); + sidecar.OpticalDisc[0].Dimensions = Dimensions.DimensionsFromMediaType(dskType); Metadata.MediaType.MediaTypeToString(dskType, out string xmlDskTyp, out string xmlDskSubTyp); sidecar.OpticalDisc[0].DiscType = xmlDskTyp; sidecar.OpticalDisc[0].DiscSubType = xmlDskSubTyp; @@ -898,8 +901,8 @@ namespace DiscImageChef.Core.Devices.Dumping FileStream xmlFs = new FileStream(outputPrefix + ".cicm.xml", FileMode.Create); - System.Xml.Serialization.XmlSerializer xmlSer = - new System.Xml.Serialization.XmlSerializer(typeof(CICMMetadataType)); + XmlSerializer xmlSer = + new XmlSerializer(typeof(CICMMetadataType)); xmlSer.Serialize(xmlFs, sidecar); xmlFs.Close(); alcohol.Close(); diff --git a/DiscImageChef.Core/Devices/Dumping/MMC.cs b/DiscImageChef.Core/Devices/Dumping/MMC.cs index 27fedfdcb..b0105b038 100644 --- a/DiscImageChef.Core/Devices/Dumping/MMC.cs +++ b/DiscImageChef.Core/Devices/Dumping/MMC.cs @@ -32,11 +32,19 @@ using System; using System.Text; -using DiscImageChef.CommonTypes; using DiscImageChef.Console; -using DiscImageChef.Devices; using DiscImageChef.Core.Logging; +using DiscImageChef.Decoders.Bluray; +using DiscImageChef.Decoders.DVD; +using DiscImageChef.Decoders.SCSI; +using DiscImageChef.Decoders.SCSI.MMC; +using DiscImageChef.Devices; +using DiscImageChef.Metadata; using Schemas; +using DDS = DiscImageChef.Decoders.DVD.DDS; +using DMI = DiscImageChef.Decoders.Xbox.DMI; +using MediaType = DiscImageChef.CommonTypes.MediaType; +using Spare = DiscImageChef.Decoders.DVD.Spare; namespace DiscImageChef.Core.Devices.Dumping { @@ -44,7 +52,7 @@ namespace DiscImageChef.Core.Devices.Dumping { internal static void Dump(Device dev, string devicePath, string outputPrefix, ushort retryPasses, bool force, bool dumpRaw, bool persistent, bool stopOnError, ref CICMMetadataType sidecar, - ref MediaType dskType, bool separateSubchannel, ref Metadata.Resume resume, + ref MediaType dskType, bool separateSubchannel, ref Resume resume, ref DumpLog dumpLog, bool dumpLeadIn, Encoding encoding) { byte[] cmdBuf = null; @@ -67,7 +75,7 @@ namespace DiscImageChef.Core.Devices.Dumping out duration); if(!sense) { - Decoders.SCSI.MMC.Features.SeparatedFeatures ftr = Decoders.SCSI.MMC.Features.Separate(cmdBuf); + Features.SeparatedFeatures ftr = Features.Separate(cmdBuf); currentProfile = ftr.CurrentProfile; dumpLog.WriteLine("Device reports current profile is 0x{0:X4}", ftr.CurrentProfile); @@ -186,9 +194,9 @@ namespace DiscImageChef.Core.Devices.Dumping MmcDiscStructureFormat.PhysicalInformation, 0, dev.Timeout, out duration); if(!sense) { - Decoders.DVD.PFI.PhysicalFormatInformation? nintendoPfi = Decoders.DVD.PFI.Decode(cmdBuf); + PFI.PhysicalFormatInformation? nintendoPfi = PFI.Decode(cmdBuf); if(nintendoPfi != null) - if(nintendoPfi.Value.DiskCategory == Decoders.DVD.DiskCategory.Nintendo && + if(nintendoPfi.Value.DiskCategory == DiskCategory.Nintendo && nintendoPfi.Value.PartVersion == 15) { dumpLog.WriteLine("Dumping Nintendo GameCube or Wii discs is not yet implemented."); @@ -221,7 +229,7 @@ namespace DiscImageChef.Core.Devices.Dumping if(!sense) { alcohol.AddPfi(cmdBuf); - if(Decoders.DVD.PFI.Decode(cmdBuf).HasValue) + if(PFI.Decode(cmdBuf).HasValue) { tmpBuf = new byte[cmdBuf.Length - 4]; Array.Copy(cmdBuf, 4, tmpBuf, 0, cmdBuf.Length - 4); @@ -233,56 +241,56 @@ namespace DiscImageChef.Core.Devices.Dumping }; DataFile.WriteTo("SCSI Dump", sidecar.OpticalDisc[0].PFI.Image, tmpBuf); - Decoders.DVD.PFI.PhysicalFormatInformation decPfi = Decoders.DVD.PFI.Decode(cmdBuf).Value; - DicConsole.WriteLine("PFI:\n{0}", Decoders.DVD.PFI.Prettify(decPfi)); + PFI.PhysicalFormatInformation decPfi = PFI.Decode(cmdBuf).Value; + DicConsole.WriteLine("PFI:\n{0}", PFI.Prettify(decPfi)); // False book types if(dskType == MediaType.DVDROM) switch(decPfi.DiskCategory) { - case Decoders.DVD.DiskCategory.DVDPR: + case DiskCategory.DVDPR: dskType = MediaType.DVDPR; break; - case Decoders.DVD.DiskCategory.DVDPRDL: + case DiskCategory.DVDPRDL: dskType = MediaType.DVDPRDL; break; - case Decoders.DVD.DiskCategory.DVDPRW: + case DiskCategory.DVDPRW: dskType = MediaType.DVDPRW; break; - case Decoders.DVD.DiskCategory.DVDPRWDL: + case DiskCategory.DVDPRWDL: dskType = MediaType.DVDPRWDL; break; - case Decoders.DVD.DiskCategory.DVDR: + case DiskCategory.DVDR: if(decPfi.PartVersion == 6) dskType = MediaType.DVDRDL; else dskType = MediaType.DVDR; break; - case Decoders.DVD.DiskCategory.DVDRAM: + case DiskCategory.DVDRAM: dskType = MediaType.DVDRAM; break; default: dskType = MediaType.DVDROM; break; - case Decoders.DVD.DiskCategory.DVDRW: + case DiskCategory.DVDRW: if(decPfi.PartVersion == 3) dskType = MediaType.DVDRWDL; else dskType = MediaType.DVDRW; break; - case Decoders.DVD.DiskCategory.HDDVDR: + case DiskCategory.HDDVDR: dskType = MediaType.HDDVDR; break; - case Decoders.DVD.DiskCategory.HDDVDRAM: + case DiskCategory.HDDVDRAM: dskType = MediaType.HDDVDRAM; break; - case Decoders.DVD.DiskCategory.HDDVDROM: + case DiskCategory.HDDVDROM: dskType = MediaType.HDDVDROM; break; - case Decoders.DVD.DiskCategory.HDDVDRW: + case DiskCategory.HDDVDRW: dskType = MediaType.HDDVDRW; break; - case Decoders.DVD.DiskCategory.Nintendo: - if(decPfi.DiscSize == Decoders.DVD.DVDSize.Eighty) dskType = MediaType.GOD; + case DiskCategory.Nintendo: + if(decPfi.DiscSize == DVDSize.Eighty) dskType = MediaType.GOD; else dskType = MediaType.WOD; break; - case Decoders.DVD.DiskCategory.UMD: + case DiskCategory.UMD: dskType = MediaType.UMD; break; } @@ -295,10 +303,10 @@ namespace DiscImageChef.Core.Devices.Dumping out duration); if(!sense) { - if(Decoders.Xbox.DMI.IsXbox(cmdBuf) || Decoders.Xbox.DMI.IsXbox360(cmdBuf)) + if(DMI.IsXbox(cmdBuf) || DMI.IsXbox360(cmdBuf)) { - if(Decoders.Xbox.DMI.IsXbox(cmdBuf)) dskType = MediaType.XGD; - else if(Decoders.Xbox.DMI.IsXbox360(cmdBuf)) + if(DMI.IsXbox(cmdBuf)) dskType = MediaType.XGD; + else if(DMI.IsXbox360(cmdBuf)) { dskType = MediaType.XGD2; @@ -311,9 +319,9 @@ namespace DiscImageChef.Core.Devices.Dumping sense = dev.ScsiInquiry(out byte[] inqBuf, out senseBuf); - if(sense || !Decoders.SCSI.Inquiry.Decode(inqBuf).HasValue || - Decoders.SCSI.Inquiry.Decode(inqBuf).HasValue && - !Decoders.SCSI.Inquiry.Decode(inqBuf).Value.KreonPresent) + if(sense || !Inquiry.Decode(inqBuf).HasValue || + Inquiry.Decode(inqBuf).HasValue && + !Inquiry.Decode(inqBuf).Value.KreonPresent) { dumpLog.WriteLine("Dumping Xbox Game Discs requires a drive with Kreon firmware."); throw new @@ -362,7 +370,7 @@ namespace DiscImageChef.Core.Devices.Dumping MmcDiscStructureFormat.CopyrightInformation, 0, dev.Timeout, out duration); if(!sense) - if(Decoders.DVD.CSS_CPRM.DecodeLeadInCopyright(cmdBuf).HasValue) + if(CSS_CPRM.DecodeLeadInCopyright(cmdBuf).HasValue) { tmpBuf = new byte[cmdBuf.Length - 4]; Array.Copy(cmdBuf, 4, tmpBuf, 0, cmdBuf.Length - 4); @@ -374,9 +382,9 @@ namespace DiscImageChef.Core.Devices.Dumping }; DataFile.WriteTo("SCSI Dump", sidecar.OpticalDisc[0].CMI.Image, tmpBuf); - Decoders.DVD.CSS_CPRM.LeadInCopyright cpy = - Decoders.DVD.CSS_CPRM.DecodeLeadInCopyright(cmdBuf).Value; - if(cpy.CopyrightType != Decoders.DVD.CopyrightType.NoProtection) + CSS_CPRM.LeadInCopyright cpy = + CSS_CPRM.DecodeLeadInCopyright(cmdBuf).Value; + if(cpy.CopyrightType != CopyrightType.NoProtection) sidecar.OpticalDisc[0].CopyProtection = cpy.CopyrightType.ToString(); } } @@ -412,7 +420,7 @@ namespace DiscImageChef.Core.Devices.Dumping sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0, MmcDiscStructureFormat.DvdramDds, 0, dev.Timeout, out duration); if(!sense) - if(Decoders.DVD.DDS.Decode(cmdBuf).HasValue) + if(DDS.Decode(cmdBuf).HasValue) { tmpBuf = new byte[cmdBuf.Length - 4]; Array.Copy(cmdBuf, 4, tmpBuf, 0, cmdBuf.Length - 4); @@ -430,7 +438,7 @@ namespace DiscImageChef.Core.Devices.Dumping MmcDiscStructureFormat.DvdramSpareAreaInformation, 0, dev.Timeout, out duration); if(!sense) - if(Decoders.DVD.Spare.Decode(cmdBuf).HasValue) + if(Spare.Decode(cmdBuf).HasValue) { tmpBuf = new byte[cmdBuf.Length - 4]; Array.Copy(cmdBuf, 4, tmpBuf, 0, cmdBuf.Length - 4); @@ -574,7 +582,7 @@ namespace DiscImageChef.Core.Devices.Dumping sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0, MmcDiscStructureFormat.DiscInformation, 0, dev.Timeout, out duration); if(!sense) - if(Decoders.Bluray.DI.Decode(cmdBuf).HasValue) + if(DI.Decode(cmdBuf).HasValue) { tmpBuf = new byte[cmdBuf.Length - 4]; Array.Copy(cmdBuf, 4, tmpBuf, 0, cmdBuf.Length - 4); diff --git a/DiscImageChef.Core/Devices/Dumping/NVMe.cs b/DiscImageChef.Core/Devices/Dumping/NVMe.cs index 2e96aec1e..61dafe360 100644 --- a/DiscImageChef.Core/Devices/Dumping/NVMe.cs +++ b/DiscImageChef.Core/Devices/Dumping/NVMe.cs @@ -32,15 +32,16 @@ using System; using System.Text; -using DiscImageChef.Devices; using DiscImageChef.Core.Logging; +using DiscImageChef.Devices; +using DiscImageChef.Metadata; namespace DiscImageChef.Core.Devices.Dumping { public static class NvMe { public static void Dump(Device dev, string devicePath, string outputPrefix, ushort retryPasses, bool force, - bool dumpRaw, bool persistent, bool stopOnError, ref Metadata.Resume resume, + bool dumpRaw, bool persistent, bool stopOnError, ref Resume resume, ref DumpLog dumpLog, Encoding encoding) { throw new NotImplementedException("NVMe devices not yet supported."); diff --git a/DiscImageChef.Core/Devices/Dumping/ResumeSupport.cs b/DiscImageChef.Core/Devices/Dumping/ResumeSupport.cs index 39de09ff5..266e5a52c 100644 --- a/DiscImageChef.Core/Devices/Dumping/ResumeSupport.cs +++ b/DiscImageChef.Core/Devices/Dumping/ResumeSupport.cs @@ -35,13 +35,14 @@ using System.Collections.Generic; using DiscImageChef.Metadata; using Extents; using Schemas; +using PlatformID = DiscImageChef.Interop.PlatformID; namespace DiscImageChef.Core.Devices.Dumping { static class ResumeSupport { internal static void Process(bool isLba, bool removable, ulong blocks, string manufacturer, string model, - string serial, Interop.PlatformID platform, ref Resume resume, + string serial, PlatformID platform, ref Resume resume, ref DumpHardwareType currentTry, ref ExtentsULong extents) { if(resume != null) diff --git a/DiscImageChef.Core/Devices/Dumping/SBC.cs b/DiscImageChef.Core/Devices/Dumping/SBC.cs index 92c987651..5276b1fe3 100644 --- a/DiscImageChef.Core/Devices/Dumping/SBC.cs +++ b/DiscImageChef.Core/Devices/Dumping/SBC.cs @@ -35,26 +35,29 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; +using System.Xml.Serialization; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.Core.Logging; +using DiscImageChef.Decoders.ATA; +using DiscImageChef.Decoders.SCSI; using DiscImageChef.Devices; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; -using DiscImageChef.Partitions; -using Schemas; +using DiscImageChef.Metadata; using Extents; +using Schemas; +using MediaType = DiscImageChef.CommonTypes.MediaType; +using TrackType = DiscImageChef.DiscImages.TrackType; namespace DiscImageChef.Core.Devices.Dumping { - using TrackType = DiscImages.TrackType; - static class Sbc { internal static void Dump(Device dev, string devicePath, string outputPrefix, ushort retryPasses, bool force, bool dumpRaw, bool persistent, bool stopOnError, ref CICMMetadataType sidecar, - ref MediaType dskType, bool opticalDisc, ref Metadata.Resume resume, + ref MediaType dskType, bool opticalDisc, ref Resume resume, ref DumpLog dumpLog, Encoding encoding, Alcohol120 alcohol = null) { MhddLog mhddLog; @@ -168,7 +171,7 @@ namespace DiscImageChef.Core.Devices.Dumping if(dev.Type == DeviceType.ATAPI) { dumpLog.WriteLine("Requesting ATAPI IDENTIFY PACKET DEVICE."); - sense = dev.AtapiIdentify(out cmdBuf, out Decoders.ATA.AtaErrorRegistersCHS errorRegs); + sense = dev.AtapiIdentify(out cmdBuf, out AtaErrorRegistersCHS errorRegs); if(!sense) { sidecar.BlockMedia[0].ATA = new ATAType @@ -203,7 +206,7 @@ namespace DiscImageChef.Core.Devices.Dumping sense = dev.ScsiInquiry(out cmdBuf, out senseBuf, 0x00); if(!sense) { - byte[] pages = Decoders.SCSI.EVPD.DecodePage00(cmdBuf); + byte[] pages = EVPD.DecodePage00(cmdBuf); if(pages != null) { @@ -236,12 +239,12 @@ namespace DiscImageChef.Core.Devices.Dumping sense = dev.ModeSense10(out cmdBuf, out senseBuf, false, true, ScsiModeSensePageControl.Current, 0x3F, 0x00, 5, out duration); - Decoders.SCSI.Modes.DecodedMode? decMode = null; + Modes.DecodedMode? decMode = null; if(!sense && !dev.Error) - if(Decoders.SCSI.Modes.DecodeMode10(cmdBuf, dev.ScsiType).HasValue) + if(Modes.DecodeMode10(cmdBuf, dev.ScsiType).HasValue) { - decMode = Decoders.SCSI.Modes.DecodeMode10(cmdBuf, dev.ScsiType); + decMode = Modes.DecodeMode10(cmdBuf, dev.ScsiType); sidecar.BlockMedia[0].SCSI.ModeSense10 = new DumpType { Image = outputPrefix + ".modesense10.bin", @@ -260,9 +263,9 @@ namespace DiscImageChef.Core.Devices.Dumping if(sense || dev.Error) sense = dev.ModeSense(out cmdBuf, out senseBuf, 5, out duration); if(!sense && !dev.Error) - if(Decoders.SCSI.Modes.DecodeMode6(cmdBuf, dev.ScsiType).HasValue) + if(Modes.DecodeMode6(cmdBuf, dev.ScsiType).HasValue) { - decMode = Decoders.SCSI.Modes.DecodeMode6(cmdBuf, dev.ScsiType); + decMode = Modes.DecodeMode6(cmdBuf, dev.ScsiType); sidecar.BlockMedia[0].SCSI.ModeSense = new DumpType { Image = outputPrefix + ".modesense.bin", @@ -353,7 +356,7 @@ namespace DiscImageChef.Core.Devices.Dumping { if(aborted) { - currentTry.Extents = Metadata.ExtentsConverter.ToMetadata(extents); + currentTry.Extents = ExtentsConverter.ToMetadata(extents); dumpLog.WriteLine("Aborted!"); break; } @@ -396,7 +399,7 @@ namespace DiscImageChef.Core.Devices.Dumping } #pragma warning disable IDE0004 // Remove Unnecessary Cast - currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (cmdDuration / (double)1000); + currentSpeed = (double)blockSize * blocksToRead / 1048576 / (cmdDuration / 1000); #pragma warning restore IDE0004 // Remove Unnecessary Cast resume.NextBlock = i + blocksToRead; } @@ -406,7 +409,7 @@ namespace DiscImageChef.Core.Devices.Dumping mhddLog.Close(); #pragma warning disable IDE0004 // Remove Unnecessary Cast ibgLog.Close(dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024, - (double)blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), devicePath); + blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), devicePath); #pragma warning restore IDE0004 // Remove Unnecessary Cast dumpLog.WriteLine("Dump finished in {0} seconds.", (end - start).TotalSeconds); dumpLog.WriteLine("Average dump speed {0:F3} KiB/sec.", @@ -425,7 +428,7 @@ namespace DiscImageChef.Core.Devices.Dumping { if(aborted) { - currentTry.Extents = Metadata.ExtentsConverter.ToMetadata(extents); + currentTry.Extents = ExtentsConverter.ToMetadata(extents); dumpLog.WriteLine("Aborted!"); break; } @@ -456,8 +459,8 @@ namespace DiscImageChef.Core.Devices.Dumping goto repeatRetry; } - Decoders.SCSI.Modes.DecodedMode? currentMode = null; - Decoders.SCSI.Modes.ModePage? currentModePage = null; + Modes.DecodedMode? currentMode = null; + Modes.ModePage? currentModePage = null; byte[] md6 = null; byte[] md10 = null; @@ -469,40 +472,40 @@ namespace DiscImageChef.Core.Devices.Dumping { sense = dev.ModeSense10(out readBuffer, out senseBuf, false, ScsiModeSensePageControl.Current, 0x01, dev.Timeout, out duration); - if(!sense) currentMode = Decoders.SCSI.Modes.DecodeMode10(readBuffer, dev.ScsiType); + if(!sense) currentMode = Modes.DecodeMode10(readBuffer, dev.ScsiType); } - else currentMode = Decoders.SCSI.Modes.DecodeMode6(readBuffer, dev.ScsiType); + else currentMode = Modes.DecodeMode6(readBuffer, dev.ScsiType); if(currentMode.HasValue) currentModePage = currentMode.Value.Pages[0]; - if(dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice) + if(dev.ScsiType == PeripheralDeviceTypes.MultiMediaDevice) { - Decoders.SCSI.Modes.ModePage_01_MMC pgMmc = - new Decoders.SCSI.Modes.ModePage_01_MMC + Modes.ModePage_01_MMC pgMmc = + new Modes.ModePage_01_MMC { PS = false, ReadRetryCount = 255, Parameter = 0x20 }; - Decoders.SCSI.Modes.DecodedMode md = new Decoders.SCSI.Modes.DecodedMode + Modes.DecodedMode md = new Modes.DecodedMode { - Header = new Decoders.SCSI.Modes.ModeHeader(), - Pages = new Decoders.SCSI.Modes.ModePage[] + Header = new Modes.ModeHeader(), + Pages = new[] { - new Decoders.SCSI.Modes.ModePage + new Modes.ModePage { Page = 0x01, Subpage = 0x00, - PageResponse = Decoders.SCSI.Modes.EncodeModePage_01_MMC(pgMmc) + PageResponse = Modes.EncodeModePage_01_MMC(pgMmc) } } }; - md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.ScsiType); - md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.ScsiType); + md6 = Modes.EncodeMode6(md, dev.ScsiType); + md10 = Modes.EncodeMode10(md, dev.ScsiType); } else { - Decoders.SCSI.Modes.ModePage_01 pg = new Decoders.SCSI.Modes.ModePage_01 + Modes.ModePage_01 pg = new Modes.ModePage_01 { PS = false, AWRE = false, @@ -515,21 +518,21 @@ namespace DiscImageChef.Core.Devices.Dumping DCR = false, ReadRetryCount = 255 }; - Decoders.SCSI.Modes.DecodedMode md = new Decoders.SCSI.Modes.DecodedMode + Modes.DecodedMode md = new Modes.DecodedMode { - Header = new Decoders.SCSI.Modes.ModeHeader(), - Pages = new Decoders.SCSI.Modes.ModePage[] + Header = new Modes.ModeHeader(), + Pages = new[] { - new Decoders.SCSI.Modes.ModePage + new Modes.ModePage { Page = 0x01, Subpage = 0x00, - PageResponse = Decoders.SCSI.Modes.EncodeModePage_01(pg) + PageResponse = Modes.EncodeModePage_01(pg) } } }; - md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.ScsiType); - md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.ScsiType); + md6 = Modes.EncodeMode6(md, dev.ScsiType); + md10 = Modes.EncodeMode10(md, dev.ScsiType); } dumpLog.WriteLine("Sending MODE SELECT to drive."); @@ -545,13 +548,13 @@ namespace DiscImageChef.Core.Devices.Dumping } else if(runningPersistent && persistent && currentModePage.HasValue) { - Decoders.SCSI.Modes.DecodedMode md = new Decoders.SCSI.Modes.DecodedMode + Modes.DecodedMode md = new Modes.DecodedMode { - Header = new Decoders.SCSI.Modes.ModeHeader(), - Pages = new Decoders.SCSI.Modes.ModePage[] {currentModePage.Value} + Header = new Modes.ModeHeader(), + Pages = new[] {currentModePage.Value} }; - md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.ScsiType); - md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.ScsiType); + md6 = Modes.EncodeMode6(md, dev.ScsiType); + md10 = Modes.EncodeMode10(md, dev.ScsiType); dumpLog.WriteLine("Sending MODE SELECT to drive."); sense = dev.ModeSelect(md6, out senseBuf, true, false, dev.Timeout, out duration); @@ -563,7 +566,7 @@ namespace DiscImageChef.Core.Devices.Dumping #endregion Error handling resume.BadBlocks.Sort(); - currentTry.Extents = Metadata.ExtentsConverter.ToMetadata(extents); + currentTry.Extents = ExtentsConverter.ToMetadata(extents); dataChk = new Checksum(); dumpFile.Seek(0, SeekOrigin.Begin); @@ -592,7 +595,7 @@ namespace DiscImageChef.Core.Devices.Dumping totalChkDuration += chkDuration; #pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created - currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (chkDuration / (double)1000); + currentSpeed = (double)blockSize * blocksToRead / 1048576 / (chkDuration / 1000); #pragma warning restore IDE0004 // Cast is necessary, otherwise incorrect value is created } @@ -791,7 +794,7 @@ namespace DiscImageChef.Core.Devices.Dumping break; } - sidecar.OpticalDisc[0].Dimensions = Metadata.Dimensions.DimensionsFromMediaType(dskType); + sidecar.OpticalDisc[0].Dimensions = Dimensions.DimensionsFromMediaType(dskType); Metadata.MediaType.MediaTypeToString(dskType, out string xmlDskTyp, out string xmlDskSubTyp); sidecar.OpticalDisc[0].DiscType = xmlDskTyp; sidecar.OpticalDisc[0].DiscSubType = xmlDskSubTyp; @@ -799,7 +802,7 @@ namespace DiscImageChef.Core.Devices.Dumping else { sidecar.BlockMedia[0].Checksums = dataChk.End().ToArray(); - sidecar.BlockMedia[0].Dimensions = Metadata.Dimensions.DimensionsFromMediaType(dskType); + sidecar.BlockMedia[0].Dimensions = Dimensions.DimensionsFromMediaType(dskType); Metadata.MediaType.MediaTypeToString(dskType, out string xmlDskTyp, out string xmlDskSubTyp); sidecar.BlockMedia[0].DiskType = xmlDskTyp; sidecar.BlockMedia[0].DiskSubType = xmlDskSubTyp; @@ -845,8 +848,8 @@ namespace DiscImageChef.Core.Devices.Dumping FileStream xmlFs = new FileStream(outputPrefix + ".cicm.xml", FileMode.Create); - System.Xml.Serialization.XmlSerializer xmlSer = - new System.Xml.Serialization.XmlSerializer(typeof(CICMMetadataType)); + XmlSerializer xmlSer = + new XmlSerializer(typeof(CICMMetadataType)); xmlSer.Serialize(xmlFs, sidecar); xmlFs.Close(); if(alcohol != null && !dumpRaw) alcohol.Close(); diff --git a/DiscImageChef.Core/Devices/Dumping/SCSI.cs b/DiscImageChef.Core/Devices/Dumping/SCSI.cs index 7b19594a3..dabf2eba5 100644 --- a/DiscImageChef.Core/Devices/Dumping/SCSI.cs +++ b/DiscImageChef.Core/Devices/Dumping/SCSI.cs @@ -31,13 +31,15 @@ // ****************************************************************************/ using System; -using System.IO; using System.Text; -using DiscImageChef.CommonTypes; +using System.Threading; using DiscImageChef.Console; -using DiscImageChef.Devices; using DiscImageChef.Core.Logging; +using DiscImageChef.Decoders.SCSI; +using DiscImageChef.Devices; +using DiscImageChef.Metadata; using Schemas; +using MediaType = DiscImageChef.CommonTypes.MediaType; namespace DiscImageChef.Core.Devices.Dumping { @@ -46,7 +48,7 @@ namespace DiscImageChef.Core.Devices.Dumping // TODO: Get cartridge serial number from Certance vendor EVPD public static void Dump(Device dev, string devicePath, string outputPrefix, ushort retryPasses, bool force, bool dumpRaw, bool persistent, bool stopOnError, bool separateSubchannel, - ref Metadata.Resume resume, ref DumpLog dumpLog, bool dumpLeadIn, Encoding encoding) + ref Resume resume, ref DumpLog dumpLog, bool dumpLeadIn, Encoding encoding) { byte[] senseBuf = null; bool sense = false; @@ -59,7 +61,7 @@ namespace DiscImageChef.Core.Devices.Dumping sense = dev.ScsiTestUnitReady(out senseBuf, dev.Timeout, out double duration); if(sense) { - Decoders.SCSI.FixedSense? decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf); + FixedSense? decSense = Sense.DecodeFixed(senseBuf); if(decSense.HasValue) { dumpLog.WriteLine("Device not ready. Sense {0}h ASC {1:X2}h ASCQ {2:X2}h", @@ -78,11 +80,11 @@ namespace DiscImageChef.Core.Devices.Dumping while(leftRetries > 0) { DicConsole.WriteLine("\rWaiting for drive to become ready"); - System.Threading.Thread.Sleep(2000); + Thread.Sleep(2000); sense = dev.ScsiTestUnitReady(out senseBuf, dev.Timeout, out duration); if(!sense) break; - decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf); + decSense = Sense.DecodeFixed(senseBuf); if(decSense.HasValue) dumpLog.WriteLine("Device not ready. Sense {0}h ASC {1:X2}h ASCQ {2:X2}h", decSense.Value.SenseKey, decSense.Value.ASC, decSense.Value.ASCQ); @@ -101,11 +103,11 @@ namespace DiscImageChef.Core.Devices.Dumping while(leftRetries > 0) { DicConsole.WriteLine("\rWaiting for drive to become ready"); - System.Threading.Thread.Sleep(2000); + Thread.Sleep(2000); sense = dev.ScsiTestUnitReady(out senseBuf, dev.Timeout, out duration); if(!sense) break; - decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf); + decSense = Sense.DecodeFixed(senseBuf); if(decSense.HasValue) dumpLog.WriteLine("Device not ready. Sense {0}h ASC {1:X2}h ASCQ {2:X2}h", decSense.Value.SenseKey, decSense.Value.ASC, decSense.Value.ASCQ); @@ -115,7 +117,7 @@ namespace DiscImageChef.Core.Devices.Dumping if(sense) { DicConsole.ErrorWriteLine("Error testing unit was ready:\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); return; } } @@ -138,11 +140,11 @@ namespace DiscImageChef.Core.Devices.Dumping while(leftRetries > 0) { DicConsole.WriteLine("\rWaiting for drive to become ready"); - System.Threading.Thread.Sleep(2000); + Thread.Sleep(2000); sense = dev.ScsiTestUnitReady(out senseBuf, dev.Timeout, out duration); if(!sense) break; - decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf); + decSense = Sense.DecodeFixed(senseBuf); if(decSense.HasValue) dumpLog.WriteLine("Device not ready. Sense {0}h ASC {1:X2}h ASCQ {2:X2}h", decSense.Value.SenseKey, decSense.Value.ASC, decSense.Value.ASCQ); @@ -152,14 +154,14 @@ namespace DiscImageChef.Core.Devices.Dumping if(sense) { DicConsole.ErrorWriteLine("Error testing unit was ready:\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); return; } } else { DicConsole.ErrorWriteLine("Error testing unit was ready:\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); return; } } @@ -174,12 +176,12 @@ namespace DiscImageChef.Core.Devices.Dumping CICMMetadataType sidecar = new CICMMetadataType(); switch(dev.ScsiType) { - case Decoders.SCSI.PeripheralDeviceTypes.SequentialAccess: + case PeripheralDeviceTypes.SequentialAccess: if(dumpRaw) throw new ArgumentException("Tapes cannot be dumped raw."); Ssc.Dump(dev, outputPrefix, devicePath, ref sidecar, ref resume, ref dumpLog); return; - case Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice: + case PeripheralDeviceTypes.MultiMediaDevice: Mmc.Dump(dev, devicePath, outputPrefix, retryPasses, force, dumpRaw, persistent, stopOnError, ref sidecar, ref dskType, separateSubchannel, ref resume, ref dumpLog, dumpLeadIn, encoding); return; diff --git a/DiscImageChef.Core/Devices/Dumping/SSC.cs b/DiscImageChef.Core/Devices/Dumping/SSC.cs index 9af3e471c..2dcbd1ba7 100644 --- a/DiscImageChef.Core/Devices/Dumping/SSC.cs +++ b/DiscImageChef.Core/Devices/Dumping/SSC.cs @@ -33,21 +33,25 @@ using System; using System.Collections.Generic; using System.IO; -using System.Text; +using System.Threading; +using System.Xml.Serialization; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.Core.Logging; +using DiscImageChef.Decoders.SCSI; using DiscImageChef.Devices; +using DiscImageChef.Metadata; using Schemas; +using MediaType = DiscImageChef.CommonTypes.MediaType; namespace DiscImageChef.Core.Devices.Dumping { static class Ssc { internal static void Dump(Device dev, string outputPrefix, string devicePath, ref CICMMetadataType sidecar, - ref Metadata.Resume resume, ref DumpLog dumpLog) + ref Resume resume, ref DumpLog dumpLog) { - Decoders.SCSI.FixedSense? fxSense; + FixedSense? fxSense; bool aborted; MhddLog mhddLog; IbgLog ibgLog; @@ -66,9 +70,9 @@ namespace DiscImageChef.Core.Devices.Dumping Checksum dataChk; dev.RequestSense(out byte[] senseBuf, dev.Timeout, out double duration); - fxSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf, out string strSense); + fxSense = Sense.DecodeFixed(senseBuf, out string strSense); - if(fxSense.HasValue && fxSense.Value.SenseKey != Decoders.SCSI.SenseKeys.NoSense) + if(fxSense.HasValue && fxSense.Value.SenseKey != SenseKeys.NoSense) { dumpLog.WriteLine("Device not ready. Sense {0}h ASC {1:X2}h ASCQ {2:X2}h", fxSense.Value.SenseKey, fxSense.Value.ASC, fxSense.Value.ASCQ); @@ -79,7 +83,7 @@ namespace DiscImageChef.Core.Devices.Dumping // Not in BOM/P if(fxSense.HasValue && fxSense.Value.ASC == 0x00 && fxSense.Value.ASCQ != 0x00 && - fxSense.Value.ASCQ != 0x04 && fxSense.Value.SenseKey != Decoders.SCSI.SenseKeys.IllegalRequest) + fxSense.Value.ASCQ != 0x04 && fxSense.Value.SenseKey != SenseKeys.IllegalRequest) { dumpLog.WriteLine("Rewinding, please wait..."); DicConsole.Write("Rewinding, please wait..."); @@ -92,13 +96,13 @@ namespace DiscImageChef.Core.Devices.Dumping { DicConsole.Write("\rRewinding, please wait..."); dev.RequestSense(out senseBuf, dev.Timeout, out duration); - fxSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf, out strSense); + fxSense = Sense.DecodeFixed(senseBuf, out strSense); } while(fxSense.HasValue && fxSense.Value.ASC == 0x00 && (fxSense.Value.ASCQ == 0x1A || fxSense.Value.ASCQ != 0x04)); dev.RequestSense(out senseBuf, dev.Timeout, out duration); - fxSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf, out strSense); + fxSense = Sense.DecodeFixed(senseBuf, out strSense); // And yet, did not rewind! if(fxSense.HasValue && (fxSense.Value.ASC == 0x00 && fxSense.Value.ASCQ != 0x04 || @@ -124,11 +128,11 @@ namespace DiscImageChef.Core.Devices.Dumping { // READ POSITION is mandatory starting SCSI-2, so do not cry if the drive does not recognize the command (SCSI-1 or earlier) // Anyway, <=SCSI-1 tapes do not support partitions - fxSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf, out strSense); + fxSense = Sense.DecodeFixed(senseBuf, out strSense); if(fxSense.HasValue && (fxSense.Value.ASC == 0x20 && fxSense.Value.ASCQ != 0x00 || fxSense.Value.ASC != 0x20 && fxSense.Value.SenseKey != - Decoders.SCSI.SenseKeys.IllegalRequest)) + SenseKeys.IllegalRequest)) { DicConsole.ErrorWriteLine("Could not get position. Sense follows..."); DicConsole.ErrorWriteLine("{0}", strSense); @@ -162,10 +166,10 @@ namespace DiscImageChef.Core.Devices.Dumping // TODO: Pause? do { - System.Threading.Thread.Sleep(1000); + Thread.Sleep(1000); DicConsole.Write("\rRewinding, please wait..."); dev.RequestSense(out senseBuf, dev.Timeout, out duration); - fxSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf, out strSense); + fxSense = Sense.DecodeFixed(senseBuf, out strSense); } while(fxSense.HasValue && fxSense.Value.ASC == 0x00 && (fxSense.Value.ASCQ == 0x1A || fxSense.Value.ASCQ == 0x19)); @@ -187,7 +191,7 @@ namespace DiscImageChef.Core.Devices.Dumping out duration); if(sense) { - fxSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf, out strSense); + fxSense = Sense.DecodeFixed(senseBuf, out strSense); DicConsole.ErrorWriteLine("Drive could not rewind, please correct. Sense follows..."); DicConsole.ErrorWriteLine("{0}", strSense); dumpLog.WriteLine("Drive could not rewind, please correct. Sense follows..."); @@ -220,12 +224,12 @@ namespace DiscImageChef.Core.Devices.Dumping sense = dev.ModeSense10(out cmdBuf, out senseBuf, false, true, ScsiModeSensePageControl.Current, 0x3F, 0x00, 5, out duration); - Decoders.SCSI.Modes.DecodedMode? decMode = null; + Modes.DecodedMode? decMode = null; if(!sense && !dev.Error) - if(Decoders.SCSI.Modes.DecodeMode10(cmdBuf, dev.ScsiType).HasValue) + if(Modes.DecodeMode10(cmdBuf, dev.ScsiType).HasValue) { - decMode = Decoders.SCSI.Modes.DecodeMode10(cmdBuf, dev.ScsiType); + decMode = Modes.DecodeMode10(cmdBuf, dev.ScsiType); sidecar.BlockMedia[0].SCSI.ModeSense10 = new DumpType { Image = outputPrefix + ".modesense10.bin", @@ -244,9 +248,9 @@ namespace DiscImageChef.Core.Devices.Dumping if(sense || dev.Error) sense = dev.ModeSense(out cmdBuf, out senseBuf, 5, out duration); if(!sense && !dev.Error) - if(Decoders.SCSI.Modes.DecodeMode6(cmdBuf, dev.ScsiType).HasValue) + if(Modes.DecodeMode6(cmdBuf, dev.ScsiType).HasValue) { - decMode = Decoders.SCSI.Modes.DecodeMode6(cmdBuf, dev.ScsiType); + decMode = Modes.DecodeMode6(cmdBuf, dev.ScsiType); sidecar.BlockMedia[0].SCSI.ModeSense = new DumpType { Image = outputPrefix + ".modesense.bin", @@ -294,14 +298,14 @@ namespace DiscImageChef.Core.Devices.Dumping out duration); if(sense) { - fxSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf, out strSense); + fxSense = Sense.DecodeFixed(senseBuf, out strSense); if(fxSense.HasValue) - if(fxSense.Value.SenseKey == Decoders.SCSI.SenseKeys.IllegalRequest) + if(fxSense.Value.SenseKey == SenseKeys.IllegalRequest) { sense = dev.Space(out senseBuf, SscSpaceCodes.LogicalBlock, -1, dev.Timeout, out duration); if(sense) { - fxSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf, out strSense); + fxSense = Sense.DecodeFixed(senseBuf, out strSense); if(!fxSense.HasValue || !fxSense.Value.EOM) { DicConsole.WriteLine(); @@ -351,7 +355,7 @@ namespace DiscImageChef.Core.Devices.Dumping sense = dev.Space(out senseBuf, SscSpaceCodes.LogicalBlock, -1, dev.Timeout, out duration); if(sense) { - fxSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf, out strSense); + fxSense = Sense.DecodeFixed(senseBuf, out strSense); if(!fxSense.HasValue || !fxSense.Value.EOM) { DicConsole.WriteLine(); @@ -401,7 +405,7 @@ namespace DiscImageChef.Core.Devices.Dumping offsetSpecified = true, Value = outputPrefix + ".bin" }, - Sequence = (long)currentPartition, + Sequence = currentPartition, StartBlock = (long)currentBlock }; partitionChk = new Checksum(); @@ -484,7 +488,7 @@ namespace DiscImageChef.Core.Devices.Dumping if(sense) { - fxSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf, out strSense); + fxSense = Sense.DecodeFixed(senseBuf, out strSense); if(fxSense.Value.ASC == 0x00 && fxSense.Value.ASCQ == 0x00 && fxSense.Value.ILI && fxSense.Value.InformationValid) { @@ -501,7 +505,7 @@ namespace DiscImageChef.Core.Devices.Dumping if(sense) { - fxSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf, out strSense); + fxSense = Sense.DecodeFixed(senseBuf, out strSense); DicConsole.WriteLine(); DicConsole.ErrorWriteLine("Drive could not go back one block. Sense follows..."); DicConsole.ErrorWriteLine("{0}", strSense); @@ -515,7 +519,7 @@ namespace DiscImageChef.Core.Devices.Dumping continue; } - if(fxSense.Value.SenseKey == Decoders.SCSI.SenseKeys.BlankCheck) + if(fxSense.Value.SenseKey == SenseKeys.BlankCheck) { if(currentBlock == 0) { @@ -543,8 +547,8 @@ namespace DiscImageChef.Core.Devices.Dumping continue; } - if((fxSense.Value.SenseKey == Decoders.SCSI.SenseKeys.NoSense || - fxSense.Value.SenseKey == Decoders.SCSI.SenseKeys.RecoveredError) && + if((fxSense.Value.SenseKey == SenseKeys.NoSense || + fxSense.Value.SenseKey == SenseKeys.RecoveredError) && (fxSense.Value.ASCQ == 0x02 || fxSense.Value.ASCQ == 0x05 || fxSense.Value.EOM)) { // TODO: Detect end of partition @@ -553,8 +557,8 @@ namespace DiscImageChef.Core.Devices.Dumping continue; } - if((fxSense.Value.SenseKey == Decoders.SCSI.SenseKeys.NoSense || - fxSense.Value.SenseKey == Decoders.SCSI.SenseKeys.RecoveredError) && + if((fxSense.Value.SenseKey == SenseKeys.NoSense || + fxSense.Value.SenseKey == SenseKeys.RecoveredError) && (fxSense.Value.ASCQ == 0x01 || fxSense.Value.Filemark)) { currentTapeFile.Checksums = fileChk.End().ToArray(); @@ -586,7 +590,7 @@ namespace DiscImageChef.Core.Devices.Dumping } // TODO: Add error recovering for tapes - fxSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf, out strSense); + fxSense = Sense.DecodeFixed(senseBuf, out strSense); DicConsole.ErrorWriteLine("Drive could not read block. Sense follows..."); DicConsole.ErrorWriteLine("{0} {1}", fxSense.Value.SenseKey, strSense); dumpLog.WriteLine("Drive could not read block. Sense follows..."); @@ -608,7 +612,7 @@ namespace DiscImageChef.Core.Devices.Dumping totalChkDuration += chkDuration; if(currentBlock % 10 == 0) - currentSpeed = (double)blockSize / (double)1048576 / (duration / (double)1000); + currentSpeed = blockSize / (double)1048576 / (duration / 1000); currentBlock++; currentSize += blockSize; currentFileSize += blockSize; @@ -620,7 +624,7 @@ namespace DiscImageChef.Core.Devices.Dumping end = DateTime.UtcNow; mhddLog.Close(); ibgLog.Close(dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024, - (double)blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), devicePath); + blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), devicePath); dumpLog.WriteLine("Dump finished in {0} seconds.", (end - start).TotalSeconds); dumpLog.WriteLine("Average dump speed {0:F3} KiB/sec.", (double)blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000)); @@ -637,7 +641,7 @@ namespace DiscImageChef.Core.Devices.Dumping DicConsole.WriteLine("Slowest speed burst: {0:F3} MiB/sec.", minSpeed); sidecar.BlockMedia[0].Checksums = dataChk.End().ToArray(); - sidecar.BlockMedia[0].Dimensions = Metadata.Dimensions.DimensionsFromMediaType(dskType); + sidecar.BlockMedia[0].Dimensions = Dimensions.DimensionsFromMediaType(dskType); Metadata.MediaType.MediaTypeToString(dskType, out string xmlDskTyp, out string xmlDskSubTyp); sidecar.BlockMedia[0].DiskType = xmlDskTyp; sidecar.BlockMedia[0].DiskSubType = xmlDskSubTyp; @@ -665,15 +669,13 @@ namespace DiscImageChef.Core.Devices.Dumping FileStream xmlFs = new FileStream(outputPrefix + ".cicm.xml", FileMode.Create); - System.Xml.Serialization.XmlSerializer xmlSer = - new System.Xml.Serialization.XmlSerializer(typeof(CICMMetadataType)); + XmlSerializer xmlSer = + new XmlSerializer(typeof(CICMMetadataType)); xmlSer.Serialize(xmlFs, sidecar); xmlFs.Close(); } Statistics.AddMedia(dskType, true); - - return; } } } \ No newline at end of file diff --git a/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs b/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs index 0e7a9cad7..d2bdabb64 100644 --- a/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs +++ b/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs @@ -34,23 +34,26 @@ using System; using System.Collections.Generic; using System.IO; using System.Text; +using System.Xml.Serialization; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.Core.Logging; using DiscImageChef.Decoders.MMC; using DiscImageChef.Devices; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; +using DiscImageChef.Metadata; using Extents; using Schemas; +using MediaType = DiscImageChef.Metadata.MediaType; namespace DiscImageChef.Core.Devices.Dumping { public class SecureDigital { public static void Dump(Device dev, string devicePath, string outputPrefix, ushort retryPasses, bool force, - bool dumpRaw, bool persistent, bool stopOnError, ref Metadata.Resume resume, + bool dumpRaw, bool persistent, bool stopOnError, ref Resume resume, ref DumpLog dumpLog, Encoding encoding) { bool aborted; @@ -75,7 +78,7 @@ namespace DiscImageChef.Core.Devices.Dumping double duration; CICMMetadataType sidecar = - new CICMMetadataType {BlockMedia = new BlockMediaType[] {new BlockMediaType()}}; + new CICMMetadataType {BlockMedia = new[] {new BlockMediaType()}}; uint blocksToRead = 128; uint blockSize = 512; @@ -305,7 +308,7 @@ namespace DiscImageChef.Core.Devices.Dumping { if(aborted) { - currentTry.Extents = Metadata.ExtentsConverter.ToMetadata(extents); + currentTry.Extents = ExtentsConverter.ToMetadata(extents); dumpLog.WriteLine("Aborted!"); break; } @@ -342,7 +345,7 @@ namespace DiscImageChef.Core.Devices.Dumping } #pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created - currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (duration / (double)1000); + currentSpeed = (double)blockSize * blocksToRead / 1048576 / (duration / 1000); #pragma warning restore IDE0004 // Cast is necessary, otherwise incorrect value is created GC.Collect(); resume.NextBlock = i + blocksToRead; @@ -353,7 +356,7 @@ namespace DiscImageChef.Core.Devices.Dumping mhddLog.Close(); #pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created ibgLog.Close(dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024, - (double)blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), devicePath); + blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), devicePath); #pragma warning restore IDE0004 // Cast is necessary, otherwise incorrect value is created dumpLog.WriteLine("Dump finished in {0} seconds.", (end - start).TotalSeconds); dumpLog.WriteLine("Average dump speed {0:F3} KiB/sec.", @@ -372,7 +375,7 @@ namespace DiscImageChef.Core.Devices.Dumping { if(aborted) { - currentTry.Extents = Metadata.ExtentsConverter.ToMetadata(extents); + currentTry.Extents = ExtentsConverter.ToMetadata(extents); dumpLog.WriteLine("Aborted!"); break; } @@ -409,7 +412,7 @@ namespace DiscImageChef.Core.Devices.Dumping } #endregion Error handling - currentTry.Extents = Metadata.ExtentsConverter.ToMetadata(extents); + currentTry.Extents = ExtentsConverter.ToMetadata(extents); dataChk = new Checksum(); dumpFile.Seek(0, SeekOrigin.Begin); @@ -437,7 +440,7 @@ namespace DiscImageChef.Core.Devices.Dumping double chkDuration = (chkEnd - chkStart).TotalMilliseconds; totalChkDuration += chkDuration; - currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (chkDuration / (double)1000); + currentSpeed = (double)blockSize * blocksToRead / 1048576 / (chkDuration / 1000); } DicConsole.WriteLine(); @@ -548,12 +551,12 @@ namespace DiscImageChef.Core.Devices.Dumping string xmlDskTyp = null, xmlDskSubTyp = null; switch(dev.Type) { case DeviceType.MMC: - Metadata.MediaType.MediaTypeToString(MediaType.MMC, out xmlDskTyp, out xmlDskSubTyp); - sidecar.BlockMedia[0].Dimensions = Metadata.Dimensions.DimensionsFromMediaType(MediaType.MMC); + MediaType.MediaTypeToString(CommonTypes.MediaType.MMC, out xmlDskTyp, out xmlDskSubTyp); + sidecar.BlockMedia[0].Dimensions = Dimensions.DimensionsFromMediaType(CommonTypes.MediaType.MMC); break; case DeviceType.SecureDigital: - Metadata.MediaType.MediaTypeToString(MediaType.SecureDigital, out xmlDskTyp, out xmlDskSubTyp); - sidecar.BlockMedia[0].Dimensions = Metadata.Dimensions.DimensionsFromMediaType(MediaType.SecureDigital); + MediaType.MediaTypeToString(CommonTypes.MediaType.SecureDigital, out xmlDskTyp, out xmlDskSubTyp); + sidecar.BlockMedia[0].Dimensions = Dimensions.DimensionsFromMediaType(CommonTypes.MediaType.SecureDigital); break; } sidecar.BlockMedia[0].DiskType = xmlDskTyp; @@ -597,16 +600,16 @@ namespace DiscImageChef.Core.Devices.Dumping FileStream xmlFs = new FileStream(outputPrefix + ".cicm.xml", FileMode.Create); - System.Xml.Serialization.XmlSerializer xmlSer = - new System.Xml.Serialization.XmlSerializer(typeof(CICMMetadataType)); + XmlSerializer xmlSer = + new XmlSerializer(typeof(CICMMetadataType)); xmlSer.Serialize(xmlFs, sidecar); xmlFs.Close(); } switch(dev.Type) { - case DeviceType.MMC: Statistics.AddMedia(MediaType.MMC, true); + case DeviceType.MMC: Statistics.AddMedia(CommonTypes.MediaType.MMC, true); break; - case DeviceType.SecureDigital: Statistics.AddMedia(MediaType.SecureDigital, true); + case DeviceType.SecureDigital: Statistics.AddMedia(CommonTypes.MediaType.SecureDigital, true); break; } } diff --git a/DiscImageChef.Core/Devices/Dumping/XGD.cs b/DiscImageChef.Core/Devices/Dumping/XGD.cs index 4b18a778d..7bab91893 100644 --- a/DiscImageChef.Core/Devices/Dumping/XGD.cs +++ b/DiscImageChef.Core/Devices/Dumping/XGD.cs @@ -34,16 +34,22 @@ using System; using System.Collections.Generic; using System.IO; using System.Text; +using System.Xml.Serialization; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.Core.Logging; +using DiscImageChef.Decoders.DVD; +using DiscImageChef.Decoders.SCSI; +using DiscImageChef.Decoders.Xbox; using DiscImageChef.Devices; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; -using DiscImageChef.Partitions; +using DiscImageChef.Metadata; using Extents; using Schemas; +using MediaType = DiscImageChef.CommonTypes.MediaType; +using TrackType = Schemas.TrackType; namespace DiscImageChef.Core.Devices.Dumping { @@ -51,7 +57,7 @@ namespace DiscImageChef.Core.Devices.Dumping { internal static void Dump(Device dev, string devicePath, string outputPrefix, ushort retryPasses, bool force, bool dumpRaw, bool persistent, bool stopOnError, ref CICMMetadataType sidecar, - ref MediaType dskType, ref Metadata.Resume resume, ref DumpLog dumpLog, + ref MediaType dskType, ref Resume resume, ref DumpLog dumpLog, Encoding encoding) { MhddLog mhddLog; @@ -83,7 +89,7 @@ namespace DiscImageChef.Core.Devices.Dumping } dumpLog.WriteLine("Decoding Xbox Security Sector."); - Decoders.Xbox.SS.SecuritySector? xboxSs = Decoders.Xbox.SS.Decode(ssBuf); + SS.SecuritySector? xboxSs = SS.Decode(ssBuf); if(!xboxSs.HasValue) { dumpLog.WriteLine("Cannot decode Xbox Security Sector, not continuing."); @@ -95,7 +101,7 @@ namespace DiscImageChef.Core.Devices.Dumping Array.Copy(ssBuf, 4, tmpBuf, 0, ssBuf.Length - 4); sidecar.OpticalDisc[0].Xbox = new XboxType { - SecuritySectors = new XboxSecuritySectorsType[] + SecuritySectors = new[] { new XboxSecuritySectorsType { @@ -155,8 +161,8 @@ namespace DiscImageChef.Core.Devices.Dumping }; DataFile.WriteTo("SCSI Dump", sidecar.OpticalDisc[0].PFI.Image, tmpBuf, "Locked PFI", true); DicConsole.DebugWriteLine("Dump-media command", "Video partition total size: {0} sectors", totalSize); - l0Video = Decoders.DVD.PFI.Decode(readBuffer).Value.Layer0EndPSN - - Decoders.DVD.PFI.Decode(readBuffer).Value.DataAreaStartPSN + 1; + l0Video = PFI.Decode(readBuffer).Value.Layer0EndPSN - + PFI.Decode(readBuffer).Value.DataAreaStartPSN + 1; l1Video = totalSize - l0Video + 1; dumpLog.WriteLine("Reading Disc Manufacturing Information."); sense = dev.ReadDiscStructure(out readBuffer, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0, @@ -235,8 +241,8 @@ namespace DiscImageChef.Core.Devices.Dumping DicConsole.DebugWriteLine("Dump-media command", "Unlocked total size: {0} sectors", totalSize); blocks = totalSize + 1; - middleZone = totalSize - (Decoders.DVD.PFI.Decode(readBuffer).Value.Layer0EndPSN - - Decoders.DVD.PFI.Decode(readBuffer).Value.DataAreaStartPSN + 1) - gameSize + 1; + middleZone = totalSize - (PFI.Decode(readBuffer).Value.Layer0EndPSN - + PFI.Decode(readBuffer).Value.DataAreaStartPSN + 1) - gameSize + 1; tmpBuf = new byte[readBuffer.Length - 4]; Array.Copy(readBuffer, 4, tmpBuf, 0, readBuffer.Length - 4); @@ -347,7 +353,7 @@ namespace DiscImageChef.Core.Devices.Dumping if(aborted) { resume.NextBlock = currentSector; - currentTry.Extents = Metadata.ExtentsConverter.ToMetadata(extents); + currentTry.Extents = ExtentsConverter.ToMetadata(extents); dumpLog.WriteLine("Aborted!"); break; } @@ -384,7 +390,7 @@ namespace DiscImageChef.Core.Devices.Dumping if(aborted) { - currentTry.Extents = Metadata.ExtentsConverter.ToMetadata(extents); + currentTry.Extents = ExtentsConverter.ToMetadata(extents); dumpLog.WriteLine("Aborted!"); break; } @@ -421,21 +427,20 @@ namespace DiscImageChef.Core.Devices.Dumping for(ulong b = i; b < i + blocksToRead; b++) resume.BadBlocks.Add(b); DicConsole.DebugWriteLine("Dump-Media", "READ error:\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); if(cmdDuration < 500) mhddLog.Write(i, 65535); else mhddLog.Write(i, cmdDuration); ibgLog.Write(i, 0); dumpLog.WriteLine("Error reading {0} blocks from block {1}.", blocksToRead, i); - string[] senseLines = Decoders - .SCSI.Sense.PrettifySense(senseBuf).Split(new[] {Environment.NewLine}, + string[] senseLines = Sense.PrettifySense(senseBuf).Split(new[] {Environment.NewLine}, StringSplitOptions.RemoveEmptyEntries); foreach(string senseLine in senseLines) dumpLog.WriteLine(senseLine); } #pragma warning disable IDE0004 // Remove Unnecessary Cast - currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (cmdDuration / (double)1000); + currentSpeed = (double)blockSize * blocksToRead / 1048576 / (cmdDuration / 1000); #pragma warning restore IDE0004 // Remove Unnecessary Cast blocksToRead = saveBlocksToRead; currentSector = i + 1; @@ -447,7 +452,7 @@ namespace DiscImageChef.Core.Devices.Dumping saveBlocksToRead = blocksToRead; if(aborted) { - currentTry.Extents = Metadata.ExtentsConverter.ToMetadata(extents); + currentTry.Extents = ExtentsConverter.ToMetadata(extents); dumpLog.WriteLine("Aborted!"); break; } @@ -472,7 +477,7 @@ namespace DiscImageChef.Core.Devices.Dumping { if(aborted) { - currentTry.Extents = Metadata.ExtentsConverter.ToMetadata(extents); + currentTry.Extents = ExtentsConverter.ToMetadata(extents); dumpLog.WriteLine("Aborted!"); break; } @@ -515,7 +520,7 @@ namespace DiscImageChef.Core.Devices.Dumping { if(aborted) { - currentTry.Extents = Metadata.ExtentsConverter.ToMetadata(extents); + currentTry.Extents = ExtentsConverter.ToMetadata(extents); dumpLog.WriteLine("Aborted!"); break; } @@ -553,20 +558,20 @@ namespace DiscImageChef.Core.Devices.Dumping //errored += blocksToRead; //resume.BadBlocks.Add(l1); DicConsole.DebugWriteLine("Dump-Media", "READ error:\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); if(cmdDuration < 500) mhddLog.Write(l1, 65535); else mhddLog.Write(l1, cmdDuration); ibgLog.Write(l1, 0); dumpLog.WriteLine("Error reading {0} blocks from block {1}.", blocksToRead, l1); - string[] senseLines = Decoders.SCSI.Sense.PrettifySense(senseBuf).Split(new[] {Environment.NewLine}, + string[] senseLines = Sense.PrettifySense(senseBuf).Split(new[] {Environment.NewLine}, StringSplitOptions .RemoveEmptyEntries); foreach(string senseLine in senseLines) dumpLog.WriteLine(senseLine); } #pragma warning disable IDE0004 // Remove Unnecessary Cast - currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (cmdDuration / (double)1000); + currentSpeed = (double)blockSize * blocksToRead / 1048576 / (cmdDuration / 1000); #pragma warning restore IDE0004 // Remove Unnecessary Cast currentSector += blocksToRead; resume.NextBlock = currentSector; @@ -593,7 +598,7 @@ namespace DiscImageChef.Core.Devices.Dumping mhddLog.Close(); #pragma warning disable IDE0004 // Remove Unnecessary Cast ibgLog.Close(dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024, - (double)blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), devicePath); + blockSize * (double)(blocks + 1) / 1024 / (totalDuration / 1000), devicePath); #pragma warning restore IDE0004 // Remove Unnecessary Cast dumpLog.WriteLine("Dump finished in {0} seconds.", (end - start).TotalSeconds); dumpLog.WriteLine("Average dump speed {0:F3} KiB/sec.", @@ -620,7 +625,7 @@ namespace DiscImageChef.Core.Devices.Dumping { if(aborted) { - currentTry.Extents = Metadata.ExtentsConverter.ToMetadata(extents); + currentTry.Extents = ExtentsConverter.ToMetadata(extents); dumpLog.WriteLine("Aborted!"); break; } @@ -654,8 +659,8 @@ namespace DiscImageChef.Core.Devices.Dumping goto repeatRetry; } - Decoders.SCSI.Modes.DecodedMode? currentMode = null; - Decoders.SCSI.Modes.ModePage? currentModePage = null; + Modes.DecodedMode? currentMode = null; + Modes.ModePage? currentModePage = null; byte[] md6 = null; byte[] md10 = null; @@ -667,40 +672,40 @@ namespace DiscImageChef.Core.Devices.Dumping { sense = dev.ModeSense10(out readBuffer, out senseBuf, false, ScsiModeSensePageControl.Current, 0x01, dev.Timeout, out duration); - if(!sense) currentMode = Decoders.SCSI.Modes.DecodeMode10(readBuffer, dev.ScsiType); + if(!sense) currentMode = Modes.DecodeMode10(readBuffer, dev.ScsiType); } - else currentMode = Decoders.SCSI.Modes.DecodeMode6(readBuffer, dev.ScsiType); + else currentMode = Modes.DecodeMode6(readBuffer, dev.ScsiType); if(currentMode.HasValue) currentModePage = currentMode.Value.Pages[0]; - if(dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice) + if(dev.ScsiType == PeripheralDeviceTypes.MultiMediaDevice) { - Decoders.SCSI.Modes.ModePage_01_MMC pgMmc = - new Decoders.SCSI.Modes.ModePage_01_MMC + Modes.ModePage_01_MMC pgMmc = + new Modes.ModePage_01_MMC { PS = false, ReadRetryCount = 255, Parameter = 0x20 }; - Decoders.SCSI.Modes.DecodedMode md = new Decoders.SCSI.Modes.DecodedMode + Modes.DecodedMode md = new Modes.DecodedMode { - Header = new Decoders.SCSI.Modes.ModeHeader(), - Pages = new Decoders.SCSI.Modes.ModePage[] + Header = new Modes.ModeHeader(), + Pages = new[] { - new Decoders.SCSI.Modes.ModePage + new Modes.ModePage { Page = 0x01, Subpage = 0x00, - PageResponse = Decoders.SCSI.Modes.EncodeModePage_01_MMC(pgMmc) + PageResponse = Modes.EncodeModePage_01_MMC(pgMmc) } } }; - md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.ScsiType); - md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.ScsiType); + md6 = Modes.EncodeMode6(md, dev.ScsiType); + md10 = Modes.EncodeMode10(md, dev.ScsiType); } else { - Decoders.SCSI.Modes.ModePage_01 pg = new Decoders.SCSI.Modes.ModePage_01 + Modes.ModePage_01 pg = new Modes.ModePage_01 { PS = false, AWRE = false, @@ -713,21 +718,21 @@ namespace DiscImageChef.Core.Devices.Dumping DCR = false, ReadRetryCount = 255 }; - Decoders.SCSI.Modes.DecodedMode md = new Decoders.SCSI.Modes.DecodedMode + Modes.DecodedMode md = new Modes.DecodedMode { - Header = new Decoders.SCSI.Modes.ModeHeader(), - Pages = new Decoders.SCSI.Modes.ModePage[] + Header = new Modes.ModeHeader(), + Pages = new[] { - new Decoders.SCSI.Modes.ModePage + new Modes.ModePage { Page = 0x01, Subpage = 0x00, - PageResponse = Decoders.SCSI.Modes.EncodeModePage_01(pg) + PageResponse = Modes.EncodeModePage_01(pg) } } }; - md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.ScsiType); - md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.ScsiType); + md6 = Modes.EncodeMode6(md, dev.ScsiType); + md10 = Modes.EncodeMode10(md, dev.ScsiType); } dumpLog.WriteLine("Sending MODE SELECT to drive."); @@ -743,13 +748,13 @@ namespace DiscImageChef.Core.Devices.Dumping } else if(runningPersistent && persistent && currentModePage.HasValue) { - Decoders.SCSI.Modes.DecodedMode md = new Decoders.SCSI.Modes.DecodedMode + Modes.DecodedMode md = new Modes.DecodedMode { - Header = new Decoders.SCSI.Modes.ModeHeader(), - Pages = new Decoders.SCSI.Modes.ModePage[] {currentModePage.Value} + Header = new Modes.ModeHeader(), + Pages = new[] {currentModePage.Value} }; - md6 = Decoders.SCSI.Modes.EncodeMode6(md, dev.ScsiType); - md10 = Decoders.SCSI.Modes.EncodeMode10(md, dev.ScsiType); + md6 = Modes.EncodeMode6(md, dev.ScsiType); + md10 = Modes.EncodeMode10(md, dev.ScsiType); dumpLog.WriteLine("Sending MODE SELECT to drive."); sense = dev.ModeSelect(md6, out senseBuf, true, false, dev.Timeout, out duration); @@ -761,7 +766,7 @@ namespace DiscImageChef.Core.Devices.Dumping #endregion Error handling resume.BadBlocks.Sort(); - currentTry.Extents = Metadata.ExtentsConverter.ToMetadata(extents); + currentTry.Extents = ExtentsConverter.ToMetadata(extents); dataChk = new Checksum(); dumpFile.Seek(0, SeekOrigin.Begin); @@ -792,7 +797,7 @@ namespace DiscImageChef.Core.Devices.Dumping totalChkDuration += chkDuration; #pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created - currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (chkDuration / (double)1000); + currentSpeed = (double)blockSize * blocksToRead / 1048576 / (chkDuration / 1000); #pragma warning restore IDE0004 // Cast is necessary, otherwise incorrect value is created } @@ -936,8 +941,8 @@ namespace DiscImageChef.Core.Devices.Dumping sidecar.OpticalDisc[0].Layers.Sectors[0] = new SectorsType {Value = (long)layerBreak}; sidecar.OpticalDisc[0].Sessions = 1; sidecar.OpticalDisc[0].Tracks = new[] {1}; - sidecar.OpticalDisc[0].Track = new Schemas.TrackType[1]; - sidecar.OpticalDisc[0].Track[0] = new Schemas.TrackType + sidecar.OpticalDisc[0].Track = new TrackType[1]; + sidecar.OpticalDisc[0].Track[0] = new TrackType { BytesPerSector = (int)blockSize, Checksums = sidecar.OpticalDisc[0].Checksums, @@ -956,7 +961,7 @@ namespace DiscImageChef.Core.Devices.Dumping }; if(xmlFileSysInfo != null) sidecar.OpticalDisc[0].Track[0].FileSystemInformation = xmlFileSysInfo; sidecar.OpticalDisc[0].Track[0].TrackType1 = TrackTypeTrackType.dvd; - sidecar.OpticalDisc[0].Dimensions = Metadata.Dimensions.DimensionsFromMediaType(dskType); + sidecar.OpticalDisc[0].Dimensions = Dimensions.DimensionsFromMediaType(dskType); Metadata.MediaType.MediaTypeToString(dskType, out string xmlDskTyp, out string xmlDskSubTyp); sidecar.OpticalDisc[0].DiscType = xmlDskTyp; sidecar.OpticalDisc[0].DiscSubType = xmlDskSubTyp; @@ -967,8 +972,8 @@ namespace DiscImageChef.Core.Devices.Dumping FileStream xmlFs = new FileStream(outputPrefix + ".cicm.xml", FileMode.Create); - System.Xml.Serialization.XmlSerializer xmlSer = - new System.Xml.Serialization.XmlSerializer(typeof(CICMMetadataType)); + XmlSerializer xmlSer = + new XmlSerializer(typeof(CICMMetadataType)); xmlSer.Serialize(xmlFs, sidecar); xmlFs.Close(); } diff --git a/DiscImageChef.Core/Devices/ReaderATA.cs b/DiscImageChef.Core/Devices/ReaderATA.cs index 2a8e73506..c538d82f0 100644 --- a/DiscImageChef.Core/Devices/ReaderATA.cs +++ b/DiscImageChef.Core/Devices/ReaderATA.cs @@ -192,7 +192,7 @@ namespace DiscImageChef.Core.Devices if((ataId.PhysLogSectorSize & 0x2000) == 0x2000) { #pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created - PhysicalBlockSize = LogicalBlockSize * (uint)Math.Pow(2, (double)(ataId.PhysLogSectorSize & 0xF)); + PhysicalBlockSize = LogicalBlockSize * (uint)Math.Pow(2, ataId.PhysLogSectorSize & 0xF); #pragma warning restore IDE0004 // Cast is necessary, otherwise incorrect value is created } else PhysicalBlockSize = LogicalBlockSize; diff --git a/DiscImageChef.Core/Devices/ReaderSCSI.cs b/DiscImageChef.Core/Devices/ReaderSCSI.cs index becfd4326..593f33e5b 100644 --- a/DiscImageChef.Core/Devices/ReaderSCSI.cs +++ b/DiscImageChef.Core/Devices/ReaderSCSI.cs @@ -32,6 +32,7 @@ using System; using DiscImageChef.Console; +using DiscImageChef.Decoders.SCSI; namespace DiscImageChef.Core.Devices { @@ -93,13 +94,13 @@ namespace DiscImageChef.Core.Devices } #pragma warning disable IDE0004 // Remove Unnecessary Cast - if(!read16 && Blocks > (long)0xFFFFFFFF + (long)1) + if(!read16 && Blocks > 0xFFFFFFFF + (long)1) #pragma warning restore IDE0004 // Remove Unnecessary Cast { #pragma warning disable IDE0004 // Remove Unnecessary Cast ErrorMessage = string.Format("Device only supports SCSI READ (10) but has more than {0} blocks ({1} blocks total)", - (long)0xFFFFFFFF + (long)1, Blocks); + 0xFFFFFFFF + (long)1, Blocks); #pragma warning restore IDE0004 // Remove Unnecessary Cast return true; } @@ -107,10 +108,10 @@ namespace DiscImageChef.Core.Devices if(CanReadRaw) { bool testSense; - Decoders.SCSI.FixedSense? decSense; + FixedSense? decSense; CanReadRaw = false; - if(dev.ScsiType != Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice) + if(dev.ScsiType != PeripheralDeviceTypes.MultiMediaDevice) { /*testSense = dev.ReadLong16(out readBuffer, out senseBuf, false, 0, 0xFFFF, timeout, out duration); if (testSense && !dev.Error) @@ -135,9 +136,9 @@ namespace DiscImageChef.Core.Devices out duration); if(testSense && !dev.Error) { - decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf); + decSense = Sense.DecodeFixed(senseBuf); if(decSense.HasValue) - if(decSense.Value.SenseKey == Decoders.SCSI.SenseKeys.IllegalRequest && + if(decSense.Value.SenseKey == SenseKeys.IllegalRequest && decSense.Value.ASC == 0x24 && decSense.Value.ASCQ == 0x00) { CanReadRaw = true; @@ -282,9 +283,9 @@ namespace DiscImageChef.Core.Devices out duration); if(testSense) { - decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf); + decSense = Sense.DecodeFixed(senseBuf); if(decSense.HasValue) - if(decSense.Value.SenseKey == Decoders.SCSI.SenseKeys.IllegalRequest && + if(decSense.Value.SenseKey == SenseKeys.IllegalRequest && decSense.Value.ASC == 0x24 && decSense.Value.ASCQ == 0x00) { CanReadRaw = true; @@ -302,9 +303,9 @@ namespace DiscImageChef.Core.Devices out duration); if(testSense) { - decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf); + decSense = Sense.DecodeFixed(senseBuf); if(decSense.HasValue) - if(decSense.Value.SenseKey == Decoders.SCSI.SenseKeys.IllegalRequest && + if(decSense.Value.SenseKey == SenseKeys.IllegalRequest && decSense.Value.ASC == 0x24 && decSense.Value.ASCQ == 0x00) { CanReadRaw = true; @@ -404,10 +405,10 @@ namespace DiscImageChef.Core.Devices sense = dev.ReadCapacity16(out cmdBuf, out senseBuf, timeout, out duration); if(sense && Blocks == 0) - if(dev.ScsiType != Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice) + if(dev.ScsiType != PeripheralDeviceTypes.MultiMediaDevice) { ErrorMessage = string.Format("Unable to get media capacity\n" + "{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); return true; } @@ -520,7 +521,7 @@ namespace DiscImageChef.Core.Devices if(!sense && !dev.Error) return false; DicConsole.DebugWriteLine("SCSI Reader", "READ error:\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); return true; } diff --git a/DiscImageChef.Core/Devices/Report/ATA.cs b/DiscImageChef.Core/Devices/Report/ATA.cs index 3aad86474..8b9be31d8 100644 --- a/DiscImageChef.Core/Devices/Report/ATA.cs +++ b/DiscImageChef.Core/Devices/Report/ATA.cs @@ -33,6 +33,7 @@ using System; using System.Collections.Generic; using DiscImageChef.Console; +using DiscImageChef.Decoders.ATA; using DiscImageChef.Devices; using DiscImageChef.Metadata; @@ -44,7 +45,7 @@ namespace DiscImageChef.Core.Devices.Report { if(report == null) return; - Decoders.ATA.AtaErrorRegistersCHS errorRegs; + AtaErrorRegistersCHS errorRegs; byte[] buffer; double duration; uint timeout = 5; @@ -60,9 +61,9 @@ namespace DiscImageChef.Core.Devices.Report dev.AtaIdentify(out buffer, out errorRegs, timeout, out duration); - if(!Decoders.ATA.Identify.Decode(buffer).HasValue) return; + if(!Identify.Decode(buffer).HasValue) return; - Decoders.ATA.Identify.IdentifyDevice ataId = Decoders.ATA.Identify.Decode(buffer).Value; + Identify.IdentifyDevice ataId = Identify.Decode(buffer).Value; if((ushort)ataId.GeneralConfiguration == 0x848A) { @@ -71,7 +72,7 @@ namespace DiscImageChef.Core.Devices.Report removable = false; } else if(!removable && - ataId.GeneralConfiguration.HasFlag(Decoders.ATA.Identify.GeneralConfigurationBit.Removable)) + ataId.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.Removable)) { pressedKey = new ConsoleKeyInfo(); while(pressedKey.Key != ConsoleKey.Y && pressedKey.Key != ConsoleKey.N) @@ -90,7 +91,7 @@ namespace DiscImageChef.Core.Devices.Report System.Console.ReadKey(true); DicConsole.WriteLine("Querying ATA IDENTIFY..."); dev.AtaIdentify(out buffer, out errorRegs, timeout, out duration); - ataId = Decoders.ATA.Identify.Decode(buffer).Value; + ataId = Identify.Decode(buffer).Value; } report.ATA = new ataType(); @@ -520,9 +521,9 @@ namespace DiscImageChef.Core.Devices.Report DicConsole.WriteLine("Querying ATA IDENTIFY..."); dev.AtaIdentify(out buffer, out errorRegs, timeout, out duration); - if(Decoders.ATA.Identify.Decode(buffer).HasValue) + if(Identify.Decode(buffer).HasValue) { - ataId = Decoders.ATA.Identify.Decode(buffer).Value; + ataId = Identify.Decode(buffer).Value; if(ataId.UnformattedBPT != 0) { @@ -559,7 +560,7 @@ namespace DiscImageChef.Core.Devices.Report mediaTest.BlocksSpecified = true; } - if(ataId.Capabilities.HasFlag(Decoders.ATA.Identify.CapabilitiesBit.LBASupport)) + if(ataId.Capabilities.HasFlag(Identify.CapabilitiesBit.LBASupport)) { mediaTest.LBASectors = ataId.LBASectors; mediaTest.LBASectorsSpecified = true; @@ -567,7 +568,7 @@ namespace DiscImageChef.Core.Devices.Report mediaTest.BlocksSpecified = true; } - if(ataId.CommandSet2.HasFlag(Decoders.ATA.Identify.CommandSetBit2.LBA48)) + if(ataId.CommandSet2.HasFlag(Identify.CommandSetBit2.LBA48)) { mediaTest.LBA48Sectors = ataId.LBA48Sectors; mediaTest.LBA48SectorsSpecified = true; @@ -643,9 +644,9 @@ namespace DiscImageChef.Core.Devices.Report mediaTest.LongBlockSizeSpecified = true; } - if(ataId.CommandSet3.HasFlag(Decoders.ATA.Identify.CommandSetBit3.MustBeSet) && - !ataId.CommandSet3.HasFlag(Decoders.ATA.Identify.CommandSetBit3.MustBeClear) && - ataId.EnabledCommandSet3.HasFlag(Decoders.ATA.Identify.CommandSetBit3.MediaSerial)) + if(ataId.CommandSet3.HasFlag(Identify.CommandSetBit3.MustBeSet) && + !ataId.CommandSet3.HasFlag(Identify.CommandSetBit3.MustBeClear) && + ataId.EnabledCommandSet3.HasFlag(Identify.CommandSetBit3.MediaSerial)) { mediaTest.CanReadMediaSerial = true; mediaTest.CanReadMediaSerialSpecified = true; @@ -675,9 +676,9 @@ namespace DiscImageChef.Core.Devices.Report mediaTest.SupportsReadLongRetrySpecified = true; mediaTest.SupportsSeekSpecified = true; - Decoders.ATA.AtaErrorRegistersCHS errorChs; - Decoders.ATA.AtaErrorRegistersLBA28 errorLba; - Decoders.ATA.AtaErrorRegistersLBA48 errorLba48; + AtaErrorRegistersCHS errorChs; + AtaErrorRegistersLBA28 errorLba; + AtaErrorRegistersLBA48 errorLba48; byte[] readBuf; ulong checkCorrectRead = BitConverter.ToUInt64(buffer, 0); @@ -930,7 +931,7 @@ namespace DiscImageChef.Core.Devices.Report report.ATA.ReadCapabilities.BlocksSpecified = true; } - if(ataId.Capabilities.HasFlag(Decoders.ATA.Identify.CapabilitiesBit.LBASupport)) + if(ataId.Capabilities.HasFlag(Identify.CapabilitiesBit.LBASupport)) { report.ATA.ReadCapabilities.LBASectors = ataId.LBASectors; report.ATA.ReadCapabilities.LBASectorsSpecified = true; @@ -938,7 +939,7 @@ namespace DiscImageChef.Core.Devices.Report report.ATA.ReadCapabilities.BlocksSpecified = true; } - if(ataId.CommandSet2.HasFlag(Decoders.ATA.Identify.CommandSetBit2.LBA48)) + if(ataId.CommandSet2.HasFlag(Identify.CommandSetBit2.LBA48)) { report.ATA.ReadCapabilities.LBA48Sectors = ataId.LBA48Sectors; report.ATA.ReadCapabilities.LBA48SectorsSpecified = true; @@ -974,7 +975,7 @@ namespace DiscImageChef.Core.Devices.Report { #pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created physicalsectorsize = logicalsectorsize * - (uint)Math.Pow(2, (double)(ataId.PhysLogSectorSize & 0xF)); + (uint)Math.Pow(2, ataId.PhysLogSectorSize & 0xF); #pragma warning restore IDE0004 // Cast is necessary, otherwise incorrect value is created } else physicalsectorsize = logicalsectorsize; @@ -1013,9 +1014,9 @@ namespace DiscImageChef.Core.Devices.Report report.ATA.ReadCapabilities.LongBlockSizeSpecified = true; } - if(ataId.CommandSet3.HasFlag(Decoders.ATA.Identify.CommandSetBit3.MustBeSet) && - !ataId.CommandSet3.HasFlag(Decoders.ATA.Identify.CommandSetBit3.MustBeClear) && - ataId.EnabledCommandSet3.HasFlag(Decoders.ATA.Identify.CommandSetBit3.MediaSerial)) + if(ataId.CommandSet3.HasFlag(Identify.CommandSetBit3.MustBeSet) && + !ataId.CommandSet3.HasFlag(Identify.CommandSetBit3.MustBeClear) && + ataId.EnabledCommandSet3.HasFlag(Identify.CommandSetBit3.MediaSerial)) { report.ATA.ReadCapabilities.CanReadMediaSerial = true; report.ATA.ReadCapabilities.CanReadMediaSerialSpecified = true; @@ -1045,9 +1046,9 @@ namespace DiscImageChef.Core.Devices.Report report.ATA.ReadCapabilities.SupportsReadLongRetrySpecified = true; report.ATA.ReadCapabilities.SupportsSeekSpecified = true; - Decoders.ATA.AtaErrorRegistersCHS errorChs; - Decoders.ATA.AtaErrorRegistersLBA28 errorLba; - Decoders.ATA.AtaErrorRegistersLBA48 errorLba48; + AtaErrorRegistersCHS errorChs; + AtaErrorRegistersLBA28 errorLba; + AtaErrorRegistersLBA48 errorLba48; byte[] readBuf; ulong checkCorrectRead = BitConverter.ToUInt64(buffer, 0); diff --git a/DiscImageChef.Core/Devices/Report/ATAPI.cs b/DiscImageChef.Core/Devices/Report/ATAPI.cs index 8f1df5828..af5bf4ade 100644 --- a/DiscImageChef.Core/Devices/Report/ATAPI.cs +++ b/DiscImageChef.Core/Devices/Report/ATAPI.cs @@ -31,6 +31,7 @@ // ****************************************************************************/ using DiscImageChef.Console; +using DiscImageChef.Decoders.ATA; using DiscImageChef.Devices; using DiscImageChef.Metadata; @@ -48,12 +49,12 @@ namespace DiscImageChef.Core.Devices.Report DicConsole.WriteLine("Querying ATAPI IDENTIFY..."); - Decoders.ATA.AtaErrorRegistersCHS errorRegs; + AtaErrorRegistersCHS errorRegs; dev.AtapiIdentify(out buffer, out errorRegs, timeout, out duration); - if(!Decoders.ATA.Identify.Decode(buffer).HasValue) return; + if(!Identify.Decode(buffer).HasValue) return; - Decoders.ATA.Identify.IdentifyDevice atapiId = Decoders.ATA.Identify.Decode(buffer).Value; + Identify.IdentifyDevice atapiId = Identify.Decode(buffer).Value; report.ATAPI = new ataType(); diff --git a/DiscImageChef.Core/Devices/Report/SCSI/General.cs b/DiscImageChef.Core/Devices/Report/SCSI/General.cs index 30e5db9dc..84bbf593a 100644 --- a/DiscImageChef.Core/Devices/Report/SCSI/General.cs +++ b/DiscImageChef.Core/Devices/Report/SCSI/General.cs @@ -34,7 +34,9 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; +using System.Threading; using DiscImageChef.Console; +using DiscImageChef.Decoders.SCSI; using DiscImageChef.Devices; using DiscImageChef.Metadata; @@ -79,9 +81,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI report.SCSI = new scsiType(); - if(!sense && Decoders.SCSI.Inquiry.Decode(buffer).HasValue) + if(!sense && Inquiry.Decode(buffer).HasValue) { - Decoders.SCSI.Inquiry.SCSIInquiry inq = Decoders.SCSI.Inquiry.Decode(buffer).Value; + Inquiry.SCSIInquiry inq = Inquiry.Decode(buffer).Value; List versionDescriptors = new List(); report.SCSI.Inquiry = new scsiInquiryType(); @@ -140,11 +142,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI report.SCSI.Inquiry.VersionDescriptors = versionDescriptors.ToArray(); } - report.SCSI.Inquiry.PeripheralQualifier = (Decoders.SCSI.PeripheralQualifiers)inq.PeripheralQualifier; + report.SCSI.Inquiry.PeripheralQualifier = (PeripheralQualifiers)inq.PeripheralQualifier; report.SCSI.Inquiry.PeripheralDeviceType = - (Decoders.SCSI.PeripheralDeviceTypes)inq.PeripheralDeviceType; - report.SCSI.Inquiry.AsymmetricalLUNAccess = (Decoders.SCSI.TGPSValues)inq.TPGS; - report.SCSI.Inquiry.SPIClocking = (Decoders.SCSI.SPIClocking)inq.Clocking; + (PeripheralDeviceTypes)inq.PeripheralDeviceType; + report.SCSI.Inquiry.AsymmetricalLUNAccess = (TGPSValues)inq.TPGS; + report.SCSI.Inquiry.SPIClocking = (SPIClocking)inq.Clocking; report.SCSI.Inquiry.AccessControlCoordinator = inq.ACC; report.SCSI.Inquiry.ACKRequests = inq.ACKREQQ; @@ -181,7 +183,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI if(!sense) { - byte[] evpdPages = Decoders.SCSI.EVPD.DecodePage00(buffer); + byte[] evpdPages = EVPD.DecodePage00(buffer); if(evpdPages != null && evpdPages.Length > 0) { List evpds = new List(); @@ -203,11 +205,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI if(removable) { switch(dev.ScsiType) { - case Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice: + case PeripheralDeviceTypes.MultiMediaDevice: dev.AllowMediumRemoval(out senseBuffer, timeout, out duration); dev.EjectTray(out senseBuffer, timeout, out duration); break; - case Decoders.SCSI.PeripheralDeviceTypes.SequentialAccess: + case PeripheralDeviceTypes.SequentialAccess: dev.SpcAllowMediumRemoval(out senseBuffer, timeout, out duration); DicConsole.WriteLine("Asking drive to unload tape (can take a few minutes)..."); dev.Unload(out senseBuffer, timeout, out duration); @@ -217,8 +219,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI System.Console.ReadKey(true); } - Decoders.SCSI.Modes.DecodedMode? decMode = null; - Decoders.SCSI.PeripheralDeviceTypes devType = dev.ScsiType; + Modes.DecodedMode? decMode = null; + PeripheralDeviceTypes devType = dev.ScsiType; DicConsole.WriteLine("Querying all mode pages and subpages using SCSI MODE SENSE (10)..."); sense = dev.ModeSense10(out byte[] mode10Buffer, out senseBuffer, false, true, @@ -232,14 +234,14 @@ namespace DiscImageChef.Core.Devices.Report.SCSI { report.SCSI.SupportsModeSense10 = true; report.SCSI.SupportsModeSubpages = false; - decMode = Decoders.SCSI.Modes.DecodeMode10(mode10Buffer, devType); + decMode = Modes.DecodeMode10(mode10Buffer, devType); } } else { report.SCSI.SupportsModeSense10 = true; report.SCSI.SupportsModeSubpages = true; - decMode = Decoders.SCSI.Modes.DecodeMode10(mode10Buffer, devType); + decMode = Modes.DecodeMode10(mode10Buffer, devType); } DicConsole.WriteLine("Querying all mode pages and subpages using SCSI MODE SENSE (6)..."); @@ -259,11 +261,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI else report.SCSI.SupportsModeSubpages = true; if(!sense && !dev.Error && !decMode.HasValue) - decMode = Decoders.SCSI.Modes.DecodeMode6(mode6Buffer, devType); + decMode = Modes.DecodeMode6(mode6Buffer, devType); report.SCSI.SupportsModeSense6 |= !sense && !dev.Error; - Decoders.SCSI.Modes.ModePage_2A? cdromMode = null; + Modes.ModePage_2A? cdromMode = null; if(debug && report.SCSI.SupportsModeSense6) report.SCSI.ModeSense6Data = mode6Buffer; if(debug && report.SCSI.SupportsModeSense10) report.SCSI.ModeSense10Data = mode10Buffer; @@ -290,7 +292,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI if(decMode.Value.Pages != null) { List modePages = new List(); - foreach(Decoders.SCSI.Modes.ModePage page in decMode.Value.Pages) + foreach(Modes.ModePage page in decMode.Value.Pages) { modePageType modePage = new modePageType(); modePage.page = page.Page; @@ -298,7 +300,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI modePage.value = page.PageResponse; modePages.Add(modePage); - if(modePage.page == 0x2A && modePage.subpage == 0x00) cdromMode = Decoders.SCSI.Modes.DecodeModePage_2A(page.PageResponse); + if(modePage.page == 0x2A && modePage.subpage == 0x00) cdromMode = Modes.DecodeModePage_2A(page.PageResponse); } if(modePages.Count > 0) report.SCSI.ModeSense.ModePages = modePages.ToArray(); @@ -308,9 +310,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI List mediaTypes = new List(); switch(dev.ScsiType) { - case Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice: Mmc.Report(dev, ref report, debug, ref cdromMode, ref mediaTypes); + case PeripheralDeviceTypes.MultiMediaDevice: Mmc.Report(dev, ref report, debug, ref cdromMode, ref mediaTypes); break; - case Decoders.SCSI.PeripheralDeviceTypes.SequentialAccess: Ssc.Report(dev, ref report, debug); + case PeripheralDeviceTypes.SequentialAccess: Ssc.Report(dev, ref report, debug); break; default: if(removable) @@ -348,7 +350,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI sense = dev.ScsiTestUnitReady(out senseBuffer, timeout, out duration); if(sense) { - Decoders.SCSI.FixedSense? decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuffer); + FixedSense? decSense = Sense.DecodeFixed(senseBuffer); if(decSense.HasValue) if(decSense.Value.ASC == 0x3A) { @@ -356,7 +358,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI while(leftRetries > 0) { DicConsole.Write("\rWaiting for drive to become ready"); - System.Threading.Thread.Sleep(2000); + Thread.Sleep(2000); sense = dev.ScsiTestUnitReady(out senseBuffer, timeout, out duration); if(!sense) break; @@ -371,7 +373,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI while(leftRetries > 0) { DicConsole.Write("\rWaiting for drive to become ready"); - System.Threading.Thread.Sleep(2000); + Thread.Sleep(2000); sense = dev.ScsiTestUnitReady(out senseBuffer, timeout, out duration); if(!sense) break; @@ -428,7 +430,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI if(!sense && !dev.Error) { report.SCSI.SupportsModeSense10 = true; - decMode = Decoders.SCSI.Modes.DecodeMode10(buffer, dev.ScsiType); + decMode = Modes.DecodeMode10(buffer, dev.ScsiType); if(debug) mediaTest.ModeSense10Data = buffer; } @@ -438,7 +440,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI { report.SCSI.SupportsModeSense6 = true; if(!decMode.HasValue) - decMode = Decoders.SCSI.Modes.DecodeMode6(buffer, dev.ScsiType); + decMode = Modes.DecodeMode6(buffer, dev.ScsiType); if(debug) mediaTest.ModeSense6Data = buffer; } @@ -505,9 +507,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI out duration); if(sense && !dev.Error) { - Decoders.SCSI.FixedSense? decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuffer); + FixedSense? decSense = Sense.DecodeFixed(senseBuffer); if(decSense.HasValue) - if(decSense.Value.SenseKey == Decoders.SCSI.SenseKeys.IllegalRequest && + if(decSense.Value.SenseKey == SenseKeys.IllegalRequest && decSense.Value.ASC == 0x24 && decSense.Value.ASCQ == 0x00) { mediaTest.SupportsReadLong = true; @@ -692,7 +694,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI if(!sense && !dev.Error) { report.SCSI.SupportsModeSense10 = true; - decMode = Decoders.SCSI.Modes.DecodeMode10(buffer, dev.ScsiType); + decMode = Modes.DecodeMode10(buffer, dev.ScsiType); if(debug) report.SCSI.ReadCapabilities.ModeSense10Data = buffer; } @@ -701,7 +703,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI if(!sense && !dev.Error) { report.SCSI.SupportsModeSense6 = true; - if(!decMode.HasValue) decMode = Decoders.SCSI.Modes.DecodeMode6(buffer, dev.ScsiType); + if(!decMode.HasValue) decMode = Modes.DecodeMode6(buffer, dev.ScsiType); if(debug) report.SCSI.ReadCapabilities.ModeSense6Data = buffer; } @@ -772,9 +774,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 0xFFFF, timeout, out duration); if(sense && !dev.Error) { - Decoders.SCSI.FixedSense? decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuffer); + FixedSense? decSense = Sense.DecodeFixed(senseBuffer); if(decSense.HasValue) - if(decSense.Value.SenseKey == Decoders.SCSI.SenseKeys.IllegalRequest && + if(decSense.Value.SenseKey == SenseKeys.IllegalRequest && decSense.Value.ASC == 0x24 && decSense.Value.ASCQ == 0x00) { report.SCSI.ReadCapabilities.SupportsReadLong = true; diff --git a/DiscImageChef.Core/Devices/Report/SCSI/MMC.cs b/DiscImageChef.Core/Devices/Report/SCSI/MMC.cs index 31e5f4cf2..07a196470 100644 --- a/DiscImageChef.Core/Devices/Report/SCSI/MMC.cs +++ b/DiscImageChef.Core/Devices/Report/SCSI/MMC.cs @@ -33,7 +33,11 @@ using System; using System.Collections.Generic; using System.IO; +using System.Text; +using System.Threading; using DiscImageChef.Console; +using DiscImageChef.Decoders.SCSI; +using DiscImageChef.Decoders.SCSI.MMC; using DiscImageChef.Devices; using DiscImageChef.Metadata; @@ -42,7 +46,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI static class Mmc { internal static void Report(Device dev, ref DeviceReport report, bool debug, - ref Decoders.SCSI.Modes.ModePage_2A? cdromMode, ref List mediaTypes) + ref Modes.ModePage_2A? cdromMode, ref List mediaTypes) { if(report == null) return; @@ -52,7 +56,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI bool sense; uint timeout = 5; ConsoleKeyInfo pressedKey; - Decoders.SCSI.Modes.DecodedMode? decMode = null; + Modes.DecodedMode? decMode = null; report.SCSI.MultiMediaDevice = new mmcType(); @@ -163,17 +167,17 @@ namespace DiscImageChef.Core.Devices.Report.SCSI if(!sense) { - Decoders.SCSI.MMC.Features.SeparatedFeatures ftr = Decoders.SCSI.MMC.Features.Separate(buffer); + Features.SeparatedFeatures ftr = Features.Separate(buffer); if(ftr.Descriptors != null && ftr.Descriptors.Length > 0) { report.SCSI.MultiMediaDevice.Features = new mmcFeaturesType(); - foreach(Decoders.SCSI.MMC.Features.FeatureDescriptor desc in ftr.Descriptors) + foreach(Features.FeatureDescriptor desc in ftr.Descriptors) switch(desc.Code) { case 0x0001: { - Decoders.SCSI.MMC.Feature_0001? ftr0001 = - Decoders.SCSI.MMC.Features.Decode_0001(desc.Data); + Feature_0001? ftr0001 = + Features.Decode_0001(desc.Data); if(ftr0001.HasValue) { report.SCSI.MultiMediaDevice.Features.PhysicalInterfaceStandard = @@ -186,7 +190,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI report.SCSI.MultiMediaDevice.Features.PhysicalInterfaceStandardNumberSpecified = true; report.SCSI.MultiMediaDevice.Features.PhysicalInterfaceStandard = - Decoders.SCSI.MMC.PhysicalInterfaces.Unspecified; + PhysicalInterfaces.Unspecified; } report.SCSI.MultiMediaDevice.Features.SupportsDeviceBusyEvent = ftr0001.Value.DBE; } @@ -194,8 +198,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI break; case 0x0003: { - Decoders.SCSI.MMC.Feature_0003? ftr0003 = - Decoders.SCSI.MMC.Features.Decode_0003(desc.Data); + Feature_0003? ftr0003 = + Features.Decode_0003(desc.Data); if(ftr0003.HasValue) { report.SCSI.MultiMediaDevice.Features.LoadingMechanismType = @@ -211,8 +215,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI break; case 0x0004: { - Decoders.SCSI.MMC.Feature_0004? ftr0004 = - Decoders.SCSI.MMC.Features.Decode_0004(desc.Data); + Feature_0004? ftr0004 = + Features.Decode_0004(desc.Data); if(ftr0004.HasValue) { report.SCSI.MultiMediaDevice.Features.SupportsWriteProtectPAC = ftr0004.Value.DWP; @@ -224,8 +228,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI break; case 0x0010: { - Decoders.SCSI.MMC.Feature_0010? ftr0010 = - Decoders.SCSI.MMC.Features.Decode_0010(desc.Data); + Feature_0010? ftr0010 = + Features.Decode_0010(desc.Data); if(ftr0010.HasValue) { if(ftr0010.Value.LogicalBlockSize > 0) @@ -250,8 +254,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI case 0x001E: { report.SCSI.MultiMediaDevice.Features.CanReadCD = true; - Decoders.SCSI.MMC.Feature_001E? ftr001E = - Decoders.SCSI.MMC.Features.Decode_001E(desc.Data); + Feature_001E? ftr001E = + Features.Decode_001E(desc.Data); if(ftr001E.HasValue) { report.SCSI.MultiMediaDevice.Features.SupportsDAP = ftr001E.Value.DAP; @@ -263,8 +267,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI case 0x001F: { report.SCSI.MultiMediaDevice.Features.CanReadDVD = true; - Decoders.SCSI.MMC.Feature_001F? ftr001F = - Decoders.SCSI.MMC.Features.Decode_001F(desc.Data); + Feature_001F? ftr001F = + Features.Decode_001F(desc.Data); if(ftr001F.HasValue) { report.SCSI.MultiMediaDevice.Features.DVDMultiRead = ftr001F.Value.MULTI110; @@ -279,8 +283,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI case 0x0023: { report.SCSI.MultiMediaDevice.Features.CanFormat = true; - Decoders.SCSI.MMC.Feature_0023? ftr0023 = - Decoders.SCSI.MMC.Features.Decode_0023(desc.Data); + Feature_0023? ftr0023 = + Features.Decode_0023(desc.Data); if(ftr0023.HasValue) { report.SCSI.MultiMediaDevice.Features.CanFormatBDREWithoutSpare = @@ -302,8 +306,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI case 0x0028: { report.SCSI.MultiMediaDevice.Features.CanReadCDMRW = true; - Decoders.SCSI.MMC.Feature_0028? ftr0028 = - Decoders.SCSI.MMC.Features.Decode_0028(desc.Data); + Feature_0028? ftr0028 = + Features.Decode_0028(desc.Data); if(ftr0028.HasValue) { report.SCSI.MultiMediaDevice.Features.CanReadDVDPlusMRW = ftr0028.Value.DVDPRead; @@ -315,24 +319,24 @@ namespace DiscImageChef.Core.Devices.Report.SCSI case 0x002A: { report.SCSI.MultiMediaDevice.Features.CanReadDVDPlusRW = true; - Decoders.SCSI.MMC.Feature_002A? ftr002A = - Decoders.SCSI.MMC.Features.Decode_002A(desc.Data); + Feature_002A? ftr002A = + Features.Decode_002A(desc.Data); if(ftr002A.HasValue) report.SCSI.MultiMediaDevice.Features.CanWriteDVDPlusRW = ftr002A.Value.Write; } break; case 0x002B: { report.SCSI.MultiMediaDevice.Features.CanReadDVDPlusR = true; - Decoders.SCSI.MMC.Feature_002B? ftr002B = - Decoders.SCSI.MMC.Features.Decode_002B(desc.Data); + Feature_002B? ftr002B = + Features.Decode_002B(desc.Data); if(ftr002B.HasValue) report.SCSI.MultiMediaDevice.Features.CanWriteDVDPlusR = ftr002B.Value.Write; } break; case 0x002D: { report.SCSI.MultiMediaDevice.Features.CanWriteCDTAO = true; - Decoders.SCSI.MMC.Feature_002D? ftr002D = - Decoders.SCSI.MMC.Features.Decode_002D(desc.Data); + Feature_002D? ftr002D = + Features.Decode_002D(desc.Data); if(ftr002D.HasValue) { report.SCSI.MultiMediaDevice.Features.BufferUnderrunFreeInTAO = ftr002D.Value.BUF; @@ -350,8 +354,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI case 0x002E: { report.SCSI.MultiMediaDevice.Features.CanWriteCDSAO = true; - Decoders.SCSI.MMC.Feature_002E? ftr002E = - Decoders.SCSI.MMC.Features.Decode_002E(desc.Data); + Feature_002E? ftr002E = + Features.Decode_002E(desc.Data); if(ftr002E.HasValue) { report.SCSI.MultiMediaDevice.Features.BufferUnderrunFreeInSAO = ftr002E.Value.BUF; @@ -366,8 +370,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI case 0x002F: { report.SCSI.MultiMediaDevice.Features.CanWriteDVDR = true; - Decoders.SCSI.MMC.Feature_002F? ftr002F = - Decoders.SCSI.MMC.Features.Decode_002F(desc.Data); + Feature_002F? ftr002F = + Features.Decode_002F(desc.Data); if(ftr002F.HasValue) { report.SCSI.MultiMediaDevice.Features.BufferUnderrunFreeInDVD = ftr002F.Value.BUF; @@ -383,8 +387,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI case 0x0031: { report.SCSI.MultiMediaDevice.Features.CanWriteDDCDR = true; - Decoders.SCSI.MMC.Feature_0031? ftr0031 = - Decoders.SCSI.MMC.Features.Decode_0031(desc.Data); + Feature_0031? ftr0031 = + Features.Decode_0031(desc.Data); if(ftr0031.HasValue) report.SCSI.MultiMediaDevice.Features.CanTestWriteDDCDR = ftr0031.Value.TestWrite; } @@ -401,8 +405,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI case 0x003A: { report.SCSI.MultiMediaDevice.Features.CanReadDVDPlusRWDL = true; - Decoders.SCSI.MMC.Feature_003A? ftr003A = - Decoders.SCSI.MMC.Features.Decode_003A(desc.Data); + Feature_003A? ftr003A = + Features.Decode_003A(desc.Data); if(ftr003A.HasValue) report.SCSI.MultiMediaDevice.Features.CanWriteDVDPlusRWDL = ftr003A.Value.Write; } @@ -410,8 +414,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI case 0x003B: { report.SCSI.MultiMediaDevice.Features.CanReadDVDPlusRDL = true; - Decoders.SCSI.MMC.Feature_003B? ftr003B = - Decoders.SCSI.MMC.Features.Decode_003B(desc.Data); + Feature_003B? ftr003B = + Features.Decode_003B(desc.Data); if(ftr003B.HasValue) report.SCSI.MultiMediaDevice.Features.CanWriteDVDPlusRDL = ftr003B.Value.Write; } @@ -419,8 +423,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI case 0x0040: { report.SCSI.MultiMediaDevice.Features.CanReadBD = true; - Decoders.SCSI.MMC.Feature_0040? ftr0040 = - Decoders.SCSI.MMC.Features.Decode_0040(desc.Data); + Feature_0040? ftr0040 = + Features.Decode_0040(desc.Data); if(ftr0040.HasValue) { report.SCSI.MultiMediaDevice.Features.CanReadBluBCA = ftr0040.Value.BCA; @@ -437,8 +441,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI case 0x0041: { report.SCSI.MultiMediaDevice.Features.CanWriteBD = true; - Decoders.SCSI.MMC.Feature_0041? ftr0041 = - Decoders.SCSI.MMC.Features.Decode_0041(desc.Data); + Feature_0041? ftr0041 = + Features.Decode_0041(desc.Data); if(ftr0041.HasValue) { report.SCSI.MultiMediaDevice.Features.CanWriteBDRE2 = ftr0041.Value.RE2; @@ -452,8 +456,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI case 0x0050: { report.SCSI.MultiMediaDevice.Features.CanReadHDDVD = true; - Decoders.SCSI.MMC.Feature_0050? ftr0050 = - Decoders.SCSI.MMC.Features.Decode_0050(desc.Data); + Feature_0050? ftr0050 = + Features.Decode_0050(desc.Data); if(ftr0050.HasValue) { report.SCSI.MultiMediaDevice.Features.CanReadHDDVDR = ftr0050.Value.HDDVDR; @@ -464,8 +468,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI case 0x0051: { // TODO: Write HD DVD-RW - Decoders.SCSI.MMC.Feature_0051? ftr0051 = - Decoders.SCSI.MMC.Features.Decode_0051(desc.Data); + Feature_0051? ftr0051 = + Features.Decode_0051(desc.Data); if(ftr0051.HasValue) { report.SCSI.MultiMediaDevice.Features.CanWriteHDDVDR = ftr0051.Value.HDDVDR; @@ -482,8 +486,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI case 0x0102: { report.SCSI.MultiMediaDevice.Features.EmbeddedChanger = true; - Decoders.SCSI.MMC.Feature_0102? ftr0102 = - Decoders.SCSI.MMC.Features.Decode_0102(desc.Data); + Feature_0102? ftr0102 = + Features.Decode_0102(desc.Data); if(ftr0102.HasValue) { report.SCSI.MultiMediaDevice.Features.ChangerIsSideChangeCapable = @@ -498,8 +502,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI case 0x0103: { report.SCSI.MultiMediaDevice.Features.CanPlayCDAudio = true; - Decoders.SCSI.MMC.Feature_0103? ftr0103 = - Decoders.SCSI.MMC.Features.Decode_0103(desc.Data); + Feature_0103? ftr0103 = + Features.Decode_0103(desc.Data); if(ftr0103.HasValue) { report.SCSI.MultiMediaDevice.Features.CanAudioScan = ftr0103.Value.Scan; @@ -519,8 +523,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI case 0x0106: { report.SCSI.MultiMediaDevice.Features.SupportsCSS = true; - Decoders.SCSI.MMC.Feature_0106? ftr0106 = - Decoders.SCSI.MMC.Features.Decode_0106(desc.Data); + Feature_0106? ftr0106 = + Features.Decode_0106(desc.Data); if(ftr0106.HasValue) if(ftr0106.Value.CSSVersion > 0) { @@ -538,8 +542,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI case 0x010B: { report.SCSI.MultiMediaDevice.Features.SupportsCPRM = true; - Decoders.SCSI.MMC.Feature_010B? ftr010B = - Decoders.SCSI.MMC.Features.Decode_010B(desc.Data); + Feature_010B? ftr010B = + Features.Decode_010B(desc.Data); if(ftr010B.HasValue) if(ftr010B.Value.CPRMVersion > 0) { @@ -550,8 +554,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI break; case 0x010C: { - Decoders.SCSI.MMC.Feature_010C? ftr010C = - Decoders.SCSI.MMC.Features.Decode_010C(desc.Data); + Feature_010C? ftr010C = + Features.Decode_010C(desc.Data); if(ftr010C.HasValue) { string syear, smonth, sday, shour, sminute, ssecond; @@ -562,27 +566,27 @@ namespace DiscImageChef.Core.Devices.Report.SCSI temp[1] = (byte)(ftr010C.Value.Century & 0xFF); temp[2] = (byte)((ftr010C.Value.Year & 0xFF00) >> 8); temp[3] = (byte)(ftr010C.Value.Year & 0xFF); - syear = System.Text.Encoding.ASCII.GetString(temp); + syear = Encoding.ASCII.GetString(temp); temp = new byte[2]; temp[0] = (byte)((ftr010C.Value.Month & 0xFF00) >> 8); temp[1] = (byte)(ftr010C.Value.Month & 0xFF); - smonth = System.Text.Encoding.ASCII.GetString(temp); + smonth = Encoding.ASCII.GetString(temp); temp = new byte[2]; temp[0] = (byte)((ftr010C.Value.Day & 0xFF00) >> 8); temp[1] = (byte)(ftr010C.Value.Day & 0xFF); - sday = System.Text.Encoding.ASCII.GetString(temp); + sday = Encoding.ASCII.GetString(temp); temp = new byte[2]; temp[0] = (byte)((ftr010C.Value.Hour & 0xFF00) >> 8); temp[1] = (byte)(ftr010C.Value.Hour & 0xFF); - shour = System.Text.Encoding.ASCII.GetString(temp); + shour = Encoding.ASCII.GetString(temp); temp = new byte[2]; temp[0] = (byte)((ftr010C.Value.Minute & 0xFF00) >> 8); temp[1] = (byte)(ftr010C.Value.Minute & 0xFF); - sminute = System.Text.Encoding.ASCII.GetString(temp); + sminute = Encoding.ASCII.GetString(temp); temp = new byte[2]; temp[0] = (byte)((ftr010C.Value.Second & 0xFF00) >> 8); temp[1] = (byte)(ftr010C.Value.Second & 0xFF); - ssecond = System.Text.Encoding.ASCII.GetString(temp); + ssecond = Encoding.ASCII.GetString(temp); try { @@ -602,8 +606,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI case 0x010D: { report.SCSI.MultiMediaDevice.Features.SupportsAACS = true; - Decoders.SCSI.MMC.Feature_010D? ftr010D = - Decoders.SCSI.MMC.Features.Decode_010D(desc.Data); + Feature_010D? ftr010D = + Features.Decode_010D(desc.Data); if(ftr010D.HasValue) { report.SCSI.MultiMediaDevice.Features.CanReadDriveAACSCertificate = @@ -755,7 +759,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI sense = dev.ScsiTestUnitReady(out senseBuffer, timeout, out duration); if(sense) { - Decoders.SCSI.FixedSense? decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuffer); + FixedSense? decSense = Sense.DecodeFixed(senseBuffer); if(decSense.HasValue) if(decSense.Value.ASC == 0x3A) { @@ -763,7 +767,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI while(leftRetries > 0) { DicConsole.Write("\rWaiting for drive to become ready"); - System.Threading.Thread.Sleep(2000); + Thread.Sleep(2000); sense = dev.ScsiTestUnitReady(out senseBuffer, timeout, out duration); if(!sense) break; @@ -778,7 +782,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI while(leftRetries > 0) { DicConsole.Write("\rWaiting for drive to become ready"); - System.Threading.Thread.Sleep(2000); + Thread.Sleep(2000); sense = dev.ScsiTestUnitReady(out senseBuffer, timeout, out duration); if(!sense) break; @@ -794,7 +798,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI while(leftRetries > 0) { DicConsole.Write("\rWaiting for drive to become ready"); - System.Threading.Thread.Sleep(2000); + Thread.Sleep(2000); sense = dev.ScsiTestUnitReady(out senseBuffer, timeout, out duration); if(!sense) break; @@ -848,7 +852,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI if(!sense && !dev.Error) { report.SCSI.SupportsModeSense10 = true; - decMode = Decoders.SCSI.Modes.DecodeMode10(buffer, dev.ScsiType); + decMode = Modes.DecodeMode10(buffer, dev.ScsiType); if(debug) mediaTest.ModeSense10Data = buffer; } DicConsole.WriteLine("Querying SCSI MODE SENSE..."); @@ -856,7 +860,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI if(!sense && !dev.Error) { report.SCSI.SupportsModeSense6 = true; - if(!decMode.HasValue) decMode = Decoders.SCSI.Modes.DecodeMode6(buffer, dev.ScsiType); + if(!decMode.HasValue) decMode = Modes.DecodeMode6(buffer, dev.ScsiType); if(debug) mediaTest.ModeSense6Data = buffer; } @@ -1818,9 +1822,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI out duration); if(sense && !dev.Error) { - Decoders.SCSI.FixedSense? decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuffer); + FixedSense? decSense = Sense.DecodeFixed(senseBuffer); if(decSense.HasValue) - if(decSense.Value.SenseKey == Decoders.SCSI.SenseKeys.IllegalRequest && + if(decSense.Value.SenseKey == SenseKeys.IllegalRequest && decSense.Value.ASC == 0x24 && decSense.Value.ASCQ == 0x00) { mediaTest.SupportsReadLong = true; diff --git a/DiscImageChef.Core/Devices/Report/SCSI/SSC.cs b/DiscImageChef.Core/Devices/Report/SCSI/SSC.cs index 87ddb2d2c..931e394a7 100644 --- a/DiscImageChef.Core/Devices/Report/SCSI/SSC.cs +++ b/DiscImageChef.Core/Devices/Report/SCSI/SSC.cs @@ -32,7 +32,10 @@ using System; using System.Collections.Generic; +using System.Threading; using DiscImageChef.Console; +using DiscImageChef.Decoders.SCSI; +using DiscImageChef.Decoders.SCSI.SSC; using DiscImageChef.Devices; using DiscImageChef.Metadata; @@ -50,14 +53,14 @@ namespace DiscImageChef.Core.Devices.Report.SCSI bool sense; uint timeout = 5; ConsoleKeyInfo pressedKey; - Decoders.SCSI.Modes.DecodedMode? decMode = null; + Modes.DecodedMode? decMode = null; report.SCSI.SequentialDevice = new sscType(); DicConsole.WriteLine("Querying SCSI READ BLOCK LIMITS..."); sense = dev.ReadBlockLimits(out buffer, out senseBuffer, timeout, out duration); if(!sense) { - Decoders.SCSI.SSC.BlockLimits.BlockLimitsData? decBl = Decoders.SCSI.SSC.BlockLimits.Decode(buffer); + BlockLimits.BlockLimitsData? decBl = BlockLimits.Decode(buffer); if(decBl.HasValue) { if(decBl.Value.granularity > 0) @@ -82,8 +85,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI sense = dev.ReportDensitySupport(out buffer, out senseBuffer, false, false, timeout, out duration); if(!sense) { - Decoders.SCSI.SSC.DensitySupport.DensitySupportHeader? dsh = - Decoders.SCSI.SSC.DensitySupport.DecodeDensity(buffer); + DensitySupport.DensitySupportHeader? dsh = + DensitySupport.DecodeDensity(buffer); if(dsh.HasValue) { report.SCSI.SequentialDevice.SupportedDensities = @@ -116,8 +119,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI sense = dev.ReportDensitySupport(out buffer, out senseBuffer, true, false, timeout, out duration); if(!sense) { - Decoders.SCSI.SSC.DensitySupport.MediaTypeSupportHeader? mtsh = - Decoders.SCSI.SSC.DensitySupport.DecodeMediumType(buffer); + DensitySupport.MediaTypeSupportHeader? mtsh = + DensitySupport.DecodeMediumType(buffer); if(mtsh.HasValue) { report.SCSI.SequentialDevice.SupportedMediaTypes = @@ -176,7 +179,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI sense = dev.ScsiTestUnitReady(out senseBuffer, timeout, out duration); if(sense) { - Decoders.SCSI.FixedSense? decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuffer); + FixedSense? decSense = Sense.DecodeFixed(senseBuffer); if(decSense.HasValue) if(decSense.Value.ASC == 0x3A) { @@ -184,7 +187,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI while(leftRetries > 0) { DicConsole.Write("\rWaiting for drive to become ready"); - System.Threading.Thread.Sleep(2000); + Thread.Sleep(2000); sense = dev.ScsiTestUnitReady(out senseBuffer, timeout, out duration); if(!sense) break; @@ -199,7 +202,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI while(leftRetries > 0) { DicConsole.Write("\rWaiting for drive to become ready"); - System.Threading.Thread.Sleep(2000); + Thread.Sleep(2000); sense = dev.ScsiTestUnitReady(out senseBuffer, timeout, out duration); if(!sense) break; @@ -222,7 +225,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI if(!sense && !dev.Error) { report.SCSI.SupportsModeSense10 = true; - decMode = Decoders.SCSI.Modes.DecodeMode10(buffer, dev.ScsiType); + decMode = Modes.DecodeMode10(buffer, dev.ScsiType); if(debug) seqTest.ModeSense10Data = buffer; } @@ -231,7 +234,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI if(!sense && !dev.Error) { report.SCSI.SupportsModeSense6 = true; - if(!decMode.HasValue) decMode = Decoders.SCSI.Modes.DecodeMode6(buffer, dev.ScsiType); + if(!decMode.HasValue) decMode = Modes.DecodeMode6(buffer, dev.ScsiType); if(debug) seqTest.ModeSense6Data = buffer; } @@ -252,8 +255,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI sense = dev.ReportDensitySupport(out buffer, out senseBuffer, false, true, timeout, out duration); if(!sense) { - Decoders.SCSI.SSC.DensitySupport.DensitySupportHeader? dsh = - Decoders.SCSI.SSC.DensitySupport.DecodeDensity(buffer); + DensitySupport.DensitySupportHeader? dsh = + DensitySupport.DecodeDensity(buffer); if(dsh.HasValue) { seqTest.SupportedDensities = new SupportedDensity[dsh.Value.descriptors.Length]; @@ -279,8 +282,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI sense = dev.ReportDensitySupport(out buffer, out senseBuffer, true, true, timeout, out duration); if(!sense) { - Decoders.SCSI.SSC.DensitySupport.MediaTypeSupportHeader? mtsh = - Decoders.SCSI.SSC.DensitySupport.DecodeMediumType(buffer); + DensitySupport.MediaTypeSupportHeader? mtsh = + DensitySupport.DecodeMediumType(buffer); if(mtsh.HasValue) { seqTest.SupportedMediaTypes = new SupportedMedia[mtsh.Value.descriptors.Length]; diff --git a/DiscImageChef.Core/Devices/Scanning/ATA.cs b/DiscImageChef.Core/Devices/Scanning/ATA.cs index b323a77aa..c40cd846c 100644 --- a/DiscImageChef.Core/Devices/Scanning/ATA.cs +++ b/DiscImageChef.Core/Devices/Scanning/ATA.cs @@ -34,6 +34,7 @@ using System; using System.Collections.Generic; using DiscImageChef.Console; using DiscImageChef.Core.Logging; +using DiscImageChef.Decoders.ATA; using DiscImageChef.Devices; namespace DiscImageChef.Core.Devices.Scanning @@ -50,14 +51,14 @@ namespace DiscImageChef.Core.Devices.Scanning bool sense; results.Blocks = 0; ushort currentProfile = 0x0001; - Decoders.ATA.AtaErrorRegistersCHS errorChs; + AtaErrorRegistersCHS errorChs; uint timeout = 5; double duration = 0; sense = dev.AtaIdentify(out cmdBuf, out errorChs); - if(!sense && Decoders.ATA.Identify.Decode(cmdBuf).HasValue) + if(!sense && Identify.Decode(cmdBuf).HasValue) { - Decoders.ATA.Identify.IdentifyDevice ataId = Decoders.ATA.Identify.Decode(cmdBuf).Value; + Identify.IdentifyDevice ataId = Identify.Decode(cmdBuf).Value; // Initializate reader Reader ataReader = new Reader(dev, timeout, cmdBuf); @@ -167,7 +168,7 @@ namespace DiscImageChef.Core.Devices.Scanning } #pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values - currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (duration / (double)1000); + currentSpeed = (double)blockSize * blocksToRead / 1048576 / (duration / 1000); #pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values GC.Collect(); } @@ -177,7 +178,7 @@ namespace DiscImageChef.Core.Devices.Scanning mhddLog.Close(); #pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values ibgLog.Close(dev, results.Blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024, - (double)blockSize * (double)(results.Blocks + 1) / 1024 / + blockSize * (double)(results.Blocks + 1) / 1024 / (results.ProcessingTime / 1000), devicePath); #pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values @@ -252,7 +253,7 @@ namespace DiscImageChef.Core.Devices.Scanning } #pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values - currentSpeed = (double)blockSize / (double)1048576 / (duration / (double)1000); + currentSpeed = blockSize / (double)1048576 / (duration / 1000); #pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values GC.Collect(); @@ -266,7 +267,7 @@ namespace DiscImageChef.Core.Devices.Scanning mhddLog.Close(); #pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values ibgLog.Close(dev, results.Blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024, - (double)blockSize * (double)(results.Blocks + 1) / 1024 / + blockSize * (double)(results.Blocks + 1) / 1024 / (results.ProcessingTime / 1000), devicePath); #pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values @@ -299,7 +300,7 @@ namespace DiscImageChef.Core.Devices.Scanning results.ProcessingTime /= 1000; results.TotalTime = (end - start).TotalSeconds; #pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values - results.AvgSpeed = (double)blockSize * (double)(results.Blocks + 1) / 1048576 / + results.AvgSpeed = blockSize * (double)(results.Blocks + 1) / 1048576 / results.ProcessingTime; #pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values results.SeekTimes = SEEK_TIMES; diff --git a/DiscImageChef.Core/Devices/Scanning/SCSI.cs b/DiscImageChef.Core/Devices/Scanning/SCSI.cs index 754e1503c..9ed3ebe5f 100644 --- a/DiscImageChef.Core/Devices/Scanning/SCSI.cs +++ b/DiscImageChef.Core/Devices/Scanning/SCSI.cs @@ -32,8 +32,12 @@ using System; using System.Collections.Generic; +using System.Threading; using DiscImageChef.Console; using DiscImageChef.Core.Logging; +using DiscImageChef.Decoders.CD; +using DiscImageChef.Decoders.SCSI; +using DiscImageChef.Decoders.SCSI.MMC; using DiscImageChef.Devices; namespace DiscImageChef.Core.Devices.Scanning @@ -59,7 +63,7 @@ namespace DiscImageChef.Core.Devices.Scanning sense = dev.ScsiTestUnitReady(out senseBuf, dev.Timeout, out duration); if(sense) { - Decoders.SCSI.FixedSense? decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf); + FixedSense? decSense = Sense.DecodeFixed(senseBuf); if(decSense.HasValue) if(decSense.Value.ASC == 0x3A) { @@ -67,7 +71,7 @@ namespace DiscImageChef.Core.Devices.Scanning while(leftRetries > 0) { DicConsole.WriteLine("\rWaiting for drive to become ready"); - System.Threading.Thread.Sleep(2000); + Thread.Sleep(2000); sense = dev.ScsiTestUnitReady(out senseBuf, dev.Timeout, out duration); if(!sense) break; @@ -86,7 +90,7 @@ namespace DiscImageChef.Core.Devices.Scanning while(leftRetries > 0) { DicConsole.WriteLine("\rWaiting for drive to become ready"); - System.Threading.Thread.Sleep(2000); + Thread.Sleep(2000); sense = dev.ScsiTestUnitReady(out senseBuf, dev.Timeout, out duration); if(!sense) break; @@ -96,7 +100,7 @@ namespace DiscImageChef.Core.Devices.Scanning if(sense) { DicConsole.ErrorWriteLine("Error testing unit was ready:\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); return results; } } @@ -107,7 +111,7 @@ namespace DiscImageChef.Core.Devices.Scanning while(leftRetries > 0) { DicConsole.WriteLine("\rWaiting for drive to become ready"); - System.Threading.Thread.Sleep(2000); + Thread.Sleep(2000); sense = dev.ScsiTestUnitReady(out senseBuf, dev.Timeout, out duration); if(!sense) break; @@ -117,14 +121,14 @@ namespace DiscImageChef.Core.Devices.Scanning if(sense) { DicConsole.ErrorWriteLine("Error testing unit was ready:\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); return results; } } else { DicConsole.ErrorWriteLine("Error testing unit was ready:\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); return results; } else @@ -138,12 +142,12 @@ namespace DiscImageChef.Core.Devices.Scanning Reader scsiReader = null; switch(dev.ScsiType) { - case Decoders.SCSI.PeripheralDeviceTypes.DirectAccess: - case Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice: - case Decoders.SCSI.PeripheralDeviceTypes.OCRWDevice: - case Decoders.SCSI.PeripheralDeviceTypes.OpticalDevice: - case Decoders.SCSI.PeripheralDeviceTypes.SimplifiedDevice: - case Decoders.SCSI.PeripheralDeviceTypes.WriteOnceDevice: + case PeripheralDeviceTypes.DirectAccess: + case PeripheralDeviceTypes.MultiMediaDevice: + case PeripheralDeviceTypes.OCRWDevice: + case PeripheralDeviceTypes.OpticalDevice: + case PeripheralDeviceTypes.SimplifiedDevice: + case PeripheralDeviceTypes.WriteOnceDevice: scsiReader = new Reader(dev, dev.Timeout, null, false); results.Blocks = scsiReader.GetDeviceBlocks(); if(scsiReader.FindReadCommand()) @@ -163,7 +167,7 @@ namespace DiscImageChef.Core.Devices.Scanning #pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values } break; - case Decoders.SCSI.PeripheralDeviceTypes.SequentialAccess: + case PeripheralDeviceTypes.SequentialAccess: DicConsole.WriteLine("Scanning will never be supported on SCSI Streaming Devices."); DicConsole.WriteLine("It has no sense to do it, and it will put too much strain on the tape."); return results; @@ -176,15 +180,15 @@ namespace DiscImageChef.Core.Devices.Scanning } bool compactDisc = true; - Decoders.CD.FullTOC.CDFullTOC? toc = null; + FullTOC.CDFullTOC? toc = null; - if(dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice) + if(dev.ScsiType == PeripheralDeviceTypes.MultiMediaDevice) { sense = dev.GetConfiguration(out cmdBuf, out senseBuf, 0, MmcGetConfigurationRt.Current, dev.Timeout, out duration); if(!sense) { - Decoders.SCSI.MMC.Features.SeparatedFeatures ftr = Decoders.SCSI.MMC.Features.Separate(cmdBuf); + Features.SeparatedFeatures ftr = Features.Separate(cmdBuf); currentProfile = ftr.CurrentProfile; @@ -209,7 +213,7 @@ namespace DiscImageChef.Core.Devices.Scanning // We discarded all discs that falsify a TOC before requesting a real TOC // No TOC, no CD (or an empty one) bool tocSense = dev.ReadRawToc(out cmdBuf, out senseBuf, 1, dev.Timeout, out duration); - if(!tocSense) toc = Decoders.CD.FullTOC.Decode(cmdBuf); + if(!tocSense) toc = FullTOC.Decode(cmdBuf); } } else compactDisc = false; @@ -316,9 +320,9 @@ namespace DiscImageChef.Core.Devices.Scanning else { DicConsole.DebugWriteLine("Media-Scan", "READ CD error:\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); - Decoders.SCSI.FixedSense? senseDecoded = Decoders.SCSI.Sense.DecodeFixed(senseBuf); + FixedSense? senseDecoded = Sense.DecodeFixed(senseBuf); if(senseDecoded.HasValue) { // TODO: This error happens when changing from track type afaik. Need to solve that more cleanly @@ -350,7 +354,7 @@ namespace DiscImageChef.Core.Devices.Scanning } #pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values - currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (cmdDuration / (double)1000); + currentSpeed = (double)blockSize * blocksToRead / 1048576 / (cmdDuration / 1000); #pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values GC.Collect(); } @@ -360,7 +364,7 @@ namespace DiscImageChef.Core.Devices.Scanning mhddLog.Close(); #pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values ibgLog.Close(dev, results.Blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024, - (double)blockSize * (double)(results.Blocks + 1) / 1024 / + blockSize * (double)(results.Blocks + 1) / 1024 / (results.ProcessingTime / 1000), devicePath); #pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values } @@ -415,7 +419,7 @@ namespace DiscImageChef.Core.Devices.Scanning } #pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values - currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (cmdDuration / (double)1000); + currentSpeed = (double)blockSize * blocksToRead / 1048576 / (cmdDuration / 1000); #pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values } @@ -424,7 +428,7 @@ namespace DiscImageChef.Core.Devices.Scanning mhddLog.Close(); #pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values ibgLog.Close(dev, results.Blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024, - (double)blockSize * (double)(results.Blocks + 1) / 1024 / + blockSize * (double)(results.Blocks + 1) / 1024 / (results.ProcessingTime / 1000), devicePath); #pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values } @@ -465,7 +469,7 @@ namespace DiscImageChef.Core.Devices.Scanning results.ProcessingTime /= 1000; results.TotalTime = (end - start).TotalSeconds; #pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values - results.AvgSpeed = (double)blockSize * (double)(results.Blocks + 1) / 1048576 / results.ProcessingTime; + results.AvgSpeed = blockSize * (double)(results.Blocks + 1) / 1048576 / results.ProcessingTime; #pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values results.SeekTimes = SEEK_TIMES; diff --git a/DiscImageChef.Core/Devices/Scanning/SecureDigital.cs b/DiscImageChef.Core/Devices/Scanning/SecureDigital.cs index 90fce5009..d3af5e3d2 100644 --- a/DiscImageChef.Core/Devices/Scanning/SecureDigital.cs +++ b/DiscImageChef.Core/Devices/Scanning/SecureDigital.cs @@ -205,7 +205,7 @@ namespace DiscImageChef.Core.Devices.Scanning } #pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values - currentSpeed = (double)blockSize * blocksToRead / (double)1048576 / (duration / (double)1000); + currentSpeed = (double)blockSize * blocksToRead / 1048576 / (duration / 1000); #pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values GC.Collect(); } @@ -215,7 +215,7 @@ namespace DiscImageChef.Core.Devices.Scanning mhddLog.Close(); #pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values ibgLog.Close(dev, results.Blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024, - (double)blockSize * (double)(results.Blocks + 1) / 1024 / (results.ProcessingTime / 1000), + blockSize * (double)(results.Blocks + 1) / 1024 / (results.ProcessingTime / 1000), devicePath); #pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values @@ -227,7 +227,7 @@ namespace DiscImageChef.Core.Devices.Scanning DicConsole.Write("\rSeeking to sector {0}...\t\t", seekPos); - dev.Read(out cmdBuf, out response, (uint)seekPos, blockSize, blocksToRead, byteAddressed, timeout, + dev.Read(out cmdBuf, out response, seekPos, blockSize, blocksToRead, byteAddressed, timeout, out seekCur); #pragma warning disable RECS0018 // Comparison of floating point numbers with equality operator @@ -244,7 +244,7 @@ namespace DiscImageChef.Core.Devices.Scanning results.ProcessingTime /= 1000; results.TotalTime = (end - start).TotalSeconds; #pragma warning disable IDE0004 // Without this specific cast, it gives incorrect values - results.AvgSpeed = (double)blockSize * (double)(results.Blocks + 1) / 1048576 / results.ProcessingTime; + results.AvgSpeed = blockSize * (double)(results.Blocks + 1) / 1048576 / results.ProcessingTime; #pragma warning restore IDE0004 // Without this specific cast, it gives incorrect values results.SeekTimes = SEEK_TIMES; diff --git a/DiscImageChef.Core/Filesystems.cs b/DiscImageChef.Core/Filesystems.cs index 07b04ed1b..1b756c87e 100644 --- a/DiscImageChef.Core/Filesystems.cs +++ b/DiscImageChef.Core/Filesystems.cs @@ -33,7 +33,6 @@ using System.Collections.Generic; using System.Linq; using DiscImageChef.CommonTypes; -using DiscImageChef.Filesystems; using DiscImageChef.DiscImages; namespace DiscImageChef.Core diff --git a/DiscImageChef.Core/ImageFormat.cs b/DiscImageChef.Core/ImageFormat.cs index 21762e6ba..b86b663b2 100644 --- a/DiscImageChef.Core/ImageFormat.cs +++ b/DiscImageChef.Core/ImageFormat.cs @@ -33,8 +33,8 @@ using System; using System.Linq; using DiscImageChef.Console; -using DiscImageChef.Filters; using DiscImageChef.DiscImages; +using DiscImageChef.Filters; namespace DiscImageChef.Core { diff --git a/DiscImageChef.Core/Logging/DumpLog.cs b/DiscImageChef.Core/Logging/DumpLog.cs index 78b378056..6c36bfd78 100644 --- a/DiscImageChef.Core/Logging/DumpLog.cs +++ b/DiscImageChef.Core/Logging/DumpLog.cs @@ -34,6 +34,8 @@ using System; using System.IO; using System.Reflection; using DiscImageChef.Devices; +using DiscImageChef.Interop; +using PlatformID = DiscImageChef.Interop.PlatformID; namespace DiscImageChef.Core.Logging { @@ -49,12 +51,12 @@ namespace DiscImageChef.Core.Logging logSw.WriteLine("Start logging at {0}", DateTime.Now); - Interop.PlatformID platId = Interop.DetectOS.GetRealPlatformID(); - string platVer = Interop.DetectOS.GetVersion(); + PlatformID platId = DetectOS.GetRealPlatformID(); + string platVer = DetectOS.GetVersion(); Type monoRunType = Type.GetType("Mono.Runtime"); logSw.WriteLine("################# System information #################"); - logSw.WriteLine("{0} {1} ({2}-bit)", Interop.DetectOS.GetPlatformName(platId, platVer), platVer, + logSw.WriteLine("{0} {1} ({2}-bit)", DetectOS.GetPlatformName(platId, platVer), platVer, Environment.Is64BitOperatingSystem ? 64 : 32); if(monoRunType != null) { diff --git a/DiscImageChef.Core/Logging/IBGLog.cs b/DiscImageChef.Core/Logging/IBGLog.cs index 52fe2bb71..01bc6b903 100644 --- a/DiscImageChef.Core/Logging/IBGLog.cs +++ b/DiscImageChef.Core/Logging/IBGLog.cs @@ -274,7 +274,7 @@ namespace DiscImageChef.Core.Logging ibgHeader.AppendLine("HRPC=True"); ibgHeader.AppendLine(); ibgHeader.AppendLine("[START_VERIFY_GRAPH_VALUES]"); - ibgHeader.Append(ibgSb.ToString()); + ibgHeader.Append(ibgSb); ibgHeader.AppendLine("[END_VERIFY_GRAPH_VALUES]"); ibgHeader.AppendLine(); ibgHeader.Replace("\r\n", "\n").Replace("\r", "\n").Replace("\n", "\r\n"); diff --git a/DiscImageChef.Core/Logging/MHDDLog.cs b/DiscImageChef.Core/Logging/MHDDLog.cs index c7a8cfe53..5488a1a10 100644 --- a/DiscImageChef.Core/Logging/MHDDLog.cs +++ b/DiscImageChef.Core/Logging/MHDDLog.cs @@ -31,6 +31,7 @@ // ****************************************************************************/ using System; +using System.Globalization; using System.IO; using System.Text; using DiscImageChef.Devices; @@ -82,10 +83,10 @@ namespace DiscImageChef.Core.Logging device = string.Format("DEVICE: {0} {1}", dev.Manufacturer, dev.Model); fw = string.Format("F/W: {0}", dev.Revision); sn = string.Format("S/N: {0}", dev.Serial); - sectors = string.Format(new System.Globalization.CultureInfo("en-US"), "SECTORS: {0:n0}", blocks); - sectorsize = string.Format(new System.Globalization.CultureInfo("en-US"), "SECTOR SIZE: {0:n0} bytes", + sectors = string.Format(new CultureInfo("en-US"), "SECTORS: {0:n0}", blocks); + sectorsize = string.Format(new CultureInfo("en-US"), "SECTOR SIZE: {0:n0} bytes", blockSize); - scanblocksize = string.Format(new System.Globalization.CultureInfo("en-US"), + scanblocksize = string.Format(new CultureInfo("en-US"), "SCAN BLOCK SIZE: {0:n0} sectors", blocksToRead); ver = "VER:2 "; diff --git a/DiscImageChef.Core/PluginBase.cs b/DiscImageChef.Core/PluginBase.cs index 3228c1582..1abb0ec06 100644 --- a/DiscImageChef.Core/PluginBase.cs +++ b/DiscImageChef.Core/PluginBase.cs @@ -35,8 +35,8 @@ using System.Collections.Generic; using System.Reflection; using System.Text; using DiscImageChef.Console; -using DiscImageChef.Filesystems; using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; using DiscImageChef.Partitions; namespace DiscImageChef.Core @@ -91,7 +91,7 @@ namespace DiscImageChef.Core Filesystem plugin; if(encoding != null) - plugin = (Filesystem)type.GetConstructor(new Type[] {encoding.GetType()}) + plugin = (Filesystem)type.GetConstructor(new[] {encoding.GetType()}) .Invoke(new object[] {encoding}); else plugin = (Filesystem)type.GetConstructor(Type.EmptyTypes).Invoke(new object[] { }); RegisterPlugin(plugin); diff --git a/DiscImageChef.Core/Remote.cs b/DiscImageChef.Core/Remote.cs index 86c087745..08a0d756b 100644 --- a/DiscImageChef.Core/Remote.cs +++ b/DiscImageChef.Core/Remote.cs @@ -33,12 +33,14 @@ using System.IO; using System.Net; using System.Threading; +using System.Xml.Serialization; +using DiscImageChef.Metadata; namespace DiscImageChef.Core { public static class Remote { - public static void SubmitReport(Metadata.DeviceReport report) + public static void SubmitReport(DeviceReport report) { Thread submitThread = new Thread(() => { @@ -51,8 +53,8 @@ namespace DiscImageChef.Core #endif MemoryStream xmlStream = new MemoryStream(); - System.Xml.Serialization.XmlSerializer xmlSer = - new System.Xml.Serialization.XmlSerializer(typeof(Metadata.DeviceReport)); + XmlSerializer xmlSer = + new XmlSerializer(typeof(DeviceReport)); xmlSer.Serialize(xmlStream, report); xmlStream.Seek(0, SeekOrigin.Begin); WebRequest request = WebRequest.Create("http://discimagechef.claunia.com/api/uploadreport"); @@ -79,7 +81,6 @@ namespace DiscImageChef.Core catch(WebException) { // Can't connect to the server, do nothing - return; } // ReSharper disable once RedundantCatchClause catch diff --git a/DiscImageChef.Core/Sidecar/AudioMedia.cs b/DiscImageChef.Core/Sidecar/AudioMedia.cs index 3aec46fb9..6923e5711 100644 --- a/DiscImageChef.Core/Sidecar/AudioMedia.cs +++ b/DiscImageChef.Core/Sidecar/AudioMedia.cs @@ -30,6 +30,7 @@ // Copyright © 2011-2018 Natalia Portillo // ****************************************************************************/ +using System; using System.Collections.Generic; using System.IO; using DiscImageChef.DiscImages; @@ -40,7 +41,7 @@ namespace DiscImageChef.Core public static partial class Sidecar { // TODO: Complete it - static void AudioMedia(ImagePlugin image, System.Guid filterId, string imagePath, FileInfo fi, + static void AudioMedia(ImagePlugin image, Guid filterId, string imagePath, FileInfo fi, PluginBase plugins, List imgChecksums, ref CICMMetadataType sidecar) { sidecar.AudioMedia = new[] diff --git a/DiscImageChef.Core/Sidecar/BlockMedia.cs b/DiscImageChef.Core/Sidecar/BlockMedia.cs index 5c6c36749..cace4166b 100644 --- a/DiscImageChef.Core/Sidecar/BlockMedia.cs +++ b/DiscImageChef.Core/Sidecar/BlockMedia.cs @@ -36,18 +36,21 @@ using System.IO; using System.Linq; using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.Decoders.ATA; using DiscImageChef.Decoders.PCMCIA; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; +using DiscImageChef.Metadata; using Schemas; +using MediaType = DiscImageChef.Metadata.MediaType; using Tuple = DiscImageChef.Decoders.PCMCIA.Tuple; namespace DiscImageChef.Core { public static partial class Sidecar { - static void BlockMedia(ImagePlugin image, System.Guid filterId, string imagePath, FileInfo fi, + static void BlockMedia(ImagePlugin image, Guid filterId, string imagePath, FileInfo fi, PluginBase plugins, List imgChecksums, ref CICMMetadataType sidecar) { sidecar.BlockMedia = new[] @@ -227,8 +230,8 @@ namespace DiscImageChef.Core } // If there is only one track, and it's the same as the image file (e.g. ".iso" files), don't re-checksum. - if(image.PluginUuid == new System.Guid("12345678-AAAA-BBBB-CCCC-123456789000") && - filterId == new System.Guid("12345678-AAAA-BBBB-CCCC-123456789000")) sidecar.BlockMedia[0].ContentChecksums = sidecar.BlockMedia[0].Checksums; + if(image.PluginUuid == new Guid("12345678-AAAA-BBBB-CCCC-123456789000") && + filterId == new Guid("12345678-AAAA-BBBB-CCCC-123456789000")) sidecar.BlockMedia[0].ContentChecksums = sidecar.BlockMedia[0].Checksums; else { Checksum contentChkWorker = new Checksum(); @@ -271,12 +274,12 @@ namespace DiscImageChef.Core EndProgress2(); } - Metadata.MediaType.MediaTypeToString(image.ImageInfo.MediaType, out string dskType, out string dskSubType); + MediaType.MediaTypeToString(image.ImageInfo.MediaType, out string dskType, out string dskSubType); sidecar.BlockMedia[0].DiskType = dskType; sidecar.BlockMedia[0].DiskSubType = dskSubType; Statistics.AddMedia(image.ImageInfo.MediaType, false); - sidecar.BlockMedia[0].Dimensions = Metadata.Dimensions.DimensionsFromMediaType(image.ImageInfo.MediaType); + sidecar.BlockMedia[0].Dimensions = Dimensions.DimensionsFromMediaType(image.ImageInfo.MediaType); sidecar.BlockMedia[0].LogicalBlocks = (long)image.GetSectors(); sidecar.BlockMedia[0].LogicalBlockSize = (int)image.GetSectorSize(); @@ -369,8 +372,8 @@ namespace DiscImageChef.Core if(image.ImageInfo.ReadableMediaTags.Contains(MediaTagType.ATA_IDENTIFY)) { - Decoders.ATA.Identify.IdentifyDevice? ataId = - Decoders.ATA.Identify.Decode(image.ReadDiskTag(MediaTagType.ATA_IDENTIFY)); + Identify.IdentifyDevice? ataId = + Identify.Decode(image.ReadDiskTag(MediaTagType.ATA_IDENTIFY)); if(ataId.HasValue) if(ataId.Value.CurrentCylinders > 0 && ataId.Value.CurrentHeads > 0 && ataId.Value.CurrentSectorsPerTrack > 0) @@ -398,114 +401,114 @@ namespace DiscImageChef.Core switch(image.ImageInfo.MediaType) { - case MediaType.Apple32SS: - case MediaType.Apple32DS: + case CommonTypes.MediaType.Apple32SS: + case CommonTypes.MediaType.Apple32DS: trkFormat = "Apple GCR (DOS 3.2)"; break; - case MediaType.Apple33SS: - case MediaType.Apple33DS: + case CommonTypes.MediaType.Apple33SS: + case CommonTypes.MediaType.Apple33DS: trkFormat = "Apple GCR (DOS 3.3)"; break; - case MediaType.AppleSonySS: - case MediaType.AppleSonyDS: + case CommonTypes.MediaType.AppleSonySS: + case CommonTypes.MediaType.AppleSonyDS: trkFormat = "Apple GCR (Sony)"; break; - case MediaType.AppleFileWare: + case CommonTypes.MediaType.AppleFileWare: trkFormat = "Apple GCR (Twiggy)"; break; - case MediaType.DOS_525_SS_DD_9: - case MediaType.DOS_525_DS_DD_8: - case MediaType.DOS_525_DS_DD_9: - case MediaType.DOS_525_HD: - case MediaType.DOS_35_SS_DD_8: - case MediaType.DOS_35_SS_DD_9: - case MediaType.DOS_35_DS_DD_8: - case MediaType.DOS_35_DS_DD_9: - case MediaType.DOS_35_HD: - case MediaType.DOS_35_ED: - case MediaType.DMF: - case MediaType.DMF_82: - case MediaType.XDF_525: - case MediaType.XDF_35: - case MediaType.IBM53FD_256: - case MediaType.IBM53FD_512: - case MediaType.IBM53FD_1024: - case MediaType.RX02: - case MediaType.RX03: - case MediaType.RX50: - case MediaType.ACORN_525_SS_DD_40: - case MediaType.ACORN_525_SS_DD_80: - case MediaType.ACORN_525_DS_DD: - case MediaType.ACORN_35_DS_DD: - case MediaType.ACORN_35_DS_HD: - case MediaType.ATARI_525_ED: - case MediaType.ATARI_525_DD: - case MediaType.ATARI_35_SS_DD: - case MediaType.ATARI_35_DS_DD: - case MediaType.ATARI_35_SS_DD_11: - case MediaType.ATARI_35_DS_DD_11: - case MediaType.DOS_525_SS_DD_8: - case MediaType.NEC_8_DD: - case MediaType.NEC_525_SS: - case MediaType.NEC_525_DS: - case MediaType.NEC_525_HD: - case MediaType.NEC_35_HD_8: - case MediaType.NEC_35_HD_15: - case MediaType.NEC_35_TD: - case MediaType.FDFORMAT_525_DD: - case MediaType.FDFORMAT_525_HD: - case MediaType.FDFORMAT_35_DD: - case MediaType.FDFORMAT_35_HD: - case MediaType.Apricot_35: - case MediaType.CompactFloppy: + case CommonTypes.MediaType.DOS_525_SS_DD_9: + case CommonTypes.MediaType.DOS_525_DS_DD_8: + case CommonTypes.MediaType.DOS_525_DS_DD_9: + case CommonTypes.MediaType.DOS_525_HD: + case CommonTypes.MediaType.DOS_35_SS_DD_8: + case CommonTypes.MediaType.DOS_35_SS_DD_9: + case CommonTypes.MediaType.DOS_35_DS_DD_8: + case CommonTypes.MediaType.DOS_35_DS_DD_9: + case CommonTypes.MediaType.DOS_35_HD: + case CommonTypes.MediaType.DOS_35_ED: + case CommonTypes.MediaType.DMF: + case CommonTypes.MediaType.DMF_82: + case CommonTypes.MediaType.XDF_525: + case CommonTypes.MediaType.XDF_35: + case CommonTypes.MediaType.IBM53FD_256: + case CommonTypes.MediaType.IBM53FD_512: + case CommonTypes.MediaType.IBM53FD_1024: + case CommonTypes.MediaType.RX02: + case CommonTypes.MediaType.RX03: + case CommonTypes.MediaType.RX50: + case CommonTypes.MediaType.ACORN_525_SS_DD_40: + case CommonTypes.MediaType.ACORN_525_SS_DD_80: + case CommonTypes.MediaType.ACORN_525_DS_DD: + case CommonTypes.MediaType.ACORN_35_DS_DD: + case CommonTypes.MediaType.ACORN_35_DS_HD: + case CommonTypes.MediaType.ATARI_525_ED: + case CommonTypes.MediaType.ATARI_525_DD: + case CommonTypes.MediaType.ATARI_35_SS_DD: + case CommonTypes.MediaType.ATARI_35_DS_DD: + case CommonTypes.MediaType.ATARI_35_SS_DD_11: + case CommonTypes.MediaType.ATARI_35_DS_DD_11: + case CommonTypes.MediaType.DOS_525_SS_DD_8: + case CommonTypes.MediaType.NEC_8_DD: + case CommonTypes.MediaType.NEC_525_SS: + case CommonTypes.MediaType.NEC_525_DS: + case CommonTypes.MediaType.NEC_525_HD: + case CommonTypes.MediaType.NEC_35_HD_8: + case CommonTypes.MediaType.NEC_35_HD_15: + case CommonTypes.MediaType.NEC_35_TD: + case CommonTypes.MediaType.FDFORMAT_525_DD: + case CommonTypes.MediaType.FDFORMAT_525_HD: + case CommonTypes.MediaType.FDFORMAT_35_DD: + case CommonTypes.MediaType.FDFORMAT_35_HD: + case CommonTypes.MediaType.Apricot_35: + case CommonTypes.MediaType.CompactFloppy: trkFormat = "IBM MFM"; break; - case MediaType.ATARI_525_SD: - case MediaType.NEC_8_SD: - case MediaType.ACORN_525_SS_SD_40: - case MediaType.ACORN_525_SS_SD_80: - case MediaType.RX01: - case MediaType.IBM23FD: - case MediaType.IBM33FD_128: - case MediaType.IBM33FD_256: - case MediaType.IBM33FD_512: - case MediaType.IBM43FD_128: - case MediaType.IBM43FD_256: + case CommonTypes.MediaType.ATARI_525_SD: + case CommonTypes.MediaType.NEC_8_SD: + case CommonTypes.MediaType.ACORN_525_SS_SD_40: + case CommonTypes.MediaType.ACORN_525_SS_SD_80: + case CommonTypes.MediaType.RX01: + case CommonTypes.MediaType.IBM23FD: + case CommonTypes.MediaType.IBM33FD_128: + case CommonTypes.MediaType.IBM33FD_256: + case CommonTypes.MediaType.IBM33FD_512: + case CommonTypes.MediaType.IBM43FD_128: + case CommonTypes.MediaType.IBM43FD_256: trkFormat = "IBM FM"; break; - case MediaType.CBM_35_DD: + case CommonTypes.MediaType.CBM_35_DD: trkFormat = "Commodore MFM"; break; - case MediaType.CBM_AMIGA_35_HD: - case MediaType.CBM_AMIGA_35_DD: + case CommonTypes.MediaType.CBM_AMIGA_35_HD: + case CommonTypes.MediaType.CBM_AMIGA_35_DD: trkFormat = "Amiga MFM"; break; - case MediaType.CBM_1540: - case MediaType.CBM_1540_Ext: - case MediaType.CBM_1571: + case CommonTypes.MediaType.CBM_1540: + case CommonTypes.MediaType.CBM_1540_Ext: + case CommonTypes.MediaType.CBM_1571: trkFormat = "Commodore GCR"; break; - case MediaType.SHARP_525: - case MediaType.SHARP_525_9: - case MediaType.SHARP_35: break; - case MediaType.SHARP_35_9: break; - case MediaType.ECMA_99_15: - case MediaType.ECMA_99_26: - case MediaType.ECMA_100: - case MediaType.ECMA_125: - case MediaType.ECMA_147: - case MediaType.ECMA_99_8: + case CommonTypes.MediaType.SHARP_525: + case CommonTypes.MediaType.SHARP_525_9: + case CommonTypes.MediaType.SHARP_35: break; + case CommonTypes.MediaType.SHARP_35_9: break; + case CommonTypes.MediaType.ECMA_99_15: + case CommonTypes.MediaType.ECMA_99_26: + case CommonTypes.MediaType.ECMA_100: + case CommonTypes.MediaType.ECMA_125: + case CommonTypes.MediaType.ECMA_147: + case CommonTypes.MediaType.ECMA_99_8: trkFormat = "ISO MFM"; break; - case MediaType.ECMA_54: - case MediaType.ECMA_59: - case MediaType.ECMA_66: - case MediaType.ECMA_69_8: - case MediaType.ECMA_69_15: - case MediaType.ECMA_69_26: - case MediaType.ECMA_70: - case MediaType.ECMA_78: - case MediaType.ECMA_78_2: + case CommonTypes.MediaType.ECMA_54: + case CommonTypes.MediaType.ECMA_59: + case CommonTypes.MediaType.ECMA_66: + case CommonTypes.MediaType.ECMA_69_8: + case CommonTypes.MediaType.ECMA_69_15: + case CommonTypes.MediaType.ECMA_69_26: + case CommonTypes.MediaType.ECMA_70: + case CommonTypes.MediaType.ECMA_78: + case CommonTypes.MediaType.ECMA_78_2: trkFormat = "ISO FM"; break; default: @@ -519,8 +522,8 @@ namespace DiscImageChef.Core if(File.Exists(scpFilePath)) { - DiscImages.SuperCardPro scpImage = new SuperCardPro(); - Filters.ZZZNoFilter scpFilter = new ZZZNoFilter(); + SuperCardPro scpImage = new SuperCardPro(); + ZZZNoFilter scpFilter = new ZZZNoFilter(); scpFilter.Open(scpFilePath); if(image.ImageInfo.Heads <= 2 && scpImage.IdentifyImage(scpFilter)) @@ -606,8 +609,8 @@ namespace DiscImageChef.Core if(kfFile != null) { - DiscImages.KryoFlux kfImage = new KryoFlux(); - Filters.ZZZNoFilter kfFilter = new ZZZNoFilter(); + KryoFlux kfImage = new KryoFlux(); + ZZZNoFilter kfFilter = new ZZZNoFilter(); kfFilter.Open(kfFile); if(image.ImageInfo.Heads <= 2 && kfImage.IdentifyImage(kfFilter)) { @@ -676,8 +679,8 @@ namespace DiscImageChef.Core if(!File.Exists(dfiFilePath)) return; - DiscImages.DiscFerret dfiImage = new DiscFerret(); - Filters.ZZZNoFilter dfiFilter = new ZZZNoFilter(); + DiscFerret dfiImage = new DiscFerret(); + ZZZNoFilter dfiFilter = new ZZZNoFilter(); dfiFilter.Open(dfiFilePath); if(!dfiImage.IdentifyImage(dfiFilter)) return; diff --git a/DiscImageChef.Core/Sidecar/BlockTape.cs b/DiscImageChef.Core/Sidecar/BlockTape.cs index 0a4085dc8..dee51291d 100644 --- a/DiscImageChef.Core/Sidecar/BlockTape.cs +++ b/DiscImageChef.Core/Sidecar/BlockTape.cs @@ -48,8 +48,8 @@ namespace DiscImageChef.Core { Image = new ImageType {format = "Directory", offsetSpecified = false, Value = folderName}, Sequence = new SequenceType {MediaTitle = folderName, MediaSequence = 1, TotalMedia = 1}, - PhysicalBlockSize = (int)blockSize, - LogicalBlockSize = (int)blockSize, + PhysicalBlockSize = blockSize, + LogicalBlockSize = blockSize, TapeInformation = new[] { new TapePartitionType diff --git a/DiscImageChef.Core/Sidecar/LinearMedia.cs b/DiscImageChef.Core/Sidecar/LinearMedia.cs index 769e51dce..de2288604 100644 --- a/DiscImageChef.Core/Sidecar/LinearMedia.cs +++ b/DiscImageChef.Core/Sidecar/LinearMedia.cs @@ -30,6 +30,7 @@ // Copyright © 2011-2018 Natalia Portillo // ****************************************************************************/ +using System; using System.Collections.Generic; using System.IO; using DiscImageChef.DiscImages; @@ -40,7 +41,7 @@ namespace DiscImageChef.Core public static partial class Sidecar { // TODO: Complete it - static void LinearMedia(ImagePlugin image, System.Guid filterId, string imagePath, FileInfo fi, + static void LinearMedia(ImagePlugin image, Guid filterId, string imagePath, FileInfo fi, PluginBase plugins, List imgChecksums, ref CICMMetadataType sidecar) { sidecar.LinearMedia = new[] diff --git a/DiscImageChef.Core/Sidecar/OpticalDisc.cs b/DiscImageChef.Core/Sidecar/OpticalDisc.cs index d53340f04..91d96fabf 100644 --- a/DiscImageChef.Core/Sidecar/OpticalDisc.cs +++ b/DiscImageChef.Core/Sidecar/OpticalDisc.cs @@ -30,18 +30,24 @@ // Copyright © 2011-2018 Natalia Portillo // ****************************************************************************/ +using System; using System.Collections.Generic; using System.IO; using DiscImageChef.CommonTypes; -using DiscImageChef.Filesystems; +using DiscImageChef.Decoders.CD; +using DiscImageChef.Decoders.DVD; using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; using Schemas; +using DMI = DiscImageChef.Decoders.Xbox.DMI; +using Session = DiscImageChef.DiscImages.Session; +using TrackType = Schemas.TrackType; namespace DiscImageChef.Core { public static partial class Sidecar { - static void OpticalDisc(ImagePlugin image, System.Guid filterId, string imagePath, FileInfo fi, + static void OpticalDisc(ImagePlugin image, Guid filterId, string imagePath, FileInfo fi, PluginBase plugins, List imgChecksums, ref CICMMetadataType sidecar) { sidecar.OpticalDisc = new[] @@ -83,8 +89,8 @@ namespace DiscImageChef.Core Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.CD_ATIP)).ToArray(), Size = image.ReadDiskTag(MediaTagType.CD_ATIP).Length }; - Decoders.CD.ATIP.CDATIP? - atip = Decoders.CD.ATIP.Decode(image.ReadDiskTag(MediaTagType.CD_ATIP)); + ATIP.CDATIP? + atip = ATIP.Decode(image.ReadDiskTag(MediaTagType.CD_ATIP)); if(atip.HasValue) if(atip.Value.DDCD) dskType = atip.Value.DiscType ? MediaType.DDCDRW : MediaType.DDCDR; else dskType = atip.Value.DiscType ? MediaType.CDRW : MediaType.CDR; @@ -109,18 +115,18 @@ namespace DiscImageChef.Core Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.DVD_CMI)).ToArray(), Size = image.ReadDiskTag(MediaTagType.DVD_CMI).Length }; - Decoders.DVD.CSS_CPRM.LeadInCopyright? cmi = - Decoders.DVD.CSS_CPRM.DecodeLeadInCopyright(image.ReadDiskTag(MediaTagType.DVD_CMI)); + CSS_CPRM.LeadInCopyright? cmi = + CSS_CPRM.DecodeLeadInCopyright(image.ReadDiskTag(MediaTagType.DVD_CMI)); if(cmi.HasValue) switch(cmi.Value.CopyrightType) { - case Decoders.DVD.CopyrightType.AACS: + case CopyrightType.AACS: sidecar.OpticalDisc[0].CopyProtection = "AACS"; break; - case Decoders.DVD.CopyrightType.CSS: + case CopyrightType.CSS: sidecar.OpticalDisc[0].CopyProtection = "CSS"; break; - case Decoders.DVD.CopyrightType.CPRM: + case CopyrightType.CPRM: sidecar.OpticalDisc[0].CopyProtection = "CPRM"; break; } @@ -132,12 +138,12 @@ namespace DiscImageChef.Core Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.DVD_DMI)).ToArray(), Size = image.ReadDiskTag(MediaTagType.DVD_DMI).Length }; - if(Decoders.Xbox.DMI.IsXbox(image.ReadDiskTag(MediaTagType.DVD_DMI))) + if(DMI.IsXbox(image.ReadDiskTag(MediaTagType.DVD_DMI))) { dskType = MediaType.XGD; sidecar.OpticalDisc[0].Dimensions = new DimensionsType {Diameter = 120}; } - else if(Decoders.Xbox.DMI.IsXbox360(image.ReadDiskTag(MediaTagType.DVD_DMI))) + else if(DMI.IsXbox360(image.ReadDiskTag(MediaTagType.DVD_DMI))) { dskType = MediaType.XGD2; sidecar.OpticalDisc[0].Dimensions = new DimensionsType {Diameter = 120}; @@ -149,53 +155,53 @@ namespace DiscImageChef.Core Checksums = Checksum.GetChecksums(image.ReadDiskTag(MediaTagType.DVD_PFI)).ToArray(), Size = image.ReadDiskTag(MediaTagType.DVD_PFI).Length }; - Decoders.DVD.PFI.PhysicalFormatInformation? pfi = - Decoders.DVD.PFI.Decode(image.ReadDiskTag(MediaTagType.DVD_PFI)); + PFI.PhysicalFormatInformation? pfi = + PFI.Decode(image.ReadDiskTag(MediaTagType.DVD_PFI)); if(pfi.HasValue) if(dskType != MediaType.XGD && dskType != MediaType.XGD2 && dskType != MediaType.XGD3) { switch(pfi.Value.DiskCategory) { - case Decoders.DVD.DiskCategory.DVDPR: + case DiskCategory.DVDPR: dskType = MediaType.DVDPR; break; - case Decoders.DVD.DiskCategory.DVDPRDL: + case DiskCategory.DVDPRDL: dskType = MediaType.DVDPRDL; break; - case Decoders.DVD.DiskCategory.DVDPRW: + case DiskCategory.DVDPRW: dskType = MediaType.DVDPRW; break; - case Decoders.DVD.DiskCategory.DVDPRWDL: + case DiskCategory.DVDPRWDL: dskType = MediaType.DVDPRWDL; break; - case Decoders.DVD.DiskCategory.DVDR: + case DiskCategory.DVDR: dskType = MediaType.DVDR; break; - case Decoders.DVD.DiskCategory.DVDRAM: + case DiskCategory.DVDRAM: dskType = MediaType.DVDRAM; break; - case Decoders.DVD.DiskCategory.DVDROM: + case DiskCategory.DVDROM: dskType = MediaType.DVDROM; break; - case Decoders.DVD.DiskCategory.DVDRW: + case DiskCategory.DVDRW: dskType = MediaType.DVDRW; break; - case Decoders.DVD.DiskCategory.HDDVDR: + case DiskCategory.HDDVDR: dskType = MediaType.HDDVDR; break; - case Decoders.DVD.DiskCategory.HDDVDRAM: + case DiskCategory.HDDVDRAM: dskType = MediaType.HDDVDRAM; break; - case Decoders.DVD.DiskCategory.HDDVDROM: + case DiskCategory.HDDVDROM: dskType = MediaType.HDDVDROM; break; - case Decoders.DVD.DiskCategory.HDDVDRW: + case DiskCategory.HDDVDRW: dskType = MediaType.HDDVDRW; break; - case Decoders.DVD.DiskCategory.Nintendo: + case DiskCategory.Nintendo: dskType = MediaType.GOD; break; - case Decoders.DVD.DiskCategory.UMD: + case DiskCategory.UMD: dskType = MediaType.UMD; break; } @@ -203,15 +209,15 @@ namespace DiscImageChef.Core if(dskType == MediaType.DVDR && pfi.Value.PartVersion == 6) dskType = MediaType.DVDRDL; if(dskType == MediaType.DVDRW && pfi.Value.PartVersion == 3) dskType = MediaType.DVDRWDL; - if(dskType == MediaType.GOD && pfi.Value.DiscSize == Decoders.DVD.DVDSize.OneTwenty) + if(dskType == MediaType.GOD && pfi.Value.DiscSize == DVDSize.OneTwenty) dskType = MediaType.WOD; sidecar.OpticalDisc[0].Dimensions = new DimensionsType(); if(dskType == MediaType.UMD) sidecar.OpticalDisc[0].Dimensions.Diameter = 60; else switch(pfi.Value.DiscSize) { - case Decoders.DVD.DVDSize.Eighty: sidecar.OpticalDisc[0].Dimensions.Diameter = 80; + case DVDSize.Eighty: sidecar.OpticalDisc[0].Dimensions.Diameter = 80; break; - case Decoders.DVD.DVDSize.OneTwenty: sidecar.OpticalDisc[0].Dimensions.Diameter = 120; + case DVDSize.OneTwenty: sidecar.OpticalDisc[0].Dimensions.Diameter = 120; break; } } @@ -234,18 +240,18 @@ namespace DiscImageChef.Core catch { sidecar.OpticalDisc[0].Sessions = 1; } List tracks = image.GetTracks(); - List trksLst = null; + List trksLst = null; if(tracks != null) { sidecar.OpticalDisc[0].Tracks = new int[1]; sidecar.OpticalDisc[0].Tracks[0] = tracks.Count; - trksLst = new List(); + trksLst = new List(); } InitProgress(); foreach(Track trk in tracks) { - Schemas.TrackType xmlTrk = new Schemas.TrackType(); + TrackType xmlTrk = new TrackType(); switch(trk.TrackType) { case DiscImages.TrackType.Audio: @@ -321,11 +327,11 @@ namespace DiscImageChef.Core ulong doneSectors = 0; // If there is only one track, and it's the same as the image file (e.g. ".iso" files), don't re-checksum. - if(image.PluginUuid == new System.Guid("12345678-AAAA-BBBB-CCCC-123456789000") && + if(image.PluginUuid == new Guid("12345678-AAAA-BBBB-CCCC-123456789000") && // Only if filter is none... - (filterId == new System.Guid("12345678-AAAA-BBBB-CCCC-123456789000") || + (filterId == new Guid("12345678-AAAA-BBBB-CCCC-123456789000") || // ...or AppleDouble - filterId == new System.Guid("1b2165ee-c9df-4b21-bbbb-9e5892b2df4d"))) xmlTrk.Checksums = sidecar.OpticalDisc[0].Checksums; + filterId == new Guid("1b2165ee-c9df-4b21-bbbb-9e5892b2df4d"))) xmlTrk.Checksums = sidecar.OpticalDisc[0].Checksums; else { UpdateProgress("Track {0} of {1}", trk.TrackSequence, tracks.Count); diff --git a/DiscImageChef.Core/Sidecar/Sidecar.cs b/DiscImageChef.Core/Sidecar/Sidecar.cs index d51a371a0..4e856016b 100644 --- a/DiscImageChef.Core/Sidecar/Sidecar.cs +++ b/DiscImageChef.Core/Sidecar/Sidecar.cs @@ -30,8 +30,10 @@ // Copyright © 2011-2018 Natalia Portillo // ****************************************************************************/ +using System; using System.Collections.Generic; using System.IO; +using System.Text; using DiscImageChef.DiscImages; using Schemas; @@ -39,8 +41,8 @@ namespace DiscImageChef.Core { public static partial class Sidecar { - public static CICMMetadataType Create(ImagePlugin image, string imagePath, System.Guid filterId, - System.Text.Encoding encoding) + public static CICMMetadataType Create(ImagePlugin image, string imagePath, Guid filterId, + Encoding encoding) { CICMMetadataType sidecar = new CICMMetadataType(); PluginBase plugins = new PluginBase(); diff --git a/DiscImageChef.Core/Statistics.cs b/DiscImageChef.Core/Statistics.cs index 66f4f08fc..16ca5872f 100644 --- a/DiscImageChef.Core/Statistics.cs +++ b/DiscImageChef.Core/Statistics.cs @@ -37,7 +37,10 @@ using System.Linq; using System.Net; using System.Threading; using System.Xml.Serialization; +using DiscImageChef.Devices; +using DiscImageChef.Interop; using DiscImageChef.Metadata; +using MediaType = DiscImageChef.CommonTypes.MediaType; namespace DiscImageChef.Core { @@ -60,9 +63,9 @@ namespace DiscImageChef.Core { new OsStats { - name = Interop.DetectOS.GetRealPlatformID().ToString(), + name = DetectOS.GetRealPlatformID().ToString(), Value = 1, - version = Interop.DetectOS.GetVersion() + version = DetectOS.GetVersion() } }, Versions = new List {new NameValueStats {name = Version.GetVersion(), Value = 1}} @@ -82,9 +85,9 @@ namespace DiscImageChef.Core { new OsStats { - name = Interop.DetectOS.GetRealPlatformID().ToString(), + name = DetectOS.GetRealPlatformID().ToString(), Value = 1, - version = Interop.DetectOS.GetVersion() + version = DetectOS.GetVersion() } }, Versions = new List {new NameValueStats {name = Version.GetVersion(), Value = 1}} @@ -106,8 +109,8 @@ namespace DiscImageChef.Core long count = 0; OsStats old = null; - foreach(OsStats nvs in AllStats.OperatingSystems.Where(nvs => nvs.name == Interop.DetectOS.GetRealPlatformID().ToString() && - nvs.version == Interop.DetectOS.GetVersion())) { + foreach(OsStats nvs in AllStats.OperatingSystems.Where(nvs => nvs.name == DetectOS.GetRealPlatformID().ToString() && + nvs.version == DetectOS.GetVersion())) { count = nvs.Value + 1; old = nvs; break; @@ -118,9 +121,9 @@ namespace DiscImageChef.Core count++; AllStats.OperatingSystems.Add(new OsStats { - name = Interop.DetectOS.GetRealPlatformID().ToString(), + name = DetectOS.GetRealPlatformID().ToString(), Value = count, - version = Interop.DetectOS.GetVersion() + version = DetectOS.GetVersion() }); } else if(CurrentStats != null) AllStats.OperatingSystems = CurrentStats.OperatingSystems; @@ -483,7 +486,7 @@ namespace DiscImageChef.Core CurrentStats.MediaImages.Add(nw); } - public static void AddDevice(DiscImageChef.Devices.Device dev) + public static void AddDevice(Device dev) { if(Settings.Settings.Current.Stats == null || !Settings.Settings.Current.Stats.DeviceStats) return; @@ -520,7 +523,7 @@ namespace DiscImageChef.Core CurrentStats.Devices.Add(nw); } - public static void AddMedia(CommonTypes.MediaType type, bool real) + public static void AddMedia(MediaType type, bool real) { if(Settings.Settings.Current.Stats == null || !Settings.Settings.Current.Stats.MediaStats) return; diff --git a/DiscImageChef.Decoders/ATA/Identify.cs b/DiscImageChef.Decoders/ATA/Identify.cs index 82bebdc70..a3cbb3a39 100644 --- a/DiscImageChef.Decoders/ATA/Identify.cs +++ b/DiscImageChef.Decoders/ATA/Identify.cs @@ -34,6 +34,7 @@ using System; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.Console; +using DiscImageChef.Decoders.SCSI; namespace DiscImageChef.Decoders.ATA { @@ -2220,69 +2221,69 @@ namespace DiscImageChef.Decoders.ATA if(atapi) { // Bits 12 to 8, SCSI Peripheral Device Type - switch((SCSI.PeripheralDeviceTypes)(((ushort)ATAID.GeneralConfiguration & 0x1F00) >> 8)) + switch((PeripheralDeviceTypes)(((ushort)ATAID.GeneralConfiguration & 0x1F00) >> 8)) { - case SCSI.PeripheralDeviceTypes.DirectAccess: //0x00, + case PeripheralDeviceTypes.DirectAccess: //0x00, sb.AppendLine("ATAPI Direct-access device"); break; - case SCSI.PeripheralDeviceTypes.SequentialAccess: //0x01, + case PeripheralDeviceTypes.SequentialAccess: //0x01, sb.AppendLine("ATAPI Sequential-access device"); break; - case SCSI.PeripheralDeviceTypes.PrinterDevice: //0x02, + case PeripheralDeviceTypes.PrinterDevice: //0x02, sb.AppendLine("ATAPI Printer device"); break; - case SCSI.PeripheralDeviceTypes.ProcessorDevice: //0x03, + case PeripheralDeviceTypes.ProcessorDevice: //0x03, sb.AppendLine("ATAPI Processor device"); break; - case SCSI.PeripheralDeviceTypes.WriteOnceDevice: //0x04, + case PeripheralDeviceTypes.WriteOnceDevice: //0x04, sb.AppendLine("ATAPI Write-once device"); break; - case SCSI.PeripheralDeviceTypes.MultiMediaDevice: //0x05, + case PeripheralDeviceTypes.MultiMediaDevice: //0x05, sb.AppendLine("ATAPI CD-ROM/DVD/etc device"); break; - case SCSI.PeripheralDeviceTypes.ScannerDevice: //0x06, + case PeripheralDeviceTypes.ScannerDevice: //0x06, sb.AppendLine("ATAPI Scanner device"); break; - case SCSI.PeripheralDeviceTypes.OpticalDevice: //0x07, + case PeripheralDeviceTypes.OpticalDevice: //0x07, sb.AppendLine("ATAPI Optical memory device"); break; - case SCSI.PeripheralDeviceTypes.MediumChangerDevice: //0x08, + case PeripheralDeviceTypes.MediumChangerDevice: //0x08, sb.AppendLine("ATAPI Medium change device"); break; - case SCSI.PeripheralDeviceTypes.CommsDevice: //0x09, + case PeripheralDeviceTypes.CommsDevice: //0x09, sb.AppendLine("ATAPI Communications device"); break; - case SCSI.PeripheralDeviceTypes.PrePressDevice1: //0x0A, + case PeripheralDeviceTypes.PrePressDevice1: //0x0A, sb.AppendLine("ATAPI Graphics arts pre-press device (defined in ASC IT8)"); break; - case SCSI.PeripheralDeviceTypes.PrePressDevice2: //0x0B, + case PeripheralDeviceTypes.PrePressDevice2: //0x0B, sb.AppendLine("ATAPI Graphics arts pre-press device (defined in ASC IT8)"); break; - case SCSI.PeripheralDeviceTypes.ArrayControllerDevice: //0x0C, + case PeripheralDeviceTypes.ArrayControllerDevice: //0x0C, sb.AppendLine("ATAPI Array controller device"); break; - case SCSI.PeripheralDeviceTypes.EnclosureServiceDevice: //0x0D, + case PeripheralDeviceTypes.EnclosureServiceDevice: //0x0D, sb.AppendLine("ATAPI Enclosure services device"); break; - case SCSI.PeripheralDeviceTypes.SimplifiedDevice: //0x0E, + case PeripheralDeviceTypes.SimplifiedDevice: //0x0E, sb.AppendLine("ATAPI Simplified direct-access device"); break; - case SCSI.PeripheralDeviceTypes.OCRWDevice: //0x0F, + case PeripheralDeviceTypes.OCRWDevice: //0x0F, sb.AppendLine("ATAPI Optical card reader/writer device"); break; - case SCSI.PeripheralDeviceTypes.BridgingExpander: //0x10, + case PeripheralDeviceTypes.BridgingExpander: //0x10, sb.AppendLine("ATAPI Bridging Expanders"); break; - case SCSI.PeripheralDeviceTypes.ObjectDevice: //0x11, + case PeripheralDeviceTypes.ObjectDevice: //0x11, sb.AppendLine("ATAPI Object-based Storage Device"); break; - case SCSI.PeripheralDeviceTypes.ADCDevice: //0x12, + case PeripheralDeviceTypes.ADCDevice: //0x12, sb.AppendLine("ATAPI Automation/Drive Interface"); break; - case SCSI.PeripheralDeviceTypes.WellKnownDevice: //0x1E, + case PeripheralDeviceTypes.WellKnownDevice: //0x1E, sb.AppendLine("ATAPI Well known logical unit"); break; - case SCSI.PeripheralDeviceTypes.UnknownDevice: //0x1F + case PeripheralDeviceTypes.UnknownDevice: //0x1F sb.AppendLine("ATAPI Unknown or no device type"); break; default: @@ -2388,7 +2389,7 @@ namespace DiscImageChef.Decoders.ATA { #pragma warning disable IDE0004 // Remove Unnecessary Cast physicalsectorsize = - logicalsectorsize * (uint)Math.Pow(2, (double)(ATAID.PhysLogSectorSize & 0xF)); + logicalsectorsize * (uint)Math.Pow(2, ATAID.PhysLogSectorSize & 0xF); #pragma warning restore IDE0004 // Remove Unnecessary Cast } else physicalsectorsize = logicalsectorsize; diff --git a/DiscImageChef.Decoders/SCSI/EVPD.cs b/DiscImageChef.Decoders/SCSI/EVPD.cs index 7ba2bf047..b6d9bdebd 100644 --- a/DiscImageChef.Decoders/SCSI/EVPD.cs +++ b/DiscImageChef.Decoders/SCSI/EVPD.cs @@ -35,6 +35,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Text.RegularExpressions; +using DiscImageChef.Decoders.ATA; namespace DiscImageChef.Decoders.SCSI { @@ -1249,7 +1250,7 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendLine("Logical unit supports types 1, 2 and 3 protection"); break; default: - sb.AppendFormat("Logical unit supports unknown protection defined by code {0}", (byte)page.SPT) + sb.AppendFormat("Logical unit supports unknown protection defined by code {0}", page.SPT) .AppendLine(); break; } @@ -1422,11 +1423,11 @@ namespace DiscImageChef.Decoders.SCSI break; } - ATA.Identify.IdentifyDevice? id = ATA.Identify.Decode(page.IdentifyData); + Identify.IdentifyDevice? id = Identify.Decode(page.IdentifyData); if(id.HasValue) { sb.AppendLine("\tATA IDENTIFY information follows:"); - sb.AppendFormat("{0}", ATA.Identify.Prettify(id)).AppendLine(); + sb.AppendFormat("{0}", Identify.Prettify(id)).AppendLine(); } else sb.AppendLine("\tCould not decode ATA IDENTIFY information"); diff --git a/DiscImageChef.Decoders/SCSI/SSC/BlockLimits.cs b/DiscImageChef.Decoders/SCSI/SSC/BlockLimits.cs index a477d28db..b8d273acb 100644 --- a/DiscImageChef.Decoders/SCSI/SSC/BlockLimits.cs +++ b/DiscImageChef.Decoders/SCSI/SSC/BlockLimits.cs @@ -86,7 +86,7 @@ namespace DiscImageChef.Decoders.SCSI.SSC if(decoded.Value.granularity > 0) #pragma warning disable IDE0004 // Remove Unnecessary Cast sb.AppendFormat("Device's needs a block size granularity of 2^{0} ({1}) bytes", - decoded.Value.granularity, Math.Pow(2, (double)decoded.Value.granularity)) + decoded.Value.granularity, Math.Pow(2, decoded.Value.granularity)) .AppendLine(); #pragma warning restore IDE0004 // Remove Unnecessary Cast } diff --git a/DiscImageChef.Decoders/SCSI/SSC/DensitySupport.cs b/DiscImageChef.Decoders/SCSI/SSC/DensitySupport.cs index 7824aa0ff..994a81854 100644 --- a/DiscImageChef.Decoders/SCSI/SSC/DensitySupport.cs +++ b/DiscImageChef.Decoders/SCSI/SSC/DensitySupport.cs @@ -161,7 +161,7 @@ namespace DiscImageChef.Decoders.SCSI.SSC if(descriptor.defaultDensity) sb.AppendLine("\tThis is the default density on the drive"); sb.AppendFormat("\tDensity has {0} bits per mm, with {1} tracks in a {2} mm width tape", #pragma warning disable IDE0004 // Remove Unnecessary Cast - descriptor.bpmm, descriptor.tracks, (double)((double)descriptor.width / (double)10)) + descriptor.bpmm, descriptor.tracks, descriptor.width / (double)10) .AppendLine(); #pragma warning restore IDE0004 // Remove Unnecessary Cast sb.AppendFormat("\tDensity maximum capacity is {0} megabytes", descriptor.capacity).AppendLine(); @@ -252,7 +252,7 @@ namespace DiscImageChef.Decoders.SCSI.SSC sb.AppendFormat("\tMedium has a nominal length of {0} m in a {1} mm width tape", #pragma warning disable IDE0004 // Remove Unnecessary Cast - descriptor.length, (double)((double)descriptor.width / (double)10)).AppendLine(); + descriptor.length, descriptor.width / (double)10).AppendLine(); #pragma warning restore IDE0004 // Remove Unnecessary Cast sb.AppendFormat("\tMedium description: {0}", descriptor.description).AppendLine(); sb.AppendLine(); diff --git a/DiscImageChef.Decoders/SecureDigital/SCR.cs b/DiscImageChef.Decoders/SecureDigital/SCR.cs index 10a03e093..74bc5a12f 100644 --- a/DiscImageChef.Decoders/SecureDigital/SCR.cs +++ b/DiscImageChef.Decoders/SecureDigital/SCR.cs @@ -107,11 +107,11 @@ namespace DiscImageChef.Decoders.SecureDigital sb.AppendLine("\tDevice follows SecureDigital Physical Layer Specification version 1.10"); else if(scr.Spec == 2 && scr.Spec3 == false && scr.Spec4 == false && scr.SpecX == 0) sb.AppendLine("\tDevice follows SecureDigital Physical Layer Specification version 2.00"); - else if(scr.Spec == 2 && scr.Spec3 == true && scr.Spec4 == false && scr.SpecX == 0) + else if(scr.Spec == 2 && scr.Spec3 && scr.Spec4 == false && scr.SpecX == 0) sb.AppendLine("\tDevice follows SecureDigital Physical Layer Specification version 3.0x"); - else if(scr.Spec == 2 && scr.Spec3 == true && scr.Spec4 == true && scr.SpecX == 0) + else if(scr.Spec == 2 && scr.Spec3 && scr.Spec4 && scr.SpecX == 0) sb.AppendLine("\tDevice follows SecureDigital Physical Layer Specification version 4.xx"); - else if(scr.Spec == 2 && scr.Spec3 == true && scr.SpecX == 1) + else if(scr.Spec == 2 && scr.Spec3 && scr.SpecX == 1) sb.AppendLine("\tDevice follows SecureDigital Physical Layer Specification version 5.xx"); else sb diff --git a/DiscImageChef.Devices/Command.cs b/DiscImageChef.Devices/Command.cs index b93ce9782..204a9e28d 100644 --- a/DiscImageChef.Devices/Command.cs +++ b/DiscImageChef.Devices/Command.cs @@ -32,8 +32,11 @@ using System; using DiscImageChef.Decoders.ATA; +using DiscImageChef.Devices.FreeBSD; +using DiscImageChef.Devices.Windows; using DiscImageChef.Interop; using Microsoft.Win32.SafeHandles; +using PlatformID = DiscImageChef.Interop.PlatformID; namespace DiscImageChef.Devices { @@ -54,7 +57,7 @@ namespace DiscImageChef.Devices internal static int SendScsiCommand(object fd, byte[] cdb, ref byte[] buffer, out byte[] senseBuffer, uint timeout, ScsiDirection direction, out double duration, out bool sense) { - Interop.PlatformID ptId = DetectOS.GetRealPlatformID(); + PlatformID ptId = DetectOS.GetRealPlatformID(); return SendScsiCommand(ptId, fd, cdb, ref buffer, out senseBuffer, timeout, direction, out duration, out sense); @@ -73,33 +76,33 @@ namespace DiscImageChef.Devices /// SCSI command transfer direction /// Time it took to execute the command in milliseconds /// True if SCSI error returned non-OK status and contains SCSI sense - internal static int SendScsiCommand(Interop.PlatformID ptId, object fd, byte[] cdb, ref byte[] buffer, + internal static int SendScsiCommand(PlatformID ptId, object fd, byte[] cdb, ref byte[] buffer, out byte[] senseBuffer, uint timeout, ScsiDirection direction, out double duration, out bool sense) { switch(ptId) { - case Interop.PlatformID.Win32NT: + case PlatformID.Win32NT: { - Windows.ScsiIoctlDirection dir; + ScsiIoctlDirection dir; switch(direction) { case ScsiDirection.In: - dir = Windows.ScsiIoctlDirection.In; + dir = ScsiIoctlDirection.In; break; case ScsiDirection.Out: - dir = Windows.ScsiIoctlDirection.Out; + dir = ScsiIoctlDirection.Out; break; default: - dir = Windows.ScsiIoctlDirection.Unspecified; + dir = ScsiIoctlDirection.Unspecified; break; } return Windows.Command.SendScsiCommand((SafeFileHandle)fd, cdb, ref buffer, out senseBuffer, timeout, dir, out duration, out sense); } - case Interop.PlatformID.Linux: + case PlatformID.Linux: { Linux.ScsiIoctlDirection dir; @@ -125,23 +128,23 @@ namespace DiscImageChef.Devices return Linux.Command.SendScsiCommand((int)fd, cdb, ref buffer, out senseBuffer, timeout, dir, out duration, out sense); } - case Interop.PlatformID.FreeBSD: + case PlatformID.FreeBSD: { - FreeBSD.CcbFlags flags = 0; + CcbFlags flags = 0; switch(direction) { case ScsiDirection.In: - flags = FreeBSD.CcbFlags.CamDirIn; + flags = CcbFlags.CamDirIn; break; case ScsiDirection.Out: - flags = FreeBSD.CcbFlags.CamDirOut; + flags = CcbFlags.CamDirOut; break; case ScsiDirection.Bidirectional: - flags = FreeBSD.CcbFlags.CamDirBoth; + flags = CcbFlags.CamDirBoth; break; case ScsiDirection.None: - flags = FreeBSD.CcbFlags.CamDirNone; + flags = CcbFlags.CamDirNone; break; } @@ -159,20 +162,20 @@ namespace DiscImageChef.Devices AtaProtocol protocol, AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, bool transferBlocks, out double duration, out bool sense) { - Interop.PlatformID ptId = DetectOS.GetRealPlatformID(); + PlatformID ptId = DetectOS.GetRealPlatformID(); return SendAtaCommand(ptId, fd, registers, out errorRegisters, protocol, transferRegister, ref buffer, timeout, transferBlocks, out duration, out sense); } - internal static int SendAtaCommand(Interop.PlatformID ptId, object fd, AtaRegistersCHS registers, + internal static int SendAtaCommand(PlatformID ptId, object fd, AtaRegistersCHS registers, out AtaErrorRegistersCHS errorRegisters, AtaProtocol protocol, AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, bool transferBlocks, out double duration, out bool sense) { switch(ptId) { - case Interop.PlatformID.Win32NT: + case PlatformID.Win32NT: { if(Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor == 1 && (Environment.OSVersion.ServicePack == "Service Pack 1" || @@ -187,13 +190,13 @@ namespace DiscImageChef.Devices return Windows.Command.SendAtaCommand((SafeFileHandle)fd, registers, out errorRegisters, protocol, ref buffer, timeout, out duration, out sense); } - case Interop.PlatformID.Linux: + case PlatformID.Linux: { return Linux.Command.SendAtaCommand((int)fd, registers, out errorRegisters, protocol, transferRegister, ref buffer, timeout, transferBlocks, out duration, out sense); } - case Interop.PlatformID.FreeBSD: + case PlatformID.FreeBSD: { return FreeBSD.Command.SendAtaCommand((IntPtr)fd, registers, out errorRegisters, protocol, ref buffer, timeout, out duration, out sense); @@ -207,20 +210,20 @@ namespace DiscImageChef.Devices AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, bool transferBlocks, out double duration, out bool sense) { - Interop.PlatformID ptId = DetectOS.GetRealPlatformID(); + PlatformID ptId = DetectOS.GetRealPlatformID(); return SendAtaCommand(ptId, fd, registers, out errorRegisters, protocol, transferRegister, ref buffer, timeout, transferBlocks, out duration, out sense); } - internal static int SendAtaCommand(Interop.PlatformID ptId, object fd, AtaRegistersLBA28 registers, + internal static int SendAtaCommand(PlatformID ptId, object fd, AtaRegistersLBA28 registers, out AtaErrorRegistersLBA28 errorRegisters, AtaProtocol protocol, AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, bool transferBlocks, out double duration, out bool sense) { switch(ptId) { - case Interop.PlatformID.Win32NT: + case PlatformID.Win32NT: { if(Environment.OSVersion.Version.Major == 5 && Environment.OSVersion.Version.Minor == 1 && (Environment.OSVersion.ServicePack == "Service Pack 1" || @@ -235,13 +238,13 @@ namespace DiscImageChef.Devices return Windows.Command.SendAtaCommand((SafeFileHandle)fd, registers, out errorRegisters, protocol, ref buffer, timeout, out duration, out sense); } - case Interop.PlatformID.Linux: + case PlatformID.Linux: { return Linux.Command.SendAtaCommand((int)fd, registers, out errorRegisters, protocol, transferRegister, ref buffer, timeout, transferBlocks, out duration, out sense); } - case Interop.PlatformID.FreeBSD: + case PlatformID.FreeBSD: { return FreeBSD.Command.SendAtaCommand((IntPtr)fd, registers, out errorRegisters, protocol, ref buffer, timeout, out duration, out sense); @@ -255,32 +258,32 @@ namespace DiscImageChef.Devices AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, bool transferBlocks, out double duration, out bool sense) { - Interop.PlatformID ptId = DetectOS.GetRealPlatformID(); + PlatformID ptId = DetectOS.GetRealPlatformID(); return SendAtaCommand(ptId, fd, registers, out errorRegisters, protocol, transferRegister, ref buffer, timeout, transferBlocks, out duration, out sense); } - internal static int SendAtaCommand(Interop.PlatformID ptId, object fd, AtaRegistersLBA48 registers, + internal static int SendAtaCommand(PlatformID ptId, object fd, AtaRegistersLBA48 registers, out AtaErrorRegistersLBA48 errorRegisters, AtaProtocol protocol, AtaTransferRegister transferRegister, ref byte[] buffer, uint timeout, bool transferBlocks, out double duration, out bool sense) { switch(ptId) { - case Interop.PlatformID.Win32NT: + case PlatformID.Win32NT: { // No check for Windows version. A 48-bit ATA disk simply does not work on earlier systems return Windows.Command.SendAtaCommand((SafeFileHandle)fd, registers, out errorRegisters, protocol, ref buffer, timeout, out duration, out sense); } - case Interop.PlatformID.Linux: + case PlatformID.Linux: { return Linux.Command.SendAtaCommand((int)fd, registers, out errorRegisters, protocol, transferRegister, ref buffer, timeout, transferBlocks, out duration, out sense); } - case Interop.PlatformID.FreeBSD: + case PlatformID.FreeBSD: { return FreeBSD.Command.SendAtaCommand((IntPtr)fd, registers, out errorRegisters, protocol, ref buffer, timeout, out duration, out sense); @@ -293,26 +296,26 @@ namespace DiscImageChef.Devices uint argument, uint blockSize, uint blocks, ref byte[] buffer, out uint[] response, out double duration, out bool sense, uint timeout = 0) { - Interop.PlatformID ptId = DetectOS.GetRealPlatformID(); + PlatformID ptId = DetectOS.GetRealPlatformID(); return SendMmcCommand(ptId, (int)fd, command, write, isApplication, flags, argument, blockSize, blocks, ref buffer, out response, out duration, out sense, timeout); } - internal static int SendMmcCommand(Interop.PlatformID ptId, object fd, MmcCommands command, bool write, + internal static int SendMmcCommand(PlatformID ptId, object fd, MmcCommands command, bool write, bool isApplication, MmcFlags flags, uint argument, uint blockSize, uint blocks, ref byte[] buffer, out uint[] response, out double duration, out bool sense, uint timeout = 0) { switch(ptId) { - case Interop.PlatformID.Win32NT: + case PlatformID.Win32NT: { return Windows.Command.SendMmcCommand((SafeFileHandle)fd, command, write, isApplication, flags, argument, blockSize, blocks, ref buffer, out response, out duration, out sense, timeout); } - case Interop.PlatformID.Linux: + case PlatformID.Linux: { return Linux.Command.SendMmcCommand((int)fd, command, write, isApplication, flags, argument, blockSize, blocks, ref buffer, out response, out duration, diff --git a/DiscImageChef.Devices/Device/Commands.cs b/DiscImageChef.Devices/Device/Commands.cs index 9fb657982..699703038 100644 --- a/DiscImageChef.Devices/Device/Commands.cs +++ b/DiscImageChef.Devices/Device/Commands.cs @@ -30,6 +30,7 @@ // Copyright © 2011-2018 Natalia Portillo // ****************************************************************************/ +using System; using DiscImageChef.Decoders.ATA; namespace DiscImageChef.Devices @@ -140,34 +141,34 @@ namespace DiscImageChef.Devices switch(command) { case MmcCommands.SendCid when cachedCid != null: { - System.DateTime start = System.DateTime.Now; + DateTime start = DateTime.Now; buffer = new byte[cachedCid.Length]; - System.Array.Copy(cachedCid, buffer, buffer.Length); + Array.Copy(cachedCid, buffer, buffer.Length); response = new uint[4]; sense = false; - System.DateTime end = System.DateTime.Now; + DateTime end = DateTime.Now; duration = (end - start).TotalMilliseconds; return 0; } case MmcCommands.SendCsd when cachedCid != null: { - System.DateTime start = System.DateTime.Now; + DateTime start = DateTime.Now; buffer = new byte[cachedCsd.Length]; - System.Array.Copy(cachedCsd, buffer, buffer.Length); + Array.Copy(cachedCsd, buffer, buffer.Length); response = new uint[4]; sense = false; - System.DateTime end = System.DateTime.Now; + DateTime end = DateTime.Now; duration = (end - start).TotalMilliseconds; return 0; } case (MmcCommands)SecureDigitalCommands.SendScr when cachedScr != null: { - System.DateTime start = System.DateTime.Now; + DateTime start = DateTime.Now; buffer = new byte[cachedScr.Length]; - System.Array.Copy(cachedScr, buffer, buffer.Length); + Array.Copy(cachedScr, buffer, buffer.Length); response = new uint[4]; sense = false; - System.DateTime end = System.DateTime.Now; + DateTime end = DateTime.Now; duration = (end - start).TotalMilliseconds; return 0; } @@ -179,12 +180,12 @@ namespace DiscImageChef.Devices blocks, ref buffer, out response, out duration, out sense, timeout); { - System.DateTime start = System.DateTime.Now; + DateTime start = DateTime.Now; buffer = new byte[cachedOcr.Length]; - System.Array.Copy(cachedOcr, buffer, buffer.Length); + Array.Copy(cachedOcr, buffer, buffer.Length); response = new uint[4]; sense = false; - System.DateTime end = System.DateTime.Now; + DateTime end = DateTime.Now; duration = (end - start).TotalMilliseconds; return 0; } diff --git a/DiscImageChef.Devices/Device/Constructor.cs b/DiscImageChef.Devices/Device/Constructor.cs index 4dbf5cdfa..440702f38 100644 --- a/DiscImageChef.Devices/Device/Constructor.cs +++ b/DiscImageChef.Devices/Device/Constructor.cs @@ -31,11 +31,26 @@ // ****************************************************************************/ using System; +using System.Globalization; +using System.IO; using System.Linq; using System.Runtime.InteropServices; using DiscImageChef.Console; using DiscImageChef.Decoders.ATA; +using DiscImageChef.Decoders.SCSI; +using DiscImageChef.Decoders.SecureDigital; +using DiscImageChef.Devices.FreeBSD; +using DiscImageChef.Devices.Windows; +using DiscImageChef.Interop; using Microsoft.Win32.SafeHandles; +using Extern = DiscImageChef.Devices.Windows.Extern; +using FileAccess = DiscImageChef.Devices.Windows.FileAccess; +using FileAttributes = DiscImageChef.Devices.Windows.FileAttributes; +using FileFlags = DiscImageChef.Devices.Linux.FileFlags; +using FileMode = DiscImageChef.Devices.Windows.FileMode; +using FileShare = DiscImageChef.Devices.Windows.FileShare; +using PlatformID = DiscImageChef.Interop.PlatformID; +using VendorString = DiscImageChef.Decoders.SecureDigital.VendorString; namespace DiscImageChef.Devices { @@ -47,19 +62,19 @@ namespace DiscImageChef.Devices /// Device path public Device(string devicePath) { - PlatformId = Interop.DetectOS.GetRealPlatformID(); + PlatformId = DetectOS.GetRealPlatformID(); Timeout = 15; Error = false; IsRemovable = false; switch(PlatformId) { - case Interop.PlatformID.Win32NT: + case PlatformID.Win32NT: { - FileHandle = Windows.Extern.CreateFile(devicePath, - Windows.FileAccess.GenericRead | Windows.FileAccess.GenericWrite, - Windows.FileShare.Read | Windows.FileShare.Write, IntPtr.Zero, - Windows.FileMode.OpenExisting, Windows.FileAttributes.Normal, + FileHandle = Extern.CreateFile(devicePath, + FileAccess.GenericRead | FileAccess.GenericWrite, + FileShare.Read | FileShare.Write, IntPtr.Zero, + FileMode.OpenExisting, FileAttributes.Normal, IntPtr.Zero); if(((SafeFileHandle)FileHandle).IsInvalid) @@ -70,9 +85,9 @@ namespace DiscImageChef.Devices break; } - case Interop.PlatformID.Linux: + case PlatformID.Linux: { - FileHandle = Linux.Extern.open(devicePath, Linux.FileFlags.Readonly | Linux.FileFlags.NonBlocking); + FileHandle = Linux.Extern.open(devicePath, FileFlags.Readonly | FileFlags.NonBlocking); if((int)FileHandle < 0) { @@ -82,7 +97,7 @@ namespace DiscImageChef.Devices break; } - case Interop.PlatformID.FreeBSD: + case PlatformID.FreeBSD: { FileHandle = FreeBSD.Extern.cam_open_device(devicePath, FreeBSD.FileFlags.ReadWrite); @@ -92,8 +107,8 @@ namespace DiscImageChef.Devices LastError = Marshal.GetLastWin32Error(); } - FreeBSD.CamDevice camDevice = - (FreeBSD.CamDevice)Marshal.PtrToStructure((IntPtr)FileHandle, typeof(FreeBSD.CamDevice)); + CamDevice camDevice = + (CamDevice)Marshal.PtrToStructure((IntPtr)FileHandle, typeof(CamDevice)); if(StringHandlers.CToString(camDevice.SimName) == "ata") throw new @@ -108,7 +123,7 @@ namespace DiscImageChef.Devices if(Error) throw new SystemException(string.Format("Error {0} opening device.", LastError)); Type = DeviceType.Unknown; - ScsiType = Decoders.SCSI.PeripheralDeviceTypes.UnknownDevice; + ScsiType = PeripheralDeviceTypes.UnknownDevice; AtaErrorRegistersCHS errorRegisters; @@ -123,10 +138,10 @@ namespace DiscImageChef.Devices // Windows is answering SCSI INQUIRY for all device types so it needs to be detected first switch(PlatformId) { - case Interop.PlatformID.Win32NT: - Windows.StoragePropertyQuery query = new Windows.StoragePropertyQuery(); - query.PropertyId = Windows.StoragePropertyId.Device; - query.QueryType = Windows.StorageQueryType.Standard; + case PlatformID.Win32NT: + StoragePropertyQuery query = new StoragePropertyQuery(); + query.PropertyId = StoragePropertyId.Device; + query.QueryType = StorageQueryType.Standard; query.AdditionalParameters = new byte[1]; IntPtr descriptorPtr = Marshal.AllocHGlobal(1000); @@ -135,8 +150,8 @@ namespace DiscImageChef.Devices uint returned = 0; int error = 0; - bool hasError = !Windows.Extern.DeviceIoControlStorageQuery((SafeFileHandle)FileHandle, - Windows.WindowsIoctl + bool hasError = !Extern.DeviceIoControlStorageQuery((SafeFileHandle)FileHandle, + WindowsIoctl .IoctlStorageQueryProperty, ref query, (uint)Marshal.SizeOf(query), descriptorPtr, 1000, ref returned, @@ -148,7 +163,7 @@ namespace DiscImageChef.Devices if(!hasError && error == 0) { - Windows.StorageDeviceDescriptor descriptor = new Windows.StorageDeviceDescriptor(); + StorageDeviceDescriptor descriptor = new StorageDeviceDescriptor(); descriptor.Version = BitConverter.ToUInt32(descriptorB, 0); descriptor.Size = BitConverter.ToUInt32(descriptorB, 4); descriptor.DeviceType = descriptorB[8]; @@ -159,42 +174,42 @@ namespace DiscImageChef.Devices descriptor.ProductIdOffset = BitConverter.ToInt32(descriptorB, 16); descriptor.ProductRevisionOffset = BitConverter.ToInt32(descriptorB, 20); descriptor.SerialNumberOffset = BitConverter.ToInt32(descriptorB, 24); - descriptor.BusType = (Windows.StorageBusType)BitConverter.ToUInt32(descriptorB, 28); + descriptor.BusType = (StorageBusType)BitConverter.ToUInt32(descriptorB, 28); descriptor.RawPropertiesLength = BitConverter.ToUInt32(descriptorB, 32); descriptor.RawDeviceProperties = new byte[descriptor.RawPropertiesLength]; Array.Copy(descriptorB, 36, descriptor.RawDeviceProperties, 0, descriptor.RawPropertiesLength); switch(descriptor.BusType) { - case Windows.StorageBusType.SCSI: - case Windows.StorageBusType.SSA: - case Windows.StorageBusType.Fibre: - case Windows.StorageBusType.iSCSI: - case Windows.StorageBusType.SAS: + case StorageBusType.SCSI: + case StorageBusType.SSA: + case StorageBusType.Fibre: + case StorageBusType.iSCSI: + case StorageBusType.SAS: Type = DeviceType.SCSI; break; - case Windows.StorageBusType.FireWire: + case StorageBusType.FireWire: IsFireWire = true; Type = DeviceType.SCSI; break; - case Windows.StorageBusType.USB: + case StorageBusType.USB: IsUsb = true; Type = DeviceType.SCSI; break; - case Windows.StorageBusType.ATAPI: + case StorageBusType.ATAPI: Type = DeviceType.ATAPI; break; - case Windows.StorageBusType.ATA: - case Windows.StorageBusType.SATA: + case StorageBusType.ATA: + case StorageBusType.SATA: Type = DeviceType.ATA; break; - case Windows.StorageBusType.MultiMediaCard: + case StorageBusType.MultiMediaCard: Type = DeviceType.MMC; break; - case Windows.StorageBusType.SecureDigital: + case StorageBusType.SecureDigital: Type = DeviceType.SecureDigital; break; - case Windows.StorageBusType.NVMe: + case StorageBusType.NVMe: Type = DeviceType.NVMe; break; } @@ -304,7 +319,7 @@ namespace DiscImageChef.Devices } } break; - case Interop.PlatformID.Linux: + case PlatformID.Linux: if(devicePath.StartsWith("/dev/sd", StringComparison.Ordinal) || devicePath.StartsWith("/dev/sr", StringComparison.Ordinal) || devicePath.StartsWith("/dev/st", StringComparison.Ordinal)) @@ -313,22 +328,22 @@ namespace DiscImageChef.Devices else if(devicePath.StartsWith("/dev/mmcblk", StringComparison.Ordinal)) { string devPath = devicePath.Substring(5); - if(System.IO.File.Exists("/sys/block/" + devPath + "/device/csd")) + if(File.Exists("/sys/block/" + devPath + "/device/csd")) { int len = ConvertFromHexAscii("/sys/block/" + devPath + "/device/csd", out cachedCsd); if(len == 0) cachedCsd = null; } - if(System.IO.File.Exists("/sys/block/" + devPath + "/device/cid")) + if(File.Exists("/sys/block/" + devPath + "/device/cid")) { int len = ConvertFromHexAscii("/sys/block/" + devPath + "/device/cid", out cachedCid); if(len == 0) cachedCid = null; } - if(System.IO.File.Exists("/sys/block/" + devPath + "/device/scr")) + if(File.Exists("/sys/block/" + devPath + "/device/scr")) { int len = ConvertFromHexAscii("/sys/block/" + devPath + "/device/scr", out cachedScr); if(len == 0) cachedScr = null; } - if(System.IO.File.Exists("/sys/block/" + devPath + "/device/ocr")) + if(File.Exists("/sys/block/" + devPath + "/device/ocr")) { int len = ConvertFromHexAscii("/sys/block/" + devPath + "/device/ocr", out cachedOcr); if(len == 0) cachedOcr = null; @@ -342,14 +357,14 @@ namespace DiscImageChef.Devices #region SecureDigital / MultiMediaCard if(cachedCid != null) { - ScsiType = Decoders.SCSI.PeripheralDeviceTypes.DirectAccess; + ScsiType = PeripheralDeviceTypes.DirectAccess; IsRemovable = false; if(cachedScr != null) { Type = DeviceType.SecureDigital; - Decoders.SecureDigital.CID decoded = Decoders.SecureDigital.Decoders.DecodeCID(cachedCid); - Manufacturer = Decoders.SecureDigital.VendorString.Prettify(decoded.Manufacturer); + CID decoded = Decoders.SecureDigital.Decoders.DecodeCID(cachedCid); + Manufacturer = VendorString.Prettify(decoded.Manufacturer); Model = decoded.ProductName; Revision = string.Format("{0:X2}.{1:X2}", (decoded.ProductRevision & 0xF0) >> 4, decoded.ProductRevision & 0x0F); @@ -370,29 +385,29 @@ namespace DiscImageChef.Devices #region USB switch(PlatformId) { - case Interop.PlatformID.Linux: + case PlatformID.Linux: if(devicePath.StartsWith("/dev/sd", StringComparison.Ordinal) || devicePath.StartsWith("/dev/sr", StringComparison.Ordinal) || devicePath.StartsWith("/dev/st", StringComparison.Ordinal)) { string devPath = devicePath.Substring(5); - if(System.IO.Directory.Exists("/sys/block/" + devPath)) + if(Directory.Exists("/sys/block/" + devPath)) { string resolvedLink = Linux.Command.ReadLink("/sys/block/" + devPath); resolvedLink = "/sys" + resolvedLink.Substring(2); if(!string.IsNullOrEmpty(resolvedLink)) while(resolvedLink.Contains("usb")) { - resolvedLink = System.IO.Path.GetDirectoryName(resolvedLink); - if(!System.IO.File.Exists(resolvedLink + "/descriptors") || - !System.IO.File.Exists(resolvedLink + "/idProduct") || - !System.IO.File.Exists(resolvedLink + "/idVendor")) continue; + resolvedLink = Path.GetDirectoryName(resolvedLink); + if(!File.Exists(resolvedLink + "/descriptors") || + !File.Exists(resolvedLink + "/idProduct") || + !File.Exists(resolvedLink + "/idVendor")) continue; - System.IO.FileStream usbFs; - System.IO.StreamReader usbSr; + FileStream usbFs; + StreamReader usbSr; string usbTemp; - usbFs = new System.IO.FileStream(resolvedLink + "/descriptors", + usbFs = new FileStream(resolvedLink + "/descriptors", System.IO.FileMode.Open, System.IO.FileAccess.Read); byte[] usbBuf = new byte[65536]; @@ -401,35 +416,35 @@ namespace DiscImageChef.Devices Array.Copy(usbBuf, 0, UsbDescriptors, 0, usbCount); usbFs.Close(); - usbSr = new System.IO.StreamReader(resolvedLink + "/idProduct"); + usbSr = new StreamReader(resolvedLink + "/idProduct"); usbTemp = usbSr.ReadToEnd(); - ushort.TryParse(usbTemp, System.Globalization.NumberStyles.HexNumber, - System.Globalization.CultureInfo.InvariantCulture, out usbProduct); + ushort.TryParse(usbTemp, NumberStyles.HexNumber, + CultureInfo.InvariantCulture, out usbProduct); usbSr.Close(); - usbSr = new System.IO.StreamReader(resolvedLink + "/idVendor"); + usbSr = new StreamReader(resolvedLink + "/idVendor"); usbTemp = usbSr.ReadToEnd(); - ushort.TryParse(usbTemp, System.Globalization.NumberStyles.HexNumber, - System.Globalization.CultureInfo.InvariantCulture, out usbVendor); + ushort.TryParse(usbTemp, NumberStyles.HexNumber, + CultureInfo.InvariantCulture, out usbVendor); usbSr.Close(); - if(System.IO.File.Exists(resolvedLink + "/manufacturer")) + if(File.Exists(resolvedLink + "/manufacturer")) { - usbSr = new System.IO.StreamReader(resolvedLink + "/manufacturer"); + usbSr = new StreamReader(resolvedLink + "/manufacturer"); UsbManufacturerString = usbSr.ReadToEnd().Trim(); usbSr.Close(); } - if(System.IO.File.Exists(resolvedLink + "/product")) + if(File.Exists(resolvedLink + "/product")) { - usbSr = new System.IO.StreamReader(resolvedLink + "/product"); + usbSr = new StreamReader(resolvedLink + "/product"); UsbProductString = usbSr.ReadToEnd().Trim(); usbSr.Close(); } - if(System.IO.File.Exists(resolvedLink + "/serial")) + if(File.Exists(resolvedLink + "/serial")) { - usbSr = new System.IO.StreamReader(resolvedLink + "/serial"); + usbSr = new StreamReader(resolvedLink + "/serial"); UsbSerialString = usbSr.ReadToEnd().Trim(); usbSr.Close(); } @@ -441,17 +456,17 @@ namespace DiscImageChef.Devices } break; - case Interop.PlatformID.Win32NT: - Windows.Usb.UsbDevice usbDevice = null; + case PlatformID.Win32NT: + Usb.UsbDevice usbDevice = null; // I have to search for USB disks, floppies and CD-ROMs as separate device types foreach(string devGuid in new[] { - Windows.Usb.GuidDevinterfaceFloppy, Windows.Usb.GuidDevinterfaceCdrom, - Windows.Usb.GuidDevinterfaceDisk + Usb.GuidDevinterfaceFloppy, Usb.GuidDevinterfaceCdrom, + Usb.GuidDevinterfaceDisk }) { - usbDevice = Windows.Usb.FindDrivePath(devicePath, devGuid); + usbDevice = Usb.FindDrivePath(devicePath, devGuid); if(usbDevice != null) break; } @@ -472,57 +487,57 @@ namespace DiscImageChef.Devices #endregion USB #region FireWire - if(PlatformId == Interop.PlatformID.Linux) + if(PlatformId == PlatformID.Linux) { if(devicePath.StartsWith("/dev/sd", StringComparison.Ordinal) || devicePath.StartsWith("/dev/sr", StringComparison.Ordinal) || devicePath.StartsWith("/dev/st", StringComparison.Ordinal)) { string devPath = devicePath.Substring(5); - if(System.IO.Directory.Exists("/sys/block/" + devPath)) + if(Directory.Exists("/sys/block/" + devPath)) { string resolvedLink = Linux.Command.ReadLink("/sys/block/" + devPath); resolvedLink = "/sys" + resolvedLink.Substring(2); if(!string.IsNullOrEmpty(resolvedLink)) while(resolvedLink.Contains("firewire")) { - resolvedLink = System.IO.Path.GetDirectoryName(resolvedLink); - if(!System.IO.File.Exists(resolvedLink + "/model") || - !System.IO.File.Exists(resolvedLink + "/vendor") || - !System.IO.File.Exists(resolvedLink + "/guid")) continue; + resolvedLink = Path.GetDirectoryName(resolvedLink); + if(!File.Exists(resolvedLink + "/model") || + !File.Exists(resolvedLink + "/vendor") || + !File.Exists(resolvedLink + "/guid")) continue; - System.IO.StreamReader fwSr; + StreamReader fwSr; string fwTemp; - fwSr = new System.IO.StreamReader(resolvedLink + "/model"); + fwSr = new StreamReader(resolvedLink + "/model"); fwTemp = fwSr.ReadToEnd(); - uint.TryParse(fwTemp, System.Globalization.NumberStyles.HexNumber, - System.Globalization.CultureInfo.InvariantCulture, out firewireModel); + uint.TryParse(fwTemp, NumberStyles.HexNumber, + CultureInfo.InvariantCulture, out firewireModel); fwSr.Close(); - fwSr = new System.IO.StreamReader(resolvedLink + "/vendor"); + fwSr = new StreamReader(resolvedLink + "/vendor"); fwTemp = fwSr.ReadToEnd(); - uint.TryParse(fwTemp, System.Globalization.NumberStyles.HexNumber, - System.Globalization.CultureInfo.InvariantCulture, + uint.TryParse(fwTemp, NumberStyles.HexNumber, + CultureInfo.InvariantCulture, out firewireVendor); fwSr.Close(); - fwSr = new System.IO.StreamReader(resolvedLink + "/guid"); + fwSr = new StreamReader(resolvedLink + "/guid"); fwTemp = fwSr.ReadToEnd(); - ulong.TryParse(fwTemp, System.Globalization.NumberStyles.HexNumber, - System.Globalization.CultureInfo.InvariantCulture, out firewireGuid); + ulong.TryParse(fwTemp, NumberStyles.HexNumber, + CultureInfo.InvariantCulture, out firewireGuid); fwSr.Close(); - if(System.IO.File.Exists(resolvedLink + "/model_name")) + if(File.Exists(resolvedLink + "/model_name")) { - fwSr = new System.IO.StreamReader(resolvedLink + "/model_name"); + fwSr = new StreamReader(resolvedLink + "/model_name"); FireWireModelName = fwSr.ReadToEnd().Trim(); fwSr.Close(); } - if(System.IO.File.Exists(resolvedLink + "/vendor_name")) + if(File.Exists(resolvedLink + "/vendor_name")) { - fwSr = new System.IO.StreamReader(resolvedLink + "/vendor_name"); + fwSr = new StreamReader(resolvedLink + "/vendor_name"); FireWireVendorName = fwSr.ReadToEnd().Trim(); fwSr.Close(); } @@ -538,38 +553,38 @@ namespace DiscImageChef.Devices #endregion FireWire #region PCMCIA - if(PlatformId == Interop.PlatformID.Linux) + if(PlatformId == PlatformID.Linux) { if(devicePath.StartsWith("/dev/sd", StringComparison.Ordinal) || devicePath.StartsWith("/dev/sr", StringComparison.Ordinal) || devicePath.StartsWith("/dev/st", StringComparison.Ordinal)) { string devPath = devicePath.Substring(5); - if(System.IO.Directory.Exists("/sys/block/" + devPath)) + if(Directory.Exists("/sys/block/" + devPath)) { string resolvedLink = Linux.Command.ReadLink("/sys/block/" + devPath); resolvedLink = "/sys" + resolvedLink.Substring(2); if(!string.IsNullOrEmpty(resolvedLink)) while(resolvedLink.Contains("/sys/devices")) { - resolvedLink = System.IO.Path.GetDirectoryName(resolvedLink); - if(!System.IO.Directory.Exists(resolvedLink + "/pcmcia_socket")) continue; + resolvedLink = Path.GetDirectoryName(resolvedLink); + if(!Directory.Exists(resolvedLink + "/pcmcia_socket")) continue; string[] subdirs = - System.IO.Directory.GetDirectories(resolvedLink + "/pcmcia_socket", + Directory.GetDirectories(resolvedLink + "/pcmcia_socket", "pcmcia_socket*", - System.IO.SearchOption.TopDirectoryOnly); + SearchOption.TopDirectoryOnly); if(subdirs.Length <= 0) continue; string possibleDir = - System.IO.Path.Combine(resolvedLink, "pcmcia_socket", subdirs[0]); - if(!System.IO.File.Exists(possibleDir + "/card_type") || - !System.IO.File.Exists(possibleDir + "/cis")) continue; + Path.Combine(resolvedLink, "pcmcia_socket", subdirs[0]); + if(!File.Exists(possibleDir + "/card_type") || + !File.Exists(possibleDir + "/cis")) continue; - System.IO.FileStream cisFs; + FileStream cisFs; - cisFs = new System.IO.FileStream(possibleDir + "/cis", + cisFs = new FileStream(possibleDir + "/cis", System.IO.FileMode.Open, System.IO.FileAccess.Read); byte[] cisBuf = new byte[65536]; @@ -590,11 +605,11 @@ namespace DiscImageChef.Devices if(!scsiSense) { - Decoders.SCSI.Inquiry.SCSIInquiry? inquiry = Decoders.SCSI.Inquiry.Decode(inqBuf); + Inquiry.SCSIInquiry? inquiry = Inquiry.Decode(inqBuf); Type = DeviceType.SCSI; bool serialSense = ScsiInquiry(out inqBuf, out senseBuf, 0x80); - if(!serialSense) Serial = Decoders.SCSI.EVPD.DecodePage80(inqBuf); + if(!serialSense) Serial = EVPD.DecodePage80(inqBuf); if(inquiry.HasValue) { @@ -606,7 +621,7 @@ namespace DiscImageChef.Devices if(tmp != null) Manufacturer = tmp.Trim(); IsRemovable = inquiry.Value.RMB; - ScsiType = (Decoders.SCSI.PeripheralDeviceTypes)inquiry.Value.PeripheralDeviceType; + ScsiType = (PeripheralDeviceTypes)inquiry.Value.PeripheralDeviceType; } bool atapiSense = AtapiIdentify(out ataBuf, out errorRegisters); @@ -647,7 +662,7 @@ namespace DiscImageChef.Devices Revision = ataid.Value.FirmwareRevision; Serial = ataid.Value.SerialNumber; - ScsiType = Decoders.SCSI.PeripheralDeviceTypes.DirectAccess; + ScsiType = PeripheralDeviceTypes.DirectAccess; if((ushort)ataid.Value.GeneralConfiguration != 0x848A) IsRemovable |= @@ -684,7 +699,7 @@ namespace DiscImageChef.Devices static int ConvertFromHexAscii(string file, out byte[] outBuf) { - System.IO.StreamReader sr = new System.IO.StreamReader(file); + StreamReader sr = new StreamReader(file); string ins = sr.ReadToEnd().Trim(); outBuf = new byte[ins.Length / 2]; int count = 0; diff --git a/DiscImageChef.Devices/Device/Destructor.cs b/DiscImageChef.Devices/Device/Destructor.cs index 519ab3b29..12e7fff04 100644 --- a/DiscImageChef.Devices/Device/Destructor.cs +++ b/DiscImageChef.Devices/Device/Destructor.cs @@ -31,7 +31,9 @@ // ****************************************************************************/ using System; +using DiscImageChef.Devices.Windows; using Microsoft.Win32.SafeHandles; +using PlatformID = DiscImageChef.Interop.PlatformID; namespace DiscImageChef.Devices { @@ -47,13 +49,13 @@ namespace DiscImageChef.Devices switch(PlatformId) { - case Interop.PlatformID.Win32NT: - Windows.Extern.CloseHandle((SafeFileHandle)FileHandle); + case PlatformID.Win32NT: + Extern.CloseHandle((SafeFileHandle)FileHandle); break; - case Interop.PlatformID.Linux: + case PlatformID.Linux: Linux.Extern.close((int)FileHandle); break; - case Interop.PlatformID.FreeBSD: + case PlatformID.FreeBSD: FreeBSD.Extern.cam_close_device((IntPtr)FileHandle); break; } diff --git a/DiscImageChef.Devices/Device/List.cs b/DiscImageChef.Devices/Device/List.cs index 6c093bd1b..8c0c7b992 100644 --- a/DiscImageChef.Devices/Device/List.cs +++ b/DiscImageChef.Devices/Device/List.cs @@ -31,6 +31,8 @@ // ****************************************************************************/ using System; +using DiscImageChef.Interop; +using PlatformID = DiscImageChef.Interop.PlatformID; namespace DiscImageChef.Devices { @@ -48,14 +50,14 @@ namespace DiscImageChef.Devices { public static DeviceInfo[] ListDevices() { - switch(Interop.DetectOS.GetRealPlatformID()) + switch(DetectOS.GetRealPlatformID()) { - case Interop.PlatformID.Win32NT: return Windows.ListDevices.GetList(); - case Interop.PlatformID.Linux: return Linux.ListDevices.GetList(); - case Interop.PlatformID.FreeBSD: return FreeBSD.ListDevices.GetList(); + case PlatformID.Win32NT: return Windows.ListDevices.GetList(); + case PlatformID.Linux: return Linux.ListDevices.GetList(); + case PlatformID.FreeBSD: return FreeBSD.ListDevices.GetList(); default: throw new InvalidOperationException(string.Format("Platform {0} not yet supported.", - Interop.DetectOS.GetRealPlatformID())); + DetectOS.GetRealPlatformID())); } } } diff --git a/DiscImageChef.Devices/Device/ScsiCommands/Fujitsu.cs b/DiscImageChef.Devices/Device/ScsiCommands/Fujitsu.cs index 7d14b2a33..c5e3679d0 100644 --- a/DiscImageChef.Devices/Device/ScsiCommands/Fujitsu.cs +++ b/DiscImageChef.Devices/Device/ScsiCommands/Fujitsu.cs @@ -31,6 +31,7 @@ // ****************************************************************************/ using System; +using System.Text; using DiscImageChef.Console; namespace DiscImageChef.Devices @@ -51,12 +52,12 @@ namespace DiscImageChef.Devices if(!string.IsNullOrWhiteSpace(firstHalf)) { - tmp = System.Text.Encoding.ASCII.GetBytes(firstHalf); + tmp = Encoding.ASCII.GetBytes(firstHalf); Array.Copy(tmp, 0, firstHalfBytes, 0, 8); } if(!string.IsNullOrWhiteSpace(secondHalf)) { - tmp = System.Text.Encoding.ASCII.GetBytes(secondHalf); + tmp = Encoding.ASCII.GetBytes(secondHalf); Array.Copy(tmp, 0, secondHalfBytes, 0, 8); } diff --git a/DiscImageChef.Devices/Device/ScsiCommands/MMC.cs b/DiscImageChef.Devices/Device/ScsiCommands/MMC.cs index dc368a69c..e7c9e1f1d 100644 --- a/DiscImageChef.Devices/Device/ScsiCommands/MMC.cs +++ b/DiscImageChef.Devices/Device/ScsiCommands/MMC.cs @@ -100,7 +100,7 @@ namespace DiscImageChef.Devices if(sense) return true; #pragma warning disable IDE0004 // Cast is necessary or an invalid bitshift happens - ushort confLength = (ushort)(((int)buffer[2] << 8) + buffer[3] + 4); + ushort confLength = (ushort)((buffer[2] << 8) + buffer[3] + 4); #pragma warning restore IDE0004 // Cast is necessary or an invalid bitshift happens buffer = new byte[confLength]; cdb[7] = (byte)((buffer.Length & 0xFF00) >> 8); @@ -157,7 +157,7 @@ namespace DiscImageChef.Devices if(sense) return true; #pragma warning disable IDE0004 // Cast is necessary or an invalid bitshift happens - ushort strctLength = (ushort)(((int)buffer[0] << 8) + buffer[1] + 2); + ushort strctLength = (ushort)((buffer[0] << 8) + buffer[1] + 2); #pragma warning restore IDE0004 // Cast is necessary or an invalid bitshift happens buffer = new byte[strctLength]; cdb[8] = (byte)((buffer.Length & 0xFF00) >> 8); @@ -319,7 +319,7 @@ namespace DiscImageChef.Devices Error = LastError != 0; #pragma warning disable IDE0004 // Cast is necessary or an invalid bitshift happens - uint strctLength = (uint)(((int)tmpBuffer[0] << 8) + tmpBuffer[1] + 2); + uint strctLength = (uint)((tmpBuffer[0] << 8) + tmpBuffer[1] + 2); #pragma warning restore IDE0004 // Cast is necessary or an invalid bitshift happens buffer = new byte[strctLength]; @@ -382,7 +382,7 @@ namespace DiscImageChef.Devices Error = LastError != 0; #pragma warning disable IDE0004 // Cast is necessary or an invalid bitshift happens - uint strctLength = (uint)(((int)tmpBuffer[0] << 8) + tmpBuffer[1] + 2); + uint strctLength = (uint)((tmpBuffer[0] << 8) + tmpBuffer[1] + 2); #pragma warning restore IDE0004 // Cast is necessary or an invalid bitshift happens buffer = new byte[strctLength]; Array.Copy(tmpBuffer, 0, buffer, 0, buffer.Length); diff --git a/DiscImageChef.Devices/Device/ScsiCommands/SMC.cs b/DiscImageChef.Devices/Device/ScsiCommands/SMC.cs index f7b42a2bb..c980e5d25 100644 --- a/DiscImageChef.Devices/Device/ScsiCommands/SMC.cs +++ b/DiscImageChef.Devices/Device/ScsiCommands/SMC.cs @@ -81,7 +81,7 @@ namespace DiscImageChef.Devices if(sense) return true; #pragma warning disable IDE0004 // Cast is necessary or an invalid bitshift happens - uint attrLen = (uint)(((int)buffer[0] << 24) + ((int)buffer[1] << 16) + ((int)buffer[2] << 8) + buffer[3] + + uint attrLen = (uint)((buffer[0] << 24) + (buffer[1] << 16) + (buffer[2] << 8) + buffer[3] + 4); #pragma warning restore IDE0004 // Cast is necessary or an invalid bitshift happens buffer = new byte[attrLen]; diff --git a/DiscImageChef.Devices/Device/ScsiCommands/SPC.cs b/DiscImageChef.Devices/Device/ScsiCommands/SPC.cs index e1e4fdbbd..d7fd528f3 100644 --- a/DiscImageChef.Devices/Device/ScsiCommands/SPC.cs +++ b/DiscImageChef.Devices/Device/ScsiCommands/SPC.cs @@ -32,6 +32,7 @@ using System; using DiscImageChef.Console; +using PlatformID = DiscImageChef.Interop.PlatformID; namespace DiscImageChef.Devices { @@ -367,7 +368,7 @@ namespace DiscImageChef.Devices if(sense) return true; #pragma warning disable IDE0004 // Cast is necessary or an invalid bitshift happens - ushort modeLength = (ushort)(((int)buffer[0] << 8) + buffer[1] + 2); + ushort modeLength = (ushort)((buffer[0] << 8) + buffer[1] + 2); #pragma warning restore IDE0004 // Cast is necessary or an invalid bitshift happens buffer = new byte[modeLength]; cdb[7] = (byte)((buffer.Length & 0xFF00) >> 8); @@ -598,7 +599,7 @@ namespace DiscImageChef.Devices if(sense) return true; #pragma warning disable IDE0004 // Cast is necessary or an invalid bitshift happens - uint strctLength = (uint)(((int)buffer[0] << 24) + ((int)buffer[1] << 16) + ((int)buffer[2] << 8) + + uint strctLength = (uint)((buffer[0] << 24) + (buffer[1] << 16) + (buffer[2] << 8) + buffer[3] + 4); #pragma warning restore IDE0004 // Cast is necessary or an invalid bitshift happens buffer = new byte[strctLength]; @@ -738,10 +739,10 @@ namespace DiscImageChef.Devices // Prevent overflows if(buffer.Length > 255) { - if(PlatformId != Interop.PlatformID.Win32NT && PlatformId != Interop.PlatformID.Win32S && - PlatformId != Interop.PlatformID.Win32Windows && PlatformId != Interop.PlatformID.WinCE && - PlatformId != Interop.PlatformID.WindowsPhone && - PlatformId != Interop.PlatformID.Xbox) LastError = 75; + if(PlatformId != PlatformID.Win32NT && PlatformId != PlatformID.Win32S && + PlatformId != PlatformID.Win32Windows && PlatformId != PlatformID.WinCE && + PlatformId != PlatformID.WindowsPhone && + PlatformId != PlatformID.Xbox) LastError = 75; else LastError = 111; Error = true; duration = 0; @@ -781,10 +782,10 @@ namespace DiscImageChef.Devices // Prevent overflows if(buffer.Length > 65535) { - if(PlatformId != Interop.PlatformID.Win32NT && PlatformId != Interop.PlatformID.Win32S && - PlatformId != Interop.PlatformID.Win32Windows && PlatformId != Interop.PlatformID.WinCE && - PlatformId != Interop.PlatformID.WindowsPhone && - PlatformId != Interop.PlatformID.Xbox) LastError = 75; + if(PlatformId != PlatformID.Win32NT && PlatformId != PlatformID.Win32S && + PlatformId != PlatformID.Win32Windows && PlatformId != PlatformID.WinCE && + PlatformId != PlatformID.WindowsPhone && + PlatformId != PlatformID.Xbox) LastError = 75; else LastError = 111; Error = true; duration = 0; diff --git a/DiscImageChef.Devices/Device/ScsiCommands/SSC.cs b/DiscImageChef.Devices/Device/ScsiCommands/SSC.cs index 567c9a748..e2122ab6b 100644 --- a/DiscImageChef.Devices/Device/ScsiCommands/SSC.cs +++ b/DiscImageChef.Devices/Device/ScsiCommands/SSC.cs @@ -918,7 +918,7 @@ namespace DiscImageChef.Devices if(sense) return true; #pragma warning disable IDE0004 // Cast is necessary or an invalid bitshift happens - ushort availableLength = (ushort)(((int)buffer[0] << 8) + buffer[1] + 2); + ushort availableLength = (ushort)((buffer[0] << 8) + buffer[1] + 2); #pragma warning restore IDE0004 // Cast is necessary or an invalid bitshift happens buffer = new byte[availableLength]; cdb[7] = (byte)((buffer.Length & 0xFF00) >> 8); diff --git a/DiscImageChef.Devices/Device/Variables.cs b/DiscImageChef.Devices/Device/Variables.cs index 9f2560c76..dd31aa008 100644 --- a/DiscImageChef.Devices/Device/Variables.cs +++ b/DiscImageChef.Devices/Device/Variables.cs @@ -30,6 +30,9 @@ // Copyright © 2011-2018 Natalia Portillo // ****************************************************************************/ +using DiscImageChef.Decoders.SCSI; +using DiscImageChef.Interop; + namespace DiscImageChef.Devices { public partial class Device @@ -51,7 +54,7 @@ namespace DiscImageChef.Devices /// Gets the Platform ID for this device /// /// The Platform ID - public Interop.PlatformID PlatformId { get; } + public PlatformID PlatformId { get; } /// /// Gets the file handle representing this device @@ -111,7 +114,7 @@ namespace DiscImageChef.Devices /// Gets the device's SCSI peripheral device type /// /// The SCSI peripheral device type. - public Decoders.SCSI.PeripheralDeviceTypes ScsiType { get; } + public PeripheralDeviceTypes ScsiType { get; } /// /// Gets a value indicating whether this device's media is removable. diff --git a/DiscImageChef.Devices/FreeBSD/Command.cs b/DiscImageChef.Devices/FreeBSD/Command.cs index 1a79d7b54..bf25a69e8 100644 --- a/DiscImageChef.Devices/FreeBSD/Command.cs +++ b/DiscImageChef.Devices/FreeBSD/Command.cs @@ -452,8 +452,8 @@ namespace DiscImageChef.Devices.FreeBSD errorRegisters = new AtaErrorRegistersLBA48(); // 48-bit ATA CAM commands can crash FreeBSD < 9.2-RELEASE - if(System.Environment.Version.Major == 9 && System.Environment.Version.Minor < 2 || - System.Environment.Version.Major < 9) return -1; + if(Environment.Version.Major == 9 && Environment.Version.Minor < 2 || + Environment.Version.Major < 9) return -1; if(buffer == null) return -1; diff --git a/DiscImageChef.Devices/FreeBSD/ListDevices.cs b/DiscImageChef.Devices/FreeBSD/ListDevices.cs index 317a20eb9..7f81c4d7c 100644 --- a/DiscImageChef.Devices/FreeBSD/ListDevices.cs +++ b/DiscImageChef.Devices/FreeBSD/ListDevices.cs @@ -35,6 +35,8 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Runtime.InteropServices; +using DiscImageChef.Decoders.ATA; +using DiscImageChef.Decoders.SCSI; using static DiscImageChef.Devices.FreeBSD.Extern; namespace DiscImageChef.Devices.FreeBSD @@ -96,7 +98,7 @@ namespace DiscImageChef.Devices.FreeBSD atadTneid[aIndex + 1] = cgd.ident_data[aIndex]; } - Decoders.ATA.Identify.IdentifyDevice? idt = Decoders.ATA.Identify.Decode(atadTneid); + Identify.IdentifyDevice? idt = Identify.Decode(atadTneid); if(idt.HasValue) { string[] separated = idt.Value.Model.Split(' '); @@ -121,7 +123,7 @@ namespace DiscImageChef.Devices.FreeBSD } case CamProto.ProtoScsi: { - Decoders.SCSI.Inquiry.SCSIInquiry? inq = Decoders.SCSI.Inquiry.Decode(cgd.inq_data); + Inquiry.SCSIInquiry? inq = Inquiry.Decode(cgd.inq_data); if(inq.HasValue) { deviceInfo.Vendor = StringHandlers.CToString(inq.Value.VendorIdentification).Trim(); diff --git a/DiscImageChef.Devices/Linux/Command.cs b/DiscImageChef.Devices/Linux/Command.cs index c79b0f8ed..95b8020bc 100644 --- a/DiscImageChef.Devices/Linux/Command.cs +++ b/DiscImageChef.Devices/Linux/Command.cs @@ -33,7 +33,9 @@ using System; using System.Runtime.InteropServices; +using System.Text; using DiscImageChef.Decoders.ATA; +using DiscImageChef.Interop; namespace DiscImageChef.Devices.Linux { @@ -382,7 +384,7 @@ namespace DiscImageChef.Devices.Linux IntPtr buf = Marshal.AllocHGlobal(4096); int resultSize; - if(Interop.DetectOS.Is64Bit()) + if(DetectOS.Is64Bit()) { long result64 = Extern.readlink64(path, buf, 4096); if(result64 <= 0) return null; @@ -400,7 +402,7 @@ namespace DiscImageChef.Devices.Linux byte[] resultString = new byte[resultSize]; Marshal.Copy(buf, resultString, 0, resultSize); Marshal.FreeHGlobal(buf); - return System.Text.Encoding.ASCII.GetString(resultString); + return Encoding.ASCII.GetString(resultString); } } } \ No newline at end of file diff --git a/DiscImageChef.Devices/Linux/Extern.cs b/DiscImageChef.Devices/Linux/Extern.cs index 9da5744df..e936183cd 100644 --- a/DiscImageChef.Devices/Linux/Extern.cs +++ b/DiscImageChef.Devices/Linux/Extern.cs @@ -54,10 +54,10 @@ namespace DiscImageChef.Devices.Linux internal static extern int ioctlMmc(int fd, LinuxIoctl request, ref MmcIocCmd value); [DllImport("libc", CharSet = CharSet.Ansi, SetLastError = true)] - internal static extern int readlink(string path, System.IntPtr buf, int bufsize); + internal static extern int readlink(string path, IntPtr buf, int bufsize); [DllImport("libc", CharSet = CharSet.Ansi, EntryPoint = "readlink", SetLastError = true)] - internal static extern long readlink64(string path, System.IntPtr buf, long bufsize); + internal static extern long readlink64(string path, IntPtr buf, long bufsize); [DllImport("libudev", CharSet = CharSet.Ansi, SetLastError = true)] internal static extern IntPtr udev_new(); diff --git a/DiscImageChef.Devices/Windows/ListDevices.cs b/DiscImageChef.Devices/Windows/ListDevices.cs index ddeadd5d5..7c6a73bd4 100644 --- a/DiscImageChef.Devices/Windows/ListDevices.cs +++ b/DiscImageChef.Devices/Windows/ListDevices.cs @@ -136,19 +136,19 @@ namespace DiscImageChef.Devices.Windows if(descriptor.VendorIdOffset > 0) info.Vendor = - StringHandlers.CToString(descriptorB, Encoding.ASCII, start: (int)descriptor.VendorIdOffset); + StringHandlers.CToString(descriptorB, Encoding.ASCII, start: descriptor.VendorIdOffset); if(descriptor.ProductIdOffset > 0) info.Model = - StringHandlers.CToString(descriptorB, Encoding.ASCII, start: (int)descriptor.ProductIdOffset); + StringHandlers.CToString(descriptorB, Encoding.ASCII, start: descriptor.ProductIdOffset); // TODO: Get serial number of SCSI and USB devices, probably also FireWire (untested) if(descriptor.SerialNumberOffset > 0) { info.Serial = StringHandlers.CToString(descriptorB, Encoding.ASCII, - start: (int)descriptor.SerialNumberOffset); + start: descriptor.SerialNumberOffset); // fix any serial numbers that are returned as hex-strings - if(Array.TrueForAll(info.Serial.ToCharArray(), (char c) => "0123456789abcdef".IndexOf(c) >= 0) + if(Array.TrueForAll(info.Serial.ToCharArray(), c => "0123456789abcdef".IndexOf(c) >= 0) && info.Serial.Length == 40) info.Serial = HexStringToString(info.Serial).Trim(); } diff --git a/DiscImageChef.Devices/Windows/Usb.cs b/DiscImageChef.Devices/Windows/Usb.cs index 697aacb19..0e3d110f8 100644 --- a/DiscImageChef.Devices/Windows/Usb.cs +++ b/DiscImageChef.Devices/Windows/Usb.cs @@ -32,6 +32,7 @@ using System; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Runtime.InteropServices; using System.Text; @@ -486,7 +487,7 @@ namespace DiscImageChef.Devices.Windows // // Return a list of USB Host Controllers // - static internal System.Collections.ObjectModel.ReadOnlyCollection GetHostControllers() + static internal ReadOnlyCollection GetHostControllers() { List hostList = new List(); Guid hostGuid = new Guid(GUID_DEVINTERFACE_HUBCONTROLLER); @@ -495,7 +496,7 @@ namespace DiscImageChef.Devices.Windows // devices that match the interface GUID of a Hub Controller IntPtr h = SetupDiGetClassDevs(ref hostGuid, 0, IntPtr.Zero, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE); if(h.ToInt32() == INVALID_HANDLE_VALUE) - return new System.Collections.ObjectModel.ReadOnlyCollection(hostList); + return new ReadOnlyCollection(hostList); IntPtr ptrBuf = Marshal.AllocHGlobal(BUFFER_SIZE); bool success; @@ -547,7 +548,7 @@ namespace DiscImageChef.Devices.Windows SetupDiDestroyDeviceInfoList(h); // convert it into a Collection - return new System.Collections.ObjectModel.ReadOnlyCollection(hostList); + return new ReadOnlyCollection(hostList); } // @@ -732,7 +733,7 @@ namespace DiscImageChef.Devices.Windows } // return a list of the down stream ports - internal System.Collections.ObjectModel.ReadOnlyCollection GetPorts() + internal ReadOnlyCollection GetPorts() { List portList = new List(); @@ -740,7 +741,7 @@ namespace DiscImageChef.Devices.Windows IntPtr h = CreateFile(HubDevicePath, GENERIC_WRITE, FILE_SHARE_WRITE, IntPtr.Zero, OPEN_EXISTING, 0, IntPtr.Zero); if(h.ToInt32() == INVALID_HANDLE_VALUE) - return new System.Collections.ObjectModel.ReadOnlyCollection(portList); + return new ReadOnlyCollection(portList); int nBytes = Marshal.SizeOf(typeof(UsbNodeConnectionInformationEx)); IntPtr ptrNodeConnection = Marshal.AllocHGlobal(nBytes); @@ -783,7 +784,7 @@ namespace DiscImageChef.Devices.Windows Marshal.FreeHGlobal(ptrNodeConnection); CloseHandle(h); // convert it into a Collection - return new System.Collections.ObjectModel.ReadOnlyCollection(portList); + return new ReadOnlyCollection(portList); } } @@ -956,7 +957,7 @@ namespace DiscImageChef.Devices.Windows // build a request for configuration descriptor UsbDescriptorRequest dcrRequest = new UsbDescriptorRequest(); dcrRequest.ConnectionIndex = PortPortNumber; - dcrRequest.SetupPacket.wValue = (short)(USB_CONFIGURATION_DESCRIPTOR_TYPE << 8); + dcrRequest.SetupPacket.wValue = USB_CONFIGURATION_DESCRIPTOR_TYPE << 8; dcrRequest.SetupPacket.wLength = (short)(nBytes - Marshal.SizeOf(dcrRequest)); dcrRequest.SetupPacket.wIndex = 0; // Geez, I wish C# had a Marshal.MemSet() method diff --git a/DiscImageChef.DiscImages/Alcohol120.cs b/DiscImageChef.DiscImages/Alcohol120.cs index 5088d3d7a..f2694740b 100644 --- a/DiscImageChef.DiscImages/Alcohol120.cs +++ b/DiscImageChef.DiscImages/Alcohol120.cs @@ -36,9 +36,13 @@ using System.IO; using System.Linq; using System.Runtime.InteropServices; using System.Text; +using DiscImageChef.Checksums; using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.Decoders.CD; +using DiscImageChef.Decoders.DVD; using DiscImageChef.Filters; +using DMI = DiscImageChef.Decoders.Xbox.DMI; namespace DiscImageChef.DiscImages { @@ -461,7 +465,7 @@ namespace DiscImageChef.DiscImages dmi[0] = 0x08; dmi[1] = 0x02; - Decoders.DVD.PFI.PhysicalFormatInformation? pfi0 = Decoders.DVD.PFI.Decode(pfi); + PFI.PhysicalFormatInformation? pfi0 = PFI.Decode(pfi); // All discs I tested the disk category and part version (as well as the start PSN for DVD-RAM) where modified by Alcohol // So much for archival value @@ -469,56 +473,56 @@ namespace DiscImageChef.DiscImages { switch(pfi0.Value.DiskCategory) { - case Decoders.DVD.DiskCategory.DVDPR: + case DiskCategory.DVDPR: ImageInfo.MediaType = MediaType.DVDPR; break; - case Decoders.DVD.DiskCategory.DVDPRDL: + case DiskCategory.DVDPRDL: ImageInfo.MediaType = MediaType.DVDPRDL; break; - case Decoders.DVD.DiskCategory.DVDPRW: + case DiskCategory.DVDPRW: ImageInfo.MediaType = MediaType.DVDPRW; break; - case Decoders.DVD.DiskCategory.DVDPRWDL: + case DiskCategory.DVDPRWDL: ImageInfo.MediaType = MediaType.DVDPRWDL; break; - case Decoders.DVD.DiskCategory.DVDR: + case DiskCategory.DVDR: if(pfi0.Value.PartVersion == 6) ImageInfo.MediaType = MediaType.DVDRDL; else ImageInfo.MediaType = MediaType.DVDR; break; - case Decoders.DVD.DiskCategory.DVDRAM: + case DiskCategory.DVDRAM: ImageInfo.MediaType = MediaType.DVDRAM; break; default: ImageInfo.MediaType = MediaType.DVDROM; break; - case Decoders.DVD.DiskCategory.DVDRW: + case DiskCategory.DVDRW: if(pfi0.Value.PartVersion == 3) ImageInfo.MediaType = MediaType.DVDRWDL; else ImageInfo.MediaType = MediaType.DVDRW; break; - case Decoders.DVD.DiskCategory.HDDVDR: + case DiskCategory.HDDVDR: ImageInfo.MediaType = MediaType.HDDVDR; break; - case Decoders.DVD.DiskCategory.HDDVDRAM: + case DiskCategory.HDDVDRAM: ImageInfo.MediaType = MediaType.HDDVDRAM; break; - case Decoders.DVD.DiskCategory.HDDVDROM: + case DiskCategory.HDDVDROM: ImageInfo.MediaType = MediaType.HDDVDROM; break; - case Decoders.DVD.DiskCategory.HDDVDRW: + case DiskCategory.HDDVDRW: ImageInfo.MediaType = MediaType.HDDVDRW; break; - case Decoders.DVD.DiskCategory.Nintendo: - if(pfi0.Value.DiscSize == Decoders.DVD.DVDSize.Eighty) + case DiskCategory.Nintendo: + if(pfi0.Value.DiscSize == DVDSize.Eighty) ImageInfo.MediaType = MediaType.GOD; else ImageInfo.MediaType = MediaType.WOD; break; - case Decoders.DVD.DiskCategory.UMD: + case DiskCategory.UMD: ImageInfo.MediaType = MediaType.UMD; break; } - if(Decoders.Xbox.DMI.IsXbox(dmi)) ImageInfo.MediaType = MediaType.XGD; - else if(Decoders.Xbox.DMI.IsXbox360(dmi)) ImageInfo.MediaType = MediaType.XGD2; + if(DMI.IsXbox(dmi)) ImageInfo.MediaType = MediaType.XGD; + else if(DMI.IsXbox360(dmi)) ImageInfo.MediaType = MediaType.XGD2; ImageInfo.ReadableMediaTags.Add(MediaTagType.DVD_PFI); ImageInfo.ReadableMediaTags.Add(MediaTagType.DVD_DMI); @@ -725,7 +729,7 @@ namespace DiscImageChef.DiscImages fullToc[2] = firstSession; fullToc[3] = lastSession; - Decoders.CD.FullTOC.CDFullTOC? decodedFullToc = Decoders.CD.FullTOC.Decode(fullToc); + FullTOC.CDFullTOC? decodedFullToc = FullTOC.Decode(fullToc); if(!decodedFullToc.HasValue) { @@ -984,7 +988,7 @@ namespace DiscImageChef.DiscImages case SectorTagType.CdSectorSubchannel: case SectorTagType.CdSectorSubHeader: case SectorTagType.CdSectorSync: break; - case SectorTagType.CdTrackFlags: return new byte[] {(byte)(_track.adrCtl & 0x0F)}; + case SectorTagType.CdTrackFlags: return new[] {(byte)(_track.adrCtl & 0x0F)}; default: throw new ArgumentException("Unsupported tag requested", nameof(tag)); } @@ -1490,13 +1494,13 @@ namespace DiscImageChef.DiscImages public override bool? VerifySector(ulong sectorAddress) { byte[] buffer = ReadSectorLong(sectorAddress); - return Checksums.CdChecksums.CheckCdSector(buffer); + return CdChecksums.CheckCdSector(buffer); } public override bool? VerifySector(ulong sectorAddress, uint track) { byte[] buffer = ReadSectorLong(sectorAddress, track); - return Checksums.CdChecksums.CheckCdSector(buffer); + return CdChecksums.CheckCdSector(buffer); } public override bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, @@ -1511,7 +1515,7 @@ namespace DiscImageChef.DiscImages for(int i = 0; i < length; i++) { Array.Copy(buffer, i * bps, sector, 0, bps); - bool? sectorStatus = Checksums.CdChecksums.CheckCdSector(sector); + bool? sectorStatus = CdChecksums.CheckCdSector(sector); switch(sectorStatus) { @@ -1542,7 +1546,7 @@ namespace DiscImageChef.DiscImages for(int i = 0; i < length; i++) { Array.Copy(buffer, i * bps, sector, 0, bps); - bool? sectorStatus = Checksums.CdChecksums.CheckCdSector(sector); + bool? sectorStatus = CdChecksums.CheckCdSector(sector); switch(sectorStatus) { diff --git a/DiscImageChef.DiscImages/BlindWrite4.cs b/DiscImageChef.DiscImages/BlindWrite4.cs index d86fbdad4..69fd4afdd 100644 --- a/DiscImageChef.DiscImages/BlindWrite4.cs +++ b/DiscImageChef.DiscImages/BlindWrite4.cs @@ -37,6 +37,7 @@ using System.IO; using System.Linq; using System.Runtime.InteropServices; using System.Text; +using DiscImageChef.Checksums; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.Filters; @@ -562,14 +563,14 @@ namespace DiscImageChef.DiscImages if(dataFilter != null) break; dataFilter = filtersList.GetFilter(Path.Combine(imageFilter.GetParentFolder(), - header.DataFile.Split(new char[] {'\\'}, + header.DataFile.Split(new[] {'\\'}, StringSplitOptions .RemoveEmptyEntries) .Last())); if(dataFilter != null) break; dataFilter = filtersList.GetFilter(Path.Combine(imageFilter.GetParentFolder(), - header.DataFile.Split(new char[] {'\\'}, + header.DataFile.Split(new[] {'\\'}, StringSplitOptions .RemoveEmptyEntries) .Last() @@ -577,7 +578,7 @@ namespace DiscImageChef.DiscImages if(dataFilter != null) break; dataFilter = filtersList.GetFilter(Path.Combine(imageFilter.GetParentFolder(), - header.DataFile.Split(new char[] {'\\'}, + header.DataFile.Split(new[] {'\\'}, StringSplitOptions .RemoveEmptyEntries) .Last() @@ -609,21 +610,21 @@ namespace DiscImageChef.DiscImages if(subFilter != null) break; subFilter = filtersList.GetFilter(Path.Combine(imageFilter.GetParentFolder(), - header.SubchannelFile.Split(new char[] {'\\'}, + header.SubchannelFile.Split(new[] {'\\'}, StringSplitOptions .RemoveEmptyEntries) .Last())); if(subFilter != null) break; subFilter = filtersList.GetFilter(Path.Combine(imageFilter.GetParentFolder(), - header.SubchannelFile.Split(new char[] {'\\'}, + header.SubchannelFile.Split(new[] {'\\'}, StringSplitOptions .RemoveEmptyEntries) .Last().ToLower(CultureInfo.CurrentCulture))); if(subFilter != null) break; subFilter = filtersList.GetFilter(Path.Combine(imageFilter.GetParentFolder(), - header.SubchannelFile.Split(new char[] {'\\'}, + header.SubchannelFile.Split(new[] {'\\'}, StringSplitOptions .RemoveEmptyEntries) .Last().ToUpper(CultureInfo.CurrentCulture))); @@ -669,7 +670,7 @@ namespace DiscImageChef.DiscImages track.TrackFilter = filtersList.GetFilter(Path.Combine(imageFilter.GetParentFolder(), - bwTrack.filename.Split(new char[] {'\\'}, + bwTrack.filename.Split(new[] {'\\'}, StringSplitOptions .RemoveEmptyEntries) .Last())); @@ -677,7 +678,7 @@ namespace DiscImageChef.DiscImages track.TrackFilter = filtersList.GetFilter(Path.Combine(imageFilter.GetParentFolder(), - bwTrack.filename.Split(new char[] {'\\'}, + bwTrack.filename.Split(new[] {'\\'}, StringSplitOptions .RemoveEmptyEntries) .Last() @@ -686,7 +687,7 @@ namespace DiscImageChef.DiscImages track.TrackFilter = filtersList.GetFilter(Path.Combine(imageFilter.GetParentFolder(), - bwTrack.filename.Split(new char[] {'\\'}, + bwTrack.filename.Split(new[] {'\\'}, StringSplitOptions .RemoveEmptyEntries) .Last() @@ -1061,7 +1062,7 @@ namespace DiscImageChef.DiscImages case SectorTagType.CdSectorSync: break; case SectorTagType.CdTrackFlags: byte flag; - if(trackFlags.TryGetValue(track, out flag)) return new byte[] {flag}; + if(trackFlags.TryGetValue(track, out flag)) return new[] {flag}; throw new ArgumentException("Unsupported tag requested", nameof(tag)); default: throw new ArgumentException("Unsupported tag requested", nameof(tag)); @@ -1295,7 +1296,7 @@ namespace DiscImageChef.DiscImages public override List GetSessionTracks(ushort session) { - return this.tracks.Where(_track => _track.TrackSession == session).ToList(); + return tracks.Where(_track => _track.TrackSession == session).ToList(); } public override List GetSessions() @@ -1306,13 +1307,13 @@ namespace DiscImageChef.DiscImages public override bool? VerifySector(ulong sectorAddress) { byte[] buffer = ReadSectorLong(sectorAddress); - return Checksums.CdChecksums.CheckCdSector(buffer); + return CdChecksums.CheckCdSector(buffer); } public override bool? VerifySector(ulong sectorAddress, uint track) { byte[] buffer = ReadSectorLong(sectorAddress, track); - return Checksums.CdChecksums.CheckCdSector(buffer); + return CdChecksums.CheckCdSector(buffer); } public override bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, @@ -1327,7 +1328,7 @@ namespace DiscImageChef.DiscImages for(int i = 0; i < length; i++) { Array.Copy(buffer, i * bps, sector, 0, bps); - bool? sectorStatus = Checksums.CdChecksums.CheckCdSector(sector); + bool? sectorStatus = CdChecksums.CheckCdSector(sector); switch(sectorStatus) { @@ -1358,7 +1359,7 @@ namespace DiscImageChef.DiscImages for(int i = 0; i < length; i++) { Array.Copy(buffer, i * bps, sector, 0, bps); - bool? sectorStatus = Checksums.CdChecksums.CheckCdSector(sector); + bool? sectorStatus = CdChecksums.CheckCdSector(sector); switch(sectorStatus) { diff --git a/DiscImageChef.DiscImages/BlindWrite5.cs b/DiscImageChef.DiscImages/BlindWrite5.cs index 7e1bd1596..84e89d56c 100644 --- a/DiscImageChef.DiscImages/BlindWrite5.cs +++ b/DiscImageChef.DiscImages/BlindWrite5.cs @@ -37,10 +37,15 @@ using System.IO; using System.Linq; using System.Runtime.InteropServices; using System.Text; +using DiscImageChef.Checksums; using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.Decoders.CD; +using DiscImageChef.Decoders.DVD; +using DiscImageChef.Decoders.SCSI; using DiscImageChef.Decoders.SCSI.MMC; using DiscImageChef.Filters; +using DMI = DiscImageChef.Decoders.Xbox.DMI; namespace DiscImageChef.DiscImages { @@ -314,10 +319,10 @@ namespace DiscImageChef.DiscImages { stream.Read(mode2A, 0, mode2A.Length); mode2A[1] -= 2; - Decoders.SCSI.Modes.ModePage_2A? decoded2A = Decoders.SCSI.Modes.DecodeModePage_2A(mode2A); + Modes.ModePage_2A? decoded2A = Modes.DecodeModePage_2A(mode2A); if(decoded2A.HasValue) DicConsole.DebugWriteLine("BlindWrite5 plugin", "mode page 2A: {0}", - Decoders.SCSI.Modes.PrettifyModePage_2A(decoded2A)); + Modes.PrettifyModePage_2A(decoded2A)); else mode2A = null; } @@ -334,9 +339,9 @@ namespace DiscImageChef.DiscImages pma[1] = tushort[0]; Array.Copy(temp, 0, pma, 4, temp.Length); - Decoders.CD.PMA.CDPMA? decodedPma = Decoders.CD.PMA.Decode(pma); + PMA.CDPMA? decodedPma = PMA.Decode(pma); if(decodedPma.HasValue) - DicConsole.DebugWriteLine("BlindWrite5 plugin", "PMA: {0}", Decoders.CD.PMA.Prettify(decodedPma)); + DicConsole.DebugWriteLine("BlindWrite5 plugin", "PMA: {0}", PMA.Prettify(decodedPma)); else pma = null; } @@ -350,10 +355,10 @@ namespace DiscImageChef.DiscImages atip[1] = tushort[0]; Array.Copy(temp, 0, atip, 4, temp.Length); - Decoders.CD.ATIP.CDATIP? decodedAtip = Decoders.CD.ATIP.Decode(atip); + ATIP.CDATIP? decodedAtip = ATIP.Decode(atip); if(decodedAtip.HasValue) DicConsole.DebugWriteLine("BlindWrite5 plugin", "ATIP: {0}", - Decoders.CD.ATIP.Prettify(decodedAtip)); + ATIP.Prettify(decodedAtip)); else atip = null; } @@ -367,10 +372,10 @@ namespace DiscImageChef.DiscImages cdtext[1] = tushort[0]; Array.Copy(temp, 0, cdtext, 4, temp.Length); - Decoders.CD.CDTextOnLeadIn.CDText? decodedCdText = Decoders.CD.CDTextOnLeadIn.Decode(cdtext); + CDTextOnLeadIn.CDText? decodedCdText = CDTextOnLeadIn.Decode(cdtext); if(decodedCdText.HasValue) DicConsole.DebugWriteLine("BlindWrite5 plugin", "CD-Text: {0}", - Decoders.CD.CDTextOnLeadIn.Prettify(decodedCdText)); + CDTextOnLeadIn.Prettify(decodedCdText)); else cdtext = null; } @@ -393,9 +398,9 @@ namespace DiscImageChef.DiscImages dmi[0] = 0x08; dmi[1] = 0x02; - Decoders.DVD.PFI.PhysicalFormatInformation? decodedPfi = Decoders.DVD.PFI.Decode(pfi); + PFI.PhysicalFormatInformation? decodedPfi = PFI.Decode(pfi); if(decodedPfi.HasValue) - DicConsole.DebugWriteLine("BlindWrite5 plugin", "PFI: {0}", Decoders.DVD.PFI.Prettify(decodedPfi)); + DicConsole.DebugWriteLine("BlindWrite5 plugin", "PFI: {0}", PFI.Prettify(decodedPfi)); else { pfi = null; @@ -950,7 +955,7 @@ namespace DiscImageChef.DiscImages fullToc[2] = firstSession; fullToc[3] = lastSession; - Decoders.CD.FullTOC.CDFullTOC? decodedFullToc = Decoders.CD.FullTOC.Decode(fullToc); + FullTOC.CDFullTOC? decodedFullToc = FullTOC.Decode(fullToc); if(!decodedFullToc.HasValue) { @@ -966,7 +971,7 @@ namespace DiscImageChef.DiscImages if(dmi != null && pfi != null) { - Decoders.DVD.PFI.PhysicalFormatInformation? pfi0 = Decoders.DVD.PFI.Decode(pfi); + PFI.PhysicalFormatInformation? pfi0 = PFI.Decode(pfi); // All discs I tested the disk category and part version (as well as the start PSN for DVD-RAM) where modified by Alcohol // So much for archival value @@ -974,55 +979,55 @@ namespace DiscImageChef.DiscImages { switch(pfi0.Value.DiskCategory) { - case Decoders.DVD.DiskCategory.DVDPR: + case DiskCategory.DVDPR: ImageInfo.MediaType = MediaType.DVDPR; break; - case Decoders.DVD.DiskCategory.DVDPRDL: + case DiskCategory.DVDPRDL: ImageInfo.MediaType = MediaType.DVDPRDL; break; - case Decoders.DVD.DiskCategory.DVDPRW: + case DiskCategory.DVDPRW: ImageInfo.MediaType = MediaType.DVDPRW; break; - case Decoders.DVD.DiskCategory.DVDPRWDL: + case DiskCategory.DVDPRWDL: ImageInfo.MediaType = MediaType.DVDPRWDL; break; - case Decoders.DVD.DiskCategory.DVDR: + case DiskCategory.DVDR: if(pfi0.Value.PartVersion == 6) ImageInfo.MediaType = MediaType.DVDRDL; else ImageInfo.MediaType = MediaType.DVDR; break; - case Decoders.DVD.DiskCategory.DVDRAM: + case DiskCategory.DVDRAM: ImageInfo.MediaType = MediaType.DVDRAM; break; default: ImageInfo.MediaType = MediaType.DVDROM; break; - case Decoders.DVD.DiskCategory.DVDRW: + case DiskCategory.DVDRW: if(pfi0.Value.PartVersion == 3) ImageInfo.MediaType = MediaType.DVDRWDL; else ImageInfo.MediaType = MediaType.DVDRW; break; - case Decoders.DVD.DiskCategory.HDDVDR: + case DiskCategory.HDDVDR: ImageInfo.MediaType = MediaType.HDDVDR; break; - case Decoders.DVD.DiskCategory.HDDVDRAM: + case DiskCategory.HDDVDRAM: ImageInfo.MediaType = MediaType.HDDVDRAM; break; - case Decoders.DVD.DiskCategory.HDDVDROM: + case DiskCategory.HDDVDROM: ImageInfo.MediaType = MediaType.HDDVDROM; break; - case Decoders.DVD.DiskCategory.HDDVDRW: + case DiskCategory.HDDVDRW: ImageInfo.MediaType = MediaType.HDDVDRW; break; - case Decoders.DVD.DiskCategory.Nintendo: - if(pfi0.Value.DiscSize == Decoders.DVD.DVDSize.Eighty) ImageInfo.MediaType = MediaType.GOD; + case DiskCategory.Nintendo: + if(pfi0.Value.DiscSize == DVDSize.Eighty) ImageInfo.MediaType = MediaType.GOD; else ImageInfo.MediaType = MediaType.WOD; break; - case Decoders.DVD.DiskCategory.UMD: + case DiskCategory.UMD: ImageInfo.MediaType = MediaType.UMD; break; } - if(Decoders.Xbox.DMI.IsXbox(dmi)) ImageInfo.MediaType = MediaType.XGD; - else if(Decoders.Xbox.DMI.IsXbox360(dmi)) ImageInfo.MediaType = MediaType.XGD2; + if(DMI.IsXbox(dmi)) ImageInfo.MediaType = MediaType.XGD; + else if(DMI.IsXbox360(dmi)) ImageInfo.MediaType = MediaType.XGD2; } } else if(ImageInfo.MediaType == MediaType.CD || ImageInfo.MediaType == MediaType.CDROM) @@ -1081,14 +1086,14 @@ namespace DiscImageChef.DiscImages if(pma != null) { - Decoders.CD.PMA.CDPMA pma0 = Decoders.CD.PMA.Decode(pma).Value; + PMA.CDPMA pma0 = PMA.Decode(pma).Value; foreach(uint id in from descriptor in pma0.PMADescriptors where descriptor.ADR == 2 select (uint)((descriptor.Min << 16) + (descriptor.Sec << 8) + descriptor.Frame)) ImageInfo.MediaSerialNumber = string.Format("{0:X6}", id & 0x00FFFFFF); } if(atip != null) { - Decoders.CD.ATIP.CDATIP atip0 = Decoders.CD.ATIP.Decode(atip).Value; + ATIP.CDATIP atip0 = ATIP.Decode(atip).Value; if(atip0.DiscType) ImageInfo.MediaType = MediaType.CDRW; else ImageInfo.MediaType = MediaType.CDR; @@ -1097,7 +1102,7 @@ namespace DiscImageChef.DiscImages { int type = atip0.LeadInStartFrame % 10; int frm = atip0.LeadInStartFrame - type; - ImageInfo.MediaManufacturer = Decoders.CD.ATIP.ManufacturerFromATIP(atip0.LeadInStartSec, frm); + ImageInfo.MediaManufacturer = ATIP.ManufacturerFromATIP(atip0.LeadInStartSec, frm); } } @@ -1417,7 +1422,7 @@ namespace DiscImageChef.DiscImages case SectorTagType.CdSectorSync: break; case SectorTagType.CdTrackFlags: byte flag; - if(trackFlags.TryGetValue(track, out flag)) return new byte[] {flag}; + if(trackFlags.TryGetValue(track, out flag)) return new[] {flag}; throw new ArgumentException("Unsupported tag requested", nameof(tag)); default: throw new ArgumentException("Unsupported tag requested", nameof(tag)); @@ -1803,7 +1808,7 @@ namespace DiscImageChef.DiscImages public override List GetSessionTracks(ushort session) { - return this.tracks.Where(_track => _track.TrackSession == session).ToList(); + return tracks.Where(_track => _track.TrackSession == session).ToList(); } public override List GetSessions() @@ -1814,13 +1819,13 @@ namespace DiscImageChef.DiscImages public override bool? VerifySector(ulong sectorAddress) { byte[] buffer = ReadSectorLong(sectorAddress); - return Checksums.CdChecksums.CheckCdSector(buffer); + return CdChecksums.CheckCdSector(buffer); } public override bool? VerifySector(ulong sectorAddress, uint track) { byte[] buffer = ReadSectorLong(sectorAddress, track); - return Checksums.CdChecksums.CheckCdSector(buffer); + return CdChecksums.CheckCdSector(buffer); } public override bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, @@ -1835,7 +1840,7 @@ namespace DiscImageChef.DiscImages for(int i = 0; i < length; i++) { Array.Copy(buffer, i * bps, sector, 0, bps); - bool? sectorStatus = Checksums.CdChecksums.CheckCdSector(sector); + bool? sectorStatus = CdChecksums.CheckCdSector(sector); switch(sectorStatus) { @@ -1866,7 +1871,7 @@ namespace DiscImageChef.DiscImages for(int i = 0; i < length; i++) { Array.Copy(buffer, i * bps, sector, 0, bps); - bool? sectorStatus = Checksums.CdChecksums.CheckCdSector(sector); + bool? sectorStatus = CdChecksums.CheckCdSector(sector); switch(sectorStatus) { diff --git a/DiscImageChef.DiscImages/CDRDAO.cs b/DiscImageChef.DiscImages/CDRDAO.cs index e746efd86..6507a3bbe 100644 --- a/DiscImageChef.DiscImages/CDRDAO.cs +++ b/DiscImageChef.DiscImages/CDRDAO.cs @@ -36,6 +36,7 @@ using System.IO; using System.Linq; using System.Text; using System.Text.RegularExpressions; +using DiscImageChef.Checksums; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.Filters; @@ -583,7 +584,7 @@ namespace DiscImageChef.DiscImages DicConsole.DebugWriteLine("CDRDAO plugin", "Found INDEX \"{1}\" at line {0}", line, matchIndex.Groups["address"].Value); - string[] lengthString = matchFile.Groups["length"].Value.Split(new char[] {':'}); + string[] lengthString = matchFile.Groups["length"].Value.Split(':'); ulong nextIndexPos = ulong.Parse(lengthString[0]) * 60 * 75 + ulong.Parse(lengthString[1]) * 75 + ulong.Parse(lengthString[2]); currenttrack.Indexes.Add(nextindex, @@ -597,7 +598,7 @@ namespace DiscImageChef.DiscImages currenttrack.Indexes.Add(0, currenttrack.StartSector); if(matchPregap.Groups["address"].Value != "") { - string[] lengthString = matchPregap.Groups["address"].Value.Split(new char[] {':'}); + string[] lengthString = matchPregap.Groups["address"].Value.Split(':'); currenttrack.Pregap = ulong.Parse(lengthString[0]) * 60 * 75 + ulong.Parse(lengthString[1]) * 75 + ulong.Parse(lengthString[2]); } @@ -608,7 +609,7 @@ namespace DiscImageChef.DiscImages DicConsole.DebugWriteLine("CDRDAO plugin", "Found PREGAP \"{1}\" at line {0}", line, matchZeroPregap.Groups["length"].Value); currenttrack.Indexes.Add(0, currenttrack.StartSector); - string[] lengthString = matchZeroPregap.Groups["length"].Value.Split(new char[] {':'}); + string[] lengthString = matchZeroPregap.Groups["length"].Value.Split(':'); currenttrack.Pregap = ulong.Parse(lengthString[0]) * 60 * 75 + ulong.Parse(lengthString[1]) * 75 + ulong.Parse(lengthString[2]); } @@ -640,7 +641,7 @@ namespace DiscImageChef.DiscImages if(matchAudioFile.Groups["start"].Value != "") { - string[] startString = matchAudioFile.Groups["start"].Value.Split(new char[] {':'}); + string[] startString = matchAudioFile.Groups["start"].Value.Split(':'); startSectors = ulong.Parse(startString[0]) * 60 * 75 + ulong.Parse(startString[1]) * 75 + ulong.Parse(startString[2]); } @@ -649,7 +650,7 @@ namespace DiscImageChef.DiscImages if(matchAudioFile.Groups["length"].Value != "") { - string[] lengthString = matchAudioFile.Groups["length"].Value.Split(new char[] {':'}); + string[] lengthString = matchAudioFile.Groups["length"].Value.Split(':'); currenttrack.Sectors = ulong.Parse(lengthString[0]) * 60 * 75 + ulong.Parse(lengthString[1]) * 75 + ulong.Parse(lengthString[2]); } @@ -677,7 +678,7 @@ namespace DiscImageChef.DiscImages currenttrack.Trackfile.Sequence = currentTrackNumber; if(matchFile.Groups["length"].Value != "") { - string[] lengthString = matchFile.Groups["length"].Value.Split(new char[] {':'}); + string[] lengthString = matchFile.Groups["length"].Value.Split(':'); currenttrack.Sectors = ulong.Parse(lengthString[0]) * 60 * 75 + ulong.Parse(lengthString[1]) * 75 + ulong.Parse(lengthString[2]); } @@ -1560,13 +1561,13 @@ namespace DiscImageChef.DiscImages public override bool? VerifySector(ulong sectorAddress) { byte[] buffer = ReadSectorLong(sectorAddress); - return Checksums.CdChecksums.CheckCdSector(buffer); + return CdChecksums.CheckCdSector(buffer); } public override bool? VerifySector(ulong sectorAddress, uint track) { byte[] buffer = ReadSectorLong(sectorAddress, track); - return Checksums.CdChecksums.CheckCdSector(buffer); + return CdChecksums.CheckCdSector(buffer); } public override bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, @@ -1581,7 +1582,7 @@ namespace DiscImageChef.DiscImages for(int i = 0; i < length; i++) { Array.Copy(buffer, i * bps, sector, 0, bps); - bool? sectorStatus = Checksums.CdChecksums.CheckCdSector(sector); + bool? sectorStatus = CdChecksums.CheckCdSector(sector); switch(sectorStatus) { @@ -1612,7 +1613,7 @@ namespace DiscImageChef.DiscImages for(int i = 0; i < length; i++) { Array.Copy(buffer, i * bps, sector, 0, bps); - bool? sectorStatus = Checksums.CdChecksums.CheckCdSector(sector); + bool? sectorStatus = CdChecksums.CheckCdSector(sector); switch(sectorStatus) { diff --git a/DiscImageChef.DiscImages/CDRWin.cs b/DiscImageChef.DiscImages/CDRWin.cs index fe072c615..88ddce045 100644 --- a/DiscImageChef.DiscImages/CDRWin.cs +++ b/DiscImageChef.DiscImages/CDRWin.cs @@ -36,6 +36,7 @@ using System.IO; using System.Linq; using System.Text; using System.Text.RegularExpressions; +using DiscImageChef.Checksums; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.Filters; @@ -1925,13 +1926,13 @@ namespace DiscImageChef.DiscImages public override bool? VerifySector(ulong sectorAddress) { byte[] buffer = ReadSectorLong(sectorAddress); - return Checksums.CdChecksums.CheckCdSector(buffer); + return CdChecksums.CheckCdSector(buffer); } public override bool? VerifySector(ulong sectorAddress, uint track) { byte[] buffer = ReadSectorLong(sectorAddress, track); - return Checksums.CdChecksums.CheckCdSector(buffer); + return CdChecksums.CheckCdSector(buffer); } public override bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, @@ -1946,7 +1947,7 @@ namespace DiscImageChef.DiscImages for(int i = 0; i < length; i++) { Array.Copy(buffer, i * bps, sector, 0, bps); - bool? sectorStatus = Checksums.CdChecksums.CheckCdSector(sector); + bool? sectorStatus = CdChecksums.CheckCdSector(sector); switch(sectorStatus) { @@ -1977,7 +1978,7 @@ namespace DiscImageChef.DiscImages for(int i = 0; i < length; i++) { Array.Copy(buffer, i * bps, sector, 0, bps); - bool? sectorStatus = Checksums.CdChecksums.CheckCdSector(sector); + bool? sectorStatus = CdChecksums.CheckCdSector(sector); switch(sectorStatus) { diff --git a/DiscImageChef.DiscImages/CHD.cs b/DiscImageChef.DiscImages/CHD.cs index 75a7b039c..ce02b88bc 100644 --- a/DiscImageChef.DiscImages/CHD.cs +++ b/DiscImageChef.DiscImages/CHD.cs @@ -37,8 +37,10 @@ using System.Linq; using System.Runtime.InteropServices; using System.Text; using System.Text.RegularExpressions; +using DiscImageChef.Checksums; using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.Decoders.ATA; using DiscImageChef.Filters; using SharpCompress.Compressors; using SharpCompress.Compressors.Deflate; @@ -1468,7 +1470,7 @@ namespace DiscImageChef.DiscImages break; // "IDNT" case HARD_DISK_IDENT_METADATA: - Decoders.ATA.Identify.IdentifyDevice? idnt = Decoders.ATA.Identify.Decode(meta); + Identify.IdentifyDevice? idnt = Identify.Decode(meta); if(idnt.HasValue) { ImageInfo.MediaManufacturer = idnt.Value.MediaManufacturer; @@ -1775,7 +1777,7 @@ namespace DiscImageChef.DiscImages if(isHdd) return null; byte[] buffer = ReadSectorLong(sectorAddress); - return Checksums.CdChecksums.CheckCdSector(buffer); + return CdChecksums.CheckCdSector(buffer); } public override bool? VerifySector(ulong sectorAddress, uint track) @@ -1800,7 +1802,7 @@ namespace DiscImageChef.DiscImages for(int i = 0; i < length; i++) { Array.Copy(buffer, i * bps, sector, 0, bps); - bool? sectorStatus = Checksums.CdChecksums.CheckCdSector(sector); + bool? sectorStatus = CdChecksums.CheckCdSector(sector); switch(sectorStatus) { @@ -1833,7 +1835,7 @@ namespace DiscImageChef.DiscImages for(int i = 0; i < length; i++) { Array.Copy(buffer, i * bps, sector, 0, bps); - bool? sectorStatus = Checksums.CdChecksums.CheckCdSector(sector); + bool? sectorStatus = CdChecksums.CheckCdSector(sector); switch(sectorStatus) { @@ -1857,7 +1859,7 @@ namespace DiscImageChef.DiscImages byte[] calculated; if(mapVersion >= 3) { - Checksums.Sha1Context sha1Ctx = new Checksums.Sha1Context(); + Sha1Context sha1Ctx = new Sha1Context(); sha1Ctx.Init(); for(uint i = 0; i < totalHunks; i++) sha1Ctx.Update(GetHunk(i)); @@ -1865,7 +1867,7 @@ namespace DiscImageChef.DiscImages } else { - Checksums.Md5Context md5Ctx = new Checksums.Md5Context(); + Md5Context md5Ctx = new Md5Context(); md5Ctx.Init(); for(uint i = 0; i < totalHunks; i++) md5Ctx.Update(GetHunk(i)); diff --git a/DiscImageChef.DiscImages/CloneCD.cs b/DiscImageChef.DiscImages/CloneCD.cs index 15cfe9622..e9a13e760 100644 --- a/DiscImageChef.DiscImages/CloneCD.cs +++ b/DiscImageChef.DiscImages/CloneCD.cs @@ -35,11 +35,11 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Text.RegularExpressions; +using DiscImageChef.Checksums; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.Decoders.CD; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; namespace DiscImageChef.DiscImages { @@ -85,7 +85,7 @@ namespace DiscImageChef.DiscImages byte[] fulltoc; bool scrambled; string catalog; - List sessions; + List sessions; List partitions; List tracks; Stream dataStream; @@ -347,7 +347,7 @@ namespace DiscImageChef.DiscImages else if(cdtEntMatch.Success) { DicConsole.DebugWriteLine("CloneCD plugin", "Found CD-Text Entry at line {0}", line); - string[] bytes = cdtEntMatch.Groups["value"].Value.Split(new char[] {' '}, + string[] bytes = cdtEntMatch.Groups["value"].Value.Split(new[] {' '}, StringSplitOptions .RemoveEmptyEntries); foreach(string byt in bytes) cdtMs.WriteByte(Convert.ToByte(byt, 16)); @@ -739,8 +739,8 @@ namespace DiscImageChef.DiscImages if(subFilter != null && !ImageInfo.ReadableSectorTags.Contains(SectorTagType.CdSectorSubchannel)) ImageInfo.ReadableSectorTags.Add(SectorTagType.CdSectorSubchannel); - sessions = new List(); - DiscImages.Session currentSession = new DiscImages.Session(); + sessions = new List(); + Session currentSession = new Session(); currentSession.EndTrack = uint.MinValue; currentSession.StartTrack = uint.MaxValue; currentSession.SessionSequence = 1; @@ -766,7 +766,7 @@ namespace DiscImageChef.DiscImages else { sessions.Add(currentSession); - currentSession = new DiscImages.Session(); + currentSession = new Session(); currentSession.EndTrack = uint.MinValue; currentSession.StartTrack = uint.MaxValue; currentSession.SessionSequence = track.TrackSession; @@ -1404,7 +1404,7 @@ namespace DiscImageChef.DiscImages return tracks; } - public override List GetSessionTracks(DiscImages.Session session) + public override List GetSessionTracks(Session session) { if(sessions.Contains(session)) return GetSessionTracks(session.SessionSequence); @@ -1413,10 +1413,10 @@ namespace DiscImageChef.DiscImages public override List GetSessionTracks(ushort session) { - return this.tracks.Where(_track => _track.TrackSession == session).ToList(); + return tracks.Where(_track => _track.TrackSession == session).ToList(); } - public override List GetSessions() + public override List GetSessions() { return sessions; } @@ -1424,13 +1424,13 @@ namespace DiscImageChef.DiscImages public override bool? VerifySector(ulong sectorAddress) { byte[] buffer = ReadSectorLong(sectorAddress); - return Checksums.CdChecksums.CheckCdSector(buffer); + return CdChecksums.CheckCdSector(buffer); } public override bool? VerifySector(ulong sectorAddress, uint track) { byte[] buffer = ReadSectorLong(sectorAddress, track); - return Checksums.CdChecksums.CheckCdSector(buffer); + return CdChecksums.CheckCdSector(buffer); } public override bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, @@ -1445,7 +1445,7 @@ namespace DiscImageChef.DiscImages for(int i = 0; i < length; i++) { Array.Copy(buffer, i * bps, sector, 0, bps); - bool? sectorStatus = Checksums.CdChecksums.CheckCdSector(sector); + bool? sectorStatus = CdChecksums.CheckCdSector(sector); switch(sectorStatus) { @@ -1476,7 +1476,7 @@ namespace DiscImageChef.DiscImages for(int i = 0; i < length; i++) { Array.Copy(buffer, i * bps, sector, 0, bps); - bool? sectorStatus = Checksums.CdChecksums.CheckCdSector(sector); + bool? sectorStatus = CdChecksums.CheckCdSector(sector); switch(sectorStatus) { diff --git a/DiscImageChef.DiscImages/DART.cs b/DiscImageChef.DiscImages/DART.cs index 0187bcf71..f36005744 100644 --- a/DiscImageChef.DiscImages/DART.cs +++ b/DiscImageChef.DiscImages/DART.cs @@ -40,7 +40,7 @@ using Claunia.RsrcFork; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; +using Version = Resources.Version; namespace DiscImageChef.DiscImages { @@ -295,7 +295,7 @@ namespace DiscImageChef.DiscImages if(vers != null) { - Resources.Version version = new Resources.Version(vers); + Version version = new Version(vers); string major; string minor; @@ -309,13 +309,13 @@ namespace DiscImageChef.DiscImages release = string.Format(".{0}", version.MinorVersion % 10); switch(version.DevStage) { - case Resources.Version.DevelopmentStage.Alpha: + case Version.DevelopmentStage.Alpha: dev = "a"; break; - case Resources.Version.DevelopmentStage.Beta: + case Version.DevelopmentStage.Beta: dev = "b"; break; - case Resources.Version.DevelopmentStage.PreAlpha: + case Version.DevelopmentStage.PreAlpha: dev = "d"; break; } diff --git a/DiscImageChef.DiscImages/DiscJuggler.cs b/DiscImageChef.DiscImages/DiscJuggler.cs index 8d208ee68..2346b5a04 100644 --- a/DiscImageChef.DiscImages/DiscJuggler.cs +++ b/DiscImageChef.DiscImages/DiscJuggler.cs @@ -35,10 +35,10 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; +using DiscImageChef.Checksums; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; namespace DiscImageChef.DiscImages { @@ -848,7 +848,7 @@ namespace DiscImageChef.DiscImages case SectorTagType.CdSectorSync: break; case SectorTagType.CdTrackFlags: byte flag; - if(trackFlags.TryGetValue(track, out flag)) return new byte[] {flag}; + if(trackFlags.TryGetValue(track, out flag)) return new[] {flag}; throw new ArgumentException("Unsupported tag requested", nameof(tag)); default: throw new ArgumentException("Unsupported tag requested", nameof(tag)); @@ -1224,13 +1224,13 @@ namespace DiscImageChef.DiscImages public override bool? VerifySector(ulong sectorAddress) { byte[] buffer = ReadSectorLong(sectorAddress); - return Checksums.CdChecksums.CheckCdSector(buffer); + return CdChecksums.CheckCdSector(buffer); } public override bool? VerifySector(ulong sectorAddress, uint track) { byte[] buffer = ReadSectorLong(sectorAddress, track); - return Checksums.CdChecksums.CheckCdSector(buffer); + return CdChecksums.CheckCdSector(buffer); } public override bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, @@ -1245,7 +1245,7 @@ namespace DiscImageChef.DiscImages for(int i = 0; i < length; i++) { Array.Copy(buffer, i * bps, sector, 0, bps); - bool? sectorStatus = Checksums.CdChecksums.CheckCdSector(sector); + bool? sectorStatus = CdChecksums.CheckCdSector(sector); switch(sectorStatus) { @@ -1276,7 +1276,7 @@ namespace DiscImageChef.DiscImages for(int i = 0; i < length; i++) { Array.Copy(buffer, i * bps, sector, 0, bps); - bool? sectorStatus = Checksums.CdChecksums.CheckCdSector(sector); + bool? sectorStatus = CdChecksums.CheckCdSector(sector); switch(sectorStatus) { diff --git a/DiscImageChef.DiscImages/DiskCopy42.cs b/DiscImageChef.DiscImages/DiskCopy42.cs index 16a5ebeb5..0f083508d 100644 --- a/DiscImageChef.DiscImages/DiskCopy42.cs +++ b/DiscImageChef.DiscImages/DiskCopy42.cs @@ -39,6 +39,7 @@ using Claunia.RsrcFork; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.Filters; +using Version = Resources.Version; namespace DiscImageChef.DiscImages { @@ -406,8 +407,8 @@ namespace DiscImageChef.DiscImages tagstream.Seek(tagOffset, SeekOrigin.Begin); tagstream.Read(tags, 0, (int)header.TagSize); - ushort mfsMagic = BigEndianBitConverter.ToUInt16(data, (int)(data.Length / 2 + 0x400)); - ushort mfsAllBlocks = BigEndianBitConverter.ToUInt16(data, (int)(data.Length / 2 + 0x412)); + ushort mfsMagic = BigEndianBitConverter.ToUInt16(data, data.Length / 2 + 0x400); + ushort mfsAllBlocks = BigEndianBitConverter.ToUInt16(data, data.Length / 2 + 0x412); // Detect a Macintosh Twiggy if(mfsMagic == 0xD2D7 && mfsAllBlocks == 422) @@ -463,7 +464,7 @@ namespace DiscImageChef.DiscImages if(vers != null) { - Resources.Version version = new Resources.Version(vers); + Version version = new Version(vers); string major; string minor; @@ -477,13 +478,13 @@ namespace DiscImageChef.DiscImages release = string.Format(".{0}", version.MinorVersion % 10); switch(version.DevStage) { - case Resources.Version.DevelopmentStage.Alpha: + case Version.DevelopmentStage.Alpha: dev = "a"; break; - case Resources.Version.DevelopmentStage.Beta: + case Version.DevelopmentStage.Beta: dev = "b"; break; - case Resources.Version.DevelopmentStage.PreAlpha: + case Version.DevelopmentStage.PreAlpha: dev = "d"; break; } diff --git a/DiscImageChef.DiscImages/GDI.cs b/DiscImageChef.DiscImages/GDI.cs index 498d4b243..a74ba1192 100644 --- a/DiscImageChef.DiscImages/GDI.cs +++ b/DiscImageChef.DiscImages/GDI.cs @@ -35,6 +35,7 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Text.RegularExpressions; +using DiscImageChef.Checksums; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.Filters; @@ -255,7 +256,7 @@ namespace DiscImageChef.DiscImages currentTrack.Trackfilter = filtersList.GetFilter(Path.Combine(imageFilter.GetParentFolder(), trackMatch.Groups["filename"].Value.Replace("\\\"", "\"") - .Trim(new[] {'"'}))); + .Trim('"'))); currentTrack.Trackfile = currentTrack.Trackfilter.GetFilename(); if(currentTrack.StartSector - currentStart > 0) @@ -1031,13 +1032,13 @@ namespace DiscImageChef.DiscImages public override bool? VerifySector(ulong sectorAddress) { byte[] buffer = ReadSectorLong(sectorAddress); - return Checksums.CdChecksums.CheckCdSector(buffer); + return CdChecksums.CheckCdSector(buffer); } public override bool? VerifySector(ulong sectorAddress, uint track) { byte[] buffer = ReadSectorLong(sectorAddress, track); - return Checksums.CdChecksums.CheckCdSector(buffer); + return CdChecksums.CheckCdSector(buffer); } public override bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, @@ -1052,7 +1053,7 @@ namespace DiscImageChef.DiscImages for(int i = 0; i < length; i++) { Array.Copy(buffer, i * bps, sector, 0, bps); - bool? sectorStatus = Checksums.CdChecksums.CheckCdSector(sector); + bool? sectorStatus = CdChecksums.CheckCdSector(sector); switch(sectorStatus) { @@ -1083,7 +1084,7 @@ namespace DiscImageChef.DiscImages for(int i = 0; i < length; i++) { Array.Copy(buffer, i * bps, sector, 0, bps); - bool? sectorStatus = Checksums.CdChecksums.CheckCdSector(sector); + bool? sectorStatus = CdChecksums.CheckCdSector(sector); switch(sectorStatus) { diff --git a/DiscImageChef.DiscImages/HDCopy.cs b/DiscImageChef.DiscImages/HDCopy.cs index 0e24c1a10..0684837c3 100644 --- a/DiscImageChef.DiscImages/HDCopy.cs +++ b/DiscImageChef.DiscImages/HDCopy.cs @@ -153,7 +153,7 @@ namespace DiscImageChef.DiscImages /// /// The ImageFilter we're reading from, after the file has been opened /// - Filter hdcpImageFilter = null; + Filter hdcpImageFilter; #endregion #region Internal constants diff --git a/DiscImageChef.DiscImages/ImagePlugin.cs b/DiscImageChef.DiscImages/ImagePlugin.cs index af48abcde..b227ce9f8 100644 --- a/DiscImageChef.DiscImages/ImagePlugin.cs +++ b/DiscImageChef.DiscImages/ImagePlugin.cs @@ -32,6 +32,7 @@ using System; using System.Collections.Generic; +using System.Runtime.Serialization; using DiscImageChef.CommonTypes; using DiscImageChef.Filters; @@ -49,8 +50,6 @@ namespace DiscImageChef.DiscImages /// Image information public ImageInfo ImageInfo; - protected ImagePlugin() { } - // Basic image handling functions /// @@ -744,8 +743,8 @@ namespace DiscImageChef.DiscImages /// /// Info. /// Context. - protected FeatureSupportedButNotImplementedImageException(System.Runtime.Serialization.SerializationInfo info, - System.Runtime.Serialization.StreamingContext context) + protected FeatureSupportedButNotImplementedImageException(SerializationInfo info, + StreamingContext context) { if(info == null) throw new ArgumentNullException(nameof(info)); } @@ -775,8 +774,8 @@ namespace DiscImageChef.DiscImages /// /// Info. /// Context. - protected FeatureUnsupportedImageException(System.Runtime.Serialization.SerializationInfo info, - System.Runtime.Serialization.StreamingContext context) + protected FeatureUnsupportedImageException(SerializationInfo info, + StreamingContext context) { if(info == null) throw new ArgumentNullException(nameof(info)); } @@ -806,8 +805,8 @@ namespace DiscImageChef.DiscImages /// /// Info. /// Context. - protected FeatureNotPresentImageException(System.Runtime.Serialization.SerializationInfo info, - System.Runtime.Serialization.StreamingContext context) + protected FeatureNotPresentImageException(SerializationInfo info, + StreamingContext context) { if(info == null) throw new ArgumentNullException(nameof(info)); } @@ -837,8 +836,8 @@ namespace DiscImageChef.DiscImages /// /// Info. /// Context. - protected FeaturedNotSupportedByDiscImageException(System.Runtime.Serialization.SerializationInfo info, - System.Runtime.Serialization.StreamingContext context) + protected FeaturedNotSupportedByDiscImageException(SerializationInfo info, + StreamingContext context) { if(info == null) throw new ArgumentNullException(nameof(info)); } @@ -868,8 +867,8 @@ namespace DiscImageChef.DiscImages /// /// Info. /// Context. - protected ImageNotSupportedException(System.Runtime.Serialization.SerializationInfo info, - System.Runtime.Serialization.StreamingContext context) + protected ImageNotSupportedException(SerializationInfo info, + StreamingContext context) { if(info == null) throw new ArgumentNullException(nameof(info)); } diff --git a/DiscImageChef.DiscImages/NDIF.cs b/DiscImageChef.DiscImages/NDIF.cs index d43169dc5..3637ef783 100644 --- a/DiscImageChef.DiscImages/NDIF.cs +++ b/DiscImageChef.DiscImages/NDIF.cs @@ -40,9 +40,9 @@ using Claunia.RsrcFork; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using SharpCompress.Compressors; using SharpCompress.Compressors.ADC; +using Version = Resources.Version; namespace DiscImageChef.DiscImages { @@ -374,7 +374,7 @@ namespace DiscImageChef.DiscImages { byte[] vers = versRsrc.GetResource(versRsrc.GetIds()[0]); - Resources.Version version = new Resources.Version(vers); + Version version = new Version(vers); string major; string minor; @@ -387,13 +387,13 @@ namespace DiscImageChef.DiscImages if(version.MinorVersion % 10 > 0) release = string.Format(".{0}", version.MinorVersion % 10); switch(version.DevStage) { - case Resources.Version.DevelopmentStage.Alpha: + case Version.DevelopmentStage.Alpha: dev = "a"; break; - case Resources.Version.DevelopmentStage.Beta: + case Version.DevelopmentStage.Beta: dev = "b"; break; - case Resources.Version.DevelopmentStage.PreAlpha: + case Version.DevelopmentStage.PreAlpha: dev = "d"; break; } diff --git a/DiscImageChef.DiscImages/Nero.cs b/DiscImageChef.DiscImages/Nero.cs index f8dbf4f29..1d6cc93c3 100644 --- a/DiscImageChef.DiscImages/Nero.cs +++ b/DiscImageChef.DiscImages/Nero.cs @@ -34,6 +34,8 @@ using System; using System.Collections.Generic; using System.IO; using System.Linq; +using System.Text; +using DiscImageChef.Checksums; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.Filters; @@ -931,11 +933,11 @@ namespace DiscImageChef.DiscImages DicConsole.DebugWriteLine("Nero plugin", "imageStream.Length = {0}", imageStream.Length); DicConsole.DebugWriteLine("Nero plugin", "footerV1.ChunkID = 0x{0:X8} (\"{1}\")", footerV1.ChunkId, - System.Text.Encoding.ASCII + Encoding.ASCII .GetString(BigEndianBitConverter.GetBytes(footerV1.ChunkId))); DicConsole.DebugWriteLine("Nero plugin", "footerV1.FirstChunkOffset = {0}", footerV1.FirstChunkOffset); DicConsole.DebugWriteLine("Nero plugin", "footerV2.ChunkID = 0x{0:X8} (\"{1}\")", footerV2.ChunkId, - System.Text.Encoding.ASCII + Encoding.ASCII .GetString(BigEndianBitConverter.GetBytes(footerV2.ChunkId))); DicConsole.DebugWriteLine("Nero plugin", "footerV2.FirstChunkOffset = {0}", footerV2.FirstChunkOffset); @@ -974,7 +976,7 @@ namespace DiscImageChef.DiscImages chunkLength = BigEndianBitConverter.ToUInt32(chunkHeaderBuffer, 4); DicConsole.DebugWriteLine("Nero plugin", "ChunkID = 0x{0:X8} (\"{1}\")", chunkId, - System.Text.Encoding.ASCII + Encoding.ASCII .GetString(BigEndianBitConverter.GetBytes(chunkId))); DicConsole.DebugWriteLine("Nero plugin", "ChunkLength = {0}", chunkLength); @@ -1517,7 +1519,7 @@ namespace DiscImageChef.DiscImages default: { DicConsole.DebugWriteLine("Nero plugin", "Unknown chunk ID \"{0}\", skipping...", - System.Text.Encoding.ASCII.GetString(BigEndianBitConverter + Encoding.ASCII.GetString(BigEndianBitConverter .GetBytes(chunkId))); imageStream.Seek(chunkLength, SeekOrigin.Current); break; @@ -2343,13 +2345,13 @@ namespace DiscImageChef.DiscImages public override bool? VerifySector(ulong sectorAddress) { byte[] buffer = ReadSectorLong(sectorAddress); - return Checksums.CdChecksums.CheckCdSector(buffer); + return CdChecksums.CheckCdSector(buffer); } public override bool? VerifySector(ulong sectorAddress, uint track) { byte[] buffer = ReadSectorLong(sectorAddress, track); - return Checksums.CdChecksums.CheckCdSector(buffer); + return CdChecksums.CheckCdSector(buffer); } public override bool? VerifySectors(ulong sectorAddress, uint length, out List failingLbas, @@ -2364,7 +2366,7 @@ namespace DiscImageChef.DiscImages for(int i = 0; i < length; i++) { Array.Copy(buffer, i * bps, sector, 0, bps); - bool? sectorStatus = Checksums.CdChecksums.CheckCdSector(sector); + bool? sectorStatus = CdChecksums.CheckCdSector(sector); switch(sectorStatus) { @@ -2395,7 +2397,7 @@ namespace DiscImageChef.DiscImages for(int i = 0; i < length; i++) { Array.Copy(buffer, i * bps, sector, 0, bps); - bool? sectorStatus = Checksums.CdChecksums.CheckCdSector(sector); + bool? sectorStatus = CdChecksums.CheckCdSector(sector); switch(sectorStatus) { diff --git a/DiscImageChef.DiscImages/Parallels.cs b/DiscImageChef.DiscImages/Parallels.cs index 943506a2b..4a89a4559 100644 --- a/DiscImageChef.DiscImages/Parallels.cs +++ b/DiscImageChef.DiscImages/Parallels.cs @@ -38,7 +38,6 @@ using System.Runtime.InteropServices; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; namespace DiscImageChef.DiscImages { diff --git a/DiscImageChef.DiscImages/PartClone.cs b/DiscImageChef.DiscImages/PartClone.cs index 8f58e507d..b54e4acf1 100644 --- a/DiscImageChef.DiscImages/PartClone.cs +++ b/DiscImageChef.DiscImages/PartClone.cs @@ -38,7 +38,6 @@ using System.Runtime.InteropServices; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using Extents; namespace DiscImageChef.DiscImages diff --git a/DiscImageChef.DiscImages/Partimage.cs b/DiscImageChef.DiscImages/Partimage.cs index 077d56247..3c8a4fd17 100644 --- a/DiscImageChef.DiscImages/Partimage.cs +++ b/DiscImageChef.DiscImages/Partimage.cs @@ -38,7 +38,6 @@ using System.Runtime.InteropServices; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using Extents; namespace DiscImageChef.DiscImages @@ -508,7 +507,7 @@ namespace DiscImageChef.DiscImages DateTime start = DateTime.Now; extents = new ExtentsULong(); extentsOff = new Dictionary(); - bool current = (bitmap[0] & (1 << (int)(0 % 8))) != 0; + bool current = (bitmap[0] & (1 << 0 % 8)) != 0; ulong blockOff = 0; ulong extentStart = 0; diff --git a/DiscImageChef.DiscImages/TeleDisk.cs b/DiscImageChef.DiscImages/TeleDisk.cs index faf579d0f..09c9e1830 100644 --- a/DiscImageChef.DiscImages/TeleDisk.cs +++ b/DiscImageChef.DiscImages/TeleDisk.cs @@ -38,6 +38,7 @@ using System; using System.Collections.Generic; using System.IO; +using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.Filters; @@ -419,7 +420,7 @@ namespace DiscImageChef.DiscImages // Replace NULLs, used by TeleDisk as newline markers, with UNIX newline marker if(commentBlock[i] == 0x00) commentBlock[i] = 0x0A; - ImageInfo.ImageComments = System.Text.Encoding.ASCII.GetString(commentBlock); + ImageInfo.ImageComments = Encoding.ASCII.GetString(commentBlock); DicConsole.DebugWriteLine("TeleDisk plugin", "Comment"); DicConsole.DebugWriteLine("TeleDisk plugin", "{0}", ImageInfo.ImageComments); @@ -1454,7 +1455,7 @@ namespace DiscImageChef.DiscImages getbuf <<= 8; getlen -= 8; i = (ushort)(i >> 8); - return (int)i; + return i; } /* initialize freq tree */ diff --git a/DiscImageChef.DiscImages/UDIF.cs b/DiscImageChef.DiscImages/UDIF.cs index 77c3af1d5..ae157321c 100644 --- a/DiscImageChef.DiscImages/UDIF.cs +++ b/DiscImageChef.DiscImages/UDIF.cs @@ -40,10 +40,11 @@ using Claunia.RsrcFork; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; -using SharpCompress.Compressors; +using Ionic.Zlib; using SharpCompress.Compressors.ADC; using SharpCompress.Compressors.BZip2; +using CompressionMode = SharpCompress.Compressors.CompressionMode; +using Version = Resources.Version; namespace DiscImageChef.DiscImages { @@ -359,7 +360,7 @@ namespace DiscImageChef.DiscImages if(vers != null) { - Resources.Version version = new Resources.Version(vers); + Version version = new Version(vers); string major; string minor; @@ -372,13 +373,13 @@ namespace DiscImageChef.DiscImages if(version.MinorVersion % 10 > 0) release = string.Format(".{0}", version.MinorVersion % 10); switch(version.DevStage) { - case Resources.Version.DevelopmentStage.Alpha: + case Version.DevelopmentStage.Alpha: dev = "a"; break; - case Resources.Version.DevelopmentStage.Beta: + case Version.DevelopmentStage.Beta: dev = "b"; break; - case Resources.Version.DevelopmentStage.PreAlpha: + case Version.DevelopmentStage.PreAlpha: dev = "d"; break; } @@ -549,7 +550,7 @@ namespace DiscImageChef.DiscImages switch(currentChunk.type) { case CHUNK_TYPE_ADC: decStream = new ADCStream(cmpMs, CompressionMode.Decompress); break; - case CHUNK_TYPE_ZLIB: decStream = new Ionic.Zlib.ZlibStream(cmpMs, Ionic.Zlib.CompressionMode.Decompress); + case CHUNK_TYPE_ZLIB: decStream = new ZlibStream(cmpMs, Ionic.Zlib.CompressionMode.Decompress); break; case CHUNK_TYPE_BZIP: decStream = new BZip2Stream(cmpMs, CompressionMode.Decompress); break; @@ -578,7 +579,7 @@ namespace DiscImageChef.DiscImages currentChunkCacheSize += (uint)realSize; #if DEBUG } - catch(Ionic.Zlib.ZlibException) + catch(ZlibException) { DicConsole.WriteLine("zlib exception on chunk starting at sector {0}", currentChunk.sector); throw; diff --git a/DiscImageChef.DiscImages/VDI.cs b/DiscImageChef.DiscImages/VDI.cs index 6231f2e1f..69e9c31ff 100644 --- a/DiscImageChef.DiscImages/VDI.cs +++ b/DiscImageChef.DiscImages/VDI.cs @@ -37,7 +37,6 @@ using System.Runtime.InteropServices; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; namespace DiscImageChef.DiscImages { diff --git a/DiscImageChef.DiscImages/VHD.cs b/DiscImageChef.DiscImages/VHD.cs index 880d4ec79..422461627 100644 --- a/DiscImageChef.DiscImages/VHD.cs +++ b/DiscImageChef.DiscImages/VHD.cs @@ -36,6 +36,7 @@ using System.IO; using System.Linq; using System.Runtime.InteropServices; using System.Text; +using DiscImageChef.Checksums; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.Filters; @@ -494,7 +495,7 @@ namespace DiscImageChef.DiscImages thisDateTime = new DateTime(2000, 1, 1, 0, 0, 0, DateTimeKind.Utc); thisDateTime = thisDateTime.AddSeconds(thisFooter.Timestamp); - Checksums.Sha1Context sha1Ctx = new Checksums.Sha1Context(); + Sha1Context sha1Ctx = new Sha1Context(); sha1Ctx.Init(); sha1Ctx.Update(thisFooter.Reserved); @@ -720,7 +721,7 @@ namespace DiscImageChef.DiscImages parentDateTime = new DateTime(2000, 1, 1, 0, 0, 0, DateTimeKind.Utc); parentDateTime = parentDateTime.AddSeconds(thisDynamic.ParentTimestamp); - sha1Ctx = new Checksums.Sha1Context(); + sha1Ctx = new Sha1Context(); sha1Ctx.Init(); sha1Ctx.Update(thisDynamic.Reserved2); diff --git a/DiscImageChef.DiscImages/VHDX.cs b/DiscImageChef.DiscImages/VHDX.cs index 84de6fb78..5584f3089 100644 --- a/DiscImageChef.DiscImages/VHDX.cs +++ b/DiscImageChef.DiscImages/VHDX.cs @@ -620,7 +620,7 @@ namespace DiscImageChef.DiscImages parentWorks = true; break; } - catch { continue; } + catch { } } else if(string.Compare(entryType, VOLUME_PATH_KEY, StringComparison.OrdinalIgnoreCase) == 0 || string.Compare(entryType, ABSOLUTE_WIN32_PATH_KEY, StringComparison.OrdinalIgnoreCase) == 0) @@ -639,7 +639,7 @@ namespace DiscImageChef.DiscImages parentWorks = true; break; } - catch { continue; } + catch { } } } diff --git a/DiscImageChef.DiscImages/VMware.cs b/DiscImageChef.DiscImages/VMware.cs index 61819707b..595f42765 100644 --- a/DiscImageChef.DiscImages/VMware.cs +++ b/DiscImageChef.DiscImages/VMware.cs @@ -39,7 +39,6 @@ using System.Text.RegularExpressions; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; namespace DiscImageChef.DiscImages { diff --git a/DiscImageChef.Filesystems/AODOS.cs b/DiscImageChef.Filesystems/AODOS.cs index 8a8bd063d..85a9406b5 100644 --- a/DiscImageChef.Filesystems/AODOS.cs +++ b/DiscImageChef.Filesystems/AODOS.cs @@ -36,6 +36,8 @@ using System.Linq; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -57,7 +59,7 @@ namespace DiscImageChef.Filesystems CurrentEncoding = Encoding.GetEncoding("koi8-r"); } - public AODOS(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public AODOS(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "Alexander Osipov DOS file system"; PluginUUID = new Guid("668E5039-9DDD-442A-BE1B-A315D6E38E26"); @@ -99,7 +101,7 @@ namespace DiscImageChef.Filesystems readonly byte[] AODOSIdentifier = {0x20, 0x41, 0x4F, 0x2D, 0x44, 0x4F, 0x53, 0x20}; - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { // Does AO-DOS support hard disks? if(partition.Start > 0) return false; @@ -122,7 +124,7 @@ namespace DiscImageChef.Filesystems return bb.identifier.SequenceEqual(AODOSIdentifier); } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { byte[] sector; @@ -138,7 +140,7 @@ namespace DiscImageChef.Filesystems sbInformation.AppendLine("Alexander Osipov DOS file system"); - xmlFSType = new Schemas.FileSystemType + xmlFSType = new FileSystemType { Type = "Alexander Osipov DOS file system", Clusters = (long)imagePlugin.ImageInfo.Sectors, diff --git a/DiscImageChef.Filesystems/APFS.cs b/DiscImageChef.Filesystems/APFS.cs index 3787e403c..e5299cc1b 100644 --- a/DiscImageChef.Filesystems/APFS.cs +++ b/DiscImageChef.Filesystems/APFS.cs @@ -35,6 +35,8 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -57,7 +59,7 @@ namespace DiscImageChef.Filesystems CurrentEncoding = Encoding.UTF8; } - public APFS(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public APFS(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "Apple File System"; PluginUUID = new Guid("A4060F9D-2909-42E2-9D95-DB31FA7EA797"); @@ -76,7 +78,7 @@ namespace DiscImageChef.Filesystems public ulong containerBlocks; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(partition.Start >= partition.End) return false; @@ -97,11 +99,11 @@ namespace DiscImageChef.Filesystems return false; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { StringBuilder sbInformation = new StringBuilder(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); information = ""; if(partition.Start >= partition.End) return; @@ -128,7 +130,7 @@ namespace DiscImageChef.Filesystems information = sbInformation.ToString(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.Bootable = false; xmlFSType.Clusters = (long)nxSb.containerBlocks; xmlFSType.ClusterSize = (int)nxSb.blockSize; diff --git a/DiscImageChef.Filesystems/Acorn.cs b/DiscImageChef.Filesystems/Acorn.cs index 2138690cd..a781a5a73 100644 --- a/DiscImageChef.Filesystems/Acorn.cs +++ b/DiscImageChef.Filesystems/Acorn.cs @@ -36,6 +36,8 @@ using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -81,7 +83,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public AcornADFS(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public AcornADFS(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "Acorn Advanced Disc Filing System"; PluginUUID = new Guid("BAFC1E50-9C64-4CD3-8400-80628CC27AFA"); @@ -259,7 +261,7 @@ namespace DiscImageChef.Filesystems } // TODO: BBC Master hard disks are untested... - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(partition.Start >= partition.End) return false; @@ -430,11 +432,11 @@ namespace DiscImageChef.Filesystems // TODO: Find root directory on volumes with DiscRecord // TODO: Support big directories (ADFS-G?) // TODO: Find the real freemap on volumes with DiscRecord, as DiscRecord's discid may be empty but this one isn't - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { StringBuilder sbInformation = new StringBuilder(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); information = ""; ulong sbSector; @@ -486,7 +488,7 @@ namespace DiscImageChef.Filesystems namebytes[i * 2 + 1] = oldMap1.name[i]; } - xmlFSType = new Schemas.FileSystemType + xmlFSType = new FileSystemType { Bootable = oldMap1.boot != 0, // Or not? Clusters = (long)(bytes / imagePlugin.ImageInfo.SectorSize), @@ -646,7 +648,7 @@ namespace DiscImageChef.Filesystems if(bytes > imagePlugin.GetSectors() * imagePlugin.GetSectorSize()) return; - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); sbInformation.AppendLine("Acorn Advanced Disc Filing System"); sbInformation.AppendLine(); diff --git a/DiscImageChef.Filesystems/AmigaDOS.cs b/DiscImageChef.Filesystems/AmigaDOS.cs index a1a0e486e..92864bde2 100644 --- a/DiscImageChef.Filesystems/AmigaDOS.cs +++ b/DiscImageChef.Filesystems/AmigaDOS.cs @@ -35,8 +35,11 @@ using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; +using DiscImageChef.Checksums; using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -57,7 +60,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public AmigaDOSPlugin(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public AmigaDOSPlugin(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "Amiga DOS filesystem"; PluginUUID = new Guid("3c882400-208c-427d-a086-9119852a1bc7"); @@ -209,7 +212,7 @@ namespace DiscImageChef.Filesystems public const uint TypeHeader = 2; public const uint SubTypeRoot = 1; - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(partition.Start >= partition.End) return false; @@ -304,11 +307,11 @@ namespace DiscImageChef.Filesystems return false; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { StringBuilder sbInformation = new StringBuilder(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); information = null; BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian; @@ -437,7 +440,7 @@ namespace DiscImageChef.Filesystems if(bootBlk.checksum == bsum) { - Checksums.Sha1Context sha1Ctx = new Checksums.Sha1Context(); + Sha1Context sha1Ctx = new Sha1Context(); sha1Ctx.Init(); sha1Ctx.Update(bootBlk.bootCode); sbInformation.AppendLine("Volume is bootable"); diff --git a/DiscImageChef.Filesystems/AppleDOS/AppleDOS.cs b/DiscImageChef.Filesystems/AppleDOS/AppleDOS.cs index 078fdca89..c544df403 100644 --- a/DiscImageChef.Filesystems/AppleDOS/AppleDOS.cs +++ b/DiscImageChef.Filesystems/AppleDOS/AppleDOS.cs @@ -32,9 +32,10 @@ using System; using System.Collections.Generic; -using System.Text; +using Claunia.Encoding; using DiscImageChef.CommonTypes; using DiscImageChef.DiscImages; +using Encoding = System.Text.Encoding; namespace DiscImageChef.Filesystems.AppleDOS { @@ -77,7 +78,7 @@ namespace DiscImageChef.Filesystems.AppleDOS { Name = "Apple DOS File System"; PluginUUID = new Guid("8658A1E9-B2E7-4BCC-9638-157A31B0A700\n"); - CurrentEncoding = new Claunia.Encoding.LisaRoman(); + CurrentEncoding = new LisaRoman(); } public AppleDOS(Encoding encoding) @@ -85,7 +86,7 @@ namespace DiscImageChef.Filesystems.AppleDOS Name = "Apple DOS File System"; PluginUUID = new Guid("8658A1E9-B2E7-4BCC-9638-157A31B0A700\n"); // TODO: Until Apple ][ encoding is implemented - CurrentEncoding = new Claunia.Encoding.LisaRoman(); + CurrentEncoding = new LisaRoman(); } public AppleDOS(ImagePlugin imagePlugin, Partition partition, Encoding encoding) @@ -95,7 +96,7 @@ namespace DiscImageChef.Filesystems.AppleDOS Name = "Apple DOS File System"; PluginUUID = new Guid("8658A1E9-B2E7-4BCC-9638-157A31B0A700\n"); // TODO: Until Apple ][ encoding is implemented - CurrentEncoding = new Claunia.Encoding.LisaRoman(); + CurrentEncoding = new LisaRoman(); } } } \ No newline at end of file diff --git a/DiscImageChef.Filesystems/AppleDOS/File.cs b/DiscImageChef.Filesystems/AppleDOS/File.cs index 521ca4134..c6e43cee5 100644 --- a/DiscImageChef.Filesystems/AppleDOS/File.cs +++ b/DiscImageChef.Filesystems/AppleDOS/File.cs @@ -43,7 +43,7 @@ namespace DiscImageChef.Filesystems.AppleDOS { if(!mounted) return Errno.AccessDenied; - string[] pathElements = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return Errno.NotSupported; string filename = pathElements[0].ToUpperInvariant(); @@ -66,7 +66,7 @@ namespace DiscImageChef.Filesystems.AppleDOS { if(!mounted) return Errno.AccessDenied; - string[] pathElements = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return Errno.NotSupported; byte[] file; @@ -108,7 +108,7 @@ namespace DiscImageChef.Filesystems.AppleDOS { if(!mounted) return Errno.AccessDenied; - string[] pathElements = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return Errno.NotSupported; string filename = pathElements[0].ToUpperInvariant(); @@ -160,7 +160,7 @@ namespace DiscImageChef.Filesystems.AppleDOS Errno CacheFile(string path) { - string[] pathElements = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return Errno.NotSupported; string filename = pathElements[0].ToUpperInvariant(); diff --git a/DiscImageChef.Filesystems/AppleDOS/Info.cs b/DiscImageChef.Filesystems/AppleDOS/Info.cs index b6f914fed..c27c30e5a 100644 --- a/DiscImageChef.Filesystems/AppleDOS/Info.cs +++ b/DiscImageChef.Filesystems/AppleDOS/Info.cs @@ -35,6 +35,7 @@ using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems.AppleDOS { @@ -92,13 +93,11 @@ namespace DiscImageChef.Filesystems.AppleDOS information = sb.ToString(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.Bootable = true; xmlFSType.Clusters = (long)imagePlugin.ImageInfo.Sectors; xmlFSType.ClusterSize = (int)imagePlugin.ImageInfo.SectorSize; xmlFSType.Type = "Apple DOS"; - - return; } } } \ No newline at end of file diff --git a/DiscImageChef.Filesystems/AppleDOS/Super.cs b/DiscImageChef.Filesystems/AppleDOS/Super.cs index 1e00386c4..505115ba9 100644 --- a/DiscImageChef.Filesystems/AppleDOS/Super.cs +++ b/DiscImageChef.Filesystems/AppleDOS/Super.cs @@ -33,6 +33,7 @@ using System; using System.Runtime.InteropServices; using DiscImageChef.Console; +using Schemas; namespace DiscImageChef.Filesystems.AppleDOS { @@ -101,7 +102,7 @@ namespace DiscImageChef.Filesystems.AppleDOS } // Create XML metadata for mounted filesystem - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.Bootable = true; xmlFSType.Clusters = (long)device.ImageInfo.Sectors; xmlFSType.ClusterSize = vtoc.bytesPerSector; diff --git a/DiscImageChef.Filesystems/AppleDOS/Xattr.cs b/DiscImageChef.Filesystems/AppleDOS/Xattr.cs index 066f6619b..f95fe7fbd 100644 --- a/DiscImageChef.Filesystems/AppleDOS/Xattr.cs +++ b/DiscImageChef.Filesystems/AppleDOS/Xattr.cs @@ -47,7 +47,7 @@ namespace DiscImageChef.Filesystems.AppleDOS { if(!mounted) return Errno.AccessDenied; - string[] pathElements = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return Errno.NotSupported; string filename = pathElements[0].ToUpperInvariant(); @@ -81,7 +81,7 @@ namespace DiscImageChef.Filesystems.AppleDOS { if(!mounted) return Errno.AccessDenied; - string[] pathElements = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return Errno.NotSupported; string filename = pathElements[0].ToUpperInvariant(); diff --git a/DiscImageChef.Filesystems/AppleHFS.cs b/DiscImageChef.Filesystems/AppleHFS.cs index bfaa2b545..693953886 100644 --- a/DiscImageChef.Filesystems/AppleHFS.cs +++ b/DiscImageChef.Filesystems/AppleHFS.cs @@ -35,6 +35,8 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -70,7 +72,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public AppleHFS(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public AppleHFS(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "Apple Hierarchical File System"; PluginUUID = new Guid("36405F8D-0D26-6ECC-0BBB-1D5225FF404F"); @@ -78,7 +80,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(2 + partition.Start >= partition.End) return false; @@ -117,7 +119,7 @@ namespace DiscImageChef.Filesystems return false; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -273,7 +275,7 @@ namespace DiscImageChef.Filesystems information = sb.ToString(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); if(MDB.drVolBkUp > 0) { xmlFSType.BackupDate = DateHandlers.MacToDateTime(MDB.drVolBkUp); @@ -301,11 +303,9 @@ namespace DiscImageChef.Filesystems xmlFSType.VolumeName = StringHandlers.PascalToString(MDB.drVN, CurrentEncoding); if(MDB.drFndrInfo6 != 0 && MDB.drFndrInfo7 != 0) xmlFSType.VolumeSerial = string.Format("{0:X8}{1:X8}", MDB.drFndrInfo6, MDB.drFndrInfo7); - - return; } - static byte[] Read2048SectorAs512(DiscImages.ImagePlugin imagePlugin, ulong LBA) + static byte[] Read2048SectorAs512(ImagePlugin imagePlugin, ulong LBA) { ulong LBA2k = LBA / 4; int Remainder = (int)(LBA % 4); diff --git a/DiscImageChef.Filesystems/AppleHFSPlus.cs b/DiscImageChef.Filesystems/AppleHFSPlus.cs index c3d0d73d1..40da88b1f 100644 --- a/DiscImageChef.Filesystems/AppleHFSPlus.cs +++ b/DiscImageChef.Filesystems/AppleHFSPlus.cs @@ -35,6 +35,8 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -68,14 +70,14 @@ namespace DiscImageChef.Filesystems CurrentEncoding = Encoding.BigEndianUnicode; } - public AppleHFSPlus(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public AppleHFSPlus(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "Apple HFS+ filesystem"; PluginUUID = new Guid("36405F8D-0D26-6EBE-436F-62F0586B4F08"); CurrentEncoding = Encoding.BigEndianUnicode; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(2 + partition.Start >= partition.End) return false; @@ -123,7 +125,7 @@ namespace DiscImageChef.Filesystems return false; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -245,7 +247,7 @@ namespace DiscImageChef.Filesystems sb.AppendFormat("Mac OS X Volume ID: {0:X8}{1:X8}", HPVH.drFndrInfo6, HPVH.drFndrInfo7) .AppendLine(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); if(HPVH.backupDate > 0) { xmlFSType.BackupDate = DateHandlers.MacToDateTime(HPVH.backupDate); diff --git a/DiscImageChef.Filesystems/AppleMFS/File.cs b/DiscImageChef.Filesystems/AppleMFS/File.cs index 987d6b2ff..e57afa967 100644 --- a/DiscImageChef.Filesystems/AppleMFS/File.cs +++ b/DiscImageChef.Filesystems/AppleMFS/File.cs @@ -33,6 +33,7 @@ using System; using System.IO; using DiscImageChef.Console; +using DiscImageChef.DiscImages; namespace DiscImageChef.Filesystems.AppleMFS { @@ -45,7 +46,7 @@ namespace DiscImageChef.Filesystems.AppleMFS if(!mounted) return Errno.AccessDenied; - string[] pathElements = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return Errno.NotSupported; uint fileID; @@ -81,7 +82,7 @@ namespace DiscImageChef.Filesystems.AppleMFS { if(!mounted) return Errno.AccessDenied; - string[] pathElements = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return Errno.NotSupported; uint fileID; @@ -151,7 +152,7 @@ namespace DiscImageChef.Filesystems.AppleMFS { if(!mounted) return Errno.AccessDenied; - string[] pathElements = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return Errno.NotSupported; if(debug) @@ -236,7 +237,7 @@ namespace DiscImageChef.Filesystems.AppleMFS if(!mounted) return Errno.AccessDenied; - string[] pathElements = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return Errno.NotSupported; uint fileID; @@ -277,7 +278,7 @@ namespace DiscImageChef.Filesystems.AppleMFS if(tags) sectors = device.ReadSectorsTag((ulong)((nextBlock - 2) * sectorsPerBlock) + volMDB.drAlBlSt + partitionStart, - (uint)sectorsPerBlock, DiscImages.SectorTagType.AppleSectorTag); + (uint)sectorsPerBlock, SectorTagType.AppleSectorTag); else sectors = device.ReadSectors((ulong)((nextBlock - 2) * sectorsPerBlock) + volMDB.drAlBlSt + partitionStart, diff --git a/DiscImageChef.Filesystems/AppleMFS/Info.cs b/DiscImageChef.Filesystems/AppleMFS/Info.cs index a51a46892..c9f30a903 100644 --- a/DiscImageChef.Filesystems/AppleMFS/Info.cs +++ b/DiscImageChef.Filesystems/AppleMFS/Info.cs @@ -33,13 +33,15 @@ using System; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems.AppleMFS { // Information from Inside Macintosh Volume II public partial class AppleMFS : Filesystem { - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { ushort drSigWord; @@ -54,7 +56,7 @@ namespace DiscImageChef.Filesystems.AppleMFS return drSigWord == MFS_MAGIC; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -173,7 +175,7 @@ namespace DiscImageChef.Filesystems.AppleMFS information = sb.ToString(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); if(MDB.drLsBkUp > 0) { xmlFSType.BackupDate = DateHandlers.MacToDateTime(MDB.drLsBkUp); @@ -193,8 +195,6 @@ namespace DiscImageChef.Filesystems.AppleMFS xmlFSType.FreeClustersSpecified = true; xmlFSType.Type = "MFS"; xmlFSType.VolumeName = MDB.drVN; - - return; } } } \ No newline at end of file diff --git a/DiscImageChef.Filesystems/AppleMFS/Super.cs b/DiscImageChef.Filesystems/AppleMFS/Super.cs index 9d09c895e..7bf61db33 100644 --- a/DiscImageChef.Filesystems/AppleMFS/Super.cs +++ b/DiscImageChef.Filesystems/AppleMFS/Super.cs @@ -31,6 +31,8 @@ // ****************************************************************************/ using System; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems.AppleMFS { @@ -105,14 +107,14 @@ namespace DiscImageChef.Filesystems.AppleMFS offset += 12; } - if(device.ImageInfo.ReadableSectorTags.Contains(DiscImages.SectorTagType.AppleSectorTag)) + if(device.ImageInfo.ReadableSectorTags.Contains(SectorTagType.AppleSectorTag)) { - mdbTags = device.ReadSectorTag(2 + partitionStart, DiscImages.SectorTagType.AppleSectorTag); - bootTags = device.ReadSectorTag(0 + partitionStart, DiscImages.SectorTagType.AppleSectorTag); + mdbTags = device.ReadSectorTag(2 + partitionStart, SectorTagType.AppleSectorTag); + bootTags = device.ReadSectorTag(0 + partitionStart, SectorTagType.AppleSectorTag); directoryTags = device.ReadSectorsTag(volMDB.drDirSt + partitionStart, volMDB.drBlLen, - DiscImages.SectorTagType.AppleSectorTag); + SectorTagType.AppleSectorTag); bitmapTags = device.ReadSectorsTag(partitionStart + 2, (uint)sectorsInWholeMDB, - DiscImages.SectorTagType.AppleSectorTag); + SectorTagType.AppleSectorTag); } sectorsPerBlock = (int)(volMDB.drAlBlkSiz / device.ImageInfo.SectorSize); @@ -125,7 +127,7 @@ namespace DiscImageChef.Filesystems.AppleMFS if(bbSig != MFSBB_MAGIC) bootBlocks = null; - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); if(volMDB.drLsBkUp > 0) { xmlFSType.BackupDate = DateHandlers.MacToDateTime(volMDB.drLsBkUp); diff --git a/DiscImageChef.Filesystems/AppleMFS/Xattr.cs b/DiscImageChef.Filesystems/AppleMFS/Xattr.cs index f1c8bfe05..c2c1176dc 100644 --- a/DiscImageChef.Filesystems/AppleMFS/Xattr.cs +++ b/DiscImageChef.Filesystems/AppleMFS/Xattr.cs @@ -33,6 +33,7 @@ using System; using System.Collections.Generic; +using DiscImageChef.DiscImages; namespace DiscImageChef.Filesystems.AppleMFS { @@ -43,7 +44,7 @@ namespace DiscImageChef.Filesystems.AppleMFS { if(!mounted) return Errno.AccessDenied; - string[] pathElements = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return Errno.NotSupported; xattrs = new List(); @@ -54,7 +55,7 @@ namespace DiscImageChef.Filesystems.AppleMFS string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0 || string.Compare(path, "$MDB", StringComparison.InvariantCulture) == 0) { - if(device.ImageInfo.ReadableSectorTags.Contains(DiscImages.SectorTagType.AppleSectorTag)) + if(device.ImageInfo.ReadableSectorTags.Contains(SectorTagType.AppleSectorTag)) xattrs.Add("com.apple.macintosh.tags"); return Errno.NoError; @@ -70,13 +71,13 @@ namespace DiscImageChef.Filesystems.AppleMFS if(entry.flRLgLen > 0) { xattrs.Add("com.apple.ResourceFork"); - if(debug && device.ImageInfo.ReadableSectorTags.Contains(DiscImages.SectorTagType.AppleSectorTag)) + if(debug && device.ImageInfo.ReadableSectorTags.Contains(SectorTagType.AppleSectorTag)) xattrs.Add("com.apple.ResourceFork.tags"); } if(!ArrayHelpers.ArrayIsNullOrEmpty(entry.flUsrWds)) xattrs.Add("com.apple.FinderInfo"); - if(debug && device.ImageInfo.ReadableSectorTags.Contains(DiscImages.SectorTagType.AppleSectorTag) && + if(debug && device.ImageInfo.ReadableSectorTags.Contains(SectorTagType.AppleSectorTag) && entry.flLgLen > 0) xattrs.Add("com.apple.macintosh.tags"); xattrs.Sort(); @@ -88,7 +89,7 @@ namespace DiscImageChef.Filesystems.AppleMFS { if(!mounted) return Errno.AccessDenied; - string[] pathElements = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return Errno.NotSupported; if(debug) @@ -96,7 +97,7 @@ namespace DiscImageChef.Filesystems.AppleMFS string.Compare(path, "$Bitmap", StringComparison.InvariantCulture) == 0 || string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0 || string.Compare(path, "$MDB", StringComparison.InvariantCulture) == 0) - if(device.ImageInfo.ReadableSectorTags.Contains(DiscImages.SectorTagType.AppleSectorTag) && + if(device.ImageInfo.ReadableSectorTags.Contains(SectorTagType.AppleSectorTag) && string.Compare(xattr, "com.apple.macintosh.tags", StringComparison.InvariantCulture) == 0) { if(string.Compare(path, "$", StringComparison.InvariantCulture) == 0) @@ -159,7 +160,7 @@ namespace DiscImageChef.Filesystems.AppleMFS return Errno.NoError; } - if(!debug || !device.ImageInfo.ReadableSectorTags.Contains(DiscImages.SectorTagType.AppleSectorTag) || + if(!debug || !device.ImageInfo.ReadableSectorTags.Contains(SectorTagType.AppleSectorTag) || string.Compare(xattr, "com.apple.macintosh.tags", StringComparison.InvariantCulture) != 0) return Errno.NoSuchExtendedAttribute; diff --git a/DiscImageChef.Filesystems/AtheOS.cs b/DiscImageChef.Filesystems/AtheOS.cs index 504e39fb7..274a3c593 100644 --- a/DiscImageChef.Filesystems/AtheOS.cs +++ b/DiscImageChef.Filesystems/AtheOS.cs @@ -35,6 +35,8 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -63,7 +65,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public AtheOS(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public AtheOS(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "AtheOS Filesystem"; PluginUUID = new Guid("AAB2C4F1-DC07-49EE-A948-576CC51B58C5"); @@ -71,7 +73,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { ulong sector = AFS_BOOTBLOCK_SIZE / imagePlugin.GetSectorSize(); uint offset = AFS_BOOTBLOCK_SIZE % imagePlugin.GetSectorSize(); @@ -93,7 +95,7 @@ namespace DiscImageChef.Filesystems return magic == AFS_MAGIC1; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -153,7 +155,7 @@ namespace DiscImageChef.Filesystems information = sb.ToString(); - xmlFSType = new Schemas.FileSystemType + xmlFSType = new FileSystemType { Clusters = afs_sb.num_blocks, ClusterSize = (int)afs_sb.block_size, diff --git a/DiscImageChef.Filesystems/BFS.cs b/DiscImageChef.Filesystems/BFS.cs index a404592a8..3405bddaa 100644 --- a/DiscImageChef.Filesystems/BFS.cs +++ b/DiscImageChef.Filesystems/BFS.cs @@ -35,6 +35,8 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -68,7 +70,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public BeFS(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public BeFS(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "Be Filesystem"; PluginUUID = new Guid("dc8572b3-b6ad-46e4-8de9-cbe123ff6672"); @@ -76,7 +78,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(2 + partition.Start >= partition.End) return false; @@ -108,7 +110,7 @@ namespace DiscImageChef.Filesystems return false; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -213,7 +215,7 @@ namespace DiscImageChef.Filesystems information = sb.ToString(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.Clusters = besb.num_blocks; xmlFSType.ClusterSize = (int)besb.block_size; xmlFSType.Dirty = besb.flags == BEFS_DIRTY; diff --git a/DiscImageChef.Filesystems/BTRFS.cs b/DiscImageChef.Filesystems/BTRFS.cs index 6e43ed386..d28395536 100644 --- a/DiscImageChef.Filesystems/BTRFS.cs +++ b/DiscImageChef.Filesystems/BTRFS.cs @@ -36,6 +36,8 @@ using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -61,7 +63,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public BTRFS(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public BTRFS(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "B-tree file system"; PluginUUID = new Guid("C904CF15-5222-446B-B7DB-02EAC5D781B3"); @@ -125,7 +127,7 @@ namespace DiscImageChef.Filesystems public Guid uuid; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(partition.Start >= partition.End) return false; @@ -153,11 +155,11 @@ namespace DiscImageChef.Filesystems return btrfsSb.magic == btrfsMagic; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { StringBuilder sbInformation = new StringBuilder(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); information = ""; ulong sbSectorOff = 0x10000 / imagePlugin.GetSectorSize(); @@ -241,7 +243,7 @@ namespace DiscImageChef.Filesystems information = sbInformation.ToString(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.Clusters = (long)(btrfsSb.total_bytes / btrfsSb.sectorsize); xmlFSType.ClusterSize = (int)btrfsSb.sectorsize; xmlFSType.FreeClusters = xmlFSType.Clusters - (long)(btrfsSb.bytes_used / btrfsSb.sectorsize); diff --git a/DiscImageChef.Filesystems/CBM.cs b/DiscImageChef.Filesystems/CBM.cs index f65c99184..8104f7172 100644 --- a/DiscImageChef.Filesystems/CBM.cs +++ b/DiscImageChef.Filesystems/CBM.cs @@ -34,7 +34,11 @@ using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; +using Claunia.Encoding; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; +using Encoding = System.Text.Encoding; namespace DiscImageChef.Filesystems { @@ -44,21 +48,21 @@ namespace DiscImageChef.Filesystems { Name = "Commodore file system"; PluginUUID = new Guid("D104744E-A376-450C-BAC0-1347C93F983B"); - CurrentEncoding = new Claunia.Encoding.PETSCII(); + CurrentEncoding = new PETSCII(); } public CBM(Encoding encoding) { Name = "Commodore file system"; PluginUUID = new Guid("D104744E-A376-450C-BAC0-1347C93F983B"); - CurrentEncoding = new Claunia.Encoding.PETSCII(); + CurrentEncoding = new PETSCII(); } - public CBM(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public CBM(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "Commodore file system"; PluginUUID = new Guid("D104744E-A376-450C-BAC0-1347C93F983B"); - CurrentEncoding = new Claunia.Encoding.PETSCII(); + CurrentEncoding = new PETSCII(); } [StructLayout(LayoutKind.Sequential, Pack = 1)] @@ -179,7 +183,7 @@ namespace DiscImageChef.Filesystems public short fill3; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(partition.Start > 0) return false; @@ -218,7 +222,7 @@ namespace DiscImageChef.Filesystems return false; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { byte[] sector; @@ -227,7 +231,7 @@ namespace DiscImageChef.Filesystems sbInformation.AppendLine("Commodore file system"); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.Type = "Commodore file system"; xmlFSType.Clusters = (long)imagePlugin.ImageInfo.Sectors; xmlFSType.ClusterSize = 256; @@ -244,11 +248,11 @@ namespace DiscImageChef.Filesystems sbInformation.AppendFormat("Directory starts at track {0} sector {1}", cbmHdr.directoryTrack, cbmHdr.directorySector).AppendLine(); sbInformation.AppendFormat("Disk DOS Version: {0}", - Encoding.ASCII.GetString(new byte[] {cbmHdr.diskDosVersion})).AppendLine(); - sbInformation.AppendFormat("DOS Version: {0}", Encoding.ASCII.GetString(new byte[] {cbmHdr.dosVersion})) + Encoding.ASCII.GetString(new[] {cbmHdr.diskDosVersion})).AppendLine(); + sbInformation.AppendFormat("DOS Version: {0}", Encoding.ASCII.GetString(new[] {cbmHdr.dosVersion})) .AppendLine(); sbInformation - .AppendFormat("Disk Version: {0}", Encoding.ASCII.GetString(new byte[] {cbmHdr.diskVersion})) + .AppendFormat("Disk Version: {0}", Encoding.ASCII.GetString(new[] {cbmHdr.diskVersion})) .AppendLine(); sbInformation.AppendFormat("Disk ID: {0}", cbmHdr.diskId).AppendLine(); sbInformation.AppendFormat("Disk name: {0}", StringHandlers.CToString(cbmHdr.name, CurrentEncoding)) @@ -271,7 +275,7 @@ namespace DiscImageChef.Filesystems sbInformation.AppendFormat("Disk DOS type: {0}", Encoding.ASCII.GetString(BitConverter.GetBytes(cbmBam.dosType))) .AppendLine(); - sbInformation.AppendFormat("DOS Version: {0}", Encoding.ASCII.GetString(new byte[] {cbmBam.dosVersion})) + sbInformation.AppendFormat("DOS Version: {0}", Encoding.ASCII.GetString(new[] {cbmBam.dosVersion})) .AppendLine(); sbInformation.AppendFormat("Disk ID: {0}", cbmBam.diskId).AppendLine(); sbInformation.AppendFormat("Disk name: {0}", StringHandlers.CToString(cbmBam.name, CurrentEncoding)) diff --git a/DiscImageChef.Filesystems/CPM/File.cs b/DiscImageChef.Filesystems/CPM/File.cs index 16ad43cb1..9d29a429f 100644 --- a/DiscImageChef.Filesystems/CPM/File.cs +++ b/DiscImageChef.Filesystems/CPM/File.cs @@ -40,7 +40,7 @@ namespace DiscImageChef.Filesystems.CPM { if(!mounted) return Errno.AccessDenied; - string[] pathElements = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return Errno.NotSupported; FileEntryInfo fInfo; @@ -79,7 +79,7 @@ namespace DiscImageChef.Filesystems.CPM if(offset < 0) return Errno.InvalidArgument; - string[] pathElements = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return Errno.NotSupported; byte[] file; @@ -106,7 +106,7 @@ namespace DiscImageChef.Filesystems.CPM { if(!mounted) return Errno.AccessDenied; - string[] pathElements = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return Errno.NotSupported; if(string.IsNullOrEmpty(path) || string.Compare(path, "/", StringComparison.OrdinalIgnoreCase) == 0) diff --git a/DiscImageChef.Filesystems/CPM/Info.cs b/DiscImageChef.Filesystems/CPM/Info.cs index 89b727532..ceecef10f 100644 --- a/DiscImageChef.Filesystems/CPM/Info.cs +++ b/DiscImageChef.Filesystems/CPM/Info.cs @@ -38,6 +38,7 @@ using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems.CPM { @@ -1045,7 +1046,7 @@ namespace DiscImageChef.Filesystems.CPM if(labelUpdateDate != null) sb.AppendFormat("Volume updated on {0}", DateHandlers.CPMToDateTime(labelUpdateDate)).AppendLine(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.Bootable |= workingDefinition.sofs > 0 || workingDefinition.ofs > 0; xmlFSType.ClusterSize = 128 << dpb.bsh; if(dpb.dsm > 0) xmlFSType.Clusters = dpb.dsm; diff --git a/DiscImageChef.Filesystems/CPM/Super.cs b/DiscImageChef.Filesystems/CPM/Super.cs index 98f1191b5..387c10fbe 100644 --- a/DiscImageChef.Filesystems/CPM/Super.cs +++ b/DiscImageChef.Filesystems/CPM/Super.cs @@ -39,6 +39,7 @@ using System.Linq; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.Console; +using Schemas; namespace DiscImageChef.Filesystems.CPM { @@ -671,7 +672,7 @@ namespace DiscImageChef.Filesystems.CPM cpmStat.Type = "CP/M filesystem"; // Generate XML info - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.Clusters = cpmStat.Blocks; xmlFSType.ClusterSize = blockSize; if(labelCreationDate != null) diff --git a/DiscImageChef.Filesystems/CPM/Xattr.cs b/DiscImageChef.Filesystems/CPM/Xattr.cs index 0e7438a79..bd395a584 100644 --- a/DiscImageChef.Filesystems/CPM/Xattr.cs +++ b/DiscImageChef.Filesystems/CPM/Xattr.cs @@ -48,7 +48,7 @@ namespace DiscImageChef.Filesystems.CPM { if(!mounted) return Errno.AccessDenied; - string[] pathElements = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return Errno.NotSupported; if(!fileCache.ContainsKey(pathElements[0].ToUpperInvariant())) return Errno.NoSuchFile; @@ -73,7 +73,7 @@ namespace DiscImageChef.Filesystems.CPM { if(!mounted) return Errno.AccessDenied; - string[] pathElements = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return Errno.NotSupported; if(!fileCache.ContainsKey(pathElements[0].ToUpperInvariant())) return Errno.NoSuchFile; diff --git a/DiscImageChef.Filesystems/Cram.cs b/DiscImageChef.Filesystems/Cram.cs index d125661d8..42e07e1d5 100644 --- a/DiscImageChef.Filesystems/Cram.cs +++ b/DiscImageChef.Filesystems/Cram.cs @@ -35,6 +35,8 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -55,7 +57,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public Cram(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public Cram(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "Cram filesystem"; PluginUUID = new Guid("F8F6E46F-7A2A-48E3-9C0A-46AF4DC29E09"); @@ -93,7 +95,7 @@ namespace DiscImageChef.Filesystems const uint Cram_MAGIC = 0x28CD3D45; const uint Cram_CIGAM = 0x453DCD28; - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(partition.Start >= partition.End) return false; @@ -104,7 +106,7 @@ namespace DiscImageChef.Filesystems return magic == Cram_MAGIC || magic == Cram_CIGAM; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { byte[] sector = imagePlugin.ReadSector(partition.Start); @@ -140,7 +142,7 @@ namespace DiscImageChef.Filesystems information = sbInformation.ToString(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.VolumeName = StringHandlers.CToString(crSb.name, CurrentEncoding); xmlFSType.Type = "Cram file system"; xmlFSType.Clusters = crSb.blocks; diff --git a/DiscImageChef.Filesystems/ECMA67.cs b/DiscImageChef.Filesystems/ECMA67.cs index 6975ed422..95fb2912b 100644 --- a/DiscImageChef.Filesystems/ECMA67.cs +++ b/DiscImageChef.Filesystems/ECMA67.cs @@ -37,6 +37,7 @@ using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -122,7 +123,7 @@ namespace DiscImageChef.Filesystems sbInformation.AppendFormat("Volume name: {0}", Encoding.ASCII.GetString(vol.volumeIdentifier)).AppendLine(); sbInformation.AppendFormat("Volume owner: {0}", Encoding.ASCII.GetString(vol.owner)).AppendLine(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.Type = "ECMA-67"; xmlFSType.ClusterSize = 256; xmlFSType.Clusters = (long)(partition.End - partition.Start + 1); diff --git a/DiscImageChef.Filesystems/EFS.cs b/DiscImageChef.Filesystems/EFS.cs index 66fb75a15..46743fdc0 100644 --- a/DiscImageChef.Filesystems/EFS.cs +++ b/DiscImageChef.Filesystems/EFS.cs @@ -36,6 +36,8 @@ using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -106,7 +108,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public EFS(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public EFS(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "Extent File System Plugin"; PluginUUID = new Guid("52A43F90-9AF3-4391-ADFE-65598DEEABAB"); @@ -114,12 +116,12 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(imagePlugin.GetSectorSize() < 512) return false; // Misaligned - if(imagePlugin.ImageInfo.XmlMediaType == DiscImages.XmlMediaType.OpticalDisc) + if(imagePlugin.ImageInfo.XmlMediaType == XmlMediaType.OpticalDisc) { EFS_Superblock efs_sb = new EFS_Superblock(); @@ -161,7 +163,7 @@ namespace DiscImageChef.Filesystems return false; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -170,7 +172,7 @@ namespace DiscImageChef.Filesystems EFS_Superblock efsSb = new EFS_Superblock(); // Misaligned - if(imagePlugin.ImageInfo.XmlMediaType == DiscImages.XmlMediaType.OpticalDisc) + if(imagePlugin.ImageInfo.XmlMediaType == XmlMediaType.OpticalDisc) { uint sbSize = (uint)((Marshal.SizeOf(efsSb) + 0x400) / imagePlugin.GetSectorSize()); if((Marshal.SizeOf(efsSb) + 0x400) % imagePlugin.GetSectorSize() != 0) sbSize++; @@ -229,7 +231,7 @@ namespace DiscImageChef.Filesystems information = sb.ToString(); - xmlFSType = new Schemas.FileSystemType + xmlFSType = new FileSystemType { Type = "Extent File System", ClusterSize = 512, diff --git a/DiscImageChef.Filesystems/F2FS.cs b/DiscImageChef.Filesystems/F2FS.cs index d6409bfa1..038dfc7a6 100644 --- a/DiscImageChef.Filesystems/F2FS.cs +++ b/DiscImageChef.Filesystems/F2FS.cs @@ -35,6 +35,8 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -110,14 +112,14 @@ namespace DiscImageChef.Filesystems CurrentEncoding = Encoding.Unicode; } - public F2FS(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public F2FS(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "F2FS Plugin"; PluginUUID = new Guid("82B0920F-5F0D-4063-9F57-ADE0AE02ECE5"); CurrentEncoding = Encoding.Unicode; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(imagePlugin.GetSectorSize() < F2FS_MinSector || imagePlugin.GetSectorSize() > F2FS_MaxSector) return false; @@ -143,7 +145,7 @@ namespace DiscImageChef.Filesystems return f2fsSb.magic == F2FS_Magic; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -191,7 +193,7 @@ namespace DiscImageChef.Filesystems information = sb.ToString(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.Type = "F2FS filesystem"; xmlFSType.SystemIdentifier = Encoding.ASCII.GetString(f2fsSb.version); xmlFSType.Clusters = (long)f2fsSb.block_count; diff --git a/DiscImageChef.Filesystems/FAT.cs b/DiscImageChef.Filesystems/FAT.cs index 0274bc1c0..8d3bc2b48 100644 --- a/DiscImageChef.Filesystems/FAT.cs +++ b/DiscImageChef.Filesystems/FAT.cs @@ -36,8 +36,12 @@ using System.IO; using System.Linq; using System.Runtime.InteropServices; using System.Text; +using DiscImageChef.Checksums; using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.DiscImages; +using DiscImageChef.Helpers; +using Schemas; namespace DiscImageChef.Filesystems { @@ -60,7 +64,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public FAT(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public FAT(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "Microsoft File Allocation Table"; PluginUUID = new Guid("33513B2C-0D26-0D2D-32C3-79D8611158E0"); @@ -68,7 +72,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(2 + partition.Start >= partition.End) return false; @@ -111,7 +115,7 @@ namespace DiscImageChef.Filesystems Array.Copy(bpb_sector, 0x052, fat32_id, 0, 8); huge_sectors = BitConverter.ToUInt64(bpb_sector, 0x052); fat_id = fat_sector[0]; - int bits_in_bps = Helpers.CountBits.Count(bps); + int bits_in_bps = CountBits.Count(bps); if(imagePlugin.ImageInfo.SectorSize >= 512) bootable = BitConverter.ToUInt16(bpb_sector, 0x1FE); bool correct_spc = spc == 1 || spc == 2 || spc == 4 || spc == 8 || spc == 16 || spc == 32 || spc == 64; @@ -155,7 +159,7 @@ namespace DiscImageChef.Filesystems ushort apricot_fat_sectors = BitConverter.ToUInt16(bpb_sector, 0x5B); bool apricot_correct_spc = apricot_spc == 1 || apricot_spc == 2 || apricot_spc == 4 || apricot_spc == 8 || apricot_spc == 16 || apricot_spc == 32 || apricot_spc == 64; - int bits_in_apricot_bps = Helpers.CountBits.Count(apricot_bps); + int bits_in_apricot_bps = CountBits.Count(apricot_bps); byte apricot_partitions = bpb_sector[0x0C]; DicConsole.DebugWriteLine("FAT plugin", "apricot_bps = {0}", apricot_bps); @@ -169,7 +173,7 @@ namespace DiscImageChef.Filesystems DicConsole.DebugWriteLine("FAT plugin", "apricot_fat_sectors = {0}", apricot_fat_sectors); // This is to support FAT partitions on hybrid ISO/USB images - if(imagePlugin.ImageInfo.XmlMediaType == DiscImages.XmlMediaType.OpticalDisc) + if(imagePlugin.ImageInfo.XmlMediaType == XmlMediaType.OpticalDisc) { sectors /= 4; big_sectors /= 4; @@ -326,13 +330,13 @@ namespace DiscImageChef.Filesystems return fat_id == fat2_sector[0]; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; StringBuilder sb = new StringBuilder(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); bool useAtariBPB = false; bool useMSXBPB = false; @@ -383,17 +387,17 @@ namespace DiscImageChef.Filesystems Marshal.FreeHGlobal(bpbPtr); - int bits_in_bps_atari = Helpers.CountBits.Count(atariBPB.bps); - int bits_in_bps_msx = Helpers.CountBits.Count(msxBPB.bps); - int bits_in_bps_dos20 = Helpers.CountBits.Count(dos2BPB.bps); - int bits_in_bps_dos30 = Helpers.CountBits.Count(dos30BPB.bps); - int bits_in_bps_dos32 = Helpers.CountBits.Count(dos32BPB.bps); - int bits_in_bps_dos33 = Helpers.CountBits.Count(dos33BPB.bps); - int bits_in_bps_dos34 = Helpers.CountBits.Count(shortEBPB.bps); - int bits_in_bps_dos40 = Helpers.CountBits.Count(EBPB.bps); - int bits_in_bps_fat32_short = Helpers.CountBits.Count(shortFat32BPB.bps); - int bits_in_bps_fat32 = Helpers.CountBits.Count(Fat32BPB.bps); - int bits_in_bps_apricot = Helpers.CountBits.Count(ApricotBPB.mainBPB.bps); + int bits_in_bps_atari = CountBits.Count(atariBPB.bps); + int bits_in_bps_msx = CountBits.Count(msxBPB.bps); + int bits_in_bps_dos20 = CountBits.Count(dos2BPB.bps); + int bits_in_bps_dos30 = CountBits.Count(dos30BPB.bps); + int bits_in_bps_dos32 = CountBits.Count(dos32BPB.bps); + int bits_in_bps_dos33 = CountBits.Count(dos33BPB.bps); + int bits_in_bps_dos34 = CountBits.Count(shortEBPB.bps); + int bits_in_bps_dos40 = CountBits.Count(EBPB.bps); + int bits_in_bps_fat32_short = CountBits.Count(shortFat32BPB.bps); + int bits_in_bps_fat32 = CountBits.Count(Fat32BPB.bps); + int bits_in_bps_apricot = CountBits.Count(ApricotBPB.mainBPB.bps); bool correct_spc_atari = atariBPB.spc == 1 || atariBPB.spc == 2 || atariBPB.spc == 4 || atariBPB.spc == 8 || atariBPB.spc == 16 || atariBPB.spc == 32 || @@ -429,7 +433,7 @@ namespace DiscImageChef.Filesystems ApricotBPB.mainBPB.spc == 64; // This is to support FAT partitions on hybrid ISO/USB images - if(imagePlugin.ImageInfo.XmlMediaType == DiscImages.XmlMediaType.OpticalDisc) + if(imagePlugin.ImageInfo.XmlMediaType == XmlMediaType.OpticalDisc) { atariBPB.sectors /= 4; msxBPB.sectors /= 4; @@ -581,7 +585,7 @@ namespace DiscImageChef.Filesystems ulong root_directory_sector = 0; string extraInfo = null; string bootChk = null; - Checksums.Sha1Context sha1Ctx = new Checksums.Sha1Context(); + Sha1Context sha1Ctx = new Sha1Context(); sha1Ctx.Init(); byte[] chkTmp; @@ -822,7 +826,7 @@ namespace DiscImageChef.Filesystems isFAT32 = true; // This is to support FAT partitions on hybrid ISO/USB images - if(imagePlugin.ImageInfo.XmlMediaType == DiscImages.XmlMediaType.OpticalDisc) + if(imagePlugin.ImageInfo.XmlMediaType == XmlMediaType.OpticalDisc) { Fat32BPB.bps *= 4; Fat32BPB.spc /= 4; @@ -1134,7 +1138,7 @@ namespace DiscImageChef.Filesystems if(!isFAT32) { // This is to support FAT partitions on hybrid ISO/USB images - if(imagePlugin.ImageInfo.XmlMediaType == DiscImages.XmlMediaType.OpticalDisc) + if(imagePlugin.ImageInfo.XmlMediaType == XmlMediaType.OpticalDisc) { fakeBPB.bps *= 4; fakeBPB.spc /= 4; @@ -1156,7 +1160,7 @@ namespace DiscImageChef.Filesystems if(fakeBPB.sectors == 0) clusters = fakeBPB.spc == 0 ? fakeBPB.big_sectors : fakeBPB.big_sectors / fakeBPB.spc; - else clusters = fakeBPB.spc == 0 ? (ulong)fakeBPB.sectors : (ulong)fakeBPB.sectors / fakeBPB.spc; + else clusters = fakeBPB.spc == 0 ? fakeBPB.sectors : (ulong)fakeBPB.sectors / fakeBPB.spc; if(clusters < 4089) isFAT12 = true; else isFAT16 = true; @@ -1297,7 +1301,7 @@ namespace DiscImageChef.Filesystems if(extraInfo != null) sb.Append(extraInfo); if(root_directory_sector + partition.Start < partition.End && - imagePlugin.ImageInfo.XmlMediaType != DiscImages.XmlMediaType.OpticalDisc) + imagePlugin.ImageInfo.XmlMediaType != XmlMediaType.OpticalDisc) { byte[] root_directory = imagePlugin.ReadSectors(root_directory_sector + partition.Start, sectors_for_root_directory); diff --git a/DiscImageChef.Filesystems/FATX.cs b/DiscImageChef.Filesystems/FATX.cs index 40e56a379..c99385b12 100644 --- a/DiscImageChef.Filesystems/FATX.cs +++ b/DiscImageChef.Filesystems/FATX.cs @@ -35,6 +35,8 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -65,14 +67,14 @@ namespace DiscImageChef.Filesystems CurrentEncoding = Encoding.UTF8; } - public FATX(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public FATX(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "FATX Filesystem Plugin"; PluginUUID = new Guid("ED27A721-4A17-4649-89FD-33633B46E228"); CurrentEncoding = Encoding.UTF8; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(imagePlugin.GetSectorSize() < 512) return false; @@ -84,7 +86,7 @@ namespace DiscImageChef.Filesystems return fatxSb.magic == FATX_Magic; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -108,7 +110,7 @@ namespace DiscImageChef.Filesystems information = sb.ToString(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.Type = "FATX filesystem"; xmlFSType.ClusterSize = (int)(fatxSb.sectorsPerCluster * imagePlugin.ImageInfo.SectorSize); xmlFSType.Clusters = (long)((partition.End - partition.Start + 1) * imagePlugin.ImageInfo.SectorSize / diff --git a/DiscImageChef.Filesystems/FFS.cs b/DiscImageChef.Filesystems/FFS.cs index 096f5e54a..17938492e 100644 --- a/DiscImageChef.Filesystems/FFS.cs +++ b/DiscImageChef.Filesystems/FFS.cs @@ -37,6 +37,8 @@ using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.DiscImages; +using Schemas; using time_t = System.Int32; using ufs_daddr_t = System.Int32; @@ -60,7 +62,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public FFSPlugin(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public FFSPlugin(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "BSD Fast File System (aka UNIX File System, UFS)"; PluginUUID = new Guid("CC90D342-05DB-48A8-988C-C1FE000034A3"); @@ -68,7 +70,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(2 + partition.Start >= partition.End) return false; @@ -99,7 +101,7 @@ namespace DiscImageChef.Filesystems return false; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -148,7 +150,7 @@ namespace DiscImageChef.Filesystems return; } - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); switch(magic) { @@ -335,7 +337,7 @@ namespace DiscImageChef.Filesystems sbInformation.AppendFormat("{0} blocks in volume ({1} bytes)", ufs_sb.fs_old_size, (long)ufs_sb.fs_old_size * ufs_sb.fs_fsize).AppendLine(); xmlFSType.Clusters = ufs_sb.fs_old_size; - xmlFSType.ClusterSize = (int)ufs_sb.fs_fsize; + xmlFSType.ClusterSize = ufs_sb.fs_fsize; sbInformation.AppendFormat("{0} data blocks in volume ({1} bytes)", ufs_sb.fs_old_dsize, (long)ufs_sb.fs_old_dsize * ufs_sb.fs_fsize).AppendLine(); sbInformation.AppendFormat("{0} cylinder groups in volume", ufs_sb.fs_ncg).AppendLine(); @@ -419,7 +421,7 @@ namespace DiscImageChef.Filesystems sbInformation.AppendFormat("{0} directories", ufs_sb.fs_cstotal.cs_ndir).AppendLine(); sbInformation.AppendFormat("{0} free blocks ({1} bytes)", ufs_sb.fs_cstotal.cs_nbfree, ufs_sb.fs_cstotal.cs_nbfree * ufs_sb.fs_fsize).AppendLine(); - xmlFSType.FreeClusters = (long)ufs_sb.fs_cstotal.cs_nbfree; + xmlFSType.FreeClusters = ufs_sb.fs_cstotal.cs_nbfree; xmlFSType.FreeClustersSpecified = true; sbInformation.AppendFormat("{0} free inodes", ufs_sb.fs_cstotal.cs_nifree).AppendLine(); sbInformation.AppendFormat("{0} free frags", ufs_sb.fs_cstotal.cs_nffree).AppendLine(); @@ -430,7 +432,7 @@ namespace DiscImageChef.Filesystems xmlFSType.ModificationDateSpecified = true; sbInformation.AppendFormat("{0} blocks ({1} bytes)", ufs_sb.fs_size, ufs_sb.fs_size * ufs_sb.fs_fsize) .AppendLine(); - xmlFSType.Clusters = (long)ufs_sb.fs_size; + xmlFSType.Clusters = ufs_sb.fs_size; sbInformation .AppendFormat("{0} data blocks ({1} bytes)", ufs_sb.fs_dsize, ufs_sb.fs_dsize * ufs_sb.fs_fsize) .AppendLine(); diff --git a/DiscImageChef.Filesystems/Filesystem.cs b/DiscImageChef.Filesystems/Filesystem.cs index ff8989125..0d91840ac 100644 --- a/DiscImageChef.Filesystems/Filesystem.cs +++ b/DiscImageChef.Filesystems/Filesystem.cs @@ -34,6 +34,8 @@ using System; using System.Collections.Generic; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -46,14 +48,14 @@ namespace DiscImageChef.Filesystems public string Name; /// Plugin UUID. public Guid PluginUUID; - internal Schemas.FileSystemType xmlFSType; + internal FileSystemType xmlFSType; public Encoding CurrentEncoding; /// /// Information about the filesystem as expected by CICM Metadata XML /// /// Information about the filesystem as expected by CICM Metadata XML - public Schemas.FileSystemType XmlFSType + public FileSystemType XmlFSType { get { return xmlFSType; } } @@ -69,7 +71,7 @@ namespace DiscImageChef.Filesystems /// Image plugin. /// Partition. /// Which encoding to use for this filesystem. - protected Filesystem(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) { } + protected Filesystem(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { } /// /// Identifies the filesystem in the specified LBA @@ -77,7 +79,7 @@ namespace DiscImageChef.Filesystems /// Disk image. /// Partition. /// true, if the filesystem is recognized, false otherwise. - public abstract bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition); + public abstract bool Identify(ImagePlugin imagePlugin, Partition partition); /// /// Gets information about the identified filesystem. @@ -85,7 +87,7 @@ namespace DiscImageChef.Filesystems /// Disk image. /// Partition. /// Filesystem information. - public abstract void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public abstract void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information); /// diff --git a/DiscImageChef.Filesystems/Fossil.cs b/DiscImageChef.Filesystems/Fossil.cs index dadf93c98..d71245f86 100644 --- a/DiscImageChef.Filesystems/Fossil.cs +++ b/DiscImageChef.Filesystems/Fossil.cs @@ -36,6 +36,8 @@ using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -139,7 +141,7 @@ namespace DiscImageChef.Filesystems CurrentEncoding = Encoding.UTF8; } - public Fossil(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public Fossil(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "Fossil Filesystem Plugin"; PluginUUID = new Guid("932BF104-43F6-494F-973C-45EF58A51DA9"); @@ -147,7 +149,7 @@ namespace DiscImageChef.Filesystems CurrentEncoding = Encoding.UTF8; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { ulong hdrSector = HeaderPos / imagePlugin.GetSectorSize(); @@ -164,7 +166,7 @@ namespace DiscImageChef.Filesystems return hdr.magic == Fossil_HdrMagic; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -192,7 +194,7 @@ namespace DiscImageChef.Filesystems ulong sbLocation = hdr.super * (hdr.blockSize / imagePlugin.GetSectorSize()) + partition.Start; - xmlFSType = new Schemas.FileSystemType + xmlFSType = new FileSystemType { Type = "Fossil filesystem", ClusterSize = hdr.blockSize, diff --git a/DiscImageChef.Filesystems/HAMMER.cs b/DiscImageChef.Filesystems/HAMMER.cs index 047aedfb5..ed6cad64e 100644 --- a/DiscImageChef.Filesystems/HAMMER.cs +++ b/DiscImageChef.Filesystems/HAMMER.cs @@ -35,6 +35,8 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; using hammer_crc_t = System.UInt32; using hammer_off_t = System.UInt64; using hammer_tid_t = System.UInt64; @@ -63,7 +65,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public HAMMER(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public HAMMER(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "HAMMER Filesystem"; PluginUUID = new Guid("91A188BF-5FD7-4677-BBD3-F59EBA9C864D"); @@ -71,7 +73,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { uint run = HAMMER_VOLHDR_SIZE / imagePlugin.GetSectorSize(); @@ -88,7 +90,7 @@ namespace DiscImageChef.Filesystems return magic == HAMMER_FSBUF_VOLUME || magic == HAMMER_FSBUF_VOLUME_REV; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -130,7 +132,7 @@ namespace DiscImageChef.Filesystems sb.AppendFormat("First volume buffer starts at {0}", hammer_sb.vol_buf_beg).AppendLine(); sb.AppendFormat("Volume ends at {0}", hammer_sb.vol_buf_end).AppendLine(); - xmlFSType = new Schemas.FileSystemType + xmlFSType = new FileSystemType { Clusters = (long)(partition.Size / HAMMER_BIGBLOCK_SIZE), ClusterSize = HAMMER_BIGBLOCK_SIZE, diff --git a/DiscImageChef.Filesystems/HPFS.cs b/DiscImageChef.Filesystems/HPFS.cs index 31450064e..22825d1c2 100644 --- a/DiscImageChef.Filesystems/HPFS.cs +++ b/DiscImageChef.Filesystems/HPFS.cs @@ -36,6 +36,8 @@ using System.Runtime.InteropServices; using System.Text; using DiscImageChef.Checksums; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -57,7 +59,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public HPFS(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public HPFS(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "OS/2 High Performance File System"; PluginUUID = new Guid("33513B2C-f590-4acb-8bf2-0b1d5e19dec5"); @@ -65,7 +67,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(16 + partition.Start >= partition.End) return false; @@ -81,7 +83,7 @@ namespace DiscImageChef.Filesystems return false; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -199,7 +201,7 @@ namespace DiscImageChef.Filesystems if((hpfs_sp.flags2 & 0x40) == 0x40) sb.AppendLine("Unknown flag 0x40 on flags2 is active"); if((hpfs_sp.flags2 & 0x80) == 0x80) sb.AppendLine("Unknown flag 0x80 on flags2 is active"); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); // Theoretically everything from BPB to SB is boot code, should I hash everything or only the sector loaded by BIOS itself? if(hpfs_bpb.jump[0] == 0xEB && hpfs_bpb.jump[1] > 0x3C && hpfs_bpb.jump[1] < 0x80 && diff --git a/DiscImageChef.Filesystems/ISO9660/ISO9660.cs b/DiscImageChef.Filesystems/ISO9660/ISO9660.cs index d4974807f..96cafb707 100644 --- a/DiscImageChef.Filesystems/ISO9660/ISO9660.cs +++ b/DiscImageChef.Filesystems/ISO9660/ISO9660.cs @@ -33,6 +33,7 @@ using System; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; namespace DiscImageChef.Filesystems.ISO9660 { @@ -54,7 +55,7 @@ namespace DiscImageChef.Filesystems.ISO9660 else CurrentEncoding = encoding; } - public ISO9660(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public ISO9660(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "ISO9660 Filesystem"; PluginUUID = new Guid("d812f4d3-c357-400d-90fd-3b22ef786aa8"); diff --git a/DiscImageChef.Filesystems/ISO9660/Info.cs b/DiscImageChef.Filesystems/ISO9660/Info.cs index 0bc990559..ca568fc59 100644 --- a/DiscImageChef.Filesystems/ISO9660/Info.cs +++ b/DiscImageChef.Filesystems/ISO9660/Info.cs @@ -34,14 +34,18 @@ using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; +using DiscImageChef.Checksums; using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.Decoders.Sega; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems.ISO9660 { public partial class ISO9660 : Filesystem { - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { byte VDType; @@ -75,7 +79,7 @@ namespace DiscImageChef.Filesystems.ISO9660 CurrentEncoding.GetString(VDMagic) == CdiMagic; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -221,7 +225,7 @@ namespace DiscImageChef.Filesystems.ISO9660 DecodedVolumeDescriptor decodedVD = new DecodedVolumeDescriptor(); DecodedVolumeDescriptor decodedJolietVD = new DecodedVolumeDescriptor(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); if(pvd == null && hsvd == null && fsvd == null) { @@ -466,9 +470,9 @@ namespace DiscImageChef.Filesystems.ISO9660 } byte[] ipbin_sector = imagePlugin.ReadSector(0 + partition.Start); - Decoders.Sega.CD.IPBin? SegaCD = Decoders.Sega.CD.DecodeIPBin(ipbin_sector); - Decoders.Sega.Saturn.IPBin? Saturn = Decoders.Sega.Saturn.DecodeIPBin(ipbin_sector); - Decoders.Sega.Dreamcast.IPBin? Dreamcast = Decoders.Sega.Dreamcast.DecodeIPBin(ipbin_sector); + CD.IPBin? SegaCD = CD.DecodeIPBin(ipbin_sector); + Saturn.IPBin? Saturn = Decoders.Sega.Saturn.DecodeIPBin(ipbin_sector); + Dreamcast.IPBin? Dreamcast = Decoders.Sega.Dreamcast.DecodeIPBin(ipbin_sector); string fsFormat; if(HighSierra) fsFormat = "High Sierra Format"; @@ -488,7 +492,7 @@ namespace DiscImageChef.Filesystems.ISO9660 if(SegaCD != null) { ISOMetadata.AppendLine("This is a SegaCD / MegaCD disc."); - ISOMetadata.AppendLine(Decoders.Sega.CD.Prettify(SegaCD)); + ISOMetadata.AppendLine(CD.Prettify(SegaCD)); } if(Saturn != null) { @@ -553,7 +557,7 @@ namespace DiscImageChef.Filesystems.ISO9660 if(torito != null) { vd_sector = imagePlugin.ReadSector(torito.Value.catalog_sector + partition.Start); - Checksums.Sha1Context sha1Ctx = new Checksums.Sha1Context(); + Sha1Context sha1Ctx = new Sha1Context(); sha1Ctx.Init(); byte[] boot_image; @@ -730,7 +734,7 @@ namespace DiscImageChef.Filesystems.ISO9660 } exit_torito: - if(refareas.Count > 0) ISOMetadata.Append(suspInformation.ToString()); + if(refareas.Count > 0) ISOMetadata.Append(suspInformation); xmlFSType.Type = fsFormat; diff --git a/DiscImageChef.Filesystems/ISO9660/Structs/CDi.cs b/DiscImageChef.Filesystems/ISO9660/Structs/CDi.cs index 3a0092dc7..8a196cf79 100644 --- a/DiscImageChef.Filesystems/ISO9660/Structs/CDi.cs +++ b/DiscImageChef.Filesystems/ISO9660/Structs/CDi.cs @@ -30,6 +30,7 @@ // Copyright © 2011-2018 Natalia Portillo // ****************************************************************************/ +using System; using System.Runtime.InteropServices; using System.Text; @@ -119,15 +120,15 @@ namespace DiscImageChef.Filesystems.ISO9660 { DecodedVolumeDescriptor decodedVD = new DecodedVolumeDescriptor(); - decodedVD.SystemIdentifier = Encoding.ASCII.GetString(pvd.system_id).TrimEnd().Trim(new[] {'\0'}); - decodedVD.VolumeIdentifier = Encoding.ASCII.GetString(pvd.volume_id).TrimEnd().Trim(new[] {'\0'}); - decodedVD.VolumeSetIdentifier = Encoding.ASCII.GetString(pvd.volume_set_id).TrimEnd().Trim(new[] {'\0'}); - decodedVD.PublisherIdentifier = Encoding.ASCII.GetString(pvd.publisher_id).TrimEnd().Trim(new[] {'\0'}); - decodedVD.DataPreparerIdentifier = Encoding.ASCII.GetString(pvd.preparer_id).TrimEnd().Trim(new[] {'\0'}); + decodedVD.SystemIdentifier = Encoding.ASCII.GetString(pvd.system_id).TrimEnd().Trim('\0'); + decodedVD.VolumeIdentifier = Encoding.ASCII.GetString(pvd.volume_id).TrimEnd().Trim('\0'); + decodedVD.VolumeSetIdentifier = Encoding.ASCII.GetString(pvd.volume_set_id).TrimEnd().Trim('\0'); + decodedVD.PublisherIdentifier = Encoding.ASCII.GetString(pvd.publisher_id).TrimEnd().Trim('\0'); + decodedVD.DataPreparerIdentifier = Encoding.ASCII.GetString(pvd.preparer_id).TrimEnd().Trim('\0'); decodedVD.ApplicationIdentifier = - Encoding.ASCII.GetString(pvd.application_data).TrimEnd().Trim(new[] {'\0'}); + Encoding.ASCII.GetString(pvd.application_data).TrimEnd().Trim('\0'); if(pvd.creation_date[0] == '0' || pvd.creation_date[0] == 0x00) - decodedVD.CreationTime = System.DateTime.MinValue; + decodedVD.CreationTime = DateTime.MinValue; else decodedVD.CreationTime = DateHandlers.HighSierraToDateTime(pvd.creation_date); if(pvd.modification_date[0] == '0' || pvd.modification_date[0] == 0x00) decodedVD.HasModificationTime = false; diff --git a/DiscImageChef.Filesystems/ISO9660/Structs/HighSierra.cs b/DiscImageChef.Filesystems/ISO9660/Structs/HighSierra.cs index 31535a7d1..ea0b7ded7 100644 --- a/DiscImageChef.Filesystems/ISO9660/Structs/HighSierra.cs +++ b/DiscImageChef.Filesystems/ISO9660/Structs/HighSierra.cs @@ -30,6 +30,7 @@ // Copyright © 2011-2018 Natalia Portillo // ****************************************************************************/ +using System; using System.Runtime.InteropServices; using System.Text; @@ -111,15 +112,15 @@ namespace DiscImageChef.Filesystems.ISO9660 { DecodedVolumeDescriptor decodedVD = new DecodedVolumeDescriptor(); - decodedVD.SystemIdentifier = Encoding.ASCII.GetString(pvd.system_id).TrimEnd().Trim(new[] {'\0'}); - decodedVD.VolumeIdentifier = Encoding.ASCII.GetString(pvd.volume_id).TrimEnd().Trim(new[] {'\0'}); - decodedVD.VolumeSetIdentifier = Encoding.ASCII.GetString(pvd.volume_set_id).TrimEnd().Trim(new[] {'\0'}); - decodedVD.PublisherIdentifier = Encoding.ASCII.GetString(pvd.publisher_id).TrimEnd().Trim(new[] {'\0'}); - decodedVD.DataPreparerIdentifier = Encoding.ASCII.GetString(pvd.preparer_id).TrimEnd().Trim(new[] {'\0'}); + decodedVD.SystemIdentifier = Encoding.ASCII.GetString(pvd.system_id).TrimEnd().Trim('\0'); + decodedVD.VolumeIdentifier = Encoding.ASCII.GetString(pvd.volume_id).TrimEnd().Trim('\0'); + decodedVD.VolumeSetIdentifier = Encoding.ASCII.GetString(pvd.volume_set_id).TrimEnd().Trim('\0'); + decodedVD.PublisherIdentifier = Encoding.ASCII.GetString(pvd.publisher_id).TrimEnd().Trim('\0'); + decodedVD.DataPreparerIdentifier = Encoding.ASCII.GetString(pvd.preparer_id).TrimEnd().Trim('\0'); decodedVD.ApplicationIdentifier = - Encoding.ASCII.GetString(pvd.application_data).TrimEnd().Trim(new[] {'\0'}); + Encoding.ASCII.GetString(pvd.application_data).TrimEnd().Trim('\0'); if(pvd.creation_date[0] == '0' || pvd.creation_date[0] == 0x00) - decodedVD.CreationTime = System.DateTime.MinValue; + decodedVD.CreationTime = DateTime.MinValue; else decodedVD.CreationTime = DateHandlers.HighSierraToDateTime(pvd.creation_date); if(pvd.modification_date[0] == '0' || pvd.modification_date[0] == 0x00) decodedVD.HasModificationTime = false; diff --git a/DiscImageChef.Filesystems/ISO9660/Structs/ISO.cs b/DiscImageChef.Filesystems/ISO9660/Structs/ISO.cs index 8a3b213d7..62615f9bb 100644 --- a/DiscImageChef.Filesystems/ISO9660/Structs/ISO.cs +++ b/DiscImageChef.Filesystems/ISO9660/Structs/ISO.cs @@ -30,6 +30,7 @@ // Copyright © 2011-2018 Natalia Portillo // ****************************************************************************/ +using System; using System.Runtime.InteropServices; using System.Text; @@ -169,15 +170,15 @@ namespace DiscImageChef.Filesystems.ISO9660 { DecodedVolumeDescriptor decodedVD = new DecodedVolumeDescriptor(); - decodedVD.SystemIdentifier = Encoding.ASCII.GetString(pvd.system_id).TrimEnd().Trim(new[] {'\0'}); - decodedVD.VolumeIdentifier = Encoding.ASCII.GetString(pvd.volume_id).TrimEnd().Trim(new[] {'\0'}); - decodedVD.VolumeSetIdentifier = Encoding.ASCII.GetString(pvd.volume_set_id).TrimEnd().Trim(new[] {'\0'}); - decodedVD.PublisherIdentifier = Encoding.ASCII.GetString(pvd.publisher_id).TrimEnd().Trim(new[] {'\0'}); - decodedVD.DataPreparerIdentifier = Encoding.ASCII.GetString(pvd.preparer_id).TrimEnd().Trim(new[] {'\0'}); + decodedVD.SystemIdentifier = Encoding.ASCII.GetString(pvd.system_id).TrimEnd().Trim('\0'); + decodedVD.VolumeIdentifier = Encoding.ASCII.GetString(pvd.volume_id).TrimEnd().Trim('\0'); + decodedVD.VolumeSetIdentifier = Encoding.ASCII.GetString(pvd.volume_set_id).TrimEnd().Trim('\0'); + decodedVD.PublisherIdentifier = Encoding.ASCII.GetString(pvd.publisher_id).TrimEnd().Trim('\0'); + decodedVD.DataPreparerIdentifier = Encoding.ASCII.GetString(pvd.preparer_id).TrimEnd().Trim('\0'); decodedVD.ApplicationIdentifier = - Encoding.ASCII.GetString(pvd.application_data).TrimEnd().Trim(new[] {'\0'}); + Encoding.ASCII.GetString(pvd.application_data).TrimEnd().Trim('\0'); if(pvd.creation_date[0] == '0' || pvd.creation_date[0] == 0x00) - decodedVD.CreationTime = System.DateTime.MinValue; + decodedVD.CreationTime = DateTime.MinValue; else decodedVD.CreationTime = DateHandlers.ISO9660ToDateTime(pvd.creation_date); if(pvd.modification_date[0] == '0' || pvd.modification_date[0] == 0x00) decodedVD.HasModificationTime = false; diff --git a/DiscImageChef.Filesystems/ISO9660/Structs/Joliet.cs b/DiscImageChef.Filesystems/ISO9660/Structs/Joliet.cs index 7efe9d1dd..d4c36491e 100644 --- a/DiscImageChef.Filesystems/ISO9660/Structs/Joliet.cs +++ b/DiscImageChef.Filesystems/ISO9660/Structs/Joliet.cs @@ -30,6 +30,7 @@ // Copyright © 2011-2018 Natalia Portillo // ****************************************************************************/ +using System; using System.Text; namespace DiscImageChef.Filesystems.ISO9660 @@ -41,19 +42,19 @@ namespace DiscImageChef.Filesystems.ISO9660 DecodedVolumeDescriptor decodedVD = new DecodedVolumeDescriptor(); decodedVD.SystemIdentifier = - Encoding.BigEndianUnicode.GetString(jolietvd.system_id).TrimEnd().Trim(new[] {'\u0000'}); + Encoding.BigEndianUnicode.GetString(jolietvd.system_id).TrimEnd().Trim('\u0000'); decodedVD.VolumeIdentifier = - Encoding.BigEndianUnicode.GetString(jolietvd.volume_id).TrimEnd().Trim(new[] {'\u0000'}); + Encoding.BigEndianUnicode.GetString(jolietvd.volume_id).TrimEnd().Trim('\u0000'); decodedVD.VolumeSetIdentifier = Encoding.BigEndianUnicode.GetString(jolietvd.volume_set_id).TrimEnd() - .Trim(new[] {'\u0000'}); + .Trim('\u0000'); decodedVD.PublisherIdentifier = - Encoding.BigEndianUnicode.GetString(jolietvd.publisher_id).TrimEnd().Trim(new[] {'\u0000'}); + Encoding.BigEndianUnicode.GetString(jolietvd.publisher_id).TrimEnd().Trim('\u0000'); decodedVD.DataPreparerIdentifier = - Encoding.BigEndianUnicode.GetString(jolietvd.preparer_id).TrimEnd().Trim(new[] {'\u0000'}); + Encoding.BigEndianUnicode.GetString(jolietvd.preparer_id).TrimEnd().Trim('\u0000'); decodedVD.ApplicationIdentifier = Encoding.BigEndianUnicode.GetString(jolietvd.application_id).TrimEnd() - .Trim(new[] {'\u0000'}); + .Trim('\u0000'); if(jolietvd.creation_date[0] < 0x31 || jolietvd.creation_date[0] > 0x39) - decodedVD.CreationTime = System.DateTime.MinValue; + decodedVD.CreationTime = DateTime.MinValue; else decodedVD.CreationTime = DateHandlers.ISO9660ToDateTime(jolietvd.creation_date); if(jolietvd.modification_date[0] < 0x31 || jolietvd.modification_date[0] > 0x39) decodedVD.HasModificationTime = false; diff --git a/DiscImageChef.Filesystems/JFS.cs b/DiscImageChef.Filesystems/JFS.cs index 10c88a755..30ced7d26 100644 --- a/DiscImageChef.Filesystems/JFS.cs +++ b/DiscImageChef.Filesystems/JFS.cs @@ -35,6 +35,8 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -147,7 +149,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public JFS(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public JFS(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "JFS Plugin"; PluginUUID = new Guid("D3BE2A41-8F28-4055-94DC-BB6C72A0E9C4"); @@ -155,7 +157,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { uint bootSectors = JFS_BootBlocksSize / imagePlugin.GetSectorSize(); if(partition.Start + bootSectors >= partition.End) return false; @@ -172,7 +174,7 @@ namespace DiscImageChef.Filesystems return jfsSb.s_magic == JFS_Magic; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -226,7 +228,7 @@ namespace DiscImageChef.Filesystems else sb.AppendFormat("Volume name: {0}", CurrentEncoding.GetString(jfsSb.s_label)).AppendLine(); sb.AppendFormat("Volume UUID: {0}", jfsSb.s_uuid).AppendLine(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.Type = "JFS filesystem"; xmlFSType.Clusters = (long)jfsSb.s_size; xmlFSType.ClusterSize = (int)jfsSb.s_bsize; @@ -239,7 +241,6 @@ namespace DiscImageChef.Filesystems if(jfsSb.s_state != 0) xmlFSType.Dirty = true; information = sb.ToString(); - return; } public override Errno Mount() diff --git a/DiscImageChef.Filesystems/LIF.cs b/DiscImageChef.Filesystems/LIF.cs index 194ae2e99..4fa2ede12 100644 --- a/DiscImageChef.Filesystems/LIF.cs +++ b/DiscImageChef.Filesystems/LIF.cs @@ -36,6 +36,8 @@ using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -76,7 +78,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public LIF(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public LIF(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "HP Logical Interchange Format Plugin"; PluginUUID = new Guid("41535647-77A5-477B-9206-DA727ACDC704"); @@ -84,7 +86,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(imagePlugin.GetSectorSize() < 256) return false; @@ -97,7 +99,7 @@ namespace DiscImageChef.Filesystems return LIFSb.magic == LIF_Magic; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -128,7 +130,7 @@ namespace DiscImageChef.Filesystems information = sb.ToString(); - xmlFSType = new Schemas.FileSystemType + xmlFSType = new FileSystemType { Type = "HP Logical Interchange Format", ClusterSize = 256, diff --git a/DiscImageChef.Filesystems/LisaFS/File.cs b/DiscImageChef.Filesystems/LisaFS/File.cs index 65a02e689..6526a2747 100644 --- a/DiscImageChef.Filesystems/LisaFS/File.cs +++ b/DiscImageChef.Filesystems/LisaFS/File.cs @@ -383,7 +383,7 @@ namespace DiscImageChef.Filesystems.LisaFS if(!mounted) return Errno.AccessDenied; - string[] pathElements = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length == 0) { diff --git a/DiscImageChef.Filesystems/LisaFS/Info.cs b/DiscImageChef.Filesystems/LisaFS/Info.cs index 5862a8c76..8ca1109c7 100644 --- a/DiscImageChef.Filesystems/LisaFS/Info.cs +++ b/DiscImageChef.Filesystems/LisaFS/Info.cs @@ -36,6 +36,7 @@ using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.Decoders; using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems.LisaFS { @@ -349,7 +350,7 @@ namespace DiscImageChef.Filesystems.LisaFS information = sb.ToString(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); if(DateTime.Compare(info_mddf.dtvb, DateHandlers.LisaToDateTime(0)) > 0) { xmlFSType.BackupDate = info_mddf.dtvb; @@ -373,13 +374,10 @@ namespace DiscImageChef.Filesystems.LisaFS return; } - - return; } catch(Exception ex) { DicConsole.ErrorWriteLine("Exception {0}, {1}, {2}", ex.Message, ex.InnerException, ex.StackTrace); - return; } } } diff --git a/DiscImageChef.Filesystems/LisaFS/LisaFS.cs b/DiscImageChef.Filesystems/LisaFS/LisaFS.cs index 331525be8..c0b9af0d5 100644 --- a/DiscImageChef.Filesystems/LisaFS/LisaFS.cs +++ b/DiscImageChef.Filesystems/LisaFS/LisaFS.cs @@ -32,9 +32,10 @@ using System; using System.Collections.Generic; -using System.Text; +using Claunia.Encoding; using DiscImageChef.CommonTypes; using DiscImageChef.DiscImages; +using Encoding = System.Text.Encoding; namespace DiscImageChef.Filesystems.LisaFS { @@ -72,14 +73,14 @@ namespace DiscImageChef.Filesystems.LisaFS { Name = "Apple Lisa File System"; PluginUUID = new Guid("7E6034D1-D823-4248-A54D-239742B28391"); - CurrentEncoding = new Claunia.Encoding.LisaRoman(); + CurrentEncoding = new LisaRoman(); } public LisaFS(Encoding encoding) { Name = "Apple Lisa File System"; PluginUUID = new Guid("7E6034D1-D823-4248-A54D-239742B28391"); - CurrentEncoding = new Claunia.Encoding.LisaRoman(); + CurrentEncoding = new LisaRoman(); } public LisaFS(ImagePlugin imagePlugin, Partition partition, Encoding encoding) @@ -87,7 +88,7 @@ namespace DiscImageChef.Filesystems.LisaFS device = imagePlugin; Name = "Apple Lisa File System"; PluginUUID = new Guid("7E6034D1-D823-4248-A54D-239742B28391"); - CurrentEncoding = new Claunia.Encoding.LisaRoman(); + CurrentEncoding = new LisaRoman(); } } } \ No newline at end of file diff --git a/DiscImageChef.Filesystems/LisaFS/Super.cs b/DiscImageChef.Filesystems/LisaFS/Super.cs index ce33bf16d..c163d38fc 100644 --- a/DiscImageChef.Filesystems/LisaFS/Super.cs +++ b/DiscImageChef.Filesystems/LisaFS/Super.cs @@ -35,6 +35,7 @@ using System.Collections.Generic; using DiscImageChef.Console; using DiscImageChef.Decoders; using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems.LisaFS { @@ -289,7 +290,7 @@ namespace DiscImageChef.Filesystems.LisaFS } // Create XML metadata for mounted filesystem - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); if(DateTime.Compare(mddf.dtvb, DateHandlers.LisaToDateTime(0)) > 0) { xmlFSType.BackupDate = mddf.dtvb; diff --git a/DiscImageChef.Filesystems/Locus.cs b/DiscImageChef.Filesystems/Locus.cs index fc95542b7..4b4edb900 100644 --- a/DiscImageChef.Filesystems/Locus.cs +++ b/DiscImageChef.Filesystems/Locus.cs @@ -36,6 +36,8 @@ using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.DiscImages; +using Schemas; // Commit count using commitcnt_t = System.Int32; // Disk address @@ -205,7 +207,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public Locus(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public Locus(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "Locus Filesystem Plugin"; PluginUUID = new Guid("1A70B30A-437D-479A-88E1-D0C9C1797FF4"); @@ -213,7 +215,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(imagePlugin.GetSectorSize() < 512) return false; @@ -243,7 +245,7 @@ namespace DiscImageChef.Filesystems return false; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -343,7 +345,7 @@ namespace DiscImageChef.Filesystems information = sb.ToString(); - xmlFSType = new Schemas.FileSystemType + xmlFSType = new FileSystemType { Type = "Locus filesystem", ClusterSize = blockSize, diff --git a/DiscImageChef.Filesystems/MicroDOS.cs b/DiscImageChef.Filesystems/MicroDOS.cs index 8968d3c17..a1d3e1f38 100644 --- a/DiscImageChef.Filesystems/MicroDOS.cs +++ b/DiscImageChef.Filesystems/MicroDOS.cs @@ -35,6 +35,8 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -60,7 +62,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public MicroDOS(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public MicroDOS(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "MicroDOS file system"; PluginUUID = new Guid("9F9A364A-1A27-48A3-B730-7A7122000324"); @@ -68,7 +70,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(1 + partition.Start >= partition.End) return false; @@ -85,7 +87,7 @@ namespace DiscImageChef.Filesystems return block0.label == magic && block0.mklabel == magic2; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -106,7 +108,7 @@ namespace DiscImageChef.Filesystems sb.AppendFormat("Volume contains {0} files", block0.files).AppendLine(); sb.AppendFormat("First used block is {0}", block0.firstUsedBlock).AppendLine(); - xmlFSType = new Schemas.FileSystemType + xmlFSType = new FileSystemType { Type = "MicroDOS", ClusterSize = 512, diff --git a/DiscImageChef.Filesystems/MinixFS.cs b/DiscImageChef.Filesystems/MinixFS.cs index 5112f01a4..ee499706c 100644 --- a/DiscImageChef.Filesystems/MinixFS.cs +++ b/DiscImageChef.Filesystems/MinixFS.cs @@ -35,6 +35,8 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -78,7 +80,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public MinixFS(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public MinixFS(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "Minix Filesystem"; PluginUUID = new Guid("FE248C3B-B727-4AE5-A39F-79EA9A07D4B3"); @@ -86,12 +88,12 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { uint sector = 2; uint offset = 0; - if(imagePlugin.ImageInfo.XmlMediaType == DiscImages.XmlMediaType.OpticalDisc) + if(imagePlugin.ImageInfo.XmlMediaType == XmlMediaType.OpticalDisc) { sector = 0; offset = 0x400; @@ -124,7 +126,7 @@ namespace DiscImageChef.Filesystems return false; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -134,7 +136,7 @@ namespace DiscImageChef.Filesystems uint sector = 2; uint offset = 0; - if(imagePlugin.ImageInfo.XmlMediaType == DiscImages.XmlMediaType.OpticalDisc) + if(imagePlugin.ImageInfo.XmlMediaType == XmlMediaType.OpticalDisc) { sector = 0; offset = 0x400; @@ -156,7 +158,7 @@ namespace DiscImageChef.Filesystems magic = BitConverter.ToUInt16(minix_sb_sector, 0x018); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); bool littleEndian = true; diff --git a/DiscImageChef.Filesystems/NILFS2.cs b/DiscImageChef.Filesystems/NILFS2.cs index ca21be782..eb4b9e985 100644 --- a/DiscImageChef.Filesystems/NILFS2.cs +++ b/DiscImageChef.Filesystems/NILFS2.cs @@ -35,6 +35,8 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -111,7 +113,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public NILFS2(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public NILFS2(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "NILFS2 Plugin"; PluginUUID = new Guid("35224226-C5CC-48B5-8FFD-3781E91E86B6"); @@ -119,7 +121,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(imagePlugin.GetSectorSize() < 512) return false; @@ -144,7 +146,7 @@ namespace DiscImageChef.Filesystems return nilfsSb.magic == NILFS2_Magic; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -190,7 +192,7 @@ namespace DiscImageChef.Filesystems information = sb.ToString(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.Type = "NILFS2 filesystem"; if(nilfsSb.creator_os == 0) xmlFSType.SystemIdentifier = "Linux"; xmlFSType.ClusterSize = 1 << (int)(nilfsSb.log_block_size + 10); diff --git a/DiscImageChef.Filesystems/NTFS.cs b/DiscImageChef.Filesystems/NTFS.cs index fd53b5a99..98aa64702 100644 --- a/DiscImageChef.Filesystems/NTFS.cs +++ b/DiscImageChef.Filesystems/NTFS.cs @@ -36,6 +36,8 @@ using System.Runtime.InteropServices; using System.Text; using DiscImageChef.Checksums; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -56,14 +58,14 @@ namespace DiscImageChef.Filesystems CurrentEncoding = Encoding.Unicode; } - public NTFS(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public NTFS(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "New Technology File System (NTFS)"; PluginUUID = new Guid("33513B2C-1e6d-4d21-a660-0bbc789c3871"); CurrentEncoding = Encoding.Unicode; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(2 + partition.Start >= partition.End) return false; @@ -92,7 +94,7 @@ namespace DiscImageChef.Filesystems return signature == 0xAA55; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -141,7 +143,7 @@ namespace DiscImageChef.Filesystems sb.AppendFormat("Volume serial number: {0:X16}", ntfs_bb.serial_no).AppendLine(); // sb.AppendFormat("Signature 2: 0x{0:X4}", ntfs_bb.signature2).AppendLine(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); if(ntfs_bb.jump[0] == 0xEB && ntfs_bb.jump[1] > 0x4E && ntfs_bb.jump[1] < 0x80 && ntfs_bb.signature2 == 0xAA55) diff --git a/DiscImageChef.Filesystems/Nintendo.cs b/DiscImageChef.Filesystems/Nintendo.cs index fb84337e8..03f1edc4e 100644 --- a/DiscImageChef.Filesystems/Nintendo.cs +++ b/DiscImageChef.Filesystems/Nintendo.cs @@ -35,6 +35,8 @@ using System.Collections.Generic; using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -55,7 +57,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public NintendoPlugin(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public NintendoPlugin(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "Nintendo optical filesystems"; PluginUUID = new Guid("4675fcb4-4418-4288-9e4a-33d6a4ac1126"); @@ -63,7 +65,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(partition.Start != 0) return false; @@ -81,12 +83,12 @@ namespace DiscImageChef.Filesystems return false; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { StringBuilder sbInformation = new StringBuilder(); information = ""; - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); NintendoFields fields = new NintendoFields(); BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian; diff --git a/DiscImageChef.Filesystems/ODS.cs b/DiscImageChef.Filesystems/ODS.cs index bc2cf774b..233398744 100644 --- a/DiscImageChef.Filesystems/ODS.cs +++ b/DiscImageChef.Filesystems/ODS.cs @@ -36,6 +36,8 @@ using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -65,7 +67,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public ODS(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public ODS(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "Files-11 On-Disk Structure"; PluginUUID = new Guid("de20633c-8021-4384-aeb0-83b0df14491f"); @@ -73,7 +75,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(2 + partition.Start >= partition.End) return false; @@ -91,7 +93,7 @@ namespace DiscImageChef.Filesystems if(magic == "DECFILE11A " || magic == "DECFILE11B ") return true; // Optical disc - if(imagePlugin.ImageInfo.XmlMediaType != DiscImages.XmlMediaType.OpticalDisc) return false; + if(imagePlugin.ImageInfo.XmlMediaType != XmlMediaType.OpticalDisc) return false; if(hb_sector.Length < 0x400) return false; @@ -107,7 +109,7 @@ namespace DiscImageChef.Filesystems return false; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -125,7 +127,7 @@ namespace DiscImageChef.Filesystems handle.Free(); // Optical disc - if(imagePlugin.ImageInfo.XmlMediaType == DiscImages.XmlMediaType.OpticalDisc && + if(imagePlugin.ImageInfo.XmlMediaType == XmlMediaType.OpticalDisc && StringHandlers.CToString(homeblock.format) != "DECFILE11A " && StringHandlers.CToString(homeblock.format) != "DECFILE11B ") { @@ -242,7 +244,7 @@ namespace DiscImageChef.Filesystems sb.AppendFormat("File protection: 0x{0:X4}", homeblock.fileprot).AppendLine(); sb.AppendFormat("Record protection: 0x{0:X4}", homeblock.recprot).AppendLine(); - xmlFSType = new Schemas.FileSystemType + xmlFSType = new FileSystemType { Type = "FILES-11", ClusterSize = homeblock.cluster * 512, diff --git a/DiscImageChef.Filesystems/Opera.cs b/DiscImageChef.Filesystems/Opera.cs index 2e93f8348..bc5e78057 100644 --- a/DiscImageChef.Filesystems/Opera.cs +++ b/DiscImageChef.Filesystems/Opera.cs @@ -35,6 +35,8 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -55,7 +57,7 @@ namespace DiscImageChef.Filesystems CurrentEncoding = Encoding.ASCII; } - public OperaFS(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public OperaFS(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "Opera Filesystem Plugin"; PluginUUID = new Guid("0ec84ec7-eae6-4196-83fe-943b3fe46dbd"); @@ -63,7 +65,7 @@ namespace DiscImageChef.Filesystems CurrentEncoding = Encoding.ASCII; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(2 + partition.Start >= partition.End) return false; @@ -82,7 +84,7 @@ namespace DiscImageChef.Filesystems return Encoding.ASCII.GetString(sync_bytes) == "ZZZZZ"; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -135,7 +137,7 @@ namespace DiscImageChef.Filesystems information = SuperBlockMetadata.ToString(); - xmlFSType = new Schemas.FileSystemType + xmlFSType = new FileSystemType { Type = "Opera", VolumeName = StringHandlers.CToString(sb.volume_label, CurrentEncoding), diff --git a/DiscImageChef.Filesystems/PCEngine.cs b/DiscImageChef.Filesystems/PCEngine.cs index a91a1faf1..66b134062 100644 --- a/DiscImageChef.Filesystems/PCEngine.cs +++ b/DiscImageChef.Filesystems/PCEngine.cs @@ -34,6 +34,8 @@ using System; using System.Collections.Generic; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -54,7 +56,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public PCEnginePlugin(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public PCEnginePlugin(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "PC Engine CD Plugin"; PluginUUID = new Guid("e5ee6d7c-90fa-49bd-ac89-14ef750b8af3"); @@ -62,7 +64,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(2 + partition.Start >= partition.End) return false; @@ -74,11 +76,11 @@ namespace DiscImageChef.Filesystems return Encoding.ASCII.GetString(system_descriptor) == "PC Engine CD-ROM SYSTEM"; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.Type = "PC Engine filesystem"; xmlFSType.Clusters = (long)((partition.End - partition.Start + 1) / imagePlugin.GetSectorSize() * 2048); xmlFSType.ClusterSize = 2048; diff --git a/DiscImageChef.Filesystems/PFS.cs b/DiscImageChef.Filesystems/PFS.cs index 8280df5e0..4be59c5ca 100644 --- a/DiscImageChef.Filesystems/PFS.cs +++ b/DiscImageChef.Filesystems/PFS.cs @@ -35,6 +35,8 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -55,7 +57,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public PFS(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public PFS(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "Professional File System"; PluginUUID = new Guid("68DE769E-D957-406A-8AE4-3781CA8CDA77"); @@ -185,7 +187,7 @@ namespace DiscImageChef.Filesystems /// const uint MUPFS_DISK = 0x6D755046; - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(partition.Length < 3) return false; @@ -199,7 +201,7 @@ namespace DiscImageChef.Filesystems magic == MUPFS_DISK; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { byte[] RootBlockSector = imagePlugin.ReadSector(2 + partition.Start); @@ -207,7 +209,7 @@ namespace DiscImageChef.Filesystems rootBlock = BigEndianMarshal.ByteArrayToStructureBigEndian(RootBlockSector); StringBuilder sbInformation = new StringBuilder(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); switch(rootBlock.diskType) { diff --git a/DiscImageChef.Filesystems/ProDOS.cs b/DiscImageChef.Filesystems/ProDOS.cs index 6f4c7cda9..599dff5c2 100644 --- a/DiscImageChef.Filesystems/ProDOS.cs +++ b/DiscImageChef.Filesystems/ProDOS.cs @@ -34,8 +34,12 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; +using Claunia.Encoding; using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.DiscImages; +using Schemas; +using Encoding = System.Text.Encoding; namespace DiscImageChef.Filesystems { @@ -84,7 +88,7 @@ namespace DiscImageChef.Filesystems { Name = "Apple ProDOS filesystem"; PluginUUID = new Guid("43874265-7B8A-4739-BCF7-07F80D5932BF"); - CurrentEncoding = new Claunia.Encoding.LisaRoman(); + CurrentEncoding = new LisaRoman(); } public ProDOSPlugin(Encoding encoding) @@ -92,18 +96,18 @@ namespace DiscImageChef.Filesystems Name = "Apple ProDOS filesystem"; PluginUUID = new Guid("43874265-7B8A-4739-BCF7-07F80D5932BF"); // TODO: Until Apple ][ encoding is implemented - CurrentEncoding = new Claunia.Encoding.LisaRoman(); + CurrentEncoding = new LisaRoman(); } - public ProDOSPlugin(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public ProDOSPlugin(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "Apple ProDOS filesystem"; PluginUUID = new Guid("43874265-7B8A-4739-BCF7-07F80D5932BF"); // TODO: Until Apple ][ encoding is implemented - CurrentEncoding = new Claunia.Encoding.LisaRoman(); + CurrentEncoding = new LisaRoman(); } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(partition.Length < 3) return false; @@ -153,7 +157,7 @@ namespace DiscImageChef.Filesystems return total_blocks <= partition.End - partition.Start + 1; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { StringBuilder sbInformation = new StringBuilder(); @@ -288,7 +292,7 @@ namespace DiscImageChef.Filesystems information = sbInformation.ToString(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.VolumeName = rootDirectoryKeyBlock.header.volume_name; if(dateCorrect) { @@ -301,8 +305,6 @@ namespace DiscImageChef.Filesystems xmlFSType.ClusterSize = (int)((partition.End - partition.Start + 1) * imagePlugin.ImageInfo.SectorSize / (ulong)xmlFSType.Clusters); xmlFSType.Type = "ProDOS"; - - return; } public override Errno Mount() diff --git a/DiscImageChef.Filesystems/QNX4.cs b/DiscImageChef.Filesystems/QNX4.cs index 049365c5f..c9e39ad55 100644 --- a/DiscImageChef.Filesystems/QNX4.cs +++ b/DiscImageChef.Filesystems/QNX4.cs @@ -36,6 +36,8 @@ using System.Linq; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -118,7 +120,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public QNX4(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public QNX4(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "QNX4 Plugin"; PluginUUID = new Guid("E73A63FA-B5B0-48BF-BF82-DA5F0A8170D2"); @@ -126,7 +128,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(partition.Start + 1 >= imagePlugin.GetSectors()) return false; @@ -160,7 +162,7 @@ namespace DiscImageChef.Filesystems return true; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -251,7 +253,7 @@ namespace DiscImageChef.Filesystems information = string.Format("QNX4 filesystem\nCreated on {0}\n", DateHandlers.UNIXUnsignedToDateTime(qnxSb.rootDir.di_ftime)); - xmlFSType = new Schemas.FileSystemType + xmlFSType = new FileSystemType { Type = "QNX4 filesystem", Clusters = (long)partition.Length, diff --git a/DiscImageChef.Filesystems/QNX6.cs b/DiscImageChef.Filesystems/QNX6.cs index 40c5e3c56..ab7aa83f2 100644 --- a/DiscImageChef.Filesystems/QNX6.cs +++ b/DiscImageChef.Filesystems/QNX6.cs @@ -35,6 +35,8 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -113,7 +115,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public QNX6(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public QNX6(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "QNX6 Plugin"; PluginUUID = new Guid("3E610EA2-4D08-4D70-8947-830CD4C74FC0"); @@ -121,7 +123,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { uint sectors = QNX6_SuperBlockSize / imagePlugin.GetSectorSize(); uint bootSectors = QNX6_BootBlocksSize / imagePlugin.GetSectorSize(); @@ -147,7 +149,7 @@ namespace DiscImageChef.Filesystems return qnxSb.magic == QNX6_Magic || audiSb.magic == QNX6_Magic; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -184,7 +186,7 @@ namespace DiscImageChef.Filesystems audiSb.freeBlocks * audiSb.blockSize, audiSb.numBlocks, audiSb.numBlocks * audiSb.blockSize).AppendLine(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.Type = "QNX6 (Audi) filesystem"; xmlFSType.Clusters = audiSb.numBlocks; xmlFSType.ClusterSize = (int)audiSb.blockSize; @@ -215,7 +217,7 @@ namespace DiscImageChef.Filesystems qnxSb.freeBlocks * qnxSb.blockSize, qnxSb.numBlocks, qnxSb.numBlocks * qnxSb.blockSize) .AppendLine(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.Type = "QNX6 filesystem"; xmlFSType.Clusters = qnxSb.numBlocks; xmlFSType.ClusterSize = (int)qnxSb.blockSize; @@ -232,7 +234,6 @@ namespace DiscImageChef.Filesystems xmlFSType.ModificationDateSpecified = true; information = sb.ToString(); - return; } public override Errno Mount() diff --git a/DiscImageChef.Filesystems/RBF.cs b/DiscImageChef.Filesystems/RBF.cs index aeaae7889..09a8e09ed 100644 --- a/DiscImageChef.Filesystems/RBF.cs +++ b/DiscImageChef.Filesystems/RBF.cs @@ -36,6 +36,8 @@ using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -165,7 +167,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public RBF(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public RBF(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "OS-9 Random Block File Plugin"; PluginUUID = new Guid("E864E45B-0B52-4D29-A858-7BDFA9199FB2"); @@ -173,7 +175,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(imagePlugin.GetSectorSize() < 256) return false; @@ -206,7 +208,7 @@ namespace DiscImageChef.Filesystems return false; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -275,7 +277,7 @@ namespace DiscImageChef.Filesystems sb.AppendFormat("Volume name: {0}", StringHandlers.CToString(RBF9000Sb.rid_name, CurrentEncoding)) .AppendLine(); - xmlFSType = new Schemas.FileSystemType + xmlFSType = new FileSystemType { Type = "OS-9 Random Block File", Bootable = RBF9000Sb.rid_bootfile > 0, @@ -323,7 +325,7 @@ namespace DiscImageChef.Filesystems sb.AppendFormat("Path descriptor options: {0}", StringHandlers.CToString(RBFSb.dd_opt, CurrentEncoding)) .AppendLine(); - xmlFSType = new Schemas.FileSystemType + xmlFSType = new FileSystemType { Type = "OS-9 Random Block File", Bootable = LSNToUInt32(RBFSb.dd_bt) > 0 && RBFSb.dd_bsz > 0, diff --git a/DiscImageChef.Filesystems/RT11.cs b/DiscImageChef.Filesystems/RT11.cs index 105fb8940..3cd09b88d 100644 --- a/DiscImageChef.Filesystems/RT11.cs +++ b/DiscImageChef.Filesystems/RT11.cs @@ -35,6 +35,8 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -57,7 +59,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public RT11(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public RT11(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "RT-11 file system"; PluginUUID = new Guid("DB3E2F98-8F98-463C-8126-E937843DA024"); @@ -65,7 +67,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(1 + partition.Start >= partition.End) return false; @@ -81,7 +83,7 @@ namespace DiscImageChef.Filesystems return magic == "DECRT11A "; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -120,7 +122,7 @@ namespace DiscImageChef.Filesystems byte[] bootBlock = imagePlugin.ReadSector(0); - xmlFSType = new Schemas.FileSystemType + xmlFSType = new FileSystemType { Type = "RT-11", ClusterSize = homeblock.cluster * 512, diff --git a/DiscImageChef.Filesystems/Reiser.cs b/DiscImageChef.Filesystems/Reiser.cs index ed1438da7..fad312ada 100644 --- a/DiscImageChef.Filesystems/Reiser.cs +++ b/DiscImageChef.Filesystems/Reiser.cs @@ -36,6 +36,8 @@ using System.Linq; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -103,7 +105,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public Reiser(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public Reiser(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "Reiser Filesystem Plugin"; PluginUUID = new Guid("1D8CD8B8-27E6-410F-9973-D16409225FBA"); @@ -111,7 +113,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(imagePlugin.GetSectorSize() < 512) return false; @@ -137,7 +139,7 @@ namespace DiscImageChef.Filesystems ReiserJr_Magic.SequenceEqual(reiserSb.magic); } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -182,7 +184,7 @@ namespace DiscImageChef.Filesystems information = sb.ToString(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); if(Reiser35_Magic.SequenceEqual(reiserSb.magic)) xmlFSType.Type = "Reiser 3.5 filesystem"; else if(Reiser36_Magic.SequenceEqual(reiserSb.magic)) xmlFSType.Type = "Reiser 3.6 filesystem"; else if(ReiserJr_Magic.SequenceEqual(reiserSb.magic)) xmlFSType.Type = "Reiser Jr. filesystem"; diff --git a/DiscImageChef.Filesystems/Reiser4.cs b/DiscImageChef.Filesystems/Reiser4.cs index 30a8b417c..889ade93e 100644 --- a/DiscImageChef.Filesystems/Reiser4.cs +++ b/DiscImageChef.Filesystems/Reiser4.cs @@ -36,6 +36,8 @@ using System.Linq; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -70,7 +72,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public Reiser4(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public Reiser4(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "Reiser4 Filesystem Plugin"; PluginUUID = new Guid("301F2D00-E8D5-4F04-934E-81DFB21D15BA"); @@ -78,7 +80,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(imagePlugin.GetSectorSize() < 512) return false; @@ -103,7 +105,7 @@ namespace DiscImageChef.Filesystems return Reiser4_Magic.SequenceEqual(reiserSb.magic); } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -137,7 +139,7 @@ namespace DiscImageChef.Filesystems information = sb.ToString(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.Type = "Reiser 4 filesystem"; xmlFSType.ClusterSize = reiserSb.blocksize; xmlFSType.Clusters = diff --git a/DiscImageChef.Filesystems/SFS.cs b/DiscImageChef.Filesystems/SFS.cs index 930e917a1..34e994373 100644 --- a/DiscImageChef.Filesystems/SFS.cs +++ b/DiscImageChef.Filesystems/SFS.cs @@ -35,6 +35,8 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -55,7 +57,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public SFS(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public SFS(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "SmartFileSystem"; PluginUUID = new Guid("26550C19-3671-4A2D-BC2F-F20CEB7F48DC"); @@ -102,7 +104,7 @@ namespace DiscImageChef.Filesystems /// Identifier for SFS v2 const uint SFS2_MAGIC = 0x53465302; - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(partition.Start >= partition.End) return false; @@ -115,7 +117,7 @@ namespace DiscImageChef.Filesystems return magic == SFS_MAGIC || magic == SFS2_MAGIC; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { byte[] RootBlockSector = imagePlugin.ReadSector(partition.Start); @@ -149,7 +151,7 @@ namespace DiscImageChef.Filesystems sbInformation.AppendLine("Volume moves deleted files to a recycled folder"); information = sbInformation.ToString(); - xmlFSType = new Schemas.FileSystemType + xmlFSType = new FileSystemType { CreationDate = DateHandlers.UNIXUnsignedToDateTime(rootBlock.datecreated).AddYears(8), CreationDateSpecified = true, diff --git a/DiscImageChef.Filesystems/SolarFS.cs b/DiscImageChef.Filesystems/SolarFS.cs index fbef4715f..4c9b85d9e 100644 --- a/DiscImageChef.Filesystems/SolarFS.cs +++ b/DiscImageChef.Filesystems/SolarFS.cs @@ -35,6 +35,8 @@ using System.Collections.Generic; using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -56,7 +58,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public SolarFS(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public SolarFS(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "Solar_OS filesystem"; PluginUUID = new Guid("EA3101C1-E777-4B4F-B5A3-8C57F50F6E65"); @@ -64,7 +66,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(2 + partition.Start >= partition.End) return false; @@ -84,7 +86,7 @@ namespace DiscImageChef.Filesystems return false; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -165,7 +167,7 @@ namespace DiscImageChef.Filesystems sb.AppendFormat("{0} sectors per track", BPB.sptrk).AppendLine(); sb.AppendFormat("Volume name: {0}", BPB.vol_name).AppendLine(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.Type = "SolarFS"; xmlFSType.Clusters = BPB.sectors; xmlFSType.ClusterSize = BPB.bps; diff --git a/DiscImageChef.Filesystems/Squash.cs b/DiscImageChef.Filesystems/Squash.cs index 35c7bbc52..ed1725204 100644 --- a/DiscImageChef.Filesystems/Squash.cs +++ b/DiscImageChef.Filesystems/Squash.cs @@ -35,6 +35,8 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -55,7 +57,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public Squash(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public Squash(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "Squash filesystem"; PluginUUID = new Guid("F8F6E46F-7A2A-48E3-9C0A-46AF4DC29E09"); @@ -103,7 +105,7 @@ namespace DiscImageChef.Filesystems const uint Squash_MAGIC = 0x73717368; const uint Squash_CIGAM = 0x68737173; - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(partition.Start >= partition.End) return false; @@ -114,7 +116,7 @@ namespace DiscImageChef.Filesystems return magic == Squash_MAGIC || magic == Squash_CIGAM; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { byte[] sector = imagePlugin.ReadSector(partition.Start); @@ -175,7 +177,7 @@ namespace DiscImageChef.Filesystems information = sbInformation.ToString(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.Type = "Squash file system"; xmlFSType.CreationDate = DateHandlers.UNIXUnsignedToDateTime(sqSb.mkfs_time); xmlFSType.CreationDateSpecified = true; diff --git a/DiscImageChef.Filesystems/Symbian.cs b/DiscImageChef.Filesystems/Symbian.cs index 5b85192f4..331ad27fb 100644 --- a/DiscImageChef.Filesystems/Symbian.cs +++ b/DiscImageChef.Filesystems/Symbian.cs @@ -30,11 +30,7 @@ // Copyright © 2011-2018 Natalia Portillo // ****************************************************************************/ -using System; -using System.IO; -using System.Text; -using DiscImageChef; -using System.Collections.Generic; + // Information from http://www.thoukydides.webspace.virginmedia.com/software/psifs/sis.html // TODO: Implement support for disc images diff --git a/DiscImageChef.Filesystems/SysV.cs b/DiscImageChef.Filesystems/SysV.cs index 1b96f07fd..863b17e2d 100644 --- a/DiscImageChef.Filesystems/SysV.cs +++ b/DiscImageChef.Filesystems/SysV.cs @@ -35,6 +35,8 @@ using System.Collections.Generic; using System.Linq; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -74,7 +76,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public SysVfs(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public SysVfs(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "UNIX System V filesystem"; PluginUUID = new Guid("9B8D016A-8561-400E-A12A-A198283C211D"); @@ -82,7 +84,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(2 + partition.Start >= partition.End) return false; @@ -186,7 +188,7 @@ namespace DiscImageChef.Filesystems return false; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -339,7 +341,7 @@ namespace DiscImageChef.Filesystems if(!sys7th && !sysv && !coherent && !xenix && !xenix3) return; - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); if(xenix || xenix3) { diff --git a/DiscImageChef.Filesystems/UCSDPascal/File.cs b/DiscImageChef.Filesystems/UCSDPascal/File.cs index e861e8909..920dcd423 100644 --- a/DiscImageChef.Filesystems/UCSDPascal/File.cs +++ b/DiscImageChef.Filesystems/UCSDPascal/File.cs @@ -49,7 +49,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal { if(!mounted) return Errno.AccessDenied; - string[] pathElements = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return Errno.NotSupported; PascalFileEntry entry; @@ -67,7 +67,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal { if(!mounted) return Errno.AccessDenied; - string[] pathElements = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return Errno.NotSupported; byte[] file; @@ -106,7 +106,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal if(!mounted) return Errno.AccessDenied; - string[] pathElements = path.Split(new char[] {'/'}, StringSplitOptions.RemoveEmptyEntries); + string[] pathElements = path.Split(new[] {'/'}, StringSplitOptions.RemoveEmptyEntries); if(pathElements.Length != 1) return Errno.NotSupported; if(debug) diff --git a/DiscImageChef.Filesystems/UCSDPascal/Info.cs b/DiscImageChef.Filesystems/UCSDPascal/Info.cs index 000b90e1f..535b96125 100644 --- a/DiscImageChef.Filesystems/UCSDPascal/Info.cs +++ b/DiscImageChef.Filesystems/UCSDPascal/Info.cs @@ -33,13 +33,15 @@ using System; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems.UCSDPascal { // Information from Call-A.P.P.L.E. Pascal Disk Directory Structure public partial class PascalPlugin : Filesystem { - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(partition.Length < 3) return false; @@ -83,7 +85,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal return true; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { StringBuilder sbInformation = new StringBuilder(); @@ -141,7 +143,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal information = sbInformation.ToString(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.Bootable = !ArrayHelpers.ArrayIsNullOrEmpty(imagePlugin.ReadSectors(partition.Start, 2)); xmlFSType.Clusters = volEntry.blocks; xmlFSType.ClusterSize = (int)imagePlugin.GetSectorSize(); @@ -149,8 +151,6 @@ namespace DiscImageChef.Filesystems.UCSDPascal xmlFSType.FilesSpecified = true; xmlFSType.Type = "UCSD Pascal"; xmlFSType.VolumeName = StringHandlers.PascalToString(volEntry.volumeName, CurrentEncoding); - - return; } } } \ No newline at end of file diff --git a/DiscImageChef.Filesystems/UCSDPascal/Super.cs b/DiscImageChef.Filesystems/UCSDPascal/Super.cs index eda1fe67c..fed7c6804 100644 --- a/DiscImageChef.Filesystems/UCSDPascal/Super.cs +++ b/DiscImageChef.Filesystems/UCSDPascal/Super.cs @@ -32,6 +32,7 @@ using System; using System.Collections.Generic; +using Schemas; namespace DiscImageChef.Filesystems.UCSDPascal { @@ -93,7 +94,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal bootBlocks = device.ReadSectors(0, 2); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.Bootable = !ArrayHelpers.ArrayIsNullOrEmpty(bootBlocks); xmlFSType.Clusters = mountedVolEntry.blocks; xmlFSType.ClusterSize = (int)device.GetSectorSize(); diff --git a/DiscImageChef.Filesystems/UCSDPascal/UCSDPascal.cs b/DiscImageChef.Filesystems/UCSDPascal/UCSDPascal.cs index b004ec223..b5046b6a6 100644 --- a/DiscImageChef.Filesystems/UCSDPascal/UCSDPascal.cs +++ b/DiscImageChef.Filesystems/UCSDPascal/UCSDPascal.cs @@ -32,9 +32,10 @@ using System; using System.Collections.Generic; -using System.Text; +using Claunia.Encoding; using DiscImageChef.CommonTypes; using DiscImageChef.DiscImages; +using Encoding = System.Text.Encoding; namespace DiscImageChef.Filesystems.UCSDPascal { @@ -54,7 +55,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal { Name = "U.C.S.D. Pascal filesystem"; PluginUUID = new Guid("B0AC2CB5-72AA-473A-9200-270B5A2C2D53"); - CurrentEncoding = new Claunia.Encoding.LisaRoman(); + CurrentEncoding = new LisaRoman(); } public PascalPlugin(Encoding encoding) @@ -62,7 +63,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal Name = "U.C.S.D. Pascal filesystem"; PluginUUID = new Guid("B0AC2CB5-72AA-473A-9200-270B5A2C2D53"); // TODO: Until Apple ][ encoding is implemented - CurrentEncoding = new Claunia.Encoding.LisaRoman(); + CurrentEncoding = new LisaRoman(); } public PascalPlugin(ImagePlugin imagePlugin, Partition partition, Encoding encoding) @@ -71,7 +72,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal Name = "U.C.S.D. Pascal filesystem"; PluginUUID = new Guid("B0AC2CB5-72AA-473A-9200-270B5A2C2D53"); // TODO: Until Apple ][ encoding is implemented - CurrentEncoding = new Claunia.Encoding.LisaRoman(); + CurrentEncoding = new LisaRoman(); } public override Errno ListXAttr(string path, ref List xattrs) diff --git a/DiscImageChef.Filesystems/UDF.cs b/DiscImageChef.Filesystems/UDF.cs index c8da26171..2c0ed17ee 100644 --- a/DiscImageChef.Filesystems/UDF.cs +++ b/DiscImageChef.Filesystems/UDF.cs @@ -38,6 +38,7 @@ using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -231,7 +232,7 @@ namespace DiscImageChef.Filesystems public ushort maximumWriteUDF; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { // UDF needs at least that if(partition.End - partition.Start < 256) return false; @@ -317,7 +318,7 @@ namespace DiscImageChef.Filesystems return false; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { byte[] sector; @@ -423,12 +424,12 @@ namespace DiscImageChef.Filesystems .AppendLine(); sbInformation.AppendFormat("Volume conforms to {0}", CurrentEncoding - .GetString(lvd.domainIdentifier.identifier).TrimEnd(new char[] {'\u0000'})) + .GetString(lvd.domainIdentifier.identifier).TrimEnd('\u0000')) .AppendLine(); sbInformation.AppendFormat("Volume was last written by: {0}", CurrentEncoding .GetString(pvd.implementationIdentifier.identifier) - .TrimEnd(new char[] {'\u0000'})).AppendLine(); + .TrimEnd('\u0000')).AppendLine(); sbInformation.AppendFormat("Volume requires UDF version {0}.{1:X2} to be read", Convert.ToInt32(string.Format("{0}", (lvidiu.minimumReadUDF & 0xFF00) >> 8), 10), Convert.ToInt32(string.Format("{0}", lvidiu.minimumReadUDF & 0xFF), 10)) @@ -444,13 +445,13 @@ namespace DiscImageChef.Filesystems Convert.ToInt32(string.Format("{0}", lvidiu.maximumWriteUDF & 0xFF), 10)) .AppendLine(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.Type = string.Format("UDF v{0}.{1:X2}", Convert.ToInt32(string.Format("{0}", (lvidiu.maximumWriteUDF & 0xFF00) >> 8), 10), Convert.ToInt32(string.Format("{0}", lvidiu.maximumWriteUDF & 0xFF), 10)); xmlFSType.ApplicationIdentifier = CurrentEncoding - .GetString(pvd.implementationIdentifier.identifier).TrimEnd(new char[] {'\u0000'}); + .GetString(pvd.implementationIdentifier.identifier).TrimEnd('\u0000'); xmlFSType.ClusterSize = (int)lvd.logicalBlockSize; xmlFSType.Clusters = (long)((partition.End - partition.Start + 1) * imagePlugin.ImageInfo.SectorSize / (ulong)xmlFSType.ClusterSize); @@ -461,7 +462,7 @@ namespace DiscImageChef.Filesystems xmlFSType.VolumeName = StringHandlers.DecompressUnicode(lvd.logicalVolumeIdentifier); xmlFSType.VolumeSetIdentifier = StringHandlers.DecompressUnicode(pvd.volumeSetIdentifier); xmlFSType.SystemIdentifier = CurrentEncoding - .GetString(pvd.implementationIdentifier.identifier).TrimEnd(new char[] {'\u0000'}); + .GetString(pvd.implementationIdentifier.identifier).TrimEnd('\u0000'); information = sbInformation.ToString(); } diff --git a/DiscImageChef.Filesystems/UNICOS.cs b/DiscImageChef.Filesystems/UNICOS.cs index 50d2af0f6..c48d071c6 100644 --- a/DiscImageChef.Filesystems/UNICOS.cs +++ b/DiscImageChef.Filesystems/UNICOS.cs @@ -36,6 +36,8 @@ using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.DiscImages; +using Schemas; // UNICOS is ILP64 so let's think everything is 64-bit using blkno_t = System.Int64; using daddr_t = System.Int64; @@ -147,7 +149,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public UNICOS(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public UNICOS(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "UNICOS Filesystem Plugin"; PluginUUID = new Guid("61712F04-066C-44D5-A2A0-1E44C66B33F0"); @@ -155,7 +157,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(imagePlugin.GetSectorSize() < 512) return false; @@ -175,7 +177,7 @@ namespace DiscImageChef.Filesystems return unicosSb.s_magic == UNICOS_Magic; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -211,7 +213,7 @@ namespace DiscImageChef.Filesystems information = sb.ToString(); - xmlFSType = new Schemas.FileSystemType + xmlFSType = new FileSystemType { Type = "UNICOS filesystem", ClusterSize = 4096, diff --git a/DiscImageChef.Filesystems/UNIXBFS.cs b/DiscImageChef.Filesystems/UNIXBFS.cs index a0026b899..2cb78ade2 100644 --- a/DiscImageChef.Filesystems/UNIXBFS.cs +++ b/DiscImageChef.Filesystems/UNIXBFS.cs @@ -35,6 +35,8 @@ using System.Collections.Generic; using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -58,7 +60,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public BFS(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public BFS(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "UNIX Boot filesystem"; PluginUUID = new Guid("1E6E0DA6-F7E4-494C-80C6-CB5929E96155"); @@ -66,7 +68,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(2 + partition.Start >= partition.End) return false; @@ -77,7 +79,7 @@ namespace DiscImageChef.Filesystems return magic == BFS_MAGIC; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -116,7 +118,7 @@ namespace DiscImageChef.Filesystems sb.AppendFormat("Filesystem name: {0}", bfs_sb.s_fsname).AppendLine(); sb.AppendFormat("Volume name: {0}", bfs_sb.s_volume).AppendLine(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.Type = "BFS"; xmlFSType.VolumeName = bfs_sb.s_volume; xmlFSType.ClusterSize = (int)imagePlugin.GetSectorSize(); diff --git a/DiscImageChef.Filesystems/VMfs.cs b/DiscImageChef.Filesystems/VMfs.cs index a082efc01..9e992f3fe 100644 --- a/DiscImageChef.Filesystems/VMfs.cs +++ b/DiscImageChef.Filesystems/VMfs.cs @@ -35,6 +35,8 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -55,7 +57,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public VMfs(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public VMfs(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "VMware filesystem"; PluginUUID = new Guid("EE52BDB8-B49C-4122-A3DA-AD21CBE79843"); @@ -93,7 +95,7 @@ namespace DiscImageChef.Filesystems const uint VMfs_MAGIC = 0xC001D00D; const uint VMfs_Base = 0x00100000; - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(partition.Start >= partition.End) return false; @@ -108,7 +110,7 @@ namespace DiscImageChef.Filesystems return magic == VMfs_MAGIC; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { ulong vmfsSuperOff = VMfs_Base / imagePlugin.ImageInfo.SectorSize; @@ -142,7 +144,7 @@ namespace DiscImageChef.Filesystems information = sbInformation.ToString(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.Type = "VMware file system"; xmlFSType.CreationDate = DateHandlers.UNIXUnsignedToDateTime(ctimeSecs, ctimeNanoSecs); xmlFSType.CreationDateSpecified = true; diff --git a/DiscImageChef.Filesystems/VxFS.cs b/DiscImageChef.Filesystems/VxFS.cs index 29a37d993..63ec7f054 100644 --- a/DiscImageChef.Filesystems/VxFS.cs +++ b/DiscImageChef.Filesystems/VxFS.cs @@ -35,6 +35,8 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -55,7 +57,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public VxFS(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public VxFS(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "Veritas filesystem"; PluginUUID = new Guid("EC372605-7687-453C-8BEA-7E0DFF79CB03"); @@ -212,7 +214,7 @@ namespace DiscImageChef.Filesystems const uint VxFS_MAGIC = 0xA501FCF5; const uint VxFS_Base = 0x400; - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { ulong vmfsSuperOff = VxFS_Base / imagePlugin.ImageInfo.SectorSize; @@ -225,7 +227,7 @@ namespace DiscImageChef.Filesystems return magic == VxFS_MAGIC; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { ulong vmfsSuperOff = VxFS_Base / imagePlugin.ImageInfo.SectorSize; @@ -257,7 +259,7 @@ namespace DiscImageChef.Filesystems information = sbInformation.ToString(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.Type = "Veritas file system"; xmlFSType.CreationDate = DateHandlers.UNIXUnsignedToDateTime(vxSb.vs_ctime, vxSb.vs_cutime); xmlFSType.CreationDateSpecified = true; diff --git a/DiscImageChef.Filesystems/XFS.cs b/DiscImageChef.Filesystems/XFS.cs index 4f5840119..bee48f034 100644 --- a/DiscImageChef.Filesystems/XFS.cs +++ b/DiscImageChef.Filesystems/XFS.cs @@ -36,6 +36,8 @@ using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -119,7 +121,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public XFS(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public XFS(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "XFS Filesystem Plugin"; PluginUUID = new Guid("1D8CD8B8-27E6-410F-9973-D16409225FBA"); @@ -127,12 +129,12 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(imagePlugin.GetSectorSize() < 512) return false; // Misaligned - if(imagePlugin.ImageInfo.XmlMediaType == DiscImages.XmlMediaType.OpticalDisc) + if(imagePlugin.ImageInfo.XmlMediaType == XmlMediaType.OpticalDisc) { XFS_Superblock xfsSb = new XFS_Superblock(); @@ -178,7 +180,7 @@ namespace DiscImageChef.Filesystems return false; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -187,7 +189,7 @@ namespace DiscImageChef.Filesystems XFS_Superblock xfsSb = new XFS_Superblock(); // Misaligned - if(imagePlugin.ImageInfo.XmlMediaType == DiscImages.XmlMediaType.OpticalDisc) + if(imagePlugin.ImageInfo.XmlMediaType == XmlMediaType.OpticalDisc) { uint sbSize = (uint)((Marshal.SizeOf(xfsSb) + 0x400) / imagePlugin.GetSectorSize()); if((Marshal.SizeOf(xfsSb) + 0x400) % imagePlugin.GetSectorSize() != 0) sbSize++; @@ -245,7 +247,7 @@ namespace DiscImageChef.Filesystems information = sb.ToString(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.Type = "XFS filesystem"; xmlFSType.ClusterSize = (int)xfsSb.blocksize; xmlFSType.Clusters = (long)xfsSb.dblocks; diff --git a/DiscImageChef.Filesystems/ZFS.cs b/DiscImageChef.Filesystems/ZFS.cs index 3b3815489..8d80ca38c 100644 --- a/DiscImageChef.Filesystems/ZFS.cs +++ b/DiscImageChef.Filesystems/ZFS.cs @@ -35,6 +35,8 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -237,7 +239,7 @@ namespace DiscImageChef.Filesystems CurrentEncoding = Encoding.UTF8; } - public ZFS(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public ZFS(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "ZFS Filesystem Plugin"; PluginUUID = new Guid("0750014F-A714-4692-A369-E23F6EC3659C"); @@ -245,7 +247,7 @@ namespace DiscImageChef.Filesystems CurrentEncoding = Encoding.UTF8; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(imagePlugin.GetSectorSize() < 512) return false; @@ -268,7 +270,7 @@ namespace DiscImageChef.Filesystems return false; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -308,7 +310,7 @@ namespace DiscImageChef.Filesystems NVS_Item tmpObj; - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.Type = "ZFS filesystem"; if(decodedNvList.TryGetValue("name", out tmpObj)) xmlFSType.VolumeName = (string)tmpObj.value; if(decodedNvList.TryGetValue("guid", out tmpObj)) diff --git a/DiscImageChef.Filesystems/dump.cs b/DiscImageChef.Filesystems/dump.cs index b99e772fa..95b8f63fa 100644 --- a/DiscImageChef.Filesystems/dump.cs +++ b/DiscImageChef.Filesystems/dump.cs @@ -36,6 +36,8 @@ using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.DiscImages; +using Schemas; using ufs_daddr_t = System.Int32; namespace DiscImageChef.Filesystems @@ -221,7 +223,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public dump(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public dump(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "dump(8) Plugin"; PluginUUID = new Guid("E53B4D28-C858-4800-B092-DDAE80D361B9"); @@ -229,7 +231,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(imagePlugin.GetSectorSize() < 512) return false; @@ -270,7 +272,7 @@ namespace DiscImageChef.Filesystems newHdr.c_magic == NFS_CIGAM || newHdr.c_magic == UFS2_MAGIC || newHdr.c_magic == UFS2_CIGAM; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -338,7 +340,7 @@ namespace DiscImageChef.Filesystems StringBuilder sb = new StringBuilder(); - xmlFSType = new Schemas.FileSystemType {ClusterSize = 1024, Clusters = (long)(partition.Size / 1024)}; + xmlFSType = new FileSystemType {ClusterSize = 1024, Clusters = (long)(partition.Size / 1024)}; if(useOld) { diff --git a/DiscImageChef.Filesystems/exFAT.cs b/DiscImageChef.Filesystems/exFAT.cs index 486278a5b..089b6b16b 100644 --- a/DiscImageChef.Filesystems/exFAT.cs +++ b/DiscImageChef.Filesystems/exFAT.cs @@ -37,6 +37,7 @@ using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -87,7 +88,7 @@ namespace DiscImageChef.Filesystems information = ""; StringBuilder sb = new StringBuilder(); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); byte[] vbrSector = imagePlugin.ReadSector(0 + partition.Start); VolumeBootRecord vbr = new VolumeBootRecord(); diff --git a/DiscImageChef.Filesystems/ext2FS.cs b/DiscImageChef.Filesystems/ext2FS.cs index 4c4b80170..1bd44c7c4 100644 --- a/DiscImageChef.Filesystems/ext2FS.cs +++ b/DiscImageChef.Filesystems/ext2FS.cs @@ -35,6 +35,8 @@ using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -58,7 +60,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public ext2FS(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public ext2FS(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "Linux extended Filesystem 2, 3 and 4"; PluginUUID = new Guid("6AA91B88-150B-4A7B-AD56-F84FB2DF4184"); @@ -66,7 +68,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { ulong sbSector = sbPos / imagePlugin.GetSectorSize(); uint sbOff = sbPos % imagePlugin.GetSectorSize(); @@ -88,7 +90,7 @@ namespace DiscImageChef.Filesystems return false; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -119,7 +121,7 @@ namespace DiscImageChef.Filesystems supblk = (ext2FSSuperBlock)Marshal.PtrToStructure(sbPtr, typeof(ext2FSSuperBlock)); Marshal.FreeHGlobal(sbPtr); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); switch(supblk.magic) { case ext2OldFSMagic: diff --git a/DiscImageChef.Filesystems/extFS.cs b/DiscImageChef.Filesystems/extFS.cs index 76d4c0e6b..178b3eb20 100644 --- a/DiscImageChef.Filesystems/extFS.cs +++ b/DiscImageChef.Filesystems/extFS.cs @@ -34,6 +34,8 @@ using System; using System.Collections.Generic; using System.Text; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using Schemas; namespace DiscImageChef.Filesystems { @@ -57,7 +59,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public extFS(DiscImages.ImagePlugin imagePlugin, Partition partition, Encoding encoding) + public extFS(ImagePlugin imagePlugin, Partition partition, Encoding encoding) { Name = "Linux extended Filesystem"; PluginUUID = new Guid("076CB3A2-08C2-4D69-BC8A-FCAA2E502BE2"); @@ -65,7 +67,7 @@ namespace DiscImageChef.Filesystems else CurrentEncoding = encoding; } - public override bool Identify(DiscImages.ImagePlugin imagePlugin, Partition partition) + public override bool Identify(ImagePlugin imagePlugin, Partition partition) { if(imagePlugin.GetSectorSize() < 512) return false; @@ -83,7 +85,7 @@ namespace DiscImageChef.Filesystems return magic == extFSMagic; } - public override void GetInformation(DiscImages.ImagePlugin imagePlugin, Partition partition, + public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information) { information = ""; @@ -124,7 +126,7 @@ namespace DiscImageChef.Filesystems sb.AppendFormat("Log zone size: {0}", ext_sb.logzonesize); sb.AppendFormat("Max zone size: {0}", ext_sb.maxsize); - xmlFSType = new Schemas.FileSystemType(); + xmlFSType = new FileSystemType(); xmlFSType.Type = "ext"; xmlFSType.FreeClusters = ext_sb.freecountblk; xmlFSType.FreeClustersSpecified = true; diff --git a/DiscImageChef.Filters/Filter.cs b/DiscImageChef.Filters/Filter.cs index 12c6dade0..3f0b33dac 100644 --- a/DiscImageChef.Filters/Filter.cs +++ b/DiscImageChef.Filters/Filter.cs @@ -40,8 +40,6 @@ namespace DiscImageChef.Filters public string Name; public Guid UUID; - protected Filter() { } - /// /// Closes all opened streams. /// diff --git a/DiscImageChef.Helpers/ArrayFill.cs b/DiscImageChef.Helpers/ArrayFill.cs index e443f7bf9..e4a1a4d97 100644 --- a/DiscImageChef.Helpers/ArrayFill.cs +++ b/DiscImageChef.Helpers/ArrayFill.cs @@ -34,7 +34,7 @@ namespace DiscImageChef public static void ArrayFill(T[] destinationArray, T value) { // if called with a single value, wrap the value in an array and call the main function - ArrayFill(destinationArray, new T[] {value}); + ArrayFill(destinationArray, new[] {value}); } public static void ArrayFill(T[] destinationArray, T[] value) diff --git a/DiscImageChef.Helpers/PrintHex.cs b/DiscImageChef.Helpers/PrintHex.cs index e5e8046a7..291b30154 100644 --- a/DiscImageChef.Helpers/PrintHex.cs +++ b/DiscImageChef.Helpers/PrintHex.cs @@ -30,6 +30,7 @@ // Copyright © 2011-2018 Natalia Portillo // ****************************************************************************/ +using System.Text; using DiscImageChef.Console; namespace DiscImageChef @@ -43,7 +44,7 @@ namespace DiscImageChef public static string ByteArrayToHexArrayString(byte[] array, int width) { - System.Text.StringBuilder sb = new System.Text.StringBuilder(); + StringBuilder sb = new StringBuilder(); int counter = 0; int subcounter = 0; diff --git a/DiscImageChef.Helpers/StringHandlers.cs b/DiscImageChef.Helpers/StringHandlers.cs index 728715e05..7f93ad326 100644 --- a/DiscImageChef.Helpers/StringHandlers.cs +++ b/DiscImageChef.Helpers/StringHandlers.cs @@ -176,7 +176,7 @@ namespace DiscImageChef if(unicode == 0) break; - temp += Encoding.Unicode.GetString(System.BitConverter.GetBytes(unicode)); + temp += Encoding.Unicode.GetString(BitConverter.GetBytes(unicode)); } return temp; diff --git a/DiscImageChef.Interop/DetectOS.cs b/DiscImageChef.Interop/DetectOS.cs index bfa17bc4a..e812b4e5d 100644 --- a/DiscImageChef.Interop/DetectOS.cs +++ b/DiscImageChef.Interop/DetectOS.cs @@ -238,7 +238,7 @@ namespace DiscImageChef.Interop case PlatformID.MacOSX: if(string.IsNullOrEmpty(version)) return "macOS"; - string[] pieces = version.Split(new[] {'.'}); + string[] pieces = version.Split('.'); if(pieces.Length < 2 || !int.TryParse(pieces[1], out int minor)) return "macOS"; if(minor >= 12) return "macOS"; diff --git a/DiscImageChef.Metadata/DeviceReport.cs b/DiscImageChef.Metadata/DeviceReport.cs index b73f0a3d0..37aeb08b7 100644 --- a/DiscImageChef.Metadata/DeviceReport.cs +++ b/DiscImageChef.Metadata/DeviceReport.cs @@ -34,6 +34,7 @@ using System; using System.Xml.Serialization; using DiscImageChef.Decoders.ATA; using DiscImageChef.Decoders.SCSI; +using DiscImageChef.Decoders.SCSI.MMC; namespace DiscImageChef.Metadata { @@ -649,7 +650,7 @@ namespace DiscImageChef.Metadata public bool Locked { get; set; } public uint LogicalBlockSize { get; set; } public bool MultiRead { get; set; } - public Decoders.SCSI.MMC.PhysicalInterfaces PhysicalInterfaceStandard { get; set; } + public PhysicalInterfaces PhysicalInterfaceStandard { get; set; } public uint PhysicalInterfaceStandardNumber { get; set; } public bool PreventJumper { get; set; } public bool SupportsAACS { get; set; } diff --git a/DiscImageChef.Partitions/AppleMap.cs b/DiscImageChef.Partitions/AppleMap.cs index dd978c86f..4d33bd49d 100644 --- a/DiscImageChef.Partitions/AppleMap.cs +++ b/DiscImageChef.Partitions/AppleMap.cs @@ -34,7 +34,9 @@ using System; using System.Collections.Generic; using System.Runtime.InteropServices; using System.Text; +using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.DiscImages; namespace DiscImageChef.Partitions { @@ -57,15 +59,15 @@ namespace DiscImageChef.Partitions PluginUuid = new Guid("36405F8D-4F1A-07F5-209C-223D735D6D22"); } - public override bool GetInformation(DiscImages.ImagePlugin imagePlugin, - out List partitions, ulong sectorOffset) + public override bool GetInformation(ImagePlugin imagePlugin, + out List partitions, ulong sectorOffset) { uint sector_size; if(imagePlugin.GetSectorSize() == 2352 || imagePlugin.GetSectorSize() == 2448) sector_size = 2048; else sector_size = imagePlugin.GetSectorSize(); - partitions = new List(); + partitions = new List(); if(sectorOffset + 2 >= imagePlugin.GetSectors()) return false; @@ -113,7 +115,7 @@ namespace DiscImageChef.Partitions if(ddm.sbMap[i].ddSize == 0) continue; - CommonTypes.Partition part = new CommonTypes.Partition + Partition part = new Partition { Size = (ulong)(ddm.sbMap[i].ddSize * 512), Length = (ulong)(ddm.sbMap[i].ddSize * 512 / sector_size), @@ -158,7 +160,7 @@ namespace DiscImageChef.Partitions continue; } - CommonTypes.Partition part = new CommonTypes.Partition + Partition part = new Partition { Size = old_entry.pdStart * ddm.sbBlockSize, Length = old_entry.pdStart * ddm.sbBlockSize / sector_size, @@ -282,7 +284,7 @@ namespace DiscImageChef.Partitions StringBuilder sb = new StringBuilder(); - CommonTypes.Partition _partition = new CommonTypes.Partition + Partition _partition = new Partition { Sequence = sequence, Type = StringHandlers.CToString(entry.type), diff --git a/DiscImageChef.Partitions/Atari.cs b/DiscImageChef.Partitions/Atari.cs index 7ee0725bb..51e192b07 100644 --- a/DiscImageChef.Partitions/Atari.cs +++ b/DiscImageChef.Partitions/Atari.cs @@ -33,7 +33,10 @@ using System; using System.Collections.Generic; using System.Text; +using DiscImageChef.Checksums; +using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.DiscImages; namespace DiscImageChef.Partitions { @@ -58,10 +61,10 @@ namespace DiscImageChef.Partitions PluginUuid = new Guid("d1dd0f24-ec39-4c4d-9072-be31919a3b5e"); } - public override bool GetInformation(DiscImages.ImagePlugin imagePlugin, - out List partitions, ulong sectorOffset) + public override bool GetInformation(ImagePlugin imagePlugin, + out List partitions, ulong sectorOffset) { - partitions = new List(); + partitions = new List(); if(imagePlugin.GetSectorSize() < 512) return false; @@ -99,7 +102,7 @@ namespace DiscImageChef.Partitions table.badLength = BigEndianBitConverter.ToUInt32(sector, 506); table.checksum = BigEndianBitConverter.ToUInt16(sector, 510); - Checksums.Sha1Context sha1Ctx = new Checksums.Sha1Context(); + Sha1Context sha1Ctx = new Sha1Context(); sha1Ctx.Init(); sha1Ctx.Update(table.boot); DicConsole.DebugWriteLine("Atari partition plugin", "Boot code SHA1: {0}", sha1Ctx.End()); @@ -169,7 +172,7 @@ namespace DiscImageChef.Partitions partType[1] = (byte)((type & 0x00FF00) >> 8); partType[2] = (byte)(type & 0x0000FF); - CommonTypes.Partition part = new CommonTypes.Partition + Partition part = new Partition { Size = table.entries[i].length * sectorSize, Length = table.entries[i].length, @@ -264,7 +267,7 @@ namespace DiscImageChef.Partitions partType[1] = (byte)((extendedType & 0x00FF00) >> 8); partType[2] = (byte)(extendedType & 0x0000FF); - CommonTypes.Partition part = new CommonTypes.Partition + Partition part = new Partition { Size = extendedTable.entries[j].length * sectorSize, Length = extendedTable.entries[j].length, @@ -345,7 +348,7 @@ namespace DiscImageChef.Partitions partType[1] = (byte)((type & 0x00FF00) >> 8); partType[2] = (byte)(type & 0x0000FF); - CommonTypes.Partition part = new CommonTypes.Partition + Partition part = new Partition { Size = table.icdEntries[i].length * sectorSize, Length = table.icdEntries[i].length, diff --git a/DiscImageChef.Partitions/GPT.cs b/DiscImageChef.Partitions/GPT.cs index 5c7558f2f..319ed537b 100644 --- a/DiscImageChef.Partitions/GPT.cs +++ b/DiscImageChef.Partitions/GPT.cs @@ -34,7 +34,9 @@ using System; using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; +using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.DiscImages; namespace DiscImageChef.Partitions { @@ -49,10 +51,10 @@ namespace DiscImageChef.Partitions PluginUuid = new Guid("CBC9D281-C1D0-44E8-9038-4D66FD2678AB"); } - public override bool GetInformation(DiscImages.ImagePlugin imagePlugin, - out List partitions, ulong sectorOffset) + public override bool GetInformation(ImagePlugin imagePlugin, + out List partitions, ulong sectorOffset) { - partitions = new List(); + partitions = new List(); if(sectorOffset + 2 >= imagePlugin.GetSectors()) return false; @@ -65,7 +67,7 @@ namespace DiscImageChef.Partitions DicConsole.DebugWriteLine("GPT Plugin", "hdr.signature = 0x{0:X16}", signature); if(signature != GptMagic) - if(imagePlugin.ImageInfo.XmlMediaType == DiscImages.XmlMediaType.OpticalDisc) + if(imagePlugin.ImageInfo.XmlMediaType == XmlMediaType.OpticalDisc) { hdrBytes = imagePlugin.ReadSector(sectorOffset); signature = BitConverter.ToUInt64(hdrBytes, 512); @@ -162,7 +164,7 @@ namespace DiscImageChef.Partitions if(entry.startLBA / divisor > imagePlugin.GetSectors() || entry.endLBA / divisor > imagePlugin.GetSectors()) return false; - CommonTypes.Partition part = new CommonTypes.Partition + Partition part = new Partition { Description = string.Format("ID: {0}", entry.partitionId), Size = (entry.endLBA - entry.startLBA + 1) * sectorSize, diff --git a/DiscImageChef.Partitions/MBR.cs b/DiscImageChef.Partitions/MBR.cs index 82c7a726a..20f1518d5 100644 --- a/DiscImageChef.Partitions/MBR.cs +++ b/DiscImageChef.Partitions/MBR.cs @@ -36,6 +36,7 @@ using System.Runtime.InteropServices; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.DiscImages; +using DiscImageChef.Helpers; namespace DiscImageChef.Partitions { @@ -50,12 +51,12 @@ namespace DiscImageChef.Partitions PluginUuid = new Guid("5E8A34E8-4F1A-59E6-4BF7-7EA647063A76"); } - public override bool GetInformation(DiscImages.ImagePlugin imagePlugin, - out List partitions, ulong sectorOffset) + public override bool GetInformation(ImagePlugin imagePlugin, + out List partitions, ulong sectorOffset) { ulong counter = 0; - partitions = new List(); + partitions = new List(); if(imagePlugin.GetSectorSize() < 512) return false; @@ -63,7 +64,7 @@ namespace DiscImageChef.Partitions // Divider of sector size in MBR between real sector size ulong divider = 1; - if(imagePlugin.ImageInfo.XmlMediaType == DiscImages.XmlMediaType.OpticalDisc) + if(imagePlugin.ImageInfo.XmlMediaType == XmlMediaType.OpticalDisc) { sectorSize = 512; divider = 4; @@ -149,9 +150,9 @@ namespace DiscImageChef.Partitions entry.end_head != 0 || entry.end_sector != 0; if(entry.lba_start == 0 && entry.lba_sectors == 0 && valid) { - lba_start = Helpers.CHS.ToLBA(start_cylinder, entry.start_head, start_sector, + lba_start = CHS.ToLBA(start_cylinder, entry.start_head, start_sector, imagePlugin.ImageInfo.Heads, imagePlugin.ImageInfo.SectorsPerTrack); - lba_sectors = Helpers.CHS.ToLBA(end_cylinder, entry.end_head, entry.end_sector, + lba_sectors = CHS.ToLBA(end_cylinder, entry.end_head, entry.end_sector, imagePlugin.ImageInfo.Heads, imagePlugin.ImageInfo.SectorsPerTrack) - lba_start; } @@ -195,7 +196,7 @@ namespace DiscImageChef.Partitions if(valid && !minix) { - CommonTypes.Partition part = new CommonTypes.Partition(); + Partition part = new Partition(); if((lba_start > 0 || imagePlugin.ImageInfo.XmlMediaType == XmlMediaType.OpticalDisc) && lba_sectors > 0) { @@ -274,10 +275,10 @@ namespace DiscImageChef.Partitions ebr_entry.end_head != 0 || ebr_entry.end_sector != 0; if(ebr_entry.lba_start == 0 && ebr_entry.lba_sectors == 0 && ext_valid) { - ext_start = Helpers.CHS.ToLBA(start_cylinder, ebr_entry.start_head, start_sector, + ext_start = CHS.ToLBA(start_cylinder, ebr_entry.start_head, start_sector, imagePlugin.ImageInfo.Heads, imagePlugin.ImageInfo.SectorsPerTrack); - ext_sectors = Helpers.CHS.ToLBA(end_cylinder, ebr_entry.end_head, ebr_entry.end_sector, + ext_sectors = CHS.ToLBA(end_cylinder, ebr_entry.end_head, ebr_entry.end_sector, imagePlugin.ImageInfo.Heads, imagePlugin.ImageInfo.SectorsPerTrack) - ext_start; } @@ -392,9 +393,9 @@ namespace DiscImageChef.Partitions mnx_entry.end_head != 0 || mnx_entry.end_sector != 0; if(mnx_entry.lba_start == 0 && mnx_entry.lba_sectors == 0 && mnx_valid) { - mnx_start = Helpers.CHS.ToLBA(start_cylinder, mnx_entry.start_head, start_sector, + mnx_start = CHS.ToLBA(start_cylinder, mnx_entry.start_head, start_sector, imagePlugin.ImageInfo.Heads, imagePlugin.ImageInfo.SectorsPerTrack); - mnx_sectors = Helpers.CHS.ToLBA(end_cylinder, mnx_entry.end_head, mnx_entry.end_sector, + mnx_sectors = CHS.ToLBA(end_cylinder, mnx_entry.end_head, mnx_entry.end_sector, imagePlugin.ImageInfo.Heads, imagePlugin.ImageInfo.SectorsPerTrack) - mnx_start; } @@ -408,7 +409,7 @@ namespace DiscImageChef.Partitions if(!mnx_valid) continue; - CommonTypes.Partition part = new CommonTypes.Partition(); + Partition part = new Partition(); if(mnx_start > 0 && mnx_sectors > 0) { part.Start = mnx_start + sectorOffset; diff --git a/DiscImageChef.Partitions/NeXT.cs b/DiscImageChef.Partitions/NeXT.cs index b0b63dbf5..f90724968 100644 --- a/DiscImageChef.Partitions/NeXT.cs +++ b/DiscImageChef.Partitions/NeXT.cs @@ -35,7 +35,9 @@ using System.Collections.Generic; using System.Linq; using System.Runtime.InteropServices; using System.Text; +using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.DiscImages; // Information learnt from XNU source and testing against real disks namespace DiscImageChef.Partitions @@ -59,8 +61,8 @@ namespace DiscImageChef.Partitions PluginUuid = new Guid("246A6D93-4F1A-1F8A-344D-50187A5513A9"); } - public override bool GetInformation(DiscImages.ImagePlugin imagePlugin, - out List partitions, ulong sectorOffset) + public override bool GetInformation(ImagePlugin imagePlugin, + out List partitions, ulong sectorOffset) { bool magic_found = false; byte[] label_sector; @@ -71,7 +73,7 @@ namespace DiscImageChef.Partitions if(imagePlugin.GetSectorSize() == 2352 || imagePlugin.GetSectorSize() == 2448) sector_size = 2048; else sector_size = imagePlugin.GetSectorSize(); - partitions = new List(); + partitions = new List(); BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian; @@ -168,7 +170,7 @@ namespace DiscImageChef.Partitions StringBuilder sb = new StringBuilder(); - CommonTypes.Partition part = new CommonTypes.Partition + Partition part = new Partition { Size = (ulong)(label.dl_dt.d_partitions[i].p_size * label.dl_dt.d_secsize), Offset = diff --git a/DiscImageChef.Partitions/PC98.cs b/DiscImageChef.Partitions/PC98.cs index 6b661697e..f9e170748 100644 --- a/DiscImageChef.Partitions/PC98.cs +++ b/DiscImageChef.Partitions/PC98.cs @@ -37,6 +37,7 @@ using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.DiscImages; +using DiscImageChef.Helpers; namespace DiscImageChef.Partitions { @@ -94,7 +95,7 @@ namespace DiscImageChef.Partitions Partition part = new Partition { - Start = Helpers.CHS.ToLBA(entry.dp_scyl, entry.dp_shd, (uint)(entry.dp_ssect + 1), + Start = CHS.ToLBA(entry.dp_scyl, entry.dp_shd, (uint)(entry.dp_ssect + 1), imagePlugin.ImageInfo.Heads, imagePlugin.ImageInfo.SectorsPerTrack), Type = DecodePC98Sid(entry.dp_sid), Name = StringHandlers.CToString(entry.dp_name, Encoding.GetEncoding(932)).Trim(), @@ -102,7 +103,7 @@ namespace DiscImageChef.Partitions Scheme = Name }; part.Offset = part.Start * imagePlugin.GetSectorSize(); - part.Length = Helpers.CHS.ToLBA(entry.dp_ecyl, entry.dp_ehd, (uint)(entry.dp_esect + 1), + part.Length = CHS.ToLBA(entry.dp_ecyl, entry.dp_ehd, (uint)(entry.dp_esect + 1), imagePlugin.ImageInfo.Heads, imagePlugin.ImageInfo.SectorsPerTrack) - part.Start; part.Size = part.Length * imagePlugin.GetSectorSize(); diff --git a/DiscImageChef.Partitions/PartitionPlugin.cs b/DiscImageChef.Partitions/PartitionPlugin.cs index 8712bee55..7582e62a5 100644 --- a/DiscImageChef.Partitions/PartitionPlugin.cs +++ b/DiscImageChef.Partitions/PartitionPlugin.cs @@ -33,6 +33,8 @@ using System; using System.Collections.Generic; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; namespace DiscImageChef.Partitions { @@ -46,8 +48,6 @@ namespace DiscImageChef.Partitions /// Plugin UUID. public Guid PluginUuid; - protected PartitionPlugin() { } - /// /// Interprets a partitioning scheme. /// @@ -55,7 +55,7 @@ namespace DiscImageChef.Partitions /// Disk image. /// Returns list of partitions. /// At which sector to start searching for the partition scheme. - public abstract bool GetInformation(DiscImages.ImagePlugin imagePlugin, - out List partitions, ulong sectorOffset); + public abstract bool GetInformation(ImagePlugin imagePlugin, + out List partitions, ulong sectorOffset); } } \ No newline at end of file diff --git a/DiscImageChef.Partitions/Plan9.cs b/DiscImageChef.Partitions/Plan9.cs index 8fffee6b2..e7e800084 100644 --- a/DiscImageChef.Partitions/Plan9.cs +++ b/DiscImageChef.Partitions/Plan9.cs @@ -34,6 +34,7 @@ using System; using System.Collections.Generic; using System.Linq; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; namespace DiscImageChef.Partitions { @@ -50,7 +51,7 @@ namespace DiscImageChef.Partitions PluginUuid = new Guid("F0BF4FFC-056E-4E7C-8B65-4EAEE250ADD9"); } - public override bool GetInformation(DiscImages.ImagePlugin imagePlugin, out List partitions, + public override bool GetInformation(ImagePlugin imagePlugin, out List partitions, ulong sectorOffset) { partitions = new List(); @@ -59,9 +60,9 @@ namespace DiscImageChef.Partitions byte[] sector = imagePlugin.ReadSector(sectorOffset + 1); // While all of Plan9 is supposedly UTF-8, it uses ASCII strcmp for reading its partition table - string[] really = StringHandlers.CToString(sector).Split(new[] {'\n'}); + string[] really = StringHandlers.CToString(sector).Split('\n'); - foreach(string[] tokens in really.TakeWhile(part => part.Length >= 5 && part.Substring(0, 5) == "part ").Select(part => part.Split(new[] {' '})).TakeWhile(tokens => tokens.Length == 4)) { + foreach(string[] tokens in really.TakeWhile(part => part.Length >= 5 && part.Substring(0, 5) == "part ").Select(part => part.Split(' ')).TakeWhile(tokens => tokens.Length == 4)) { if(!ulong.TryParse(tokens[2], out ulong start) || !ulong.TryParse(tokens[3], out ulong end)) break; Partition _part = new Partition diff --git a/DiscImageChef.Partitions/RDB.cs b/DiscImageChef.Partitions/RDB.cs index 668e92b26..1aa2ad399 100644 --- a/DiscImageChef.Partitions/RDB.cs +++ b/DiscImageChef.Partitions/RDB.cs @@ -34,8 +34,10 @@ using System; using System.Collections.Generic; using System.Linq; using System.Text; +using DiscImageChef.Checksums; using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.DiscImages; namespace DiscImageChef.Partitions { @@ -891,10 +893,10 @@ namespace DiscImageChef.Partitions public byte[] LoadData; } - public override bool GetInformation(DiscImages.ImagePlugin imagePlugin, - out List partitions, ulong sectorOffset) + public override bool GetInformation(ImagePlugin imagePlugin, + out List partitions, ulong sectorOffset) { - partitions = new List(); + partitions = new List(); BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian; ulong rdbBlock = 0; bool foundRdb = false; @@ -1323,7 +1325,7 @@ namespace DiscImageChef.Partitions nextBlock = fshd.Dnode.SeglistPtr; bool thereAreLoadSegments = false; - Checksums.Sha1Context sha1Ctx = new Checksums.Sha1Context(); + Sha1Context sha1Ctx = new Sha1Context(); sha1Ctx.Init(); while(nextBlock != 0xFFFFFFFF) { @@ -1371,7 +1373,7 @@ namespace DiscImageChef.Partitions } ulong sequence = 0; - foreach(Partition entry in partitionEntries.Select(rdbEntry => new CommonTypes.Partition + foreach(Partition entry in partitionEntries.Select(rdbEntry => new Partition { Description = AmigaDosTypeToDescriptionString(rdbEntry.DosEnvVec.DosType), Name = rdbEntry.DriveName, diff --git a/DiscImageChef.Partitions/Sun.cs b/DiscImageChef.Partitions/Sun.cs index 42642013a..47c344892 100644 --- a/DiscImageChef.Partitions/Sun.cs +++ b/DiscImageChef.Partitions/Sun.cs @@ -33,7 +33,10 @@ using System; using System.Collections.Generic; using System.Runtime.InteropServices; +using System.Text; +using DiscImageChef.CommonTypes; using DiscImageChef.Console; +using DiscImageChef.DiscImages; namespace DiscImageChef.Partitions { @@ -106,10 +109,10 @@ namespace DiscImageChef.Partitions PluginUuid = new Guid("50F35CC4-8375-4445-8DCB-1BA550C931A3"); } - public override bool GetInformation(DiscImages.ImagePlugin imagePlugin, - out List partitions, ulong sectorOffset) + public override bool GetInformation(ImagePlugin imagePlugin, + out List partitions, ulong sectorOffset) { - partitions = new List(); + partitions = new List(); if(imagePlugin.GetSectorSize() < 512) return false; @@ -189,7 +192,7 @@ namespace DiscImageChef.Partitions for(int i = 0; i < NDKMAP; i++) if(dkl.dkl_map[i].dkl_cylno > 0 && dkl.dkl_map[i].dkl_nblk > 0) { - CommonTypes.Partition part = new CommonTypes.Partition + Partition part = new Partition { Size = (ulong)dkl.dkl_map[i].dkl_nblk * DK_LABEL_SIZE, Length = (ulong)(dkl.dkl_map[i].dkl_nblk * DK_LABEL_SIZE / imagePlugin.GetSectorSize()), @@ -254,7 +257,7 @@ namespace DiscImageChef.Partitions if(dkl8.dkl_map[i].dkl_nblk > 0 && dkl8.dkl_vtoc.v_part[i].p_tag != SunTag.SunEmpty && dkl8.dkl_vtoc.v_part[i].p_tag != SunTag.SunWholeDisk) { - CommonTypes.Partition part = new CommonTypes.Partition + Partition part = new Partition { Description = SunFlagsToString(dkl8.dkl_vtoc.v_part[i].p_flag), Size = (ulong)dkl8.dkl_map[i].dkl_nblk * DK_LABEL_SIZE, @@ -322,7 +325,7 @@ namespace DiscImageChef.Partitions if(dkl16.dkl_vtoc.v_part[i].p_size > 0 && dkl16.dkl_vtoc.v_part[i].p_tag != SunTag.SunEmpty && dkl16.dkl_vtoc.v_part[i].p_tag != SunTag.SunWholeDisk) { - CommonTypes.Partition part = new CommonTypes.Partition + Partition part = new Partition { Description = SunFlagsToString(dkl16.dkl_vtoc.v_part[i].p_flag), Size = (ulong)dkl16.dkl_vtoc.v_part[i].p_size * dkl16.dkl_vtoc.v_sectorsz, @@ -406,7 +409,7 @@ namespace DiscImageChef.Partitions public static string SunFlagsToString(SunFlags flags) { - System.Text.StringBuilder sb = new System.Text.StringBuilder(); + StringBuilder sb = new StringBuilder(); if(flags.HasFlag(SunFlags.NoMount)) sb.AppendLine("Unmountable"); if(flags.HasFlag(SunFlags.ReadOnly)) sb.AppendLine("Read-only"); return sb.ToString(); diff --git a/DiscImageChef.Partitions/Xbox.cs b/DiscImageChef.Partitions/Xbox.cs index b5642aa79..a8bd539ee 100644 --- a/DiscImageChef.Partitions/Xbox.cs +++ b/DiscImageChef.Partitions/Xbox.cs @@ -146,7 +146,7 @@ namespace DiscImageChef.Partitions { Description = "Data volume", Size = - (ulong)imagePlugin.ImageInfo.Sectors * imagePlugin.ImageInfo.SectorSize - MemoryUnitDataOff, + imagePlugin.ImageInfo.Sectors * imagePlugin.ImageInfo.SectorSize - MemoryUnitDataOff, Length = imagePlugin.ImageInfo.Sectors - sysCachePart.Length, Sequence = 2, Offset = MemoryUnitDataOff, diff --git a/DiscImageChef.Server/App_Start/Ata.cs b/DiscImageChef.Server/App_Start/Ata.cs index fbc7af16f..a3cdebfe4 100644 --- a/DiscImageChef.Server/App_Start/Ata.cs +++ b/DiscImageChef.Server/App_Start/Ata.cs @@ -360,69 +360,69 @@ namespace DiscImageChef.Server.App_Start if(atapi && ataReport.GeneralConfigurationSpecified) { // Bits 12 to 8, SCSI Peripheral Device Type - switch((Decoders.SCSI.PeripheralDeviceTypes)(((ushort)ataReport.GeneralConfiguration & 0x1F00) >> 8)) + switch((PeripheralDeviceTypes)(((ushort)ataReport.GeneralConfiguration & 0x1F00) >> 8)) { - case Decoders.SCSI.PeripheralDeviceTypes.DirectAccess: //0x00, + case PeripheralDeviceTypes.DirectAccess: //0x00, ataOneValue.Add("ATAPI Direct-access device"); break; - case Decoders.SCSI.PeripheralDeviceTypes.SequentialAccess: //0x01, + case PeripheralDeviceTypes.SequentialAccess: //0x01, ataOneValue.Add("ATAPI Sequential-access device"); break; - case Decoders.SCSI.PeripheralDeviceTypes.PrinterDevice: //0x02, + case PeripheralDeviceTypes.PrinterDevice: //0x02, ataOneValue.Add("ATAPI Printer device"); break; - case Decoders.SCSI.PeripheralDeviceTypes.ProcessorDevice: //0x03, + case PeripheralDeviceTypes.ProcessorDevice: //0x03, ataOneValue.Add("ATAPI Processor device"); break; - case Decoders.SCSI.PeripheralDeviceTypes.WriteOnceDevice: //0x04, + case PeripheralDeviceTypes.WriteOnceDevice: //0x04, ataOneValue.Add("ATAPI Write-once device"); break; case PeripheralDeviceTypes.MultiMediaDevice: //0x05, ataOneValue.Add("ATAPI CD-ROM/DVD/etc device"); break; - case Decoders.SCSI.PeripheralDeviceTypes.ScannerDevice: //0x06, + case PeripheralDeviceTypes.ScannerDevice: //0x06, ataOneValue.Add("ATAPI Scanner device"); break; - case Decoders.SCSI.PeripheralDeviceTypes.OpticalDevice: //0x07, + case PeripheralDeviceTypes.OpticalDevice: //0x07, ataOneValue.Add("ATAPI Optical memory device"); break; - case Decoders.SCSI.PeripheralDeviceTypes.MediumChangerDevice: //0x08, + case PeripheralDeviceTypes.MediumChangerDevice: //0x08, ataOneValue.Add("ATAPI Medium change device"); break; - case Decoders.SCSI.PeripheralDeviceTypes.CommsDevice: //0x09, + case PeripheralDeviceTypes.CommsDevice: //0x09, ataOneValue.Add("ATAPI Communications device"); break; - case Decoders.SCSI.PeripheralDeviceTypes.PrePressDevice1: //0x0A, + case PeripheralDeviceTypes.PrePressDevice1: //0x0A, ataOneValue.Add("ATAPI Graphics arts pre-press device (defined in ASC IT8)"); break; - case Decoders.SCSI.PeripheralDeviceTypes.PrePressDevice2: //0x0B, + case PeripheralDeviceTypes.PrePressDevice2: //0x0B, ataOneValue.Add("ATAPI Graphics arts pre-press device (defined in ASC IT8)"); break; - case Decoders.SCSI.PeripheralDeviceTypes.ArrayControllerDevice: //0x0C, + case PeripheralDeviceTypes.ArrayControllerDevice: //0x0C, ataOneValue.Add("ATAPI Array controller device"); break; - case Decoders.SCSI.PeripheralDeviceTypes.EnclosureServiceDevice: //0x0D, + case PeripheralDeviceTypes.EnclosureServiceDevice: //0x0D, ataOneValue.Add("ATAPI Enclosure services device"); break; - case Decoders.SCSI.PeripheralDeviceTypes.SimplifiedDevice: //0x0E, + case PeripheralDeviceTypes.SimplifiedDevice: //0x0E, ataOneValue.Add("ATAPI Simplified direct-access device"); break; - case Decoders.SCSI.PeripheralDeviceTypes.OCRWDevice: //0x0F, + case PeripheralDeviceTypes.OCRWDevice: //0x0F, ataOneValue.Add("ATAPI Optical card reader/writer device"); break; - case Decoders.SCSI.PeripheralDeviceTypes.BridgingExpander: //0x10, + case PeripheralDeviceTypes.BridgingExpander: //0x10, ataOneValue.Add("ATAPI Bridging Expanders"); break; - case Decoders.SCSI.PeripheralDeviceTypes.ObjectDevice: //0x11, + case PeripheralDeviceTypes.ObjectDevice: //0x11, ataOneValue.Add("ATAPI Object-based Storage Device"); break; - case Decoders.SCSI.PeripheralDeviceTypes.ADCDevice: //0x12, + case PeripheralDeviceTypes.ADCDevice: //0x12, ataOneValue.Add("ATAPI Automation/Drive Interface"); break; - case Decoders.SCSI.PeripheralDeviceTypes.WellKnownDevice: //0x1E, + case PeripheralDeviceTypes.WellKnownDevice: //0x1E, ataOneValue.Add("ATAPI Well known logical unit"); break; - case Decoders.SCSI.PeripheralDeviceTypes.UnknownDevice: //0x1F + case PeripheralDeviceTypes.UnknownDevice: //0x1F ataOneValue.Add("ATAPI Unknown or no device type"); break; default: @@ -818,25 +818,25 @@ namespace DiscImageChef.Server.App_Start { if(!ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.Clear)) { - if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen1Speed)) ataOneValue.Add(string.Format("SATA 1.5Gb/s is supported")); - if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen2Speed)) ataOneValue.Add(string.Format("SATA 3.0Gb/s is supported")); - if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen3Speed)) ataOneValue.Add(string.Format("SATA 6.0Gb/s is supported")); + if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen1Speed)) ataOneValue.Add("SATA 1.5Gb/s is supported"); + if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen2Speed)) ataOneValue.Add("SATA 3.0Gb/s is supported"); + if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.Gen3Speed)) ataOneValue.Add("SATA 6.0Gb/s is supported"); if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.PowerReceipt)) ataOneValue - .Add(string.Format("Receipt of host initiated power management requests is supported")); - if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.PHYEventCounter)) ataOneValue.Add(string.Format("PHY Event counters are supported")); + .Add("Receipt of host initiated power management requests is supported"); + if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.PHYEventCounter)) ataOneValue.Add("PHY Event counters are supported"); if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.HostSlumbTrans)) ataOneValue - .Add(string.Format("Supports host automatic partial to slumber transitions is supported")); + .Add("Supports host automatic partial to slumber transitions is supported"); if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.DevSlumbTrans)) ataOneValue - .Add(string.Format("Supports device automatic partial to slumber transitions is supported")); + .Add("Supports device automatic partial to slumber transitions is supported"); if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.NCQ)) { - ataOneValue.Add(string.Format("NCQ is supported")); + ataOneValue.Add("NCQ is supported"); - if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.NCQPriority)) ataOneValue.Add(string.Format("NCQ priority is supported")); - if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.UnloadNCQ)) ataOneValue.Add(string.Format("Unload is supported with outstanding NCQ commands")); + if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.NCQPriority)) ataOneValue.Add("NCQ priority is supported"); + if(ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.UnloadNCQ)) ataOneValue.Add("Unload is supported with outstanding NCQ commands"); } } @@ -847,16 +847,16 @@ namespace DiscImageChef.Server.App_Start !ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.Clear) && ataReport.SATACapabilities.HasFlag(SATACapabilitiesBit.NCQ)) { - if(ataReport.SATACapabilities2.HasFlag(SATACapabilitiesBit2.NCQMgmt)) ataOneValue.Add(string.Format("NCQ queue management is supported")); - if(ataReport.SATACapabilities2.HasFlag(SATACapabilitiesBit2.NCQStream)) ataOneValue.Add(string.Format("NCQ streaming is supported")); + if(ataReport.SATACapabilities2.HasFlag(SATACapabilitiesBit2.NCQMgmt)) ataOneValue.Add("NCQ queue management is supported"); + if(ataReport.SATACapabilities2.HasFlag(SATACapabilitiesBit2.NCQStream)) ataOneValue.Add("NCQ streaming is supported"); } if(ataReport.SATACapabilities2Specified && atapi) { - if(ataReport.SATACapabilities2.HasFlag(SATACapabilitiesBit2.HostEnvDetect)) ataOneValue.Add(string.Format("ATAPI device supports host environment detection")); + if(ataReport.SATACapabilities2.HasFlag(SATACapabilitiesBit2.HostEnvDetect)) ataOneValue.Add("ATAPI device supports host environment detection"); if(ataReport.SATACapabilities2.HasFlag(SATACapabilitiesBit2.DevAttSlimline)) ataOneValue - .Add(string.Format("ATAPI device supports attention on slimline connected devices")); + .Add("ATAPI device supports attention on slimline connected devices"); } } } diff --git a/DiscImageChef.Server/App_Start/ScsiEvpd.cs b/DiscImageChef.Server/App_Start/ScsiEvpd.cs index 593b6a03a..b66dbc457 100644 --- a/DiscImageChef.Server/App_Start/ScsiEvpd.cs +++ b/DiscImageChef.Server/App_Start/ScsiEvpd.cs @@ -31,6 +31,7 @@ // ****************************************************************************/ using System.Collections.Generic; +using DiscImageChef.Decoders.SCSI; using DiscImageChef.Metadata; namespace DiscImageChef.Server.App_Start @@ -42,38 +43,38 @@ namespace DiscImageChef.Server.App_Start foreach(pageType evpd in pages) { string decoded; - if(evpd.page >= 0x01 && evpd.page <= 0x7F) decoded = Decoders.SCSI.EVPD.DecodeASCIIPage(evpd.value); - else if(evpd.page == 0x81) decoded = Decoders.SCSI.EVPD.PrettifyPage_81(evpd.value); - else if(evpd.page == 0x82) decoded = Decoders.SCSI.EVPD.DecodePage82(evpd.value); - else if(evpd.page == 0x83) decoded = Decoders.SCSI.EVPD.PrettifyPage_83(evpd.value); - else if(evpd.page == 0x84) decoded = Decoders.SCSI.EVPD.PrettifyPage_84(evpd.value); - else if(evpd.page == 0x85) decoded = Decoders.SCSI.EVPD.PrettifyPage_85(evpd.value); - else if(evpd.page == 0x86) decoded = Decoders.SCSI.EVPD.PrettifyPage_86(evpd.value); - else if(evpd.page == 0x89) decoded = Decoders.SCSI.EVPD.PrettifyPage_89(evpd.value); - else if(evpd.page == 0xB0) decoded = Decoders.SCSI.EVPD.PrettifyPage_B0(evpd.value); + if(evpd.page >= 0x01 && evpd.page <= 0x7F) decoded = EVPD.DecodeASCIIPage(evpd.value); + else if(evpd.page == 0x81) decoded = EVPD.PrettifyPage_81(evpd.value); + else if(evpd.page == 0x82) decoded = EVPD.DecodePage82(evpd.value); + else if(evpd.page == 0x83) decoded = EVPD.PrettifyPage_83(evpd.value); + else if(evpd.page == 0x84) decoded = EVPD.PrettifyPage_84(evpd.value); + else if(evpd.page == 0x85) decoded = EVPD.PrettifyPage_85(evpd.value); + else if(evpd.page == 0x86) decoded = EVPD.PrettifyPage_86(evpd.value); + else if(evpd.page == 0x89) decoded = EVPD.PrettifyPage_89(evpd.value); + else if(evpd.page == 0xB0) decoded = EVPD.PrettifyPage_B0(evpd.value); else if(evpd.page == 0xB2) decoded = string.Format("TapeAlert Supported Flags Bitmap: 0x{0:X16}
", - Decoders.SCSI.EVPD.DecodePageB2(evpd.value)); - else if(evpd.page == 0xB4) decoded = Decoders.SCSI.EVPD.DecodePageB4(evpd.value); + EVPD.DecodePageB2(evpd.value)); + else if(evpd.page == 0xB4) decoded = EVPD.DecodePageB4(evpd.value); else if(evpd.page == 0xC0 && vendor.Trim() == "quantum") - decoded = Decoders.SCSI.EVPD.PrettifyPage_C0_Quantum(evpd.value); + decoded = EVPD.PrettifyPage_C0_Quantum(evpd.value); else if(evpd.page == 0xC0 && vendor.Trim() == "seagate") - decoded = Decoders.SCSI.EVPD.PrettifyPage_C0_Seagate(evpd.value); + decoded = EVPD.PrettifyPage_C0_Seagate(evpd.value); else if(evpd.page == 0xC0 && vendor.Trim() == "ibm") - decoded = Decoders.SCSI.EVPD.PrettifyPage_C0_IBM(evpd.value); + decoded = EVPD.PrettifyPage_C0_IBM(evpd.value); else if(evpd.page == 0xC1 && vendor.Trim() == "ibm") - decoded = Decoders.SCSI.EVPD.PrettifyPage_C1_IBM(evpd.value); + decoded = EVPD.PrettifyPage_C1_IBM(evpd.value); else if((evpd.page == 0xC0 || evpd.page == 0xC1) && vendor.Trim() == "certance") - decoded = Decoders.SCSI.EVPD.PrettifyPage_C0_C1_Certance(evpd.value); + decoded = EVPD.PrettifyPage_C0_C1_Certance(evpd.value); else if((evpd.page == 0xC2 || evpd.page == 0xC3 || evpd.page == 0xC4 || evpd.page == 0xC5 || evpd.page == 0xC6) && vendor.Trim() == "certance") - decoded = Decoders.SCSI.EVPD.PrettifyPage_C2_C3_C4_C5_C6_Certance(evpd.value); + decoded = EVPD.PrettifyPage_C2_C3_C4_C5_C6_Certance(evpd.value); else if((evpd.page == 0xC0 || evpd.page == 0xC1 || evpd.page == 0xC2 || evpd.page == 0xC3 || evpd.page == 0xC4 || evpd.page == 0xC5) && - vendor.Trim() == "hp") decoded = Decoders.SCSI.EVPD.PrettifyPage_C0_to_C5_HP(evpd.value); + vendor.Trim() == "hp") decoded = EVPD.PrettifyPage_C0_to_C5_HP(evpd.value); else if(evpd.page == 0xDF && vendor.Trim() == "certance") - decoded = Decoders.SCSI.EVPD.PrettifyPage_DF_Certance(evpd.value); + decoded = EVPD.PrettifyPage_DF_Certance(evpd.value); else decoded = "Undecoded"; if(!string.IsNullOrEmpty(decoded)) decoded = decoded.Replace("\n", "
"); diff --git a/DiscImageChef.Server/App_Start/ScsiInquiry.cs b/DiscImageChef.Server/App_Start/ScsiInquiry.cs index 867c613fd..feef85848 100644 --- a/DiscImageChef.Server/App_Start/ScsiInquiry.cs +++ b/DiscImageChef.Server/App_Start/ScsiInquiry.cs @@ -42,7 +42,7 @@ namespace DiscImageChef.Server.App_Start { List scsiOneValue = new List(); - switch((PeripheralQualifiers)inquiry.PeripheralQualifier) + switch(inquiry.PeripheralQualifier) { case PeripheralQualifiers.Supported: scsiOneValue.Add("Device is connected and supported."); @@ -62,7 +62,7 @@ namespace DiscImageChef.Server.App_Start break; } - switch((PeripheralDeviceTypes)inquiry.PeripheralDeviceType) + switch(inquiry.PeripheralDeviceType) { case PeripheralDeviceTypes.DirectAccess: //0x00, scsiOneValue.Add("Direct-access device"); @@ -227,7 +227,7 @@ namespace DiscImageChef.Server.App_Start if(inquiry.IUS) scsiOneValue.Add("Device supports information unit transfers"); if(inquiry.SoftReset) scsiOneValue.Add("Device implements RESET as a soft reset"); - switch((TGPSValues)inquiry.AsymmetricalLUNAccess) + switch(inquiry.AsymmetricalLUNAccess) { case TGPSValues.NotSupported: scsiOneValue.Add("Device does not support assymetrical access"); @@ -247,7 +247,7 @@ namespace DiscImageChef.Server.App_Start break; } - switch((SPIClocking)inquiry.SPIClocking) + switch(inquiry.SPIClocking) { case SPIClocking.ST: scsiOneValue.Add("Device supports only ST clocking"); diff --git a/DiscImageChef.Server/App_Start/ScsiModeSense.cs b/DiscImageChef.Server/App_Start/ScsiModeSense.cs index 80fd270f5..b9535681d 100644 --- a/DiscImageChef.Server/App_Start/ScsiModeSense.cs +++ b/DiscImageChef.Server/App_Start/ScsiModeSense.cs @@ -223,7 +223,7 @@ namespace DiscImageChef.Server.App_Start case 0x10: { if(page.subpage == 0) - if(deviceType == Decoders.SCSI.PeripheralDeviceTypes.SequentialAccess) + if(deviceType == PeripheralDeviceTypes.SequentialAccess) modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_10_SSC(page.value)); else diff --git a/DiscImageChef.Server/Controllers/UploadReportController.cs b/DiscImageChef.Server/Controllers/UploadReportController.cs index af6e7951d..15e8e39bf 100644 --- a/DiscImageChef.Server/Controllers/UploadReportController.cs +++ b/DiscImageChef.Server/Controllers/UploadReportController.cs @@ -32,8 +32,11 @@ using System; using System.IO; +using System.Net; using System.Net.Http; +using System.Text; using System.Web; +using System.Web.Hosting; using System.Web.Http; using System.Xml.Serialization; using DiscImageChef.Metadata; @@ -47,7 +50,7 @@ namespace DiscImageChef.Server.Controllers public HttpResponseMessage UploadReport() { HttpResponseMessage response = new HttpResponseMessage(); - response.StatusCode = System.Net.HttpStatusCode.OK; + response.StatusCode = HttpStatusCode.OK; try { @@ -56,7 +59,7 @@ namespace DiscImageChef.Server.Controllers if(request.InputStream == null) { - response.Content = new StringContent("notstats", System.Text.Encoding.UTF8, "text/plain"); + response.Content = new StringContent("notstats", Encoding.UTF8, "text/plain"); return response; } @@ -65,21 +68,21 @@ namespace DiscImageChef.Server.Controllers if(newReport == null) { - response.Content = new StringContent("notstats", System.Text.Encoding.UTF8, "text/plain"); + response.Content = new StringContent("notstats", Encoding.UTF8, "text/plain"); return response; } Random rng = new Random(); string filename = string.Format("NewReport_{0:yyyyMMddHHmmssfff}_{1}.xml", DateTime.UtcNow, rng.Next()); - while(File.Exists(Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~"), "Upload", filename))) filename = string.Format("NewReport_{0:yyyyMMddHHmmssfff}_{1}.xml", DateTime.UtcNow, rng.Next()); + while(File.Exists(Path.Combine(HostingEnvironment.MapPath("~"), "Upload", filename))) filename = string.Format("NewReport_{0:yyyyMMddHHmmssfff}_{1}.xml", DateTime.UtcNow, rng.Next()); FileStream newFile = - new FileStream(Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~"), "Upload", filename), + new FileStream(Path.Combine(HostingEnvironment.MapPath("~"), "Upload", filename), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None); xs.Serialize(newFile, newReport); newFile.Close(); - response.Content = new StringContent("ok", System.Text.Encoding.UTF8, "text/plain"); + response.Content = new StringContent("ok", Encoding.UTF8, "text/plain"); return response; } // ReSharper disable once RedundantCatchClause diff --git a/DiscImageChef.Server/Controllers/UploadStatsController.cs b/DiscImageChef.Server/Controllers/UploadStatsController.cs index 4acb9436e..daf1c9233 100644 --- a/DiscImageChef.Server/Controllers/UploadStatsController.cs +++ b/DiscImageChef.Server/Controllers/UploadStatsController.cs @@ -31,10 +31,15 @@ // ****************************************************************************/ using System; +using System.Collections.Generic; using System.IO; using System.Linq; +using System.Net; using System.Net.Http; +using System.Text; +using System.Threading; using System.Web; +using System.Web.Hosting; using System.Web.Http; using System.Xml.Serialization; using DiscImageChef.Metadata; @@ -48,7 +53,7 @@ namespace DiscImageChef.Server.Controllers public HttpResponseMessage UploadStats() { HttpResponseMessage response = new HttpResponseMessage(); - response.StatusCode = System.Net.HttpStatusCode.OK; + response.StatusCode = HttpStatusCode.OK; try { @@ -57,7 +62,7 @@ namespace DiscImageChef.Server.Controllers if(request.InputStream == null) { - response.Content = new StringContent("notstats", System.Text.Encoding.UTF8, "text/plain"); + response.Content = new StringContent("notstats", Encoding.UTF8, "text/plain"); return response; } @@ -66,17 +71,17 @@ namespace DiscImageChef.Server.Controllers if(newStats == null) { - response.Content = new StringContent("notstats", System.Text.Encoding.UTF8, "text/plain"); + response.Content = new StringContent("notstats", Encoding.UTF8, "text/plain"); return response; } FileStream fs = - WaitForFile(Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~"), "Statistics", "Statistics.xml"), + WaitForFile(Path.Combine(HostingEnvironment.MapPath("~"), "Statistics", "Statistics.xml"), FileMode.Open, FileAccess.ReadWrite, FileShare.None); if(fs == null) { - response.Content = new StringContent("retry", System.Text.Encoding.UTF8, "text/plain"); + response.Content = new StringContent("retry", Encoding.UTF8, "text/plain"); return response; } @@ -139,7 +144,7 @@ namespace DiscImageChef.Server.Controllers { if(oldStats.OperatingSystems == null) oldStats.OperatingSystems = - new System.Collections.Generic.List {new OsStats {name = "Linux", Value = 1}}; + new List {new OsStats {name = "Linux", Value = 1}}; else { OsStats removeNvs = null; @@ -194,7 +199,7 @@ namespace DiscImageChef.Server.Controllers { if(oldStats.Versions == null) oldStats.Versions = - new System.Collections.Generic.List + new List { new NameValueStats {name = "previous", Value = 1} }; @@ -418,13 +423,13 @@ namespace DiscImageChef.Server.Controllers Random rng = new Random(); string filename = string.Format("BackupStats_{0:yyyyMMddHHmmssfff}_{1}.xml", DateTime.UtcNow, rng.Next()); - while(File.Exists(Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~"), "Statistics", + while(File.Exists(Path.Combine(HostingEnvironment.MapPath("~"), "Statistics", filename))) filename = string.Format("BackupStats_{0:yyyyMMddHHmmssfff}_{1}.xml", DateTime.UtcNow, rng.Next()); FileStream backup = new - FileStream(Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~"), "Statistics", filename), + FileStream(Path.Combine(HostingEnvironment.MapPath("~"), "Statistics", filename), FileMode.CreateNew, FileAccess.ReadWrite, FileShare.None); fs.Seek(0, SeekOrigin.Begin); fs.CopyTo(backup); @@ -435,13 +440,13 @@ namespace DiscImageChef.Server.Controllers fs.SetLength(fs.Position); fs.Close(); - response.Content = new StringContent("ok", System.Text.Encoding.UTF8, "text/plain"); + response.Content = new StringContent("ok", Encoding.UTF8, "text/plain"); return response; } catch(Exception ex) { #if DEBUG - System.Console.WriteLine("{0} {1}", ex.Message, ex.InnerException); + Console.WriteLine("{0} {1}", ex.Message, ex.InnerException); throw; #else response.Content = new StringContent("error", System.Text.Encoding.UTF8, "text/plain"); @@ -463,7 +468,7 @@ namespace DiscImageChef.Server.Controllers catch(IOException) { if(fs != null) fs.Dispose(); - System.Threading.Thread.Sleep(50); + Thread.Sleep(50); } } diff --git a/DiscImageChef.Server/Default.aspx.cs b/DiscImageChef.Server/Default.aspx.cs index b2a010d6c..e5940e8e2 100644 --- a/DiscImageChef.Server/Default.aspx.cs +++ b/DiscImageChef.Server/Default.aspx.cs @@ -32,24 +32,27 @@ using System; using System.IO; +using System.Reflection; +using System.Web.Hosting; +using System.Web.UI; using Velyo.AspNet.Markdown; namespace DiscImageChef.Server { - public partial class Default : System.Web.UI.Page + public partial class Default : Page { protected void Page_Load(object sender, EventArgs e) { MarkdownContent mkdown = new MarkdownContent(); StreamReader sr = - new StreamReader(Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~"), "docs", "README.md")); + new StreamReader(Path.Combine(HostingEnvironment.MapPath("~"), "docs", "README.md")); string mdcontent = sr.ReadToEnd(); sr.Close(); mkdown.Content = mdcontent.Replace(".md)", ".aspx)"); body.Controls.Add(mkdown); - lblVersion.Text = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString(); + lblVersion.Text = Assembly.GetExecutingAssembly().GetName().Version.ToString(); } } } \ No newline at end of file diff --git a/DiscImageChef.Server/Default.aspx.designer.cs b/DiscImageChef.Server/Default.aspx.designer.cs index 3558dbcc3..9d4061592 100644 --- a/DiscImageChef.Server/Default.aspx.designer.cs +++ b/DiscImageChef.Server/Default.aspx.designer.cs @@ -8,13 +8,16 @@ // //------------------------------------------------------------------------------ +using System.Web.UI.HtmlControls; +using System.Web.UI.WebControls; + namespace DiscImageChef.Server { public partial class Default { - protected System.Web.UI.HtmlControls.HtmlGenericControl body; + protected HtmlGenericControl body; - protected System.Web.UI.WebControls.Label lblVersion; + protected Label lblVersion; } } diff --git a/DiscImageChef.Server/Statistics.aspx.cs b/DiscImageChef.Server/Statistics.aspx.cs index abe29f8e2..7ce26a339 100644 --- a/DiscImageChef.Server/Statistics.aspx.cs +++ b/DiscImageChef.Server/Statistics.aspx.cs @@ -35,13 +35,18 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Reflection; +using System.Threading; using System.Web; +using System.Web.Hosting; +using System.Web.UI; using System.Xml.Serialization; +using DiscImageChef.Interop; using DiscImageChef.Metadata; +using PlatformID = DiscImageChef.Interop.PlatformID; namespace DiscImageChef.Server { - public partial class Statistics : System.Web.UI.Page + public partial class Statistics : Page { class MediaItem { @@ -72,12 +77,12 @@ namespace DiscImageChef.Server try { - if(!File.Exists(Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~"), "Statistics", + if(!File.Exists(Path.Combine(HostingEnvironment.MapPath("~"), "Statistics", "Statistics.xml"))) { #if DEBUG content.InnerHtml = string.Format("Sorry, cannot load data file \"{0}\"", - Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~"), + Path.Combine(HostingEnvironment.MapPath("~"), "Statistics", "Statistics.xml")); #else content.InnerHtml = "Sorry, cannot load data file"; @@ -89,7 +94,7 @@ namespace DiscImageChef.Server XmlSerializer xs = new XmlSerializer(statistics.GetType()); FileStream fs = - WaitForFile(Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~"), "Statistics", "Statistics.xml"), + WaitForFile(Path.Combine(HostingEnvironment.MapPath("~"), "Statistics", "Statistics.xml"), FileMode.Open, FileAccess.Read, FileShare.Read); statistics = (Stats)xs.Deserialize(fs); fs.Close(); @@ -101,8 +106,8 @@ namespace DiscImageChef.Server operatingSystems.Add(new NameValueStats { name = string.Format("{0}{1}{2}", - Interop.DetectOS - .GetPlatformName((Interop.PlatformID)Enum.Parse(typeof(Interop.PlatformID), nvs.name), + DetectOS + .GetPlatformName((PlatformID)Enum.Parse(typeof(PlatformID), nvs.name), nvs.version), string.IsNullOrEmpty(nvs.version) ? "" : " ", nvs.version), Value = nvs.Value @@ -256,7 +261,7 @@ namespace DiscImageChef.Server xmlFile = xmlFile.Replace('/', '_').Replace('\\', '_').Replace('?', '_'); - if(!File.Exists(Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~"), "Reports", + if(!File.Exists(Path.Combine(HostingEnvironment.MapPath("~"), "Reports", xmlFile))) url = null; devices.Add(new DeviceItem @@ -299,7 +304,7 @@ namespace DiscImageChef.Server catch(IOException) { if(fs != null) fs.Dispose(); - System.Threading.Thread.Sleep(50); + Thread.Sleep(50); } } diff --git a/DiscImageChef.Server/Statistics.aspx.designer.cs b/DiscImageChef.Server/Statistics.aspx.designer.cs index 5fe480945..da2c54ff2 100644 --- a/DiscImageChef.Server/Statistics.aspx.designer.cs +++ b/DiscImageChef.Server/Statistics.aspx.designer.cs @@ -8,91 +8,94 @@ // //------------------------------------------------------------------------------ +using System.Web.UI.HtmlControls; +using System.Web.UI.WebControls; + namespace DiscImageChef.Server { public partial class Statistics { - protected System.Web.UI.HtmlControls.HtmlGenericControl body; + protected HtmlGenericControl body; - protected System.Web.UI.WebControls.Label lblVersion; + protected Label lblVersion; - protected System.Web.UI.HtmlControls.HtmlGenericControl content; + protected HtmlGenericControl content; - protected System.Web.UI.HtmlControls.HtmlGenericControl divOperatingSystems; + protected HtmlGenericControl divOperatingSystems; - protected System.Web.UI.WebControls.Repeater repOperatingSystems; + protected Repeater repOperatingSystems; - protected System.Web.UI.HtmlControls.HtmlGenericControl divVersions; + protected HtmlGenericControl divVersions; - protected System.Web.UI.WebControls.Repeater repVersions; + protected Repeater repVersions; - protected System.Web.UI.HtmlControls.HtmlGenericControl divCommands; + protected HtmlGenericControl divCommands; - protected System.Web.UI.WebControls.Label lblAnalyze; + protected Label lblAnalyze; - protected System.Web.UI.WebControls.Label lblBenchmark; + protected Label lblBenchmark; - protected System.Web.UI.WebControls.Label lblChecksum; + protected Label lblChecksum; - protected System.Web.UI.WebControls.Label lblCompare; + protected Label lblCompare; - protected System.Web.UI.WebControls.Label lblCreateSidecar; + protected Label lblCreateSidecar; - protected System.Web.UI.WebControls.Label lblDecode; + protected Label lblDecode; - protected System.Web.UI.WebControls.Label lblDeviceInfo; + protected Label lblDeviceInfo; - protected System.Web.UI.WebControls.Label lblDeviceReport; + protected Label lblDeviceReport; - protected System.Web.UI.WebControls.Label lblDumpMedia; + protected Label lblDumpMedia; - protected System.Web.UI.WebControls.Label lblEntropy; + protected Label lblEntropy; - protected System.Web.UI.WebControls.Label lblExtractFiles; + protected Label lblExtractFiles; - protected System.Web.UI.WebControls.Label lblFormats; + protected Label lblFormats; - protected System.Web.UI.WebControls.Label lblListDevices; + protected Label lblListDevices; - protected System.Web.UI.WebControls.Label lblListEncodings; + protected Label lblListEncodings; - protected System.Web.UI.WebControls.Label lblLs; + protected Label lblLs; - protected System.Web.UI.WebControls.Label lblMediaInfo; + protected Label lblMediaInfo; - protected System.Web.UI.WebControls.Label lblMediaScan; + protected Label lblMediaScan; - protected System.Web.UI.WebControls.Label lblPrintHex; + protected Label lblPrintHex; - protected System.Web.UI.WebControls.Label lblVerify; + protected Label lblVerify; - protected System.Web.UI.HtmlControls.HtmlGenericControl divFilters; + protected HtmlGenericControl divFilters; - protected System.Web.UI.WebControls.Repeater repFilters; + protected Repeater repFilters; - protected System.Web.UI.HtmlControls.HtmlGenericControl divMediaImages; + protected HtmlGenericControl divMediaImages; - protected System.Web.UI.WebControls.Repeater repMediaImages; + protected Repeater repMediaImages; - protected System.Web.UI.HtmlControls.HtmlGenericControl divPartitions; + protected HtmlGenericControl divPartitions; - protected System.Web.UI.WebControls.Repeater repPartitions; + protected Repeater repPartitions; - protected System.Web.UI.HtmlControls.HtmlGenericControl divFilesystems; + protected HtmlGenericControl divFilesystems; - protected System.Web.UI.WebControls.Repeater repFilesystems; + protected Repeater repFilesystems; - protected System.Web.UI.HtmlControls.HtmlGenericControl divVirtualMedia; + protected HtmlGenericControl divVirtualMedia; - protected System.Web.UI.WebControls.Repeater repVirtualMedia; + protected Repeater repVirtualMedia; - protected System.Web.UI.HtmlControls.HtmlGenericControl divRealMedia; + protected HtmlGenericControl divRealMedia; - protected System.Web.UI.WebControls.Repeater repRealMedia; + protected Repeater repRealMedia; - protected System.Web.UI.HtmlControls.HtmlGenericControl divDevices; + protected HtmlGenericControl divDevices; - protected System.Web.UI.WebControls.Repeater repDevices; + protected Repeater repDevices; } } diff --git a/DiscImageChef.Server/ViewReport.aspx.cs b/DiscImageChef.Server/ViewReport.aspx.cs index 831e0d061..8beb3ce0c 100644 --- a/DiscImageChef.Server/ViewReport.aspx.cs +++ b/DiscImageChef.Server/ViewReport.aspx.cs @@ -35,14 +35,18 @@ using System.Collections.Generic; using System.IO; using System.Text; using System.Web; +using System.Web.Hosting; +using System.Web.UI; using System.Xml.Serialization; +using DiscImageChef.Decoders.PCMCIA; using DiscImageChef.Decoders.SCSI; using DiscImageChef.Metadata; using DiscImageChef.Server.App_Start; +using Tuple = DiscImageChef.Decoders.PCMCIA.Tuple; namespace DiscImageChef.Server { - public partial class ViewReport : System.Web.UI.Page + public partial class ViewReport : Page { protected void Page_Load(object sender, EventArgs e) { @@ -78,7 +82,7 @@ namespace DiscImageChef.Server else if(!string.IsNullOrWhiteSpace(model)) xmlFile = model + ".xml"; if(xmlFile == null || - !File.Exists(Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~"), "Reports", xmlFile))) + !File.Exists(Path.Combine(HostingEnvironment.MapPath("~"), "Reports", xmlFile))) { content.InnerHtml = "Could not find the specified report"; return; @@ -91,7 +95,7 @@ namespace DiscImageChef.Server DeviceReport report = new DeviceReport(); XmlSerializer xs = new XmlSerializer(report.GetType()); StreamReader sr = - new StreamReader(Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~"), "Reports", + new StreamReader(Path.Combine(HostingEnvironment.MapPath("~"), "Reports", xmlFile)); report = (DeviceReport)xs.Deserialize(sr); sr.Close(); @@ -132,23 +136,23 @@ namespace DiscImageChef.Server lblPcmciaManufacturerCode.Text = string.Format("0x{0:x4}", report.PCMCIA.ManufacturerCode); lblPcmciaCardCode.Text = string.Format("0x{0:x4}", report.PCMCIA.CardCode); lblPcmciaCompliance.Text = HttpUtility.HtmlEncode(report.PCMCIA.Compliance); - Decoders.PCMCIA.Tuple[] tuples = Decoders.PCMCIA.CIS.GetTuples(report.PCMCIA.CIS); + Tuple[] tuples = CIS.GetTuples(report.PCMCIA.CIS); if(tuples != null) { Dictionary decodedTuples = new Dictionary(); - foreach(Decoders.PCMCIA.Tuple tuple in tuples) + foreach(Tuple tuple in tuples) switch(tuple.Code) { - case Decoders.PCMCIA.TupleCodes.CISTPL_NULL: - case Decoders.PCMCIA.TupleCodes.CISTPL_END: - case Decoders.PCMCIA.TupleCodes.CISTPL_MANFID: - case Decoders.PCMCIA.TupleCodes.CISTPL_VERS_1: break; - case Decoders.PCMCIA.TupleCodes.CISTPL_DEVICEGEO: - case Decoders.PCMCIA.TupleCodes.CISTPL_DEVICEGEO_A: - Decoders.PCMCIA.DeviceGeometryTuple geom = - Decoders.PCMCIA.CIS.DecodeDeviceGeometryTuple(tuple.Data); + case TupleCodes.CISTPL_NULL: + case TupleCodes.CISTPL_END: + case TupleCodes.CISTPL_MANFID: + case TupleCodes.CISTPL_VERS_1: break; + case TupleCodes.CISTPL_DEVICEGEO: + case TupleCodes.CISTPL_DEVICEGEO_A: + DeviceGeometryTuple geom = + CIS.DecodeDeviceGeometryTuple(tuple.Data); if(geom != null && geom.Geometries != null) - foreach(Decoders.PCMCIA.DeviceGeometry geometry in geom.Geometries) + foreach(DeviceGeometry geometry in geom.Geometries) { decodedTuples.Add("Device width", string.Format("{0} bits", @@ -173,40 +177,40 @@ namespace DiscImageChef.Server } break; - case Decoders.PCMCIA.TupleCodes.CISTPL_ALTSTR: - case Decoders.PCMCIA.TupleCodes.CISTPL_BAR: - case Decoders.PCMCIA.TupleCodes.CISTPL_BATTERY: - case Decoders.PCMCIA.TupleCodes.CISTPL_BYTEORDER: - case Decoders.PCMCIA.TupleCodes.CISTPL_CFTABLE_ENTRY: - case Decoders.PCMCIA.TupleCodes.CISTPL_CFTABLE_ENTRY_CB: - case Decoders.PCMCIA.TupleCodes.CISTPL_CHECKSUM: - case Decoders.PCMCIA.TupleCodes.CISTPL_CONFIG: - case Decoders.PCMCIA.TupleCodes.CISTPL_CONFIG_CB: - case Decoders.PCMCIA.TupleCodes.CISTPL_DATE: - case Decoders.PCMCIA.TupleCodes.CISTPL_DEVICE: - case Decoders.PCMCIA.TupleCodes.CISTPL_DEVICE_A: - case Decoders.PCMCIA.TupleCodes.CISTPL_DEVICE_OA: - case Decoders.PCMCIA.TupleCodes.CISTPL_DEVICE_OC: - case Decoders.PCMCIA.TupleCodes.CISTPL_EXTDEVIC: - case Decoders.PCMCIA.TupleCodes.CISTPL_FORMAT: - case Decoders.PCMCIA.TupleCodes.CISTPL_FORMAT_A: - case Decoders.PCMCIA.TupleCodes.CISTPL_FUNCE: - case Decoders.PCMCIA.TupleCodes.CISTPL_FUNCID: - case Decoders.PCMCIA.TupleCodes.CISTPL_GEOMETRY: - case Decoders.PCMCIA.TupleCodes.CISTPL_INDIRECT: - case Decoders.PCMCIA.TupleCodes.CISTPL_JEDEC_A: - case Decoders.PCMCIA.TupleCodes.CISTPL_JEDEC_C: - case Decoders.PCMCIA.TupleCodes.CISTPL_LINKTARGET: - case Decoders.PCMCIA.TupleCodes.CISTPL_LONGLINK_A: - case Decoders.PCMCIA.TupleCodes.CISTPL_LONGLINK_C: - case Decoders.PCMCIA.TupleCodes.CISTPL_LONGLINK_CB: - case Decoders.PCMCIA.TupleCodes.CISTPL_LONGLINK_MFC: - case Decoders.PCMCIA.TupleCodes.CISTPL_NO_LINK: - case Decoders.PCMCIA.TupleCodes.CISTPL_ORG: - case Decoders.PCMCIA.TupleCodes.CISTPL_PWR_MGMNT: - case Decoders.PCMCIA.TupleCodes.CISTPL_SPCL: - case Decoders.PCMCIA.TupleCodes.CISTPL_SWIL: - case Decoders.PCMCIA.TupleCodes.CISTPL_VERS_2: + case TupleCodes.CISTPL_ALTSTR: + case TupleCodes.CISTPL_BAR: + case TupleCodes.CISTPL_BATTERY: + case TupleCodes.CISTPL_BYTEORDER: + case TupleCodes.CISTPL_CFTABLE_ENTRY: + case TupleCodes.CISTPL_CFTABLE_ENTRY_CB: + case TupleCodes.CISTPL_CHECKSUM: + case TupleCodes.CISTPL_CONFIG: + case TupleCodes.CISTPL_CONFIG_CB: + case TupleCodes.CISTPL_DATE: + case TupleCodes.CISTPL_DEVICE: + case TupleCodes.CISTPL_DEVICE_A: + case TupleCodes.CISTPL_DEVICE_OA: + case TupleCodes.CISTPL_DEVICE_OC: + case TupleCodes.CISTPL_EXTDEVIC: + case TupleCodes.CISTPL_FORMAT: + case TupleCodes.CISTPL_FORMAT_A: + case TupleCodes.CISTPL_FUNCE: + case TupleCodes.CISTPL_FUNCID: + case TupleCodes.CISTPL_GEOMETRY: + case TupleCodes.CISTPL_INDIRECT: + case TupleCodes.CISTPL_JEDEC_A: + case TupleCodes.CISTPL_JEDEC_C: + case TupleCodes.CISTPL_LINKTARGET: + case TupleCodes.CISTPL_LONGLINK_A: + case TupleCodes.CISTPL_LONGLINK_C: + case TupleCodes.CISTPL_LONGLINK_CB: + case TupleCodes.CISTPL_LONGLINK_MFC: + case TupleCodes.CISTPL_NO_LINK: + case TupleCodes.CISTPL_ORG: + case TupleCodes.CISTPL_PWR_MGMNT: + case TupleCodes.CISTPL_SPCL: + case TupleCodes.CISTPL_SWIL: + case TupleCodes.CISTPL_VERS_2: decodedTuples.Add("Undecoded tuple ID", tuple.Code.ToString()); break; default: @@ -563,10 +567,10 @@ namespace DiscImageChef.Server vendorDescription = null; productDescription = null; - if(!File.Exists(Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~"), "usb.ids"))) return; + if(!File.Exists(Path.Combine(HostingEnvironment.MapPath("~"), "usb.ids"))) return; StreamReader tocStream = - new StreamReader(Path.Combine(System.Web.Hosting.HostingEnvironment.MapPath("~"), "usb.ids")); + new StreamReader(Path.Combine(HostingEnvironment.MapPath("~"), "usb.ids")); string _line; bool inManufacturer = false; ushort number; @@ -589,19 +593,16 @@ namespace DiscImageChef.Server productDescription = _line.Substring(7); return; } - else - { - // Skip products - if(_line[0] == '\t') continue; + // Skip products + if(_line[0] == '\t') continue; - try { number = Convert.ToUInt16(_line.Substring(0, 4), 16); } - catch(FormatException) { continue; } + try { number = Convert.ToUInt16(_line.Substring(0, 4), 16); } + catch(FormatException) { continue; } - if(number != vendor) continue; + if(number != vendor) continue; - vendorDescription = _line.Substring(6); - inManufacturer = true; - } + vendorDescription = _line.Substring(6); + inManufacturer = true; } } } diff --git a/DiscImageChef.Server/ViewReport.aspx.designer.cs b/DiscImageChef.Server/ViewReport.aspx.designer.cs index ffa3e3d4c..18398b2f0 100644 --- a/DiscImageChef.Server/ViewReport.aspx.designer.cs +++ b/DiscImageChef.Server/ViewReport.aspx.designer.cs @@ -8,115 +8,118 @@ // //------------------------------------------------------------------------------ +using System.Web.UI.HtmlControls; +using System.Web.UI.WebControls; + namespace DiscImageChef.Server { public partial class ViewReport { - protected System.Web.UI.HtmlControls.HtmlGenericControl content; + protected HtmlGenericControl content; - protected System.Web.UI.WebControls.Label lblManufacturer; + protected Label lblManufacturer; - protected System.Web.UI.WebControls.Label lblModel; + protected Label lblModel; - protected System.Web.UI.WebControls.Label lblRevision; + protected Label lblRevision; - protected System.Web.UI.HtmlControls.HtmlGenericControl divUsb; + protected HtmlGenericControl divUsb; - protected System.Web.UI.WebControls.Label lblUsbManufacturer; + protected Label lblUsbManufacturer; - protected System.Web.UI.WebControls.Label lblUsbProduct; + protected Label lblUsbProduct; - protected System.Web.UI.WebControls.Label lblUsbVendor; + protected Label lblUsbVendor; - protected System.Web.UI.WebControls.Label lblUsbVendorDescription; + protected Label lblUsbVendorDescription; - protected System.Web.UI.WebControls.Label lblUsbProductId; + protected Label lblUsbProductId; - protected System.Web.UI.WebControls.Label lblUsbProductDescription; + protected Label lblUsbProductDescription; - protected System.Web.UI.HtmlControls.HtmlGenericControl divFirewire; + protected HtmlGenericControl divFirewire; - protected System.Web.UI.WebControls.Label lblFirewireManufacturer; + protected Label lblFirewireManufacturer; - protected System.Web.UI.WebControls.Label lblFirewireProduct; + protected Label lblFirewireProduct; - protected System.Web.UI.WebControls.Label lblFirewireVendor; + protected Label lblFirewireVendor; - protected System.Web.UI.WebControls.Label lblFirewireProductId; + protected Label lblFirewireProductId; - protected System.Web.UI.HtmlControls.HtmlGenericControl divPcmcia; + protected HtmlGenericControl divPcmcia; - protected System.Web.UI.WebControls.Label lblPcmciaManufacturer; + protected Label lblPcmciaManufacturer; - protected System.Web.UI.WebControls.Label lblPcmciaProduct; + protected Label lblPcmciaProduct; - protected System.Web.UI.WebControls.Label lblPcmciaManufacturerCode; + protected Label lblPcmciaManufacturerCode; - protected System.Web.UI.WebControls.Label lblPcmciaCardCode; + protected Label lblPcmciaCardCode; - protected System.Web.UI.WebControls.Label lblPcmciaCompliance; + protected Label lblPcmciaCompliance; - protected System.Web.UI.WebControls.Repeater repPcmciaTuples; + protected Repeater repPcmciaTuples; - protected System.Web.UI.HtmlControls.HtmlGenericControl divAta; + protected HtmlGenericControl divAta; - protected System.Web.UI.WebControls.Label lblAtapi; + protected Label lblAtapi; - protected System.Web.UI.WebControls.Label lblAtaDeviceType; + protected Label lblAtaDeviceType; - protected System.Web.UI.WebControls.Repeater repAtaTwo; + protected Repeater repAtaTwo; - protected System.Web.UI.WebControls.Repeater repAtaOne; + protected Repeater repAtaOne; - protected System.Web.UI.HtmlControls.HtmlGenericControl divScsi; + protected HtmlGenericControl divScsi; - protected System.Web.UI.WebControls.Label lblScsiVendor; + protected Label lblScsiVendor; - protected System.Web.UI.WebControls.Label lblScsiProduct; + protected Label lblScsiProduct; - protected System.Web.UI.WebControls.Label lblScsiRevision; + protected Label lblScsiRevision; - protected System.Web.UI.WebControls.Repeater repScsi; + protected Repeater repScsi; - protected System.Web.UI.HtmlControls.HtmlGenericControl divScsiModeSense; + protected HtmlGenericControl divScsiModeSense; - protected System.Web.UI.WebControls.Repeater repModeSense; + protected Repeater repModeSense; - protected System.Web.UI.HtmlControls.HtmlGenericControl divScsiEvpd; + protected HtmlGenericControl divScsiEvpd; - protected System.Web.UI.WebControls.Repeater repEvpd; + protected Repeater repEvpd; - protected System.Web.UI.HtmlControls.HtmlGenericControl divScsiMmcMode; + protected HtmlGenericControl divScsiMmcMode; - protected System.Web.UI.WebControls.Repeater repScsiMmcMode; + protected Repeater repScsiMmcMode; - protected System.Web.UI.HtmlControls.HtmlGenericControl divScsiMmcFeatures; + protected HtmlGenericControl divScsiMmcFeatures; - protected System.Web.UI.WebControls.Repeater repScsiMmcFeatures; + protected Repeater repScsiMmcFeatures; - protected System.Web.UI.HtmlControls.HtmlGenericControl divScsiSsc; + protected HtmlGenericControl divScsiSsc; - protected System.Web.UI.WebControls.Label lblScsiSscGranularity; + protected Label lblScsiSscGranularity; - protected System.Web.UI.WebControls.Label lblScsiSscMaxBlock; + protected Label lblScsiSscMaxBlock; - protected System.Web.UI.WebControls.Label lblScsiSscMinBlock; + protected Label lblScsiSscMinBlock; - protected System.Web.UI.WebControls.Repeater repScsiSscDensities; + protected Repeater repScsiSscDensities; - protected System.Web.UI.WebControls.Repeater repScsiSscMedias; + protected Repeater repScsiSscMedias; - protected System.Web.UI.HtmlControls.HtmlGenericControl divTestedMedia; + protected HtmlGenericControl divTestedMedia; - protected System.Web.UI.WebControls.Repeater repTestedMedia; + protected Repeater repTestedMedia; - protected System.Web.UI.HtmlControls.HtmlGenericControl divMMC; + protected HtmlGenericControl divMMC; - protected System.Web.UI.WebControls.Repeater repMMC; + protected Repeater repMMC; - protected System.Web.UI.HtmlControls.HtmlGenericControl divSD; + protected HtmlGenericControl divSD; - protected System.Web.UI.WebControls.Repeater repSD; + protected Repeater repSD; } } diff --git a/DiscImageChef.Settings/Settings.cs b/DiscImageChef.Settings/Settings.cs index 8daa664b0..a5b2ff7a5 100644 --- a/DiscImageChef.Settings/Settings.cs +++ b/DiscImageChef.Settings/Settings.cs @@ -36,6 +36,7 @@ using System.Xml.Serialization; using Claunia.PropertyList; using DiscImageChef.Interop; using Microsoft.Win32; +using PlatformID = DiscImageChef.Interop.PlatformID; namespace DiscImageChef.Settings { @@ -78,14 +79,14 @@ namespace DiscImageChef.Settings public static void LoadSettings() { Current = new DicSettings(); - Interop.PlatformID ptID = DetectOS.GetRealPlatformID(); + PlatformID ptID = DetectOS.GetRealPlatformID(); try { switch(ptID) { - case Interop.PlatformID.MacOSX: - case Interop.PlatformID.iOS: + case PlatformID.MacOSX: + case PlatformID.iOS: { string appSupportPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Library", @@ -102,11 +103,11 @@ namespace DiscImageChef.Settings if(!Directory.Exists(StatsPath)) Directory.CreateDirectory(StatsPath); } break; - case Interop.PlatformID.Win32NT: - case Interop.PlatformID.Win32S: - case Interop.PlatformID.Win32Windows: - case Interop.PlatformID.WinCE: - case Interop.PlatformID.WindowsPhone: + case PlatformID.Win32NT: + case PlatformID.Win32S: + case PlatformID.Win32Windows: + case PlatformID.WinCE: + case PlatformID.WindowsPhone: { string appSupportPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @@ -151,8 +152,8 @@ namespace DiscImageChef.Settings { switch(ptID) { - case Interop.PlatformID.MacOSX: - case Interop.PlatformID.iOS: + case PlatformID.MacOSX: + case PlatformID.iOS: { string preferencesPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Library", @@ -235,11 +236,11 @@ namespace DiscImageChef.Settings } } break; - case Interop.PlatformID.Win32NT: - case Interop.PlatformID.Win32S: - case Interop.PlatformID.Win32Windows: - case Interop.PlatformID.WinCE: - case Interop.PlatformID.WindowsPhone: + case PlatformID.Win32NT: + case PlatformID.Win32S: + case PlatformID.Win32Windows: + case PlatformID.WinCE: + case PlatformID.WindowsPhone: { RegistryKey parentKey = Registry.CurrentUser.OpenSubKey("SOFTWARE").OpenSubKey("Claunia.com"); if(parentKey == null) @@ -313,12 +314,12 @@ namespace DiscImageChef.Settings { try { - Interop.PlatformID ptID = DetectOS.GetRealPlatformID(); + PlatformID ptID = DetectOS.GetRealPlatformID(); switch(ptID) { - case Interop.PlatformID.MacOSX: - case Interop.PlatformID.iOS: + case PlatformID.MacOSX: + case PlatformID.iOS: { NSDictionary root = new NSDictionary(); root.Add("SaveReportsGlobally", Current.SaveReportsGlobally); @@ -350,11 +351,11 @@ namespace DiscImageChef.Settings fs.Close(); } break; - case Interop.PlatformID.Win32NT: - case Interop.PlatformID.Win32S: - case Interop.PlatformID.Win32Windows: - case Interop.PlatformID.WinCE: - case Interop.PlatformID.WindowsPhone: + case PlatformID.Win32NT: + case PlatformID.Win32S: + case PlatformID.Win32Windows: + case PlatformID.WinCE: + case PlatformID.WindowsPhone: { RegistryKey parentKey = Registry.CurrentUser.OpenSubKey("SOFTWARE", true).CreateSubKey("Claunia.com"); diff --git a/DiscImageChef.Tests.Devices/ATA/Ata28.cs b/DiscImageChef.Tests.Devices/ATA/Ata28.cs index 0a1edcc16..e756e57fb 100644 --- a/DiscImageChef.Tests.Devices/ATA/Ata28.cs +++ b/DiscImageChef.Tests.Devices/ATA/Ata28.cs @@ -298,7 +298,6 @@ namespace DiscImageChef.Tests.Devices.ATA DicConsole.WriteLine("Not a number. Press any key to continue..."); count = 0; System.Console.ReadKey(); - continue; } break; @@ -552,7 +551,6 @@ namespace DiscImageChef.Tests.Devices.ATA DicConsole.WriteLine("Not a number. Press any key to continue..."); count = 0; System.Console.ReadKey(); - continue; } break; @@ -737,7 +735,6 @@ namespace DiscImageChef.Tests.Devices.ATA DicConsole.WriteLine("Not a number. Press any key to continue..."); count = 0; System.Console.ReadKey(); - continue; } break; diff --git a/DiscImageChef.Tests.Devices/ATA/Ata48.cs b/DiscImageChef.Tests.Devices/ATA/Ata48.cs index b00cd1257..218c1826d 100644 --- a/DiscImageChef.Tests.Devices/ATA/Ata48.cs +++ b/DiscImageChef.Tests.Devices/ATA/Ata48.cs @@ -205,7 +205,6 @@ namespace DiscImageChef.Tests.Devices.ATA DicConsole.WriteLine("Not a number. Press any key to continue..."); count = 0; System.Console.ReadKey(); - continue; } break; @@ -342,7 +341,6 @@ namespace DiscImageChef.Tests.Devices.ATA DicConsole.WriteLine("Not a number. Press any key to continue..."); count = 0; System.Console.ReadKey(); - continue; } break; @@ -479,7 +477,6 @@ namespace DiscImageChef.Tests.Devices.ATA DicConsole.WriteLine("Not a number. Press any key to continue..."); count = 0; System.Console.ReadKey(); - continue; } break; @@ -611,7 +608,6 @@ namespace DiscImageChef.Tests.Devices.ATA DicConsole.WriteLine("Not a number. Press any key to continue..."); count = 0; System.Console.ReadKey(); - continue; } break; @@ -796,7 +792,6 @@ namespace DiscImageChef.Tests.Devices.ATA DicConsole.WriteLine("Not a number. Press any key to continue..."); count = 0; System.Console.ReadKey(); - continue; } break; diff --git a/DiscImageChef.Tests.Devices/ATA/AtaCHS.cs b/DiscImageChef.Tests.Devices/ATA/AtaCHS.cs index 3d6874a03..934dd803d 100644 --- a/DiscImageChef.Tests.Devices/ATA/AtaCHS.cs +++ b/DiscImageChef.Tests.Devices/ATA/AtaCHS.cs @@ -258,7 +258,6 @@ namespace DiscImageChef.Tests.Devices.ATA DicConsole.WriteLine("Not a number. Press any key to continue..."); count = 0; System.Console.ReadKey(); - continue; } break; @@ -412,7 +411,6 @@ namespace DiscImageChef.Tests.Devices.ATA DicConsole.WriteLine("Not a number. Press any key to continue..."); blockSize = 0; System.Console.ReadKey(); - continue; } break; @@ -566,7 +564,6 @@ namespace DiscImageChef.Tests.Devices.ATA DicConsole.WriteLine("Not a number. Press any key to continue..."); count = 0; System.Console.ReadKey(); - continue; } break; @@ -720,7 +717,6 @@ namespace DiscImageChef.Tests.Devices.ATA DicConsole.WriteLine("Not a number. Press any key to continue..."); count = 0; System.Console.ReadKey(); - continue; } break; @@ -862,7 +858,6 @@ namespace DiscImageChef.Tests.Devices.ATA DicConsole.WriteLine("Not a number. Press any key to continue..."); sector = 0; System.Console.ReadKey(); - continue; } break; diff --git a/DiscImageChef.Tests.Devices/ATA/Cfa.cs b/DiscImageChef.Tests.Devices/ATA/Cfa.cs index 100f15a51..62b530eea 100644 --- a/DiscImageChef.Tests.Devices/ATA/Cfa.cs +++ b/DiscImageChef.Tests.Devices/ATA/Cfa.cs @@ -199,7 +199,6 @@ namespace DiscImageChef.Tests.Devices.ATA DicConsole.WriteLine("Not a number. Press any key to continue..."); sector = 0; System.Console.ReadKey(); - continue; } break; diff --git a/DiscImageChef.Tests.Devices/ATA/MCPT.cs b/DiscImageChef.Tests.Devices/ATA/MCPT.cs index 73c17e541..80e8b3785 100644 --- a/DiscImageChef.Tests.Devices/ATA/MCPT.cs +++ b/DiscImageChef.Tests.Devices/ATA/MCPT.cs @@ -109,7 +109,6 @@ namespace DiscImageChef.Tests.Devices.ATA DicConsole.WriteLine("Not a number. Press any key to continue..."); feature = 0; System.Console.ReadKey(); - continue; } break; diff --git a/DiscImageChef.Tests.Devices/ATA/Smart.cs b/DiscImageChef.Tests.Devices/ATA/Smart.cs index 8decf78d9..ee2b01571 100644 --- a/DiscImageChef.Tests.Devices/ATA/Smart.cs +++ b/DiscImageChef.Tests.Devices/ATA/Smart.cs @@ -309,7 +309,6 @@ namespace DiscImageChef.Tests.Devices.ATA DicConsole.WriteLine("Not a number. Press any key to continue..."); subcommand = 0; System.Console.ReadKey(); - continue; } break; @@ -467,7 +466,6 @@ namespace DiscImageChef.Tests.Devices.ATA DicConsole.WriteLine("Not a number. Press any key to continue..."); address = 0; System.Console.ReadKey(); - continue; } break; diff --git a/DiscImageChef.Tests.Devices/DecodeATARegisters.cs b/DiscImageChef.Tests.Devices/DecodeATARegisters.cs index 31a3cb9e1..7ab65db01 100644 --- a/DiscImageChef.Tests.Devices/DecodeATARegisters.cs +++ b/DiscImageChef.Tests.Devices/DecodeATARegisters.cs @@ -105,7 +105,7 @@ namespace DiscImageChef.Tests.Devices sb.AppendFormat("Error: {0}", DecodeATAStatus(registers.error)).AppendLine(); sb.AppendFormat("Device: {0}", (registers.deviceHead >> 4) & 0x01).AppendLine(); sb.AppendFormat("LBA: {0}", - (ulong)(registers.deviceHead & 0xF) * (ulong)0x100000000000 + + (ulong)(registers.deviceHead & 0xF) * 0x100000000000 + registers.lbaHigh * (ulong)0x100000000L + (ulong)(registers.lbaMid << 16) + registers.lbaLow); sb.AppendFormat("Count: {0}", registers.sectorCount).AppendLine(); diff --git a/DiscImageChef.Tests.Devices/Device.cs b/DiscImageChef.Tests.Devices/Device.cs index 425a919d6..34a468606 100644 --- a/DiscImageChef.Tests.Devices/Device.cs +++ b/DiscImageChef.Tests.Devices/Device.cs @@ -27,6 +27,7 @@ // ****************************************************************************/ using DiscImageChef.Console; +using DiscImageChef.Devices; namespace DiscImageChef.Tests.Devices { @@ -37,7 +38,7 @@ namespace DiscImageChef.Tests.Devices DicConsole.WriteLine("Going to open {0}. Press any key to continue...", devPath); System.Console.ReadKey(); - DiscImageChef.Devices.Device dev = new DiscImageChef.Devices.Device(devPath); + Device dev = new Device(devPath); while(true) { diff --git a/DiscImageChef.Tests.Devices/SCSI/Adaptec.cs b/DiscImageChef.Tests.Devices/SCSI/Adaptec.cs index b2f271502..4703cf90b 100644 --- a/DiscImageChef.Tests.Devices/SCSI/Adaptec.cs +++ b/DiscImageChef.Tests.Devices/SCSI/Adaptec.cs @@ -27,6 +27,7 @@ // ****************************************************************************/ using DiscImageChef.Console; +using DiscImageChef.Decoders.SCSI; using DiscImageChef.Devices; namespace DiscImageChef.Tests.Devices.SCSI @@ -120,7 +121,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a boolean. Press any key to continue..."); drive1 = false; System.Console.ReadKey(); - continue; } break; @@ -191,7 +191,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ/RESET USAGE COUNTER decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -271,7 +271,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ DATA BUFFER decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -338,7 +338,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); threshold = 0; System.Console.ReadKey(); - continue; } break; @@ -361,7 +360,7 @@ namespace DiscImageChef.Tests.Devices.SCSI senseBuffer == null ? "null" : senseBuffer.Length.ToString()); DicConsole.WriteLine("Sense buffer is null or empty? {0}", ArrayHelpers.ArrayIsNullOrEmpty(senseBuffer)); DicConsole.WriteLine("SET ERROR THRESHOLD decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine(); DicConsole.WriteLine("Choose what to do:"); DicConsole.WriteLine("1.- Print sense buffer."); @@ -456,7 +455,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); lba = 0; System.Console.ReadKey(); - continue; } break; @@ -527,7 +525,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("TRANSLATE decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); diff --git a/DiscImageChef.Tests.Devices/SCSI/ArchiveCorp.cs b/DiscImageChef.Tests.Devices/SCSI/ArchiveCorp.cs index 9638099f5..904607f7e 100644 --- a/DiscImageChef.Tests.Devices/SCSI/ArchiveCorp.cs +++ b/DiscImageChef.Tests.Devices/SCSI/ArchiveCorp.cs @@ -27,6 +27,7 @@ // ****************************************************************************/ using DiscImageChef.Console; +using DiscImageChef.Decoders.SCSI; using DiscImageChef.Devices; namespace DiscImageChef.Tests.Devices.SCSI @@ -112,7 +113,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); lba = 0; System.Console.ReadKey(); - continue; } break; @@ -183,7 +183,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("REQUEST BLOCK ADDRESS decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -251,7 +251,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); lba = 0; System.Console.ReadKey(); - continue; } break; @@ -273,7 +272,7 @@ namespace DiscImageChef.Tests.Devices.SCSI senseBuffer == null ? "null" : senseBuffer.Length.ToString()); DicConsole.WriteLine("Sense buffer is null or empty? {0}", ArrayHelpers.ArrayIsNullOrEmpty(senseBuffer)); DicConsole.WriteLine("SEEK BLOCK decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine(); DicConsole.WriteLine("Choose what to do:"); DicConsole.WriteLine("1.- Print sense buffer."); diff --git a/DiscImageChef.Tests.Devices/SCSI/Certance.cs b/DiscImageChef.Tests.Devices/SCSI/Certance.cs index c26e1207e..edde6e191 100644 --- a/DiscImageChef.Tests.Devices/SCSI/Certance.cs +++ b/DiscImageChef.Tests.Devices/SCSI/Certance.cs @@ -27,6 +27,7 @@ // ****************************************************************************/ using DiscImageChef.Console; +using DiscImageChef.Decoders.SCSI; using DiscImageChef.Devices; namespace DiscImageChef.Tests.Devices.SCSI @@ -87,7 +88,7 @@ namespace DiscImageChef.Tests.Devices.SCSI senseBuffer == null ? "null" : senseBuffer.Length.ToString()); DicConsole.WriteLine("Sense buffer is null or empty? {0}", ArrayHelpers.ArrayIsNullOrEmpty(senseBuffer)); DicConsole.WriteLine("PARK decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine(); DicConsole.WriteLine("Choose what to do:"); DicConsole.WriteLine("1.- Print sense buffer."); @@ -143,7 +144,7 @@ namespace DiscImageChef.Tests.Devices.SCSI senseBuffer == null ? "null" : senseBuffer.Length.ToString()); DicConsole.WriteLine("Sense buffer is null or empty? {0}", ArrayHelpers.ArrayIsNullOrEmpty(senseBuffer)); DicConsole.WriteLine("UNPARK decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine(); DicConsole.WriteLine("Choose what to do:"); DicConsole.WriteLine("1.- Print sense buffer."); diff --git a/DiscImageChef.Tests.Devices/SCSI/Fujitsu.cs b/DiscImageChef.Tests.Devices/SCSI/Fujitsu.cs index c6ffaeb41..a809bad3c 100644 --- a/DiscImageChef.Tests.Devices/SCSI/Fujitsu.cs +++ b/DiscImageChef.Tests.Devices/SCSI/Fujitsu.cs @@ -26,7 +26,9 @@ // Copyright © 2011-2018 Natalia Portillo // ****************************************************************************/ +using System; using DiscImageChef.Console; +using DiscImageChef.Decoders.SCSI; using DiscImageChef.Devices; namespace DiscImageChef.Tests.Devices.SCSI @@ -120,7 +122,7 @@ namespace DiscImageChef.Tests.Devices.SCSI FujitsuDisplayModes.Idle, FujitsuDisplayModes.Ready); DicConsole.Write("Choose?: "); strDev = System.Console.ReadLine(); - if(!System.Enum.TryParse(strDev, true, out mode)) + if(!Enum.TryParse(strDev, true, out mode)) { DicConsole.WriteLine("Not a correct display mode. Press any key to continue..."); mode = FujitsuDisplayModes.Ready; @@ -151,7 +153,7 @@ namespace DiscImageChef.Tests.Devices.SCSI senseBuffer == null ? "null" : senseBuffer.Length.ToString()); DicConsole.WriteLine("Sense buffer is null or empty? {0}", ArrayHelpers.ArrayIsNullOrEmpty(senseBuffer)); DicConsole.WriteLine("DISPLAY decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine(); DicConsole.WriteLine("Choose what to do:"); DicConsole.WriteLine("1.- Print sense buffer."); diff --git a/DiscImageChef.Tests.Devices/SCSI/HL-DT-ST.cs b/DiscImageChef.Tests.Devices/SCSI/HL-DT-ST.cs index 65f2dc63d..ed076d2f4 100644 --- a/DiscImageChef.Tests.Devices/SCSI/HL-DT-ST.cs +++ b/DiscImageChef.Tests.Devices/SCSI/HL-DT-ST.cs @@ -27,6 +27,7 @@ // ****************************************************************************/ using DiscImageChef.Console; +using DiscImageChef.Decoders.SCSI; using DiscImageChef.Devices; namespace DiscImageChef.Tests.Devices.SCSI @@ -120,7 +121,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); lba = 0; System.Console.ReadKey(); - continue; } break; @@ -191,7 +191,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ DVD (RAW) decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); diff --git a/DiscImageChef.Tests.Devices/SCSI/HP.cs b/DiscImageChef.Tests.Devices/SCSI/HP.cs index 0c6e9d726..7a31d3501 100644 --- a/DiscImageChef.Tests.Devices/SCSI/HP.cs +++ b/DiscImageChef.Tests.Devices/SCSI/HP.cs @@ -27,6 +27,7 @@ // ****************************************************************************/ using DiscImageChef.Console; +using DiscImageChef.Decoders.SCSI; using DiscImageChef.Devices; namespace DiscImageChef.Tests.Devices.SCSI @@ -168,7 +169,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a numbr. Press any key to continue..."); bps = 512; System.Console.ReadKey(); - continue; } } @@ -240,7 +240,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ LONG decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); diff --git a/DiscImageChef.Tests.Devices/SCSI/Kreon.cs b/DiscImageChef.Tests.Devices/SCSI/Kreon.cs index 4c09e6e29..e5caaf8e4 100644 --- a/DiscImageChef.Tests.Devices/SCSI/Kreon.cs +++ b/DiscImageChef.Tests.Devices/SCSI/Kreon.cs @@ -26,7 +26,9 @@ // Copyright © 2011-2018 Natalia Portillo // ****************************************************************************/ +using System; using DiscImageChef.Console; +using DiscImageChef.Decoders.SCSI; using DiscImageChef.Devices; namespace DiscImageChef.Tests.Devices.SCSI @@ -120,7 +122,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); requestNumber = 0; System.Console.ReadKey(); - continue; } break; @@ -191,7 +192,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("EXTRACT SS decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -224,7 +225,7 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Sense buffer is null or empty? {0}", ArrayHelpers.ArrayIsNullOrEmpty(senseBuffer)); DicConsole.WriteLine("Features: {0}.", features); DicConsole.WriteLine("GET FEATURE LIST decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine(); DicConsole.WriteLine("Choose what to do:"); DicConsole.WriteLine("1.- Print sense buffer."); @@ -303,12 +304,11 @@ namespace DiscImageChef.Tests.Devices.SCSI KreonLockStates.Wxripper, KreonLockStates.Xtreme); DicConsole.Write("Choose?: "); strDev = System.Console.ReadLine(); - if(!System.Enum.TryParse(strDev, true, out state)) + if(!Enum.TryParse(strDev, true, out state)) { DicConsole.WriteLine("Not a correct page control. Press any key to continue..."); state = KreonLockStates.Locked; System.Console.ReadKey(); - continue; } break; @@ -326,7 +326,7 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Command took {0} ms.", duration); DicConsole.WriteLine("Sense is {0}.", sense); DicConsole.WriteLine("SET LOCK STATE decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine(); DicConsole.WriteLine("Choose what to do:"); DicConsole.WriteLine("1.- Send command again."); @@ -373,7 +373,7 @@ namespace DiscImageChef.Tests.Devices.SCSI senseBuffer == null ? "null" : senseBuffer.Length.ToString()); DicConsole.WriteLine("Sense buffer is null or empty? {0}", ArrayHelpers.ArrayIsNullOrEmpty(senseBuffer)); DicConsole.WriteLine("UNLOCK decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine(); DicConsole.WriteLine("Choose what to do:"); DicConsole.WriteLine("1.- Print sense buffer."); diff --git a/DiscImageChef.Tests.Devices/SCSI/MMC.cs b/DiscImageChef.Tests.Devices/SCSI/MMC.cs index e2e2953f8..bc8816143 100644 --- a/DiscImageChef.Tests.Devices/SCSI/MMC.cs +++ b/DiscImageChef.Tests.Devices/SCSI/MMC.cs @@ -26,7 +26,11 @@ // Copyright © 2011-2018 Natalia Portillo // ****************************************************************************/ +using System; using DiscImageChef.Console; +using DiscImageChef.Decoders.CD; +using DiscImageChef.Decoders.SCSI; +using DiscImageChef.Decoders.SCSI.MMC; using DiscImageChef.Devices; namespace DiscImageChef.Tests.Devices.SCSI @@ -137,7 +141,7 @@ namespace DiscImageChef.Tests.Devices.SCSI MmcGetConfigurationRt.Single); DicConsole.Write("Choose?: "); strDev = System.Console.ReadLine(); - if(!System.Enum.TryParse(strDev, true, out rt)) + if(!Enum.TryParse(strDev, true, out rt)) { DicConsole.WriteLine("Not a correct object type. Press any key to continue..."); rt = MmcGetConfigurationRt.All; @@ -152,7 +156,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); startingFeatureNumber = 1; System.Console.ReadKey(); - continue; } break; @@ -216,246 +219,246 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("GET CONFIGURATION decoded buffer:"); if(buffer != null) { - Decoders.SCSI.MMC.Features.SeparatedFeatures ftr = Decoders.SCSI.MMC.Features.Separate(buffer); + Features.SeparatedFeatures ftr = Features.Separate(buffer); DicConsole.WriteLine("GET CONFIGURATION length is {0} bytes", ftr.DataLength); DicConsole.WriteLine("GET CONFIGURATION current profile is {0:X4}h", ftr.CurrentProfile); if(ftr.Descriptors != null) - foreach(Decoders.SCSI.MMC.Features.FeatureDescriptor desc in ftr.Descriptors) + foreach(Features.FeatureDescriptor desc in ftr.Descriptors) { DicConsole.WriteLine("Feature {0:X4}h", desc.Code); switch(desc.Code) { case 0x0000: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0000(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0000(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0001: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0001(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0001(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0002: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0002(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0002(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0003: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0003(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0003(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0004: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0004(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0004(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0010: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0010(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0010(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x001D: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_001D(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_001D(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x001E: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_001E(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_001E(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x001F: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_001F(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_001F(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0020: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0020(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0020(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0021: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0021(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0021(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0022: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0022(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0022(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0023: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0023(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0023(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0024: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0024(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0024(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0025: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0025(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0025(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0026: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0026(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0026(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0027: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0027(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0027(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0028: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0028(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0028(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0029: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0029(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0029(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x002A: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_002A(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_002A(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x002B: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_002B(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_002B(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x002C: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_002C(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_002C(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x002D: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_002D(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_002D(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x002E: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_002E(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_002E(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x002F: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_002F(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_002F(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0030: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0030(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0030(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0031: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0031(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0031(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0032: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0032(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0032(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0033: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0033(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0033(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0035: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0035(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0035(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0037: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0037(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0037(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0038: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0038(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0038(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x003A: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_003A(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_003A(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x003B: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_003B(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_003B(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0040: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0040(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0040(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0041: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0041(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0041(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0042: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0042(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0042(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0050: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0050(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0050(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0051: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0051(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0051(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0080: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0080(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0080(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0100: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0100(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0100(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0101: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0101(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0101(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0102: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0102(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0102(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0103: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0103(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0103(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0104: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0104(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0104(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0105: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0105(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0105(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0106: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0106(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0106(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0107: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0107(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0107(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0108: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0108(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0108(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0109: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0109(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0109(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x010A: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_010A(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_010A(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x010B: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_010B(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_010B(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x010C: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_010C(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_010C(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x010D: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_010D(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_010D(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x010E: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_010E(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_010E(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0110: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0110(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0110(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0113: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0113(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0113(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; case 0x0142: - DicConsole.Write("{0}", Decoders.SCSI.MMC.Features.Prettify_0142(desc.Data)); + DicConsole.Write("{0}", Features.Prettify_0142(desc.Data)); PrintHex.PrintHexArray(desc.Data, 64); break; default: @@ -485,7 +488,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("GET CONFIGURATION decoded sense:"); - if(senseBuffer != null) DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + if(senseBuffer != null) DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -553,7 +556,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a boolean. Press any key to continue..."); persistent = false; System.Console.ReadKey(); - continue; } break; @@ -575,7 +577,7 @@ namespace DiscImageChef.Tests.Devices.SCSI senseBuffer == null ? "null" : senseBuffer.Length.ToString()); DicConsole.WriteLine("Sense buffer is null or empty? {0}", ArrayHelpers.ArrayIsNullOrEmpty(senseBuffer)); DicConsole.WriteLine("PREVENT ALLOW MEDIUM REMOVAL decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine(); DicConsole.WriteLine("Choose what to do:"); DicConsole.WriteLine("1.- Print sense buffer."); @@ -709,7 +711,7 @@ namespace DiscImageChef.Tests.Devices.SCSI MmcSectorTypes.Mode2Form1, MmcSectorTypes.Mode2Form2); DicConsole.Write("Choose?: "); strDev = System.Console.ReadLine(); - if(!System.Enum.TryParse(strDev, true, out sectorType)) + if(!Enum.TryParse(strDev, true, out sectorType)) { DicConsole.WriteLine("Not a correct page control. Press any key to continue..."); sectorType = MmcSectorTypes.AllTypes; @@ -743,7 +745,7 @@ namespace DiscImageChef.Tests.Devices.SCSI MmcHeaderCodes.AllHeaders); DicConsole.Write("Choose?: "); strDev = System.Console.ReadLine(); - if(!System.Enum.TryParse(strDev, true, out header)) + if(!Enum.TryParse(strDev, true, out header)) { DicConsole.WriteLine("Not a correct page control. Press any key to continue..."); header = MmcHeaderCodes.None; @@ -776,7 +778,7 @@ namespace DiscImageChef.Tests.Devices.SCSI MmcErrorField.C2Pointers, MmcErrorField.C2PointersAndBlock); DicConsole.Write("Choose?: "); strDev = System.Console.ReadLine(); - if(!System.Enum.TryParse(strDev, true, out c2)) + if(!Enum.TryParse(strDev, true, out c2)) { DicConsole.WriteLine("Not a correct page control. Press any key to continue..."); c2 = MmcErrorField.None; @@ -789,7 +791,7 @@ namespace DiscImageChef.Tests.Devices.SCSI MmcSubchannel.Q16, MmcSubchannel.Rw); DicConsole.Write("Choose?: "); strDev = System.Console.ReadLine(); - if(!System.Enum.TryParse(strDev, true, out subchan)) + if(!Enum.TryParse(strDev, true, out subchan)) { DicConsole.WriteLine("Not a correct page control. Press any key to continue..."); subchan = MmcSubchannel.None; @@ -804,7 +806,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); blockSize = 2352; System.Console.ReadKey(); - continue; } break; @@ -876,7 +877,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ CD decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -1015,7 +1016,7 @@ namespace DiscImageChef.Tests.Devices.SCSI MmcSectorTypes.Mode2Form1, MmcSectorTypes.Mode2Form2); DicConsole.Write("Choose?: "); strDev = System.Console.ReadLine(); - if(!System.Enum.TryParse(strDev, true, out sectorType)) + if(!Enum.TryParse(strDev, true, out sectorType)) { DicConsole.WriteLine("Not a correct page control. Press any key to continue..."); sectorType = MmcSectorTypes.AllTypes; @@ -1049,7 +1050,7 @@ namespace DiscImageChef.Tests.Devices.SCSI MmcHeaderCodes.AllHeaders); DicConsole.Write("Choose?: "); strDev = System.Console.ReadLine(); - if(!System.Enum.TryParse(strDev, true, out header)) + if(!Enum.TryParse(strDev, true, out header)) { DicConsole.WriteLine("Not a correct page control. Press any key to continue..."); header = MmcHeaderCodes.None; @@ -1082,7 +1083,7 @@ namespace DiscImageChef.Tests.Devices.SCSI MmcErrorField.C2Pointers, MmcErrorField.C2PointersAndBlock); DicConsole.Write("Choose?: "); strDev = System.Console.ReadLine(); - if(!System.Enum.TryParse(strDev, true, out c2)) + if(!Enum.TryParse(strDev, true, out c2)) { DicConsole.WriteLine("Not a correct page control. Press any key to continue..."); c2 = MmcErrorField.None; @@ -1095,7 +1096,7 @@ namespace DiscImageChef.Tests.Devices.SCSI MmcSubchannel.Q16, MmcSubchannel.Rw); DicConsole.Write("Choose?: "); strDev = System.Console.ReadLine(); - if(!System.Enum.TryParse(strDev, true, out subchan)) + if(!Enum.TryParse(strDev, true, out subchan)) { DicConsole.WriteLine("Not a correct page control. Press any key to continue..."); subchan = MmcSubchannel.None; @@ -1110,7 +1111,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); blockSize = 2352; System.Console.ReadKey(); - continue; } break; @@ -1184,7 +1184,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ CD MSF decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -1240,12 +1240,11 @@ namespace DiscImageChef.Tests.Devices.SCSI MmcDiscInformationDataTypes.PowResources); DicConsole.Write("Choose?: "); strDev = System.Console.ReadLine(); - if(!System.Enum.TryParse(strDev, true, out info)) + if(!Enum.TryParse(strDev, true, out info)) { DicConsole.WriteLine("Not a correct page control. Press any key to continue..."); info = MmcDiscInformationDataTypes.DiscInformation; System.Console.ReadKey(); - continue; } break; @@ -1307,7 +1306,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ DISC INFORMATION decoded response:"); - DicConsole.Write("{0}", Decoders.SCSI.MMC.DiscInformation.Prettify(buffer)); + DicConsole.Write("{0}", DiscInformation.Prettify(buffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -1327,7 +1326,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ DISC INFORMATION decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -1389,7 +1388,7 @@ namespace DiscImageChef.Tests.Devices.SCSI MmcDiscStructureMediaType.Bd); DicConsole.Write("Choose?: "); strDev = System.Console.ReadLine(); - if(!System.Enum.TryParse(strDev, true, out mediaType)) + if(!Enum.TryParse(strDev, true, out mediaType)) { DicConsole.WriteLine("Not a correct media type. Press any key to continue..."); mediaType = MmcDiscStructureMediaType.Dvd; @@ -1449,7 +1448,7 @@ namespace DiscImageChef.Tests.Devices.SCSI MmcDiscStructureFormat.CapabilityList); DicConsole.Write("Choose?: "); strDev = System.Console.ReadLine(); - if(!System.Enum.TryParse(strDev, true, out format)) + if(!Enum.TryParse(strDev, true, out format)) { DicConsole.WriteLine("Not a correct media type. Press any key to continue..."); format = MmcDiscStructureFormat.CapabilityList; @@ -1484,7 +1483,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); agid = 0; System.Console.ReadKey(); - continue; } break; @@ -1566,7 +1564,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ DISC STRUCTURE decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -1646,7 +1644,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); session = 0; System.Console.ReadKey(); - continue; } break; @@ -1712,27 +1709,27 @@ namespace DiscImageChef.Tests.Devices.SCSI switch(format) { case 0: - DicConsole.Write("{0}", Decoders.CD.TOC.Prettify(buffer)); + DicConsole.Write("{0}", TOC.Prettify(buffer)); PrintHex.PrintHexArray(buffer, 64); break; case 1: - DicConsole.Write("{0}", Decoders.CD.Session.Prettify(buffer)); + DicConsole.Write("{0}", Session.Prettify(buffer)); PrintHex.PrintHexArray(buffer, 64); break; case 2: - DicConsole.Write("{0}", Decoders.CD.FullTOC.Prettify(buffer)); + DicConsole.Write("{0}", FullTOC.Prettify(buffer)); PrintHex.PrintHexArray(buffer, 64); break; case 3: - DicConsole.Write("{0}", Decoders.CD.PMA.Prettify(buffer)); + DicConsole.Write("{0}", PMA.Prettify(buffer)); PrintHex.PrintHexArray(buffer, 64); break; case 4: - DicConsole.Write("{0}", Decoders.CD.ATIP.Prettify(buffer)); + DicConsole.Write("{0}", ATIP.Prettify(buffer)); PrintHex.PrintHexArray(buffer, 64); break; case 5: - DicConsole.Write("{0}", Decoders.CD.CDTextOnLeadIn.Prettify(buffer)); + DicConsole.Write("{0}", CDTextOnLeadIn.Prettify(buffer)); PrintHex.PrintHexArray(buffer, 64); break; } @@ -1756,7 +1753,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ TOC/PMA/ATIP decoded sense:"); - if(senseBuffer != null) DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + if(senseBuffer != null) DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -1872,7 +1869,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); powerConditions = 0; System.Console.ReadKey(); - continue; } break; @@ -1894,7 +1890,7 @@ namespace DiscImageChef.Tests.Devices.SCSI senseBuffer == null ? "null" : senseBuffer.Length.ToString()); DicConsole.WriteLine("Sense buffer is null or empty? {0}", ArrayHelpers.ArrayIsNullOrEmpty(senseBuffer)); DicConsole.WriteLine("START STOP UNIT decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine(); DicConsole.WriteLine("Choose what to do:"); DicConsole.WriteLine("1.- Print sense buffer."); diff --git a/DiscImageChef.Tests.Devices/SCSI/NEC.cs b/DiscImageChef.Tests.Devices/SCSI/NEC.cs index 7e80d96f7..3a299447a 100644 --- a/DiscImageChef.Tests.Devices/SCSI/NEC.cs +++ b/DiscImageChef.Tests.Devices/SCSI/NEC.cs @@ -27,6 +27,7 @@ // ****************************************************************************/ using DiscImageChef.Console; +using DiscImageChef.Decoders.SCSI; using DiscImageChef.Devices; namespace DiscImageChef.Tests.Devices.SCSI @@ -120,7 +121,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); length = 1; System.Console.ReadKey(); - continue; } break; @@ -191,7 +191,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ CD-DA decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); diff --git a/DiscImageChef.Tests.Devices/SCSI/Pioneer.cs b/DiscImageChef.Tests.Devices/SCSI/Pioneer.cs index 78ce252bf..07b96f59c 100644 --- a/DiscImageChef.Tests.Devices/SCSI/Pioneer.cs +++ b/DiscImageChef.Tests.Devices/SCSI/Pioneer.cs @@ -26,7 +26,9 @@ // Copyright © 2011-2018 Natalia Portillo // ****************************************************************************/ +using System; using DiscImageChef.Console; +using DiscImageChef.Decoders.SCSI; using DiscImageChef.Devices; namespace DiscImageChef.Tests.Devices.SCSI @@ -140,7 +142,7 @@ namespace DiscImageChef.Tests.Devices.SCSI PioneerSubchannel.Q16, PioneerSubchannel.All, PioneerSubchannel.Only); DicConsole.Write("Choose?: "); strDev = System.Console.ReadLine(); - if(!System.Enum.TryParse(strDev, true, out subchan)) + if(!Enum.TryParse(strDev, true, out subchan)) { DicConsole.WriteLine("Not a correct page control. Press any key to continue..."); subchan = PioneerSubchannel.None; @@ -232,7 +234,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ CD-DA decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -356,7 +358,7 @@ namespace DiscImageChef.Tests.Devices.SCSI PioneerSubchannel.Q16, PioneerSubchannel.All, PioneerSubchannel.Only); DicConsole.Write("Choose?: "); strDev = System.Console.ReadLine(); - if(!System.Enum.TryParse(strDev, true, out subchan)) + if(!Enum.TryParse(strDev, true, out subchan)) { DicConsole.WriteLine("Not a correct page control. Press any key to continue..."); subchan = PioneerSubchannel.None; @@ -450,7 +452,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ CD-DA MSF decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -542,7 +544,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); wholeSector = false; System.Console.ReadKey(); - continue; } break; @@ -613,7 +614,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ CD-XA decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); diff --git a/DiscImageChef.Tests.Devices/SCSI/Plasmon.cs b/DiscImageChef.Tests.Devices/SCSI/Plasmon.cs index d880154eb..df1ec7349 100644 --- a/DiscImageChef.Tests.Devices/SCSI/Plasmon.cs +++ b/DiscImageChef.Tests.Devices/SCSI/Plasmon.cs @@ -27,6 +27,7 @@ // ****************************************************************************/ using DiscImageChef.Console; +using DiscImageChef.Decoders.SCSI; using DiscImageChef.Devices; namespace DiscImageChef.Tests.Devices.SCSI @@ -172,7 +173,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a numbr. Press any key to continue..."); bps = 512; System.Console.ReadKey(); - continue; } } @@ -244,7 +244,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ LONG decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -311,7 +311,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a numbr. Press any key to continue..."); address = 0; System.Console.ReadKey(); - continue; } break; @@ -382,7 +381,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ SECTOR LOCATION decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); diff --git a/DiscImageChef.Tests.Devices/SCSI/Plextor.cs b/DiscImageChef.Tests.Devices/SCSI/Plextor.cs index eeaa0577a..3b487e8b8 100644 --- a/DiscImageChef.Tests.Devices/SCSI/Plextor.cs +++ b/DiscImageChef.Tests.Devices/SCSI/Plextor.cs @@ -26,7 +26,9 @@ // Copyright © 2011-2018 Natalia Portillo // ****************************************************************************/ +using System; using DiscImageChef.Console; +using DiscImageChef.Decoders.SCSI; using DiscImageChef.Devices; namespace DiscImageChef.Tests.Devices.SCSI @@ -160,7 +162,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a boolean. Press any key to continue..."); dl = false; System.Console.ReadKey(); - continue; } break; @@ -231,7 +232,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("GET BOOK BITSETTING decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -311,7 +312,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("GET GIGAREC decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -390,7 +391,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("GET SECUREC decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -469,7 +470,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("GET SILENT MODE decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -548,7 +549,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("GET SINGLE-SESSION / HIDE CD-R decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -627,7 +628,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("GET SPEEDREAD decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -707,7 +708,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("GET TEST WRITE DVD+ decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -762,7 +763,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a boolean. Press any key to continue..."); dvd = false; System.Console.ReadKey(); - continue; } break; @@ -833,7 +833,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("GET VARIREC decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -867,7 +867,7 @@ namespace DiscImageChef.Tests.Devices.SCSI senseBuffer == null ? "null" : senseBuffer.Length.ToString()); DicConsole.WriteLine("Sense buffer is null or empty? {0}", ArrayHelpers.ArrayIsNullOrEmpty(senseBuffer)); DicConsole.WriteLine("POWEREC GET SPEEDS decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine(); DicConsole.WriteLine("Choose what to do:"); DicConsole.WriteLine("1.- Print sense buffer."); @@ -973,7 +973,7 @@ namespace DiscImageChef.Tests.Devices.SCSI PlextorSubchannel.RawC2); DicConsole.Write("Choose?: "); strDev = System.Console.ReadLine(); - if(!System.Enum.TryParse(strDev, true, out subchan)) + if(!Enum.TryParse(strDev, true, out subchan)) { DicConsole.WriteLine("Not a correct subchannel mode. Press any key to continue..."); subchan = PlextorSubchannel.None; @@ -1066,7 +1066,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ CD-DA decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -1134,7 +1134,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); lba = 0; System.Console.ReadKey(); - continue; } break; @@ -1205,7 +1204,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ DVD (RAW) decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -1285,7 +1284,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ EEPROM decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -1352,7 +1351,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); blockSize = 0; System.Console.ReadKey(); - continue; } break; @@ -1423,7 +1421,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ EEPROM decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -1503,7 +1501,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ EEPROM decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); diff --git a/DiscImageChef.Tests.Devices/SCSI/SBC.cs b/DiscImageChef.Tests.Devices/SCSI/SBC.cs index 2e73bd07a..703ffd6b3 100644 --- a/DiscImageChef.Tests.Devices/SCSI/SBC.cs +++ b/DiscImageChef.Tests.Devices/SCSI/SBC.cs @@ -27,6 +27,7 @@ // ****************************************************************************/ using DiscImageChef.Console; +using DiscImageChef.Decoders.SCSI; using DiscImageChef.Devices; namespace DiscImageChef.Tests.Devices.SCSI @@ -165,7 +166,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); blockSize = 512; System.Console.ReadKey(); - continue; } break; @@ -236,7 +236,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ (6) decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -388,7 +388,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); count = 1; System.Console.ReadKey(); - continue; } break; @@ -459,7 +458,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ (10) decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -623,7 +622,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a boolean. Press any key to continue..."); lba = 0; System.Console.ReadKey(); - continue; } break; @@ -694,7 +692,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ (12) decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -846,7 +844,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a boolean. Press any key to continue..."); lba = 0; System.Console.ReadKey(); - continue; } break; @@ -917,7 +914,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ (16) decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -1009,7 +1006,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a boolean. Press any key to continue..."); lba = 0; System.Console.ReadKey(); - continue; } break; @@ -1080,7 +1076,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ LONG (10) decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -1160,7 +1156,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a boolean. Press any key to continue..."); lba = 0; System.Console.ReadKey(); - continue; } break; @@ -1231,7 +1226,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ LONG (16) decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -1313,7 +1308,7 @@ namespace DiscImageChef.Tests.Devices.SCSI senseBuffer == null ? "null" : senseBuffer.Length.ToString()); DicConsole.WriteLine("Sense buffer is null or empty? {0}", ArrayHelpers.ArrayIsNullOrEmpty(senseBuffer)); DicConsole.WriteLine("SEEK (6) decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine(); DicConsole.WriteLine("Choose what to do:"); DicConsole.WriteLine("1.- Print sense buffer."); @@ -1396,7 +1391,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); lba = 0; System.Console.ReadKey(); - continue; } break; @@ -1417,7 +1411,7 @@ namespace DiscImageChef.Tests.Devices.SCSI senseBuffer == null ? "null" : senseBuffer.Length.ToString()); DicConsole.WriteLine("Sense buffer is null or empty? {0}", ArrayHelpers.ArrayIsNullOrEmpty(senseBuffer)); DicConsole.WriteLine("SEEK (6) decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine(); DicConsole.WriteLine("Choose what to do:"); DicConsole.WriteLine("1.- Print sense buffer."); diff --git a/DiscImageChef.Tests.Devices/SCSI/SMC.cs b/DiscImageChef.Tests.Devices/SCSI/SMC.cs index e485b4164..f6891409b 100644 --- a/DiscImageChef.Tests.Devices/SCSI/SMC.cs +++ b/DiscImageChef.Tests.Devices/SCSI/SMC.cs @@ -26,7 +26,9 @@ // Copyright © 2011-2018 Natalia Portillo // ****************************************************************************/ +using System; using DiscImageChef.Console; +using DiscImageChef.Decoders.SCSI; using DiscImageChef.Devices; namespace DiscImageChef.Tests.Devices.SCSI @@ -120,7 +122,7 @@ namespace DiscImageChef.Tests.Devices.SCSI ScsiAttributeAction.Supported); DicConsole.Write("Choose?: "); strDev = System.Console.ReadLine(); - if(!System.Enum.TryParse(strDev, true, out action)) + if(!Enum.TryParse(strDev, true, out action)) { DicConsole.WriteLine("Not a valid attribute action. Press any key to continue..."); action = ScsiAttributeAction.Values; @@ -185,7 +187,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a boolean. Press any key to continue..."); cache = false; System.Console.ReadKey(); - continue; } break; @@ -256,7 +257,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ ATTRIBUTE decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); diff --git a/DiscImageChef.Tests.Devices/SCSI/SPC.cs b/DiscImageChef.Tests.Devices/SCSI/SPC.cs index f3dc90f0e..b16ac3509 100644 --- a/DiscImageChef.Tests.Devices/SCSI/SPC.cs +++ b/DiscImageChef.Tests.Devices/SCSI/SPC.cs @@ -28,6 +28,7 @@ using System; using DiscImageChef.Console; +using DiscImageChef.Decoders.SCSI; using DiscImageChef.Devices; namespace DiscImageChef.Tests.Devices.SCSI @@ -179,7 +180,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("INQUIRY decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -234,7 +235,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); page = 0; System.Console.ReadKey(); - continue; } break; @@ -305,7 +305,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("INQUIRY decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -401,7 +401,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); subpage = 0xFF; System.Console.ReadKey(); - continue; } break; @@ -464,7 +463,7 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("MODE SENSE (6) decoded response:"); if(buffer != null) - DicConsole.WriteLine("{0}", Decoders.SCSI.Modes.PrettifyModeHeader6(buffer, dev.ScsiType)); + DicConsole.WriteLine("{0}", Modes.PrettifyModeHeader6(buffer, dev.ScsiType)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -484,7 +483,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("MODE SENSE (6) decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -592,7 +591,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); subpage = 0xFF; System.Console.ReadKey(); - continue; } break; @@ -655,7 +653,7 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("MODE SENSE (10) decoded response:"); if(buffer != null) - DicConsole.WriteLine("{0}", Decoders.SCSI.Modes.PrettifyModeHeader10(buffer, dev.ScsiType)); + DicConsole.WriteLine("{0}", Modes.PrettifyModeHeader10(buffer, dev.ScsiType)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -675,7 +673,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("MODE SENSE (10) decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -735,7 +733,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a correct page control. Press any key to continue..."); mode = ScsiPreventAllowMode.Allow; System.Console.ReadKey(); - continue; } break; @@ -754,7 +751,7 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Command took {0} ms.", duration); DicConsole.WriteLine("Sense is {0}.", sense); DicConsole.WriteLine("PREVENT ALLOW MEDIUM REMOVAL decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine(); DicConsole.WriteLine("Choose what to do:"); DicConsole.WriteLine("1.- Send command again."); @@ -850,7 +847,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); address = 0; System.Console.ReadKey(); - continue; } break; @@ -921,7 +917,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ CAPACITY (10) decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -989,7 +985,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); address = 0; System.Console.ReadKey(); - continue; } break; @@ -1060,7 +1055,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ CAPACITY (16) decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -1140,7 +1135,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ MEDIA SERIAL NUMBER decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -1195,7 +1190,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); descriptor = false; System.Console.ReadKey(); - continue; } break; @@ -1216,7 +1210,7 @@ namespace DiscImageChef.Tests.Devices.SCSI senseBuffer == null ? "null" : senseBuffer.Length.ToString()); DicConsole.WriteLine("Sense buffer is null or empty? {0}", ArrayHelpers.ArrayIsNullOrEmpty(senseBuffer)); DicConsole.WriteLine("REQUEST SENSE decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine(); DicConsole.WriteLine("Choose what to do:"); DicConsole.WriteLine("1.- Print sense buffer."); @@ -1274,7 +1268,7 @@ namespace DiscImageChef.Tests.Devices.SCSI senseBuffer == null ? "null" : senseBuffer.Length.ToString()); DicConsole.WriteLine("Sense buffer is null or empty? {0}", ArrayHelpers.ArrayIsNullOrEmpty(senseBuffer)); DicConsole.WriteLine("TEST UNIT READY decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine(); DicConsole.WriteLine("Choose what to do:"); DicConsole.WriteLine("1.- Print sense buffer."); diff --git a/DiscImageChef.Tests.Devices/SCSI/SSC.cs b/DiscImageChef.Tests.Devices/SCSI/SSC.cs index afedd149d..518bf85aa 100644 --- a/DiscImageChef.Tests.Devices/SCSI/SSC.cs +++ b/DiscImageChef.Tests.Devices/SCSI/SSC.cs @@ -26,7 +26,10 @@ // Copyright © 2011-2018 Natalia Portillo // ****************************************************************************/ +using System; using DiscImageChef.Console; +using DiscImageChef.Decoders.SCSI; +using DiscImageChef.Decoders.SCSI.SSC; using DiscImageChef.Devices; namespace DiscImageChef.Tests.Devices.SCSI @@ -208,7 +211,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a boolean. Press any key to continue..."); hold = false; System.Console.ReadKey(); - continue; } break; @@ -230,7 +232,7 @@ namespace DiscImageChef.Tests.Devices.SCSI senseBuffer == null ? "null" : senseBuffer.Length.ToString()); DicConsole.WriteLine("Sense buffer is null or empty? {0}", ArrayHelpers.ArrayIsNullOrEmpty(senseBuffer)); DicConsole.WriteLine("LOAD UNLOAD decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine(); DicConsole.WriteLine("Choose what to do:"); DicConsole.WriteLine("1.- Print sense buffer."); @@ -361,7 +363,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); objectId = 0; System.Console.ReadKey(); - continue; } break; @@ -383,7 +384,7 @@ namespace DiscImageChef.Tests.Devices.SCSI senseBuffer == null ? "null" : senseBuffer.Length.ToString()); DicConsole.WriteLine("Sense buffer is null or empty? {0}", ArrayHelpers.ArrayIsNullOrEmpty(senseBuffer)); DicConsole.WriteLine("LOCATE (10) decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine(); DicConsole.WriteLine("Choose what to do:"); DicConsole.WriteLine("1.- Print sense buffer."); @@ -475,7 +476,7 @@ namespace DiscImageChef.Tests.Devices.SCSI SscLogicalIdTypes.SetId); DicConsole.Write("Choose?: "); strDev = System.Console.ReadLine(); - if(!System.Enum.TryParse(strDev, true, out destType)) + if(!Enum.TryParse(strDev, true, out destType)) { DicConsole.WriteLine("Not a correct object type. Press any key to continue..."); destType = SscLogicalIdTypes.FileId; @@ -530,7 +531,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); objectId = 1; System.Console.ReadKey(); - continue; } break; @@ -552,7 +552,7 @@ namespace DiscImageChef.Tests.Devices.SCSI senseBuffer == null ? "null" : senseBuffer.Length.ToString()); DicConsole.WriteLine("Sense buffer is null or empty? {0}", ArrayHelpers.ArrayIsNullOrEmpty(senseBuffer)); DicConsole.WriteLine("LOCATE (16) decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine(); DicConsole.WriteLine("Choose what to do:"); DicConsole.WriteLine("1.- Print sense buffer."); @@ -680,7 +680,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a boolean. Press any key to continue..."); sili = false; System.Console.ReadKey(); - continue; } break; @@ -751,7 +750,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ (6) decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -875,7 +874,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); partition = 0; System.Console.ReadKey(); - continue; } break; @@ -946,7 +944,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ (16) decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -1017,7 +1015,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ BLOCK LIMITS decoded response:"); - if(buffer != null) DicConsole.WriteLine("{0}", Decoders.SCSI.SSC.BlockLimits.Prettify(buffer)); + if(buffer != null) DicConsole.WriteLine("{0}", BlockLimits.Prettify(buffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -1037,7 +1035,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ BLOCK LIMITS decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -1094,12 +1092,11 @@ namespace DiscImageChef.Tests.Devices.SCSI SscPositionForms.Extended); DicConsole.Write("Choose?: "); strDev = System.Console.ReadLine(); - if(!System.Enum.TryParse(strDev, true, out responseForm)) + if(!Enum.TryParse(strDev, true, out responseForm)) { DicConsole.WriteLine("Not a correct response form. Press any key to continue..."); responseForm = SscPositionForms.Short; System.Console.ReadKey(); - continue; } break; @@ -1121,7 +1118,7 @@ namespace DiscImageChef.Tests.Devices.SCSI senseBuffer == null ? "null" : senseBuffer.Length.ToString()); DicConsole.WriteLine("Sense buffer is null or empty? {0}", ArrayHelpers.ArrayIsNullOrEmpty(senseBuffer)); DicConsole.WriteLine("READ POSITION decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine(); DicConsole.WriteLine("Choose what to do:"); DicConsole.WriteLine("1.- Print sense buffer."); @@ -1261,7 +1258,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a boolean. Press any key to continue..."); byteOrder = false; System.Console.ReadKey(); - continue; } break; @@ -1332,7 +1328,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ REVERSE (6) decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -1468,7 +1464,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a boolean. Press any key to continue..."); byteOrder = false; System.Console.ReadKey(); - continue; } break; @@ -1539,7 +1534,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ REVERSE (16) decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -1640,7 +1635,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a boolean. Press any key to continue..."); sili = false; System.Console.ReadKey(); - continue; } break; @@ -1711,7 +1705,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("RECOVER BUFFERED DATA decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -1779,7 +1773,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a boolean. Press any key to continue..."); current = false; System.Console.ReadKey(); - continue; } break; @@ -1841,8 +1834,8 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("REPORT DENSITY SUPPORT decoded buffer:"); - if(medium) DicConsole.Write("{0}", Decoders.SCSI.SSC.DensitySupport.PrettifyMediumType(buffer)); - else DicConsole.Write("{0}", Decoders.SCSI.SSC.DensitySupport.PrettifyDensity(buffer)); + if(medium) DicConsole.Write("{0}", DensitySupport.PrettifyMediumType(buffer)); + else DicConsole.Write("{0}", DensitySupport.PrettifyDensity(buffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -1862,7 +1855,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("REPORT DENSITY SUPPORT decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -1918,7 +1911,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a boolean. Press any key to continue..."); immediate = false; System.Console.ReadKey(); - continue; } break; @@ -1939,7 +1931,7 @@ namespace DiscImageChef.Tests.Devices.SCSI senseBuffer == null ? "null" : senseBuffer.Length.ToString()); DicConsole.WriteLine("Sense buffer is null or empty? {0}", ArrayHelpers.ArrayIsNullOrEmpty(senseBuffer)); DicConsole.WriteLine("REWIND decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine(); DicConsole.WriteLine("Choose what to do:"); DicConsole.WriteLine("1.- Print sense buffer."); @@ -2023,7 +2015,7 @@ namespace DiscImageChef.Tests.Devices.SCSI SscSpaceCodes.EndOfData, SscSpaceCodes.Obsolete1, SscSpaceCodes.Obsolete2); DicConsole.Write("Choose?: "); strDev = System.Console.ReadLine(); - if(!System.Enum.TryParse(strDev, true, out what)) + if(!Enum.TryParse(strDev, true, out what)) { DicConsole.WriteLine("Not a correct object type. Press any key to continue..."); what = SscSpaceCodes.LogicalBlock; @@ -2038,7 +2030,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); count = 0; System.Console.ReadKey(); - continue; } break; @@ -2059,7 +2050,7 @@ namespace DiscImageChef.Tests.Devices.SCSI senseBuffer == null ? "null" : senseBuffer.Length.ToString()); DicConsole.WriteLine("Sense buffer is null or empty? {0}", ArrayHelpers.ArrayIsNullOrEmpty(senseBuffer)); DicConsole.WriteLine("SPACE decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine(); DicConsole.WriteLine("Choose what to do:"); DicConsole.WriteLine("1.- Print sense buffer."); @@ -2142,7 +2133,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a number. Press any key to continue..."); track = 0; System.Console.ReadKey(); - continue; } break; @@ -2163,7 +2153,7 @@ namespace DiscImageChef.Tests.Devices.SCSI senseBuffer == null ? "null" : senseBuffer.Length.ToString()); DicConsole.WriteLine("Sense buffer is null or empty? {0}", ArrayHelpers.ArrayIsNullOrEmpty(senseBuffer)); DicConsole.WriteLine("TRACK SELECT decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine(); DicConsole.WriteLine("Choose what to do:"); DicConsole.WriteLine("1.- Print sense buffer."); diff --git a/DiscImageChef.Tests.Devices/SCSI/SyQuest.cs b/DiscImageChef.Tests.Devices/SCSI/SyQuest.cs index d9d7b0da8..b12e0c42f 100644 --- a/DiscImageChef.Tests.Devices/SCSI/SyQuest.cs +++ b/DiscImageChef.Tests.Devices/SCSI/SyQuest.cs @@ -27,6 +27,7 @@ // ****************************************************************************/ using DiscImageChef.Console; +using DiscImageChef.Decoders.SCSI; using DiscImageChef.Devices; namespace DiscImageChef.Tests.Devices.SCSI @@ -165,7 +166,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a boolean. Press any key to continue..."); noDma = false; System.Console.ReadKey(); - continue; } break; @@ -236,7 +236,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ {0}(6) decoded sense:", readlong ? "LONG " : ""); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -328,7 +328,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Not a boolean. Press any key to continue..."); noDma = false; System.Console.ReadKey(); - continue; } break; @@ -399,7 +398,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ {0}(10) decoded sense:", readlong ? "LONG " : ""); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); @@ -483,7 +482,7 @@ namespace DiscImageChef.Tests.Devices.SCSI System.Console.Clear(); DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ/RESET USAGE COUNTER decoded sense:"); - DicConsole.Write("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuffer)); + DicConsole.Write("{0}", Sense.PrettifySense(senseBuffer)); DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); System.Console.Clear(); diff --git a/DiscImageChef.Tests.Devices/SecureDigital/MultiMediaCard.cs b/DiscImageChef.Tests.Devices/SecureDigital/MultiMediaCard.cs index 158f1f7f9..5f6e333a6 100644 --- a/DiscImageChef.Tests.Devices/SecureDigital/MultiMediaCard.cs +++ b/DiscImageChef.Tests.Devices/SecureDigital/MultiMediaCard.cs @@ -174,7 +174,6 @@ namespace DiscImageChef.Tests.Devices.SecureDigital DicConsole.WriteLine("Not a number. Press any key to continue..."); blockSize = 512; System.Console.ReadKey(); - continue; } break; @@ -693,7 +692,6 @@ namespace DiscImageChef.Tests.Devices.SecureDigital DicConsole.WriteLine("Not a number. Press any key to continue..."); blockSize = 512; System.Console.ReadKey(); - continue; } break; diff --git a/DiscImageChef.Tests.Devices/SecureDigital/SecureDigital.cs b/DiscImageChef.Tests.Devices/SecureDigital/SecureDigital.cs index a3f24974c..9c02d2b2a 100644 --- a/DiscImageChef.Tests.Devices/SecureDigital/SecureDigital.cs +++ b/DiscImageChef.Tests.Devices/SecureDigital/SecureDigital.cs @@ -174,7 +174,6 @@ namespace DiscImageChef.Tests.Devices.SecureDigital DicConsole.WriteLine("Not a number. Press any key to continue..."); blockSize = 512; System.Console.ReadKey(); - continue; } break; @@ -693,7 +692,6 @@ namespace DiscImageChef.Tests.Devices.SecureDigital DicConsole.WriteLine("Not a number. Press any key to continue..."); blockSize = 512; System.Console.ReadKey(); - continue; } break; diff --git a/DiscImageChef.Tests/Devices/IomegaJaz.cs b/DiscImageChef.Tests/Devices/IomegaJaz.cs index 4b7695361..7960b113e 100644 --- a/DiscImageChef.Tests/Devices/IomegaJaz.cs +++ b/DiscImageChef.Tests/Devices/IomegaJaz.cs @@ -28,8 +28,8 @@ using System.IO; using DiscImageChef.CommonTypes; -using DiscImageChef.Filters; using DiscImageChef.DiscImages; +using DiscImageChef.Filters; using NUnit.Framework; namespace DiscImageChef.Tests.Devices diff --git a/DiscImageChef.Tests/Devices/LS120.cs b/DiscImageChef.Tests/Devices/LS120.cs index 5f6620dc5..d4b89cc10 100644 --- a/DiscImageChef.Tests/Devices/LS120.cs +++ b/DiscImageChef.Tests/Devices/LS120.cs @@ -28,8 +28,8 @@ using System.IO; using DiscImageChef.CommonTypes; -using DiscImageChef.Filters; using DiscImageChef.DiscImages; +using DiscImageChef.Filters; using NUnit.Framework; namespace DiscImageChef.Tests.Devices diff --git a/DiscImageChef.Tests/Devices/PocketZip.cs b/DiscImageChef.Tests/Devices/PocketZip.cs index ad28794e7..f9c7eb7f1 100644 --- a/DiscImageChef.Tests/Devices/PocketZip.cs +++ b/DiscImageChef.Tests/Devices/PocketZip.cs @@ -28,8 +28,8 @@ using System.IO; using DiscImageChef.CommonTypes; -using DiscImageChef.Filters; using DiscImageChef.DiscImages; +using DiscImageChef.Filters; using NUnit.Framework; namespace DiscImageChef.Tests.Devices diff --git a/DiscImageChef.Tests/Filesystems/ADFS.cs b/DiscImageChef.Tests/Filesystems/ADFS.cs index b3601be99..2629b81b3 100644 --- a/DiscImageChef.Tests/Filesystems/ADFS.cs +++ b/DiscImageChef.Tests/Filesystems/ADFS.cs @@ -28,9 +28,9 @@ using System.IO; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using NUnit.Framework; namespace DiscImageChef.Tests.Filesystems diff --git a/DiscImageChef.Tests/Filesystems/AFFS.cs b/DiscImageChef.Tests/Filesystems/AFFS.cs index 2cf115c70..9da72642e 100644 --- a/DiscImageChef.Tests/Filesystems/AFFS.cs +++ b/DiscImageChef.Tests/Filesystems/AFFS.cs @@ -28,9 +28,9 @@ using System.IO; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using NUnit.Framework; namespace DiscImageChef.Tests.Filesystems diff --git a/DiscImageChef.Tests/Filesystems/AFFS2_RDB.cs b/DiscImageChef.Tests/Filesystems/AFFS2_RDB.cs index 833c69850..8c0fa82d8 100644 --- a/DiscImageChef.Tests/Filesystems/AFFS2_RDB.cs +++ b/DiscImageChef.Tests/Filesystems/AFFS2_RDB.cs @@ -66,7 +66,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin(); + Filesystem fs = new AmigaDOSPlugin(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "\"DOS\\7\"") diff --git a/DiscImageChef.Tests/Filesystems/AFFS_MBR.cs b/DiscImageChef.Tests/Filesystems/AFFS_MBR.cs index f4fdc5c51..bbeb20d2e 100644 --- a/DiscImageChef.Tests/Filesystems/AFFS_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/AFFS_MBR.cs @@ -66,7 +66,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin(); + Filesystem fs = new AmigaDOSPlugin(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "0x2D" || partitions[j].Type == "0x2E") diff --git a/DiscImageChef.Tests/Filesystems/AFFS_MBR_RDB.cs b/DiscImageChef.Tests/Filesystems/AFFS_MBR_RDB.cs index 2213d1e67..402cebe5b 100644 --- a/DiscImageChef.Tests/Filesystems/AFFS_MBR_RDB.cs +++ b/DiscImageChef.Tests/Filesystems/AFFS_MBR_RDB.cs @@ -66,7 +66,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin(); + Filesystem fs = new AmigaDOSPlugin(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "\"DOS\\1\"" || partitions[j].Type == "\"DOS\\3\"") diff --git a/DiscImageChef.Tests/Filesystems/AFFS_RDB.cs b/DiscImageChef.Tests/Filesystems/AFFS_RDB.cs index b0abbb81e..2b3ca1412 100644 --- a/DiscImageChef.Tests/Filesystems/AFFS_RDB.cs +++ b/DiscImageChef.Tests/Filesystems/AFFS_RDB.cs @@ -75,7 +75,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin(); + Filesystem fs = new AmigaDOSPlugin(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "\"DOS\\1\"" || partitions[j].Type == "\"DOS\\3\"" || diff --git a/DiscImageChef.Tests/Filesystems/AFS.cs b/DiscImageChef.Tests/Filesystems/AFS.cs index 0c242dc3b..abe6268f8 100644 --- a/DiscImageChef.Tests/Filesystems/AFS.cs +++ b/DiscImageChef.Tests/Filesystems/AFS.cs @@ -28,9 +28,9 @@ using System.IO; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using NUnit.Framework; namespace DiscImageChef.Tests.Filesystems @@ -79,7 +79,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(mediatypes[i], image.ImageInfo.MediaType, testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); - Filesystem fs = new DiscImageChef.Filesystems.SysVfs(); + Filesystem fs = new SysVfs(); Partition wholePart = new Partition { Name = "Whole device", diff --git a/DiscImageChef.Tests/Filesystems/AFS_MBR.cs b/DiscImageChef.Tests/Filesystems/AFS_MBR.cs index e5d1d3241..49d4451f2 100644 --- a/DiscImageChef.Tests/Filesystems/AFS_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/AFS_MBR.cs @@ -68,7 +68,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.SysVfs(); + Filesystem fs = new SysVfs(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "XENIX") diff --git a/DiscImageChef.Tests/Filesystems/AOFS.cs b/DiscImageChef.Tests/Filesystems/AOFS.cs index f15b77606..c1886b1c1 100644 --- a/DiscImageChef.Tests/Filesystems/AOFS.cs +++ b/DiscImageChef.Tests/Filesystems/AOFS.cs @@ -28,9 +28,9 @@ using System.IO; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using NUnit.Framework; namespace DiscImageChef.Tests.Filesystems diff --git a/DiscImageChef.Tests/Filesystems/AOFS_MBR.cs b/DiscImageChef.Tests/Filesystems/AOFS_MBR.cs index d3d0d5079..8d154942b 100644 --- a/DiscImageChef.Tests/Filesystems/AOFS_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/AOFS_MBR.cs @@ -66,7 +66,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin(); + Filesystem fs = new AmigaDOSPlugin(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "0x2C") diff --git a/DiscImageChef.Tests/Filesystems/AOFS_MBR_RDB.cs b/DiscImageChef.Tests/Filesystems/AOFS_MBR_RDB.cs index d78b460d0..e6b92d89c 100644 --- a/DiscImageChef.Tests/Filesystems/AOFS_MBR_RDB.cs +++ b/DiscImageChef.Tests/Filesystems/AOFS_MBR_RDB.cs @@ -66,7 +66,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin(); + Filesystem fs = new AmigaDOSPlugin(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "\"DOS\\0\"") diff --git a/DiscImageChef.Tests/Filesystems/AOFS_RDB.cs b/DiscImageChef.Tests/Filesystems/AOFS_RDB.cs index f5a54a626..9e489e8c2 100644 --- a/DiscImageChef.Tests/Filesystems/AOFS_RDB.cs +++ b/DiscImageChef.Tests/Filesystems/AOFS_RDB.cs @@ -67,7 +67,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin(); + Filesystem fs = new AmigaDOSPlugin(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "\"DOS\\0\"" || partitions[j].Type == "\"DOS\\2\"" || diff --git a/DiscImageChef.Tests/Filesystems/Atheos_MBR.cs b/DiscImageChef.Tests/Filesystems/Atheos_MBR.cs index d620653af..67a27f7de 100644 --- a/DiscImageChef.Tests/Filesystems/Atheos_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/Atheos_MBR.cs @@ -66,7 +66,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.AtheOS(); + Filesystem fs = new AtheOS(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "0x2A") diff --git a/DiscImageChef.Tests/Filesystems/BeFS.cs b/DiscImageChef.Tests/Filesystems/BeFS.cs index 9abff108d..756611ccb 100644 --- a/DiscImageChef.Tests/Filesystems/BeFS.cs +++ b/DiscImageChef.Tests/Filesystems/BeFS.cs @@ -28,9 +28,9 @@ using System.IO; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using NUnit.Framework; namespace DiscImageChef.Tests.Filesystems diff --git a/DiscImageChef.Tests/Filesystems/COHERENT.cs b/DiscImageChef.Tests/Filesystems/COHERENT.cs index b6b9d9a91..f74f0fb4c 100644 --- a/DiscImageChef.Tests/Filesystems/COHERENT.cs +++ b/DiscImageChef.Tests/Filesystems/COHERENT.cs @@ -28,9 +28,9 @@ using System.IO; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using NUnit.Framework; namespace DiscImageChef.Tests.Filesystems @@ -74,7 +74,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(mediatypes[i], image.ImageInfo.MediaType, testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); - Filesystem fs = new DiscImageChef.Filesystems.SysVfs(); + Filesystem fs = new SysVfs(); Partition wholePart = new Partition { Name = "Whole device", diff --git a/DiscImageChef.Tests/Filesystems/COHERENT_MBR.cs b/DiscImageChef.Tests/Filesystems/COHERENT_MBR.cs index d837cade0..4d1b4323c 100644 --- a/DiscImageChef.Tests/Filesystems/COHERENT_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/COHERENT_MBR.cs @@ -68,7 +68,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.SysVfs(); + Filesystem fs = new SysVfs(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "0x09") diff --git a/DiscImageChef.Tests/Filesystems/DTFS.cs b/DiscImageChef.Tests/Filesystems/DTFS.cs index f4280fdf8..581ca1999 100644 --- a/DiscImageChef.Tests/Filesystems/DTFS.cs +++ b/DiscImageChef.Tests/Filesystems/DTFS.cs @@ -28,9 +28,9 @@ using System.IO; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using NUnit.Framework; namespace DiscImageChef.Tests.Filesystems @@ -75,7 +75,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(mediatypes[i], image.ImageInfo.MediaType, testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); - Filesystem fs = new DiscImageChef.Filesystems.SysVfs(); + Filesystem fs = new SysVfs(); Partition wholePart = new Partition { Name = "Whole device", diff --git a/DiscImageChef.Tests/Filesystems/DTFS_MBR.cs b/DiscImageChef.Tests/Filesystems/DTFS_MBR.cs index 7d1c06e84..1b0102db6 100644 --- a/DiscImageChef.Tests/Filesystems/DTFS_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/DTFS_MBR.cs @@ -68,7 +68,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.SysVfs(); + Filesystem fs = new SysVfs(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "XENIX") diff --git a/DiscImageChef.Tests/Filesystems/EAFS.cs b/DiscImageChef.Tests/Filesystems/EAFS.cs index 8ed498adb..4f06a4ed9 100644 --- a/DiscImageChef.Tests/Filesystems/EAFS.cs +++ b/DiscImageChef.Tests/Filesystems/EAFS.cs @@ -28,9 +28,9 @@ using System.IO; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using NUnit.Framework; namespace DiscImageChef.Tests.Filesystems @@ -79,7 +79,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(mediatypes[i], image.ImageInfo.MediaType, testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); - Filesystem fs = new DiscImageChef.Filesystems.SysVfs(); + Filesystem fs = new SysVfs(); Partition wholePart = new Partition { Name = "Whole device", diff --git a/DiscImageChef.Tests/Filesystems/EAFS_MBR.cs b/DiscImageChef.Tests/Filesystems/EAFS_MBR.cs index 9e630c217..f465b7a01 100644 --- a/DiscImageChef.Tests/Filesystems/EAFS_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/EAFS_MBR.cs @@ -68,7 +68,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.SysVfs(); + Filesystem fs = new SysVfs(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "XENIX") diff --git a/DiscImageChef.Tests/Filesystems/FAT12.cs b/DiscImageChef.Tests/Filesystems/FAT12.cs index 7b008f7cc..0cc181b4d 100644 --- a/DiscImageChef.Tests/Filesystems/FAT12.cs +++ b/DiscImageChef.Tests/Filesystems/FAT12.cs @@ -28,9 +28,9 @@ using System.IO; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using NUnit.Framework; namespace DiscImageChef.Tests.Filesystems diff --git a/DiscImageChef.Tests/Filesystems/FAT12_APM.cs b/DiscImageChef.Tests/Filesystems/FAT12_APM.cs index de352f06f..48d1126f8 100644 --- a/DiscImageChef.Tests/Filesystems/FAT12_APM.cs +++ b/DiscImageChef.Tests/Filesystems/FAT12_APM.cs @@ -68,7 +68,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.FAT(); + Filesystem fs = new FAT(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "DOS_FAT_12") diff --git a/DiscImageChef.Tests/Filesystems/FAT12_GPT.cs b/DiscImageChef.Tests/Filesystems/FAT12_GPT.cs index 80564251e..2df4121d6 100644 --- a/DiscImageChef.Tests/Filesystems/FAT12_GPT.cs +++ b/DiscImageChef.Tests/Filesystems/FAT12_GPT.cs @@ -68,7 +68,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.FAT(); + Filesystem fs = new FAT(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "Microsoft Basic data") diff --git a/DiscImageChef.Tests/Filesystems/FAT16.cs b/DiscImageChef.Tests/Filesystems/FAT16.cs index cfd2101e3..d1e08d9f4 100644 --- a/DiscImageChef.Tests/Filesystems/FAT16.cs +++ b/DiscImageChef.Tests/Filesystems/FAT16.cs @@ -28,9 +28,9 @@ using System.IO; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using NUnit.Framework; namespace DiscImageChef.Tests.Filesystems diff --git a/DiscImageChef.Tests/Filesystems/FAT16_APM.cs b/DiscImageChef.Tests/Filesystems/FAT16_APM.cs index 7477b178b..b4e240799 100644 --- a/DiscImageChef.Tests/Filesystems/FAT16_APM.cs +++ b/DiscImageChef.Tests/Filesystems/FAT16_APM.cs @@ -68,7 +68,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.FAT(); + Filesystem fs = new FAT(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "DOS_FAT_16") diff --git a/DiscImageChef.Tests/Filesystems/FAT16_Atari.cs b/DiscImageChef.Tests/Filesystems/FAT16_Atari.cs index 9636495e2..7550d151d 100644 --- a/DiscImageChef.Tests/Filesystems/FAT16_Atari.cs +++ b/DiscImageChef.Tests/Filesystems/FAT16_Atari.cs @@ -68,7 +68,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.FAT(); + Filesystem fs = new FAT(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "GEM" || partitions[j].Type == "BGM") diff --git a/DiscImageChef.Tests/Filesystems/FAT16_GPT.cs b/DiscImageChef.Tests/Filesystems/FAT16_GPT.cs index 80c3ad56b..7dfc80677 100644 --- a/DiscImageChef.Tests/Filesystems/FAT16_GPT.cs +++ b/DiscImageChef.Tests/Filesystems/FAT16_GPT.cs @@ -68,7 +68,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.FAT(); + Filesystem fs = new FAT(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "Microsoft Basic data") diff --git a/DiscImageChef.Tests/Filesystems/FAT16_RDB.cs b/DiscImageChef.Tests/Filesystems/FAT16_RDB.cs index bc2c4d3ba..47c3e4d16 100644 --- a/DiscImageChef.Tests/Filesystems/FAT16_RDB.cs +++ b/DiscImageChef.Tests/Filesystems/FAT16_RDB.cs @@ -68,7 +68,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.FAT(); + Filesystem fs = new FAT(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "0x06") diff --git a/DiscImageChef.Tests/Filesystems/FAT32_APM.cs b/DiscImageChef.Tests/Filesystems/FAT32_APM.cs index 1df0da904..da6c4aa0f 100644 --- a/DiscImageChef.Tests/Filesystems/FAT32_APM.cs +++ b/DiscImageChef.Tests/Filesystems/FAT32_APM.cs @@ -68,7 +68,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.FAT(); + Filesystem fs = new FAT(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "DOS_FAT_32") diff --git a/DiscImageChef.Tests/Filesystems/FAT32_GPT.cs b/DiscImageChef.Tests/Filesystems/FAT32_GPT.cs index 7c093d6aa..2459e2630 100644 --- a/DiscImageChef.Tests/Filesystems/FAT32_GPT.cs +++ b/DiscImageChef.Tests/Filesystems/FAT32_GPT.cs @@ -68,7 +68,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.FAT(); + Filesystem fs = new FAT(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "Microsoft Basic data") diff --git a/DiscImageChef.Tests/Filesystems/HAMMER_MBR.cs b/DiscImageChef.Tests/Filesystems/HAMMER_MBR.cs index 6b0211ba7..984746029 100644 --- a/DiscImageChef.Tests/Filesystems/HAMMER_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/HAMMER_MBR.cs @@ -67,7 +67,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.HAMMER(); + Filesystem fs = new HAMMER(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "Hammer") diff --git a/DiscImageChef.Tests/Filesystems/HFS.cs b/DiscImageChef.Tests/Filesystems/HFS.cs index 4deaa6fb8..0a6d5db89 100644 --- a/DiscImageChef.Tests/Filesystems/HFS.cs +++ b/DiscImageChef.Tests/Filesystems/HFS.cs @@ -28,9 +28,9 @@ using System.IO; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using NUnit.Framework; namespace DiscImageChef.Tests.Filesystems diff --git a/DiscImageChef.Tests/Filesystems/HFSPlus_APM.cs b/DiscImageChef.Tests/Filesystems/HFSPlus_APM.cs index aec66074e..176f2939f 100644 --- a/DiscImageChef.Tests/Filesystems/HFSPlus_APM.cs +++ b/DiscImageChef.Tests/Filesystems/HFSPlus_APM.cs @@ -102,7 +102,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.AppleHFSPlus(); + Filesystem fs = new AppleHFSPlus(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "Apple_HFS") diff --git a/DiscImageChef.Tests/Filesystems/HFSPlus_GPT.cs b/DiscImageChef.Tests/Filesystems/HFSPlus_GPT.cs index fef8ae7d9..2360ad0eb 100644 --- a/DiscImageChef.Tests/Filesystems/HFSPlus_GPT.cs +++ b/DiscImageChef.Tests/Filesystems/HFSPlus_GPT.cs @@ -68,7 +68,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.AppleHFSPlus(); + Filesystem fs = new AppleHFSPlus(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "Apple HFS") diff --git a/DiscImageChef.Tests/Filesystems/HFSPlus_MBR.cs b/DiscImageChef.Tests/Filesystems/HFSPlus_MBR.cs index 28f025871..48fa7e95f 100644 --- a/DiscImageChef.Tests/Filesystems/HFSPlus_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/HFSPlus_MBR.cs @@ -81,7 +81,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.AppleHFSPlus(); + Filesystem fs = new AppleHFSPlus(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "0xAF") diff --git a/DiscImageChef.Tests/Filesystems/HFSX_APM.cs b/DiscImageChef.Tests/Filesystems/HFSX_APM.cs index 6af2fd4ac..36a35e716 100644 --- a/DiscImageChef.Tests/Filesystems/HFSX_APM.cs +++ b/DiscImageChef.Tests/Filesystems/HFSX_APM.cs @@ -76,7 +76,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.AppleHFSPlus(); + Filesystem fs = new AppleHFSPlus(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "Apple_HFSX") diff --git a/DiscImageChef.Tests/Filesystems/HFSX_GPT.cs b/DiscImageChef.Tests/Filesystems/HFSX_GPT.cs index 2bceaf74c..41381ca5d 100644 --- a/DiscImageChef.Tests/Filesystems/HFSX_GPT.cs +++ b/DiscImageChef.Tests/Filesystems/HFSX_GPT.cs @@ -68,7 +68,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.AppleHFSPlus(); + Filesystem fs = new AppleHFSPlus(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "Apple HFS") diff --git a/DiscImageChef.Tests/Filesystems/HFSX_MBR.cs b/DiscImageChef.Tests/Filesystems/HFSX_MBR.cs index 1f35e56ba..24946d7c2 100644 --- a/DiscImageChef.Tests/Filesystems/HFSX_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/HFSX_MBR.cs @@ -73,7 +73,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.AppleHFSPlus(); + Filesystem fs = new AppleHFSPlus(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "0xAF") diff --git a/DiscImageChef.Tests/Filesystems/HFS_APM.cs b/DiscImageChef.Tests/Filesystems/HFS_APM.cs index 44781b927..4a6aaff1c 100644 --- a/DiscImageChef.Tests/Filesystems/HFS_APM.cs +++ b/DiscImageChef.Tests/Filesystems/HFS_APM.cs @@ -107,7 +107,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.AppleHFS(); + Filesystem fs = new AppleHFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "Apple_HFS") diff --git a/DiscImageChef.Tests/Filesystems/HFS_CDROM.cs b/DiscImageChef.Tests/Filesystems/HFS_CDROM.cs index 68fe9174b..c914212b3 100644 --- a/DiscImageChef.Tests/Filesystems/HFS_CDROM.cs +++ b/DiscImageChef.Tests/Filesystems/HFS_CDROM.cs @@ -29,9 +29,9 @@ using System.Collections.Generic; using System.IO; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using NUnit.Framework; namespace DiscImageChef.Tests.Filesystems @@ -72,7 +72,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.AppleHFS(); + Filesystem fs = new AppleHFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "Apple_HFS") diff --git a/DiscImageChef.Tests/Filesystems/HFS_MBR.cs b/DiscImageChef.Tests/Filesystems/HFS_MBR.cs index 1be7b0ad6..5d9d6ff91 100644 --- a/DiscImageChef.Tests/Filesystems/HFS_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/HFS_MBR.cs @@ -70,7 +70,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.AppleHFS(); + Filesystem fs = new AppleHFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "0xAF") diff --git a/DiscImageChef.Tests/Filesystems/HFS_RDB.cs b/DiscImageChef.Tests/Filesystems/HFS_RDB.cs index de272e772..ddeb36340 100644 --- a/DiscImageChef.Tests/Filesystems/HFS_RDB.cs +++ b/DiscImageChef.Tests/Filesystems/HFS_RDB.cs @@ -66,7 +66,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.AppleHFS(); + Filesystem fs = new AppleHFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "\"RES\\86\"") diff --git a/DiscImageChef.Tests/Filesystems/HTFS.cs b/DiscImageChef.Tests/Filesystems/HTFS.cs index 1b1993b77..a197b0a42 100644 --- a/DiscImageChef.Tests/Filesystems/HTFS.cs +++ b/DiscImageChef.Tests/Filesystems/HTFS.cs @@ -28,9 +28,9 @@ using System.IO; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using NUnit.Framework; namespace DiscImageChef.Tests.Filesystems @@ -75,7 +75,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(mediatypes[i], image.ImageInfo.MediaType, testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); - Filesystem fs = new DiscImageChef.Filesystems.SysVfs(); + Filesystem fs = new SysVfs(); Partition wholePart = new Partition { Name = "Whole device", diff --git a/DiscImageChef.Tests/Filesystems/HTFS_MBR.cs b/DiscImageChef.Tests/Filesystems/HTFS_MBR.cs index 243e56579..9cb597c93 100644 --- a/DiscImageChef.Tests/Filesystems/HTFS_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/HTFS_MBR.cs @@ -68,7 +68,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.SysVfs(); + Filesystem fs = new SysVfs(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "XENIX") diff --git a/DiscImageChef.Tests/Filesystems/ISO9660.cs b/DiscImageChef.Tests/Filesystems/ISO9660.cs index 3aabde1e1..32e3bf10d 100644 --- a/DiscImageChef.Tests/Filesystems/ISO9660.cs +++ b/DiscImageChef.Tests/Filesystems/ISO9660.cs @@ -28,9 +28,9 @@ using System.IO; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using NUnit.Framework; namespace DiscImageChef.Tests.Filesystems diff --git a/DiscImageChef.Tests/Filesystems/JFS2.cs b/DiscImageChef.Tests/Filesystems/JFS2.cs index 69646129c..49a435a1e 100644 --- a/DiscImageChef.Tests/Filesystems/JFS2.cs +++ b/DiscImageChef.Tests/Filesystems/JFS2.cs @@ -67,7 +67,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.JFS(); + Filesystem fs = new JFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "0x83" || partitions[j].Type == "0x07") diff --git a/DiscImageChef.Tests/Filesystems/LisaFS.cs b/DiscImageChef.Tests/Filesystems/LisaFS.cs index e9674d6a1..d3a1c85bc 100644 --- a/DiscImageChef.Tests/Filesystems/LisaFS.cs +++ b/DiscImageChef.Tests/Filesystems/LisaFS.cs @@ -28,9 +28,9 @@ using System.IO; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using NUnit.Framework; namespace DiscImageChef.Tests.Filesystems diff --git a/DiscImageChef.Tests/Filesystems/Locus.cs b/DiscImageChef.Tests/Filesystems/Locus.cs index 500a310f0..18dca597f 100644 --- a/DiscImageChef.Tests/Filesystems/Locus.cs +++ b/DiscImageChef.Tests/Filesystems/Locus.cs @@ -28,9 +28,9 @@ using System.IO; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using NUnit.Framework; namespace DiscImageChef.Tests.Filesystems diff --git a/DiscImageChef.Tests/Filesystems/MFS.cs b/DiscImageChef.Tests/Filesystems/MFS.cs index 260fbbdfd..69d54230b 100644 --- a/DiscImageChef.Tests/Filesystems/MFS.cs +++ b/DiscImageChef.Tests/Filesystems/MFS.cs @@ -28,9 +28,10 @@ using System.IO; using DiscImageChef.CommonTypes; -using DiscImageChef.Filesystems; -using DiscImageChef.Filters; using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filesystems.AppleMFS; +using DiscImageChef.Filters; using NUnit.Framework; namespace DiscImageChef.Tests.Filesystems @@ -76,7 +77,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(mediatypes[i], image.ImageInfo.MediaType, testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); - Filesystem fs = new DiscImageChef.Filesystems.AppleMFS.AppleMFS(); + Filesystem fs = new AppleMFS(); Partition wholePart = new Partition { Name = "Whole device", diff --git a/DiscImageChef.Tests/Filesystems/MINIXv1.cs b/DiscImageChef.Tests/Filesystems/MINIXv1.cs index 6feabed47..e0a88209d 100644 --- a/DiscImageChef.Tests/Filesystems/MINIXv1.cs +++ b/DiscImageChef.Tests/Filesystems/MINIXv1.cs @@ -28,9 +28,9 @@ using System.IO; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using NUnit.Framework; namespace DiscImageChef.Tests.Filesystems diff --git a/DiscImageChef.Tests/Filesystems/MINIXv1_MBR.cs b/DiscImageChef.Tests/Filesystems/MINIXv1_MBR.cs index fe713cc7c..5c50b11b5 100644 --- a/DiscImageChef.Tests/Filesystems/MINIXv1_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/MINIXv1_MBR.cs @@ -64,7 +64,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.MinixFS(); + Filesystem fs = new MinixFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "0x80" || partitions[j].Type == "0x81" || partitions[j].Type == "MINIX") diff --git a/DiscImageChef.Tests/Filesystems/MINIXv2.cs b/DiscImageChef.Tests/Filesystems/MINIXv2.cs index 343ac9723..69dfaa43c 100644 --- a/DiscImageChef.Tests/Filesystems/MINIXv2.cs +++ b/DiscImageChef.Tests/Filesystems/MINIXv2.cs @@ -28,9 +28,9 @@ using System.IO; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using NUnit.Framework; namespace DiscImageChef.Tests.Filesystems diff --git a/DiscImageChef.Tests/Filesystems/MINIXv2_MBR.cs b/DiscImageChef.Tests/Filesystems/MINIXv2_MBR.cs index 6553214c2..b526ff9b1 100644 --- a/DiscImageChef.Tests/Filesystems/MINIXv2_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/MINIXv2_MBR.cs @@ -64,7 +64,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.MinixFS(); + Filesystem fs = new MinixFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "0x81" || partitions[j].Type == "MINIX") diff --git a/DiscImageChef.Tests/Filesystems/MINIXv3.cs b/DiscImageChef.Tests/Filesystems/MINIXv3.cs index d12871cee..e934f87d3 100644 --- a/DiscImageChef.Tests/Filesystems/MINIXv3.cs +++ b/DiscImageChef.Tests/Filesystems/MINIXv3.cs @@ -28,9 +28,9 @@ using System.IO; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using NUnit.Framework; namespace DiscImageChef.Tests.Filesystems diff --git a/DiscImageChef.Tests/Filesystems/MINIXv3_MBR.cs b/DiscImageChef.Tests/Filesystems/MINIXv3_MBR.cs index b10c7f872..70b864d5f 100644 --- a/DiscImageChef.Tests/Filesystems/MINIXv3_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/MINIXv3_MBR.cs @@ -64,7 +64,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.MinixFS(); + Filesystem fs = new MinixFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "0x81" || partitions[j].Type == "MINIX") diff --git a/DiscImageChef.Tests/Filesystems/NTFS_GPT.cs b/DiscImageChef.Tests/Filesystems/NTFS_GPT.cs index 799f4e435..990544ce4 100644 --- a/DiscImageChef.Tests/Filesystems/NTFS_GPT.cs +++ b/DiscImageChef.Tests/Filesystems/NTFS_GPT.cs @@ -68,7 +68,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.NTFS(); + Filesystem fs = new NTFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "Microsoft Basic data") diff --git a/DiscImageChef.Tests/Filesystems/NTFS_MBR.cs b/DiscImageChef.Tests/Filesystems/NTFS_MBR.cs index 5c994f81d..689971067 100644 --- a/DiscImageChef.Tests/Filesystems/NTFS_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/NTFS_MBR.cs @@ -76,7 +76,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.NTFS(); + Filesystem fs = new NTFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "0x07" || diff --git a/DiscImageChef.Tests/Filesystems/PFS3_RDB.cs b/DiscImageChef.Tests/Filesystems/PFS3_RDB.cs index f9d432c3a..d6aeb84b6 100644 --- a/DiscImageChef.Tests/Filesystems/PFS3_RDB.cs +++ b/DiscImageChef.Tests/Filesystems/PFS3_RDB.cs @@ -68,7 +68,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.PFS(); + Filesystem fs = new PFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "\"PFS\\1\"") diff --git a/DiscImageChef.Tests/Filesystems/ProDOS_APM.cs b/DiscImageChef.Tests/Filesystems/ProDOS_APM.cs index 805e73e96..a70fcceb1 100644 --- a/DiscImageChef.Tests/Filesystems/ProDOS_APM.cs +++ b/DiscImageChef.Tests/Filesystems/ProDOS_APM.cs @@ -74,7 +74,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.ProDOSPlugin(); + Filesystem fs = new ProDOSPlugin(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "Apple_ProDOS") diff --git a/DiscImageChef.Tests/Filesystems/QNX4.cs b/DiscImageChef.Tests/Filesystems/QNX4.cs index e522a7ae6..4936495d2 100644 --- a/DiscImageChef.Tests/Filesystems/QNX4.cs +++ b/DiscImageChef.Tests/Filesystems/QNX4.cs @@ -28,9 +28,9 @@ using System.IO; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using NUnit.Framework; namespace DiscImageChef.Tests.Filesystems diff --git a/DiscImageChef.Tests/Filesystems/Reiser3.cs b/DiscImageChef.Tests/Filesystems/Reiser3.cs index 6b6740546..871ff4fc2 100644 --- a/DiscImageChef.Tests/Filesystems/Reiser3.cs +++ b/DiscImageChef.Tests/Filesystems/Reiser3.cs @@ -64,7 +64,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.Reiser(); + Filesystem fs = new Reiser(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "0x83") diff --git a/DiscImageChef.Tests/Filesystems/SFS_MBR.cs b/DiscImageChef.Tests/Filesystems/SFS_MBR.cs index 064d081fd..2f47003dd 100644 --- a/DiscImageChef.Tests/Filesystems/SFS_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/SFS_MBR.cs @@ -66,7 +66,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.SFS(); + Filesystem fs = new SFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "0x2F") diff --git a/DiscImageChef.Tests/Filesystems/SFS_MBR_RDB.cs b/DiscImageChef.Tests/Filesystems/SFS_MBR_RDB.cs index b7a00163b..53c738a7c 100644 --- a/DiscImageChef.Tests/Filesystems/SFS_MBR_RDB.cs +++ b/DiscImageChef.Tests/Filesystems/SFS_MBR_RDB.cs @@ -66,7 +66,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.SFS(); + Filesystem fs = new SFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "\"SFS\\0\"") diff --git a/DiscImageChef.Tests/Filesystems/SFS_RDB.cs b/DiscImageChef.Tests/Filesystems/SFS_RDB.cs index c4227ea68..0ed387f7e 100644 --- a/DiscImageChef.Tests/Filesystems/SFS_RDB.cs +++ b/DiscImageChef.Tests/Filesystems/SFS_RDB.cs @@ -66,7 +66,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.SFS(); + Filesystem fs = new SFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "\"SFS\\0\"" || partitions[j].Type == "\"SFS\\2\"") diff --git a/DiscImageChef.Tests/Filesystems/SysV.cs b/DiscImageChef.Tests/Filesystems/SysV.cs index cc97177cf..5cd3bf0c6 100644 --- a/DiscImageChef.Tests/Filesystems/SysV.cs +++ b/DiscImageChef.Tests/Filesystems/SysV.cs @@ -28,9 +28,9 @@ using System.IO; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using NUnit.Framework; namespace DiscImageChef.Tests.Filesystems @@ -80,7 +80,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(mediatypes[i], image.ImageInfo.MediaType, testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); - Filesystem fs = new DiscImageChef.Filesystems.SysVfs(); + Filesystem fs = new SysVfs(); Partition wholePart = new Partition { Name = "Whole device", diff --git a/DiscImageChef.Tests/Filesystems/SysV_MBR.cs b/DiscImageChef.Tests/Filesystems/SysV_MBR.cs index e1f2a7827..42e757295 100644 --- a/DiscImageChef.Tests/Filesystems/SysV_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/SysV_MBR.cs @@ -69,7 +69,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.SysVfs(); + Filesystem fs = new SysVfs(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "UNIX: /usr" || partitions[j].Type == "XENIX") diff --git a/DiscImageChef.Tests/Filesystems/SysV_RDB.cs b/DiscImageChef.Tests/Filesystems/SysV_RDB.cs index 6d2a8cdcd..3be322ffc 100644 --- a/DiscImageChef.Tests/Filesystems/SysV_RDB.cs +++ b/DiscImageChef.Tests/Filesystems/SysV_RDB.cs @@ -68,7 +68,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.SysVfs(); + Filesystem fs = new SysVfs(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "\"UNI\\1\"") diff --git a/DiscImageChef.Tests/Filesystems/UFS.cs b/DiscImageChef.Tests/Filesystems/UFS.cs index 715b891bf..7150506ca 100644 --- a/DiscImageChef.Tests/Filesystems/UFS.cs +++ b/DiscImageChef.Tests/Filesystems/UFS.cs @@ -28,9 +28,9 @@ using System.IO; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using NUnit.Framework; namespace DiscImageChef.Tests.Filesystems @@ -78,7 +78,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(mediatypes[i], image.ImageInfo.MediaType, testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); - Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin(); + Filesystem fs = new FFSPlugin(); Partition wholePart = new Partition { Name = "Whole device", diff --git a/DiscImageChef.Tests/Filesystems/UFS_APM.cs b/DiscImageChef.Tests/Filesystems/UFS_APM.cs index 6dc99f155..26094de0e 100644 --- a/DiscImageChef.Tests/Filesystems/UFS_APM.cs +++ b/DiscImageChef.Tests/Filesystems/UFS_APM.cs @@ -76,7 +76,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin(); + Filesystem fs = new FFSPlugin(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "Apple_UFS") diff --git a/DiscImageChef.Tests/Filesystems/UFS_MBR.cs b/DiscImageChef.Tests/Filesystems/UFS_MBR.cs index a24fe87b5..a9770611e 100644 --- a/DiscImageChef.Tests/Filesystems/UFS_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/UFS_MBR.cs @@ -109,7 +109,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin(); + Filesystem fs = new FFSPlugin(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "0x63" || partitions[j].Type == "0xA8" || partitions[j].Type == "0xA5" || diff --git a/DiscImageChef.Tests/Filesystems/UFS_NeXT.cs b/DiscImageChef.Tests/Filesystems/UFS_NeXT.cs index eb1450a08..27de2b055 100644 --- a/DiscImageChef.Tests/Filesystems/UFS_NeXT.cs +++ b/DiscImageChef.Tests/Filesystems/UFS_NeXT.cs @@ -72,7 +72,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin(); + Filesystem fs = new FFSPlugin(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "4.3BSD" || partitions[j].Type == "4.4BSD") diff --git a/DiscImageChef.Tests/Filesystems/UFS_NeXT_Floppy.cs b/DiscImageChef.Tests/Filesystems/UFS_NeXT_Floppy.cs index bec0eedf6..643397247 100644 --- a/DiscImageChef.Tests/Filesystems/UFS_NeXT_Floppy.cs +++ b/DiscImageChef.Tests/Filesystems/UFS_NeXT_Floppy.cs @@ -29,9 +29,9 @@ using System.Collections.Generic; using System.IO; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using NUnit.Framework; namespace DiscImageChef.Tests.Filesystems @@ -74,7 +74,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin(); + Filesystem fs = new FFSPlugin(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "4.3BSD" || partitions[j].Type == "4.4BSD") diff --git a/DiscImageChef.Tests/Filesystems/UFS_RDB.cs b/DiscImageChef.Tests/Filesystems/UFS_RDB.cs index 48fcfa223..670a441e8 100644 --- a/DiscImageChef.Tests/Filesystems/UFS_RDB.cs +++ b/DiscImageChef.Tests/Filesystems/UFS_RDB.cs @@ -68,7 +68,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin(); + Filesystem fs = new FFSPlugin(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "\"UNI\\2\"") diff --git a/DiscImageChef.Tests/Filesystems/UFS_Suni86.cs b/DiscImageChef.Tests/Filesystems/UFS_Suni86.cs index 5d28cff8a..787390183 100644 --- a/DiscImageChef.Tests/Filesystems/UFS_Suni86.cs +++ b/DiscImageChef.Tests/Filesystems/UFS_Suni86.cs @@ -68,7 +68,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin(); + Filesystem fs = new FFSPlugin(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "Replacement sectors") diff --git a/DiscImageChef.Tests/Filesystems/UNIXBFS.cs b/DiscImageChef.Tests/Filesystems/UNIXBFS.cs index f82b94d8c..df9e01dca 100644 --- a/DiscImageChef.Tests/Filesystems/UNIXBFS.cs +++ b/DiscImageChef.Tests/Filesystems/UNIXBFS.cs @@ -28,9 +28,9 @@ using System.IO; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using NUnit.Framework; namespace DiscImageChef.Tests.Filesystems @@ -73,7 +73,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(mediatypes[i], image.ImageInfo.MediaType, testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); - Filesystem fs = new DiscImageChef.Filesystems.BFS(); + Filesystem fs = new BFS(); Partition wholePart = new Partition { Name = "Whole device", diff --git a/DiscImageChef.Tests/Filesystems/UNIXBFS_MBR.cs b/DiscImageChef.Tests/Filesystems/UNIXBFS_MBR.cs index 3f040f153..b119c821c 100644 --- a/DiscImageChef.Tests/Filesystems/UNIXBFS_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/UNIXBFS_MBR.cs @@ -64,7 +64,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.BFS(); + Filesystem fs = new BFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "0x83") diff --git a/DiscImageChef.Tests/Filesystems/UNIXBFS_RDB.cs b/DiscImageChef.Tests/Filesystems/UNIXBFS_RDB.cs index 329063b32..080dab9bc 100644 --- a/DiscImageChef.Tests/Filesystems/UNIXBFS_RDB.cs +++ b/DiscImageChef.Tests/Filesystems/UNIXBFS_RDB.cs @@ -68,7 +68,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.BFS(); + Filesystem fs = new BFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "\"UNI\\0\"") diff --git a/DiscImageChef.Tests/Filesystems/XENIX.cs b/DiscImageChef.Tests/Filesystems/XENIX.cs index 4e66f3a6f..779696d2f 100644 --- a/DiscImageChef.Tests/Filesystems/XENIX.cs +++ b/DiscImageChef.Tests/Filesystems/XENIX.cs @@ -28,9 +28,9 @@ using System.IO; using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using NUnit.Framework; namespace DiscImageChef.Tests.Filesystems @@ -75,7 +75,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(mediatypes[i], image.ImageInfo.MediaType, testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); - Filesystem fs = new DiscImageChef.Filesystems.SysVfs(); + Filesystem fs = new SysVfs(); Partition wholePart = new Partition { Name = "Whole device", diff --git a/DiscImageChef.Tests/Filesystems/XENIX_MBR.cs b/DiscImageChef.Tests/Filesystems/XENIX_MBR.cs index a29691532..194396856 100644 --- a/DiscImageChef.Tests/Filesystems/XENIX_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/XENIX_MBR.cs @@ -68,7 +68,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.SysVfs(); + Filesystem fs = new SysVfs(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "XENIX") diff --git a/DiscImageChef.Tests/Filesystems/XFS_MBR.cs b/DiscImageChef.Tests/Filesystems/XFS_MBR.cs index 5cb3f5e5e..8e01185d6 100644 --- a/DiscImageChef.Tests/Filesystems/XFS_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/XFS_MBR.cs @@ -66,7 +66,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.XFS(); + Filesystem fs = new XFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "0x83") diff --git a/DiscImageChef.Tests/Filesystems/btrfs.cs b/DiscImageChef.Tests/Filesystems/btrfs.cs index 995b27be1..21acb435c 100644 --- a/DiscImageChef.Tests/Filesystems/btrfs.cs +++ b/DiscImageChef.Tests/Filesystems/btrfs.cs @@ -68,7 +68,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); PartitionPlugin parts = new MBR(); Assert.AreEqual(true, parts.GetInformation(image, out List partitions, 0), testfiles[i]); - Filesystem fs = new DiscImageChef.Filesystems.BTRFS(); + Filesystem fs = new BTRFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "0x83") diff --git a/DiscImageChef.Tests/Filesystems/exFAT_APM.cs b/DiscImageChef.Tests/Filesystems/exFAT_APM.cs index c8c8ab073..37177ef54 100644 --- a/DiscImageChef.Tests/Filesystems/exFAT_APM.cs +++ b/DiscImageChef.Tests/Filesystems/exFAT_APM.cs @@ -66,7 +66,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.exFAT(); + Filesystem fs = new exFAT(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "Windows_NTFS") diff --git a/DiscImageChef.Tests/Filesystems/exFAT_GPT.cs b/DiscImageChef.Tests/Filesystems/exFAT_GPT.cs index 0579c928b..d383c8813 100644 --- a/DiscImageChef.Tests/Filesystems/exFAT_GPT.cs +++ b/DiscImageChef.Tests/Filesystems/exFAT_GPT.cs @@ -66,7 +66,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.exFAT(); + Filesystem fs = new exFAT(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "Microsoft Basic data") diff --git a/DiscImageChef.Tests/Filesystems/exFAT_MBR.cs b/DiscImageChef.Tests/Filesystems/exFAT_MBR.cs index c4386db48..af4cfd82b 100644 --- a/DiscImageChef.Tests/Filesystems/exFAT_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/exFAT_MBR.cs @@ -66,7 +66,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); List partitions = Core.Partitions.GetAll(image); - Filesystem fs = new DiscImageChef.Filesystems.exFAT(); + Filesystem fs = new exFAT(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "0x07") diff --git a/DiscImageChef.Tests/Filesystems/ext2.cs b/DiscImageChef.Tests/Filesystems/ext2.cs index e1161389a..fdc1fff31 100644 --- a/DiscImageChef.Tests/Filesystems/ext2.cs +++ b/DiscImageChef.Tests/Filesystems/ext2.cs @@ -78,7 +78,7 @@ namespace DiscImageChef.Tests.Filesystems Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); PartitionPlugin parts = new MBR(); Assert.AreEqual(true, parts.GetInformation(image, out List partitions, 0), testfiles[i]); - Filesystem fs = new DiscImageChef.Filesystems.ext2FS(); + Filesystem fs = new ext2FS(); int part = -1; for(int j = 0; j < partitions.Count; j++) if(partitions[j].Type == "0x83") diff --git a/DiscImageChef.Tests/Filters/AppleDoubleDave.cs b/DiscImageChef.Tests/Filters/AppleDoubleDave.cs index e256a67b4..a5d93b9c7 100644 --- a/DiscImageChef.Tests/Filters/AppleDoubleDave.cs +++ b/DiscImageChef.Tests/Filters/AppleDoubleDave.cs @@ -67,14 +67,14 @@ namespace DiscImageChef.Tests.Filters [Test] public void CheckFilterId() { - Filter filter = new DiscImageChef.Filters.AppleDouble(); + Filter filter = new AppleDouble(); Assert.AreEqual(true, filter.Identify(location)); } [Test] public void Test() { - Filter filter = new DiscImageChef.Filters.AppleDouble(); + Filter filter = new AppleDouble(); filter.Open(location); Assert.AreEqual(true, filter.IsOpened()); Assert.AreEqual(737280, filter.GetDataForkLength()); @@ -88,7 +88,7 @@ namespace DiscImageChef.Tests.Filters [Test] public void CheckContents() { - Filter filter = new DiscImageChef.Filters.AppleDouble(); + Filter filter = new AppleDouble(); filter.Open(location); Stream str = filter.GetDataForkStream(); byte[] data = new byte[737280]; @@ -105,7 +105,7 @@ namespace DiscImageChef.Tests.Filters [Test] public void CheckResource() { - Filter filter = new DiscImageChef.Filters.AppleDouble(); + Filter filter = new AppleDouble(); filter.Open(location); Stream str = filter.GetResourceForkStream(); byte[] data = new byte[286]; diff --git a/DiscImageChef.Tests/Filters/AppleDoubleDos.cs b/DiscImageChef.Tests/Filters/AppleDoubleDos.cs index 8d7792f63..aa4be4847 100644 --- a/DiscImageChef.Tests/Filters/AppleDoubleDos.cs +++ b/DiscImageChef.Tests/Filters/AppleDoubleDos.cs @@ -66,14 +66,14 @@ namespace DiscImageChef.Tests.Filters [Test] public void CheckFilterId() { - Filter filter = new DiscImageChef.Filters.AppleDouble(); + Filter filter = new AppleDouble(); Assert.AreEqual(true, filter.Identify(location)); } [Test] public void Test() { - Filter filter = new DiscImageChef.Filters.AppleDouble(); + Filter filter = new AppleDouble(); filter.Open(location); Assert.AreEqual(true, filter.IsOpened()); Assert.AreEqual(737280, filter.GetDataForkLength()); @@ -87,7 +87,7 @@ namespace DiscImageChef.Tests.Filters [Test] public void CheckContents() { - Filter filter = new DiscImageChef.Filters.AppleDouble(); + Filter filter = new AppleDouble(); filter.Open(location); Stream str = filter.GetDataForkStream(); byte[] data = new byte[737280]; @@ -104,7 +104,7 @@ namespace DiscImageChef.Tests.Filters [Test] public void CheckResource() { - Filter filter = new DiscImageChef.Filters.AppleDouble(); + Filter filter = new AppleDouble(); filter.Open(location); Stream str = filter.GetResourceForkStream(); byte[] data = new byte[286]; diff --git a/DiscImageChef.Tests/Filters/AppleDoubleNetatalk.cs b/DiscImageChef.Tests/Filters/AppleDoubleNetatalk.cs index 2ee2c7300..2892014fa 100644 --- a/DiscImageChef.Tests/Filters/AppleDoubleNetatalk.cs +++ b/DiscImageChef.Tests/Filters/AppleDoubleNetatalk.cs @@ -67,14 +67,14 @@ namespace DiscImageChef.Tests.Filters [Test] public void CheckFilterId() { - Filter filter = new DiscImageChef.Filters.AppleDouble(); + Filter filter = new AppleDouble(); Assert.AreEqual(true, filter.Identify(location)); } [Test] public void Test() { - Filter filter = new DiscImageChef.Filters.AppleDouble(); + Filter filter = new AppleDouble(); filter.Open(location); Assert.AreEqual(true, filter.IsOpened()); Assert.AreEqual(737280, filter.GetDataForkLength()); @@ -88,7 +88,7 @@ namespace DiscImageChef.Tests.Filters [Test] public void CheckContents() { - Filter filter = new DiscImageChef.Filters.AppleDouble(); + Filter filter = new AppleDouble(); filter.Open(location); Stream str = filter.GetDataForkStream(); byte[] data = new byte[737280]; @@ -105,7 +105,7 @@ namespace DiscImageChef.Tests.Filters [Test] public void CheckResource() { - Filter filter = new DiscImageChef.Filters.AppleDouble(); + Filter filter = new AppleDouble(); filter.Open(location); Stream str = filter.GetResourceForkStream(); byte[] data = new byte[286]; diff --git a/DiscImageChef.Tests/Filters/AppleDoubleOsX.cs b/DiscImageChef.Tests/Filters/AppleDoubleOsX.cs index 5f6e5b8a2..455e11fb2 100644 --- a/DiscImageChef.Tests/Filters/AppleDoubleOsX.cs +++ b/DiscImageChef.Tests/Filters/AppleDoubleOsX.cs @@ -66,14 +66,14 @@ namespace DiscImageChef.Tests.Filters [Test] public void CheckFilterId() { - Filter filter = new DiscImageChef.Filters.AppleDouble(); + Filter filter = new AppleDouble(); Assert.AreEqual(true, filter.Identify(location)); } [Test] public void Test() { - Filter filter = new DiscImageChef.Filters.AppleDouble(); + Filter filter = new AppleDouble(); filter.Open(location); Assert.AreEqual(true, filter.IsOpened()); Assert.AreEqual(737280, filter.GetDataForkLength()); @@ -87,7 +87,7 @@ namespace DiscImageChef.Tests.Filters [Test] public void CheckContents() { - Filter filter = new DiscImageChef.Filters.AppleDouble(); + Filter filter = new AppleDouble(); filter.Open(location); Stream str = filter.GetDataForkStream(); byte[] data = new byte[737280]; @@ -104,7 +104,7 @@ namespace DiscImageChef.Tests.Filters [Test] public void CheckResource() { - Filter filter = new DiscImageChef.Filters.AppleDouble(); + Filter filter = new AppleDouble(); filter.Open(location); Stream str = filter.GetResourceForkStream(); byte[] data = new byte[286]; diff --git a/DiscImageChef.Tests/Filters/AppleDoubleProDos.cs b/DiscImageChef.Tests/Filters/AppleDoubleProDos.cs index 19e0f6b20..bf4051811 100644 --- a/DiscImageChef.Tests/Filters/AppleDoubleProDos.cs +++ b/DiscImageChef.Tests/Filters/AppleDoubleProDos.cs @@ -66,14 +66,14 @@ namespace DiscImageChef.Tests.Filters [Test] public void CheckFilterId() { - Filter filter = new DiscImageChef.Filters.AppleDouble(); + Filter filter = new AppleDouble(); Assert.AreEqual(true, filter.Identify(location)); } [Test] public void Test() { - Filter filter = new DiscImageChef.Filters.AppleDouble(); + Filter filter = new AppleDouble(); filter.Open(location); Assert.AreEqual(true, filter.IsOpened()); Assert.AreEqual(737280, filter.GetDataForkLength()); @@ -87,7 +87,7 @@ namespace DiscImageChef.Tests.Filters [Test] public void CheckContents() { - Filter filter = new DiscImageChef.Filters.AppleDouble(); + Filter filter = new AppleDouble(); filter.Open(location); Stream str = filter.GetDataForkStream(); byte[] data = new byte[737280]; @@ -104,7 +104,7 @@ namespace DiscImageChef.Tests.Filters [Test] public void CheckResource() { - Filter filter = new DiscImageChef.Filters.AppleDouble(); + Filter filter = new AppleDouble(); filter.Open(location); Stream str = filter.GetResourceForkStream(); byte[] data = new byte[286]; diff --git a/DiscImageChef.Tests/Filters/AppleDoubleUnAr.cs b/DiscImageChef.Tests/Filters/AppleDoubleUnAr.cs index 6a8316e19..e296c0688 100644 --- a/DiscImageChef.Tests/Filters/AppleDoubleUnAr.cs +++ b/DiscImageChef.Tests/Filters/AppleDoubleUnAr.cs @@ -66,14 +66,14 @@ namespace DiscImageChef.Tests.Filters [Test] public void CheckFilterId() { - Filter filter = new DiscImageChef.Filters.AppleDouble(); + Filter filter = new AppleDouble(); Assert.AreEqual(true, filter.Identify(location)); } [Test] public void Test() { - Filter filter = new DiscImageChef.Filters.AppleDouble(); + Filter filter = new AppleDouble(); filter.Open(location); Assert.AreEqual(true, filter.IsOpened()); Assert.AreEqual(737280, filter.GetDataForkLength()); @@ -87,7 +87,7 @@ namespace DiscImageChef.Tests.Filters [Test] public void CheckContents() { - Filter filter = new DiscImageChef.Filters.AppleDouble(); + Filter filter = new AppleDouble(); filter.Open(location); Stream str = filter.GetDataForkStream(); byte[] data = new byte[737280]; @@ -104,7 +104,7 @@ namespace DiscImageChef.Tests.Filters [Test] public void CheckResource() { - Filter filter = new DiscImageChef.Filters.AppleDouble(); + Filter filter = new AppleDouble(); filter.Open(location); Stream str = filter.GetResourceForkStream(); byte[] data = new byte[286]; diff --git a/DiscImageChef.Tests/Filters/AppleDoubleUnix.cs b/DiscImageChef.Tests/Filters/AppleDoubleUnix.cs index fe0989588..c7b812096 100644 --- a/DiscImageChef.Tests/Filters/AppleDoubleUnix.cs +++ b/DiscImageChef.Tests/Filters/AppleDoubleUnix.cs @@ -66,14 +66,14 @@ namespace DiscImageChef.Tests.Filters [Test] public void CheckFilterId() { - Filter filter = new DiscImageChef.Filters.AppleDouble(); + Filter filter = new AppleDouble(); Assert.AreEqual(true, filter.Identify(location)); } [Test] public void Test() { - Filter filter = new DiscImageChef.Filters.AppleDouble(); + Filter filter = new AppleDouble(); filter.Open(location); Assert.AreEqual(true, filter.IsOpened()); Assert.AreEqual(737280, filter.GetDataForkLength()); @@ -87,7 +87,7 @@ namespace DiscImageChef.Tests.Filters [Test] public void CheckContents() { - Filter filter = new DiscImageChef.Filters.AppleDouble(); + Filter filter = new AppleDouble(); filter.Open(location); Stream str = filter.GetDataForkStream(); byte[] data = new byte[737280]; @@ -104,7 +104,7 @@ namespace DiscImageChef.Tests.Filters [Test] public void CheckResource() { - Filter filter = new DiscImageChef.Filters.AppleDouble(); + Filter filter = new AppleDouble(); filter.Open(location); Stream str = filter.GetResourceForkStream(); byte[] data = new byte[286]; diff --git a/DiscImageChef.Tests/Filters/MacBinary2.cs b/DiscImageChef.Tests/Filters/MacBinary2.cs index c6686c50e..b0f09ebc4 100644 --- a/DiscImageChef.Tests/Filters/MacBinary2.cs +++ b/DiscImageChef.Tests/Filters/MacBinary2.cs @@ -58,14 +58,14 @@ namespace DiscImageChef.Tests.Filters [Test] public void CheckFilterId() { - Filter filter = new DiscImageChef.Filters.MacBinary(); + Filter filter = new MacBinary(); Assert.AreEqual(true, filter.Identify(location)); } [Test] public void Test() { - Filter filter = new DiscImageChef.Filters.MacBinary(); + Filter filter = new MacBinary(); filter.Open(location); Assert.AreEqual(true, filter.IsOpened()); Assert.AreEqual(737280, filter.GetDataForkLength()); @@ -79,7 +79,7 @@ namespace DiscImageChef.Tests.Filters [Test] public void CheckContents() { - Filter filter = new DiscImageChef.Filters.MacBinary(); + Filter filter = new MacBinary(); filter.Open(location); Stream str = filter.GetDataForkStream(); byte[] data = new byte[737280]; @@ -96,7 +96,7 @@ namespace DiscImageChef.Tests.Filters [Test] public void CheckResource() { - Filter filter = new DiscImageChef.Filters.MacBinary(); + Filter filter = new MacBinary(); filter.Open(location); Stream str = filter.GetResourceForkStream(); byte[] data = new byte[286]; diff --git a/DiscImageChef.Tests/Filters/MacBinary3.cs b/DiscImageChef.Tests/Filters/MacBinary3.cs index d17d5d80d..ab8e470a4 100644 --- a/DiscImageChef.Tests/Filters/MacBinary3.cs +++ b/DiscImageChef.Tests/Filters/MacBinary3.cs @@ -58,14 +58,14 @@ namespace DiscImageChef.Tests.Filters [Test] public void CheckFilterId() { - Filter filter = new DiscImageChef.Filters.MacBinary(); + Filter filter = new MacBinary(); Assert.AreEqual(true, filter.Identify(location)); } [Test] public void Test() { - Filter filter = new DiscImageChef.Filters.MacBinary(); + Filter filter = new MacBinary(); filter.Open(location); Assert.AreEqual(true, filter.IsOpened()); Assert.AreEqual(737280, filter.GetDataForkLength()); @@ -79,7 +79,7 @@ namespace DiscImageChef.Tests.Filters [Test] public void CheckContents() { - Filter filter = new DiscImageChef.Filters.MacBinary(); + Filter filter = new MacBinary(); filter.Open(location); Stream str = filter.GetDataForkStream(); byte[] data = new byte[737280]; @@ -96,7 +96,7 @@ namespace DiscImageChef.Tests.Filters [Test] public void CheckResource() { - Filter filter = new DiscImageChef.Filters.MacBinary(); + Filter filter = new MacBinary(); filter.Open(location); Stream str = filter.GetResourceForkStream(); byte[] data = new byte[286]; diff --git a/DiscImageChef.Tests/Images/2MG.cs b/DiscImageChef.Tests/Images/2MG.cs index b65937c6e..e38ad28de 100644 --- a/DiscImageChef.Tests/Images/2MG.cs +++ b/DiscImageChef.Tests/Images/2MG.cs @@ -29,8 +29,8 @@ using System.IO; using DiscImageChef.Checksums; using DiscImageChef.CommonTypes; -using DiscImageChef.Filters; using DiscImageChef.DiscImages; +using DiscImageChef.Filters; using NUnit.Framework; namespace DiscImageChef.Tests.Images @@ -68,7 +68,7 @@ namespace DiscImageChef.Tests.Images string location = Path.Combine(Consts.TestFilesRoot, "images", "2mg", testfiles[i]); Filter filter = new LZip(); filter.Open(location); - ImagePlugin image = new DiscImageChef.DiscImages.Apple2Mg(); + ImagePlugin image = new Apple2Mg(); Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); diff --git a/DiscImageChef.Tests/Images/Anex86.cs b/DiscImageChef.Tests/Images/Anex86.cs index 41da449d2..27a74f8a8 100644 --- a/DiscImageChef.Tests/Images/Anex86.cs +++ b/DiscImageChef.Tests/Images/Anex86.cs @@ -29,8 +29,8 @@ using System.IO; using DiscImageChef.Checksums; using DiscImageChef.CommonTypes; -using DiscImageChef.Filters; using DiscImageChef.DiscImages; +using DiscImageChef.Filters; using NUnit.Framework; namespace DiscImageChef.Tests.Images @@ -72,7 +72,7 @@ namespace DiscImageChef.Tests.Images string location = Path.Combine(Consts.TestFilesRoot, "images", "anex86", testfiles[i]); Filter filter = new LZip(); filter.Open(location); - ImagePlugin image = new DiscImageChef.DiscImages.Anex86(); + ImagePlugin image = new DiscImages.Anex86(); Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); diff --git a/DiscImageChef.Tests/Images/CisCopy.cs b/DiscImageChef.Tests/Images/CisCopy.cs index c98a06fb5..3e4788688 100644 --- a/DiscImageChef.Tests/Images/CisCopy.cs +++ b/DiscImageChef.Tests/Images/CisCopy.cs @@ -29,8 +29,8 @@ using System.IO; using DiscImageChef.Checksums; using DiscImageChef.CommonTypes; -using DiscImageChef.Filters; using DiscImageChef.DiscImages; +using DiscImageChef.Filters; using NUnit.Framework; namespace DiscImageChef.Tests.Images @@ -86,7 +86,7 @@ namespace DiscImageChef.Tests.Images string location = Path.Combine(Consts.TestFilesRoot, "images", "ciscopy", testfiles[i]); Filter filter = new LZip(); filter.Open(location); - ImagePlugin image = new DiscImageChef.DiscImages.CisCopy(); + ImagePlugin image = new DiscImages.CisCopy(); Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); diff --git a/DiscImageChef.Tests/Images/CopyQM.cs b/DiscImageChef.Tests/Images/CopyQM.cs index 14af20fe5..7ac412131 100644 --- a/DiscImageChef.Tests/Images/CopyQM.cs +++ b/DiscImageChef.Tests/Images/CopyQM.cs @@ -29,8 +29,8 @@ using System.IO; using DiscImageChef.Checksums; using DiscImageChef.CommonTypes; -using DiscImageChef.Filters; using DiscImageChef.DiscImages; +using DiscImageChef.Filters; using NUnit.Framework; namespace DiscImageChef.Tests.Images @@ -70,7 +70,7 @@ namespace DiscImageChef.Tests.Images string location = Path.Combine(Consts.TestFilesRoot, "images", "copyqm", testfiles[i]); Filter filter = new LZip(); filter.Open(location); - ImagePlugin image = new DiscImageChef.DiscImages.CopyQm(); + ImagePlugin image = new CopyQm(); Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); diff --git a/DiscImageChef.Tests/Images/D88.cs b/DiscImageChef.Tests/Images/D88.cs index ebe075430..9b3263d63 100644 --- a/DiscImageChef.Tests/Images/D88.cs +++ b/DiscImageChef.Tests/Images/D88.cs @@ -29,8 +29,8 @@ using System.IO; using DiscImageChef.Checksums; using DiscImageChef.CommonTypes; -using DiscImageChef.Filters; using DiscImageChef.DiscImages; +using DiscImageChef.Filters; using NUnit.Framework; namespace DiscImageChef.Tests.Images @@ -88,7 +88,7 @@ namespace DiscImageChef.Tests.Images string location = Path.Combine(Consts.TestFilesRoot, "images", "d88", testfiles[i]); Filter filter = new LZip(); filter.Open(location); - ImagePlugin image = new DiscImageChef.DiscImages.D88(); + ImagePlugin image = new DiscImages.D88(); Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); diff --git a/DiscImageChef.Tests/Images/DART.cs b/DiscImageChef.Tests/Images/DART.cs index e423a1e2d..708a6dbf9 100644 --- a/DiscImageChef.Tests/Images/DART.cs +++ b/DiscImageChef.Tests/Images/DART.cs @@ -29,8 +29,8 @@ using System.IO; using DiscImageChef.Checksums; using DiscImageChef.CommonTypes; -using DiscImageChef.Filters; using DiscImageChef.DiscImages; +using DiscImageChef.Filters; using NUnit.Framework; namespace DiscImageChef.Tests.Images @@ -69,7 +69,7 @@ namespace DiscImageChef.Tests.Images string location = Path.Combine(Consts.TestFilesRoot, "images", "dart", testfiles[i]); Filter filter = new LZip(); filter.Open(location); - ImagePlugin image = new DiscImageChef.DiscImages.D88(); + ImagePlugin image = new DiscImages.D88(); Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); diff --git a/DiscImageChef.Tests/Images/DiskCopy42.cs b/DiscImageChef.Tests/Images/DiskCopy42.cs index 91bc3b871..e055f0bdd 100644 --- a/DiscImageChef.Tests/Images/DiskCopy42.cs +++ b/DiscImageChef.Tests/Images/DiskCopy42.cs @@ -29,8 +29,8 @@ using System.IO; using DiscImageChef.Checksums; using DiscImageChef.CommonTypes; -using DiscImageChef.Filters; using DiscImageChef.DiscImages; +using DiscImageChef.Filters; using NUnit.Framework; namespace DiscImageChef.Tests.Images @@ -89,7 +89,7 @@ namespace DiscImageChef.Tests.Images string location = Path.Combine(Consts.TestFilesRoot, "images", "", testfiles[i]); Filter filter = new LZip(); filter.Open(location); - ImagePlugin image = new DiscImageChef.DiscImages.DiskCopy42(); + ImagePlugin image = new DiscImages.DiskCopy42(); Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]); diff --git a/DiscImageChef.Tests/Partitions/PC98.cs b/DiscImageChef.Tests/Partitions/PC98.cs index a64c3e44b..80333e823 100644 --- a/DiscImageChef.Tests/Partitions/PC98.cs +++ b/DiscImageChef.Tests/Partitions/PC98.cs @@ -29,8 +29,8 @@ using System.Collections.Generic; using System.IO; using DiscImageChef.CommonTypes; -using DiscImageChef.Filters; using DiscImageChef.DiscImages; +using DiscImageChef.Filters; using NUnit.Framework; namespace DiscImageChef.Tests.Partitions diff --git a/DiscImageChef/Commands/Analyze.cs b/DiscImageChef/Commands/Analyze.cs index 7bbfdb283..401471b4c 100644 --- a/DiscImageChef/Commands/Analyze.cs +++ b/DiscImageChef/Commands/Analyze.cs @@ -36,9 +36,9 @@ using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.Core; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; namespace DiscImageChef.Commands { diff --git a/DiscImageChef/Commands/Checksum.cs b/DiscImageChef/Commands/Checksum.cs index 553a3d494..2ccf3564d 100644 --- a/DiscImageChef/Commands/Checksum.cs +++ b/DiscImageChef/Commands/Checksum.cs @@ -34,8 +34,8 @@ using System; using System.Collections.Generic; using DiscImageChef.Console; using DiscImageChef.Core; -using DiscImageChef.Filters; using DiscImageChef.DiscImages; +using DiscImageChef.Filters; using Schemas; namespace DiscImageChef.Commands diff --git a/DiscImageChef/Commands/Compare.cs b/DiscImageChef/Commands/Compare.cs index bf3699b6d..2c91b581f 100644 --- a/DiscImageChef/Commands/Compare.cs +++ b/DiscImageChef/Commands/Compare.cs @@ -35,8 +35,8 @@ using System.Collections.Generic; using System.Text; using DiscImageChef.Console; using DiscImageChef.Core; -using DiscImageChef.Filters; using DiscImageChef.DiscImages; +using DiscImageChef.Filters; namespace DiscImageChef.Commands { diff --git a/DiscImageChef/Commands/CreateSidecar.cs b/DiscImageChef/Commands/CreateSidecar.cs index 09f76a40a..367c69f3f 100644 --- a/DiscImageChef/Commands/CreateSidecar.cs +++ b/DiscImageChef/Commands/CreateSidecar.cs @@ -35,10 +35,11 @@ using System.Collections.Generic; using System.IO; using System.Linq; using System.Text; +using System.Xml.Serialization; using DiscImageChef.Console; using DiscImageChef.Core; -using DiscImageChef.Filters; using DiscImageChef.DiscImages; +using DiscImageChef.Filters; using Schemas; namespace DiscImageChef.Commands @@ -135,8 +136,8 @@ namespace DiscImageChef.Commands FileStream(Path.Combine(Path.GetDirectoryName(options.InputFile), Path.GetFileNameWithoutExtension(options.InputFile) + ".cicm.xml"), FileMode.CreateNew); - System.Xml.Serialization.XmlSerializer xmlSer = - new System.Xml.Serialization.XmlSerializer(typeof(CICMMetadataType)); + XmlSerializer xmlSer = + new XmlSerializer(typeof(CICMMetadataType)); xmlSer.Serialize(xmlFs, sidecar); xmlFs.Close(); @@ -171,8 +172,8 @@ namespace DiscImageChef.Commands FileStream(Path.Combine(Path.GetDirectoryName(options.InputFile), Path.GetFileNameWithoutExtension(options.InputFile) + ".cicm.xml"), FileMode.CreateNew); - System.Xml.Serialization.XmlSerializer xmlSer = - new System.Xml.Serialization.XmlSerializer(typeof(CICMMetadataType)); + XmlSerializer xmlSer = + new XmlSerializer(typeof(CICMMetadataType)); xmlSer.Serialize(xmlFs, sidecar); xmlFs.Close(); @@ -181,7 +182,6 @@ namespace DiscImageChef.Commands else { DicConsole.ErrorWriteLine("The specified input file cannot be found."); - return; } } } diff --git a/DiscImageChef/Commands/Decode.cs b/DiscImageChef/Commands/Decode.cs index cffc73a97..be625f277 100644 --- a/DiscImageChef/Commands/Decode.cs +++ b/DiscImageChef/Commands/Decode.cs @@ -32,8 +32,12 @@ using DiscImageChef.Console; using DiscImageChef.Core; -using DiscImageChef.Filters; +using DiscImageChef.Decoders.ATA; +using DiscImageChef.Decoders.CD; +using DiscImageChef.Decoders.SCSI; using DiscImageChef.DiscImages; +using DiscImageChef.Filters; +using Session = DiscImageChef.Decoders.CD.Session; namespace DiscImageChef.Commands { @@ -88,7 +92,7 @@ namespace DiscImageChef.Commands DicConsole.WriteLine("SCSI INQUIRY command response:"); DicConsole .WriteLine("================================================================================"); - DicConsole.WriteLine(Decoders.SCSI.Inquiry.Prettify(inquiry)); + DicConsole.WriteLine(Inquiry.Prettify(inquiry)); DicConsole .WriteLine("================================================================================"); } @@ -104,7 +108,7 @@ namespace DiscImageChef.Commands DicConsole.WriteLine("ATA IDENTIFY DEVICE command response:"); DicConsole .WriteLine("================================================================================"); - DicConsole.WriteLine(Decoders.ATA.Identify.Prettify(identify)); + DicConsole.WriteLine(Identify.Prettify(identify)); DicConsole .WriteLine("================================================================================"); } @@ -121,7 +125,7 @@ namespace DiscImageChef.Commands DicConsole.WriteLine("ATA IDENTIFY PACKET DEVICE command response:"); DicConsole .WriteLine("================================================================================"); - DicConsole.WriteLine(Decoders.ATA.Identify.Prettify(identify)); + DicConsole.WriteLine(Identify.Prettify(identify)); DicConsole .WriteLine("================================================================================"); } @@ -136,7 +140,7 @@ namespace DiscImageChef.Commands DicConsole.WriteLine("CD ATIP:"); DicConsole .WriteLine("================================================================================"); - DicConsole.WriteLine(Decoders.CD.ATIP.Prettify(atip)); + DicConsole.WriteLine(ATIP.Prettify(atip)); DicConsole .WriteLine("================================================================================"); } @@ -151,7 +155,7 @@ namespace DiscImageChef.Commands DicConsole.WriteLine("CD full TOC:"); DicConsole .WriteLine("================================================================================"); - DicConsole.WriteLine(Decoders.CD.FullTOC.Prettify(fulltoc)); + DicConsole.WriteLine(FullTOC.Prettify(fulltoc)); DicConsole .WriteLine("================================================================================"); } @@ -166,7 +170,7 @@ namespace DiscImageChef.Commands DicConsole.WriteLine("CD PMA:"); DicConsole .WriteLine("================================================================================"); - DicConsole.WriteLine(Decoders.CD.PMA.Prettify(pma)); + DicConsole.WriteLine(PMA.Prettify(pma)); DicConsole .WriteLine("================================================================================"); } @@ -182,7 +186,7 @@ namespace DiscImageChef.Commands DicConsole.WriteLine("CD session information:"); DicConsole .WriteLine("================================================================================"); - DicConsole.WriteLine(Decoders.CD.Session.Prettify(sessioninfo)); + DicConsole.WriteLine(Session.Prettify(sessioninfo)); DicConsole .WriteLine("================================================================================"); } @@ -197,7 +201,7 @@ namespace DiscImageChef.Commands DicConsole.WriteLine("CD-TEXT:"); DicConsole .WriteLine("================================================================================"); - DicConsole.WriteLine(Decoders.CD.CDTextOnLeadIn.Prettify(cdtext)); + DicConsole.WriteLine(CDTextOnLeadIn.Prettify(cdtext)); DicConsole .WriteLine("================================================================================"); } @@ -212,7 +216,7 @@ namespace DiscImageChef.Commands DicConsole.WriteLine("CD TOC:"); DicConsole .WriteLine("================================================================================"); - DicConsole.WriteLine(Decoders.CD.TOC.Prettify(toc)); + DicConsole.WriteLine(TOC.Prettify(toc)); DicConsole .WriteLine("================================================================================"); } diff --git a/DiscImageChef/Commands/DeviceInfo.cs b/DiscImageChef/Commands/DeviceInfo.cs index 4ee811ac0..5aac8411a 100644 --- a/DiscImageChef/Commands/DeviceInfo.cs +++ b/DiscImageChef/Commands/DeviceInfo.cs @@ -34,7 +34,12 @@ using System; using DiscImageChef.Console; using DiscImageChef.Core; using DiscImageChef.Decoders.ATA; +using DiscImageChef.Decoders.PCMCIA; +using DiscImageChef.Decoders.SCSI; +using DiscImageChef.Decoders.SCSI.MMC; +using DiscImageChef.Decoders.SCSI.SSC; using DiscImageChef.Devices; +using Tuple = DiscImageChef.Decoders.PCMCIA.Tuple; namespace DiscImageChef.Commands { @@ -88,59 +93,59 @@ namespace DiscImageChef.Commands { DicConsole.WriteLine("PCMCIA device"); DicConsole.WriteLine("PCMCIA CIS is {0} bytes", dev.Cis.Length); - Decoders.PCMCIA.Tuple[] tuples = Decoders.PCMCIA.CIS.GetTuples(dev.Cis); + Tuple[] tuples = CIS.GetTuples(dev.Cis); if(tuples != null) - foreach(Decoders.PCMCIA.Tuple tuple in tuples) + foreach(Tuple tuple in tuples) switch(tuple.Code) { - case Decoders.PCMCIA.TupleCodes.CISTPL_NULL: - case Decoders.PCMCIA.TupleCodes.CISTPL_END: break; - case Decoders.PCMCIA.TupleCodes.CISTPL_DEVICEGEO: - case Decoders.PCMCIA.TupleCodes.CISTPL_DEVICEGEO_A: - DicConsole.WriteLine("{0}", Decoders.PCMCIA.CIS.PrettifyDeviceGeometryTuple(tuple)); + case TupleCodes.CISTPL_NULL: + case TupleCodes.CISTPL_END: break; + case TupleCodes.CISTPL_DEVICEGEO: + case TupleCodes.CISTPL_DEVICEGEO_A: + DicConsole.WriteLine("{0}", CIS.PrettifyDeviceGeometryTuple(tuple)); break; - case Decoders.PCMCIA.TupleCodes.CISTPL_MANFID: + case TupleCodes.CISTPL_MANFID: DicConsole.WriteLine("{0}", - Decoders.PCMCIA.CIS + CIS .PrettifyManufacturerIdentificationTuple(tuple)); break; - case Decoders.PCMCIA.TupleCodes.CISTPL_VERS_1: - DicConsole.WriteLine("{0}", Decoders.PCMCIA.CIS.PrettifyLevel1VersionTuple(tuple)); + case TupleCodes.CISTPL_VERS_1: + DicConsole.WriteLine("{0}", CIS.PrettifyLevel1VersionTuple(tuple)); break; - case Decoders.PCMCIA.TupleCodes.CISTPL_ALTSTR: - case Decoders.PCMCIA.TupleCodes.CISTPL_BAR: - case Decoders.PCMCIA.TupleCodes.CISTPL_BATTERY: - case Decoders.PCMCIA.TupleCodes.CISTPL_BYTEORDER: - case Decoders.PCMCIA.TupleCodes.CISTPL_CFTABLE_ENTRY: - case Decoders.PCMCIA.TupleCodes.CISTPL_CFTABLE_ENTRY_CB: - case Decoders.PCMCIA.TupleCodes.CISTPL_CHECKSUM: - case Decoders.PCMCIA.TupleCodes.CISTPL_CONFIG: - case Decoders.PCMCIA.TupleCodes.CISTPL_CONFIG_CB: - case Decoders.PCMCIA.TupleCodes.CISTPL_DATE: - case Decoders.PCMCIA.TupleCodes.CISTPL_DEVICE: - case Decoders.PCMCIA.TupleCodes.CISTPL_DEVICE_A: - case Decoders.PCMCIA.TupleCodes.CISTPL_DEVICE_OA: - case Decoders.PCMCIA.TupleCodes.CISTPL_DEVICE_OC: - case Decoders.PCMCIA.TupleCodes.CISTPL_EXTDEVIC: - case Decoders.PCMCIA.TupleCodes.CISTPL_FORMAT: - case Decoders.PCMCIA.TupleCodes.CISTPL_FORMAT_A: - case Decoders.PCMCIA.TupleCodes.CISTPL_FUNCE: - case Decoders.PCMCIA.TupleCodes.CISTPL_FUNCID: - case Decoders.PCMCIA.TupleCodes.CISTPL_GEOMETRY: - case Decoders.PCMCIA.TupleCodes.CISTPL_INDIRECT: - case Decoders.PCMCIA.TupleCodes.CISTPL_JEDEC_A: - case Decoders.PCMCIA.TupleCodes.CISTPL_JEDEC_C: - case Decoders.PCMCIA.TupleCodes.CISTPL_LINKTARGET: - case Decoders.PCMCIA.TupleCodes.CISTPL_LONGLINK_A: - case Decoders.PCMCIA.TupleCodes.CISTPL_LONGLINK_C: - case Decoders.PCMCIA.TupleCodes.CISTPL_LONGLINK_CB: - case Decoders.PCMCIA.TupleCodes.CISTPL_LONGLINK_MFC: - case Decoders.PCMCIA.TupleCodes.CISTPL_NO_LINK: - case Decoders.PCMCIA.TupleCodes.CISTPL_ORG: - case Decoders.PCMCIA.TupleCodes.CISTPL_PWR_MGMNT: - case Decoders.PCMCIA.TupleCodes.CISTPL_SPCL: - case Decoders.PCMCIA.TupleCodes.CISTPL_SWIL: - case Decoders.PCMCIA.TupleCodes.CISTPL_VERS_2: + case TupleCodes.CISTPL_ALTSTR: + case TupleCodes.CISTPL_BAR: + case TupleCodes.CISTPL_BATTERY: + case TupleCodes.CISTPL_BYTEORDER: + case TupleCodes.CISTPL_CFTABLE_ENTRY: + case TupleCodes.CISTPL_CFTABLE_ENTRY_CB: + case TupleCodes.CISTPL_CHECKSUM: + case TupleCodes.CISTPL_CONFIG: + case TupleCodes.CISTPL_CONFIG_CB: + case TupleCodes.CISTPL_DATE: + case TupleCodes.CISTPL_DEVICE: + case TupleCodes.CISTPL_DEVICE_A: + case TupleCodes.CISTPL_DEVICE_OA: + case TupleCodes.CISTPL_DEVICE_OC: + case TupleCodes.CISTPL_EXTDEVIC: + case TupleCodes.CISTPL_FORMAT: + case TupleCodes.CISTPL_FORMAT_A: + case TupleCodes.CISTPL_FUNCE: + case TupleCodes.CISTPL_FUNCID: + case TupleCodes.CISTPL_GEOMETRY: + case TupleCodes.CISTPL_INDIRECT: + case TupleCodes.CISTPL_JEDEC_A: + case TupleCodes.CISTPL_JEDEC_C: + case TupleCodes.CISTPL_LINKTARGET: + case TupleCodes.CISTPL_LONGLINK_A: + case TupleCodes.CISTPL_LONGLINK_C: + case TupleCodes.CISTPL_LONGLINK_CB: + case TupleCodes.CISTPL_LONGLINK_MFC: + case TupleCodes.CISTPL_NO_LINK: + case TupleCodes.CISTPL_ORG: + case TupleCodes.CISTPL_PWR_MGMNT: + case TupleCodes.CISTPL_SPCL: + case TupleCodes.CISTPL_SWIL: + case TupleCodes.CISTPL_VERS_2: DicConsole.DebugWriteLine("Device-Info command", "Found undecoded tuple ID {0}", tuple.Code); break; @@ -265,7 +270,7 @@ namespace DiscImageChef.Commands if(sense) { - DicConsole.ErrorWriteLine("SCSI error:\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); + DicConsole.ErrorWriteLine("SCSI error:\n{0}", Sense.PrettifySense(senseBuf)); break; } @@ -275,14 +280,14 @@ namespace DiscImageChef.Commands DataFile.WriteTo("Device-Info command", options.OutputPrefix, "_scsi_inquiry.bin", "SCSI INQUIRY", inqBuf); - Decoders.SCSI.Inquiry.SCSIInquiry? inq = Decoders.SCSI.Inquiry.Decode(inqBuf); - DicConsole.WriteLine(Decoders.SCSI.Inquiry.Prettify(inq)); + Inquiry.SCSIInquiry? inq = Inquiry.Decode(inqBuf); + DicConsole.WriteLine(Inquiry.Prettify(inq)); sense = dev.ScsiInquiry(out inqBuf, out senseBuf, 0x00); if(!sense) { - byte[] pages = Decoders.SCSI.EVPD.DecodePage00(inqBuf); + byte[] pages = EVPD.DecodePage00(inqBuf); if(pages != null) foreach(byte page in pages) @@ -292,7 +297,7 @@ namespace DiscImageChef.Commands if(sense) continue; DicConsole.WriteLine("ASCII Page {0:X2}h: {1}", page, - Decoders.SCSI.EVPD.DecodeASCIIPage(inqBuf)); + EVPD.DecodeASCIIPage(inqBuf)); DataFile.WriteTo("Device-Info command", options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), @@ -304,7 +309,7 @@ namespace DiscImageChef.Commands if(sense) continue; DicConsole.WriteLine("Unit Serial Number: {0}", - Decoders.SCSI.EVPD.DecodePage80(inqBuf)); + EVPD.DecodePage80(inqBuf)); DataFile.WriteTo("Device-Info command", options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf); @@ -314,7 +319,7 @@ namespace DiscImageChef.Commands sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page); if(sense) continue; - DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_81(inqBuf)); + DicConsole.WriteLine("{0}", EVPD.PrettifyPage_81(inqBuf)); DataFile.WriteTo("Device-Info command", options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf); @@ -325,7 +330,7 @@ namespace DiscImageChef.Commands if(sense) continue; DicConsole.WriteLine("ASCII implemented operating definitions: {0}", - Decoders.SCSI.EVPD.DecodePage82(inqBuf)); + EVPD.DecodePage82(inqBuf)); DataFile.WriteTo("Device-Info command", options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf); @@ -335,7 +340,7 @@ namespace DiscImageChef.Commands sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page); if(sense) continue; - DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_83(inqBuf)); + DicConsole.WriteLine("{0}", EVPD.PrettifyPage_83(inqBuf)); DataFile.WriteTo("Device-Info command", options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf); @@ -345,7 +350,7 @@ namespace DiscImageChef.Commands sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page); if(sense) continue; - DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_84(inqBuf)); + DicConsole.WriteLine("{0}", EVPD.PrettifyPage_84(inqBuf)); DataFile.WriteTo("Device-Info command", options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf); @@ -355,7 +360,7 @@ namespace DiscImageChef.Commands sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page); if(sense) continue; - DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_85(inqBuf)); + DicConsole.WriteLine("{0}", EVPD.PrettifyPage_85(inqBuf)); DataFile.WriteTo("Device-Info command", options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf); @@ -365,7 +370,7 @@ namespace DiscImageChef.Commands sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page); if(sense) continue; - DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_86(inqBuf)); + DicConsole.WriteLine("{0}", EVPD.PrettifyPage_86(inqBuf)); DataFile.WriteTo("Device-Info command", options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf); @@ -375,7 +380,7 @@ namespace DiscImageChef.Commands sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page); if(sense) continue; - DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_89(inqBuf)); + DicConsole.WriteLine("{0}", EVPD.PrettifyPage_89(inqBuf)); DataFile.WriteTo("Device-Info command", options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf); @@ -385,7 +390,7 @@ namespace DiscImageChef.Commands sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page); if(sense) continue; - DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_B0(inqBuf)); + DicConsole.WriteLine("{0}", EVPD.PrettifyPage_B0(inqBuf)); DataFile.WriteTo("Device-Info command", options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf); @@ -396,7 +401,7 @@ namespace DiscImageChef.Commands if(sense) continue; DicConsole.WriteLine("Manufacturer-assigned Serial Number: {0}", - Decoders.SCSI.EVPD.DecodePageB1(inqBuf)); + EVPD.DecodePageB1(inqBuf)); DataFile.WriteTo("Device-Info command", options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf); @@ -407,7 +412,7 @@ namespace DiscImageChef.Commands if(sense) continue; DicConsole.WriteLine("TapeAlert Supported Flags Bitmap: 0x{0:X16}", - Decoders.SCSI.EVPD.DecodePageB2(inqBuf)); + EVPD.DecodePageB2(inqBuf)); DataFile.WriteTo("Device-Info command", options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf); @@ -418,7 +423,7 @@ namespace DiscImageChef.Commands if(sense) continue; DicConsole.WriteLine("Automation Device Serial Number: {0}", - Decoders.SCSI.EVPD.DecodePageB3(inqBuf)); + EVPD.DecodePageB3(inqBuf)); DataFile.WriteTo("Device-Info command", options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf); @@ -429,7 +434,7 @@ namespace DiscImageChef.Commands if(sense) continue; DicConsole.WriteLine("Data Transfer Device Element Address: 0x{0}", - Decoders.SCSI.EVPD.DecodePageB4(inqBuf)); + EVPD.DecodePageB4(inqBuf)); DataFile.WriteTo("Device-Info command", options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf); @@ -442,7 +447,7 @@ namespace DiscImageChef.Commands sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page); if(sense) continue; - DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_C0_Quantum(inqBuf)); + DicConsole.WriteLine("{0}", EVPD.PrettifyPage_C0_Quantum(inqBuf)); DataFile.WriteTo("Device-Info command", options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf); @@ -455,7 +460,7 @@ namespace DiscImageChef.Commands sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page); if(sense) continue; - DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_C0_Seagate(inqBuf)); + DicConsole.WriteLine("{0}", EVPD.PrettifyPage_C0_Seagate(inqBuf)); DataFile.WriteTo("Device-Info command", options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf); @@ -468,7 +473,7 @@ namespace DiscImageChef.Commands sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page); if(sense) continue; - DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_C0_IBM(inqBuf)); + DicConsole.WriteLine("{0}", EVPD.PrettifyPage_C0_IBM(inqBuf)); DataFile.WriteTo("Device-Info command", options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf); @@ -481,7 +486,7 @@ namespace DiscImageChef.Commands sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page); if(sense) continue; - DicConsole.WriteLine("{0}", Decoders.SCSI.EVPD.PrettifyPage_C1_IBM(inqBuf)); + DicConsole.WriteLine("{0}", EVPD.PrettifyPage_C1_IBM(inqBuf)); DataFile.WriteTo("Device-Info command", options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf); @@ -495,7 +500,7 @@ namespace DiscImageChef.Commands if(sense) continue; DicConsole.WriteLine("{0}", - Decoders.SCSI.EVPD.PrettifyPage_C0_C1_Certance(inqBuf)); + EVPD.PrettifyPage_C0_C1_Certance(inqBuf)); DataFile.WriteTo("Device-Info command", options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf); @@ -509,8 +514,7 @@ namespace DiscImageChef.Commands if(sense) continue; DicConsole.WriteLine("{0}", - Decoders - .SCSI.EVPD + EVPD .PrettifyPage_C2_C3_C4_C5_C6_Certance(inqBuf)); DataFile.WriteTo("Device-Info command", options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), @@ -526,7 +530,7 @@ namespace DiscImageChef.Commands if(sense) continue; DicConsole.WriteLine("{0}", - Decoders.SCSI.EVPD.PrettifyPage_C0_to_C5_HP(inqBuf)); + EVPD.PrettifyPage_C0_to_C5_HP(inqBuf)); DataFile.WriteTo("Device-Info command", options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf); @@ -540,7 +544,7 @@ namespace DiscImageChef.Commands if(sense) continue; DicConsole.WriteLine("{0}", - Decoders.SCSI.EVPD.PrettifyPage_DF_Certance(inqBuf)); + EVPD.PrettifyPage_DF_Certance(inqBuf)); DataFile.WriteTo("Device-Info command", options.OutputPrefix, string.Format("_scsi_evpd_{0:X2}h.bin", page), string.Format("SCSI INQUIRY EVPD {0:X2}h", page), inqBuf); @@ -562,9 +566,9 @@ namespace DiscImageChef.Commands byte[] modeBuf; double duration; - Decoders.SCSI.Modes.DecodedMode? decMode = null; - Decoders.SCSI.PeripheralDeviceTypes devType = - (Decoders.SCSI.PeripheralDeviceTypes)inq.Value.PeripheralDeviceType; + Modes.DecodedMode? decMode = null; + PeripheralDeviceTypes devType = + (PeripheralDeviceTypes)inq.Value.PeripheralDeviceType; sense = dev.ModeSense10(out modeBuf, out senseBuf, false, true, ScsiModeSensePageControl.Current, 0x3F, 0xFF, 5, out duration); @@ -572,7 +576,7 @@ namespace DiscImageChef.Commands sense = dev.ModeSense10(out modeBuf, out senseBuf, false, true, ScsiModeSensePageControl.Current, 0x3F, 0x00, 5, out duration); - if(!sense && !dev.Error) decMode = Decoders.SCSI.Modes.DecodeMode10(modeBuf, devType); + if(!sense && !dev.Error) decMode = Modes.DecodeMode10(modeBuf, devType); if(sense || dev.Error || !decMode.HasValue) { @@ -583,7 +587,7 @@ namespace DiscImageChef.Commands 0x3F, 0x00, 5, out duration); if(sense || dev.Error) sense = dev.ModeSense(out modeBuf, out senseBuf, 5, out duration); - if(!sense && !dev.Error) decMode = Decoders.SCSI.Modes.DecodeMode6(modeBuf, devType); + if(!sense && !dev.Error) decMode = Modes.DecodeMode6(modeBuf, devType); } if(!sense) @@ -592,18 +596,18 @@ namespace DiscImageChef.Commands if(decMode.HasValue) { - DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModeHeader(decMode.Value.Header, devType)); + DicConsole.WriteLine(Modes.PrettifyModeHeader(decMode.Value.Header, devType)); if(decMode.Value.Pages != null) - foreach(Decoders.SCSI.Modes.ModePage page in decMode.Value.Pages) + foreach(Modes.ModePage page in decMode.Value.Pages) //DicConsole.WriteLine("Page {0:X2}h subpage {1:X2}h is {2} bytes long", page.Page, page.Subpage, page.PageResponse.Length); switch(page.Page) { case 0x00: { - if(devType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice && + if(devType == PeripheralDeviceTypes.MultiMediaDevice && page.Subpage == 0) - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyModePage_00_SFF(page.PageResponse)); else { @@ -620,12 +624,12 @@ namespace DiscImageChef.Commands case 0x01: { if(page.Subpage == 0) - if(devType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice) - DicConsole.WriteLine(Decoders.SCSI.Modes + if(devType == PeripheralDeviceTypes.MultiMediaDevice) + DicConsole.WriteLine(Modes .PrettifyModePage_01_MMC(page .PageResponse)); else - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyModePage_01(page.PageResponse)); else goto default; @@ -634,7 +638,7 @@ namespace DiscImageChef.Commands case 0x02: { if(page.Subpage == 0) - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyModePage_02(page.PageResponse)); else goto default; @@ -643,7 +647,7 @@ namespace DiscImageChef.Commands case 0x03: { if(page.Subpage == 0) - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyModePage_03(page.PageResponse)); else goto default; @@ -652,7 +656,7 @@ namespace DiscImageChef.Commands case 0x04: { if(page.Subpage == 0) - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyModePage_04(page.PageResponse)); else goto default; @@ -661,7 +665,7 @@ namespace DiscImageChef.Commands case 0x05: { if(page.Subpage == 0) - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyModePage_05(page.PageResponse)); else goto default; @@ -670,7 +674,7 @@ namespace DiscImageChef.Commands case 0x06: { if(page.Subpage == 0) - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyModePage_06(page.PageResponse)); else goto default; @@ -679,12 +683,12 @@ namespace DiscImageChef.Commands case 0x07: { if(page.Subpage == 0) - if(devType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice) - DicConsole.WriteLine(Decoders.SCSI.Modes + if(devType == PeripheralDeviceTypes.MultiMediaDevice) + DicConsole.WriteLine(Modes .PrettifyModePage_07_MMC(page .PageResponse)); else - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyModePage_07(page.PageResponse)); else goto default; @@ -693,7 +697,7 @@ namespace DiscImageChef.Commands case 0x08: { if(page.Subpage == 0) - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyModePage_08(page.PageResponse)); else goto default; @@ -702,10 +706,10 @@ namespace DiscImageChef.Commands case 0x0A: { if(page.Subpage == 0) - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyModePage_0A(page.PageResponse)); else if(page.Subpage == 1) - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyModePage_0A_S01(page.PageResponse)); else goto default; @@ -714,7 +718,7 @@ namespace DiscImageChef.Commands case 0x0B: { if(page.Subpage == 0) - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyModePage_0B(page.PageResponse)); else goto default; @@ -723,7 +727,7 @@ namespace DiscImageChef.Commands case 0x0D: { if(page.Subpage == 0) - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyModePage_0D(page.PageResponse)); else goto default; @@ -732,7 +736,7 @@ namespace DiscImageChef.Commands case 0x0E: { if(page.Subpage == 0) - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyModePage_0E(page.PageResponse)); else goto default; @@ -741,7 +745,7 @@ namespace DiscImageChef.Commands case 0x0F: { if(page.Subpage == 0) - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyModePage_0F(page.PageResponse)); else goto default; @@ -750,12 +754,12 @@ namespace DiscImageChef.Commands case 0x10: { if(page.Subpage == 0) - if(devType == Decoders.SCSI.PeripheralDeviceTypes.SequentialAccess) - DicConsole.WriteLine(Decoders.SCSI.Modes + if(devType == PeripheralDeviceTypes.SequentialAccess) + DicConsole.WriteLine(Modes .PrettifyModePage_10_SSC(page .PageResponse)); else - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyModePage_10(page.PageResponse)); else goto default; @@ -764,7 +768,7 @@ namespace DiscImageChef.Commands case 0x11: { if(page.Subpage == 0) - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyModePage_11(page.PageResponse)); else goto default; @@ -775,7 +779,7 @@ namespace DiscImageChef.Commands case 0x14: { if(page.Subpage == 0) - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyModePage_12_13_14(page .PageResponse)); else goto default; @@ -785,10 +789,10 @@ namespace DiscImageChef.Commands case 0x1A: { if(page.Subpage == 0) - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyModePage_1A(page.PageResponse)); else if(page.Subpage == 1) - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyModePage_1A_S01(page.PageResponse)); else goto default; @@ -797,7 +801,7 @@ namespace DiscImageChef.Commands case 0x1B: { if(page.Subpage == 0) - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyModePage_1B(page.PageResponse)); else goto default; @@ -806,15 +810,15 @@ namespace DiscImageChef.Commands case 0x1C: { if(page.Subpage == 0) - if(devType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice) - DicConsole.WriteLine(Decoders.SCSI.Modes + if(devType == PeripheralDeviceTypes.MultiMediaDevice) + DicConsole.WriteLine(Modes .PrettifyModePage_1C_SFF(page .PageResponse)); else - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyModePage_1C(page.PageResponse)); else if(page.Subpage == 1) - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyModePage_1C_S01(page.PageResponse)); else goto default; @@ -823,7 +827,7 @@ namespace DiscImageChef.Commands case 0x1D: { if(page.Subpage == 0) - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyModePage_1D(page.PageResponse)); else goto default; @@ -833,7 +837,7 @@ namespace DiscImageChef.Commands { if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "CERTANCE" ) - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyCertanceModePage_21(page .PageResponse)); else goto default; @@ -844,7 +848,7 @@ namespace DiscImageChef.Commands { if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "CERTANCE" ) - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyCertanceModePage_22(page .PageResponse)); else goto default; @@ -854,7 +858,7 @@ namespace DiscImageChef.Commands case 0x24: { if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "IBM") - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyIBMModePage_24(page.PageResponse)); else goto default; @@ -863,7 +867,7 @@ namespace DiscImageChef.Commands case 0x2A: { if(page.Subpage == 0) - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyModePage_2A(page.PageResponse)); else goto default; @@ -872,7 +876,7 @@ namespace DiscImageChef.Commands case 0x2F: { if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "IBM") - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyIBMModePage_2F(page.PageResponse)); else goto default; @@ -880,7 +884,7 @@ namespace DiscImageChef.Commands } case 0x30: { - if(Decoders.SCSI.Modes.IsAppleModePage_30(page.PageResponse)) + if(Modes.IsAppleModePage_30(page.PageResponse)) DicConsole.WriteLine("Drive identifies as Apple OEM drive"); else goto default; @@ -889,7 +893,7 @@ namespace DiscImageChef.Commands case 0x3B: { if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "HP") - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyHPModePage_3B(page.PageResponse)); else goto default; @@ -898,7 +902,7 @@ namespace DiscImageChef.Commands case 0x3C: { if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "HP") - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyHPModePage_3C(page.PageResponse)); else goto default; @@ -907,10 +911,10 @@ namespace DiscImageChef.Commands case 0x3D: { if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "IBM") - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyIBMModePage_3D(page.PageResponse)); else if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "HP") - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyHPModePage_3D(page.PageResponse)); else goto default; @@ -919,11 +923,11 @@ namespace DiscImageChef.Commands case 0x3E: { if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "FUJITSU") - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyFujitsuModePage_3E(page .PageResponse)); else if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "HP") - DicConsole.WriteLine(Decoders.SCSI.Modes + DicConsole.WriteLine(Modes .PrettifyHPModePage_3E(page.PageResponse)); else goto default; @@ -941,7 +945,7 @@ namespace DiscImageChef.Commands } switch(devType) { - case Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice: + case PeripheralDeviceTypes.MultiMediaDevice: byte[] confBuf; sense = dev.GetConfiguration(out confBuf, out senseBuf, dev.Timeout, out duration); @@ -950,8 +954,8 @@ namespace DiscImageChef.Commands DataFile.WriteTo("Device-Info command", options.OutputPrefix, "_mmc_getconfiguration.bin", "MMC GET CONFIGURATION", confBuf); - Decoders.SCSI.MMC.Features.SeparatedFeatures ftr = - Decoders.SCSI.MMC.Features.Separate(confBuf); + Features.SeparatedFeatures ftr = + Features.Separate(confBuf); DicConsole.DebugWriteLine("Device-Info command", "GET CONFIGURATION length is {0} bytes", ftr.DataLength); @@ -961,185 +965,185 @@ namespace DiscImageChef.Commands if(ftr.Descriptors != null) { DicConsole.WriteLine("SCSI MMC GET CONFIGURATION Features:"); - foreach(Decoders.SCSI.MMC.Features.FeatureDescriptor desc in ftr.Descriptors) + foreach(Features.FeatureDescriptor desc in ftr.Descriptors) { DicConsole.DebugWriteLine("Device-Info command", "Feature {0:X4}h", desc.Code); switch(desc.Code) { case 0x0000: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0000(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0000(desc.Data)); break; case 0x0001: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0001(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0001(desc.Data)); break; case 0x0002: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0002(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0002(desc.Data)); break; case 0x0003: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0003(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0003(desc.Data)); break; case 0x0004: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0004(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0004(desc.Data)); break; case 0x0010: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0010(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0010(desc.Data)); break; case 0x001D: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_001D(desc.Data)); + DicConsole.WriteLine(Features.Prettify_001D(desc.Data)); break; case 0x001E: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_001E(desc.Data)); + DicConsole.WriteLine(Features.Prettify_001E(desc.Data)); break; case 0x001F: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_001F(desc.Data)); + DicConsole.WriteLine(Features.Prettify_001F(desc.Data)); break; case 0x0020: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0020(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0020(desc.Data)); break; case 0x0021: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0021(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0021(desc.Data)); break; case 0x0022: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0022(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0022(desc.Data)); break; case 0x0023: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0023(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0023(desc.Data)); break; case 0x0024: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0024(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0024(desc.Data)); break; case 0x0025: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0025(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0025(desc.Data)); break; case 0x0026: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0026(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0026(desc.Data)); break; case 0x0027: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0027(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0027(desc.Data)); break; case 0x0028: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0028(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0028(desc.Data)); break; case 0x0029: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0029(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0029(desc.Data)); break; case 0x002A: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002A(desc.Data)); + DicConsole.WriteLine(Features.Prettify_002A(desc.Data)); break; case 0x002B: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002B(desc.Data)); + DicConsole.WriteLine(Features.Prettify_002B(desc.Data)); break; case 0x002C: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002C(desc.Data)); + DicConsole.WriteLine(Features.Prettify_002C(desc.Data)); break; case 0x002D: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002D(desc.Data)); + DicConsole.WriteLine(Features.Prettify_002D(desc.Data)); break; case 0x002E: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002E(desc.Data)); + DicConsole.WriteLine(Features.Prettify_002E(desc.Data)); break; case 0x002F: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_002F(desc.Data)); + DicConsole.WriteLine(Features.Prettify_002F(desc.Data)); break; case 0x0030: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0030(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0030(desc.Data)); break; case 0x0031: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0031(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0031(desc.Data)); break; case 0x0032: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0032(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0032(desc.Data)); break; case 0x0033: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0033(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0033(desc.Data)); break; case 0x0035: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0035(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0035(desc.Data)); break; case 0x0037: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0037(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0037(desc.Data)); break; case 0x0038: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0038(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0038(desc.Data)); break; case 0x003A: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_003A(desc.Data)); + DicConsole.WriteLine(Features.Prettify_003A(desc.Data)); break; case 0x003B: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_003B(desc.Data)); + DicConsole.WriteLine(Features.Prettify_003B(desc.Data)); break; case 0x0040: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0040(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0040(desc.Data)); break; case 0x0041: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0041(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0041(desc.Data)); break; case 0x0042: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0042(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0042(desc.Data)); break; case 0x0050: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0050(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0050(desc.Data)); break; case 0x0051: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0051(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0051(desc.Data)); break; case 0x0080: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0080(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0080(desc.Data)); break; case 0x0100: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0100(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0100(desc.Data)); break; case 0x0101: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0101(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0101(desc.Data)); break; case 0x0102: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0102(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0102(desc.Data)); break; case 0x0103: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0103(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0103(desc.Data)); break; case 0x0104: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0104(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0104(desc.Data)); break; case 0x0105: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0105(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0105(desc.Data)); break; case 0x0106: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0106(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0106(desc.Data)); break; case 0x0107: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0107(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0107(desc.Data)); break; case 0x0108: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0108(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0108(desc.Data)); break; case 0x0109: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0109(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0109(desc.Data)); break; case 0x010A: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_010A(desc.Data)); + DicConsole.WriteLine(Features.Prettify_010A(desc.Data)); break; case 0x010B: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_010B(desc.Data)); + DicConsole.WriteLine(Features.Prettify_010B(desc.Data)); break; case 0x010C: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_010C(desc.Data)); + DicConsole.WriteLine(Features.Prettify_010C(desc.Data)); break; case 0x010D: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_010D(desc.Data)); + DicConsole.WriteLine(Features.Prettify_010D(desc.Data)); break; case 0x010E: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_010E(desc.Data)); + DicConsole.WriteLine(Features.Prettify_010E(desc.Data)); break; case 0x0110: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0110(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0110(desc.Data)); break; case 0x0113: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0113(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0113(desc.Data)); break; case 0x0142: - DicConsole.WriteLine(Decoders.SCSI.MMC.Features.Prettify_0142(desc.Data)); + DicConsole.WriteLine(Features.Prettify_0142(desc.Data)); break; default: DicConsole.WriteLine("Found unknown feature code {0:X4}h", desc.Code); @@ -1422,35 +1426,35 @@ namespace DiscImageChef.Commands } } break; - case Decoders.SCSI.PeripheralDeviceTypes.SequentialAccess: + case PeripheralDeviceTypes.SequentialAccess: byte[] seqBuf; sense = dev.ReadBlockLimits(out seqBuf, out senseBuf, dev.Timeout, out duration); if(sense) DicConsole.ErrorWriteLine("READ BLOCK LIMITS:\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else { DataFile.WriteTo("Device-Info command", options.OutputPrefix, "_ssc_readblocklimits.bin", "SSC READ BLOCK LIMITS", seqBuf); DicConsole.WriteLine("Block limits for device:"); - DicConsole.WriteLine(Decoders.SCSI.SSC.BlockLimits.Prettify(seqBuf)); + DicConsole.WriteLine(BlockLimits.Prettify(seqBuf)); } sense = dev.ReportDensitySupport(out seqBuf, out senseBuf, dev.Timeout, out duration); if(sense) DicConsole.ErrorWriteLine("REPORT DENSITY SUPPORT:\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else { DataFile.WriteTo("Device-Info command", options.OutputPrefix, "_ssc_reportdensitysupport.bin", "SSC REPORT DENSITY SUPPORT", seqBuf); - Decoders.SCSI.SSC.DensitySupport.DensitySupportHeader? dens = - Decoders.SCSI.SSC.DensitySupport.DecodeDensity(seqBuf); + DensitySupport.DensitySupportHeader? dens = + DensitySupport.DecodeDensity(seqBuf); if(dens.HasValue) { DicConsole.WriteLine("Densities supported by device:"); - DicConsole.WriteLine(Decoders.SCSI.SSC.DensitySupport.PrettifyDensity(dens)); + DicConsole.WriteLine(DensitySupport.PrettifyDensity(dens)); } } @@ -1458,20 +1462,20 @@ namespace DiscImageChef.Commands out duration); if(sense) DicConsole.ErrorWriteLine("REPORT DENSITY SUPPORT (MEDIUM):\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else { DataFile.WriteTo("Device-Info command", options.OutputPrefix, "_ssc_reportdensitysupport_medium.bin", "SSC REPORT DENSITY SUPPORT (MEDIUM)", seqBuf); - Decoders.SCSI.SSC.DensitySupport.MediaTypeSupportHeader? meds = - Decoders.SCSI.SSC.DensitySupport.DecodeMediumType(seqBuf); + DensitySupport.MediaTypeSupportHeader? meds = + DensitySupport.DecodeMediumType(seqBuf); if(meds.HasValue) { DicConsole.WriteLine("Medium types supported by device:"); - DicConsole.WriteLine(Decoders.SCSI.SSC.DensitySupport.PrettifyMediumType(meds)); + DicConsole.WriteLine(DensitySupport.PrettifyMediumType(meds)); } - DicConsole.WriteLine(Decoders.SCSI.SSC.DensitySupport.PrettifyMediumType(seqBuf)); + DicConsole.WriteLine(DensitySupport.PrettifyMediumType(seqBuf)); } break; } diff --git a/DiscImageChef/Commands/DeviceReport.cs b/DiscImageChef/Commands/DeviceReport.cs index 89855e6bc..3d399761a 100644 --- a/DiscImageChef/Commands/DeviceReport.cs +++ b/DiscImageChef/Commands/DeviceReport.cs @@ -32,8 +32,11 @@ using System; using System.IO; +using System.Xml.Serialization; using DiscImageChef.Console; using DiscImageChef.Core; +using DiscImageChef.Core.Devices.Report; +using DiscImageChef.Core.Devices.Report.SCSI; using DiscImageChef.Devices; namespace DiscImageChef.Commands @@ -73,26 +76,26 @@ namespace DiscImageChef.Commands switch(dev.Type) { case DeviceType.ATA: - Core.Devices.Report.Ata.Report(dev, ref report, options.Debug, ref removable); + Ata.Report(dev, ref report, options.Debug, ref removable); break; case DeviceType.MMC: case DeviceType.SecureDigital: - Core.Devices.Report.SecureDigital.Report(dev, ref report, options.Debug, ref removable); + SecureDigital.Report(dev, ref report, options.Debug, ref removable); break; case DeviceType.NVMe: - Core.Devices.Report.Nvme.Report(dev, ref report, options.Debug, ref removable); + Nvme.Report(dev, ref report, options.Debug, ref removable); break; case DeviceType.ATAPI: case DeviceType.SCSI: - Core.Devices.Report.SCSI.General.Report(dev, ref report, options.Debug, ref removable); + General.Report(dev, ref report, options.Debug, ref removable); break; default: throw new NotSupportedException("Unknown device type."); } FileStream xmlFs = new FileStream(xmlFile, FileMode.Create); - System.Xml.Serialization.XmlSerializer xmlSer = - new System.Xml.Serialization.XmlSerializer(typeof(Metadata.DeviceReport)); + XmlSerializer xmlSer = + new XmlSerializer(typeof(Metadata.DeviceReport)); xmlSer.Serialize(xmlFs, report); xmlFs.Close(); Core.Statistics.AddCommand("device-report"); diff --git a/DiscImageChef/Commands/Entropy.cs b/DiscImageChef/Commands/Entropy.cs index d65bcdd9d..93236c534 100644 --- a/DiscImageChef/Commands/Entropy.cs +++ b/DiscImageChef/Commands/Entropy.cs @@ -36,8 +36,8 @@ using System.Linq; using DiscImageChef.Checksums; using DiscImageChef.Console; using DiscImageChef.Core; -using DiscImageChef.Filters; using DiscImageChef.DiscImages; +using DiscImageChef.Filters; namespace DiscImageChef.Commands { diff --git a/DiscImageChef/Commands/ExtractFiles.cs b/DiscImageChef/Commands/ExtractFiles.cs index de8a73e24..f311e0fd7 100644 --- a/DiscImageChef/Commands/ExtractFiles.cs +++ b/DiscImageChef/Commands/ExtractFiles.cs @@ -37,9 +37,9 @@ using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.Core; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; namespace DiscImageChef.Commands { @@ -163,9 +163,9 @@ namespace DiscImageChef.Commands { DicConsole.WriteLine(string.Format("As identified by {0}.", plugin.Name)); Filesystem fs = (Filesystem)plugin - .GetType().GetConstructor(new Type[] + .GetType().GetConstructor(new[] { - typeof(ImagePlugin), typeof(Partition), typeof(System.Text.Encoding) + typeof(ImagePlugin), typeof(Partition), typeof(Encoding) }).Invoke(new object[] {imageFormat, partitions[i], null}); error = fs.Mount(options.Debug); @@ -311,9 +311,9 @@ namespace DiscImageChef.Commands plugins.PluginsList.TryGetValue(idPlugins[0], out plugin); DicConsole.WriteLine(string.Format("Identified by {0}.", plugin.Name)); Filesystem fs = (Filesystem)plugin - .GetType().GetConstructor(new Type[] + .GetType().GetConstructor(new[] { - typeof(ImagePlugin), typeof(Partition), typeof(System.Text.Encoding) + typeof(ImagePlugin), typeof(Partition), typeof(Encoding) }).Invoke(new object[] {imageFormat, partitions[i], null}); error = fs.Mount(options.Debug); if(error == Errno.NoError) @@ -453,9 +453,9 @@ namespace DiscImageChef.Commands { DicConsole.WriteLine(string.Format("As identified by {0}.", plugin.Name)); Filesystem fs = (Filesystem)plugin - .GetType().GetConstructor(new Type[] + .GetType().GetConstructor(new[] { - typeof(ImagePlugin), typeof(Partition), typeof(System.Text.Encoding) + typeof(ImagePlugin), typeof(Partition), typeof(Encoding) }).Invoke(new object[] {imageFormat, wholePart, null}); error = fs.Mount(options.Debug); if(error == Errno.NoError) @@ -580,9 +580,9 @@ namespace DiscImageChef.Commands plugins.PluginsList.TryGetValue(idPlugins[0], out plugin); DicConsole.WriteLine(string.Format("Identified by {0}.", plugin.Name)); Filesystem fs = (Filesystem)plugin - .GetType().GetConstructor(new Type[] + .GetType().GetConstructor(new[] { - typeof(ImagePlugin), typeof(Partition), typeof(System.Text.Encoding) + typeof(ImagePlugin), typeof(Partition), typeof(Encoding) }).Invoke(new object[] {imageFormat, wholePart, null}); error = fs.Mount(options.Debug); if(error == Errno.NoError) diff --git a/DiscImageChef/Commands/Formats.cs b/DiscImageChef/Commands/Formats.cs index 6cc62f938..e6258f3ae 100644 --- a/DiscImageChef/Commands/Formats.cs +++ b/DiscImageChef/Commands/Formats.cs @@ -33,9 +33,9 @@ using System.Collections.Generic; using DiscImageChef.Console; using DiscImageChef.Core; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; using DiscImageChef.Partitions; namespace DiscImageChef.Commands diff --git a/DiscImageChef/Commands/ListEncodings.cs b/DiscImageChef/Commands/ListEncodings.cs index 03eabc63a..4b5b6c66d 100644 --- a/DiscImageChef/Commands/ListEncodings.cs +++ b/DiscImageChef/Commands/ListEncodings.cs @@ -32,6 +32,7 @@ using System.Collections.Generic; using System.Linq; +using System.Text; using DiscImageChef.Console; namespace DiscImageChef.Commands @@ -46,7 +47,7 @@ namespace DiscImageChef.Commands internal static void DoList(ListEncodingsOptions encodingOptions) { - List encodings = System.Text.Encoding.GetEncodings().Select(info => new CommonEncodingInfo {Name = info.Name, DisplayName = info.GetEncoding().EncodingName}).ToList(); + List encodings = Encoding.GetEncodings().Select(info => new CommonEncodingInfo {Name = info.Name, DisplayName = info.GetEncoding().EncodingName}).ToList(); encodings.AddRange(Claunia.Encoding.Encoding.GetEncodings().Select(info => new CommonEncodingInfo {Name = info.Name, DisplayName = info.DisplayName})); DicConsole.WriteLine("{0,-16} {1,-8}", "Name", "Description"); diff --git a/DiscImageChef/Commands/Ls.cs b/DiscImageChef/Commands/Ls.cs index 9bdb02869..fb3a655eb 100644 --- a/DiscImageChef/Commands/Ls.cs +++ b/DiscImageChef/Commands/Ls.cs @@ -36,9 +36,9 @@ using System.Text; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.Core; +using DiscImageChef.DiscImages; using DiscImageChef.Filesystems; using DiscImageChef.Filters; -using DiscImageChef.DiscImages; namespace DiscImageChef.Commands { @@ -150,9 +150,9 @@ namespace DiscImageChef.Commands { DicConsole.WriteLine(string.Format("As identified by {0}.", plugin.Name)); Filesystem fs = (Filesystem)plugin - .GetType().GetConstructor(new Type[] + .GetType().GetConstructor(new[] { - typeof(ImagePlugin), typeof(Partition), typeof(System.Text.Encoding) + typeof(ImagePlugin), typeof(Partition), typeof(Encoding) }).Invoke(new object[] {imageFormat, partitions[i], null}); error = fs.Mount(options.Debug); @@ -177,9 +177,9 @@ namespace DiscImageChef.Commands plugins.PluginsList.TryGetValue(idPlugins[0], out plugin); DicConsole.WriteLine(string.Format("Identified by {0}.", plugin.Name)); Filesystem fs = (Filesystem)plugin - .GetType().GetConstructor(new Type[] + .GetType().GetConstructor(new[] { - typeof(ImagePlugin), typeof(Partition), typeof(System.Text.Encoding) + typeof(ImagePlugin), typeof(Partition), typeof(Encoding) }).Invoke(new object[] {imageFormat, partitions[i], null}); error = fs.Mount(options.Debug); if(error == Errno.NoError) @@ -215,9 +215,9 @@ namespace DiscImageChef.Commands { DicConsole.WriteLine(string.Format("As identified by {0}.", plugin.Name)); Filesystem fs = (Filesystem)plugin - .GetType().GetConstructor(new Type[] + .GetType().GetConstructor(new[] { - typeof(ImagePlugin), typeof(Partition), typeof(System.Text.Encoding) + typeof(ImagePlugin), typeof(Partition), typeof(Encoding) }).Invoke(new object[] {imageFormat, wholePart, null}); error = fs.Mount(options.Debug); if(error == Errno.NoError) @@ -238,9 +238,9 @@ namespace DiscImageChef.Commands plugins.PluginsList.TryGetValue(idPlugins[0], out plugin); DicConsole.WriteLine(string.Format("Identified by {0}.", plugin.Name)); Filesystem fs = (Filesystem)plugin - .GetType().GetConstructor(new Type[] + .GetType().GetConstructor(new[] { - typeof(ImagePlugin), typeof(Partition), typeof(System.Text.Encoding) + typeof(ImagePlugin), typeof(Partition), typeof(Encoding) }).Invoke(new object[] {imageFormat, wholePart, null}); error = fs.Mount(options.Debug); if(error == Errno.NoError) diff --git a/DiscImageChef/Commands/MediaInfo.cs b/DiscImageChef/Commands/MediaInfo.cs index 529f08b42..847b6a716 100644 --- a/DiscImageChef/Commands/MediaInfo.cs +++ b/DiscImageChef/Commands/MediaInfo.cs @@ -32,10 +32,23 @@ using System; using System.Linq; +using System.Threading; using DiscImageChef.CommonTypes; using DiscImageChef.Console; using DiscImageChef.Core; +using DiscImageChef.Decoders.Bluray; +using DiscImageChef.Decoders.CD; +using DiscImageChef.Decoders.DVD; +using DiscImageChef.Decoders.SCSI; +using DiscImageChef.Decoders.SCSI.MMC; +using DiscImageChef.Decoders.SCSI.SSC; +using DiscImageChef.Decoders.Xbox; using DiscImageChef.Devices; +using BCA = DiscImageChef.Decoders.Bluray.BCA; +using Cartridge = DiscImageChef.Decoders.DVD.Cartridge; +using DDS = DiscImageChef.Decoders.DVD.DDS; +using DMI = DiscImageChef.Decoders.Xbox.DMI; +using Spare = DiscImageChef.Decoders.DVD.Spare; namespace DiscImageChef.Commands { @@ -115,7 +128,7 @@ namespace DiscImageChef.Commands sense = dev.ScsiTestUnitReady(out senseBuf, dev.Timeout, out duration); if(sense) { - Decoders.SCSI.FixedSense? decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf); + FixedSense? decSense = Sense.DecodeFixed(senseBuf); if(decSense.HasValue) { // Just retry, for 5 times @@ -131,7 +144,7 @@ namespace DiscImageChef.Commands while(leftRetries > 0) { DicConsole.WriteLine("\rWaiting for drive to become ready"); - System.Threading.Thread.Sleep(2000); + Thread.Sleep(2000); sense = dev.ScsiTestUnitReady(out senseBuf, dev.Timeout, out duration); if(!sense) break; @@ -150,7 +163,7 @@ namespace DiscImageChef.Commands while(leftRetries > 0) { DicConsole.WriteLine("\rWaiting for drive to become ready"); - System.Threading.Thread.Sleep(2000); + Thread.Sleep(2000); sense = dev.ScsiTestUnitReady(out senseBuf, dev.Timeout, out duration); if(!sense) break; @@ -160,14 +173,14 @@ namespace DiscImageChef.Commands if(sense) { DicConsole.ErrorWriteLine("Error testing unit was ready:\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); return; } } else { DicConsole.ErrorWriteLine("Error testing unit was ready:\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); return; } } @@ -180,8 +193,8 @@ namespace DiscImageChef.Commands } byte[] modeBuf; - Decoders.SCSI.Modes.DecodedMode? decMode = null; - Decoders.SCSI.PeripheralDeviceTypes devType = dev.ScsiType; + Modes.DecodedMode? decMode = null; + PeripheralDeviceTypes devType = dev.ScsiType; sense = dev.ModeSense10(out modeBuf, out senseBuf, false, true, ScsiModeSensePageControl.Current, 0x3F, 0xFF, 5, out duration); @@ -189,7 +202,7 @@ namespace DiscImageChef.Commands sense = dev.ModeSense10(out modeBuf, out senseBuf, false, true, ScsiModeSensePageControl.Current, 0x3F, 0x00, 5, out duration); - if(!sense && !dev.Error) decMode = Decoders.SCSI.Modes.DecodeMode10(modeBuf, devType); + if(!sense && !dev.Error) decMode = Modes.DecodeMode10(modeBuf, devType); if(sense || dev.Error || !decMode.HasValue) { @@ -200,7 +213,7 @@ namespace DiscImageChef.Commands 0x00, 5, out duration); if(sense || dev.Error) sense = dev.ModeSense(out modeBuf, out senseBuf, 5, out duration); - if(!sense && !dev.Error) decMode = Decoders.SCSI.Modes.DecodeMode6(modeBuf, devType); + if(!sense && !dev.Error) decMode = Modes.DecodeMode6(modeBuf, devType); } if(!sense) @@ -220,12 +233,12 @@ namespace DiscImageChef.Commands } switch(dev.ScsiType) { - case Decoders.SCSI.PeripheralDeviceTypes.DirectAccess: - case Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice: - case Decoders.SCSI.PeripheralDeviceTypes.OCRWDevice: - case Decoders.SCSI.PeripheralDeviceTypes.OpticalDevice: - case Decoders.SCSI.PeripheralDeviceTypes.SimplifiedDevice: - case Decoders.SCSI.PeripheralDeviceTypes.WriteOnceDevice: + case PeripheralDeviceTypes.DirectAccess: + case PeripheralDeviceTypes.MultiMediaDevice: + case PeripheralDeviceTypes.OCRWDevice: + case PeripheralDeviceTypes.OpticalDevice: + case PeripheralDeviceTypes.SimplifiedDevice: + case PeripheralDeviceTypes.WriteOnceDevice: sense = dev.ReadCapacity(out cmdBuf, out senseBuf, dev.Timeout, out duration); if(!sense) { @@ -240,10 +253,10 @@ namespace DiscImageChef.Commands sense = dev.ReadCapacity16(out cmdBuf, out senseBuf, dev.Timeout, out duration); if(sense && blocks == 0) - if(dev.ScsiType != Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice) + if(dev.ScsiType != PeripheralDeviceTypes.MultiMediaDevice) { DicConsole.ErrorWriteLine("Unable to get media capacity"); - DicConsole.ErrorWriteLine("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); + DicConsole.ErrorWriteLine("{0}", Sense.PrettifySense(senseBuf)); } if(!sense) @@ -266,7 +279,7 @@ namespace DiscImageChef.Commands blockSize, blocks * blockSize); } break; - case Decoders.SCSI.PeripheralDeviceTypes.SequentialAccess: + case PeripheralDeviceTypes.SequentialAccess: byte[] seqBuf; byte[] medBuf; @@ -279,12 +292,12 @@ namespace DiscImageChef.Commands { DataFile.WriteTo("Media-Info command", outputPrefix, "_ssc_reportdensitysupport_media.bin", "SSC REPORT DENSITY SUPPORT (MEDIA)", seqBuf); - Decoders.SCSI.SSC.DensitySupport.DensitySupportHeader? dens = - Decoders.SCSI.SSC.DensitySupport.DecodeDensity(seqBuf); + DensitySupport.DensitySupportHeader? dens = + DensitySupport.DecodeDensity(seqBuf); if(dens.HasValue) { DicConsole.WriteLine("Densities supported by currently inserted media:"); - DicConsole.WriteLine(Decoders.SCSI.SSC.DensitySupport.PrettifyDensity(dens)); + DicConsole.WriteLine(DensitySupport.PrettifyDensity(dens)); } } } @@ -299,14 +312,14 @@ namespace DiscImageChef.Commands DataFile.WriteTo("Media-Info command", outputPrefix, "_ssc_reportdensitysupport_medium_media.bin", "SSC REPORT DENSITY SUPPORT (MEDIUM & MEDIA)", seqBuf); - Decoders.SCSI.SSC.DensitySupport.MediaTypeSupportHeader? meds = - Decoders.SCSI.SSC.DensitySupport.DecodeMediumType(seqBuf); + DensitySupport.MediaTypeSupportHeader? meds = + DensitySupport.DecodeMediumType(seqBuf); if(meds.HasValue) { DicConsole.WriteLine("Medium types currently inserted in device:"); - DicConsole.WriteLine(Decoders.SCSI.SSC.DensitySupport.PrettifyMediumType(meds)); + DicConsole.WriteLine(DensitySupport.PrettifyMediumType(meds)); } - DicConsole.WriteLine(Decoders.SCSI.SSC.DensitySupport.PrettifyMediumType(seqBuf)); + DicConsole.WriteLine(DensitySupport.PrettifyMediumType(seqBuf)); } } @@ -323,19 +336,19 @@ namespace DiscImageChef.Commands break; } - if(dev.ScsiType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice) + if(dev.ScsiType == PeripheralDeviceTypes.MultiMediaDevice) { sense = dev.GetConfiguration(out cmdBuf, out senseBuf, 0, MmcGetConfigurationRt.Current, dev.Timeout, out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ GET CONFIGURATION:\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else { DataFile.WriteTo("Media-Info command", outputPrefix, "_getconfiguration_current.bin", "SCSI GET CONFIGURATION", cmdBuf); - Decoders.SCSI.MMC.Features.SeparatedFeatures ftr = Decoders.SCSI.MMC.Features.Separate(cmdBuf); + Features.SeparatedFeatures ftr = Features.Separate(cmdBuf); DicConsole.DebugWriteLine("Media-Info command", "GET CONFIGURATION current profile is {0:X4}h", ftr.CurrentProfile); @@ -438,7 +451,7 @@ namespace DiscImageChef.Commands if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Recognized Format Layers\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_formatlayers.bin", "SCSI READ DISC STRUCTURE", cmdBuf); @@ -447,7 +460,7 @@ namespace DiscImageChef.Commands out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Write Protection Status\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_writeprotection.bin", "SCSI READ DISC STRUCTURE", cmdBuf); @@ -474,64 +487,64 @@ namespace DiscImageChef.Commands out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: PFI\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_pfi.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - Decoders.DVD.PFI.PhysicalFormatInformation? decPfi = Decoders.DVD.PFI.Decode(cmdBuf); + PFI.PhysicalFormatInformation? decPfi = PFI.Decode(cmdBuf); if(decPfi.HasValue) { - DicConsole.WriteLine("PFI:\n{0}", Decoders.DVD.PFI.Prettify(decPfi)); + DicConsole.WriteLine("PFI:\n{0}", PFI.Prettify(decPfi)); // False book types if(dskType == MediaType.DVDROM) switch(decPfi.Value.DiskCategory) { - case Decoders.DVD.DiskCategory.DVDPR: + case DiskCategory.DVDPR: dskType = MediaType.DVDPR; break; - case Decoders.DVD.DiskCategory.DVDPRDL: + case DiskCategory.DVDPRDL: dskType = MediaType.DVDPRDL; break; - case Decoders.DVD.DiskCategory.DVDPRW: + case DiskCategory.DVDPRW: dskType = MediaType.DVDPRW; break; - case Decoders.DVD.DiskCategory.DVDPRWDL: + case DiskCategory.DVDPRWDL: dskType = MediaType.DVDPRWDL; break; - case Decoders.DVD.DiskCategory.DVDR: + case DiskCategory.DVDR: if(decPfi.Value.PartVersion == 6) dskType = MediaType.DVDRDL; else dskType = MediaType.DVDR; break; - case Decoders.DVD.DiskCategory.DVDRAM: + case DiskCategory.DVDRAM: dskType = MediaType.DVDRAM; break; default: dskType = MediaType.DVDROM; break; - case Decoders.DVD.DiskCategory.DVDRW: + case DiskCategory.DVDRW: if(decPfi.Value.PartVersion == 3) dskType = MediaType.DVDRWDL; else dskType = MediaType.DVDRW; break; - case Decoders.DVD.DiskCategory.HDDVDR: + case DiskCategory.HDDVDR: dskType = MediaType.HDDVDR; break; - case Decoders.DVD.DiskCategory.HDDVDRAM: + case DiskCategory.HDDVDRAM: dskType = MediaType.HDDVDRAM; break; - case Decoders.DVD.DiskCategory.HDDVDROM: + case DiskCategory.HDDVDROM: dskType = MediaType.HDDVDROM; break; - case Decoders.DVD.DiskCategory.HDDVDRW: + case DiskCategory.HDDVDRW: dskType = MediaType.HDDVDRW; break; - case Decoders.DVD.DiskCategory.Nintendo: - if(decPfi.Value.DiscSize == Decoders.DVD.DVDSize.Eighty) + case DiskCategory.Nintendo: + if(decPfi.Value.DiscSize == DVDSize.Eighty) dskType = MediaType.GOD; else dskType = MediaType.WOD; break; - case Decoders.DVD.DiskCategory.UMD: + case DiskCategory.UMD: dskType = MediaType.UMD; break; } @@ -543,20 +556,20 @@ namespace DiscImageChef.Commands out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DMI\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_dmi.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - if(Decoders.Xbox.DMI.IsXbox(cmdBuf)) + if(DMI.IsXbox(cmdBuf)) { dskType = MediaType.XGD; - DicConsole.WriteLine("Xbox DMI:\n{0}", Decoders.Xbox.DMI.PrettifyXbox(cmdBuf)); + DicConsole.WriteLine("Xbox DMI:\n{0}", DMI.PrettifyXbox(cmdBuf)); } - else if(Decoders.Xbox.DMI.IsXbox360(cmdBuf)) + else if(DMI.IsXbox360(cmdBuf)) { dskType = MediaType.XGD2; - DicConsole.WriteLine("Xbox 360 DMI:\n{0}", Decoders.Xbox.DMI.PrettifyXbox360(cmdBuf)); + DicConsole.WriteLine("Xbox 360 DMI:\n{0}", DMI.PrettifyXbox360(cmdBuf)); // All XGD3 all have the same number of blocks if(blocks == 25063 || // Locked (or non compatible drive) @@ -576,13 +589,13 @@ namespace DiscImageChef.Commands out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: CMI\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_cmi.bin", "SCSI READ DISC STRUCTURE", cmdBuf); DicConsole.WriteLine("Lead-In CMI:\n{0}", - Decoders.DVD.CSS_CPRM.PrettifyLeadInCopyright(cmdBuf)); + CSS_CPRM.PrettifyLeadInCopyright(cmdBuf)); } } #endregion DVD-ROM @@ -597,7 +610,7 @@ namespace DiscImageChef.Commands out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: BCA\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_bca.bin", "SCSI READ DISC STRUCTURE", cmdBuf); @@ -605,7 +618,7 @@ namespace DiscImageChef.Commands MmcDiscStructureFormat.DvdAacs, 0, dev.Timeout, out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DVD AACS\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_aacs.bin", "SCSI READ DISC STRUCTURE", cmdBuf); @@ -616,36 +629,36 @@ namespace DiscImageChef.Commands MmcDiscStructureFormat.DvdramDds, 0, dev.Timeout, out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DDS\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdram_dds.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - DicConsole.WriteLine("Disc Definition Structure:\n{0}", Decoders.DVD.DDS.Prettify(cmdBuf)); + DicConsole.WriteLine("Disc Definition Structure:\n{0}", DDS.Prettify(cmdBuf)); } sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0, MmcDiscStructureFormat.DvdramMediumStatus, 0, dev.Timeout, out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Medium Status\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdram_status.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - DicConsole.WriteLine("Medium Status:\n{0}", Decoders.DVD.Cartridge.Prettify(cmdBuf)); + DicConsole.WriteLine("Medium Status:\n{0}", Cartridge.Prettify(cmdBuf)); } sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0, MmcDiscStructureFormat.DvdramSpareAreaInformation, 0, dev.Timeout, out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: SAI\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdram_spare.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - DicConsole.WriteLine("Spare Area Information:\n{0}", Decoders.DVD.Spare.Prettify(cmdBuf)); + DicConsole.WriteLine("Spare Area Information:\n{0}", Spare.Prettify(cmdBuf)); } break; case MediaType.DVDR: @@ -655,7 +668,7 @@ namespace DiscImageChef.Commands out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Last-Out Border RMD\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_lastrmd.bin", "SCSI READ DISC STRUCTURE", cmdBuf); @@ -736,7 +749,7 @@ namespace DiscImageChef.Commands MmcDiscStructureFormat.PreRecordedInfo, 0, dev.Timeout, out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Pre-Recorded Info\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_pri.bin", "SCSI READ DISC STRUCTURE", cmdBuf); @@ -753,7 +766,7 @@ namespace DiscImageChef.Commands out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DVD-R Media ID\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdr_mediaid.bin", "SCSI READ DISC STRUCTURE", cmdBuf); @@ -762,7 +775,7 @@ namespace DiscImageChef.Commands out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DVD-R PFI\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdr_pfi.bin", "SCSI READ DISC STRUCTURE", cmdBuf); @@ -777,7 +790,7 @@ namespace DiscImageChef.Commands MmcDiscStructureFormat.Adip, 0, dev.Timeout, out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: ADIP\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd+_adip.bin", "SCSI READ DISC STRUCTURE", cmdBuf); @@ -786,7 +799,7 @@ namespace DiscImageChef.Commands MmcDiscStructureFormat.Dcb, 0, dev.Timeout, out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DCB\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd+_dcb.bin", "SCSI READ DISC STRUCTURE", cmdBuf); @@ -799,7 +812,7 @@ namespace DiscImageChef.Commands out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: HDDVD CMI\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_hddvd_cmi.bin", "SCSI READ DISC STRUCTURE", cmdBuf); @@ -816,7 +829,7 @@ namespace DiscImageChef.Commands if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: HDDVD-R Medium Status\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_hddvdr_status.bin", "SCSI READ DISC STRUCTURE", cmdBuf); @@ -824,7 +837,7 @@ namespace DiscImageChef.Commands MmcDiscStructureFormat.HddvdrLastRmd, 0, dev.Timeout, out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Last RMD\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_hddvdr_lastrmd.bin", "SCSI READ DISC STRUCTURE", cmdBuf); @@ -840,7 +853,7 @@ namespace DiscImageChef.Commands out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Layer Capacity\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdr_layercap.bin", "SCSI READ DISC STRUCTURE", cmdBuf); @@ -854,7 +867,7 @@ namespace DiscImageChef.Commands MmcDiscStructureFormat.MiddleZoneStart, 0, dev.Timeout, out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Middle Zone Start\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_mzs.bin", "SCSI READ DISC STRUCTURE", cmdBuf); @@ -863,7 +876,7 @@ namespace DiscImageChef.Commands out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Jump Interval Size\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_jis.bin", "SCSI READ DISC STRUCTURE", cmdBuf); @@ -873,7 +886,7 @@ namespace DiscImageChef.Commands if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Manual Layer Jump Start LBA\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_manuallj.bin", "SCSI READ DISC STRUCTURE", cmdBuf); @@ -882,7 +895,7 @@ namespace DiscImageChef.Commands out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Remap Anchor Point\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_remapanchor.bin", "SCSI READ DISC STRUCTURE", cmdBuf); @@ -898,18 +911,18 @@ namespace DiscImageChef.Commands MmcDiscStructureFormat.DiscInformation, 0, dev.Timeout, out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DI\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_di.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - DicConsole.WriteLine("Blu-ray Disc Information:\n{0}", Decoders.Bluray.DI.Prettify(cmdBuf)); + DicConsole.WriteLine("Blu-ray Disc Information:\n{0}", DI.Prettify(cmdBuf)); } sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0, MmcDiscStructureFormat.Pac, 0, dev.Timeout, out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: PAC\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_pac.bin", "SCSI READ DISC STRUCTURE", cmdBuf); @@ -926,12 +939,12 @@ namespace DiscImageChef.Commands out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: BCA\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_bca.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - DicConsole.WriteLine("Blu-ray Burst Cutting Area:\n{0}", Decoders.Bluray.BCA.Prettify(cmdBuf)); + DicConsole.WriteLine("Blu-ray Burst Cutting Area:\n{0}", BCA.Prettify(cmdBuf)); } break; #endregion BD-ROM only @@ -944,7 +957,7 @@ namespace DiscImageChef.Commands MmcDiscStructureFormat.BdDds, 0, dev.Timeout, out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DDS\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_dds.bin", @@ -956,12 +969,12 @@ namespace DiscImageChef.Commands MmcDiscStructureFormat.CartridgeStatus, 0, dev.Timeout, out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Cartridge Status\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_cartstatus.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - DicConsole.WriteLine("Blu-ray Cartridge Status:\n{0}", Decoders.Bluray.DI.Prettify(cmdBuf)); + DicConsole.WriteLine("Blu-ray Cartridge Status:\n{0}", DI.Prettify(cmdBuf)); } sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0, MmcDiscStructureFormat.BdSpareAreaInformation, 0, dev.Timeout, @@ -969,19 +982,19 @@ namespace DiscImageChef.Commands if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Spare Area Information\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_spare.bin", "SCSI READ DISC STRUCTURE", cmdBuf); DicConsole.WriteLine("Blu-ray Spare Area Information:\n{0}", - Decoders.Bluray.DI.Prettify(cmdBuf)); + DI.Prettify(cmdBuf)); } sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0, MmcDiscStructureFormat.RawDfl, 0, dev.Timeout, out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Raw DFL\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_dfl.bin", "SCSI READ DISC STRUCTURE", cmdBuf); @@ -990,11 +1003,11 @@ namespace DiscImageChef.Commands out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC INFORMATION 001b\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else { DicConsole.WriteLine("Track Resources Information:\n{0}", - Decoders.SCSI.MMC.DiscInformation.Prettify(cmdBuf)); + DiscInformation.Prettify(cmdBuf)); DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscinformation_001b.bin", "SCSI READ DISC INFORMATION", cmdBuf); } @@ -1002,11 +1015,11 @@ namespace DiscImageChef.Commands dev.Timeout, out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC INFORMATION 010b\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else { DicConsole.WriteLine("POW Resources Information:\n{0}", - Decoders.SCSI.MMC.DiscInformation.Prettify(cmdBuf)); + DiscInformation.Prettify(cmdBuf)); DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscinformation_010b.bin", "SCSI READ DISC INFORMATION", cmdBuf); } @@ -1018,7 +1031,7 @@ namespace DiscImageChef.Commands case MediaType.CDROM: case MediaType.CDRW: case MediaType.Unknown: - Decoders.CD.TOC.CDTOC? toc = null; + TOC.CDTOC? toc = null; // We discarded all discs that falsify a TOC before requesting a real TOC // No TOC, no CD (or an empty one) @@ -1026,11 +1039,11 @@ namespace DiscImageChef.Commands dev.ReadTocPmaAtip(out cmdBuf, out senseBuf, false, 0, 0, dev.Timeout, out duration); if(tocSense) DicConsole.DebugWriteLine("Media-Info command", "READ TOC/PMA/ATIP: TOC\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else { - toc = Decoders.CD.TOC.Decode(cmdBuf); - DicConsole.WriteLine("TOC:\n{0}", Decoders.CD.TOC.Prettify(toc)); + toc = TOC.Decode(cmdBuf); + DicConsole.WriteLine("TOC:\n{0}", TOC.Prettify(toc)); DataFile.WriteTo("Media-Info command", outputPrefix, "_toc.bin", "SCSI READ TOC/PMA/ATIP", cmdBuf); @@ -1042,15 +1055,15 @@ namespace DiscImageChef.Commands sense = dev.ReadAtip(out cmdBuf, out senseBuf, dev.Timeout, out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ TOC/PMA/ATIP: ATIP\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else { DataFile.WriteTo("Media-Info command", outputPrefix, "_atip.bin", "SCSI READ TOC/PMA/ATIP", cmdBuf); - Decoders.CD.ATIP.CDATIP? atip = Decoders.CD.ATIP.Decode(cmdBuf); + ATIP.CDATIP? atip = ATIP.Decode(cmdBuf); if(atip.HasValue) { - DicConsole.WriteLine("ATIP:\n{0}", Decoders.CD.ATIP.Prettify(atip)); + DicConsole.WriteLine("ATIP:\n{0}", ATIP.Prettify(atip)); // Only CD-R and CD-RW have ATIP dskType = atip.Value.DiscType ? MediaType.CDRW : MediaType.CDR; } @@ -1064,15 +1077,15 @@ namespace DiscImageChef.Commands out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC INFORMATION 000b\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else { - Decoders.SCSI.MMC.DiscInformation.StandardDiscInformation? discInfo = - Decoders.SCSI.MMC.DiscInformation.Decode000b(cmdBuf); + DiscInformation.StandardDiscInformation? discInfo = + DiscInformation.Decode000b(cmdBuf); if(discInfo.HasValue) { DicConsole.WriteLine("Standard Disc Information:\n{0}", - Decoders.SCSI.MMC.DiscInformation.Prettify000b(discInfo)); + DiscInformation.Prettify000b(discInfo)); DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscinformation_000b.bin", "SCSI READ DISC INFORMATION", cmdBuf); @@ -1096,13 +1109,13 @@ namespace DiscImageChef.Commands sense = dev.ReadSessionInfo(out cmdBuf, out senseBuf, dev.Timeout, out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ TOC/PMA/ATIP: Session info\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else { DataFile.WriteTo("Media-Info command", outputPrefix, "_session.bin", "SCSI READ TOC/PMA/ATIP", cmdBuf); - Decoders.CD.Session.CDSessionInfo? session = Decoders.CD.Session.Decode(cmdBuf); - DicConsole.WriteLine("Session information:\n{0}", Decoders.CD.Session.Prettify(session)); + Session.CDSessionInfo? session = Session.Decode(cmdBuf); + DicConsole.WriteLine("Session information:\n{0}", Session.Prettify(session)); if(session.HasValue) { sessions = session.Value.LastCompleteSession; @@ -1118,18 +1131,18 @@ namespace DiscImageChef.Commands bool hasVideoTrack = false; if(toc.HasValue) - foreach(Decoders.CD.TOC.CDTOCTrackDataDescriptor track in toc.Value.TrackDescriptors) + foreach(TOC.CDTOCTrackDataDescriptor track in toc.Value.TrackDescriptors) { if(track.TrackNumber == 1 && - ((Decoders.CD.TOC_CONTROL)(track.CONTROL & 0x0D) == - Decoders.CD.TOC_CONTROL.DataTrack || - (Decoders.CD.TOC_CONTROL)(track.CONTROL & 0x0D) == - Decoders.CD.TOC_CONTROL.DataTrackIncremental)) allFirstSessionTracksAreAudio &= firstTrackLastSession != 1; + ((TOC_CONTROL)(track.CONTROL & 0x0D) == + TOC_CONTROL.DataTrack || + (TOC_CONTROL)(track.CONTROL & 0x0D) == + TOC_CONTROL.DataTrackIncremental)) allFirstSessionTracksAreAudio &= firstTrackLastSession != 1; - if((Decoders.CD.TOC_CONTROL)(track.CONTROL & 0x0D) == - Decoders.CD.TOC_CONTROL.DataTrack || - (Decoders.CD.TOC_CONTROL)(track.CONTROL & 0x0D) == - Decoders.CD.TOC_CONTROL.DataTrackIncremental) + if((TOC_CONTROL)(track.CONTROL & 0x0D) == + TOC_CONTROL.DataTrack || + (TOC_CONTROL)(track.CONTROL & 0x0D) == + TOC_CONTROL.DataTrackIncremental) { hasDataTrack = true; allFirstSessionTracksAreAudio &= track.TrackNumber >= firstTrackLastSession; @@ -1149,35 +1162,35 @@ namespace DiscImageChef.Commands sense = dev.ReadRawToc(out cmdBuf, out senseBuf, 1, dev.Timeout, out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ TOC/PMA/ATIP: Raw TOC\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else { DataFile.WriteTo("Media-Info command", outputPrefix, "_rawtoc.bin", "SCSI READ TOC/PMA/ATIP", cmdBuf); - DicConsole.WriteLine("Raw TOC:\n{0}", Decoders.CD.FullTOC.Prettify(cmdBuf)); + DicConsole.WriteLine("Raw TOC:\n{0}", FullTOC.Prettify(cmdBuf)); } sense = dev.ReadPma(out cmdBuf, out senseBuf, dev.Timeout, out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ TOC/PMA/ATIP: PMA\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else { DataFile.WriteTo("Media-Info command", outputPrefix, "_pma.bin", "SCSI READ TOC/PMA/ATIP", cmdBuf); - DicConsole.WriteLine("PMA:\n{0}", Decoders.CD.PMA.Prettify(cmdBuf)); + DicConsole.WriteLine("PMA:\n{0}", PMA.Prettify(cmdBuf)); } sense = dev.ReadCdText(out cmdBuf, out senseBuf, dev.Timeout, out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ TOC/PMA/ATIP: CD-TEXT\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else { DataFile.WriteTo("Media-Info command", outputPrefix, "_cdtext.bin", "SCSI READ TOC/PMA/ATIP", cmdBuf); - if(Decoders.CD.CDTextOnLeadIn.Decode(cmdBuf).HasValue) + if(CDTextOnLeadIn.Decode(cmdBuf).HasValue) DicConsole.WriteLine("CD-TEXT on Lead-In:\n{0}", - Decoders.CD.CDTextOnLeadIn.Prettify(cmdBuf)); + CDTextOnLeadIn.Prettify(cmdBuf)); } } @@ -1193,21 +1206,21 @@ namespace DiscImageChef.Commands out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: PFI\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_pfi.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - Decoders.DVD.PFI.PhysicalFormatInformation? nintendoPfi = Decoders.DVD.PFI.Decode(cmdBuf); + PFI.PhysicalFormatInformation? nintendoPfi = PFI.Decode(cmdBuf); if(nintendoPfi != null) { - DicConsole.WriteLine("PFI:\n{0}", Decoders.DVD.PFI.Prettify(cmdBuf)); - if(nintendoPfi.Value.DiskCategory == Decoders.DVD.DiskCategory.Nintendo && + DicConsole.WriteLine("PFI:\n{0}", PFI.Prettify(cmdBuf)); + if(nintendoPfi.Value.DiskCategory == DiskCategory.Nintendo && nintendoPfi.Value.PartVersion == 15) switch(nintendoPfi.Value.DiscSize) { - case Decoders.DVD.DVDSize.Eighty: dskType = MediaType.GOD; + case DVDSize.Eighty: dskType = MediaType.GOD; break; - case Decoders.DVD.DVDSize.OneTwenty: dskType = MediaType.WOD; + case DVDSize.OneTwenty: dskType = MediaType.WOD; break; } } @@ -1217,7 +1230,7 @@ namespace DiscImageChef.Commands out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DMI\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_dmi.bin", "SCSI READ DISC STRUCTURE", cmdBuf); @@ -1232,24 +1245,24 @@ namespace DiscImageChef.Commands case MediaType.XGD3: // We need to get INQUIRY to know if it is a Kreon drive byte[] inqBuffer; - Decoders.SCSI.Inquiry.SCSIInquiry? inq; + Inquiry.SCSIInquiry? inq; sense = dev.ScsiInquiry(out inqBuffer, out senseBuf); if(!sense) { - inq = Decoders.SCSI.Inquiry.Decode(inqBuffer); + inq = Inquiry.Decode(inqBuffer); if(inq.HasValue && inq.Value.KreonPresent) { sense = dev.KreonExtractSs(out cmdBuf, out senseBuf, dev.Timeout, out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "KREON EXTRACT SS:\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else DataFile.WriteTo("Media-Info command", outputPrefix, "_xbox_ss.bin", "KREON EXTRACT SS", cmdBuf); - if(Decoders.Xbox.SS.Decode(cmdBuf).HasValue) - DicConsole.WriteLine("Xbox Security Sector:\n{0}", Decoders.Xbox.SS.Prettify(cmdBuf)); + if(SS.Decode(cmdBuf).HasValue) + DicConsole.WriteLine("Xbox Security Sector:\n{0}", SS.Prettify(cmdBuf)); ulong l0Video, l1Video, middleZone, gameSize, totalSize, layerBreak; @@ -1280,8 +1293,8 @@ namespace DiscImageChef.Commands DicConsole.DebugWriteLine("Dump-media command", "Video partition total size: {0} sectors", totalSize); - l0Video = Decoders.DVD.PFI.Decode(cmdBuf).Value.Layer0EndPSN - - Decoders.DVD.PFI.Decode(cmdBuf).Value.DataAreaStartPSN + 1; + l0Video = PFI.Decode(cmdBuf).Value.Layer0EndPSN - + PFI.Decode(cmdBuf).Value.DataAreaStartPSN + 1; l1Video = totalSize - l0Video + 1; // Get game partition size @@ -1331,8 +1344,8 @@ namespace DiscImageChef.Commands DicConsole.DebugWriteLine("Dump-media command", "Unlocked total size: {0} sectors", totalSize); middleZone = - totalSize - (Decoders.DVD.PFI.Decode(cmdBuf).Value.Layer0EndPSN - - Decoders.DVD.PFI.Decode(cmdBuf).Value.DataAreaStartPSN + 1) - gameSize + 1; + totalSize - (PFI.Decode(cmdBuf).Value.Layer0EndPSN - + PFI.Decode(cmdBuf).Value.DataAreaStartPSN + 1) - gameSize + 1; totalSize = l0Video + l1Video + middleZone * 2 + gameSize; layerBreak = l0Video + middleZone + gameSize / 2; @@ -1363,7 +1376,7 @@ namespace DiscImageChef.Commands sense = dev.ReadMediaSerialNumber(out cmdBuf, out senseBuf, dev.Timeout, out duration); if(sense) DicConsole.DebugWriteLine("Media-Info command", "READ MEDIA SERIAL NUMBER\n{0}", - Decoders.SCSI.Sense.PrettifySense(senseBuf)); + Sense.PrettifySense(senseBuf)); else { DataFile.WriteTo("Media-Info command", outputPrefix, "_mediaserialnumber.bin", diff --git a/DiscImageChef/Commands/PrintHex.cs b/DiscImageChef/Commands/PrintHex.cs index fa1541fc3..15b6bcdb9 100644 --- a/DiscImageChef/Commands/PrintHex.cs +++ b/DiscImageChef/Commands/PrintHex.cs @@ -32,8 +32,8 @@ using DiscImageChef.Console; using DiscImageChef.Core; -using DiscImageChef.Filters; using DiscImageChef.DiscImages; +using DiscImageChef.Filters; namespace DiscImageChef.Commands { diff --git a/DiscImageChef/Commands/Verify.cs b/DiscImageChef/Commands/Verify.cs index 8f76239f0..ac3ad4c37 100644 --- a/DiscImageChef/Commands/Verify.cs +++ b/DiscImageChef/Commands/Verify.cs @@ -34,8 +34,8 @@ using System; using System.Collections.Generic; using DiscImageChef.Console; using DiscImageChef.Core; -using DiscImageChef.Filters; using DiscImageChef.DiscImages; +using DiscImageChef.Filters; namespace DiscImageChef.Commands { diff --git a/DiscImageChef/Main.cs b/DiscImageChef/Main.cs index e02afebce..d5678b7fd 100644 --- a/DiscImageChef/Main.cs +++ b/DiscImageChef/Main.cs @@ -33,7 +33,9 @@ using System; using System.Reflection; using CommandLine; +using DiscImageChef.Commands; using DiscImageChef.Console; +using Statistics = DiscImageChef.Core.Statistics; namespace DiscImageChef { @@ -46,51 +48,40 @@ namespace DiscImageChef DicConsole.ErrorWriteLineEvent += System.Console.Error.WriteLine; Settings.Settings.LoadSettings(); - Core.Statistics.LoadStats(); - if(Settings.Settings.Current.Stats.ShareStats) Core.Statistics.SubmitStats(); + Statistics.LoadStats(); + if(Settings.Settings.Current.Stats.ShareStats) Statistics.SubmitStats(); Parser.Default - .ParseArguments(args, - new[] - { - typeof(AnalyzeOptions), typeof(CompareOptions), typeof(ChecksumOptions), - typeof(EntropyOptions), typeof(VerifyOptions), typeof(PrintHexOptions), - typeof(DecodeOptions), typeof(DeviceInfoOptions), typeof(MediaInfoOptions), - typeof(MediaScanOptions), typeof(FormatsOptions), typeof(BenchmarkOptions), - typeof(CreateSidecarOptions), typeof(DumpMediaOptions), - typeof(DeviceReportOptions), typeof(ConfigureOptions), typeof(StatsOptions), - typeof(LsOptions), typeof(ExtractFilesOptions), typeof(ListDevicesOptions), - typeof(ListEncodingsOptions) - }).WithParsed(opts => + .ParseArguments(args, typeof(AnalyzeOptions), typeof(CompareOptions), typeof(ChecksumOptions), typeof(EntropyOptions), typeof(VerifyOptions), typeof(PrintHexOptions), typeof(DecodeOptions), typeof(DeviceInfoOptions), typeof(MediaInfoOptions), typeof(MediaScanOptions), typeof(FormatsOptions), typeof(BenchmarkOptions), typeof(CreateSidecarOptions), typeof(DumpMediaOptions), typeof(DeviceReportOptions), typeof(ConfigureOptions), typeof(StatsOptions), typeof(LsOptions), typeof(ExtractFilesOptions), typeof(ListDevicesOptions), typeof(ListEncodingsOptions)).WithParsed(opts => { if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine; if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine; PrintCopyright(); - Commands.Analyze.DoAnalyze(opts); + Analyze.DoAnalyze(opts); }).WithParsed(opts => { if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine; if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine; PrintCopyright(); - Commands.Compare.DoCompare(opts); + Compare.DoCompare(opts); }).WithParsed(opts => { if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine; if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine; PrintCopyright(); - Commands.Checksum.DoChecksum(opts); + Checksum.DoChecksum(opts); }).WithParsed(opts => { if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine; if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine; PrintCopyright(); - Commands.Entropy.DoEntropy(opts); + Entropy.DoEntropy(opts); }).WithParsed(opts => { if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine; if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine; PrintCopyright(); - Commands.Verify.DoVerify(opts); + Verify.DoVerify(opts); }).WithParsed(opts => { if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine; @@ -102,90 +93,90 @@ namespace DiscImageChef if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine; if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine; PrintCopyright(); - Commands.Decode.DoDecode(opts); + Decode.DoDecode(opts); }).WithParsed(opts => { if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine; if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine; PrintCopyright(); - Commands.DeviceInfo.DoDeviceInfo(opts); + DeviceInfo.DoDeviceInfo(opts); }).WithParsed(opts => { if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine; if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine; PrintCopyright(); - Commands.MediaInfo.DoMediaInfo(opts); + MediaInfo.DoMediaInfo(opts); }).WithParsed(opts => { if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine; if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine; PrintCopyright(); - Commands.MediaScan.DoMediaScan(opts); + MediaScan.DoMediaScan(opts); }).WithParsed(opts => { if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine; if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine; PrintCopyright(); - Commands.Formats.ListFormats(opts); + Formats.ListFormats(opts); }).WithParsed(opts => { if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine; if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine; PrintCopyright(); - Commands.Benchmark.DoBenchmark(opts); + Benchmark.DoBenchmark(opts); }).WithParsed(opts => { if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine; if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine; PrintCopyright(); - Commands.CreateSidecar.DoSidecar(opts); + CreateSidecar.DoSidecar(opts); }).WithParsed(opts => { if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine; if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine; PrintCopyright(); - Commands.DumpMedia.DoDumpMedia(opts); + DumpMedia.DoDumpMedia(opts); }).WithParsed(opts => { if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine; if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine; PrintCopyright(); - Commands.DeviceReport.DoDeviceReport(opts); + DeviceReport.DoDeviceReport(opts); }).WithParsed(opts => { if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine; if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine; PrintCopyright(); - Commands.Ls.DoLs(opts); + Ls.DoLs(opts); }).WithParsed(opts => { if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine; if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine; PrintCopyright(); - Commands.ExtractFiles.DoExtractFiles(opts); + ExtractFiles.DoExtractFiles(opts); }).WithParsed(opts => { if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine; if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine; PrintCopyright(); - Commands.ListDevices.DoListDevices(opts); + ListDevices.DoListDevices(opts); }).WithParsed(opts => { if(opts.Debug) DicConsole.DebugWriteLineEvent += System.Console.Error.WriteLine; if(opts.Verbose) DicConsole.VerboseWriteLineEvent += System.Console.WriteLine; PrintCopyright(); - Commands.ListEncodings.DoList(opts); + ListEncodings.DoList(opts); }).WithParsed(opts => { PrintCopyright(); - Commands.Configure.DoConfigure(); + Configure.DoConfigure(); }).WithParsed(opts => { PrintCopyright(); Commands.Statistics.ShowStats(); }).WithNotParsed(errs => Environment.Exit(1)); - Core.Statistics.SaveStats(); + Statistics.SaveStats(); } static void PrintCopyright() diff --git a/DiscImageChef/Options.cs b/DiscImageChef/Options.cs index 3e8d89094..0daba47f3 100644 --- a/DiscImageChef/Options.cs +++ b/DiscImageChef/Options.cs @@ -31,6 +31,7 @@ // ****************************************************************************/ using CommandLine; + // ReSharper disable MemberCanBeInternal // ReSharper disable UnusedAutoPropertyAccessor.Global