diff --git a/DiscImageChef.Core/DataFile.cs b/DiscImageChef.Core/DataFile.cs index 70ac12a0..f1e45fd8 100644 --- a/DiscImageChef.Core/DataFile.cs +++ b/DiscImageChef.Core/DataFile.cs @@ -107,14 +107,12 @@ namespace DiscImageChef.Core if(!string.IsNullOrEmpty(filename)) { if(File.Exists(filename)) - { if(overwrite) File.Delete(filename); else { DicConsole.ErrorWriteLine("Not overwriting file {0}", filename); return; } - } try { diff --git a/DiscImageChef.Core/Devices/Dumping/ATA.cs b/DiscImageChef.Core/Devices/Dumping/ATA.cs index f60841f5..386a0137 100644 --- a/DiscImageChef.Core/Devices/Dumping/ATA.cs +++ b/DiscImageChef.Core/Devices/Dumping/ATA.cs @@ -117,9 +117,7 @@ namespace DiscImageChef.Core.Devices.Dumping dumpLog.WriteLine("Decoding PCMCIA CIS."); Decoders.PCMCIA.Tuple[] tuples = CIS.GetTuples(dev.Cis); if(tuples != null) - { foreach(Decoders.PCMCIA.Tuple tuple in tuples) - { if(tuple.Code == TupleCodes.CISTPL_MANFID) { ManufacturerIdentificationTuple manfid = @@ -146,8 +144,6 @@ namespace DiscImageChef.Core.Devices.Dumping sidecar.BlockMedia[0].PCMCIA.AdditionalInformation = vers.AdditionalInformation; } } - } - } } sidecar.BlockMedia[0].ATA = new ATAType @@ -506,7 +502,6 @@ namespace DiscImageChef.Core.Devices.Dumping partitions[i].Scheme); foreach(Filesystem plugin in plugins.PluginsList.Values) - { try { if(plugin.Identify(imageFormat, partitions[i])) @@ -523,7 +518,6 @@ namespace DiscImageChef.Core.Devices.Dumping { //DicConsole.DebugWriteLine("Dump-media command", "Plugin {0} crashed", _plugin.Name); } - } if(lstFs.Count > 0) xmlFileSysInfo[i].FileSystems = lstFs.ToArray(); } @@ -544,7 +538,6 @@ namespace DiscImageChef.Core.Devices.Dumping }; foreach(Filesystem plugin in plugins.PluginsList.Values) - { try { if(plugin.Identify(imageFormat, wholePart)) @@ -561,7 +554,6 @@ namespace DiscImageChef.Core.Devices.Dumping { //DicConsole.DebugWriteLine("Create-sidecar command", "Plugin {0} crashed", _plugin.Name); } - } if(lstFs.Count > 0) xmlFileSysInfo[0].FileSystems = lstFs.ToArray(); } diff --git a/DiscImageChef.Core/Devices/Dumping/MMC.cs b/DiscImageChef.Core/Devices/Dumping/MMC.cs index f75e8e10..ac0e6118 100644 --- a/DiscImageChef.Core/Devices/Dumping/MMC.cs +++ b/DiscImageChef.Core/Devices/Dumping/MMC.cs @@ -188,7 +188,6 @@ namespace DiscImageChef.Core.Devices.Dumping { Decoders.DVD.PFI.PhysicalFormatInformation? nintendoPfi = Decoders.DVD.PFI.Decode(cmdBuf); if(nintendoPfi != null) - { if(nintendoPfi.Value.DiskCategory == Decoders.DVD.DiskCategory.Nintendo && nintendoPfi.Value.PartVersion == 15) { @@ -196,7 +195,6 @@ namespace DiscImageChef.Core.Devices.Dumping throw new NotImplementedException("Dumping Nintendo GameCube or Wii discs is not yet implemented."); } - } } } #endregion Nintendo @@ -232,7 +230,6 @@ namespace DiscImageChef.Core.Devices.Dumping // False book types if(dskType == MediaType.DVDROM) - { switch(decPfi.DiskCategory) { case Decoders.DVD.DiskCategory.DVDPR: @@ -281,7 +278,6 @@ namespace DiscImageChef.Core.Devices.Dumping dskType = MediaType.UMD; break; } - } } } @@ -353,7 +349,6 @@ namespace DiscImageChef.Core.Devices.Dumping MmcDiscStructureFormat.CopyrightInformation, 0, dev.Timeout, out duration); if(!sense) - { if(Decoders.DVD.CSS_CPRM.DecodeLeadInCopyright(cmdBuf).HasValue) { tmpBuf = new byte[cmdBuf.Length - 4]; @@ -371,7 +366,6 @@ namespace DiscImageChef.Core.Devices.Dumping if(cpy.CopyrightType != Decoders.DVD.CopyrightType.NoProtection) sidecar.OpticalDisc[0].CopyProtection = cpy.CopyrightType.ToString(); } - } } #endregion DVD-ROM @@ -404,7 +398,6 @@ 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) { tmpBuf = new byte[cmdBuf.Length - 4]; @@ -417,14 +410,12 @@ namespace DiscImageChef.Core.Devices.Dumping }; DataFile.WriteTo("SCSI Dump", sidecar.OpticalDisc[0].DDS.Image, tmpBuf); } - } dumpLog.WriteLine("Reading Spare Area Information."); sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0, MmcDiscStructureFormat.DvdramSpareAreaInformation, 0, dev.Timeout, out duration); if(!sense) - { if(Decoders.DVD.Spare.Decode(cmdBuf).HasValue) { tmpBuf = new byte[cmdBuf.Length - 4]; @@ -437,7 +428,6 @@ namespace DiscImageChef.Core.Devices.Dumping }; DataFile.WriteTo("SCSI Dump", sidecar.OpticalDisc[0].SAI.Image, tmpBuf); } - } } #endregion DVD-RAM and HD DVD-RAM @@ -569,7 +559,6 @@ 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) { tmpBuf = new byte[cmdBuf.Length - 4]; @@ -582,7 +571,6 @@ namespace DiscImageChef.Core.Devices.Dumping }; DataFile.WriteTo("SCSI Dump", sidecar.OpticalDisc[0].DI.Image, tmpBuf); } - } dumpLog.WriteLine("Reading PAC."); sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0, diff --git a/DiscImageChef.Core/Devices/Dumping/SSC.cs b/DiscImageChef.Core/Devices/Dumping/SSC.cs index 4d597bd2..9af3e471 100644 --- a/DiscImageChef.Core/Devices/Dumping/SSC.cs +++ b/DiscImageChef.Core/Devices/Dumping/SSC.cs @@ -217,15 +217,12 @@ namespace DiscImageChef.Core.Devices.Dumping sense = dev.ModeSense10(out cmdBuf, out senseBuf, false, true, ScsiModeSensePageControl.Current, 0x3F, 0xFF, 5, out duration); if(!sense || dev.Error) - { sense = dev.ModeSense10(out cmdBuf, out senseBuf, false, true, ScsiModeSensePageControl.Current, 0x3F, 0x00, 5, out duration); - } Decoders.SCSI.Modes.DecodedMode? decMode = null; if(!sense && !dev.Error) - { if(Decoders.SCSI.Modes.DecodeMode10(cmdBuf, dev.ScsiType).HasValue) { decMode = Decoders.SCSI.Modes.DecodeMode10(cmdBuf, dev.ScsiType); @@ -237,7 +234,6 @@ namespace DiscImageChef.Core.Devices.Dumping }; DataFile.WriteTo("SCSI Dump", sidecar.BlockMedia[0].SCSI.ModeSense10.Image, cmdBuf); } - } dumpLog.WriteLine("Requesting MODE SENSE (6)."); sense = dev.ModeSense6(out cmdBuf, out senseBuf, false, ScsiModeSensePageControl.Current, 0x3F, 0x00, 5, @@ -248,7 +244,6 @@ 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) { decMode = Decoders.SCSI.Modes.DecodeMode6(cmdBuf, dev.ScsiType); @@ -260,7 +255,6 @@ namespace DiscImageChef.Core.Devices.Dumping }; DataFile.WriteTo("SCSI Dump", sidecar.BlockMedia[0].SCSI.ModeSense.Image, cmdBuf); } - } // TODO: Check partitions page if(decMode.HasValue) @@ -302,7 +296,6 @@ namespace DiscImageChef.Core.Devices.Dumping { fxSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf, out strSense); if(fxSense.HasValue) - { if(fxSense.Value.SenseKey == Decoders.SCSI.SenseKeys.IllegalRequest) { sense = dev.Space(out senseBuf, SscSpaceCodes.LogicalBlock, -1, dev.Timeout, out duration); @@ -346,7 +339,6 @@ namespace DiscImageChef.Core.Devices.Dumping fxSense.Value.SenseKey, fxSense.Value.ASC, fxSense.Value.ASCQ); return; } - } else { DicConsole.WriteLine(); diff --git a/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs b/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs index a421650a..ee226032 100644 --- a/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs +++ b/DiscImageChef.Core/Devices/Dumping/SecureDigital.cs @@ -489,7 +489,6 @@ namespace DiscImageChef.Core.Devices.Dumping partitions[i].Scheme); foreach(Filesystem plugin in plugins.PluginsList.Values) - { try { if(plugin.Identify(imageFormat, partitions[i])) @@ -506,7 +505,6 @@ namespace DiscImageChef.Core.Devices.Dumping { //DicConsole.DebugWriteLine("Dump-media command", "Plugin {0} crashed", _plugin.Name); } - } if(lstFs.Count > 0) xmlFileSysInfo[i].FileSystems = lstFs.ToArray(); } @@ -523,7 +521,6 @@ namespace DiscImageChef.Core.Devices.Dumping new Partition {Name = "Whole device", Length = blocks, Size = blocks * blockSize}; foreach(Filesystem plugin in plugins.PluginsList.Values) - { try { if(plugin.Identify(imageFormat, wholePart)) @@ -540,7 +537,6 @@ namespace DiscImageChef.Core.Devices.Dumping { //DicConsole.DebugWriteLine("Create-sidecar command", "Plugin {0} crashed", _plugin.Name); } - } if(lstFs.Count > 0) xmlFileSysInfo[0].FileSystems = lstFs.ToArray(); } diff --git a/DiscImageChef.Core/Devices/ReaderATA.cs b/DiscImageChef.Core/Devices/ReaderATA.cs index fc110f44..e6e95e42 100644 --- a/DiscImageChef.Core/Devices/ReaderATA.cs +++ b/DiscImageChef.Core/Devices/ReaderATA.cs @@ -200,10 +200,8 @@ namespace DiscImageChef.Core.Devices if((ataId.PhysLogSectorSize & 0x8000) == 0x0000 && (ataId.PhysLogSectorSize & 0x4000) == 0x4000) { if((ataId.PhysLogSectorSize & 0x1000) == 0x1000) - { if(ataId.LogicalSectorWords <= 255 || ataId.LogicalAlignment == 0xFFFF) blockSize = 512; else blockSize = ataId.LogicalSectorWords * 2; - } else blockSize = 512; if((ataId.PhysLogSectorSize & 0x2000) == 0x2000) diff --git a/DiscImageChef.Core/Devices/ReaderSCSI.cs b/DiscImageChef.Core/Devices/ReaderSCSI.cs index f63bf97e..9820f71b 100644 --- a/DiscImageChef.Core/Devices/ReaderSCSI.cs +++ b/DiscImageChef.Core/Devices/ReaderSCSI.cs @@ -137,7 +137,6 @@ namespace DiscImageChef.Core.Devices { decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf); if(decSense.HasValue) - { if(decSense.Value.SenseKey == Decoders.SCSI.SenseKeys.IllegalRequest && decSense.Value.ASC == 0x24 && decSense.Value.ASCQ == 0x00) { @@ -149,13 +148,10 @@ namespace DiscImageChef.Core.Devices (ushort)longBlockSize, timeout, out duration); } } - } } if(readRaw && longBlockSize == blockSize) - { if(blockSize == 512) - { foreach(ushort testSize in new[] { // Long sector sizes for floppies @@ -186,9 +182,7 @@ namespace DiscImageChef.Core.Devices break; } } - } else if(blockSize == 1024) - { foreach(ushort testSize in new[] { // Long sector sizes for floppies @@ -217,7 +211,6 @@ namespace DiscImageChef.Core.Devices break; } } - } else if(blockSize == 2048) { testSense = dev.ReadLong16(out readBuffer, out senseBuf, false, 0, 2380, timeout, @@ -284,7 +277,6 @@ namespace DiscImageChef.Core.Devices } } } - } if(!readRaw && dev.Manufacturer == "SYQUEST") { @@ -294,7 +286,6 @@ namespace DiscImageChef.Core.Devices { decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf); if(decSense.HasValue) - { if(decSense.Value.SenseKey == Decoders.SCSI.SenseKeys.IllegalRequest && decSense.Value.ASC == 0x24 && decSense.Value.ASCQ == 0x00) { @@ -315,7 +306,6 @@ namespace DiscImageChef.Core.Devices { decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuf); if(decSense.HasValue) - { if(decSense.Value.SenseKey == Decoders.SCSI.SenseKeys.IllegalRequest && decSense.Value.ASC == 0x24 && decSense.Value.ASCQ == 0x00) { @@ -328,10 +318,8 @@ namespace DiscImageChef.Core.Devices longBlockSize, timeout, out duration); } } - } } } - } } if(!readRaw && blockSize == 256) @@ -350,16 +338,12 @@ namespace DiscImageChef.Core.Devices else { if(dev.Manufacturer == "HL-DT-ST") - { hldtstReadRaw = !dev.HlDtStReadRawDvd(out readBuffer, out senseBuf, 0, 1, timeout, out duration); - } if(dev.Manufacturer == "PLEXTOR") - { plextorReadRaw = !dev.PlextorReadRawDvd(out readBuffer, out senseBuf, 0, 1, timeout, out duration); - } if(hldtstReadRaw || plextorReadRaw) { @@ -419,8 +403,6 @@ namespace DiscImageChef.Core.Devices sense = dev.ReadCapacity16(out cmdBuf, out senseBuf, timeout, out duration); if(sense && blocks == 0) - { - // Not all MMC devices support READ CAPACITY, as they have READ TOC if(dev.ScsiType != Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice) { errorMessage = string.Format("Unable to get media capacity\n" + "{0}", @@ -428,7 +410,6 @@ namespace DiscImageChef.Core.Devices return true; } - } if(!sense) { @@ -502,61 +483,39 @@ namespace DiscImageChef.Core.Devices duration = 0; if(readRaw) - { if(readLong16) - { sense = dev.ReadLong16(out buffer, out senseBuf, false, block, longBlockSize, timeout, out duration); - } else if(readLong10) - { sense = dev.ReadLong10(out buffer, out senseBuf, false, false, (uint)block, (ushort)longBlockSize, timeout, out duration); - } else if(syqReadLong10) - { sense = dev.SyQuestReadLong10(out buffer, out senseBuf, (uint)block, longBlockSize, timeout, out duration); - } else if(syqReadLong6) - { sense = dev.SyQuestReadLong6(out buffer, out senseBuf, (uint)block, longBlockSize, timeout, out duration); - } else if(hldtstReadRaw) - { sense = dev.HlDtStReadRawDvd(out buffer, out senseBuf, (uint)block, longBlockSize, timeout, out duration); - } else if(plextorReadRaw) - { sense = dev.PlextorReadRawDvd(out buffer, out senseBuf, (uint)block, longBlockSize, timeout, out duration); - } else return true; - } else { if(read16) - { sense = dev.Read16(out buffer, out senseBuf, 0, false, true, false, block, blockSize, 0, count, false, timeout, out duration); - } else if(read12) - { sense = dev.Read12(out buffer, out senseBuf, 0, false, false, false, false, (uint)block, blockSize, 0, count, false, timeout, out duration); - } else if(read10) - { sense = dev.Read10(out buffer, out senseBuf, 0, false, true, false, false, (uint)block, blockSize, 0, (ushort)count, timeout, out duration); - } else if(read6) - { sense = dev.Read6(out buffer, out senseBuf, (uint)block, blockSize, (byte)count, timeout, out duration); - } else return true; } diff --git a/DiscImageChef.Core/Devices/Report/ATA.cs b/DiscImageChef.Core/Devices/Report/ATA.cs index a359217c..65832f28 100644 --- a/DiscImageChef.Core/Devices/Report/ATA.cs +++ b/DiscImageChef.Core/Devices/Report/ATA.cs @@ -553,11 +553,9 @@ namespace DiscImageChef.Core.Devices.Report mediaTest.CurrentCHS.Heads = ataId.CurrentHeads; mediaTest.CurrentCHS.Sectors = ataId.CurrentSectorsPerTrack; if(mediaTest.Blocks == 0) - { mediaTest.Blocks = (ulong)(ataId.CurrentCylinders * ataId.CurrentHeads * ataId.CurrentSectorsPerTrack); - } mediaTest.BlocksSpecified = true; } @@ -578,7 +576,6 @@ namespace DiscImageChef.Core.Devices.Report } if(ataId.NominalRotationRate != 0x0000 && ataId.NominalRotationRate != 0xFFFF) - { if(ataId.NominalRotationRate == 0x0001) { mediaTest.SolidStateDevice = true; @@ -591,7 +588,6 @@ namespace DiscImageChef.Core.Devices.Report mediaTest.NominalRotationRate = ataId.NominalRotationRate; mediaTest.NominalRotationRateSpecified = true; } - } uint logicalsectorsize = 0; uint physicalsectorsize; @@ -599,11 +595,9 @@ namespace DiscImageChef.Core.Devices.Report (ataId.PhysLogSectorSize & 0x4000) == 0x4000) { if((ataId.PhysLogSectorSize & 0x1000) == 0x1000) - { if(ataId.LogicalSectorWords <= 255 || ataId.LogicalAlignment == 0xFFFF) logicalsectorsize = 512; else logicalsectorsize = ataId.LogicalSectorWords * 2; - } else logicalsectorsize = 512; if((ataId.PhysLogSectorSize & 0x2000) == 0x2000) @@ -698,11 +692,9 @@ namespace DiscImageChef.Core.Devices.Report "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, errorChs.status, errorChs.error, readBuf.Length); if(debug) - { DataFile.WriteTo("ATA Report", "readsectorschs", "_debug_" + mediaTest.MediumTypeName + ".bin", "read results", readBuf); - } DicConsole.WriteLine("Trying READ SECTOR(S) RETRY in CHS mode..."); sense = dev.Read(out readBuf, out errorChs, true, 0, 0, 1, 1, timeout, out duration); @@ -713,11 +705,9 @@ namespace DiscImageChef.Core.Devices.Report "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, errorChs.status, errorChs.error, readBuf.Length); if(debug) - { DataFile.WriteTo("ATA Report", "readsectorsretrychs", "_debug_" + mediaTest.MediumTypeName + ".bin", "read results", readBuf); - } DicConsole.WriteLine("Trying READ DMA in CHS mode..."); sense = dev.ReadDma(out readBuf, out errorChs, false, 0, 0, 1, 1, timeout, @@ -729,11 +719,9 @@ namespace DiscImageChef.Core.Devices.Report "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, errorChs.status, errorChs.error, readBuf.Length); if(debug) - { DataFile.WriteTo("ATA Report", "readdmachs", "_debug_" + mediaTest.MediumTypeName + ".bin", "read results", readBuf); - } DicConsole.WriteLine("Trying READ DMA RETRY in CHS mode..."); sense = dev.ReadDma(out readBuf, out errorChs, true, 0, 0, 1, 1, timeout, out duration); @@ -744,11 +732,9 @@ namespace DiscImageChef.Core.Devices.Report "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, errorChs.status, errorChs.error, readBuf.Length); if(debug) - { DataFile.WriteTo("ATA Report", "readdmaretrychs", "_debug_" + mediaTest.MediumTypeName + ".bin", "read results", readBuf); - } DicConsole.WriteLine("Trying SEEK in CHS mode..."); sense = dev.Seek(out errorChs, 0, 0, 1, timeout, out duration); @@ -767,11 +753,9 @@ namespace DiscImageChef.Core.Devices.Report "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, errorChs.status, errorChs.error, readBuf.Length); if(debug) - { DataFile.WriteTo("ATA Report", "readsectors", "_debug_" + mediaTest.MediumTypeName + ".bin", "read results", readBuf); - } DicConsole.WriteLine("Trying READ SECTOR(S) RETRY in LBA mode..."); sense = dev.Read(out readBuf, out errorLba, true, 0, 1, timeout, out duration); @@ -782,11 +766,9 @@ namespace DiscImageChef.Core.Devices.Report "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, errorChs.status, errorChs.error, readBuf.Length); if(debug) - { DataFile.WriteTo("ATA Report", "readsectorsretry", "_debug_" + mediaTest.MediumTypeName + ".bin", "read results", readBuf); - } DicConsole.WriteLine("Trying READ DMA in LBA mode..."); sense = dev.ReadDma(out readBuf, out errorLba, false, 0, 1, timeout, out duration); @@ -797,11 +779,9 @@ namespace DiscImageChef.Core.Devices.Report "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, errorChs.status, errorChs.error, readBuf.Length); if(debug) - { DataFile.WriteTo("ATA Report", "readdma", "_debug_" + mediaTest.MediumTypeName + ".bin", "read results", readBuf); - } DicConsole.WriteLine("Trying READ DMA RETRY in LBA mode..."); sense = dev.ReadDma(out readBuf, out errorLba, true, 0, 1, timeout, out duration); @@ -812,11 +792,9 @@ namespace DiscImageChef.Core.Devices.Report "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, errorChs.status, errorChs.error, readBuf.Length); if(debug) - { DataFile.WriteTo("ATA Report", "readdmaretry", "_debug_" + mediaTest.MediumTypeName + ".bin", "read results", readBuf); - } DicConsole.WriteLine("Trying SEEK in LBA mode..."); sense = dev.Seek(out errorLba, 0, timeout, out duration); @@ -835,11 +813,9 @@ namespace DiscImageChef.Core.Devices.Report "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, errorChs.status, errorChs.error, readBuf.Length); if(debug) - { DataFile.WriteTo("ATA Report", "readsectors48", "_debug_" + mediaTest.MediumTypeName + ".bin", "read results", readBuf); - } DicConsole.WriteLine("Trying READ DMA in LBA48 mode..."); sense = dev.ReadDma(out readBuf, out errorLba48, 0, 1, timeout, out duration); @@ -850,11 +826,9 @@ namespace DiscImageChef.Core.Devices.Report "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, errorChs.status, errorChs.error, readBuf.Length); if(debug) - { DataFile.WriteTo("ATA Report", "readdma48", "_debug_" + mediaTest.MediumTypeName + ".bin", "read results", readBuf); - } DicConsole.WriteLine("Trying READ LONG in CHS mode..."); sense = dev.ReadLong(out readBuf, out errorChs, false, 0, 0, 1, mediaTest.LongBlockSize, @@ -866,11 +840,9 @@ namespace DiscImageChef.Core.Devices.Report "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, errorChs.status, errorChs.error, readBuf.Length); if(debug) - { DataFile.WriteTo("ATA Report", "readlongchs", "_debug_" + mediaTest.MediumTypeName + ".bin", "read results", readBuf); - } DicConsole.WriteLine("Trying READ LONG RETRY in CHS mode..."); sense = dev.ReadLong(out readBuf, out errorChs, true, 0, 0, 1, mediaTest.LongBlockSize, @@ -882,11 +854,9 @@ namespace DiscImageChef.Core.Devices.Report "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, errorChs.status, errorChs.error, readBuf.Length); if(debug) - { DataFile.WriteTo("ATA Report", "readlongretrychs", "_debug_" + mediaTest.MediumTypeName + ".bin", "read results", readBuf); - } DicConsole.WriteLine("Trying READ LONG in LBA mode..."); sense = dev.ReadLong(out readBuf, out errorLba, false, 0, mediaTest.LongBlockSize, @@ -898,11 +868,9 @@ namespace DiscImageChef.Core.Devices.Report "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, errorChs.status, errorChs.error, readBuf.Length); if(debug) - { DataFile.WriteTo("ATA Report", "readlong", "_debug_" + mediaTest.MediumTypeName + ".bin", "read results", readBuf); - } DicConsole.WriteLine("Trying READ LONG RETRY in LBA mode..."); sense = dev.ReadLong(out readBuf, out errorLba, true, 0, mediaTest.LongBlockSize, @@ -914,11 +882,9 @@ namespace DiscImageChef.Core.Devices.Report "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, errorChs.status, errorChs.error, readBuf.Length); if(debug) - { DataFile.WriteTo("ATA Report", "readlongretry", "_debug_" + mediaTest.MediumTypeName + ".bin", "read results", readBuf); - } } else mediaTest.MediaIsRecognized = false; @@ -982,7 +948,6 @@ namespace DiscImageChef.Core.Devices.Report } if(ataId.NominalRotationRate != 0x0000 && ataId.NominalRotationRate != 0xFFFF) - { if(ataId.NominalRotationRate == 0x0001) { report.ATA.ReadCapabilities.SolidStateDevice = true; @@ -995,18 +960,15 @@ namespace DiscImageChef.Core.Devices.Report report.ATA.ReadCapabilities.NominalRotationRate = ataId.NominalRotationRate; report.ATA.ReadCapabilities.NominalRotationRateSpecified = true; } - } uint logicalsectorsize = 0; uint physicalsectorsize; if((ataId.PhysLogSectorSize & 0x8000) == 0x0000 && (ataId.PhysLogSectorSize & 0x4000) == 0x4000) { if((ataId.PhysLogSectorSize & 0x1000) == 0x1000) - { if(ataId.LogicalSectorWords <= 255 || ataId.LogicalAlignment == 0xFFFF) logicalsectorsize = 512; else logicalsectorsize = ataId.LogicalSectorWords * 2; - } else logicalsectorsize = 512; if((ataId.PhysLogSectorSize & 0x2000) == 0x2000) @@ -1100,10 +1062,8 @@ namespace DiscImageChef.Core.Devices.Report "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, errorChs.status, errorChs.error, readBuf.Length); if(debug) - { DataFile.WriteTo("ATA Report", "readsectorschs", "_debug_" + report.ATA.Model + ".bin", "read results", readBuf); - } DicConsole.WriteLine("Trying READ SECTOR(S) RETRY in CHS mode..."); sense = dev.Read(out readBuf, out errorChs, true, 0, 0, 1, 1, timeout, out duration); @@ -1113,10 +1073,8 @@ namespace DiscImageChef.Core.Devices.Report "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, errorChs.status, errorChs.error, readBuf.Length); if(debug) - { DataFile.WriteTo("ATA Report", "readsectorsretrychs", "_debug_" + report.ATA.Model + ".bin", "read results", readBuf); - } DicConsole.WriteLine("Trying READ DMA in CHS mode..."); sense = dev.ReadDma(out readBuf, out errorChs, false, 0, 0, 1, 1, timeout, out duration); @@ -1126,10 +1084,8 @@ namespace DiscImageChef.Core.Devices.Report "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, errorChs.status, errorChs.error, readBuf.Length); if(debug) - { DataFile.WriteTo("ATA Report", "readdmachs", "_debug_" + report.ATA.Model + ".bin", "read results", readBuf); - } DicConsole.WriteLine("Trying READ DMA RETRY in CHS mode..."); sense = dev.ReadDma(out readBuf, out errorChs, true, 0, 0, 1, 1, timeout, out duration); @@ -1139,10 +1095,8 @@ namespace DiscImageChef.Core.Devices.Report "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, errorChs.status, errorChs.error, readBuf.Length); if(debug) - { DataFile.WriteTo("ATA Report", "readdmaretrychs", "_debug_" + report.ATA.Model + ".bin", "read results", readBuf); - } DicConsole.WriteLine("Trying SEEK in CHS mode..."); sense = dev.Seek(out errorChs, 0, 0, 1, timeout, out duration); @@ -1159,10 +1113,8 @@ namespace DiscImageChef.Core.Devices.Report "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, errorLba.status, errorLba.error, readBuf.Length); if(debug) - { DataFile.WriteTo("ATA Report", "readsectors", "_debug_" + report.ATA.Model + ".bin", "read results", readBuf); - } DicConsole.WriteLine("Trying READ SECTOR(S) RETRY in LBA mode..."); sense = dev.Read(out readBuf, out errorLba, true, 0, 1, timeout, out duration); @@ -1172,10 +1124,8 @@ namespace DiscImageChef.Core.Devices.Report "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, errorLba.status, errorLba.error, readBuf.Length); if(debug) - { DataFile.WriteTo("ATA Report", "readsectorsretry", "_debug_" + report.ATA.Model + ".bin", "read results", readBuf); - } DicConsole.WriteLine("Trying READ DMA in LBA mode..."); sense = dev.ReadDma(out readBuf, out errorLba, false, 0, 1, timeout, out duration); @@ -1185,10 +1135,8 @@ namespace DiscImageChef.Core.Devices.Report "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, errorLba.status, errorLba.error, readBuf.Length); if(debug) - { DataFile.WriteTo("ATA Report", "readdma", "_debug_" + report.ATA.Model + ".bin", "read results", readBuf); - } DicConsole.WriteLine("Trying READ DMA RETRY in LBA mode..."); sense = dev.ReadDma(out readBuf, out errorLba, true, 0, 1, timeout, out duration); @@ -1198,10 +1146,8 @@ namespace DiscImageChef.Core.Devices.Report "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, errorLba.status, errorLba.error, readBuf.Length); if(debug) - { DataFile.WriteTo("ATA Report", "readdmaretry", "_debug_" + report.ATA.Model + ".bin", "read results", readBuf); - } DicConsole.WriteLine("Trying SEEK in LBA mode..."); sense = dev.Seek(out errorLba, 0, timeout, out duration); @@ -1218,10 +1164,8 @@ namespace DiscImageChef.Core.Devices.Report "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, errorLba48.status, errorLba48.error, readBuf.Length); if(debug) - { DataFile.WriteTo("ATA Report", "readsectors48", "_debug_" + report.ATA.Model + ".bin", "read results", readBuf); - } DicConsole.WriteLine("Trying READ DMA in LBA48 mode..."); sense = dev.ReadDma(out readBuf, out errorLba48, 0, 1, timeout, out duration); @@ -1231,10 +1175,8 @@ namespace DiscImageChef.Core.Devices.Report "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, errorLba48.status, errorLba48.error, readBuf.Length); if(debug) - { DataFile.WriteTo("ATA Report", "readdma48", "_debug_" + report.ATA.Model + ".bin", "read results", readBuf); - } DicConsole.WriteLine("Trying READ LONG in CHS mode..."); sense = dev.ReadLong(out readBuf, out errorChs, false, 0, 0, 1, @@ -1246,10 +1188,8 @@ namespace DiscImageChef.Core.Devices.Report "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, errorChs.status, errorChs.error, readBuf.Length); if(debug) - { DataFile.WriteTo("ATA Report", "readlongchs", "_debug_" + report.ATA.Model + ".bin", "read results", readBuf); - } DicConsole.WriteLine("Trying READ LONG RETRY in CHS mode..."); sense = dev.ReadLong(out readBuf, out errorChs, true, 0, 0, 1, @@ -1261,10 +1201,8 @@ namespace DiscImageChef.Core.Devices.Report "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, errorChs.status, errorChs.error, readBuf.Length); if(debug) - { DataFile.WriteTo("ATA Report", "readlongretrychs", "_debug_" + report.ATA.Model + ".bin", "read results", readBuf); - } DicConsole.WriteLine("Trying READ LONG in LBA mode..."); sense = dev.ReadLong(out readBuf, out errorLba, false, 0, report.ATA.ReadCapabilities.LongBlockSize, @@ -1276,10 +1214,8 @@ namespace DiscImageChef.Core.Devices.Report "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, errorLba.status, errorLba.error, readBuf.Length); if(debug) - { DataFile.WriteTo("ATA Report", "readlong", "_debug_" + report.ATA.Model + ".bin", "read results", readBuf); - } DicConsole.WriteLine("Trying READ LONG RETRY in LBA mode..."); sense = dev.ReadLong(out readBuf, out errorLba, true, 0, report.ATA.ReadCapabilities.LongBlockSize, @@ -1291,10 +1227,8 @@ namespace DiscImageChef.Core.Devices.Report "Sense = {0}, Status = 0x{1:X2}, Error = 0x{2:X2}, Length = {3}", sense, errorLba.status, errorLba.error, readBuf.Length); if(debug) - { DataFile.WriteTo("ATA Report", "readlongretry", "_debug_" + report.ATA.Model + ".bin", "read results", readBuf); - } } } } diff --git a/DiscImageChef.Core/Devices/Report/PCMCIA.cs b/DiscImageChef.Core/Devices/Report/PCMCIA.cs index a3cdce82..34172f5d 100644 --- a/DiscImageChef.Core/Devices/Report/PCMCIA.cs +++ b/DiscImageChef.Core/Devices/Report/PCMCIA.cs @@ -44,9 +44,7 @@ namespace DiscImageChef.Core.Devices.Report report.PCMCIA.CIS = dev.Cis; Tuple[] tuples = CIS.GetTuples(dev.Cis); if(tuples != null) - { foreach(Tuple tuple in tuples) - { if(tuple.Code == TupleCodes.CISTPL_MANFID) { ManufacturerIdentificationTuple manfid = CIS.DecodeManufacturerIdentificationTuple(tuple); @@ -71,8 +69,6 @@ namespace DiscImageChef.Core.Devices.Report report.PCMCIA.AdditionalInformation = vers.AdditionalInformation; } } - } - } } } } \ No newline at end of file diff --git a/DiscImageChef.Core/Devices/Report/SCSI/General.cs b/DiscImageChef.Core/Devices/Report/SCSI/General.cs index f7104e5a..ecfc7d93 100644 --- a/DiscImageChef.Core/Devices/Report/SCSI/General.cs +++ b/DiscImageChef.Core/Devices/Report/SCSI/General.cs @@ -185,7 +185,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI { List evpds = new List(); foreach(byte page in evpdPages) - { if(page != 0x80) { DicConsole.WriteLine("Querying SCSI EVPD {0:X2}h...", page); @@ -198,7 +197,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI evpds.Add(evpd); } } - } if(evpds.Count > 0) report.SCSI.EVPDPages = evpds.ToArray(); } @@ -354,7 +352,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI { Decoders.SCSI.FixedSense? decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuffer); if(decSense.HasValue) - { if(decSense.Value.ASC == 0x3A) { int leftRetries = 20; @@ -386,7 +383,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI mediaTest.MediaIsRecognized &= !sense; } else mediaTest.MediaIsRecognized = false; - } else mediaTest.MediaIsRecognized = false; } @@ -471,11 +467,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsRead); if(debug) - { DataFile.WriteTo("SCSI Report", "read6", "_debug_" + mediaTest.MediumTypeName + ".bin", "read results", buffer); - } DicConsole.WriteLine("Trying SCSI READ (10)..."); mediaTest.SupportsRead10 = @@ -483,11 +477,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI mediaTest.BlockSize, 0, 1, timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsRead10); if(debug) - { DataFile.WriteTo("SCSI Report", "read10", "_debug_" + mediaTest.MediumTypeName + ".bin", "read results", buffer); - } DicConsole.WriteLine("Trying SCSI READ (12)..."); mediaTest.SupportsRead12 = @@ -495,11 +487,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI mediaTest.BlockSize, 0, 1, false, timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsRead12); if(debug) - { DataFile.WriteTo("SCSI Report", "read12", "_debug_" + mediaTest.MediumTypeName + ".bin", "read results", buffer); - } DicConsole.WriteLine("Trying SCSI READ (16)..."); mediaTest.SupportsRead16 = @@ -507,11 +497,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI mediaTest.BlockSize, 0, 1, false, timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsRead16); if(debug) - { DataFile.WriteTo("SCSI Report", "read16", "_debug_" + mediaTest.MediumTypeName + ".bin", "read results", buffer); - } mediaTest.LongBlockSize = mediaTest.BlockSize; DicConsole.WriteLine("Trying SCSI READ LONG (10)..."); @@ -521,7 +509,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI { Decoders.SCSI.FixedSense? decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuffer); if(decSense.HasValue) - { if(decSense.Value.SenseKey == Decoders.SCSI.SenseKeys.IllegalRequest && decSense.Value.ASC == 0x24 && decSense.Value.ASCQ == 0x00) { @@ -533,13 +520,10 @@ namespace DiscImageChef.Core.Devices.Report.SCSI mediaTest.LongBlockSizeSpecified = true; } } - } } if(mediaTest.SupportsReadLong && mediaTest.LongBlockSize == mediaTest.BlockSize) - { if(mediaTest.BlockSize == 512) - { foreach(ushort testSize in new[] { // Long sector sizes for floppies @@ -560,9 +544,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI break; } } - } else if(mediaTest.BlockSize == 1024) - { foreach(ushort testSize in new[] { // Long sector sizes for floppies @@ -581,7 +563,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI break; } } - } else if(mediaTest.BlockSize == 2048) { sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 2380, @@ -615,7 +596,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI mediaTest.LongBlockSizeSpecified = true; } } - } if(mediaTest.SupportsReadLong && mediaTest.LongBlockSize == mediaTest.BlockSize) { @@ -655,11 +635,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, (ushort)mediaTest.LongBlockSize, timeout, out duration); if(!sense) - { DataFile.WriteTo("SCSI Report", "readlong10", "_debug_" + mediaTest.MediumTypeName + ".bin", "read results", buffer); - } } mediaTest.CanReadMediaSerialSpecified = true; @@ -757,11 +735,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !report.SCSI.ReadCapabilities.SupportsRead); if(debug) - { DataFile.WriteTo("SCSI Report", "read6", "_debug_" + report.SCSI.Inquiry.ProductIdentification + ".bin", "read results", buffer); - } DicConsole.WriteLine("Trying SCSI READ (10)..."); report.SCSI.ReadCapabilities.SupportsRead10 = @@ -770,11 +746,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !report.SCSI.ReadCapabilities.SupportsRead10); if(debug) - { DataFile.WriteTo("SCSI Report", "read10", "_debug_" + report.SCSI.Inquiry.ProductIdentification + ".bin", "read results", buffer); - } DicConsole.WriteLine("Trying SCSI READ (12)..."); report.SCSI.ReadCapabilities.SupportsRead12 = @@ -783,11 +757,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !report.SCSI.ReadCapabilities.SupportsRead12); if(debug) - { DataFile.WriteTo("SCSI Report", "read12", "_debug_" + report.SCSI.Inquiry.ProductIdentification + ".bin", "read results", buffer); - } DicConsole.WriteLine("Trying SCSI READ (16)..."); report.SCSI.ReadCapabilities.SupportsRead16 = @@ -796,11 +768,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !report.SCSI.ReadCapabilities.SupportsRead16); if(debug) - { DataFile.WriteTo("SCSI Report", "read16", "_debug_" + report.SCSI.Inquiry.ProductIdentification + ".bin", "read results", buffer); - } report.SCSI.ReadCapabilities.LongBlockSize = report.SCSI.ReadCapabilities.BlockSize; DicConsole.WriteLine("Trying SCSI READ LONG (10)..."); @@ -809,7 +779,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI { Decoders.SCSI.FixedSense? decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuffer); if(decSense.HasValue) - { if(decSense.Value.SenseKey == Decoders.SCSI.SenseKeys.IllegalRequest && decSense.Value.ASC == 0x24 && decSense.Value.ASCQ == 0x00) { @@ -821,14 +790,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI report.SCSI.ReadCapabilities.LongBlockSizeSpecified = true; } } - } } if(report.SCSI.ReadCapabilities.SupportsReadLong && report.SCSI.ReadCapabilities.LongBlockSize == report.SCSI.ReadCapabilities.BlockSize) - { if(report.SCSI.ReadCapabilities.BlockSize == 512) - { foreach(ushort testSize in new[] { // Long sector sizes for floppies @@ -849,9 +815,7 @@ namespace DiscImageChef.Core.Devices.Report.SCSI break; } } - } else if(report.SCSI.ReadCapabilities.BlockSize == 1024) - { foreach(ushort testSize in new[] { // Long sector sizes for floppies @@ -870,7 +834,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI break; } } - } else if(report.SCSI.ReadCapabilities.BlockSize == 2048) { sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 2380, timeout, @@ -904,7 +867,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI report.SCSI.ReadCapabilities.LongBlockSizeSpecified = true; } } - } if(report.SCSI.ReadCapabilities.SupportsReadLong && report.SCSI.ReadCapabilities.LongBlockSize == report.SCSI.ReadCapabilities.BlockSize) @@ -955,11 +917,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI (ushort)report.SCSI.ReadCapabilities.LongBlockSize, timeout, out duration); if(!sense) - { DataFile.WriteTo("SCSI Report", "readlong10", "_debug_" + report.SCSI.Inquiry.ProductIdentification + ".bin", "read results", buffer); - } } } } diff --git a/DiscImageChef.Core/Devices/Report/SCSI/MMC.cs b/DiscImageChef.Core/Devices/Report/SCSI/MMC.cs index 49d9054c..e3866d33 100644 --- a/DiscImageChef.Core/Devices/Report/SCSI/MMC.cs +++ b/DiscImageChef.Core/Devices/Report/SCSI/MMC.cs @@ -168,7 +168,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI { report.SCSI.MultiMediaDevice.Features = new mmcFeaturesType(); foreach(Decoders.SCSI.MMC.Features.FeatureDescriptor desc in ftr.Descriptors) - { switch(desc.Code) { case 0x0001: @@ -523,13 +522,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI Decoders.SCSI.MMC.Feature_0106? ftr0106 = Decoders.SCSI.MMC.Features.Decode_0106(desc.Data); if(ftr0106.HasValue) - { if(ftr0106.Value.CSSVersion > 0) { report.SCSI.MultiMediaDevice.Features.CSSVersionSpecified = true; report.SCSI.MultiMediaDevice.Features.CSSVersion = ftr0106.Value.CSSVersion; } - } } break; case 0x0108: @@ -544,13 +541,11 @@ namespace DiscImageChef.Core.Devices.Report.SCSI Decoders.SCSI.MMC.Feature_010B? ftr010B = Decoders.SCSI.MMC.Features.Decode_010B(desc.Data); if(ftr010B.HasValue) - { if(ftr010B.Value.CPRMVersion > 0) { report.SCSI.MultiMediaDevice.Features.CPRMVersionSpecified = true; report.SCSI.MultiMediaDevice.Features.CPRMVersion = ftr010B.Value.CPRMVersion; } - } } break; case 0x010C: @@ -653,7 +648,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI report.SCSI.MultiMediaDevice.Features.SupportsVCPS = true; break; } - } } if(report.SCSI.MultiMediaDevice.Features.CanReadBD || @@ -763,7 +757,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI { Decoders.SCSI.FixedSense? decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuffer); if(decSense.HasValue) - { if(decSense.Value.ASC == 0x3A) { int leftRetries = 20; @@ -811,7 +804,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI mediaTest.MediaIsRecognized &= !sense; } else mediaTest.MediaIsRecognized = false; - } else mediaTest.MediaIsRecognized = false; } @@ -890,22 +882,18 @@ namespace DiscImageChef.Core.Devices.Report.SCSI !dev.ReadTocPmaAtip(out buffer, out senseBuffer, false, 0, 0, timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadTOC); if(debug) - { DataFile.WriteTo("SCSI Report", "readtoc", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } DicConsole.WriteLine("Querying CD Full TOC..."); mediaTest.CanReadFullTOC = !dev.ReadRawToc(out buffer, out senseBuffer, 1, timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadFullTOC); if(debug) - { DataFile.WriteTo("SCSI Report", "readfulltoc", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } } if(mediaType.StartsWith("CD-R", StringComparison.Ordinal) || @@ -917,20 +905,16 @@ namespace DiscImageChef.Core.Devices.Report.SCSI mediaTest.CanReadATIP = !dev.ReadAtip(out buffer, out senseBuffer, timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadATIP); if(debug) - { DataFile.WriteTo("SCSI Report", "atip", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } DicConsole.WriteLine("Querying CD PMA..."); mediaTest.CanReadPMA = !dev.ReadPma(out buffer, out senseBuffer, timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadPMA); if(debug) - { DataFile.WriteTo("SCSI Report", "pma", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } } if(mediaType.StartsWith("DVD-", StringComparison.Ordinal) || @@ -945,11 +929,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadPFI); if(debug) - { DataFile.WriteTo("SCSI Report", "pfi", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } DicConsole.WriteLine("Querying DVD DMI..."); mediaTest.CanReadDMI = !dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Dvd, 0, 0, @@ -957,11 +939,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadDMI); if(debug) - { DataFile.WriteTo("SCSI Report", "dmi", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } } if(mediaType == "DVD-ROM") @@ -974,11 +954,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadCMI); if(debug) - { DataFile.WriteTo("SCSI Report", "cmi", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } } if(mediaType == "DVD-ROM" || mediaType == "HD DVD-ROM") @@ -991,11 +969,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadBCA); if(debug) - { DataFile.WriteTo("SCSI Report", "bca", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } mediaTest.CanReadAACSSpecified = true; DicConsole.WriteLine("Querying DVD AACS..."); mediaTest.CanReadAACS = @@ -1003,11 +979,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI MmcDiscStructureFormat.DvdAacs, 0, timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadAACS); if(debug) - { DataFile.WriteTo("SCSI Report", "aacs", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } } if(mediaType == "BD-ROM") @@ -1020,11 +994,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadBCA); if(debug) - { DataFile.WriteTo("SCSI Report", "bdbca", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } } if(mediaType == "DVD-RAM" || mediaType == "HD DVD-RAM") @@ -1036,11 +1008,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI MmcDiscStructureFormat.DvdramDds, 0, timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadDDS); if(debug) - { DataFile.WriteTo("SCSI Report", "dds", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } mediaTest.CanReadSpareAreaInformation = !dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Dvd, 0, 0, MmcDiscStructureFormat.DvdramSpareAreaInformation, 0, timeout, @@ -1048,11 +1018,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadSpareAreaInformation); if(debug) - { DataFile.WriteTo("SCSI Report", "sai", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } } if(mediaType.StartsWith("BD-R", StringComparison.Ordinal) && mediaType != "BD-ROM") @@ -1065,11 +1033,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI MmcDiscStructureFormat.BdDds, 0, timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadDDS); if(debug) - { DataFile.WriteTo("SCSI Report", "bddds", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } DicConsole.WriteLine("Querying BD SAI..."); mediaTest.CanReadSpareAreaInformation = !dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Bd, 0, 0, @@ -1078,11 +1044,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadSpareAreaInformation); if(debug) - { DataFile.WriteTo("SCSI Report", "bdsai", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } } if(mediaType == "DVD-R" || mediaType == "DVD-RW") @@ -1095,11 +1059,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadPRI); if(debug) - { DataFile.WriteTo("SCSI Report", "pri", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } } if(mediaType == "DVD-R" || mediaType == "DVD-RW" || mediaType == "HD DVD-R") @@ -1113,11 +1075,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadMediaID); if(debug) - { DataFile.WriteTo("SCSI Report", "mediaid", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } DicConsole.WriteLine("Querying DVD Embossed PFI..."); mediaTest.CanReadRecordablePFI = !dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Dvd, 0, 0, @@ -1125,11 +1085,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadRecordablePFI); if(debug) - { DataFile.WriteTo("SCSI Report", "epfi", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } } if(mediaType.StartsWith("DVD+R", StringComparison.Ordinal) || mediaType == "DVD+MRW") @@ -1142,22 +1100,18 @@ namespace DiscImageChef.Core.Devices.Report.SCSI MmcDiscStructureFormat.Adip, 0, timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadADIP); if(debug) - { DataFile.WriteTo("SCSI Report", "adip", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } DicConsole.WriteLine("Querying DVD DCB..."); mediaTest.CanReadDCB = !dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Dvd, 0, 0, MmcDiscStructureFormat.Dcb, 0, timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadDCB); if(debug) - { DataFile.WriteTo("SCSI Report", "dcb", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } } if(mediaType == "HD DVD-ROM") @@ -1170,11 +1124,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadHDCMI); if(debug) - { DataFile.WriteTo("SCSI Report", "hdcmi", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } } if(mediaType.EndsWith(" DL", StringComparison.Ordinal)) @@ -1187,11 +1139,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadLayerCapacity); if(debug) - { DataFile.WriteTo("SCSI Report", "layer", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } } if(mediaType.StartsWith("BD-R", StringComparison.Ordinal)) @@ -1205,22 +1155,18 @@ namespace DiscImageChef.Core.Devices.Report.SCSI out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadDiscInformation); if(debug) - { DataFile.WriteTo("SCSI Report", "di", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } DicConsole.WriteLine("Querying BD PAC..."); mediaTest.CanReadPAC = !dev.ReadDiscStructure(out buffer, out senseBuffer, MmcDiscStructureMediaType.Bd, 0, 0, MmcDiscStructureFormat.Pac, 0, timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadPAC); if(debug) - { DataFile.WriteTo("SCSI Report", "pac", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } } mediaTest.SupportsReadSpecified = true; @@ -1233,44 +1179,35 @@ namespace DiscImageChef.Core.Devices.Report.SCSI !dev.Read6(out buffer, out senseBuffer, 0, 2048, timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsRead); if(debug) - { DataFile.WriteTo("SCSI Report", "read6", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } DicConsole.WriteLine("Trying SCSI READ (10)..."); mediaTest.SupportsRead10 = !dev.Read10(out buffer, out senseBuffer, 0, false, true, false, false, 0, 2048, 0, 1, timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsRead10); if(debug) - { DataFile.WriteTo("SCSI Report", "read10", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } DicConsole.WriteLine("Trying SCSI READ (12)..."); mediaTest.SupportsRead12 = !dev.Read12(out buffer, out senseBuffer, 0, false, true, false, false, 0, 2048, 0, 1, false, timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsRead12); if(debug) - { DataFile.WriteTo("SCSI Report", "read12", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } DicConsole.WriteLine("Trying SCSI READ (16)..."); mediaTest.SupportsRead16 = !dev.Read16(out buffer, out senseBuffer, 0, false, true, false, 0, 2048, 0, 1, false, timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsRead16); if(debug) - { DataFile.WriteTo("SCSI Report", "read16", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } if(debug) - { if(!tryPlextor) { pressedKey = new ConsoleKeyInfo(); @@ -1284,7 +1221,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI tryPlextor |= pressedKey.Key == ConsoleKey.Y; } - } if(mediaType.StartsWith("CD-", StringComparison.Ordinal) || mediaType.StartsWith("DDCD-", StringComparison.Ordinal) || mediaType == "Audio CD") @@ -1313,11 +1249,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsReadCd); if(debug) - { DataFile.WriteTo("SCSI Report", "readcd", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } DicConsole.WriteLine("Trying SCSI READ CD MSF..."); mediaTest.SupportsReadCdMsf = !dev.ReadCdMsf(out buffer, out senseBuffer, 0x00000200, 0x00000201, 2352, MmcSectorTypes.Cdda, @@ -1326,11 +1260,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI MmcSubchannel.None, timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsReadCdMsf); if(debug) - { DataFile.WriteTo("SCSI Report", "readcdmsf", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } } else { @@ -1342,11 +1274,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsReadCd); if(debug) - { DataFile.WriteTo("SCSI Report", "readcd", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } DicConsole.WriteLine("Trying SCSI READ CD MSF..."); mediaTest.SupportsReadCdMsf = !dev.ReadCdMsf(out buffer, out senseBuffer, 0x00000200, 0x00000201, 2048, MmcSectorTypes.AllTypes, @@ -1355,11 +1285,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI MmcSubchannel.None, timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsReadCdMsf); if(debug) - { DataFile.WriteTo("SCSI Report", "readcdmsf", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } DicConsole.WriteLine("Trying SCSI READ CD full sector..."); mediaTest.SupportsReadCdRaw = !dev.ReadCd(out buffer, out senseBuffer, 0, 2352, 1, MmcSectorTypes.AllTypes, false, false, true, @@ -1368,11 +1296,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsReadCdRaw); if(debug) - { DataFile.WriteTo("SCSI Report", "readcdraw", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } DicConsole.WriteLine("Trying SCSI READ CD MSF full sector..."); mediaTest.SupportsReadCdMsfRaw = !dev.ReadCdMsf(out buffer, out senseBuffer, 0x00000200, 0x00000201, 2352, @@ -1383,11 +1309,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsReadCdMsfRaw); if(debug) - { DataFile.WriteTo("SCSI Report", "readcdmsfraw", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } } if(mediaTest.SupportsReadCdRaw || mediaType == "Audio CD") @@ -1396,26 +1320,20 @@ namespace DiscImageChef.Core.Devices.Report.SCSI for(int i = -150; i < 0; i++) { if(mediaType == "Audio CD") - { sense = dev.ReadCd(out buffer, out senseBuffer, (uint)i, 2352, 1, MmcSectorTypes.Cdda, false, false, false, MmcHeaderCodes.None, true, false, MmcErrorField.None, MmcSubchannel.None, timeout, out duration); - } else - { sense = dev.ReadCd(out buffer, out senseBuffer, (uint)i, 2352, 1, MmcSectorTypes.AllTypes, false, false, true, MmcHeaderCodes.AllHeaders, true, true, MmcErrorField.None, MmcSubchannel.None, timeout, out duration); - } DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", sense); if(debug) - { DataFile.WriteTo("SCSI Report", "leadin", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } if(!sense) { mediaTest.CanReadLeadIn = true; @@ -1425,30 +1343,24 @@ namespace DiscImageChef.Core.Devices.Report.SCSI DicConsole.WriteLine("Trying to read CD Lead-Out..."); if(mediaType == "Audio CD") - { mediaTest.CanReadLeadOut = !dev.ReadCd(out buffer, out senseBuffer, (uint)(mediaTest.Blocks + 1), 2352, 1, MmcSectorTypes.Cdda, false, false, false, MmcHeaderCodes.None, true, false, MmcErrorField.None, MmcSubchannel.None, timeout, out duration); - } else - { mediaTest.CanReadLeadOut = !dev.ReadCd(out buffer, out senseBuffer, (uint)(mediaTest.Blocks + 1), 2352, 1, MmcSectorTypes.AllTypes, false, false, true, MmcHeaderCodes.AllHeaders, true, true, MmcErrorField.None, MmcSubchannel.None, timeout, out duration); - } DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadLeadOut); if(debug) - { DataFile.WriteTo("SCSI Report", "leadout", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } } if(mediaType == "Audio CD") @@ -1460,21 +1372,17 @@ namespace DiscImageChef.Core.Devices.Report.SCSI MmcErrorField.C2Pointers, MmcSubchannel.None, timeout, out duration); if(!mediaTest.CanReadC2Pointers) - { mediaTest.CanReadC2Pointers = !dev.ReadCd(out buffer, out senseBuffer, 0, 2648, 1, MmcSectorTypes.Cdda, false, false, false, MmcHeaderCodes.None, true, false, MmcErrorField.C2PointersAndBlock, MmcSubchannel.None, timeout, out duration); - } DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadC2Pointers); if(debug) - { DataFile.WriteTo("SCSI Report", "readcdc2", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } DicConsole.WriteLine("Trying to read subchannels..."); mediaTest.CanReadPQSubchannel = !dev.ReadCd(out buffer, out senseBuffer, 0, 2368, 1, @@ -1484,11 +1392,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadPQSubchannel); if(debug) - { DataFile.WriteTo("SCSI Report", "readcdpq", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } mediaTest.CanReadRWSubchannel = !dev.ReadCd(out buffer, out senseBuffer, 0, 2448, 1, MmcSectorTypes.Cdda, false, false, false, MmcHeaderCodes.None, true, false, @@ -1496,11 +1402,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadRWSubchannel); if(debug) - { DataFile.WriteTo("SCSI Report", "readcdrw", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } mediaTest.CanReadCorrectedSubchannel = !dev.ReadCd(out buffer, out senseBuffer, 0, 2448, 1, MmcSectorTypes.Cdda, false, false, false, MmcHeaderCodes.None, true, @@ -1510,11 +1414,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadCorrectedSubchannel); if(debug) - { DataFile.WriteTo("SCSI Report", "readcdsub", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } DicConsole.WriteLine("Trying to read subchannels with C2 Pointers..."); mediaTest.CanReadPQSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0, 2662, @@ -1524,7 +1426,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI MmcSubchannel.Q16, timeout, out duration); if(!mediaTest.CanReadPQSubchannelWithC2) - { mediaTest.CanReadPQSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0, 2664, 1, MmcSectorTypes.Cdda, false, false, false, @@ -1532,15 +1433,12 @@ namespace DiscImageChef.Core.Devices.Report.SCSI MmcErrorField.C2PointersAndBlock, MmcSubchannel.Q16, timeout, out duration); - } DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadPQSubchannelWithC2); if(debug) - { DataFile.WriteTo("SCSI Report", "readcdpqc2", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } mediaTest.CanReadRWSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0, 2712, 1, MmcSectorTypes.Cdda, false, false, @@ -1549,7 +1447,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI MmcSubchannel.Raw, timeout, out duration); if(!mediaTest.CanReadRWSubchannelWithC2) - { mediaTest.CanReadRWSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0, 2714, 1, MmcSectorTypes.Cdda, false, false, false, @@ -1557,15 +1454,12 @@ namespace DiscImageChef.Core.Devices.Report.SCSI MmcErrorField.C2PointersAndBlock, MmcSubchannel.Raw, timeout, out duration); - } DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadRWSubchannelWithC2); if(debug) - { DataFile.WriteTo("SCSI Report", "readcdrwc2", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } mediaTest.CanReadCorrectedSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0, 2712, 1, MmcSectorTypes.Cdda, @@ -1576,21 +1470,17 @@ namespace DiscImageChef.Core.Devices.Report.SCSI MmcSubchannel.Rw, timeout, out duration); if(!mediaTest.CanReadCorrectedSubchannelWithC2) - { mediaTest.CanReadCorrectedSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0, 2714, 1, MmcSectorTypes.Cdda, false, false, false, MmcHeaderCodes.None, true, false, MmcErrorField.C2PointersAndBlock, MmcSubchannel.Rw, timeout, out duration); - } DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadCorrectedSubchannelWithC2); if(debug) - { DataFile.WriteTo("SCSI Report", "readcdsubc2", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } } else if(mediaTest.SupportsReadCdRaw) { @@ -1601,21 +1491,17 @@ namespace DiscImageChef.Core.Devices.Report.SCSI MmcErrorField.C2Pointers, MmcSubchannel.None, timeout, out duration); if(!mediaTest.CanReadC2Pointers) - { mediaTest.CanReadC2Pointers = !dev.ReadCd(out buffer, out senseBuffer, 0, 2648, 1, MmcSectorTypes.AllTypes, false, false, true, MmcHeaderCodes.AllHeaders, true, true, MmcErrorField.C2PointersAndBlock, MmcSubchannel.None, timeout, out duration); - } DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadC2Pointers); if(debug) - { DataFile.WriteTo("SCSI Report", "readcdc2", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } DicConsole.WriteLine("Trying to read subchannels..."); mediaTest.CanReadPQSubchannel = !dev.ReadCd(out buffer, out senseBuffer, 0, 2368, 1, @@ -1625,11 +1511,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadPQSubchannel); if(debug) - { DataFile.WriteTo("SCSI Report", "readcdpq", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } mediaTest.CanReadRWSubchannel = !dev.ReadCd(out buffer, out senseBuffer, 0, 2448, 1, MmcSectorTypes.AllTypes, false, false, true, MmcHeaderCodes.AllHeaders, true, true, @@ -1637,11 +1521,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadRWSubchannel); if(debug) - { DataFile.WriteTo("SCSI Report", "readcdrw", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } mediaTest.CanReadCorrectedSubchannel = !dev.ReadCd(out buffer, out senseBuffer, 0, 2448, 1, MmcSectorTypes.AllTypes, false, false, true, @@ -1652,11 +1534,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadCorrectedSubchannel); if(debug) - { DataFile.WriteTo("SCSI Report", "readcdsub", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } DicConsole.WriteLine("Trying to read subchannels with C2 Pointers..."); mediaTest.CanReadPQSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0, 2662, @@ -1667,7 +1547,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI MmcSubchannel.Q16, timeout, out duration); if(!mediaTest.CanReadPQSubchannelWithC2) - { mediaTest.CanReadPQSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0, 2664, 1, MmcSectorTypes.AllTypes, false, false, true, @@ -1676,15 +1555,12 @@ namespace DiscImageChef.Core.Devices.Report.SCSI MmcErrorField.C2PointersAndBlock, MmcSubchannel.Q16, timeout, out duration); - } DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadPQSubchannelWithC2); if(debug) - { DataFile.WriteTo("SCSI Report", "readcdpqc2", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } mediaTest.CanReadRWSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0, 2712, 1, MmcSectorTypes.AllTypes, false, @@ -1694,7 +1570,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI MmcSubchannel.Raw, timeout, out duration); if(!mediaTest.CanReadRWSubchannelWithC2) - { mediaTest.CanReadRWSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0, 2714, 1, MmcSectorTypes.AllTypes, false, false, true, @@ -1703,15 +1578,12 @@ namespace DiscImageChef.Core.Devices.Report.SCSI MmcErrorField.C2PointersAndBlock, MmcSubchannel.Raw, timeout, out duration); - } DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadRWSubchannelWithC2); if(debug) - { DataFile.WriteTo("SCSI Report", "readcdrwc2", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } mediaTest.CanReadCorrectedSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0, 2712, 1, @@ -1723,21 +1595,17 @@ namespace DiscImageChef.Core.Devices.Report.SCSI MmcSubchannel.Rw, timeout, out duration); if(!mediaTest.CanReadCorrectedSubchannelWithC2) - { mediaTest.CanReadCorrectedSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0, 2714, 1, MmcSectorTypes.AllTypes, false, false, true, MmcHeaderCodes.AllHeaders, true, true, MmcErrorField.C2PointersAndBlock, MmcSubchannel.Rw, timeout, out duration); - } DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadCorrectedSubchannelWithC2); if(debug) - { DataFile.WriteTo("SCSI Report", "readcdsubc2", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } } else { @@ -1748,21 +1616,17 @@ namespace DiscImageChef.Core.Devices.Report.SCSI MmcErrorField.C2Pointers, MmcSubchannel.None, timeout, out duration); if(!mediaTest.CanReadC2Pointers) - { mediaTest.CanReadC2Pointers = !dev.ReadCd(out buffer, out senseBuffer, 0, 2344, 1, MmcSectorTypes.AllTypes, false, false, false, MmcHeaderCodes.None, true, false, MmcErrorField.C2PointersAndBlock, MmcSubchannel.None, timeout, out duration); - } DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadC2Pointers); if(debug) - { DataFile.WriteTo("SCSI Report", "readcdc2", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } DicConsole.WriteLine("Trying to read subchannels..."); mediaTest.CanReadPQSubchannel = !dev.ReadCd(out buffer, out senseBuffer, 0, 2064, 1, @@ -1772,11 +1636,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadPQSubchannel); if(debug) - { DataFile.WriteTo("SCSI Report", "readcdpq", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } mediaTest.CanReadRWSubchannel = !dev.ReadCd(out buffer, out senseBuffer, 0, 2144, 1, MmcSectorTypes.AllTypes, false, false, false, MmcHeaderCodes.None, true, false, @@ -1784,11 +1646,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadRWSubchannel); if(debug) - { DataFile.WriteTo("SCSI Report", "readcdrw", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } mediaTest.CanReadCorrectedSubchannel = !dev.ReadCd(out buffer, out senseBuffer, 0, 2144, 1, MmcSectorTypes.AllTypes, false, false, false, MmcHeaderCodes.None, @@ -1798,11 +1658,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadCorrectedSubchannel); if(debug) - { DataFile.WriteTo("SCSI Report", "readcdsub", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } DicConsole.WriteLine("Trying to read subchannels with C2 Pointers..."); mediaTest.CanReadPQSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0, 2358, @@ -1812,7 +1670,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI MmcSubchannel.Q16, timeout, out duration); if(!mediaTest.CanReadPQSubchannelWithC2) - { mediaTest.CanReadPQSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0, 2360, 1, MmcSectorTypes.AllTypes, false, false, false, @@ -1820,15 +1677,12 @@ namespace DiscImageChef.Core.Devices.Report.SCSI MmcErrorField.C2PointersAndBlock, MmcSubchannel.Q16, timeout, out duration); - } DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadPQSubchannelWithC2); if(debug) - { DataFile.WriteTo("SCSI Report", "readcdpqc2", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } mediaTest.CanReadRWSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0, 2438, 1, MmcSectorTypes.AllTypes, false, @@ -1837,7 +1691,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI MmcSubchannel.Raw, timeout, out duration); if(!mediaTest.CanReadRWSubchannelWithC2) - { mediaTest.CanReadRWSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0, 2440, 1, MmcSectorTypes.AllTypes, false, false, false, @@ -1845,15 +1698,12 @@ namespace DiscImageChef.Core.Devices.Report.SCSI MmcErrorField.C2PointersAndBlock, MmcSubchannel.Raw, timeout, out duration); - } DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadRWSubchannelWithC2); if(debug) - { DataFile.WriteTo("SCSI Report", "readcdrwc2", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } mediaTest.CanReadCorrectedSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0, 2438, 1, @@ -1865,21 +1715,17 @@ namespace DiscImageChef.Core.Devices.Report.SCSI MmcSubchannel.Rw, timeout, out duration); if(!mediaTest.CanReadCorrectedSubchannelWithC2) - { mediaTest.CanReadCorrectedSubchannelWithC2 = !dev.ReadCd(out buffer, out senseBuffer, 0, 2440, 1, MmcSectorTypes.AllTypes, false, false, false, MmcHeaderCodes.None, true, false, MmcErrorField.C2PointersAndBlock, MmcSubchannel.Rw, timeout, out duration); - } DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadCorrectedSubchannelWithC2); if(debug) - { DataFile.WriteTo("SCSI Report", "readcdsubc2", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } } if(debug) @@ -1923,11 +1769,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsPlextorReadCDDA); if(debug) - { DataFile.WriteTo("SCSI Report", "plextorreadcdda", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } } if(tryPioneer) @@ -1941,11 +1785,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsPioneerReadCDDA); if(debug) - { DataFile.WriteTo("SCSI Report", "pioneerreadcdda", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } DicConsole.WriteLine("Trying Pioneer READ CD-DA MSF..."); mediaTest.SupportsPioneerReadCDDAMSF = !dev.PioneerReadCdDaMsf(out buffer, out senseBuffer, 0x00000200, 0x00000201, 2352, @@ -1953,11 +1795,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsPioneerReadCDDAMSF); if(debug) - { DataFile.WriteTo("SCSI Report", "pioneerreadcddamsf", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } } if(tryNec) @@ -1968,11 +1808,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI !dev.NecReadCdDa(out buffer, out senseBuffer, 0, 1, timeout, out duration); DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsNECReadCDDA); if(debug) - { DataFile.WriteTo("SCSI Report", "necreadcdda", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } } } @@ -1984,7 +1822,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI { Decoders.SCSI.FixedSense? decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuffer); if(decSense.HasValue) - { if(decSense.Value.SenseKey == Decoders.SCSI.SenseKeys.IllegalRequest && decSense.Value.ASC == 0x24 && decSense.Value.ASCQ == 0x00) { @@ -1995,11 +1832,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI mediaTest.LongBlockSizeSpecified = true; } } - } } if(debug) - { if(!tryHldtst) { pressedKey = new ConsoleKeyInfo(); @@ -2013,7 +1848,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI tryHldtst |= pressedKey.Key == ConsoleKey.Y; } - } if(mediaTest.SupportsReadLong && mediaTest.LongBlockSize == mediaTest.BlockSize) { @@ -2037,11 +1871,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsPlextorReadRawDVD); if(debug) - { DataFile.WriteTo("SCSI Report", "plextorrawdvd", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } if(mediaTest.SupportsPlextorReadRawDVD) mediaTest.SupportsPlextorReadRawDVD = !ArrayHelpers.ArrayIsNullOrEmpty(buffer); } @@ -2055,11 +1887,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI DicConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.SupportsHLDTSTReadRawDVD); if(debug) - { DataFile.WriteTo("SCSI Report", "hldtstrawdvd", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } } if(mediaTest.SupportsReadLong && mediaTest.LongBlockSize == mediaTest.BlockSize) @@ -2108,11 +1938,9 @@ namespace DiscImageChef.Core.Devices.Report.SCSI sense = dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, (ushort)mediaTest.LongBlockSize, timeout, out duration); if(!sense) - { DataFile.WriteTo("SCSI Report", "readlong10", "_debug_" + report.SCSI.Inquiry.ProductIdentification + "_" + mediaType + ".bin", "read results", buffer); - } } } diff --git a/DiscImageChef.Core/Devices/Report/SCSI/SSC.cs b/DiscImageChef.Core/Devices/Report/SCSI/SSC.cs index cd049ee7..77e9b651 100644 --- a/DiscImageChef.Core/Devices/Report/SCSI/SSC.cs +++ b/DiscImageChef.Core/Devices/Report/SCSI/SSC.cs @@ -138,10 +138,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI report.SCSI.SequentialDevice.SupportedMediaTypes[i].DensityCodes = new int[mtsh.Value.descriptors[i].densityCodes.Length]; for(int j = 0; j < mtsh.Value.descriptors.Length; j++) - { report.SCSI.SequentialDevice.SupportedMediaTypes[i].DensityCodes[j] = mtsh.Value.descriptors[i].densityCodes[j]; - } } } } @@ -181,7 +179,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI { Decoders.SCSI.FixedSense? decSense = Decoders.SCSI.Sense.DecodeFixed(senseBuffer); if(decSense.HasValue) - { if(decSense.Value.ASC == 0x3A) { int leftRetries = 20; @@ -213,7 +210,6 @@ namespace DiscImageChef.Core.Devices.Report.SCSI seqTest.MediaIsRecognized &= !sense; } else seqTest.MediaIsRecognized = false; - } else seqTest.MediaIsRecognized = false; } @@ -302,10 +298,8 @@ namespace DiscImageChef.Core.Devices.Report.SCSI seqTest.SupportedMediaTypes[i].DensityCodes = new int[mtsh.Value.descriptors[i].densityCodes.Length]; for(int j = 0; j < mtsh.Value.descriptors.Length; j++) - { seqTest.SupportedMediaTypes[i].DensityCodes[j] = mtsh.Value.descriptors[i].densityCodes[j]; - } } } } diff --git a/DiscImageChef.Core/ImageFormat.cs b/DiscImageChef.Core/ImageFormat.cs index 81a9d48f..5fccc6af 100644 --- a/DiscImageChef.Core/ImageFormat.cs +++ b/DiscImageChef.Core/ImageFormat.cs @@ -51,7 +51,6 @@ namespace DiscImageChef.Core // Check all but RAW plugin foreach(ImagePlugin imageplugin in plugins.ImagePluginsList.Values) - { if(imageplugin.PluginUuid != new Guid("12345678-AAAA-BBBB-CCCC-123456789000")) { try @@ -67,13 +66,10 @@ namespace DiscImageChef.Core catch { } #pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body } - } // Check only RAW plugin if(imageFormat == null) - { foreach(ImagePlugin imageplugin in plugins.ImagePluginsList.Values) - { if(imageplugin.PluginUuid == new Guid("12345678-AAAA-BBBB-CCCC-123456789000")) { try @@ -89,8 +85,6 @@ namespace DiscImageChef.Core catch { } #pragma warning restore RECS0022 // A catch clause that catches System.Exception and has an empty body } - } - } // Still not recognized if(imageFormat == null) return null; diff --git a/DiscImageChef.Core/Partitions.cs b/DiscImageChef.Core/Partitions.cs index 0090f675..d198a726 100644 --- a/DiscImageChef.Core/Partitions.cs +++ b/DiscImageChef.Core/Partitions.cs @@ -51,33 +51,27 @@ namespace DiscImageChef.Core // Getting all partitions from device (e.g. tracks) if(image.ImageInfo.ImageHasPartitions) - { foreach(Partition imagePartition in image.GetPartitions()) { foreach(PartitionPlugin _partplugin in plugins.PartPluginsList.Values) - { if(_partplugin.GetInformation(image, out List _partitions, imagePartition.Start)) { partitions.AddRange(_partitions); DicConsole.DebugWriteLine("Partitions", "Found {0} @ {1}", _partplugin.Name, imagePartition.Start); } - } checkedLocations.Add(imagePartition.Start); } - } // Getting all partitions at start of device else { foreach(PartitionPlugin _partplugin in plugins.PartPluginsList.Values) - { if(_partplugin.GetInformation(image, out List _partitions, 0)) { partitions.AddRange(_partitions); DicConsole.DebugWriteLine("Partitions", "Found {0} @ 0", _partplugin.Name); } - } checkedLocations.Add(0); } @@ -113,10 +107,8 @@ namespace DiscImageChef.Core partitions.RemoveAt(0); foreach(Partition child in childs) - { if(checkedLocations.Contains(child.Start)) childPartitions.Add(child); else partitions.Add(child); - } } else { diff --git a/DiscImageChef.Core/PluginBase.cs b/DiscImageChef.Core/PluginBase.cs index d3dcbb81..731463a1 100644 --- a/DiscImageChef.Core/PluginBase.cs +++ b/DiscImageChef.Core/PluginBase.cs @@ -61,7 +61,6 @@ namespace DiscImageChef.Core assembly = Assembly.GetAssembly(typeof(ImagePlugin)); foreach(Type type in assembly.GetTypes()) - { try { if(type.IsSubclassOf(typeof(ImagePlugin))) @@ -71,12 +70,10 @@ namespace DiscImageChef.Core } } catch(Exception exception) { DicConsole.ErrorWriteLine("Exception {0}", exception); } - } assembly = Assembly.GetAssembly(typeof(PartitionPlugin)); foreach(Type type in assembly.GetTypes()) - { try { if(type.IsSubclassOf(typeof(PartitionPlugin))) @@ -86,28 +83,23 @@ namespace DiscImageChef.Core } } catch(Exception exception) { DicConsole.ErrorWriteLine("Exception {0}", exception); } - } assembly = Assembly.GetAssembly(typeof(Filesystem)); foreach(Type type in assembly.GetTypes()) - { try { if(type.IsSubclassOf(typeof(Filesystem))) { Filesystem plugin; if(encoding != null) - { plugin = (Filesystem)type.GetConstructor(new Type[] {encoding.GetType()}) .Invoke(new object[] {encoding}); - } else plugin = (Filesystem)type.GetConstructor(Type.EmptyTypes).Invoke(new object[] { }); RegisterPlugin(plugin); } } catch(Exception exception) { DicConsole.ErrorWriteLine("Exception {0}", exception); } - } } void RegisterImagePlugin(ImagePlugin plugin) diff --git a/DiscImageChef.Core/Sidecar/BlockMedia.cs b/DiscImageChef.Core/Sidecar/BlockMedia.cs index 570badfa..2fe15f76 100644 --- a/DiscImageChef.Core/Sidecar/BlockMedia.cs +++ b/DiscImageChef.Core/Sidecar/BlockMedia.cs @@ -79,7 +79,6 @@ namespace DiscImageChef.Core } foreach(MediaTagType tagType in image.ImageInfo.ReadableMediaTags) - { switch(tagType) { case MediaTagType.ATAPI_IDENTIFY: @@ -112,9 +111,7 @@ namespace DiscImageChef.Core }; Tuple[] tuples = CIS.GetTuples(cis); if(tuples != null) - { foreach(Tuple tuple in tuples) - { if(tuple.Code == TupleCodes.CISTPL_MANFID) { ManufacturerIdentificationTuple manfid = @@ -141,8 +138,6 @@ namespace DiscImageChef.Core sidecar.BlockMedia[0].PCMCIA.AdditionalInformation = vers.AdditionalInformation; } } - } - } break; case MediaTagType.SCSI_INQUIRY: @@ -230,7 +225,6 @@ namespace DiscImageChef.Core }; break; } - } // 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") && @@ -312,7 +306,6 @@ namespace DiscImageChef.Core List lstFs = new List(); foreach(Filesystem plugin in plugins.PluginsList.Values) - { try { if(plugin.Identify(image, partitions[i])) @@ -328,7 +321,6 @@ namespace DiscImageChef.Core { //DicConsole.DebugWriteLine("Create-sidecar command", "Plugin {0} crashed", _plugin.Name); } - } if(lstFs.Count > 0) sidecar.BlockMedia[0].FileSystemInformation[i].FileSystems = lstFs.ToArray(); } @@ -348,7 +340,6 @@ namespace DiscImageChef.Core List lstFs = new List(); foreach(Filesystem plugin in plugins.PluginsList.Values) - { try { if(plugin.Identify(image, wholePart)) @@ -364,7 +355,6 @@ namespace DiscImageChef.Core { //DicConsole.DebugWriteLine("Create-sidecar command", "Plugin {0} crashed", _plugin.Name); } - } if(lstFs.Count > 0) sidecar.BlockMedia[0].FileSystemInformation[0].FileSystems = lstFs.ToArray(); } @@ -384,7 +374,6 @@ namespace DiscImageChef.Core Decoders.ATA.Identify.IdentifyDevice? ataId = Decoders.ATA.Identify.Decode(image.ReadDiskTag(MediaTagType.ATA_IDENTIFY)); if(ataId.HasValue) - { if(ataId.Value.CurrentCylinders > 0 && ataId.Value.CurrentHeads > 0 && ataId.Value.CurrentSectorsPerTrack > 0) { @@ -404,7 +393,6 @@ namespace DiscImageChef.Core sidecar.BlockMedia[0].Heads = ataId.Value.Heads; sidecar.BlockMedia[0].SectorsPerTrack = ataId.Value.SectorsPerTrack; } - } } // TODO: This is more of a hack, redo it planned for >4.0 @@ -544,7 +532,6 @@ namespace DiscImageChef.Core if(image.ImageInfo.Heads == 2 && scpImage.Header.heads == 0 || image.ImageInfo.Heads == 1 && (scpImage.Header.heads == 1 || scpImage.Header.heads == 2)) - { if(scpImage.Header.end + 1 >= image.ImageInfo.Cylinders) { List scpBlockTrackTypes = new List(); @@ -590,18 +577,13 @@ namespace DiscImageChef.Core scpBlockTrackTypes.OrderBy(t => t.Cylinder).ThenBy(t => t.Head).ToArray(); } else - { DicConsole .ErrorWriteLine("SuperCardPro image do not contain same number of tracks ({0}) than disk image ({1}), ignoring...", scpImage.Header.end + 1, image.ImageInfo.Cylinders); - } - } else - { DicConsole .ErrorWriteLine("SuperCardPro image do not contain same number of heads ({0}) than disk image ({1}), ignoring...", 2, image.ImageInfo.Heads); - } } } #endregion @@ -635,7 +617,6 @@ namespace DiscImageChef.Core catch(NotImplementedException) { } if(kfImage.ImageInfo.Heads == image.ImageInfo.Heads) - { if(kfImage.ImageInfo.Cylinders >= image.ImageInfo.Cylinders) { List kfBlockTrackTypes = new List(); @@ -680,18 +661,13 @@ namespace DiscImageChef.Core kfBlockTrackTypes.OrderBy(t => t.Cylinder).ThenBy(t => t.Head).ToArray(); } else - { DicConsole .ErrorWriteLine("KryoFlux image do not contain same number of tracks ({0}) than disk image ({1}), ignoring...", kfImage.ImageInfo.Cylinders, image.ImageInfo.Cylinders); - } - } else - { DicConsole .ErrorWriteLine("KryoFluximage do not contain same number of heads ({0}) than disk image ({1}), ignoring...", kfImage.ImageInfo.Heads, image.ImageInfo.Heads); - } } } #endregion @@ -712,7 +688,6 @@ namespace DiscImageChef.Core catch(NotImplementedException) { } if(image.ImageInfo.Heads == dfiImage.ImageInfo.Heads) - { if(dfiImage.ImageInfo.Cylinders >= image.ImageInfo.Cylinders) { List dfiBlockTrackTypes = new List(); @@ -756,18 +731,13 @@ namespace DiscImageChef.Core dfiBlockTrackTypes.OrderBy(t => t.Cylinder).ThenBy(t => t.Head).ToArray(); } else - { DicConsole .ErrorWriteLine("DiscFerret image do not contain same number of tracks ({0}) than disk image ({1}), ignoring...", dfiImage.ImageInfo.Cylinders, image.ImageInfo.Cylinders); - } - } else - { DicConsole .ErrorWriteLine("DiscFerret image do not contain same number of heads ({0}) than disk image ({1}), ignoring...", dfiImage.ImageInfo.Heads, image.ImageInfo.Heads); - } } } #endregion diff --git a/DiscImageChef.Core/Statistics.cs b/DiscImageChef.Core/Statistics.cs index fccdb7f9..774accd1 100644 --- a/DiscImageChef.Core/Statistics.cs +++ b/DiscImageChef.Core/Statistics.cs @@ -106,7 +106,6 @@ namespace DiscImageChef.Core OsStats old = null; foreach(OsStats nvs in AllStats.OperatingSystems) - { if(nvs.name == Interop.DetectOS.GetRealPlatformID().ToString() && nvs.version == Interop.DetectOS.GetVersion()) { @@ -114,7 +113,6 @@ namespace DiscImageChef.Core old = nvs; break; } - } if(old != null) AllStats.OperatingSystems.Remove(old); @@ -134,14 +132,12 @@ namespace DiscImageChef.Core NameValueStats old = null; foreach(NameValueStats nvs in AllStats.Versions) - { if(nvs.name == Version.GetVersion()) { count = nvs.Value + 1; old = nvs; break; } - } if(old != null) AllStats.Versions.Remove(old); @@ -182,7 +178,6 @@ namespace DiscImageChef.Core SearchOption.TopDirectoryOnly); foreach(string statsFile in statsFiles) - { try { if(!File.Exists(statsFile)) continue; @@ -237,7 +232,6 @@ namespace DiscImageChef.Core continue; #endif } - } submitStatsLock = false; }); @@ -343,13 +337,11 @@ namespace DiscImageChef.Core NameValueStats old = null; foreach(NameValueStats nvs in AllStats.Filesystems) - { if(nvs.name == filesystem) { old = nvs; break; } - } NameValueStats nw = new NameValueStats(); if(old != null) @@ -367,13 +359,11 @@ namespace DiscImageChef.Core old = null; foreach(NameValueStats nvs in CurrentStats.Filesystems) - { if(nvs.name == filesystem) { old = nvs; break; } - } nw = new NameValueStats(); if(old != null) @@ -400,13 +390,11 @@ namespace DiscImageChef.Core NameValueStats old = null; foreach(NameValueStats nvs in AllStats.Partitions) - { if(nvs.name == partition) { old = nvs; break; } - } NameValueStats nw = new NameValueStats(); if(old != null) @@ -424,13 +412,11 @@ namespace DiscImageChef.Core old = null; foreach(NameValueStats nvs in CurrentStats.Partitions) - { if(nvs.name == partition) { old = nvs; break; } - } nw = new NameValueStats(); if(old != null) @@ -457,13 +443,11 @@ namespace DiscImageChef.Core NameValueStats old = null; foreach(NameValueStats nvs in AllStats.Filters) - { if(nvs.name == format) { old = nvs; break; } - } NameValueStats nw = new NameValueStats(); if(old != null) @@ -481,13 +465,11 @@ namespace DiscImageChef.Core old = null; foreach(NameValueStats nvs in CurrentStats.Filters) - { if(nvs.name == format) { old = nvs; break; } - } nw = new NameValueStats(); if(old != null) @@ -514,13 +496,11 @@ namespace DiscImageChef.Core NameValueStats old = null; foreach(NameValueStats nvs in AllStats.MediaImages) - { if(nvs.name == format) { old = nvs; break; } - } NameValueStats nw = new NameValueStats(); if(old != null) @@ -538,13 +518,11 @@ namespace DiscImageChef.Core old = null; foreach(NameValueStats nvs in CurrentStats.MediaImages) - { if(nvs.name == format) { old = nvs; break; } - } nw = new NameValueStats(); if(old != null) @@ -576,14 +554,12 @@ namespace DiscImageChef.Core DeviceStats old = null; foreach(DeviceStats ds in AllStats.Devices) - { if(ds.Manufacturer == dev.Manufacturer && ds.Model == dev.Model && ds.Revision == dev.Revision && ds.Bus == deviceBus) { old = ds; break; } - } if(old != null) AllStats.Devices.Remove(old); @@ -597,14 +573,12 @@ namespace DiscImageChef.Core old = null; foreach(DeviceStats ds in CurrentStats.Devices) - { if(ds.Manufacturer == dev.Manufacturer && ds.Model == dev.Model && ds.Revision == dev.Revision && ds.Bus == deviceBus) { old = ds; break; } - } if(old != null) CurrentStats.Devices.Remove(old); @@ -627,13 +601,11 @@ namespace DiscImageChef.Core MediaStats old = null; foreach(MediaStats ms in AllStats.Medias) - { if(ms.real == real && ms.type == type.ToString()) { old = ms; break; } - } MediaStats nw = new MediaStats(); if(old != null) @@ -653,13 +625,11 @@ namespace DiscImageChef.Core old = null; foreach(MediaStats ms in CurrentStats.Medias) - { if(ms.real == real && ms.type == type.ToString()) { old = ms; break; } - } nw = new MediaStats(); if(old != null) @@ -731,7 +701,6 @@ namespace DiscImageChef.Core } if(mediaVerified.HasValue) - { if(mediaVerified.Value) { CurrentStats.Verify.MediaImages.Correct++; @@ -742,7 +711,6 @@ namespace DiscImageChef.Core CurrentStats.Verify.MediaImages.Failed++; AllStats.Verify.MediaImages.Failed++; } - } CurrentStats.Verify.Sectors.Correct += correct; CurrentStats.Verify.Sectors.Error += failed; diff --git a/DiscImageChef.Decoders/CD/CDTextOnLeadIn.cs b/DiscImageChef.Decoders/CD/CDTextOnLeadIn.cs index 236c8d6a..2732bf6a 100644 --- a/DiscImageChef.Decoders/CD/CDTextOnLeadIn.cs +++ b/DiscImageChef.Decoders/CD/CDTextOnLeadIn.cs @@ -237,7 +237,6 @@ namespace DiscImageChef.Decoders.CD #endif foreach(CDTextPack descriptor in response.DataPacks) - { if((descriptor.HeaderID1 & 0x80) != 0x80) { // Ignore NOPs @@ -366,7 +365,6 @@ namespace DiscImageChef.Decoders.CD sb.AppendFormat("CRC: 0x{0:X4}", descriptor.CRC).AppendLine(); } - } return sb.ToString(); } diff --git a/DiscImageChef.Decoders/CD/FullTOC.cs b/DiscImageChef.Decoders/CD/FullTOC.cs index a4da3108..717c6e27 100644 --- a/DiscImageChef.Decoders/CD/FullTOC.cs +++ b/DiscImageChef.Decoders/CD/FullTOC.cs @@ -200,7 +200,6 @@ namespace DiscImageChef.Decoders.CD sb.AppendFormat("First complete session number: {0}", response.FirstCompleteSession).AppendLine(); sb.AppendFormat("Last complete session number: {0}", response.LastCompleteSession).AppendLine(); foreach(TrackDataDescriptor descriptor in response.TrackDescriptors) - { if((descriptor.CONTROL & 0x08) == 0x08 || descriptor.ADR != 1 && descriptor.ADR != 5 && descriptor.ADR != 4 && descriptor.ADR != 6 || descriptor.TNO != 0) @@ -378,7 +377,6 @@ namespace DiscImageChef.Decoders.CD default: { if(descriptor.POINT >= 0x01 && descriptor.POINT <= 0x63) - { if(descriptor.ADR == 4) sb.AppendFormat("Video track {3} starts at: {0:D2}:{1:D2}:{2:D2}", descriptor.PMIN, descriptor.PSEC, descriptor.PFRAME, @@ -424,8 +422,6 @@ namespace DiscImageChef.Decoders.CD sb.AppendLine(")"); } - //sb.AppendFormat("Absolute time: {3:D2}:{0:D2}:{1:D2}:{2:D2}", descriptor.Min, descriptor.Sec, descriptor.Frame, descriptor.HOUR).AppendLine(); - } else { sb.AppendFormat("ADR = {0}", descriptor.ADR).AppendLine(); @@ -593,7 +589,6 @@ namespace DiscImageChef.Decoders.CD } } } - } return sb.ToString(); } diff --git a/DiscImageChef.Decoders/DVD/Cartridge.cs b/DiscImageChef.Decoders/DVD/Cartridge.cs index e228fe77..64c09a39 100644 --- a/DiscImageChef.Decoders/DVD/Cartridge.cs +++ b/DiscImageChef.Decoders/DVD/Cartridge.cs @@ -175,7 +175,6 @@ namespace DiscImageChef.Decoders.DVD } if(decoded.MSWI) - { switch(decoded.RAMSWI) { case 0: break; @@ -190,7 +189,6 @@ namespace DiscImageChef.Decoders.DVD .AppendLine(); break; } - } return sb.ToString(); } diff --git a/DiscImageChef.Decoders/DVD/DDS.cs b/DiscImageChef.Decoders/DVD/DDS.cs index 120887e8..7b3fd4d9 100644 --- a/DiscImageChef.Decoders/DVD/DDS.cs +++ b/DiscImageChef.Decoders/DVD/DDS.cs @@ -279,7 +279,6 @@ namespace DiscImageChef.Decoders.DVD sb.AppendFormat("DDS has been updated {0} times", decoded.UpdateCount).AppendLine(); if(decoded.Groups == 24) - { for(int i = 0; i < decoded.GroupCertificationFlags.Length; i++) { if(decoded.GroupCertificationFlags[i].InProcess) @@ -291,7 +290,6 @@ namespace DiscImageChef.Decoders.DVD if(decoded.GroupCertificationFlags[i].UserCertification) sb.AppendFormat("Group {0} has been certified by an user", i).AppendLine(); } - } if(decoded.Groups == 1) { diff --git a/DiscImageChef.Decoders/MMC/ExtendedCSD.cs b/DiscImageChef.Decoders/MMC/ExtendedCSD.cs index 11abeaac..991d72ef 100644 --- a/DiscImageChef.Decoders/MMC/ExtendedCSD.cs +++ b/DiscImageChef.Decoders/MMC/ExtendedCSD.cs @@ -223,10 +223,8 @@ namespace DiscImageChef.Decoders.MMC double unit; if((csd.HPIFeatures & 0x01) == 0x01) - { if((csd.HPIFeatures & 0x02) == 0x02) sb.AppendLine("\tDevice implements HPI using CMD12"); else sb.AppendLine("\tDevice implements HPI using CMD13"); - } if((csd.BackgroundOperationsSupport & 0x01) == 0x01) sb.AppendLine("\tDevice supports background operations"); diff --git a/DiscImageChef.Decoders/SCSI/EVPD.cs b/DiscImageChef.Decoders/SCSI/EVPD.cs index 4722f477..6426e580 100644 --- a/DiscImageChef.Decoders/SCSI/EVPD.cs +++ b/DiscImageChef.Decoders/SCSI/EVPD.cs @@ -610,15 +610,12 @@ namespace DiscImageChef.Decoders.SCSI descriptor.CodeSet == IdentificationCodeSet.UTF8) sb.AppendFormat("\tSCSI name string identifier: {0}", descriptor.ASCII).AppendLine(); else - { sb.AppendFormat("\tSCSI name string identifier (hex): {0}", PrintHex.ByteArrayToHexArrayString(descriptor.Binary, 40)).AppendLine(); - } break; case IdentificationTypes.ProtocolSpecific: { if(descriptor.PIV) - { switch(descriptor.ProtocolIdentifier) { case ProtocolIdentifiers.ADT: @@ -704,7 +701,6 @@ namespace DiscImageChef.Decoders.SCSI .AppendLine(); break; } - } } break; @@ -1211,7 +1207,6 @@ namespace DiscImageChef.Decoders.SCSI if(page.PeripheralDeviceType == PeripheralDeviceTypes.DirectAccess || page.PeripheralDeviceType == PeripheralDeviceTypes.SCSIZonedBlockDevice) - { switch(page.SPT) { case 0: @@ -1240,7 +1235,6 @@ namespace DiscImageChef.Decoders.SCSI .AppendLine(); break; } - } else if(page.PeripheralDeviceType == PeripheralDeviceTypes.SequentialAccess && page.SPT == 1) sb.AppendLine("Logical unit supports logical block protection"); @@ -2302,7 +2296,6 @@ namespace DiscImageChef.Decoders.SCSI Match servoMatch; for(int pos = 5; pos < pageResponse.Length; pos++) - { if(pageResponse[pos] == 0x00) { string str = StringHandlers.CToString(array.ToArray()); @@ -2329,7 +2322,6 @@ namespace DiscImageChef.Decoders.SCSI array = new List(); } else array.Add(pageResponse[pos]); - } return decoded; } diff --git a/DiscImageChef.Decoders/SCSI/MMC/AACS.cs b/DiscImageChef.Decoders/SCSI/MMC/AACS.cs index 715f3bfb..1b93a7b7 100644 --- a/DiscImageChef.Decoders/SCSI/MMC/AACS.cs +++ b/DiscImageChef.Decoders/SCSI/MMC/AACS.cs @@ -463,10 +463,8 @@ namespace DiscImageChef.Decoders.SCSI.MMC StringBuilder sb = new StringBuilder(); if(response.MaxLBAExtents == 0) - { if(response.DataLength > 2) sb.AppendLine("Drive can store 256 LBA Extents"); else sb.AppendLine("Drive cannot store LBA Extents"); - } else sb.AppendFormat("Drive can store {0} LBA Extents", response.MaxLBAExtents).AppendLine(); for(int i = 0; i < response.Extents.Length; i++) diff --git a/DiscImageChef.Decoders/SCSI/MMC/DiscInformation.cs b/DiscImageChef.Decoders/SCSI/MMC/DiscInformation.cs index 2e9f3231..0a92f400 100644 --- a/DiscImageChef.Decoders/SCSI/MMC/DiscInformation.cs +++ b/DiscImageChef.Decoders/SCSI/MMC/DiscInformation.cs @@ -426,14 +426,10 @@ namespace DiscImageChef.Decoders.SCSI.MMC if(decoded.DAC_V) sb.AppendFormat("Disc application code: {0}", decoded.DiscApplicationCode).AppendLine(); if(decoded.OPCTables != null) - { foreach(OPCTable table in decoded.OPCTables) - { sb.AppendFormat("OPC values for {0}Kbit/sec.: {1}, {2}, {3}, {4}, {5}, {6}", table.Speed, table.OPCValues[0], table.OPCValues[1], table.OPCValues[2], table.OPCValues[3], table.OPCValues[4], table.OPCValues[5]).AppendLine(); - } - } return sb.ToString(); } diff --git a/DiscImageChef.Decoders/SCSI/Sense.cs b/DiscImageChef.Decoders/SCSI/Sense.cs index db78e907..d898bda5 100644 --- a/DiscImageChef.Decoders/SCSI/Sense.cs +++ b/DiscImageChef.Decoders/SCSI/Sense.cs @@ -335,7 +335,6 @@ namespace DiscImageChef.Decoders.SCSI int offset = 8; while(offset < sense.Length) - { if(offset + 2 < sense.Length) { byte descType = sense[offset]; @@ -349,7 +348,6 @@ namespace DiscImageChef.Decoders.SCSI offset += descLen; } else break; - } return decoded; } @@ -401,7 +399,6 @@ namespace DiscImageChef.Decoders.SCSI if(decoded.AdditionalLength < 10) return sb.ToString(); if(decoded.SKSV) - { switch(decoded.SenseKey) { case SenseKeys.IllegalRequest: @@ -428,7 +425,6 @@ namespace DiscImageChef.Decoders.SCSI sb.AppendFormat("Actual retry count is {0}", decoded.SenseKeySpecific & 0xFFFF).AppendLine(); break; } - } return sb.ToString(); } @@ -447,14 +443,12 @@ namespace DiscImageChef.Decoders.SCSI if(decoded.Descriptors == null || decoded.Descriptors.Count == 0) return sb.ToString(); foreach(KeyValuePair kvp in decoded.Descriptors) - { switch(kvp.Key) { case 0x00: sb.AppendLine(PrettifyDescriptor00(kvp.Value)); break; } - } return sb.ToString(); } diff --git a/DiscImageChef.Decoders/Sega/CD.cs b/DiscImageChef.Decoders/Sega/CD.cs index ee307689..f51cebab 100644 --- a/DiscImageChef.Decoders/Sega/CD.cs +++ b/DiscImageChef.Decoders/Sega/CD.cs @@ -234,7 +234,6 @@ namespace DiscImageChef.Decoders.Sega .AppendLine(); IPBinInformation.AppendFormat("Peripherals:").AppendLine(); foreach(byte peripheral in ipbin.peripherals) - { switch((char)peripheral) { case 'A': @@ -275,11 +274,9 @@ namespace DiscImageChef.Decoders.Sega IPBinInformation.AppendFormat("Game supports unknown peripheral {0}.", peripheral).AppendLine(); break; } - } IPBinInformation.AppendLine("Regions supported:"); foreach(byte region in ipbin.region_codes) - { switch((char)region) { case 'J': @@ -296,7 +293,6 @@ namespace DiscImageChef.Decoders.Sega IPBinInformation.AppendFormat("Game supports unknown region {0}.", region).AppendLine(); break; } - } return IPBinInformation.ToString(); } diff --git a/DiscImageChef.Decoders/Sega/Dreamcast.cs b/DiscImageChef.Decoders/Sega/Dreamcast.cs index 7d381c83..55186d01 100644 --- a/DiscImageChef.Decoders/Sega/Dreamcast.cs +++ b/DiscImageChef.Decoders/Sega/Dreamcast.cs @@ -175,7 +175,6 @@ namespace DiscImageChef.Decoders.Sega IPBinInformation.AppendLine("Regions supported:"); foreach(byte region in ipbin.region_codes) - { switch((char)region) { case 'J': @@ -192,7 +191,6 @@ namespace DiscImageChef.Decoders.Sega IPBinInformation.AppendFormat("Game supports unknown region {0}.", region).AppendLine(); break; } - } int iPeripherals = int.Parse(Encoding.ASCII.GetString(ipbin.peripherals), NumberStyles.HexNumber); diff --git a/DiscImageChef.Decoders/Sega/Saturn.cs b/DiscImageChef.Decoders/Sega/Saturn.cs index 7b475d47..a334efac 100644 --- a/DiscImageChef.Decoders/Sega/Saturn.cs +++ b/DiscImageChef.Decoders/Sega/Saturn.cs @@ -140,7 +140,6 @@ namespace DiscImageChef.Decoders.Sega IPBinInformation.AppendFormat("Peripherals:").AppendLine(); foreach(byte peripheral in ipbin.peripherals) - { switch((char)peripheral) { case 'A': @@ -166,11 +165,9 @@ namespace DiscImageChef.Decoders.Sega IPBinInformation.AppendFormat("Game supports unknown peripheral {0}.", peripheral).AppendLine(); break; } - } IPBinInformation.AppendLine("Regions supported:"); foreach(byte region in ipbin.region_codes) - { switch((char)region) { case 'J': @@ -190,7 +187,6 @@ namespace DiscImageChef.Decoders.Sega IPBinInformation.AppendFormat("Game supports unknown region {0}.", region).AppendLine(); break; } - } return IPBinInformation.ToString(); } diff --git a/DiscImageChef.Decoders/Xbox/SS.cs b/DiscImageChef.Decoders/Xbox/SS.cs index 769e5935..b05dcaf7 100644 --- a/DiscImageChef.Decoders/Xbox/SS.cs +++ b/DiscImageChef.Decoders/Xbox/SS.cs @@ -421,7 +421,6 @@ namespace DiscImageChef.Decoders.Xbox } if(decoded.DataAreaStartPSN > 0) - { if(decoded.DataAreaEndPSN > 0) { sb.AppendFormat("Data area starts at PSN {0:X}h", decoded.DataAreaStartPSN).AppendLine(); @@ -430,7 +429,6 @@ namespace DiscImageChef.Decoders.Xbox sb.AppendFormat("Layer 0 ends at PSN {0:X}h", decoded.Layer0EndPSN).AppendLine(); } else sb.AppendLine("Disc is empty"); - } else sb.AppendLine("Disc is empty"); sb.AppendLine("Challenges:"); diff --git a/DiscImageChef.Devices/Device/Destructor.cs b/DiscImageChef.Devices/Device/Destructor.cs index 0eafd147..34ecd47b 100644 --- a/DiscImageChef.Devices/Device/Destructor.cs +++ b/DiscImageChef.Devices/Device/Destructor.cs @@ -44,7 +44,6 @@ namespace DiscImageChef.Devices ~Device() { if(fd != null) - { switch(platformId) { case Interop.PlatformID.Win32NT: @@ -57,7 +56,6 @@ namespace DiscImageChef.Devices FreeBSD.Extern.cam_close_device((IntPtr)fd); break; } - } } } } \ No newline at end of file diff --git a/DiscImageChef.Devices/Device/ScsiCommands/Fujitsu.cs b/DiscImageChef.Devices/Device/ScsiCommands/Fujitsu.cs index 4ab0203f..44f76e3a 100644 --- a/DiscImageChef.Devices/Device/ScsiCommands/Fujitsu.cs +++ b/DiscImageChef.Devices/Device/ScsiCommands/Fujitsu.cs @@ -61,7 +61,6 @@ namespace DiscImageChef.Devices } if(mode != FujitsuDisplayModes.Half) - { if(!ArrayHelpers.ArrayIsNullOrWhiteSpace(firstHalfBytes) && !ArrayHelpers.ArrayIsNullOrWhiteSpace(secondHalfBytes)) { @@ -85,7 +84,6 @@ namespace DiscImageChef.Devices displayLen = false; halfMsg = false; } - } buffer[0] = (byte)((byte)mode << 5); if(displayLen) buffer[0] += 0x10; diff --git a/DiscImageChef.Devices/FreeBSD/Command.cs b/DiscImageChef.Devices/FreeBSD/Command.cs index e503d45a..1a79d7b5 100644 --- a/DiscImageChef.Devices/FreeBSD/Command.cs +++ b/DiscImageChef.Devices/FreeBSD/Command.cs @@ -124,7 +124,6 @@ namespace DiscImageChef.Devices.FreeBSD } if((csio.ccb_h.status & CamStatus.CamAutosnsValid) != 0) - { if(csio.sense_len - csio.sense_resid > 0) { sense = (csio.ccb_h.status & CamStatus.CamStatusMask) == CamStatus.CamScsiStatusError; @@ -132,7 +131,6 @@ namespace DiscImageChef.Devices.FreeBSD senseBuffer[0] = csio.sense_data.error_code; Array.Copy(csio.sense_data.sense_buf, 0, senseBuffer, 1, senseBuffer.Length - 1); } - } buffer = new byte[csio.dxfer_len]; cdb = new byte[csio.cdb_len]; @@ -231,7 +229,6 @@ namespace DiscImageChef.Devices.FreeBSD } if((csio.ccb_h.status & CamStatus.CamAutosnsValid) != 0) - { if(csio.sense_len - csio.sense_resid > 0) { sense = (csio.ccb_h.status & CamStatus.CamStatusMask) == CamStatus.CamScsiStatusError; @@ -239,7 +236,6 @@ namespace DiscImageChef.Devices.FreeBSD senseBuffer[0] = csio.sense_data.error_code; Array.Copy(csio.sense_data.sense_buf, 0, senseBuffer, 1, senseBuffer.Length - 1); } - } buffer = new byte[csio.dxfer_len]; cdb = new byte[csio.cdb_len]; diff --git a/DiscImageChef.Devices/Linux/ListDevices.cs b/DiscImageChef.Devices/Linux/ListDevices.cs index 91729b41..6f7433a8 100644 --- a/DiscImageChef.Devices/Linux/ListDevices.cs +++ b/DiscImageChef.Devices/Linux/ListDevices.cs @@ -99,7 +99,6 @@ namespace DiscImageChef.Devices.Linux } if(string.IsNullOrEmpty(devices[i].Vendor) || devices[i].Vendor == "ATA") - { if(devices[i].Model != null) { string[] pieces = devices[i].Model.Split(' '); @@ -109,7 +108,6 @@ namespace DiscImageChef.Devices.Linux devices[i].Model = devices[i].Model.Substring(pieces[0].Length + 1); } } - } // TODO: Get better device type from sysfs paths if(string.IsNullOrEmpty(devices[i].Bus)) diff --git a/DiscImageChef.DiscImages/CPCDSK.cs b/DiscImageChef.DiscImages/CPCDSK.cs index 063ef5f0..38150d29 100644 --- a/DiscImageChef.DiscImages/CPCDSK.cs +++ b/DiscImageChef.DiscImages/CPCDSK.cs @@ -282,16 +282,12 @@ namespace DiscImageChef.DiscImages DicConsole.DebugWriteLine("CPCDSK plugin", "header.sides = {0}", header.sides); if(!extended) DicConsole.DebugWriteLine("CPCDSK plugin", "header.tracksize = {0}", header.tracksize); else - { for(int i = 0; i < header.tracks; i++) { for(int j = 0; j < header.sides; j++) - { DicConsole.DebugWriteLine("CPCDSK plugin", "Track {0} Side {1} size = {2}", i, j, header.tracksizeTable[i * header.sides + j] * 256); - } } - } ulong currentSector = 0; sectors = new Dictionary(); @@ -345,10 +341,8 @@ namespace DiscImageChef.DiscImages DicConsole.DebugWriteLine("CPCDSK plugin", "trackInfo[{1}:{2}].track = {0}", trackInfo.track, i, j); if(trackInfo.sectors != sectorsPerTrack) - { if(sectorsPerTrack == 0) sectorsPerTrack = trackInfo.sectors; else allTracksSameSize = false; - } byte[][] thisTrackSectors = new byte[trackInfo.sectors][]; byte[][] thisTrackAddressMarks = new byte[trackInfo.sectors][]; diff --git a/DiscImageChef.DiscImages/CisCopy.cs b/DiscImageChef.DiscImages/CisCopy.cs index d24feed8..ee6afb66 100644 --- a/DiscImageChef.DiscImages/CisCopy.cs +++ b/DiscImageChef.DiscImages/CisCopy.cs @@ -143,10 +143,8 @@ namespace DiscImageChef.DiscImages stream.Read(trackBytes, 0, tracks); for(int i = 0; i < tracks; i++) - { if(trackBytes[i] != (byte)TrackType.Copied && trackBytes[i] != (byte)TrackType.Omitted && trackBytes[i] != (byte)TrackType.OmittedAlternate) return false; - } Compression cmpr = (Compression)stream.ReadByte(); diff --git a/DiscImageChef.DiscImages/D88.cs b/DiscImageChef.DiscImages/D88.cs index ef364bdc..bca1646a 100644 --- a/DiscImageChef.DiscImages/D88.cs +++ b/DiscImageChef.DiscImages/D88.cs @@ -403,7 +403,6 @@ namespace DiscImageChef.DiscImages ImageInfo.MediaType = MediaType.Unknown; if(allEqual) - { if(trkCounter == 154 && spt == 26 && bps == IBMSectorSizeCode.EighthKilo) ImageInfo.MediaType = MediaType.NEC_8_SD; else if(bps == IBMSectorSizeCode.QuarterKilo) @@ -415,7 +414,6 @@ namespace DiscImageChef.DiscImages else if(trkCounter == 154 && spt == 8 && bps == IBMSectorSizeCode.Kilo) ImageInfo.MediaType = MediaType.NEC_525_HD; else if(bps == IBMSectorSizeCode.HalfKilo) - { switch(d88Hdr.track_table.Length) { case 40: @@ -470,8 +468,6 @@ namespace DiscImageChef.DiscImages if(spt == 38) ImageInfo.MediaType = MediaType.NEC_35_TD; break; } - } - } DicConsole.DebugWriteLine("D88 plugin", "MediaType: {0}", ImageInfo.MediaType); diff --git a/DiscImageChef.DiscImages/DART.cs b/DiscImageChef.DiscImages/DART.cs index 1c4db99b..0187bcf7 100644 --- a/DiscImageChef.DiscImages/DART.cs +++ b/DiscImageChef.DiscImages/DART.cs @@ -250,7 +250,6 @@ namespace DiscImageChef.DiscImages MemoryStream tagMs = new MemoryStream(); for(int i = 0; i < bLength.Length; i++) - { if(bLength[i] != 0) { buffer = new byte[BUFFER_SIZE]; @@ -273,7 +272,6 @@ namespace DiscImageChef.DiscImages throw new ImageNotSupportedException("Compressed images not yet supported"); } } - } dataCache = dataMs.ToArray(); if(header.srcType == DISK_LISA || header.srcType == DISK_MAC || header.srcType == DISK_APPLE2) diff --git a/DiscImageChef.DiscImages/KryoFlux.cs b/DiscImageChef.DiscImages/KryoFlux.cs index fe7b5df3..7d6a1c9c 100644 --- a/DiscImageChef.DiscImages/KryoFlux.cs +++ b/DiscImageChef.DiscImages/KryoFlux.cs @@ -207,7 +207,6 @@ namespace DiscImageChef.DiscImages : string.Format("{0}{1:D2}.{2:D1}.raw", basename, cylinder, head); if(!File.Exists(trackfile)) - { if(cylinder == 0) { if(head == 0) @@ -236,7 +235,6 @@ namespace DiscImageChef.DiscImages step = 2; break; } - } ZZZNoFilter trackFilter = new ZZZNoFilter(); trackFilter.Open(trackfile); @@ -301,10 +299,8 @@ namespace DiscImageChef.DiscImages foundDate = true; } else if(kvp[0] == hostTime) - { DateTime.TryParseExact(kvp[1], "HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.AssumeLocal, out blockTime); - } else if(kvp[0] == kfName) ImageInfo.ImageApplication = kvp[1]; else if(kvp[0] == kfVersion) ImageInfo.ImageApplicationVersion = kvp[1]; } diff --git a/DiscImageChef.DiscImages/UDIF.cs b/DiscImageChef.DiscImages/UDIF.cs index 3f490e3e..32cfc533 100644 --- a/DiscImageChef.DiscImages/UDIF.cs +++ b/DiscImageChef.DiscImages/UDIF.cs @@ -521,14 +521,12 @@ namespace DiscImageChef.DiscImages ulong chunkStartSector = 0; foreach(KeyValuePair kvp in chunks) - { if(sectorAddress >= kvp.Key) { currentChunk = kvp.Value; chunkFound = true; chunkStartSector = kvp.Key; } - } long relOff = ((long)sectorAddress - (long)chunkStartSector) * SECTOR_SIZE; diff --git a/DiscImageChef.DiscImages/UkvFdi.cs b/DiscImageChef.DiscImages/UkvFdi.cs index 23d6c9d5..0e92f02c 100644 --- a/DiscImageChef.DiscImages/UkvFdi.cs +++ b/DiscImageChef.DiscImages/UkvFdi.cs @@ -238,8 +238,6 @@ namespace DiscImageChef.DiscImages // For empty cylinders if(sectorsOff[cyl][head].Length == 0) - { - // Last cylinder if(cyl + 1 == hdr.cylinders || // Next cylinder is also empty sectorsOff[cyl + 1][head].Length == 0) emptyCyl = true; @@ -249,7 +247,6 @@ namespace DiscImageChef.DiscImages sectorsData[cyl][head] = new byte[spt][]; for(int i = 0; i < spt; i++) sectorsData[cyl][head][i] = new byte[ImageInfo.SectorSize]; } - } } if(emptyCyl) ImageInfo.Cylinders--; diff --git a/DiscImageChef.DiscImages/VMware.cs b/DiscImageChef.DiscImages/VMware.cs index f57ffa21..48d596b6 100644 --- a/DiscImageChef.DiscImages/VMware.cs +++ b/DiscImageChef.DiscImages/VMware.cs @@ -726,14 +726,12 @@ namespace DiscImageChef.DiscImages ulong extentStartSector = 0; foreach(KeyValuePair kvp in extents) - { if(sectorAddress >= kvp.Key) { currentExtent = kvp.Value; extentFound = true; extentStartSector = kvp.Key; } - } if(!extentFound) throw new ArgumentOutOfRangeException(nameof(sectorAddress), diff --git a/DiscImageChef.Filesystems/AppleDOS/Dir.cs b/DiscImageChef.Filesystems/AppleDOS/Dir.cs index 86714251..3f6f97bf 100644 --- a/DiscImageChef.Filesystems/AppleDOS/Dir.cs +++ b/DiscImageChef.Filesystems/AppleDOS/Dir.cs @@ -104,7 +104,6 @@ namespace DiscImageChef.Filesystems.AppleDOS Marshal.FreeHGlobal(catPtr); foreach(FileEntry entry in catSector.entries) - { if(entry.extentTrack > 0) { track1UsedByFiles |= entry.extentTrack == 1; @@ -129,7 +128,6 @@ namespace DiscImageChef.Filesystems.AppleDOS if((entry.typeAndFlags & 0x80) == 0x80 && !lockedFiles.Contains(filename)) lockedFiles.Add(filename); } - } lba = (ulong)(catSector.trackOfNext * sectorsPerTrack + catSector.sectorOfNext); diff --git a/DiscImageChef.Filesystems/AppleMFS/File.cs b/DiscImageChef.Filesystems/AppleMFS/File.cs index 5276ef56..987d6b2f 100644 --- a/DiscImageChef.Filesystems/AppleMFS/File.cs +++ b/DiscImageChef.Filesystems/AppleMFS/File.cs @@ -155,7 +155,6 @@ namespace DiscImageChef.Filesystems.AppleMFS if(pathElements.Length != 1) return Errno.NotSupported; if(debug) - { if(string.Compare(path, "$", StringComparison.InvariantCulture) == 0 || string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0 || string.Compare(path, "$Bitmap", StringComparison.InvariantCulture) == 0 || @@ -197,7 +196,6 @@ namespace DiscImageChef.Filesystems.AppleMFS return Errno.NoError; } - } uint fileID; MFS_FileEntry entry; @@ -301,14 +299,12 @@ namespace DiscImageChef.Filesystems.AppleMFS else { if(resourceFork) - { if(ms.Length < entry.flRLgLen) buf = ms.ToArray(); else { buf = new byte[entry.flRLgLen]; Array.Copy(ms.ToArray(), 0, buf, 0, buf.Length); } - } else { if(ms.Length < entry.flLgLen) buf = ms.ToArray(); diff --git a/DiscImageChef.Filesystems/AppleMFS/Xattr.cs b/DiscImageChef.Filesystems/AppleMFS/Xattr.cs index 885c3843..60b131d2 100644 --- a/DiscImageChef.Filesystems/AppleMFS/Xattr.cs +++ b/DiscImageChef.Filesystems/AppleMFS/Xattr.cs @@ -49,7 +49,6 @@ namespace DiscImageChef.Filesystems.AppleMFS xattrs = new List(); if(debug) - { if(string.Compare(path, "$", StringComparison.InvariantCulture) == 0 || string.Compare(path, "$Bitmap", StringComparison.InvariantCulture) == 0 || string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0 || @@ -60,7 +59,6 @@ namespace DiscImageChef.Filesystems.AppleMFS return Errno.NoError; } - } uint fileID; MFS_FileEntry entry; @@ -94,12 +92,10 @@ namespace DiscImageChef.Filesystems.AppleMFS if(pathElements.Length != 1) return Errno.NotSupported; if(debug) - { if(string.Compare(path, "$", StringComparison.InvariantCulture) == 0 || 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) && string.Compare(xattr, "com.apple.macintosh.tags", StringComparison.InvariantCulture) == 0) { @@ -132,8 +128,6 @@ namespace DiscImageChef.Filesystems.AppleMFS } } else return Errno.NoSuchExtendedAttribute; - } - } uint fileID; MFS_FileEntry entry; diff --git a/DiscImageChef.Filesystems/CPM/Info.cs b/DiscImageChef.Filesystems/CPM/Info.cs index cb32ef8d..b7bcc02b 100644 --- a/DiscImageChef.Filesystems/CPM/Info.cs +++ b/DiscImageChef.Filesystems/CPM/Info.cs @@ -380,10 +380,8 @@ namespace DiscImageChef.Filesystems.CPM // Check for alternate location of format ID if(sector.Last() == 0x00 || sector.Last() == 0xFF) - { if(sector[0x40] == 0x94 || sector[0x40] == 0x26) formatByte = sector[0x40]; else formatByte = sector.Last(); - } else formatByte = sector.Last(); uint firstDirectorySector86 = 0; @@ -878,10 +876,8 @@ namespace DiscImageChef.Filesystems.CPM // Complement of the directory bytes if needed if(def.complement) - { for(int b = 0; b < directory.Length; b++) directory[b] = (byte)(~directory[b] & 0xFF); - } // Check the directory if(CheckDir(directory)) diff --git a/DiscImageChef.Filesystems/FAT.cs b/DiscImageChef.Filesystems/FAT.cs index 88f70c35..d0a0f6ea 100644 --- a/DiscImageChef.Filesystems/FAT.cs +++ b/DiscImageChef.Filesystems/FAT.cs @@ -257,14 +257,12 @@ namespace DiscImageChef.Filesystems for(int e = 0; e < 96 * 32; e += 32) { for(int c = 0; c < 11; c++) - { if(root_dir[c + e] < 0x20 && root_dir[c + e] != 0x00 && root_dir[c + e] != 0x05 || root_dir[c + e] == 0xFF || root_dir[c + e] == 0x2E) { valid_root_dir = false; break; } - } if(!valid_root_dir) break; } @@ -498,7 +496,6 @@ namespace DiscImageChef.Filesystems if(EBPB.sectors == 0) { if(EBPB.big_sectors <= partition.End - partition.Start + 1) - { if(EBPB.signature == 0x29 || andos_oem_correct) { DicConsole.DebugWriteLine("FAT plugin", "Using DOS 4.0 BPB"); @@ -509,10 +506,8 @@ namespace DiscImageChef.Filesystems DicConsole.DebugWriteLine("FAT plugin", "Using DOS 3.4 BPB"); useShortEBPB = true; } - } } else if(EBPB.sectors <= partition.End - partition.Start + 1) - { if(EBPB.signature == 0x29 || andos_oem_correct) { DicConsole.DebugWriteLine("FAT plugin", "Using DOS 4.0 BPB"); @@ -523,12 +518,10 @@ namespace DiscImageChef.Filesystems DicConsole.DebugWriteLine("FAT plugin", "Using DOS 3.4 BPB"); useShortEBPB = true; } - } } else if(bits_in_bps_dos33 == 1 && correct_spc_dos33 && dos33BPB.rsectors < partition.End - partition.Start && dos33BPB.fats_no <= 2 && dos33BPB.root_ent > 0 && dos33BPB.spfat > 0) - { if(dos33BPB.sectors == 0 && dos33BPB.hsectors <= partition.Start && dos33BPB.big_sectors > 0 && dos33BPB.big_sectors <= partition.End - partition.Start + 1) { @@ -537,7 +530,6 @@ namespace DiscImageChef.Filesystems } else if(dos33BPB.big_sectors == 0 && dos33BPB.hsectors <= partition.Start && dos33BPB.sectors > 0 && dos33BPB.sectors <= partition.End - partition.Start + 1) - { if(atariBPB.jump[0] == 0x60 || atariBPB.jump[0] == 0xE9 && atariBPB.jump[1] == 0x00 && Encoding.ASCII.GetString(dos33BPB.oem_name) != "NEXT ") { @@ -549,7 +541,6 @@ namespace DiscImageChef.Filesystems DicConsole.DebugWriteLine("FAT plugin", "Using DOS 3.3 BPB"); useDOS33BPB = true; } - } else { if(dos32BPB.hsectors <= partition.Start && @@ -559,7 +550,6 @@ namespace DiscImageChef.Filesystems useDOS32BPB = true; } else if(dos30BPB.sptrk > 0 && dos30BPB.sptrk < 64 && dos30BPB.heads > 0 && dos30BPB.heads < 256) - { if(atariBPB.jump[0] == 0x60 || atariBPB.jump[0] == 0xE9 && atariBPB.jump[1] == 0x00 && Encoding.ASCII.GetString(dos33BPB.oem_name) != "NEXT ") { @@ -571,7 +561,6 @@ namespace DiscImageChef.Filesystems DicConsole.DebugWriteLine("FAT plugin", "Using DOS 3.0 BPB"); useDOS3BPB = true; } - } else { if(atariBPB.jump[0] == 0x60 || atariBPB.jump[0] == 0xE9 && atariBPB.jump[1] == 0x00 && @@ -587,7 +576,6 @@ namespace DiscImageChef.Filesystems } } } - } } BIOSParameterBlockEBPB fakeBPB = new BIOSParameterBlockEBPB(); @@ -635,14 +623,12 @@ namespace DiscImageChef.Filesystems for(int e = 0; e < 96 * 32; e += 32) { for(int c = 0; c < 11; c++) - { if(root_dir[c + e] < 0x20 && root_dir[c + e] != 0x00 && root_dir[c + e] != 0x05 || root_dir[c + e] == 0xFF || root_dir[c + e] == 0x2E) { valid_root_dir = false; break; } - } if(!valid_root_dir) break; } @@ -865,11 +851,9 @@ namespace DiscImageChef.Filesystems } if(Fat32BPB.oem_name != null) - { if(Fat32BPB.oem_name[5] == 0x49 && Fat32BPB.oem_name[6] == 0x48 && Fat32BPB.oem_name[7] == 0x43) sb.AppendLine("Volume has been modified by Windows 9x/Me Volume Tracker."); else xmlFSType.SystemIdentifier = StringHandlers.CToString(Fat32BPB.oem_name); - } if(!string.IsNullOrEmpty(xmlFSType.SystemIdentifier)) sb.AppendFormat("OEM Name: {0}", xmlFSType.SystemIdentifier.Trim()).AppendLine(); @@ -1360,10 +1344,8 @@ namespace DiscImageChef.Filesystems Array.Copy(entry.extension, 0, fullname, 8, 3); string volname = CurrentEncoding.GetString(fullname).Trim(); if(!string.IsNullOrEmpty(volname)) - { if((entry.caseinfo & 0x0C) > 0) xmlFSType.VolumeName = volname.ToLower(); else xmlFSType.VolumeName = volname; - } if(entry.ctime > 0 && entry.cdate > 0) { diff --git a/DiscImageChef.Filesystems/LisaFS/Dir.cs b/DiscImageChef.Filesystems/LisaFS/Dir.cs index 9651e0ab..a4f973c6 100644 --- a/DiscImageChef.Filesystems/LisaFS/Dir.cs +++ b/DiscImageChef.Filesystems/LisaFS/Dir.cs @@ -91,12 +91,10 @@ namespace DiscImageChef.Filesystems.LisaFS { contents = new List(); foreach(CatalogEntry entry in catalogCache) - { if(entry.parentID == dirId) // Do same trick as Mac OS X, replace filesystem '/' with '-', // as '-' is the path separator in Lisa OS contents.Add(StringHandlers.CToString(entry.filename, CurrentEncoding).Replace('/', '-')); - } return Errno.NoError; } @@ -228,8 +226,7 @@ namespace DiscImageChef.Filesystems.LisaFS // Traverse all entries while(offset + 64 <= buf.Length) - { - // Catalog block header + // Catalog block header if(buf[offset + 0x24] == 0x08) offset += 78; // Maybe just garbage? Found in more than 1 disk else if(buf[offset + 0x24] == 0x7C) offset += 50; @@ -256,13 +253,11 @@ namespace DiscImageChef.Filesystems.LisaFS ExtentFile ext; if(ReadExtentsFile(entry.fileID, out ext) == Errno.NoError) - { if(!fileSizeCache.ContainsKey(entry.fileID)) { catalogCache.Add(entry); fileSizeCache.Add(entry.fileID, entry.length); } - } offset += 64; } @@ -292,7 +287,6 @@ namespace DiscImageChef.Filesystems.LisaFS offset += 48; } else break; - } } return Errno.NoError; diff --git a/DiscImageChef.Filesystems/LisaFS/Extent.cs b/DiscImageChef.Filesystems/LisaFS/Extent.cs index 84f0373c..4f2b901c 100644 --- a/DiscImageChef.Filesystems/LisaFS/Extent.cs +++ b/DiscImageChef.Filesystems/LisaFS/Extent.cs @@ -183,7 +183,6 @@ namespace DiscImageChef.Filesystems.LisaFS extentCache.Add(fileId, file); if(debug) - { if(!printedExtents.Contains(fileId)) { DicConsole.DebugWriteLine("LisaFS plugin", "ExtentFile[{0}].filenameLen = {1}", fileId, @@ -268,7 +267,6 @@ namespace DiscImageChef.Filesystems.LisaFS printedExtents.Add(fileId); } - } return Errno.NoError; } diff --git a/DiscImageChef.Filesystems/LisaFS/Xattr.cs b/DiscImageChef.Filesystems/LisaFS/Xattr.cs index 5c744c59..3c9890a5 100644 --- a/DiscImageChef.Filesystems/LisaFS/Xattr.cs +++ b/DiscImageChef.Filesystems/LisaFS/Xattr.cs @@ -149,13 +149,11 @@ namespace DiscImageChef.Filesystems.LisaFS // Only MDDF contains an extended attributes if(fileId == FILEID_MDDF) - { if(xattr == "com.apple.lisa.password") { buf = Encoding.ASCII.GetBytes(mddf.password); return Errno.NoError; } - } // But on debug mode even system files contain tags if(debug && xattr == "com.apple.lisa.tags") return ReadSystemFile(fileId, out buf, true); diff --git a/DiscImageChef.Filesystems/Nintendo.cs b/DiscImageChef.Filesystems/Nintendo.cs index d87908dd..fb84337e 100644 --- a/DiscImageChef.Filesystems/Nintendo.cs +++ b/DiscImageChef.Filesystems/Nintendo.cs @@ -139,7 +139,6 @@ namespace DiscImageChef.Filesystems fields.fourthPartitions = new NintendoPartition[BigEndianBitConverter.ToUInt32(header, 0x40018)]; for(int i = 0; i < fields.firstPartitions.Length; i++) - { if(offset1 + i * 8 + 8 < 0x50000) { fields.firstPartitions[i].offset = @@ -147,10 +146,8 @@ namespace DiscImageChef.Filesystems fields.firstPartitions[i].type = BigEndianBitConverter.ToUInt32(header, (int)(offset1 + i * 8 + 4)); } - } for(int i = 0; i < fields.secondPartitions.Length; i++) - { if(offset1 + i * 8 + 8 < 0x50000) { fields.firstPartitions[i].offset = @@ -158,10 +155,8 @@ namespace DiscImageChef.Filesystems fields.firstPartitions[i].type = BigEndianBitConverter.ToUInt32(header, (int)(offset2 + i * 8 + 4)); } - } for(int i = 0; i < fields.thirdPartitions.Length; i++) - { if(offset1 + i * 8 + 8 < 0x50000) { fields.firstPartitions[i].offset = @@ -169,10 +164,8 @@ namespace DiscImageChef.Filesystems fields.firstPartitions[i].type = BigEndianBitConverter.ToUInt32(header, (int)(offset3 + i * 8 + 4)); } - } for(int i = 0; i < fields.fourthPartitions.Length; i++) - { if(offset1 + i * 8 + 8 < 0x50000) { fields.firstPartitions[i].offset = @@ -180,7 +173,6 @@ namespace DiscImageChef.Filesystems fields.firstPartitions[i].type = BigEndianBitConverter.ToUInt32(header, (int)(offset4 + i * 8 + 4)); } - } fields.region = header[0x4E000]; fields.japanAge = header[0x4E010]; diff --git a/DiscImageChef.Filesystems/ProDOS.cs b/DiscImageChef.Filesystems/ProDOS.cs index 129d9ad8..95fecc40 100644 --- a/DiscImageChef.Filesystems/ProDOS.cs +++ b/DiscImageChef.Filesystems/ProDOS.cs @@ -116,7 +116,6 @@ namespace DiscImageChef.Filesystems byte[] tmp = imagePlugin.ReadSectors(partition.Start, 2); foreach(int offset in new[] {0, 0x200, 0x400, 0x600, 0x800, 0xA00}) - { if(BitConverter.ToUInt16(tmp, offset) == 0 && (byte)((tmp[offset + 0x04] & ProDOSStorageTypeMask) >> 4) == RootDirectoryType && tmp[offset + 0x23] == ProDOSEntryLength && tmp[offset + 0x24] == ProDOSEntriesPerBlock) @@ -125,7 +124,6 @@ namespace DiscImageChef.Filesystems APMFromHDDOnCD = true; break; } - } } ushort prePointer = BitConverter.ToUInt16(rootDirectoryKeyBlock, 0); @@ -172,7 +170,6 @@ namespace DiscImageChef.Filesystems byte[] tmp = imagePlugin.ReadSectors(partition.Start, 2); foreach(int offset in new[] {0, 0x200, 0x400, 0x600, 0x800, 0xA00}) - { if(BitConverter.ToUInt16(tmp, offset) == 0 && (byte)((tmp[offset + 0x04] & ProDOSStorageTypeMask) >> 4) == RootDirectoryType && tmp[offset + 0x23] == ProDOSEntryLength && tmp[offset + 0x24] == ProDOSEntriesPerBlock) @@ -181,7 +178,6 @@ namespace DiscImageChef.Filesystems APMFromHDDOnCD = true; break; } - } } ProDOSRootDirectoryKeyBlock rootDirectoryKeyBlock = new ProDOSRootDirectoryKeyBlock(); diff --git a/DiscImageChef.Filesystems/SolarFS.cs b/DiscImageChef.Filesystems/SolarFS.cs index f3b37e65..fbef4715 100644 --- a/DiscImageChef.Filesystems/SolarFS.cs +++ b/DiscImageChef.Filesystems/SolarFS.cs @@ -149,18 +149,14 @@ namespace DiscImageChef.Filesystems imagePlugin.GetSectorSize() == 2448) { if(BPB.bps != imagePlugin.GetSectorSize()) - { sb .AppendFormat("WARNING: Filesystem describes a {0} bytes/sector, while device describes a {1} bytes/sector", BPB.bps, 2048).AppendLine(); - } } else if(BPB.bps != imagePlugin.GetSectorSize()) - { sb .AppendFormat("WARNING: Filesystem describes a {0} bytes/sector, while device describes a {1} bytes/sector", BPB.bps, imagePlugin.GetSectorSize()).AppendLine(); - } sb.AppendFormat("{0} sectors on volume ({1} bytes)", BPB.sectors, BPB.sectors * BPB.bps).AppendLine(); if(BPB.sectors > imagePlugin.GetSectors()) sb.AppendFormat("WARNING: Filesystem describes a {0} sectors volume, bigger than device ({1} sectors)", diff --git a/DiscImageChef.Filesystems/SysV.cs b/DiscImageChef.Filesystems/SysV.cs index 68b22fac..59cd25d9 100644 --- a/DiscImageChef.Filesystems/SysV.cs +++ b/DiscImageChef.Filesystems/SysV.cs @@ -178,14 +178,10 @@ namespace DiscImageChef.Filesystems } if((s_fsize & 0xFF000000) == 0x00 && (s_nfree & 0xFF00) == 0x00 && (s_ninode & 0xFF00) == 0x00) - { if(s_fsize < V7_MAXSIZE && s_nfree < V7_NICFREE && s_ninode < V7_NICINOD) - { if(s_fsize * 1024 == (partition.End - partition.Start) * imagePlugin.GetSectorSize() || s_fsize * 512 == (partition.End - partition.Start) * imagePlugin.GetSectorSize()) return true; - } - } } } @@ -330,9 +326,7 @@ namespace DiscImageChef.Filesystems } if((s_fsize & 0xFF000000) == 0x00 && (s_nfree & 0xFF00) == 0x00 && (s_ninode & 0xFF00) == 0x00) - { if(s_fsize < V7_MAXSIZE && s_nfree < V7_NICFREE && s_ninode < V7_NICINOD) - { if(s_fsize * 1024 == (partition.End - partition.Start) * imagePlugin.GetSectorSize() || s_fsize * 512 == (partition.End - partition.Start) * imagePlugin.GetSectorSize()) { @@ -341,8 +335,6 @@ namespace DiscImageChef.Filesystems start = i; break; } - } - } } } diff --git a/DiscImageChef.Filesystems/UCSDPascal/File.cs b/DiscImageChef.Filesystems/UCSDPascal/File.cs index 42146f59..23351e23 100644 --- a/DiscImageChef.Filesystems/UCSDPascal/File.cs +++ b/DiscImageChef.Filesystems/UCSDPascal/File.cs @@ -75,10 +75,8 @@ namespace DiscImageChef.Filesystems.UCSDPascal if(debug && (string.Compare(path, "$", StringComparison.InvariantCulture) == 0 || string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0)) - { if(string.Compare(path, "$", StringComparison.InvariantCulture) == 0) file = catalogBlocks; else file = bootBlocks; - } else { PascalFileEntry entry; @@ -112,7 +110,6 @@ namespace DiscImageChef.Filesystems.UCSDPascal if(pathElements.Length != 1) return Errno.NotSupported; if(debug) - { if(string.Compare(path, "$", StringComparison.InvariantCulture) == 0 || string.Compare(path, "$Boot", StringComparison.InvariantCulture) == 0) { @@ -140,7 +137,6 @@ namespace DiscImageChef.Filesystems.UCSDPascal return Errno.NoError; } - } PascalFileEntry entry; Errno error = GetFileEntry(path, out entry); @@ -169,14 +165,12 @@ namespace DiscImageChef.Filesystems.UCSDPascal entry = new PascalFileEntry(); foreach(PascalFileEntry ent in fileEntries) - { if(string.Compare(path, StringHandlers.PascalToString(ent.filename, CurrentEncoding), StringComparison.InvariantCultureIgnoreCase) == 0) { entry = ent; return Errno.NoError; } - } return Errno.NoSuchFile; } diff --git a/DiscImageChef.Filesystems/XFS.cs b/DiscImageChef.Filesystems/XFS.cs index d5849726..4f584011 100644 --- a/DiscImageChef.Filesystems/XFS.cs +++ b/DiscImageChef.Filesystems/XFS.cs @@ -157,7 +157,6 @@ namespace DiscImageChef.Filesystems } } else - { foreach(ulong location in new[] {0, 1, 2}) { XFS_Superblock xfsSb = new XFS_Superblock(); @@ -175,7 +174,6 @@ namespace DiscImageChef.Filesystems if(xfsSb.magicnum == XFS_Magic) return true; } - } return false; } @@ -212,7 +210,6 @@ namespace DiscImageChef.Filesystems } } else - { foreach(ulong location in new[] {0, 1, 2}) { uint sbSize = (uint)(Marshal.SizeOf(xfsSb) / imagePlugin.GetSectorSize()); @@ -228,7 +225,6 @@ namespace DiscImageChef.Filesystems if(xfsSb.magicnum == XFS_Magic) break; } - } if(xfsSb.magicnum != XFS_Magic) return; diff --git a/DiscImageChef.Filesystems/ZFS.cs b/DiscImageChef.Filesystems/ZFS.cs index 9c32b483..b2ff8e89 100644 --- a/DiscImageChef.Filesystems/ZFS.cs +++ b/DiscImageChef.Filesystems/ZFS.cs @@ -679,10 +679,8 @@ namespace DiscImageChef.Filesystems case NVS_DataTypes.DATA_TYPE_BOOLEAN_ARRAY: case NVS_DataTypes.DATA_TYPE_BOOLEAN_VALUE: if(item.elements > 1) - { for(int i = 0; i < item.elements; i++) sb.AppendFormat("{0}[{1}] = {2}", item.name, i, ((bool[])item.value)[i]).AppendLine(); - } else sb.AppendFormat("{0} = {1}", item.name, (bool)item.value).AppendLine(); break; @@ -691,109 +689,87 @@ namespace DiscImageChef.Filesystems case NVS_DataTypes.DATA_TYPE_UINT8: case NVS_DataTypes.DATA_TYPE_UINT8_ARRAY: if(item.elements > 1) - { for(int i = 0; i < item.elements; i++) sb.AppendFormat("{0}[{1}] = {2}", item.name, i, ((byte[])item.value)[i]).AppendLine(); - } else sb.AppendFormat("{0} = {1}", item.name, (byte)item.value).AppendLine(); break; case NVS_DataTypes.DATA_TYPE_DOUBLE: if(item.elements > 1) - { for(int i = 0; i < item.elements; i++) sb.AppendFormat("{0}[{1}] = {2}", item.name, i, ((double[])item.value)[i]).AppendLine(); - } else sb.AppendFormat("{0} = {1}", item.name, (double)item.value).AppendLine(); break; case NVS_DataTypes.DATA_TYPE_HRTIME: if(item.elements > 1) - { for(int i = 0; i < item.elements; i++) sb.AppendFormat("{0}[{1}] = {2}", item.name, i, ((DateTime[])item.value)[i]) .AppendLine(); - } else sb.AppendFormat("{0} = {1}", item.name, (DateTime)item.value).AppendLine(); break; case NVS_DataTypes.DATA_TYPE_INT16: case NVS_DataTypes.DATA_TYPE_INT16_ARRAY: if(item.elements > 1) - { for(int i = 0; i < item.elements; i++) sb.AppendFormat("{0}[{1}] = {2}", item.name, i, ((short[])item.value)[i]).AppendLine(); - } else sb.AppendFormat("{0} = {1}", item.name, (short)item.value).AppendLine(); break; case NVS_DataTypes.DATA_TYPE_INT32: case NVS_DataTypes.DATA_TYPE_INT32_ARRAY: if(item.elements > 1) - { for(int i = 0; i < item.elements; i++) sb.AppendFormat("{0}[{1}] = {2}", item.name, i, ((int[])item.value)[i]).AppendLine(); - } else sb.AppendFormat("{0} = {1}", item.name, (int)item.value).AppendLine(); break; case NVS_DataTypes.DATA_TYPE_INT64: case NVS_DataTypes.DATA_TYPE_INT64_ARRAY: if(item.elements > 1) - { for(int i = 0; i < item.elements; i++) sb.AppendFormat("{0}[{1}] = {2}", item.name, i, ((long[])item.value)[i]).AppendLine(); - } else sb.AppendFormat("{0} = {1}", item.name, (long)item.value).AppendLine(); break; case NVS_DataTypes.DATA_TYPE_INT8: case NVS_DataTypes.DATA_TYPE_INT8_ARRAY: if(item.elements > 1) - { for(int i = 0; i < item.elements; i++) sb.AppendFormat("{0}[{1}] = {2}", item.name, i, ((sbyte[])item.value)[i]).AppendLine(); - } else sb.AppendFormat("{0} = {1}", item.name, (sbyte)item.value).AppendLine(); break; case NVS_DataTypes.DATA_TYPE_STRING: case NVS_DataTypes.DATA_TYPE_STRING_ARRAY: if(item.elements > 1) - { for(int i = 0; i < item.elements; i++) sb.AppendFormat("{0}[{1}] = {2}", item.name, i, ((string[])item.value)[i]).AppendLine(); - } else sb.AppendFormat("{0} = {1}", item.name, (string)item.value).AppendLine(); break; case NVS_DataTypes.DATA_TYPE_UINT16: case NVS_DataTypes.DATA_TYPE_UINT16_ARRAY: if(item.elements > 1) - { for(int i = 0; i < item.elements; i++) sb.AppendFormat("{0}[{1}] = {2}", item.name, i, ((ushort[])item.value)[i]).AppendLine(); - } else sb.AppendFormat("{0} = {1}", item.name, (ushort)item.value).AppendLine(); break; case NVS_DataTypes.DATA_TYPE_UINT32: case NVS_DataTypes.DATA_TYPE_UINT32_ARRAY: if(item.elements > 1) - { for(int i = 0; i < item.elements; i++) sb.AppendFormat("{0}[{1}] = {2}", item.name, i, ((uint[])item.value)[i]).AppendLine(); - } else sb.AppendFormat("{0} = {1}", item.name, (uint)item.value).AppendLine(); break; case NVS_DataTypes.DATA_TYPE_UINT64: case NVS_DataTypes.DATA_TYPE_UINT64_ARRAY: if(item.elements > 1) - { for(int i = 0; i < item.elements; i++) sb.AppendFormat("{0}[{1}] = {2}", item.name, i, ((ulong[])item.value)[i]).AppendLine(); - } else sb.AppendFormat("{0} = {1}", item.name, (ulong)item.value).AppendLine(); break; @@ -807,11 +783,9 @@ namespace DiscImageChef.Filesystems break; default: if(item.elements > 1) - { for(int i = 0; i < item.elements; i++) sb.AppendFormat("{0}[{1}] = Unknown data type {2}", item.name, i, item.dataType) .AppendLine(); - } else sb.AppendFormat("{0} = Unknown data type {1}", item.name, item.dataType).AppendLine(); break; diff --git a/DiscImageChef.Filesystems/ext2FS.cs b/DiscImageChef.Filesystems/ext2FS.cs index 0fa8b01e..d3e3dd4d 100644 --- a/DiscImageChef.Filesystems/ext2FS.cs +++ b/DiscImageChef.Filesystems/ext2FS.cs @@ -288,14 +288,12 @@ namespace DiscImageChef.Filesystems } if(supblk.check_t > 0) - { if(supblk.check_inv > 0) sb.AppendFormat("Last checked on {0} (should check every {1} seconds)", DateHandlers.UNIXUnsignedToDateTime(supblk.check_t), supblk.check_inv).AppendLine(); else sb.AppendFormat("Last checked on {0}", DateHandlers.UNIXUnsignedToDateTime(supblk.check_t)) .AppendLine(); - } else { if(supblk.check_inv > 0) diff --git a/DiscImageChef.Filters/AppleDouble.cs b/DiscImageChef.Filters/AppleDouble.cs index 4715b93f..8bc871e9 100644 --- a/DiscImageChef.Filters/AppleDouble.cs +++ b/DiscImageChef.Filters/AppleDouble.cs @@ -583,7 +583,6 @@ namespace DiscImageChef.Filters creationTime = DateTime.UtcNow; lastWriteTime = creationTime; foreach(AppleDoubleEntry entry in entries) - { switch((AppleDoubleEntryID)entry.id) { case AppleDoubleEntryID.DataFork: @@ -635,7 +634,6 @@ namespace DiscImageChef.Filters rsrcFork = entry; break; } - } dataFork = new AppleDoubleEntry(); dataFork.id = (uint)AppleDoubleEntryID.DataFork; diff --git a/DiscImageChef.Filters/AppleSingle.cs b/DiscImageChef.Filters/AppleSingle.cs index d7bcd062..e2969aea 100644 --- a/DiscImageChef.Filters/AppleSingle.cs +++ b/DiscImageChef.Filters/AppleSingle.cs @@ -304,7 +304,6 @@ namespace DiscImageChef.Filters creationTime = DateTime.UtcNow; lastWriteTime = creationTime; foreach(AppleSingleEntry entry in entries) - { switch((AppleSingleEntryID)entry.id) { case AppleSingleEntryID.DataFork: @@ -356,7 +355,6 @@ namespace DiscImageChef.Filters rsrcFork = entry; break; } - } ms.Close(); opened = true; @@ -383,7 +381,6 @@ namespace DiscImageChef.Filters creationTime = DateTime.UtcNow; lastWriteTime = creationTime; foreach(AppleSingleEntry entry in entries) - { switch((AppleSingleEntryID)entry.id) { case AppleSingleEntryID.DataFork: @@ -435,7 +432,6 @@ namespace DiscImageChef.Filters rsrcFork = entry; break; } - } stream.Seek(0, SeekOrigin.Begin); opened = true; @@ -463,7 +459,6 @@ namespace DiscImageChef.Filters creationTime = DateTime.UtcNow; lastWriteTime = creationTime; foreach(AppleSingleEntry entry in entries) - { switch((AppleSingleEntryID)entry.id) { case AppleSingleEntryID.DataFork: @@ -515,7 +510,6 @@ namespace DiscImageChef.Filters rsrcFork = entry; break; } - } fs.Close(); opened = true; diff --git a/DiscImageChef.Filters/BZip2.cs b/DiscImageChef.Filters/BZip2.cs index 2387a9e2..bf1b5d9c 100644 --- a/DiscImageChef.Filters/BZip2.cs +++ b/DiscImageChef.Filters/BZip2.cs @@ -91,11 +91,8 @@ namespace DiscImageChef.Filters if(buffer[0] == 0x42 && buffer[1] == 0x5A && buffer[2] == 0x68 && buffer[3] >= 0x31 && buffer[3] <= 0x39) { if(buffer.Length > 512) - { - // Check it is not an UDIF if(buffer[buffer.Length - 512] == 0x6B && buffer[buffer.Length - 511] == 0x6F && buffer[buffer.Length - 510] == 0x6C && buffer[buffer.Length - 509] == 0x79) return false; - } return true; } diff --git a/DiscImageChef.Helpers/BigEndianMarshal.cs b/DiscImageChef.Helpers/BigEndianMarshal.cs index 84fadb93..0fd5c34a 100644 --- a/DiscImageChef.Helpers/BigEndianMarshal.cs +++ b/DiscImageChef.Helpers/BigEndianMarshal.cs @@ -66,7 +66,6 @@ namespace DiscImageChef Type t = str.GetType(); FieldInfo[] fieldInfo = t.GetFields(); foreach(FieldInfo fi in fieldInfo) - { if(fi.FieldType == typeof(short)) { short int16 = (short)fi.GetValue(str); @@ -123,7 +122,6 @@ namespace DiscImageChef byte[] dbl_r = dbl_b.Reverse().ToArray(); fi.SetValueDirect(__makeref(str), BitConverter.ToDouble(dbl_r, 0)); } - } return str; } diff --git a/DiscImageChef.Helpers/CompareBytes.cs b/DiscImageChef.Helpers/CompareBytes.cs index 776fffa3..5eb96857 100644 --- a/DiscImageChef.Helpers/CompareBytes.cs +++ b/DiscImageChef.Helpers/CompareBytes.cs @@ -54,13 +54,11 @@ namespace DiscImageChef else leastBytes = compareArray1.LongLength; for(long i = 0; i < leastBytes; i++) - { if(compareArray1[i] != compareArray2[i]) { different = true; return; } - } } } } \ No newline at end of file diff --git a/DiscImageChef.Helpers/Extents/ExtentsByte.cs b/DiscImageChef.Helpers/Extents/ExtentsByte.cs index 59a38066..b7efb0f7 100644 --- a/DiscImageChef.Helpers/Extents/ExtentsByte.cs +++ b/DiscImageChef.Helpers/Extents/ExtentsByte.cs @@ -199,13 +199,11 @@ namespace Extents { start = 0; foreach(Tuple extent in backend) - { if(item >= extent.Item1 && item <= extent.Item2) { start = extent.Item1; return true; } - } return false; } diff --git a/DiscImageChef.Helpers/Extents/ExtentsInt.cs b/DiscImageChef.Helpers/Extents/ExtentsInt.cs index bbdab8ab..ee6b2d3c 100644 --- a/DiscImageChef.Helpers/Extents/ExtentsInt.cs +++ b/DiscImageChef.Helpers/Extents/ExtentsInt.cs @@ -199,13 +199,11 @@ namespace Extents { start = 0; foreach(Tuple extent in backend) - { if(item >= extent.Item1 && item <= extent.Item2) { start = extent.Item1; return true; } - } return false; } diff --git a/DiscImageChef.Helpers/Extents/ExtentsLong.cs b/DiscImageChef.Helpers/Extents/ExtentsLong.cs index b29e5363..1e2979ce 100644 --- a/DiscImageChef.Helpers/Extents/ExtentsLong.cs +++ b/DiscImageChef.Helpers/Extents/ExtentsLong.cs @@ -199,13 +199,11 @@ namespace Extents { start = 0; foreach(Tuple extent in backend) - { if(item >= extent.Item1 && item <= extent.Item2) { start = extent.Item1; return true; } - } return false; } diff --git a/DiscImageChef.Helpers/Extents/ExtentsSByte.cs b/DiscImageChef.Helpers/Extents/ExtentsSByte.cs index df33ce34..8ecd6093 100644 --- a/DiscImageChef.Helpers/Extents/ExtentsSByte.cs +++ b/DiscImageChef.Helpers/Extents/ExtentsSByte.cs @@ -199,13 +199,11 @@ namespace Extents { start = 0; foreach(Tuple extent in backend) - { if(item >= extent.Item1 && item <= extent.Item2) { start = extent.Item1; return true; } - } return false; } diff --git a/DiscImageChef.Helpers/Extents/ExtentsShort.cs b/DiscImageChef.Helpers/Extents/ExtentsShort.cs index 943e4a55..2e5f4015 100644 --- a/DiscImageChef.Helpers/Extents/ExtentsShort.cs +++ b/DiscImageChef.Helpers/Extents/ExtentsShort.cs @@ -199,13 +199,11 @@ namespace Extents { start = 0; foreach(Tuple extent in backend) - { if(item >= extent.Item1 && item <= extent.Item2) { start = extent.Item1; return true; } - } return false; } diff --git a/DiscImageChef.Helpers/Extents/ExtentsUInt.cs b/DiscImageChef.Helpers/Extents/ExtentsUInt.cs index ccda61f8..8fb27ffc 100644 --- a/DiscImageChef.Helpers/Extents/ExtentsUInt.cs +++ b/DiscImageChef.Helpers/Extents/ExtentsUInt.cs @@ -199,13 +199,11 @@ namespace Extents { start = 0; foreach(Tuple extent in backend) - { if(item >= extent.Item1 && item <= extent.Item2) { start = extent.Item1; return true; } - } return false; } diff --git a/DiscImageChef.Helpers/Extents/ExtentsULong.cs b/DiscImageChef.Helpers/Extents/ExtentsULong.cs index 76a242ac..68d5a3b6 100644 --- a/DiscImageChef.Helpers/Extents/ExtentsULong.cs +++ b/DiscImageChef.Helpers/Extents/ExtentsULong.cs @@ -199,13 +199,11 @@ namespace Extents { start = 0; foreach(Tuple extent in backend) - { if(item >= extent.Item1 && item <= extent.Item2) { start = extent.Item1; return true; } - } return false; } diff --git a/DiscImageChef.Helpers/Extents/ExtentsUShort.cs b/DiscImageChef.Helpers/Extents/ExtentsUShort.cs index d8720d39..e74f0287 100644 --- a/DiscImageChef.Helpers/Extents/ExtentsUShort.cs +++ b/DiscImageChef.Helpers/Extents/ExtentsUShort.cs @@ -200,13 +200,11 @@ namespace Extents { start = 0; foreach(Tuple extent in backend) - { if(item >= extent.Item1 && item <= extent.Item2) { start = extent.Item1; return true; } - } return false; } diff --git a/DiscImageChef.Helpers/StringHandlers.cs b/DiscImageChef.Helpers/StringHandlers.cs index c6ccc887..839cfea8 100644 --- a/DiscImageChef.Helpers/StringHandlers.cs +++ b/DiscImageChef.Helpers/StringHandlers.cs @@ -62,7 +62,6 @@ namespace DiscImageChef for(int i = start; i < CString.Length; i++) { if(CString[i] == 0) - { if(twoBytes) { if(i + 1 < CString.Length && CString[i + 1] == 0) @@ -74,7 +73,6 @@ namespace DiscImageChef // break; } else break; - } len++; } diff --git a/DiscImageChef.Partitions/Acorn.cs b/DiscImageChef.Partitions/Acorn.cs index 25ca10d6..a227e2a7 100644 --- a/DiscImageChef.Partitions/Acorn.cs +++ b/DiscImageChef.Partitions/Acorn.cs @@ -145,7 +145,6 @@ namespace DiscImageChef.Partitions Marshal.FreeHGlobal(tablePtr); if(table.magic == RISCIX_MAGIC) - { foreach(RiscIxEntry entry in table.partitions) { Partition part = new Partition @@ -164,7 +163,6 @@ namespace DiscImageChef.Partitions counter++; } } - } } return !(partitions.Count == 0); diff --git a/DiscImageChef.Partitions/AppleMap.cs b/DiscImageChef.Partitions/AppleMap.cs index 5c51ef17..0e58dbba 100644 --- a/DiscImageChef.Partitions/AppleMap.cs +++ b/DiscImageChef.Partitions/AppleMap.cs @@ -96,7 +96,6 @@ namespace DiscImageChef.Partitions uint sequence = 0; if(ddm.sbSig == DDM_MAGIC) - { if(ddm.sbDrvrCount < max_drivers) { ddm.sbMap = new AppleDriverEntry[ddm.sbDrvrCount]; @@ -131,7 +130,6 @@ namespace DiscImageChef.Partitions sequence++; } } - } byte[] part_sector = imagePlugin.ReadSector(1 + sectorOffset); AppleOldDevicePartitionMap old_map = @@ -335,11 +333,9 @@ namespace DiscImageChef.Partitions sequence++; } else - { DicConsole.DebugWriteLine("AppleMap Plugin", "Not adding partition becaus start ({0}) is outside media size ({1})", _partition.Start, imagePlugin.ImageInfo.Sectors - 1); - } } } } diff --git a/DiscImageChef.Partitions/Atari.cs b/DiscImageChef.Partitions/Atari.cs index 8d65b391..41d23a2a 100644 --- a/DiscImageChef.Partitions/Atari.cs +++ b/DiscImageChef.Partitions/Atari.cs @@ -313,7 +313,6 @@ namespace DiscImageChef.Partitions } if(validTable) - { for(int i = 0; i < 8; i++) { uint type = table.icdEntries[i].type & 0x00FFFFFF; @@ -321,7 +320,6 @@ namespace DiscImageChef.Partitions if(type == TypeGEMDOS || type == TypeBigGEMDOS || type == TypeLinux || type == TypeSwap || type == TypeRAW || type == TypeNetBSD || type == TypeNetBSDSwap || type == TypeSysV || type == TypeMac || type == TypeMinix || type == TypeMinix2) - { if(table.icdEntries[i].start <= imagePlugin.GetSectors()) { if(table.icdEntries[i].start + table.icdEntries[i].length > imagePlugin.GetSectors()) @@ -388,9 +386,7 @@ namespace DiscImageChef.Partitions partitions.Add(part); partitionSequence++; } - } } - } return partitions.Count > 0; } diff --git a/DiscImageChef.Partitions/GPT.cs b/DiscImageChef.Partitions/GPT.cs index 352f07b0..32db1821 100644 --- a/DiscImageChef.Partitions/GPT.cs +++ b/DiscImageChef.Partitions/GPT.cs @@ -64,7 +64,6 @@ namespace DiscImageChef.Partitions DicConsole.DebugWriteLine("GPT Plugin", "hdr.signature = 0x{0:X16}", signature); if(signature != GptMagic) - { if(imagePlugin.ImageInfo.XmlMediaType == DiscImages.XmlMediaType.OpticalDisc) { hdrBytes = imagePlugin.ReadSector(sectorOffset); @@ -81,7 +80,6 @@ namespace DiscImageChef.Partitions else return false; } else return false; - } try { @@ -153,7 +151,6 @@ namespace DiscImageChef.Partitions ulong pseq = 0; foreach(GptEntry entry in entries) - { if(entry.partitionType != Guid.Empty && entry.partitionId != Guid.Empty) { DicConsole.DebugWriteLine("GPT Plugin", "entry.partitionType = {0}", entry.partitionType); @@ -181,7 +178,6 @@ namespace DiscImageChef.Partitions DicConsole.DebugWriteLine("GPT Plugin", "part.PartitionType = {0}", part.Type); partitions.Add(part); } - } return true; } diff --git a/DiscImageChef.Partitions/MBR.cs b/DiscImageChef.Partitions/MBR.cs index af63fd09..d0353492 100644 --- a/DiscImageChef.Partitions/MBR.cs +++ b/DiscImageChef.Partitions/MBR.cs @@ -189,11 +189,9 @@ namespace DiscImageChef.Partitions DicConsole.DebugWriteLine("MBR plugin", "lba_sectors {0}", lba_sectors); if(valid && minix) // Let's mix the fun - { if(GetMinix(imagePlugin, lba_start, divider, sectorOffset, sectorSize, out List mnx_parts)) partitions.AddRange(mnx_parts); else minix = false; - } if(valid && !minix) { @@ -311,11 +309,9 @@ namespace DiscImageChef.Partitions ext_sectors = imagePlugin.GetSectors() - ext_start; if(ext_valid && ext_minix) // Let's mix the fun - { if(GetMinix(imagePlugin, lba_start, divider, sectorOffset, sectorSize, out List mnx_parts)) partitions.AddRange(mnx_parts); else ext_minix = false; - } if(ext_valid && !ext_minix) { diff --git a/DiscImageChef.Partitions/Sun.cs b/DiscImageChef.Partitions/Sun.cs index 9fe63674..5d093e6a 100644 --- a/DiscImageChef.Partitions/Sun.cs +++ b/DiscImageChef.Partitions/Sun.cs @@ -130,11 +130,9 @@ namespace DiscImageChef.Partitions DicConsole.DebugWriteLine("Sun plugin", "dkl16.dkl_vtoc.v_sanity = 0x{0:X8}", dkl16.dkl_vtoc.v_sanity); if(dkl.dkl_magic == DKL_MAGIC || dkl.dkl_magic == DKL_CIGAM) - { if(dkl16.dkl_vtoc.v_sanity == VTOC_SANE || dkl16.dkl_vtoc.v_sanity == VTOC_ENAS) useDkl16 = true; else if(dkl8.dkl_vtoc.v_sanity == VTOC_SANE || dkl8.dkl_vtoc.v_sanity == VTOC_ENAS) useDkl8 = true; else useDkl = true; - } if(!useDkl && !useDkl8 && !useDkl16) { @@ -147,11 +145,9 @@ namespace DiscImageChef.Partitions handle.Free(); if(dkl.dkl_magic == DKL_MAGIC || dkl.dkl_magic == DKL_CIGAM) - { if(dkl16.dkl_vtoc.v_sanity == VTOC_SANE || dkl16.dkl_vtoc.v_sanity == VTOC_ENAS) useDkl16 = true; else if(dkl8.dkl_vtoc.v_sanity == VTOC_SANE || dkl8.dkl_vtoc.v_sanity == VTOC_ENAS) useDkl8 = true; else useDkl = true; - } } if(!useDkl && !useDkl8 && !useDkl16) return false; @@ -191,7 +187,6 @@ namespace DiscImageChef.Partitions DicConsole.DebugWriteLine("Sun plugin", "sectorsPerCylinder = {0}", sectorsPerCylinder); 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 @@ -209,7 +204,6 @@ namespace DiscImageChef.Partitions if(part.Start < imagePlugin.GetSectors() && part.End <= imagePlugin.GetSectors()) partitions.Add(part); } - } } else if(useDkl8) { @@ -257,7 +251,6 @@ namespace DiscImageChef.Partitions if(dkl8.dkl_vtoc.v_nparts > NDKMAP) return false; for(int i = 0; i < dkl8.dkl_vtoc.v_nparts; i++) - { 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) { @@ -283,7 +276,6 @@ namespace DiscImageChef.Partitions if(part.Start < imagePlugin.GetSectors() && part.End <= imagePlugin.GetSectors()) partitions.Add(part); } - } } else if(useDkl16) { @@ -327,7 +319,6 @@ namespace DiscImageChef.Partitions if(dkl16.dkl_vtoc.v_nparts > NDKMAP16) return false; for(int i = 0; i < dkl16.dkl_vtoc.v_nparts; i++) - { 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) { @@ -354,7 +345,6 @@ namespace DiscImageChef.Partitions if(part.Start < imagePlugin.GetSectors() && part.End <= imagePlugin.GetSectors()) partitions.Add(part); } - } } return partitions.Count > 0; diff --git a/DiscImageChef.Partitions/VTOC.cs b/DiscImageChef.Partitions/VTOC.cs index 068e5f70..b111def6 100644 --- a/DiscImageChef.Partitions/VTOC.cs +++ b/DiscImageChef.Partitions/VTOC.cs @@ -323,16 +323,13 @@ namespace DiscImageChef.Partitions // Check for a partition describing the VTOC whose start is the same as the start we know. // This means partition starts are absolute, not relative, to the VTOC position for(int i = 0; i < V_NUMPAR; i++) - { if(parts[i].p_tag == pTag.V_BACKUP && (ulong)parts[i].p_start == sectorOffset) { absolute = true; break; } - } for(int i = 0; i < V_NUMPAR; i++) - { if(parts[i].p_tag != pTag.V_UNUSED) { Partition part = new Partition @@ -366,7 +363,6 @@ namespace DiscImageChef.Partitions if(part.End < imagePlugin.GetSectors()) partitions.Add(part); } - } return partitions.Count > 0; } diff --git a/DiscImageChef.Server/App_Start/ScsiInquiry.cs b/DiscImageChef.Server/App_Start/ScsiInquiry.cs index 15ea06bc..5440b64d 100644 --- a/DiscImageChef.Server/App_Start/ScsiInquiry.cs +++ b/DiscImageChef.Server/App_Start/ScsiInquiry.cs @@ -268,9 +268,7 @@ namespace DiscImageChef.Server.App_Start } if(inquiry.VersionDescriptors != null) - { foreach(ushort VersionDescriptor in inquiry.VersionDescriptors) - { switch(VersionDescriptor) { case 0xFFFF: @@ -1701,8 +1699,6 @@ namespace DiscImageChef.Server.App_Start VersionDescriptor)); break; } - } - } return scsiOneValue; } diff --git a/DiscImageChef.Server/App_Start/ScsiMmcMode.cs b/DiscImageChef.Server/App_Start/ScsiMmcMode.cs index 0120ffea..bb8d5b8e 100644 --- a/DiscImageChef.Server/App_Start/ScsiMmcMode.cs +++ b/DiscImageChef.Server/App_Start/ScsiMmcMode.cs @@ -111,22 +111,16 @@ namespace DiscImageChef.Server.App_Start } if(mode.ReadsCDRW) - { if(mode.WritesCDRW) mmcOneValue.Add("Drive can read and write CD-RW"); else mmcOneValue.Add("Drive can read CD-RW"); - } if(mode.ReadsDVDROM) mmcOneValue.Add("Drive can read DVD-ROM"); if(mode.ReadsDVDR) - { if(mode.WritesDVDR) mmcOneValue.Add("Drive can read and write DVD-R"); else mmcOneValue.Add("Drive can read DVD-R"); - } if(mode.ReadsDVDRAM) - { if(mode.WritesDVDRAM) mmcOneValue.Add("Drive can read and write DVD-RAM"); else mmcOneValue.Add("Drive can read DVD-RAM"); - } if(mode.CompositeAudioVideo) mmcOneValue.Add("Drive can deliver a composite audio and video data stream"); if(mode.DigitalPort1) mmcOneValue.Add("Drive supports IEC-958 digital output on port 1"); @@ -154,12 +148,9 @@ namespace DiscImageChef.Server.App_Start } if(mode.WriteSpeedPerformanceDescriptors != null) - { foreach(Decoders.SCSI.Modes.ModePage_2A_WriteDescriptor descriptor in mode.WriteSpeedPerformanceDescriptors) - { if(descriptor.WriteSpeed > 0) - { if(descriptor.RotationControl == 0) mmcOneValue.Add(string.Format("Drive supports writing at {0} Kbyte/sec. in CLV mode", descriptor.WriteSpeed)); @@ -167,9 +158,6 @@ namespace DiscImageChef.Server.App_Start mmcOneValue .Add(string.Format("Drive supports writing at is {0} Kbyte/sec. in pure CAV mode", descriptor.WriteSpeed)); - } - } - } if(mode.TestWrite) mmcOneValue.Add("Drive supports test writing"); diff --git a/DiscImageChef.Server/App_Start/ScsiModeSense.cs b/DiscImageChef.Server/App_Start/ScsiModeSense.cs index 45aa18bc..d05a8d84 100644 --- a/DiscImageChef.Server/App_Start/ScsiModeSense.cs +++ b/DiscImageChef.Server/App_Start/ScsiModeSense.cs @@ -45,20 +45,15 @@ namespace DiscImageChef.Server.App_Start scsiOneValue.Add(string.Format("Medium type is {0:X2}h", modeSense.MediumType)); if(modeSense.WriteProtected) scsiOneValue.Add("Device is write protected."); if(modeSense.BlockDescriptors != null) - { foreach(blockDescriptorType descriptor in modeSense.BlockDescriptors) - { if(descriptor.BlocksSpecified && descriptor.BlockLengthSpecified) scsiOneValue.Add(string.Format("Density code {0:X2}h has {1} blocks of {2} bytes each", descriptor.Density, descriptor.Blocks, descriptor.BlockLength)); else scsiOneValue.Add(string.Format("Density code {0:X2}h", descriptor.Density)); - } - } if(modeSense.DPOandFUA) scsiOneValue.Add("Drive supports DPO and FUA bits"); if(modeSense.BlankCheckEnabled) scsiOneValue.Add("Blank checking during write is enabled"); if(modeSense.BufferedModeSpecified) - { switch(modeSense.BufferedMode) { case 0: @@ -74,12 +69,10 @@ namespace DiscImageChef.Server.App_Start scsiOneValue.Add(string.Format("Unknown buffered mode code 0x{0:X2}", modeSense.BufferedMode)); break; } - } if(modeSense.ModePages != null) { foreach(modePageType page in modeSense.ModePages) - { switch(page.page) { case 0x00: @@ -102,14 +95,12 @@ namespace DiscImageChef.Server.App_Start case 0x01: { if(page.subpage == 0) - { if(deviceType == PeripheralDeviceTypes.MultiMediaDevice) modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_01_MMC(page.value)); else modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_01(page.value)); - } else goto default; break; @@ -162,14 +153,12 @@ namespace DiscImageChef.Server.App_Start case 0x07: { if(page.subpage == 0) - { if(deviceType == PeripheralDeviceTypes.MultiMediaDevice) modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_07_MMC(page.value)); else modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_07(page.value)); - } else goto default; break; @@ -234,14 +223,12 @@ namespace DiscImageChef.Server.App_Start case 0x10: { if(page.subpage == 0) - { if(deviceType == Decoders.SCSI.PeripheralDeviceTypes.SequentialAccess) modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_10_SSC(page.value)); else modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_10(page.value)); - } else goto default; break; @@ -290,14 +277,12 @@ namespace DiscImageChef.Server.App_Start case 0x1C: { if(page.subpage == 0) - { if(deviceType == PeripheralDeviceTypes.MultiMediaDevice) modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_1C_SFF(page.value)); else modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_1C(page.value)); - } else if(page.subpage == 1) modePages.Add(string.Format("MODE page {0:X2}h", page.page), Modes.PrettifyModePage_1C_S01(page.value)); @@ -419,14 +404,11 @@ namespace DiscImageChef.Server.App_Start } break; } - } Dictionary newModePages = new Dictionary(); foreach(KeyValuePair kvp in modePages) - { if(string.IsNullOrWhiteSpace(kvp.Value)) newModePages.Add(kvp.Key, "Undecoded"); else newModePages.Add(kvp.Key, kvp.Value.Replace("\n", "
")); - } modePages = newModePages; } diff --git a/DiscImageChef.Server/App_Start/TestedMedia.cs b/DiscImageChef.Server/App_Start/TestedMedia.cs index ab6bd1ac..262a911b 100644 --- a/DiscImageChef.Server/App_Start/TestedMedia.cs +++ b/DiscImageChef.Server/App_Start/TestedMedia.cs @@ -76,31 +76,25 @@ namespace DiscImageChef.Server.App_Start testedMedia.BlockSize)); if(testedMedia.Blocks * testedMedia.BlockSize / 1024 / 1024 > 1000000) - { mediaOneValue.Add(string.Format("Medium size: {0} bytes, {1} Tb, {2:F2} TiB", testedMedia.Blocks * testedMedia.BlockSize, testedMedia.Blocks * testedMedia.BlockSize / 1000 / 1000 / 1000 / 1000, (double)(testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024 / 1024 / 1024)); - } else if(testedMedia.Blocks * testedMedia.BlockSize / 1024 / 1024 > 1000) - { mediaOneValue.Add(string.Format("Medium size: {0} bytes, {1} Gb, {2:F2} GiB", testedMedia.Blocks * testedMedia.BlockSize, testedMedia.Blocks * testedMedia.BlockSize / 1000 / 1000 / 1000, (double)(testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024 / 1024)); - } else - { mediaOneValue.Add(string.Format("Medium size: {0} bytes, {1} Mb, {2:F2} MiB", testedMedia.Blocks * testedMedia.BlockSize, testedMedia.Blocks * testedMedia.BlockSize / 1000 / 1000, (double)(testedMedia.Blocks * testedMedia.BlockSize) / 1024 / 1024)); - } } if(testedMedia.CHS != null && testedMedia.CurrentCHS != null) @@ -142,32 +136,26 @@ namespace DiscImageChef.Server.App_Start testedMedia.LBASectors)); if((ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1024 / 1024 > 1000000) - { mediaOneValue.Add(string.Format("Medium size in 28-bit LBA mode: {0} bytes, {1} Tb, {2:F2} TiB", (ulong)testedMedia.LBASectors * testedMedia.BlockSize, (ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1000 / 1000 / 1000 / 1000, (double)((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024 / 1024 / 1024)); - } else if((ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1024 / 1024 > 1000) - { mediaOneValue.Add(string.Format("Medium size in 28-bit LBA mode: {0} bytes, {1} Gb, {2:F2} GiB", (ulong)testedMedia.LBASectors * testedMedia.BlockSize, (ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1000 / 1000 / 1000, (double)((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024 / 1024)); - } else - { mediaOneValue.Add(string.Format("Medium size in 28-bit LBA mode: {0} bytes, {1} Mb, {2:F2} MiB", (ulong)testedMedia.LBASectors * testedMedia.BlockSize, (ulong)testedMedia.LBASectors * testedMedia.BlockSize / 1000 / 1000, (double)((ulong)testedMedia.LBASectors * testedMedia.BlockSize) / 1024 / 1024)); - } } if(testedMedia.LBA48SectorsSpecified) @@ -176,49 +164,39 @@ namespace DiscImageChef.Server.App_Start testedMedia.LBA48Sectors)); if(testedMedia.LBA48Sectors * testedMedia.BlockSize / 1024 / 1024 > 1000000) - { mediaOneValue.Add(string.Format("Medium size in 48-bit LBA mode: {0} bytes, {1} Tb, {2:F2} TiB", testedMedia.LBA48Sectors * testedMedia.BlockSize, testedMedia.LBA48Sectors * testedMedia.BlockSize / 1000 / 1000 / 1000 / 1000, (double)(testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024 / 1024 / 1024)); - } else if(testedMedia.LBA48Sectors * testedMedia.BlockSize / 1024 / 1024 > 1000) - { mediaOneValue.Add(string.Format("Medium size in 48-bit LBA mode: {0} bytes, {1} Gb, {2:F2} GiB", testedMedia.LBA48Sectors * testedMedia.BlockSize, testedMedia.LBA48Sectors * testedMedia.BlockSize / 1000 / 1000 / 1000, (double)(testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024 / 1024)); - } else - { mediaOneValue.Add(string.Format("Medium size in 48-bit LBA mode: {0} bytes, {1} Mb, {2:F2} MiB", testedMedia.LBA48Sectors * testedMedia.BlockSize, testedMedia.LBA48Sectors * testedMedia.BlockSize / 1000 / 1000, (double)(testedMedia.LBA48Sectors * testedMedia.BlockSize) / 1024 / 1024)); - } } if(testedMedia.NominalRotationRateSpecified && testedMedia.NominalRotationRate != 0x0000 && testedMedia.NominalRotationRate != 0xFFFF) - { if(testedMedia.NominalRotationRate == 0x0001) mediaOneValue.Add("Medium does not rotate."); else mediaOneValue.Add(string.Format("Medium rotates at {0} rpm", testedMedia.NominalRotationRate)); - } if(testedMedia.BlockSizeSpecified && testedMedia.PhysicalBlockSizeSpecified && testedMedia.BlockSize != testedMedia.PhysicalBlockSize && (testedMedia.LogicalAlignment & 0x8000) == 0x0000 && (testedMedia.LogicalAlignment & 0x4000) == 0x4000) - { mediaOneValue.Add(string.Format("Logical sector starts at offset {0} from physical sector", testedMedia.LogicalAlignment & 0x3FFF)); - } if(testedMedia.SupportsRead && ata) mediaOneValue.Add("Device can use the READ SECTOR(S) command in CHS mode with this medium"); diff --git a/DiscImageChef.Server/Statistics.aspx.cs b/DiscImageChef.Server/Statistics.aspx.cs index 6008cbc4..590b5de2 100644 --- a/DiscImageChef.Server/Statistics.aspx.cs +++ b/DiscImageChef.Server/Statistics.aspx.cs @@ -98,7 +98,6 @@ namespace DiscImageChef.Server { operatingSystems = new List(); foreach(OsStats nvs in statistics.OperatingSystems) - { operatingSystems.Add(new NameValueStats { name = string.Format("{0}{1}{2}", @@ -108,7 +107,6 @@ namespace DiscImageChef.Server string.IsNullOrEmpty(nvs.version) ? "" : " ", nvs.version), Value = nvs.Value }); - } repOperatingSystems.DataSource = operatingSystems.OrderBy(os => os.name).ToList(); repOperatingSystems.DataBind(); @@ -119,11 +117,9 @@ namespace DiscImageChef.Server { versions = new List(); foreach(NameValueStats nvs in statistics.Versions) - { if(nvs.name == "previous") versions.Add(new NameValueStats {name = "Previous than 3.4.99.0", Value = nvs.Value}); else versions.Add(nvs); - } repVersions.DataSource = versions.OrderBy(ver => ver.name).ToList(); repVersions.DataBind(); diff --git a/DiscImageChef.Server/ViewReport.aspx.cs b/DiscImageChef.Server/ViewReport.aspx.cs index 6a8ad5e9..04d975cb 100644 --- a/DiscImageChef.Server/ViewReport.aspx.cs +++ b/DiscImageChef.Server/ViewReport.aspx.cs @@ -54,25 +54,19 @@ namespace DiscImageChef.Server // Strip non-ascii, strip slashes and question marks if(manufacturer != null) - { manufacturer = Encoding .ASCII.GetString(Encoding.Convert(Encoding.UTF8, Encoding.ASCII, Encoding.UTF8.GetBytes(manufacturer))).Replace('/', '_') .Replace('\\', '_').Replace('?', '_'); - } if(model != null) - { model = Encoding .ASCII.GetString(Encoding.Convert(Encoding.UTF8, Encoding.ASCII, Encoding.UTF8.GetBytes(model))) .Replace('/', '_').Replace('\\', '_').Replace('?', '_'); - } if(revision != null) - { revision = Encoding .ASCII.GetString(Encoding.Convert(Encoding.UTF8, Encoding.ASCII, Encoding.UTF8.GetBytes(revision))).Replace('/', '_') .Replace('\\', '_').Replace('?', '_'); - } string xmlFile = null; if(!string.IsNullOrWhiteSpace(manufacturer) && !string.IsNullOrWhiteSpace(model) && @@ -113,16 +107,12 @@ namespace DiscImageChef.Server lblUsbProduct.Text = HttpUtility.HtmlEncode(report.USB.Product); lblUsbVendor.Text = string.Format("0x{0:x4}", report.USB.VendorID); if(usbVendorDescription != null) - { lblUsbVendorDescription.Text = string.Format("({0})", HttpUtility.HtmlEncode(usbVendorDescription)); - } lblUsbProductId.Text = string.Format("0x{0:x4}", report.USB.ProductID); if(usbProductDescription != null) - { lblUsbProductDescription.Text = string.Format("({0})", HttpUtility.HtmlEncode(usbProductDescription)); - } } else divUsb.Visible = false; @@ -147,7 +137,6 @@ namespace DiscImageChef.Server { Dictionary decodedTuples = new Dictionary(); foreach(Decoders.PCMCIA.Tuple tuple in tuples) - { switch(tuple.Code) { case Decoders.PCMCIA.TupleCodes.CISTPL_NULL: @@ -159,7 +148,6 @@ namespace DiscImageChef.Server Decoders.PCMCIA.DeviceGeometryTuple geom = Decoders.PCMCIA.CIS.DecodeDeviceGeometryTuple(tuple.Data); if(geom != null && geom.Geometries != null) - { foreach(Decoders.PCMCIA.DeviceGeometry geometry in geom.Geometries) { decodedTuples.Add("Device width", @@ -183,7 +171,6 @@ namespace DiscImageChef.Server (1 << (geometry.Interleaving - 1)) * (1 << (geometry.Partitions - 1)))); } - } break; case Decoders.PCMCIA.TupleCodes.CISTPL_ALTSTR: @@ -226,7 +213,6 @@ namespace DiscImageChef.Server decodedTuples.Add("Unknown tuple ID", string.Format("0x{0:X2}", (byte)tuple.Code)); break; } - } if(decodedTuples.Count > 0) { @@ -283,11 +269,9 @@ namespace DiscImageChef.Server if(VendorString.Prettify(report.SCSI.Inquiry.VendorIdentification) != report.SCSI.Inquiry.VendorIdentification) - { lblScsiVendor.Text = string.Format("{0} ({1})", report.SCSI.Inquiry.VendorIdentification, VendorString.Prettify(report.SCSI.Inquiry .VendorIdentification)); - } else lblScsiVendor.Text = report.SCSI.Inquiry.VendorIdentification; lblScsiProduct.Text = report.SCSI.Inquiry.ProductIdentification; lblScsiRevision.Text = report.SCSI.Inquiry.ProductRevisionLevel; @@ -299,10 +283,8 @@ namespace DiscImageChef.Server if(report.SCSI.SupportsModeSubpages) scsiOneValue.Add("Device supports MODE SENSE subpages"); if(report.SCSI.ModeSense != null) - { ScsiModeSense.Report(report.SCSI.ModeSense, report.SCSI.Inquiry.VendorIdentification, report.SCSI.Inquiry.PeripheralDeviceType, ref scsiOneValue, ref modePages); - } if(modePages.Count > 0) { @@ -411,7 +393,6 @@ namespace DiscImageChef.Server if(report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize / 1024 / 1024 > 1000000) - { scsiOneValue.Add(string.Format("Device size: {0} bytes, {1} Tb, {2:F2} TiB", report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize, @@ -421,11 +402,9 @@ namespace DiscImageChef.Server (double)(report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize) / 1024 / 1024 / 1024 / 1024)); - } else if( report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize / 1024 / 1024 > 1000) - { scsiOneValue.Add(string.Format("Device size: {0} bytes, {1} Gb, {2:F2} GiB", report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize, @@ -435,9 +414,7 @@ namespace DiscImageChef.Server (double)(report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize) / 1024 / 1024 / 1024)); - } else - { scsiOneValue.Add(string.Format("Device size: {0} bytes, {1} Mb, {2:F2} MiB", report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize, @@ -446,26 +423,19 @@ namespace DiscImageChef.Server (double)(report.SCSI.ReadCapabilities.Blocks * report.SCSI.ReadCapabilities.BlockSize) / 1024 / 1024)); - } } if(report.SCSI.ReadCapabilities.MediumTypeSpecified) - { scsiOneValue.Add(string.Format("Medium type code: {0:X2}h", report.SCSI.ReadCapabilities.MediumType)); - } if(report.SCSI.ReadCapabilities.DensitySpecified) - { scsiOneValue.Add(string.Format("Density code: {0:X2}h", report.SCSI.ReadCapabilities.Density)); - } if((report.SCSI.ReadCapabilities.SupportsReadLong || report.SCSI.ReadCapabilities.SupportsReadLong16) && report.SCSI.ReadCapabilities.LongBlockSizeSpecified) - { scsiOneValue.Add(string.Format("Long block size: {0} bytes", report.SCSI.ReadCapabilities.LongBlockSize)); - } if(report.SCSI.ReadCapabilities.SupportsReadCapacity) scsiOneValue.Add("Device supports READ CAPACITY (10) command."); if(report.SCSI.ReadCapabilities.SupportsReadCapacity16) diff --git a/DiscImageChef.Tests.Devices/Main.cs b/DiscImageChef.Tests.Devices/Main.cs index 37cb33d0..b6ce5f83 100644 --- a/DiscImageChef.Tests.Devices/Main.cs +++ b/DiscImageChef.Tests.Devices/Main.cs @@ -67,11 +67,9 @@ namespace DiscImageChef.Tests.Devices "----------------", "------------------------", "------------------------", "----------", "----------", "--------"); for(int i = 0; i < devices.Length; i++) - { DicConsole.WriteLine("{6,-8}|{0,-22}|{1,-16}|{2,-24}|{3,-24}|{4,-10}|{5,-10}", devices[i].Path, devices[i].Vendor, devices[i].Model, devices[i].Serial, devices[i].Bus, devices[i].Supported, i + 1); - } DicConsole.Write("Please choose which drive to test (0 to exit): "); strDev = System.Console.ReadLine(); diff --git a/DiscImageChef.Tests.Devices/SCSI/MMC.cs b/DiscImageChef.Tests.Devices/SCSI/MMC.cs index b97bb9d1..66a2b6a2 100644 --- a/DiscImageChef.Tests.Devices/SCSI/MMC.cs +++ b/DiscImageChef.Tests.Devices/SCSI/MMC.cs @@ -220,7 +220,6 @@ namespace DiscImageChef.Tests.Devices.SCSI 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) { DicConsole.WriteLine("Feature {0:X4}h", desc.Code); @@ -465,7 +464,6 @@ namespace DiscImageChef.Tests.Devices.SCSI break; } } - } } DicConsole.WriteLine("Press any key to continue..."); @@ -1710,7 +1708,6 @@ namespace DiscImageChef.Tests.Devices.SCSI DicConsole.WriteLine("Device: {0}", devPath); DicConsole.WriteLine("READ TOC/PMA/ATIP decoded buffer:"); if(buffer != null) - { switch(format) { case 0: @@ -1738,7 +1735,6 @@ namespace DiscImageChef.Tests.Devices.SCSI PrintHex.PrintHexArray(buffer, 64); break; } - } DicConsole.WriteLine("Press any key to continue..."); System.Console.ReadKey(); diff --git a/DiscImageChef.Tests/Filesystems/AFFS2_RDB.cs b/DiscImageChef.Tests/Filesystems/AFFS2_RDB.cs index 9d01b18f..023d1fe4 100644 --- a/DiscImageChef.Tests/Filesystems/AFFS2_RDB.cs +++ b/DiscImageChef.Tests/Filesystems/AFFS2_RDB.cs @@ -69,13 +69,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "\"DOS\\7\"") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/AFFS_MBR.cs b/DiscImageChef.Tests/Filesystems/AFFS_MBR.cs index 212c73ba..9c099afc 100644 --- a/DiscImageChef.Tests/Filesystems/AFFS_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/AFFS_MBR.cs @@ -69,13 +69,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "0x2D" || partitions[j].Type == "0x2E") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/AFFS_MBR_RDB.cs b/DiscImageChef.Tests/Filesystems/AFFS_MBR_RDB.cs index 79aad4dc..875829b5 100644 --- a/DiscImageChef.Tests/Filesystems/AFFS_MBR_RDB.cs +++ b/DiscImageChef.Tests/Filesystems/AFFS_MBR_RDB.cs @@ -69,13 +69,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "\"DOS\\1\"" || partitions[j].Type == "\"DOS\\3\"") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/AFFS_RDB.cs b/DiscImageChef.Tests/Filesystems/AFFS_RDB.cs index aeac09cc..e57397c1 100644 --- a/DiscImageChef.Tests/Filesystems/AFFS_RDB.cs +++ b/DiscImageChef.Tests/Filesystems/AFFS_RDB.cs @@ -78,14 +78,12 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "\"DOS\\1\"" || partitions[j].Type == "\"DOS\\3\"" || partitions[j].Type == "\"DOS\\5\"") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/AFS_MBR.cs b/DiscImageChef.Tests/Filesystems/AFS_MBR.cs index e66905ac..dac146b4 100644 --- a/DiscImageChef.Tests/Filesystems/AFS_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/AFS_MBR.cs @@ -71,13 +71,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.SysVfs(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "XENIX") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/AOFS_MBR.cs b/DiscImageChef.Tests/Filesystems/AOFS_MBR.cs index 30996b05..91451d08 100644 --- a/DiscImageChef.Tests/Filesystems/AOFS_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/AOFS_MBR.cs @@ -69,13 +69,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "0x2C") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/AOFS_MBR_RDB.cs b/DiscImageChef.Tests/Filesystems/AOFS_MBR_RDB.cs index 51a702aa..4c982d28 100644 --- a/DiscImageChef.Tests/Filesystems/AOFS_MBR_RDB.cs +++ b/DiscImageChef.Tests/Filesystems/AOFS_MBR_RDB.cs @@ -69,13 +69,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "\"DOS\\0\"") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/AOFS_RDB.cs b/DiscImageChef.Tests/Filesystems/AOFS_RDB.cs index fab5828d..12f92eb8 100644 --- a/DiscImageChef.Tests/Filesystems/AOFS_RDB.cs +++ b/DiscImageChef.Tests/Filesystems/AOFS_RDB.cs @@ -70,14 +70,12 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "\"DOS\\0\"" || partitions[j].Type == "\"DOS\\2\"" || partitions[j].Type == "\"DOS\\4\"") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/Atheos_MBR.cs b/DiscImageChef.Tests/Filesystems/Atheos_MBR.cs index ad751201..359d86a9 100644 --- a/DiscImageChef.Tests/Filesystems/Atheos_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/Atheos_MBR.cs @@ -69,13 +69,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.AtheOS(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "0x2A") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/BeFS_APM.cs b/DiscImageChef.Tests/Filesystems/BeFS_APM.cs index 7d7d92e0..91f8e0e4 100644 --- a/DiscImageChef.Tests/Filesystems/BeFS_APM.cs +++ b/DiscImageChef.Tests/Filesystems/BeFS_APM.cs @@ -71,13 +71,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.BeFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "Be_BFS") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/BeFS_GPT.cs b/DiscImageChef.Tests/Filesystems/BeFS_GPT.cs index 02c45cf3..5110f95b 100644 --- a/DiscImageChef.Tests/Filesystems/BeFS_GPT.cs +++ b/DiscImageChef.Tests/Filesystems/BeFS_GPT.cs @@ -69,13 +69,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.BeFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "Haiku BFS") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/BeFS_MBR.cs b/DiscImageChef.Tests/Filesystems/BeFS_MBR.cs index 0d3c1374..98bbc605 100644 --- a/DiscImageChef.Tests/Filesystems/BeFS_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/BeFS_MBR.cs @@ -70,13 +70,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.BeFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "0xEB") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/COHERENT_MBR.cs b/DiscImageChef.Tests/Filesystems/COHERENT_MBR.cs index db371539..3501d59e 100644 --- a/DiscImageChef.Tests/Filesystems/COHERENT_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/COHERENT_MBR.cs @@ -71,13 +71,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.SysVfs(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "0x09") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/DTFS_MBR.cs b/DiscImageChef.Tests/Filesystems/DTFS_MBR.cs index 05197dc2..574ac037 100644 --- a/DiscImageChef.Tests/Filesystems/DTFS_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/DTFS_MBR.cs @@ -71,13 +71,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.SysVfs(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "XENIX") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/EAFS_MBR.cs b/DiscImageChef.Tests/Filesystems/EAFS_MBR.cs index e2800f91..0d45ed24 100644 --- a/DiscImageChef.Tests/Filesystems/EAFS_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/EAFS_MBR.cs @@ -71,13 +71,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.SysVfs(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "XENIX") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/F2FS.cs b/DiscImageChef.Tests/Filesystems/F2FS.cs index b75076f2..7b0b0346 100644 --- a/DiscImageChef.Tests/Filesystems/F2FS.cs +++ b/DiscImageChef.Tests/Filesystems/F2FS.cs @@ -71,13 +71,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.F2FS(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "0x83") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/FAT12_APM.cs b/DiscImageChef.Tests/Filesystems/FAT12_APM.cs index f66bfb63..8dcf9ee6 100644 --- a/DiscImageChef.Tests/Filesystems/FAT12_APM.cs +++ b/DiscImageChef.Tests/Filesystems/FAT12_APM.cs @@ -71,13 +71,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.FAT(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "DOS_FAT_12") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/FAT12_GPT.cs b/DiscImageChef.Tests/Filesystems/FAT12_GPT.cs index 1f278163..10e69c29 100644 --- a/DiscImageChef.Tests/Filesystems/FAT12_GPT.cs +++ b/DiscImageChef.Tests/Filesystems/FAT12_GPT.cs @@ -71,13 +71,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.FAT(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "Microsoft Basic data") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/FAT16_APM.cs b/DiscImageChef.Tests/Filesystems/FAT16_APM.cs index 2357af0e..59d18b07 100644 --- a/DiscImageChef.Tests/Filesystems/FAT16_APM.cs +++ b/DiscImageChef.Tests/Filesystems/FAT16_APM.cs @@ -71,13 +71,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.FAT(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "DOS_FAT_16") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/FAT16_Atari.cs b/DiscImageChef.Tests/Filesystems/FAT16_Atari.cs index ab2c90be..874170fd 100644 --- a/DiscImageChef.Tests/Filesystems/FAT16_Atari.cs +++ b/DiscImageChef.Tests/Filesystems/FAT16_Atari.cs @@ -71,13 +71,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.FAT(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "GEM" || partitions[j].Type == "BGM") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/FAT16_GPT.cs b/DiscImageChef.Tests/Filesystems/FAT16_GPT.cs index c772ab0b..32caf67a 100644 --- a/DiscImageChef.Tests/Filesystems/FAT16_GPT.cs +++ b/DiscImageChef.Tests/Filesystems/FAT16_GPT.cs @@ -71,13 +71,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.FAT(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "Microsoft Basic data") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/FAT16_RDB.cs b/DiscImageChef.Tests/Filesystems/FAT16_RDB.cs index 4ef78576..624568b7 100644 --- a/DiscImageChef.Tests/Filesystems/FAT16_RDB.cs +++ b/DiscImageChef.Tests/Filesystems/FAT16_RDB.cs @@ -71,13 +71,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.FAT(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "0x06") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/FAT32_APM.cs b/DiscImageChef.Tests/Filesystems/FAT32_APM.cs index a4724a6a..570badb9 100644 --- a/DiscImageChef.Tests/Filesystems/FAT32_APM.cs +++ b/DiscImageChef.Tests/Filesystems/FAT32_APM.cs @@ -71,13 +71,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.FAT(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "DOS_FAT_32") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/FAT32_GPT.cs b/DiscImageChef.Tests/Filesystems/FAT32_GPT.cs index 8c272479..c87de5a3 100644 --- a/DiscImageChef.Tests/Filesystems/FAT32_GPT.cs +++ b/DiscImageChef.Tests/Filesystems/FAT32_GPT.cs @@ -71,13 +71,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.FAT(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "Microsoft Basic data") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/HAMMER_MBR.cs b/DiscImageChef.Tests/Filesystems/HAMMER_MBR.cs index 251cba44..c227154b 100644 --- a/DiscImageChef.Tests/Filesystems/HAMMER_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/HAMMER_MBR.cs @@ -70,13 +70,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.HAMMER(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "Hammer") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/HFSPlus_APM.cs b/DiscImageChef.Tests/Filesystems/HFSPlus_APM.cs index b3174f5f..2e10e756 100644 --- a/DiscImageChef.Tests/Filesystems/HFSPlus_APM.cs +++ b/DiscImageChef.Tests/Filesystems/HFSPlus_APM.cs @@ -105,13 +105,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.AppleHFSPlus(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "Apple_HFS") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/HFSPlus_GPT.cs b/DiscImageChef.Tests/Filesystems/HFSPlus_GPT.cs index 9ed0170c..fd3ecf1b 100644 --- a/DiscImageChef.Tests/Filesystems/HFSPlus_GPT.cs +++ b/DiscImageChef.Tests/Filesystems/HFSPlus_GPT.cs @@ -71,13 +71,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.AppleHFSPlus(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "Apple HFS") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/HFSPlus_MBR.cs b/DiscImageChef.Tests/Filesystems/HFSPlus_MBR.cs index 3527ea8a..94c4796c 100644 --- a/DiscImageChef.Tests/Filesystems/HFSPlus_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/HFSPlus_MBR.cs @@ -84,13 +84,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.AppleHFSPlus(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "0xAF") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/HFSX_APM.cs b/DiscImageChef.Tests/Filesystems/HFSX_APM.cs index 12a34e6e..6dca8439 100644 --- a/DiscImageChef.Tests/Filesystems/HFSX_APM.cs +++ b/DiscImageChef.Tests/Filesystems/HFSX_APM.cs @@ -79,13 +79,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.AppleHFSPlus(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "Apple_HFSX") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/HFSX_GPT.cs b/DiscImageChef.Tests/Filesystems/HFSX_GPT.cs index 929c47e1..f0f90609 100644 --- a/DiscImageChef.Tests/Filesystems/HFSX_GPT.cs +++ b/DiscImageChef.Tests/Filesystems/HFSX_GPT.cs @@ -71,13 +71,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.AppleHFSPlus(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "Apple HFS") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/HFSX_MBR.cs b/DiscImageChef.Tests/Filesystems/HFSX_MBR.cs index e228abbe..b78ba82f 100644 --- a/DiscImageChef.Tests/Filesystems/HFSX_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/HFSX_MBR.cs @@ -76,13 +76,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.AppleHFSPlus(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "0xAF") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/HFS_APM.cs b/DiscImageChef.Tests/Filesystems/HFS_APM.cs index 016d6974..b4320f74 100644 --- a/DiscImageChef.Tests/Filesystems/HFS_APM.cs +++ b/DiscImageChef.Tests/Filesystems/HFS_APM.cs @@ -110,13 +110,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.AppleHFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "Apple_HFS") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/HFS_CDROM.cs b/DiscImageChef.Tests/Filesystems/HFS_CDROM.cs index 2a1edfce..8f4ff0ec 100644 --- a/DiscImageChef.Tests/Filesystems/HFS_CDROM.cs +++ b/DiscImageChef.Tests/Filesystems/HFS_CDROM.cs @@ -75,13 +75,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.AppleHFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "Apple_HFS") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/HFS_MBR.cs b/DiscImageChef.Tests/Filesystems/HFS_MBR.cs index 62c4826a..b461328a 100644 --- a/DiscImageChef.Tests/Filesystems/HFS_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/HFS_MBR.cs @@ -73,13 +73,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.AppleHFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "0xAF") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/HFS_RDB.cs b/DiscImageChef.Tests/Filesystems/HFS_RDB.cs index 317bb123..c3e7a461 100644 --- a/DiscImageChef.Tests/Filesystems/HFS_RDB.cs +++ b/DiscImageChef.Tests/Filesystems/HFS_RDB.cs @@ -69,13 +69,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.AppleHFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "\"RES\\86\"") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/HTFS_MBR.cs b/DiscImageChef.Tests/Filesystems/HTFS_MBR.cs index 341cea8c..69e259d1 100644 --- a/DiscImageChef.Tests/Filesystems/HTFS_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/HTFS_MBR.cs @@ -71,13 +71,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.SysVfs(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "XENIX") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/JFS2.cs b/DiscImageChef.Tests/Filesystems/JFS2.cs index 838f1d47..aa066300 100644 --- a/DiscImageChef.Tests/Filesystems/JFS2.cs +++ b/DiscImageChef.Tests/Filesystems/JFS2.cs @@ -70,13 +70,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.JFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "0x83" || partitions[j].Type == "0x07") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/MINIXv1_MBR.cs b/DiscImageChef.Tests/Filesystems/MINIXv1_MBR.cs index 9df6de36..09952090 100644 --- a/DiscImageChef.Tests/Filesystems/MINIXv1_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/MINIXv1_MBR.cs @@ -67,13 +67,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.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") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/MINIXv2_MBR.cs b/DiscImageChef.Tests/Filesystems/MINIXv2_MBR.cs index cdc836ab..05999388 100644 --- a/DiscImageChef.Tests/Filesystems/MINIXv2_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/MINIXv2_MBR.cs @@ -67,13 +67,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.MinixFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "0x81" || partitions[j].Type == "MINIX") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/MINIXv3_MBR.cs b/DiscImageChef.Tests/Filesystems/MINIXv3_MBR.cs index 255b633f..02578f08 100644 --- a/DiscImageChef.Tests/Filesystems/MINIXv3_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/MINIXv3_MBR.cs @@ -67,13 +67,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.MinixFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "0x81" || partitions[j].Type == "MINIX") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/NILFS2.cs b/DiscImageChef.Tests/Filesystems/NILFS2.cs index 68da239b..e9d150f7 100644 --- a/DiscImageChef.Tests/Filesystems/NILFS2.cs +++ b/DiscImageChef.Tests/Filesystems/NILFS2.cs @@ -69,13 +69,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.NILFS2(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "0x83") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/NTFS_GPT.cs b/DiscImageChef.Tests/Filesystems/NTFS_GPT.cs index 9ee47314..bf7a3a57 100644 --- a/DiscImageChef.Tests/Filesystems/NTFS_GPT.cs +++ b/DiscImageChef.Tests/Filesystems/NTFS_GPT.cs @@ -71,13 +71,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.NTFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "Microsoft Basic data") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/NTFS_MBR.cs b/DiscImageChef.Tests/Filesystems/NTFS_MBR.cs index a210c4ed..29ba318a 100644 --- a/DiscImageChef.Tests/Filesystems/NTFS_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/NTFS_MBR.cs @@ -79,7 +79,6 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.NTFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "0x07" || // Value incorrectly set by Haiku partitions[j].Type == "0x86") @@ -87,7 +86,6 @@ namespace DiscImageChef.Tests.Filesystems part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/PFS3_RDB.cs b/DiscImageChef.Tests/Filesystems/PFS3_RDB.cs index 49c73f7f..92c64f82 100644 --- a/DiscImageChef.Tests/Filesystems/PFS3_RDB.cs +++ b/DiscImageChef.Tests/Filesystems/PFS3_RDB.cs @@ -71,13 +71,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.PFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "\"PFS\\1\"") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/ProDOS_APM.cs b/DiscImageChef.Tests/Filesystems/ProDOS_APM.cs index aecc82a5..acd7e83d 100644 --- a/DiscImageChef.Tests/Filesystems/ProDOS_APM.cs +++ b/DiscImageChef.Tests/Filesystems/ProDOS_APM.cs @@ -77,13 +77,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.ProDOSPlugin(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "Apple_ProDOS") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/QNX4_MBR.cs b/DiscImageChef.Tests/Filesystems/QNX4_MBR.cs index 3e96f42d..aba382cb 100644 --- a/DiscImageChef.Tests/Filesystems/QNX4_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/QNX4_MBR.cs @@ -65,13 +65,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.QNX4(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "0x4D") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/ReFS_MBR.cs b/DiscImageChef.Tests/Filesystems/ReFS_MBR.cs index 05c898cc..58d602cb 100644 --- a/DiscImageChef.Tests/Filesystems/ReFS_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/ReFS_MBR.cs @@ -70,13 +70,11 @@ namespace DiscImageChef.Tests.Filesystems List partitions = Core.Partitions.GetAll(image); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "0x07") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); throw new NotImplementedException("ReFS is not yet implemented"); diff --git a/DiscImageChef.Tests/Filesystems/Reiser3.cs b/DiscImageChef.Tests/Filesystems/Reiser3.cs index 5a3c6217..3854b941 100644 --- a/DiscImageChef.Tests/Filesystems/Reiser3.cs +++ b/DiscImageChef.Tests/Filesystems/Reiser3.cs @@ -67,13 +67,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.Reiser(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "0x83") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/Reiser4.cs b/DiscImageChef.Tests/Filesystems/Reiser4.cs index 0f3d8323..9b4a5928 100644 --- a/DiscImageChef.Tests/Filesystems/Reiser4.cs +++ b/DiscImageChef.Tests/Filesystems/Reiser4.cs @@ -69,13 +69,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.Reiser4(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "0x83") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/SFS_MBR.cs b/DiscImageChef.Tests/Filesystems/SFS_MBR.cs index 63deb352..ac96b10d 100644 --- a/DiscImageChef.Tests/Filesystems/SFS_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/SFS_MBR.cs @@ -69,13 +69,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.SFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "0x2F") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/SFS_MBR_RDB.cs b/DiscImageChef.Tests/Filesystems/SFS_MBR_RDB.cs index c04861d3..897b1fb4 100644 --- a/DiscImageChef.Tests/Filesystems/SFS_MBR_RDB.cs +++ b/DiscImageChef.Tests/Filesystems/SFS_MBR_RDB.cs @@ -69,13 +69,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.SFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "\"SFS\\0\"") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/SFS_RDB.cs b/DiscImageChef.Tests/Filesystems/SFS_RDB.cs index 372dd388..6cd2c828 100644 --- a/DiscImageChef.Tests/Filesystems/SFS_RDB.cs +++ b/DiscImageChef.Tests/Filesystems/SFS_RDB.cs @@ -69,13 +69,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.SFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "\"SFS\\0\"" || partitions[j].Type == "\"SFS\\2\"") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/SysV_MBR.cs b/DiscImageChef.Tests/Filesystems/SysV_MBR.cs index c7b084cb..c7432321 100644 --- a/DiscImageChef.Tests/Filesystems/SysV_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/SysV_MBR.cs @@ -72,13 +72,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.SysVfs(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "UNIX: /usr" || partitions[j].Type == "XENIX") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/SysV_RDB.cs b/DiscImageChef.Tests/Filesystems/SysV_RDB.cs index d6f429eb..f4f22527 100644 --- a/DiscImageChef.Tests/Filesystems/SysV_RDB.cs +++ b/DiscImageChef.Tests/Filesystems/SysV_RDB.cs @@ -71,13 +71,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.SysVfs(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "\"UNI\\1\"") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/UFS_APM.cs b/DiscImageChef.Tests/Filesystems/UFS_APM.cs index b14e3dc1..dbe84bc5 100644 --- a/DiscImageChef.Tests/Filesystems/UFS_APM.cs +++ b/DiscImageChef.Tests/Filesystems/UFS_APM.cs @@ -79,13 +79,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "Apple_UFS") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/UFS_MBR.cs b/DiscImageChef.Tests/Filesystems/UFS_MBR.cs index 4da10970..3cde1d6c 100644 --- a/DiscImageChef.Tests/Filesystems/UFS_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/UFS_MBR.cs @@ -112,7 +112,6 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.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" || partitions[j].Type == "0xA9" || partitions[j].Type == "0x82" || partitions[j].Type == "0x83" || partitions[j].Type == "4.2BSD Fast File System" || partitions[j].Type == "Sun boot") @@ -120,7 +119,6 @@ namespace DiscImageChef.Tests.Filesystems part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/UFS_NeXT.cs b/DiscImageChef.Tests/Filesystems/UFS_NeXT.cs index 21e7219a..fde7edd8 100644 --- a/DiscImageChef.Tests/Filesystems/UFS_NeXT.cs +++ b/DiscImageChef.Tests/Filesystems/UFS_NeXT.cs @@ -75,13 +75,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "4.3BSD" || partitions[j].Type == "4.4BSD") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/UFS_NeXT_Floppy.cs b/DiscImageChef.Tests/Filesystems/UFS_NeXT_Floppy.cs index d30b2215..fb4e1e14 100644 --- a/DiscImageChef.Tests/Filesystems/UFS_NeXT_Floppy.cs +++ b/DiscImageChef.Tests/Filesystems/UFS_NeXT_Floppy.cs @@ -77,13 +77,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "4.3BSD" || partitions[j].Type == "4.4BSD") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/UFS_RDB.cs b/DiscImageChef.Tests/Filesystems/UFS_RDB.cs index a7b70823..38ea1ae3 100644 --- a/DiscImageChef.Tests/Filesystems/UFS_RDB.cs +++ b/DiscImageChef.Tests/Filesystems/UFS_RDB.cs @@ -71,13 +71,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "\"UNI\\2\"") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/UFS_Suni86.cs b/DiscImageChef.Tests/Filesystems/UFS_Suni86.cs index 884806f5..7cd79cd7 100644 --- a/DiscImageChef.Tests/Filesystems/UFS_Suni86.cs +++ b/DiscImageChef.Tests/Filesystems/UFS_Suni86.cs @@ -71,13 +71,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "Replacement sectors") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/UNIXBFS_MBR.cs b/DiscImageChef.Tests/Filesystems/UNIXBFS_MBR.cs index 3874a23f..855dd111 100644 --- a/DiscImageChef.Tests/Filesystems/UNIXBFS_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/UNIXBFS_MBR.cs @@ -67,13 +67,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.BFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "0x83") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/UNIXBFS_RDB.cs b/DiscImageChef.Tests/Filesystems/UNIXBFS_RDB.cs index 8c456bf8..b1f606a4 100644 --- a/DiscImageChef.Tests/Filesystems/UNIXBFS_RDB.cs +++ b/DiscImageChef.Tests/Filesystems/UNIXBFS_RDB.cs @@ -71,13 +71,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.BFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "\"UNI\\0\"") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/XENIX_MBR.cs b/DiscImageChef.Tests/Filesystems/XENIX_MBR.cs index 23a42b00..a71fdf3d 100644 --- a/DiscImageChef.Tests/Filesystems/XENIX_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/XENIX_MBR.cs @@ -71,13 +71,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.SysVfs(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "XENIX") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/XFS_MBR.cs b/DiscImageChef.Tests/Filesystems/XFS_MBR.cs index 3f61fa75..91432979 100644 --- a/DiscImageChef.Tests/Filesystems/XFS_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/XFS_MBR.cs @@ -69,13 +69,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.XFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "0x83") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/btrfs.cs b/DiscImageChef.Tests/Filesystems/btrfs.cs index 5f51b288..8fa0642c 100644 --- a/DiscImageChef.Tests/Filesystems/btrfs.cs +++ b/DiscImageChef.Tests/Filesystems/btrfs.cs @@ -71,13 +71,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.BTRFS(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "0x83") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/exFAT_APM.cs b/DiscImageChef.Tests/Filesystems/exFAT_APM.cs index 23ca382d..af95cf49 100644 --- a/DiscImageChef.Tests/Filesystems/exFAT_APM.cs +++ b/DiscImageChef.Tests/Filesystems/exFAT_APM.cs @@ -69,13 +69,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.exFAT(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "Windows_NTFS") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/exFAT_GPT.cs b/DiscImageChef.Tests/Filesystems/exFAT_GPT.cs index 881067c9..0b832faa 100644 --- a/DiscImageChef.Tests/Filesystems/exFAT_GPT.cs +++ b/DiscImageChef.Tests/Filesystems/exFAT_GPT.cs @@ -69,13 +69,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.exFAT(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "Microsoft Basic data") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/exFAT_MBR.cs b/DiscImageChef.Tests/Filesystems/exFAT_MBR.cs index 768e11b5..b49984a1 100644 --- a/DiscImageChef.Tests/Filesystems/exFAT_MBR.cs +++ b/DiscImageChef.Tests/Filesystems/exFAT_MBR.cs @@ -69,13 +69,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.exFAT(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "0x07") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef.Tests/Filesystems/ext2.cs b/DiscImageChef.Tests/Filesystems/ext2.cs index 02bd067c..220a4c70 100644 --- a/DiscImageChef.Tests/Filesystems/ext2.cs +++ b/DiscImageChef.Tests/Filesystems/ext2.cs @@ -81,13 +81,11 @@ namespace DiscImageChef.Tests.Filesystems Filesystem fs = new DiscImageChef.Filesystems.ext2FS(); int part = -1; for(int j = 0; j < partitions.Count; j++) - { if(partitions[j].Type == "0x83") { part = j; break; } - } Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i])); Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]); diff --git a/DiscImageChef/Commands/Analyze.cs b/DiscImageChef/Commands/Analyze.cs index 348192b3..eba33202 100644 --- a/DiscImageChef/Commands/Analyze.cs +++ b/DiscImageChef/Commands/Analyze.cs @@ -64,7 +64,6 @@ namespace DiscImageChef.Commands Encoding encoding = null; if(options.EncodingName != null) - { try { encoding = Claunia.Encoding.Encoding.GetEncoding(options.EncodingName); @@ -76,7 +75,6 @@ namespace DiscImageChef.Commands encoding = null; return; } - } PluginBase plugins = new PluginBase(); plugins.RegisterAllPlugins(encoding); @@ -99,10 +97,8 @@ namespace DiscImageChef.Commands else { if(options.Verbose) - { DicConsole.VerboseWriteLine("Image format identified by {0} ({1}).", imageFormat.Name, imageFormat.PluginUuid); - } else DicConsole.WriteLine("Image format identified by {0}.", imageFormat.Name); } @@ -179,7 +175,6 @@ namespace DiscImageChef.Commands DicConsole.WriteLine(string.Format("Identified by {0} plugins", idPlugins.Count)); foreach(string pluginName in idPlugins) - { if(plugins.PluginsList.TryGetValue(pluginName, out plugin)) { DicConsole.WriteLine(string.Format("As identified by {0}.", plugin.Name)); @@ -187,7 +182,6 @@ namespace DiscImageChef.Commands DicConsole.Write(information); Core.Statistics.AddFilesystem(plugin.XmlFSType.Type); } - } } else { @@ -218,7 +212,6 @@ namespace DiscImageChef.Commands DicConsole.WriteLine(string.Format("Identified by {0} plugins", idPlugins.Count)); foreach(string pluginName in idPlugins) - { if(plugins.PluginsList.TryGetValue(pluginName, out plugin)) { DicConsole.WriteLine(string.Format("As identified by {0}.", plugin.Name)); @@ -226,7 +219,6 @@ namespace DiscImageChef.Commands DicConsole.Write(information); Core.Statistics.AddFilesystem(plugin.XmlFSType.Type); } - } } else { diff --git a/DiscImageChef/Commands/Checksum.cs b/DiscImageChef/Commands/Checksum.cs index 07f1d87f..553a3d49 100644 --- a/DiscImageChef/Commands/Checksum.cs +++ b/DiscImageChef/Commands/Checksum.cs @@ -102,7 +102,6 @@ namespace DiscImageChef.Commands Core.Checksum mediaChecksum = null; if(inputFormat.ImageInfo.ImageHasPartitions) - { try { Core.Checksum trackChecksum = null; @@ -115,7 +114,6 @@ namespace DiscImageChef.Commands foreach(Track currentTrack in inputTracks) { if(currentTrack.TrackStartSector - previousTrackEnd != 0 && options.WholeDisc) - { for(ulong i = previousTrackEnd + 1; i < currentTrack.TrackStartSector; i++) { DicConsole.Write("\rHashing track-less sector {0}", i); @@ -124,7 +122,6 @@ namespace DiscImageChef.Commands mediaChecksum.Update(hiddenSector); } - } DicConsole.DebugWriteLine("Checksum command", "Track {0} starts at sector {1} and ends at sector {2}", @@ -166,19 +163,14 @@ namespace DiscImageChef.Commands DicConsole.WriteLine(); if(options.SeparatedTracks) - { foreach(ChecksumType chk in trackChecksum.End()) - { DicConsole.WriteLine("Track {0}'s {1}: {2}", currentTrack.TrackSequence, chk.type, chk.Value); - } - } previousTrackEnd = currentTrack.TrackEndSector; } if(inputFormat.GetSectors() - previousTrackEnd != 0 && options.WholeDisc) - { for(ulong i = previousTrackEnd + 1; i < inputFormat.GetSectors(); i++) { DicConsole.Write("\rHashing track-less sector {0}", i); @@ -186,20 +178,16 @@ namespace DiscImageChef.Commands byte[] hiddenSector = inputFormat.ReadSector(i); mediaChecksum.Update(hiddenSector); } - } if(options.WholeDisc) - { foreach(ChecksumType chk in mediaChecksum.End()) DicConsole.WriteLine("Disk's {0}: {1}", chk.type, chk.Value); - } } catch(Exception ex) { if(options.Debug) DicConsole.DebugWriteLine("Could not get tracks because {0}", ex.Message); else DicConsole.WriteLine("Unable to get separate tracks, not checksumming them"); } - } else { mediaChecksum = new Core.Checksum(enabledChecksums); diff --git a/DiscImageChef/Commands/Compare.cs b/DiscImageChef/Commands/Compare.cs index 589ef411..5ea83a91 100644 --- a/DiscImageChef/Commands/Compare.cs +++ b/DiscImageChef/Commands/Compare.cs @@ -77,10 +77,8 @@ namespace DiscImageChef.Commands else { if(options.Verbose) - { DicConsole.VerboseWriteLine("Input file 1 format identified by {0} ({1}).", input1Format.Name, input1Format.PluginUuid); - } else DicConsole.WriteLine("Input file 1 format identified by {0}.", input1Format.Name); } @@ -92,10 +90,8 @@ namespace DiscImageChef.Commands else { if(options.Verbose) - { DicConsole.VerboseWriteLine("Input file 2 format identified by {0} ({1}).", input2Format.Name, input2Format.PluginUuid); - } else DicConsole.WriteLine("Input file 2 format identified by {0}.", input2Format.Name); } @@ -295,10 +291,8 @@ namespace DiscImageChef.Commands sb.AppendFormat("Drive serial number\t{0}\t{1}", image1Info.DriveSerialNumber, image2Info.DriveSerialNumber).AppendLine(); foreach(MediaTagType disktag in Enum.GetValues(typeof(MediaTagType))) - { sb.AppendFormat("Has {0}?\t{1}\t{2}", disktag, image1DiskTags.ContainsKey(disktag), image2DiskTags.ContainsKey(disktag)).AppendLine(); - } } DicConsole.WriteLine("Comparing disk image characteristics"); diff --git a/DiscImageChef/Commands/CreateSidecar.cs b/DiscImageChef/Commands/CreateSidecar.cs index c5a49728..f9ff5ed3 100644 --- a/DiscImageChef/Commands/CreateSidecar.cs +++ b/DiscImageChef/Commands/CreateSidecar.cs @@ -57,7 +57,6 @@ namespace DiscImageChef.Commands Encoding encoding = null; if(options.EncodingName != null) - { try { encoding = Claunia.Encoding.Encoding.GetEncoding(options.EncodingName); @@ -69,7 +68,6 @@ namespace DiscImageChef.Commands encoding = null; return; } - } if(File.Exists(options.InputFile)) { @@ -102,10 +100,8 @@ namespace DiscImageChef.Commands else { if(options.Verbose) - { DicConsole.VerboseWriteLine("Image format identified by {0} ({1}).", imageFormat.Name, imageFormat.PluginUuid); - } else DicConsole.WriteLine("Image format identified by {0}.", imageFormat.Name); } diff --git a/DiscImageChef/Commands/Decode.cs b/DiscImageChef/Commands/Decode.cs index aefc9d7a..cffc73a9 100644 --- a/DiscImageChef/Commands/Decode.cs +++ b/DiscImageChef/Commands/Decode.cs @@ -72,13 +72,10 @@ namespace DiscImageChef.Commands Core.Statistics.AddFilter(inputFilter.Name); if(options.DiskTags) - { if(inputFormat.ImageInfo.ReadableMediaTags.Count == 0) DicConsole.WriteLine("There are no disk tags in chosen disc image."); else - { foreach(MediaTagType tag in inputFormat.ImageInfo.ReadableMediaTags) - { switch(tag) { case MediaTagType.SCSI_INQUIRY: @@ -117,10 +114,8 @@ namespace DiscImageChef.Commands { byte[] identify = inputFormat.ReadDiskTag(MediaTagType.ATAPI_IDENTIFY); if(identify == null) - { DicConsole .WriteLine("Error reading ATA IDENTIFY PACKET DEVICE response from disc image"); - } else { DicConsole.WriteLine("ATA IDENTIFY PACKET DEVICE command response:"); @@ -228,9 +223,6 @@ namespace DiscImageChef.Commands tag); break; } - } - } - } if(options.SectorTags) { @@ -250,9 +242,7 @@ namespace DiscImageChef.Commands if(inputFormat.ImageInfo.ReadableSectorTags.Count == 0) DicConsole.WriteLine("There are no sector tags in chosen disc image."); else - { foreach(SectorTagType tag in inputFormat.ImageInfo.ReadableSectorTags) - { switch(tag) { default: @@ -260,8 +250,6 @@ namespace DiscImageChef.Commands tag); break; } - } - } } Core.Statistics.AddCommand("decode"); diff --git a/DiscImageChef/Commands/DeviceInfo.cs b/DiscImageChef/Commands/DeviceInfo.cs index 9fd8a19b..3e45a3dd 100644 --- a/DiscImageChef/Commands/DeviceInfo.cs +++ b/DiscImageChef/Commands/DeviceInfo.cs @@ -90,9 +90,7 @@ namespace DiscImageChef.Commands DicConsole.WriteLine("PCMCIA CIS is {0} bytes", dev.Cis.Length); Decoders.PCMCIA.Tuple[] tuples = Decoders.PCMCIA.CIS.GetTuples(dev.Cis); if(tuples != null) - { foreach(Decoders.PCMCIA.Tuple tuple in tuples) - { switch(tuple.Code) { case Decoders.PCMCIA.TupleCodes.CISTPL_NULL: @@ -151,8 +149,6 @@ namespace DiscImageChef.Commands (byte)tuple.Code); break; } - } - } else DicConsole.DebugWriteLine("Device-Info command", "Could not get tuples"); } @@ -289,9 +285,7 @@ namespace DiscImageChef.Commands byte[] pages = Decoders.SCSI.EVPD.DecodePage00(inqBuf); if(pages != null) - { foreach(byte page in pages) - { if(page >= 0x01 && page <= 0x7F) { sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page); @@ -582,15 +576,11 @@ namespace DiscImageChef.Commands sense = dev.ScsiInquiry(out inqBuf, out senseBuf, page); if(!sense) - { 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); - } } } - } - } } byte[] modeBuf; @@ -602,10 +592,8 @@ namespace DiscImageChef.Commands sense = dev.ModeSense10(out modeBuf, out senseBuf, false, true, ScsiModeSensePageControl.Current, 0x3F, 0xFF, 5, out duration); if(sense || dev.Error) - { 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); @@ -614,29 +602,23 @@ namespace DiscImageChef.Commands sense = dev.ModeSense6(out modeBuf, out senseBuf, false, ScsiModeSensePageControl.Current, 0x3F, 0xFF, 5, out duration); if(sense || dev.Error) - { sense = dev.ModeSense6(out modeBuf, out senseBuf, false, ScsiModeSensePageControl.Current, 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) - { DataFile.WriteTo("Device-Info command", options.OutputPrefix, "_scsi_modesense.bin", "SCSI MODE SENSE", modeBuf); - } if(decMode.HasValue) { DicConsole.WriteLine(Decoders.SCSI.Modes.PrettifyModeHeader(decMode.Value.Header, devType)); if(decMode.Value.Pages != null) - { foreach(Decoders.SCSI.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) { @@ -644,42 +626,30 @@ namespace DiscImageChef.Commands { if(devType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice && page.Subpage == 0) - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_00_SFF(page.PageResponse)); - } else { if(page.Subpage != 0) - { DicConsole .WriteLine("Found unknown vendor mode page {0:X2}h subpage {1:X2}h", page.Page, page.Subpage); - } else - { DicConsole.WriteLine("Found unknown vendor mode page {0:X2}h", page.Page); - } } break; } case 0x01: { if(page.Subpage == 0) - { if(devType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice) - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_01_MMC(page .PageResponse)); - } else - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_01(page.PageResponse)); - } - } else goto default; break; @@ -687,10 +657,8 @@ namespace DiscImageChef.Commands case 0x02: { if(page.Subpage == 0) - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_02(page.PageResponse)); - } else goto default; break; @@ -698,10 +666,8 @@ namespace DiscImageChef.Commands case 0x03: { if(page.Subpage == 0) - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_03(page.PageResponse)); - } else goto default; break; @@ -709,10 +675,8 @@ namespace DiscImageChef.Commands case 0x04: { if(page.Subpage == 0) - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_04(page.PageResponse)); - } else goto default; break; @@ -720,10 +684,8 @@ namespace DiscImageChef.Commands case 0x05: { if(page.Subpage == 0) - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_05(page.PageResponse)); - } else goto default; break; @@ -731,10 +693,8 @@ namespace DiscImageChef.Commands case 0x06: { if(page.Subpage == 0) - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_06(page.PageResponse)); - } else goto default; break; @@ -742,19 +702,13 @@ namespace DiscImageChef.Commands case 0x07: { if(page.Subpage == 0) - { if(devType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice) - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_07_MMC(page .PageResponse)); - } else - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_07(page.PageResponse)); - } - } else goto default; break; @@ -762,10 +716,8 @@ namespace DiscImageChef.Commands case 0x08: { if(page.Subpage == 0) - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_08(page.PageResponse)); - } else goto default; break; @@ -773,15 +725,11 @@ namespace DiscImageChef.Commands case 0x0A: { if(page.Subpage == 0) - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_0A(page.PageResponse)); - } else if(page.Subpage == 1) - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_0A_S01(page.PageResponse)); - } else goto default; break; @@ -789,10 +737,8 @@ namespace DiscImageChef.Commands case 0x0B: { if(page.Subpage == 0) - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_0B(page.PageResponse)); - } else goto default; break; @@ -800,10 +746,8 @@ namespace DiscImageChef.Commands case 0x0D: { if(page.Subpage == 0) - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_0D(page.PageResponse)); - } else goto default; break; @@ -811,10 +755,8 @@ namespace DiscImageChef.Commands case 0x0E: { if(page.Subpage == 0) - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_0E(page.PageResponse)); - } else goto default; break; @@ -822,10 +764,8 @@ namespace DiscImageChef.Commands case 0x0F: { if(page.Subpage == 0) - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_0F(page.PageResponse)); - } else goto default; break; @@ -833,19 +773,13 @@ namespace DiscImageChef.Commands case 0x10: { if(page.Subpage == 0) - { if(devType == Decoders.SCSI.PeripheralDeviceTypes.SequentialAccess) - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_10_SSC(page .PageResponse)); - } else - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_10(page.PageResponse)); - } - } else goto default; break; @@ -853,10 +787,8 @@ namespace DiscImageChef.Commands case 0x11: { if(page.Subpage == 0) - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_11(page.PageResponse)); - } else goto default; break; @@ -866,11 +798,9 @@ namespace DiscImageChef.Commands case 0x14: { if(page.Subpage == 0) - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_12_13_14(page .PageResponse)); - } else goto default; break; @@ -878,15 +808,11 @@ namespace DiscImageChef.Commands case 0x1A: { if(page.Subpage == 0) - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_1A(page.PageResponse)); - } else if(page.Subpage == 1) - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_1A_S01(page.PageResponse)); - } else goto default; break; @@ -894,10 +820,8 @@ namespace DiscImageChef.Commands case 0x1B: { if(page.Subpage == 0) - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_1B(page.PageResponse)); - } else goto default; break; @@ -905,24 +829,16 @@ namespace DiscImageChef.Commands case 0x1C: { if(page.Subpage == 0) - { if(devType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice) - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_1C_SFF(page .PageResponse)); - } else - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_1C(page.PageResponse)); - } - } else if(page.Subpage == 1) - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_1C_S01(page.PageResponse)); - } else goto default; break; @@ -930,10 +846,8 @@ namespace DiscImageChef.Commands case 0x1D: { if(page.Subpage == 0) - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_1D(page.PageResponse)); - } else goto default; break; @@ -942,11 +856,9 @@ namespace DiscImageChef.Commands { if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "CERTANCE" ) - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyCertanceModePage_21(page .PageResponse)); - } else goto default; break; @@ -955,11 +867,9 @@ namespace DiscImageChef.Commands { if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "CERTANCE" ) - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyCertanceModePage_22(page .PageResponse)); - } else goto default; break; @@ -967,10 +877,8 @@ namespace DiscImageChef.Commands case 0x24: { if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "IBM") - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyIBMModePage_24(page.PageResponse)); - } else goto default; break; @@ -978,10 +886,8 @@ namespace DiscImageChef.Commands case 0x2A: { if(page.Subpage == 0) - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyModePage_2A(page.PageResponse)); - } else goto default; break; @@ -989,10 +895,8 @@ namespace DiscImageChef.Commands case 0x2F: { if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "IBM") - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyIBMModePage_2F(page.PageResponse)); - } else goto default; break; @@ -1008,10 +912,8 @@ namespace DiscImageChef.Commands case 0x3B: { if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "HP") - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyHPModePage_3B(page.PageResponse)); - } else goto default; break; @@ -1019,10 +921,8 @@ namespace DiscImageChef.Commands case 0x3C: { if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "HP") - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyHPModePage_3C(page.PageResponse)); - } else goto default; break; @@ -1030,15 +930,11 @@ namespace DiscImageChef.Commands case 0x3D: { if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "IBM") - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyIBMModePage_3D(page.PageResponse)); - } else if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "HP") - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyHPModePage_3D(page.PageResponse)); - } else goto default; break; @@ -1046,16 +942,12 @@ namespace DiscImageChef.Commands case 0x3E: { if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "FUJITSU") - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyFujitsuModePage_3E(page .PageResponse)); - } else if(StringHandlers.CToString(inq.Value.VendorIdentification).Trim() == "HP") - { DicConsole.WriteLine(Decoders.SCSI.Modes .PrettifyHPModePage_3E(page.PageResponse)); - } else goto default; break; @@ -1063,16 +955,12 @@ namespace DiscImageChef.Commands default: { if(page.Subpage != 0) - { DicConsole.WriteLine("Found unknown mode page {0:X2}h subpage {1:X2}h", page.Page, page.Subpage); - } else DicConsole.WriteLine("Found unknown mode page {0:X2}h", page.Page); break; } } - } - } } if(devType == Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice) @@ -1283,10 +1171,8 @@ namespace DiscImageChef.Commands } } else - { DicConsole.DebugWriteLine("Device-Info command", "GET CONFIGURATION returned no feature descriptors"); - } } // TODO: DVD drives respond correctly to BD status. @@ -1373,10 +1259,8 @@ namespace DiscImageChef.Commands default: { if(dev.Model.StartsWith("CD-R ", StringComparison.Ordinal)) - { plxtSense = dev.PlextorReadEepromCdr(out plxtBuf, out senseBuf, dev.Timeout, out duration); - } break; } } @@ -1446,22 +1330,16 @@ namespace DiscImageChef.Commands if(!plxtSense) { if(plxtPwrRecSelected > 0) - { DicConsole .WriteLine("Selected PoweRec speed for currently inserted media is {0} Kb/sec ({1}x)", plxtPwrRecSelected, plxtPwrRecSelected / 177); - } if(plxtPwrRecMax > 0) - { DicConsole .WriteLine("Maximum PoweRec speed for currently inserted media is {0} Kb/sec ({1}x)", plxtPwrRecMax, plxtPwrRecMax / 177); - } if(plxtPwrRecLast > 0) - { DicConsole.WriteLine("Last used PoweRec was {0} Kb/sec ({1}x)", plxtPwrRecLast, plxtPwrRecLast / 177); - } } } else DicConsole.WriteLine("PoweRec is disabled"); @@ -1492,18 +1370,10 @@ namespace DiscImageChef.Commands } plxtSense = dev.PlextorGetGigaRec(out plxtBuf, out senseBuf, dev.Timeout, out duration); - if(!plxtSense) - { - DicConsole.WriteLine("Drive supports Plextor GigaRec"); - // TODO: Pretty print it - } + if(!plxtSense) DicConsole.WriteLine("Drive supports Plextor GigaRec"); plxtSense = dev.PlextorGetSecuRec(out plxtBuf, out senseBuf, dev.Timeout, out duration); - if(!plxtSense) - { - DicConsole.WriteLine("Drive supports Plextor SecuRec"); - // TODO: Pretty print it - } + if(!plxtSense) DicConsole.WriteLine("Drive supports Plextor SecuRec"); plxtSense = dev.PlextorGetSpeedRead(out plxtBuf, out senseBuf, dev.Timeout, out duration); if(!plxtSense) @@ -1525,21 +1395,13 @@ namespace DiscImageChef.Commands plxtSense = dev.PlextorGetVariRec(out plxtBuf, out senseBuf, false, dev.Timeout, out duration); - if(!plxtSense) - { - DicConsole.WriteLine("Drive supports Plextor VariRec"); - // TODO: Pretty print it - } + if(!plxtSense) DicConsole.WriteLine("Drive supports Plextor VariRec"); if(plxtDvd) { plxtSense = dev.PlextorGetVariRec(out plxtBuf, out senseBuf, true, dev.Timeout, out duration); - if(!plxtSense) - { - DicConsole.WriteLine("Drive supports Plextor VariRec for DVDs"); - // TODO: Pretty print it - } + if(!plxtSense) DicConsole.WriteLine("Drive supports Plextor VariRec for DVDs"); plxtSense = dev.PlextorGetBitsetting(out plxtBuf, out senseBuf, false, dev.Timeout, out duration); @@ -1590,10 +1452,8 @@ namespace DiscImageChef.Commands 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)); - } else { DataFile.WriteTo("Device-Info command", options.OutputPrefix, "_ssc_readblocklimits.bin", @@ -1604,10 +1464,8 @@ namespace DiscImageChef.Commands 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)); - } else { DataFile.WriteTo("Device-Info command", options.OutputPrefix, @@ -1624,10 +1482,8 @@ namespace DiscImageChef.Commands sense = dev.ReportDensitySupport(out seqBuf, out senseBuf, true, false, dev.Timeout, out duration); if(sense) - { DicConsole.ErrorWriteLine("REPORT DENSITY SUPPORT (MEDIUM):\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else { DataFile.WriteTo("Device-Info command", options.OutputPrefix, diff --git a/DiscImageChef/Commands/DumpMedia.cs b/DiscImageChef/Commands/DumpMedia.cs index 13edd99c..266fe164 100644 --- a/DiscImageChef/Commands/DumpMedia.cs +++ b/DiscImageChef/Commands/DumpMedia.cs @@ -63,7 +63,6 @@ namespace DiscImageChef.Commands Encoding encoding = null; if(options.EncodingName != null) - { try { encoding = Claunia.Encoding.Encoding.GetEncoding(options.EncodingName); @@ -75,7 +74,6 @@ namespace DiscImageChef.Commands encoding = null; return; } - } if(options.DevicePath.Length == 2 && options.DevicePath[1] == ':' && options.DevicePath[0] != '/' && char.IsLetter(options.DevicePath[0])) options.DevicePath = "\\\\.\\" + char.ToUpper(options.DevicePath[0]) + ':'; @@ -93,7 +91,6 @@ namespace DiscImageChef.Commands Resume resume = null; XmlSerializer xs = new XmlSerializer(typeof(Resume)); if(File.Exists(options.OutputPrefix + ".resume.xml") && options.Resume) - { try { StreamReader sr = new StreamReader(options.OutputPrefix + ".resume.xml"); @@ -105,7 +102,6 @@ namespace DiscImageChef.Commands DicConsole.ErrorWriteLine("Incorrect resume file, not continuing..."); return; } - } if(resume != null && resume.NextBlock > resume.LastBlock && resume.BadBlocks.Count == 0) { diff --git a/DiscImageChef/Commands/Entropy.cs b/DiscImageChef/Commands/Entropy.cs index d088a4a6..1c4c00de 100644 --- a/DiscImageChef/Commands/Entropy.cs +++ b/DiscImageChef/Commands/Entropy.cs @@ -74,7 +74,6 @@ namespace DiscImageChef.Commands Core.Statistics.AddFilter(inputFilter.Name); if(options.SeparatedTracks) - { try { List inputTracks = inputFormat.GetTracks(); @@ -119,11 +118,9 @@ namespace DiscImageChef.Commands #pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created if(options.DuplicatedSectors) - { DicConsole.WriteLine("Track {0} has {1} unique sectors ({1:P3})", currentTrack.TrackSequence, uniqueSectorsPerTrack.Count, (double)uniqueSectorsPerTrack.Count / (double)sectors); - } #pragma warning restore IDE0004 // Cast is necessary, otherwise incorrect value is created DicConsole.WriteLine(); @@ -134,7 +131,6 @@ namespace DiscImageChef.Commands if(options.Debug) DicConsole.DebugWriteLine("Could not get tracks because {0}", ex.Message); else DicConsole.ErrorWriteLine("Unable to get separate tracks, not calculating their entropy"); } - } if(options.WholeDisc) { @@ -180,10 +176,8 @@ namespace DiscImageChef.Commands if(options.DuplicatedSectors) #pragma warning disable IDE0004 // Cast is necessary, otherwise incorrect value is created - { DicConsole.WriteLine("Disk has {0} unique sectors ({1:P3})", uniqueSectors.Count, (double)uniqueSectors.Count / (double)sectors); - } #pragma warning restore IDE0004 // Cast is necessary, otherwise incorrect value is created Core.Statistics.AddCommand("entropy"); diff --git a/DiscImageChef/Commands/ExtractFiles.cs b/DiscImageChef/Commands/ExtractFiles.cs index 64b951b1..34a24400 100644 --- a/DiscImageChef/Commands/ExtractFiles.cs +++ b/DiscImageChef/Commands/ExtractFiles.cs @@ -66,7 +66,6 @@ namespace DiscImageChef.Commands Encoding encoding = null; if(options.EncodingName != null) - { try { encoding = Claunia.Encoding.Encoding.GetEncoding(options.EncodingName); @@ -78,7 +77,6 @@ namespace DiscImageChef.Commands encoding = null; return; } - } PluginBase plugins = new PluginBase(); plugins.RegisterAllPlugins(encoding); @@ -100,10 +98,8 @@ namespace DiscImageChef.Commands else { if(options.Verbose) - { DicConsole.VerboseWriteLine("Image format identified by {0} ({1}).", imageFormat.Name, imageFormat.PluginUuid); - } else DicConsole.WriteLine("Image format identified by {0}.", imageFormat.Name); } @@ -165,7 +161,6 @@ namespace DiscImageChef.Commands DicConsole.WriteLine(string.Format("Identified by {0} plugins", idPlugins.Count)); foreach(string pluginName in idPlugins) - { if(plugins.PluginsList.TryGetValue(pluginName, out plugin)) { DicConsole.WriteLine(string.Format("As identified by {0}.", plugin.Name)); @@ -181,7 +176,6 @@ namespace DiscImageChef.Commands List rootDir = new List(); error = fs.ReadDir("/", ref rootDir); if(error == Errno.NoError) - { foreach(string entry in rootDir) { FileEntryInfo stat = new FileEntryInfo(); @@ -202,7 +196,6 @@ namespace DiscImageChef.Commands error = fs.ListXAttr(entry, ref xattrs); if(error == Errno.NoError) - { foreach(string xattr in xattrs) { byte[] xattrBuf = new byte[0]; @@ -254,14 +247,11 @@ namespace DiscImageChef.Commands outputPath); } else - { DicConsole .ErrorWriteLine("Cannot write xattr {0} for {1}, output exists", xattr, entry); - } } } - } } Directory.CreateDirectory(Path.Combine(options.OutputDir, @@ -298,36 +288,26 @@ namespace DiscImageChef.Commands outBuf.Length, entry, outputPath); } else - { DicConsole.ErrorWriteLine("Error {0} reading file {1}", error, entry); - } } else - { DicConsole .ErrorWriteLine("Cannot write file {0}, output exists", entry); - } } else DicConsole.ErrorWriteLine("Error reading file {0}", entry); } - } else - { DicConsole.ErrorWriteLine("Error {0} reading root directory {0}", error.ToString()); - } Core.Statistics.AddFilesystem(fs.XmlFSType.Type); } else - { DicConsole.ErrorWriteLine("Unable to mount device, error {0}", error.ToString()); - } } - } } else { @@ -344,7 +324,6 @@ namespace DiscImageChef.Commands List rootDir = new List(); error = fs.ReadDir("/", ref rootDir); if(error == Errno.NoError) - { foreach(string entry in rootDir) { FileEntryInfo stat = new FileEntryInfo(); @@ -364,7 +343,6 @@ namespace DiscImageChef.Commands error = fs.ListXAttr(entry, ref xattrs); if(error == Errno.NoError) - { foreach(string xattr in xattrs) { byte[] xattrBuf = new byte[0]; @@ -403,14 +381,11 @@ namespace DiscImageChef.Commands outputPath); } else - { DicConsole .ErrorWriteLine("Cannot write xattr {0} for {1}, output exists", xattr, entry); - } } } - } } Directory.CreateDirectory(Path.Combine(options.OutputDir, fs.XmlFSType.Type, @@ -445,20 +420,15 @@ namespace DiscImageChef.Commands outBuf.Length, entry, outputPath); } else - { DicConsole.ErrorWriteLine("Error {0} reading file {1}", error, entry); - } } else - { DicConsole.ErrorWriteLine("Cannot write file {0}, output exists", entry); - } } else DicConsole.ErrorWriteLine("Error reading file {0}", entry); } - } else DicConsole.ErrorWriteLine("Error {0} reading root directory {0}", error.ToString()); @@ -483,7 +453,6 @@ namespace DiscImageChef.Commands DicConsole.WriteLine(string.Format("Identified by {0} plugins", idPlugins.Count)); foreach(string pluginName in idPlugins) - { if(plugins.PluginsList.TryGetValue(pluginName, out plugin)) { DicConsole.WriteLine(string.Format("As identified by {0}.", plugin.Name)); @@ -498,7 +467,6 @@ namespace DiscImageChef.Commands List rootDir = new List(); error = fs.ReadDir("/", ref rootDir); if(error == Errno.NoError) - { foreach(string entry in rootDir) { FileEntryInfo stat = new FileEntryInfo(); @@ -518,7 +486,6 @@ namespace DiscImageChef.Commands error = fs.ListXAttr(entry, ref xattrs); if(error == Errno.NoError) - { foreach(string xattr in xattrs) { byte[] xattrBuf = new byte[0]; @@ -557,14 +524,11 @@ namespace DiscImageChef.Commands outputPath); } else - { DicConsole .ErrorWriteLine("Cannot write xattr {0} for {1}, output exists", xattr, entry); - } } } - } } Directory.CreateDirectory(Path.Combine(options.OutputDir, fs.XmlFSType.Type, @@ -599,20 +563,15 @@ namespace DiscImageChef.Commands outBuf.Length, entry, outputPath); } else - { DicConsole.ErrorWriteLine("Error {0} reading file {1}", error, entry); - } } else - { DicConsole.ErrorWriteLine("Cannot write file {0}, output exists", entry); - } } else DicConsole.ErrorWriteLine("Error reading file {0}", entry); } - } else DicConsole.ErrorWriteLine("Error {0} reading root directory {0}", error.ToString()); @@ -620,7 +579,6 @@ namespace DiscImageChef.Commands } else DicConsole.ErrorWriteLine("Unable to mount device, error {0}", error.ToString()); } - } } else { @@ -637,7 +595,6 @@ namespace DiscImageChef.Commands List rootDir = new List(); error = fs.ReadDir("/", ref rootDir); if(error == Errno.NoError) - { foreach(string entry in rootDir) { FileEntryInfo stat = new FileEntryInfo(); @@ -657,7 +614,6 @@ namespace DiscImageChef.Commands error = fs.ListXAttr(entry, ref xattrs); if(error == Errno.NoError) - { foreach(string xattr in xattrs) { byte[] xattrBuf = new byte[0]; @@ -694,14 +650,11 @@ namespace DiscImageChef.Commands xattrBuf.Length, xattr, entry, outputPath); } else - { DicConsole .ErrorWriteLine("Cannot write xattr {0} for {1}, output exists", xattr, entry); - } } } - } } Directory.CreateDirectory(Path.Combine(options.OutputDir, fs.XmlFSType.Type, @@ -739,7 +692,6 @@ namespace DiscImageChef.Commands } else DicConsole.ErrorWriteLine("Error reading file {0}", entry); } - } else DicConsole.ErrorWriteLine("Error {0} reading root directory {0}", error.ToString()); Core.Statistics.AddFilesystem(fs.XmlFSType.Type); diff --git a/DiscImageChef/Commands/Formats.cs b/DiscImageChef/Commands/Formats.cs index 3ac6fda3..6cc62f93 100644 --- a/DiscImageChef/Commands/Formats.cs +++ b/DiscImageChef/Commands/Formats.cs @@ -51,40 +51,32 @@ namespace DiscImageChef.Commands DicConsole.WriteLine("Supported filters:"); if(formatsOptions.Verbose) DicConsole.VerboseWriteLine("GUID\t\t\t\t\tFilter"); foreach(KeyValuePair kvp in filtersList.filtersList) - { if(formatsOptions.Verbose) DicConsole.VerboseWriteLine("{0}\t{1}", kvp.Value.UUID, kvp.Value.Name); else DicConsole.WriteLine(kvp.Value.Name); - } DicConsole.WriteLine(); DicConsole.WriteLine("Supported disc image formats:"); if(formatsOptions.Verbose) DicConsole.VerboseWriteLine("GUID\t\t\t\t\tPlugin"); foreach(KeyValuePair kvp in plugins.ImagePluginsList) - { if(formatsOptions.Verbose) DicConsole.VerboseWriteLine("{0}\t{1}", kvp.Value.PluginUuid, kvp.Value.Name); else DicConsole.WriteLine(kvp.Value.Name); - } DicConsole.WriteLine(); DicConsole.WriteLine("Supported filesystems:"); if(formatsOptions.Verbose) DicConsole.VerboseWriteLine("GUID\t\t\t\t\tPlugin"); foreach(KeyValuePair kvp in plugins.PluginsList) - { if(formatsOptions.Verbose) DicConsole.VerboseWriteLine("{0}\t{1}", kvp.Value.PluginUUID, kvp.Value.Name); else DicConsole.WriteLine(kvp.Value.Name); - } DicConsole.WriteLine(); DicConsole.WriteLine("Supported partitioning schemes:"); if(formatsOptions.Verbose) DicConsole.VerboseWriteLine("GUID\t\t\t\t\tPlugin"); foreach(KeyValuePair kvp in plugins.PartPluginsList) - { if(formatsOptions.Verbose) DicConsole.VerboseWriteLine("{0}\t{1}", kvp.Value.PluginUuid, kvp.Value.Name); else DicConsole.WriteLine(kvp.Value.Name); - } Core.Statistics.AddCommand("formats"); } diff --git a/DiscImageChef/Commands/Ls.cs b/DiscImageChef/Commands/Ls.cs index 08bd885e..51f94003 100644 --- a/DiscImageChef/Commands/Ls.cs +++ b/DiscImageChef/Commands/Ls.cs @@ -62,7 +62,6 @@ namespace DiscImageChef.Commands Encoding encoding = null; if(options.EncodingName != null) - { try { encoding = Claunia.Encoding.Encoding.GetEncoding(options.EncodingName); @@ -74,7 +73,6 @@ namespace DiscImageChef.Commands encoding = null; return; } - } PluginBase plugins = new PluginBase(); plugins.RegisterAllPlugins(encoding); @@ -96,10 +94,8 @@ namespace DiscImageChef.Commands else { if(options.Verbose) - { DicConsole.VerboseWriteLine("Image format identified by {0} ({1}).", imageFormat.Name, imageFormat.PluginUuid); - } else DicConsole.WriteLine("Image format identified by {0}.", imageFormat.Name); } @@ -152,7 +148,6 @@ namespace DiscImageChef.Commands DicConsole.WriteLine(string.Format("Identified by {0} plugins", idPlugins.Count)); foreach(string pluginName in idPlugins) - { if(plugins.PluginsList.TryGetValue(pluginName, out plugin)) { DicConsole.WriteLine(string.Format("As identified by {0}.", plugin.Name)); @@ -169,20 +164,15 @@ namespace DiscImageChef.Commands error = fs.ReadDir("/", ref rootDir); if(error == Errno.NoError) foreach(string entry in rootDir) DicConsole.WriteLine("{0}", entry); else - { DicConsole.ErrorWriteLine("Error {0} reading root directory {0}", error.ToString()); - } Core.Statistics.AddFilesystem(fs.XmlFSType.Type); } else - { DicConsole.ErrorWriteLine("Unable to mount device, error {0}", error.ToString()); - } } - } } else { @@ -223,7 +213,6 @@ namespace DiscImageChef.Commands DicConsole.WriteLine(string.Format("Identified by {0} plugins", idPlugins.Count)); foreach(string pluginName in idPlugins) - { if(plugins.PluginsList.TryGetValue(pluginName, out plugin)) { DicConsole.WriteLine(string.Format("As identified by {0}.", plugin.Name)); @@ -245,7 +234,6 @@ namespace DiscImageChef.Commands } else DicConsole.ErrorWriteLine("Unable to mount device, error {0}", error.ToString()); } - } } else { @@ -262,9 +250,7 @@ namespace DiscImageChef.Commands List rootDir = new List(); error = fs.ReadDir("/", ref rootDir); if(error == Errno.NoError) - { foreach(string entry in rootDir) - { if(options.Long) { FileEntryInfo stat = new FileEntryInfo(); @@ -278,20 +264,16 @@ namespace DiscImageChef.Commands error = fs.ListXAttr(entry, ref xattrs); if(error == Errno.NoError) - { foreach(string xattr in xattrs) { byte[] xattrBuf = new byte[0]; error = fs.GetXattr(entry, xattr, ref xattrBuf); if(error == Errno.NoError) DicConsole.WriteLine("\t\t{0}\t{1} bytes", xattr, xattrBuf.Length); } - } } else DicConsole.WriteLine("{0}", entry); } else DicConsole.WriteLine("{0}", entry); - } - } else DicConsole.ErrorWriteLine("Error {0} reading root directory {0}", error.ToString()); Core.Statistics.AddFilesystem(fs.XmlFSType.Type); diff --git a/DiscImageChef/Commands/MediaInfo.cs b/DiscImageChef/Commands/MediaInfo.cs index 3f6b63b6..ea001c7a 100644 --- a/DiscImageChef/Commands/MediaInfo.cs +++ b/DiscImageChef/Commands/MediaInfo.cs @@ -186,10 +186,8 @@ namespace DiscImageChef.Commands sense = dev.ModeSense10(out modeBuf, out senseBuf, false, true, ScsiModeSensePageControl.Current, 0x3F, 0xFF, 5, out duration); if(sense || dev.Error) - { 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); @@ -198,10 +196,8 @@ namespace DiscImageChef.Commands sense = dev.ModeSense6(out modeBuf, out senseBuf, false, ScsiModeSensePageControl.Current, 0x3F, 0x00, 5, out duration); if(sense || dev.Error) - { sense = dev.ModeSense6(out modeBuf, out senseBuf, false, ScsiModeSensePageControl.Current, 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); @@ -245,14 +241,11 @@ namespace DiscImageChef.Commands sense = dev.ReadCapacity16(out cmdBuf, out senseBuf, dev.Timeout, out duration); if(sense && blocks == 0) - { - // Not all MMC devices support READ CAPACITY, as they have READ TOC if(dev.ScsiType != Decoders.SCSI.PeripheralDeviceTypes.MultiMediaDevice) { DicConsole.ErrorWriteLine("Unable to get media capacity"); DicConsole.ErrorWriteLine("{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); } - } if(!sense) { @@ -337,10 +330,8 @@ namespace DiscImageChef.Commands 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)); - } else { DataFile.WriteTo("Media-Info command", outputPrefix, "_getconfiguration_current.bin", @@ -447,29 +438,21 @@ namespace DiscImageChef.Commands MmcDiscStructureFormat.RecognizedFormatLayers, 0, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Recognized Format Layers\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else - { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_formatlayers.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - } sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0, MmcDiscStructureFormat.WriteProtectionStatus, 0, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Write Protection Status\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else - { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_writeprotection.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - } // More like a drive information /* @@ -492,10 +475,8 @@ namespace DiscImageChef.Commands MmcDiscStructureFormat.PhysicalInformation, 0, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: PFI\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_pfi.bin", @@ -507,7 +488,6 @@ namespace DiscImageChef.Commands // False book types if(dskType == MediaType.DVDROM) - { switch(decPfi.Value.DiskCategory) { case Decoders.DVD.DiskCategory.DVDPR: @@ -557,7 +537,6 @@ namespace DiscImageChef.Commands dskType = MediaType.UMD; break; } - } } } @@ -565,10 +544,8 @@ namespace DiscImageChef.Commands MmcDiscStructureFormat.DiscManufacturingInformation, 0, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DMI\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_dmi.bin", @@ -600,10 +577,8 @@ namespace DiscImageChef.Commands MmcDiscStructureFormat.CopyrightInformation, 0, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: CMI\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_cmi.bin", @@ -621,27 +596,19 @@ namespace DiscImageChef.Commands MmcDiscStructureFormat.BurstCuttingArea, 0, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: BCA\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else - { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_bca.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - } sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0, MmcDiscStructureFormat.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)); - } else - { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_aacs.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - } } #endregion DVD-ROM and HD DVD-ROM @@ -711,10 +678,8 @@ namespace DiscImageChef.Commands sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0, MmcDiscStructureFormat.DvdramDds, 0, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DDS\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdram_dds.bin", @@ -725,10 +690,8 @@ namespace DiscImageChef.Commands 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)); - } else { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdram_status.bin", @@ -739,10 +702,8 @@ namespace DiscImageChef.Commands 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)); - } else { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdram_spare.bin", @@ -759,15 +720,11 @@ namespace DiscImageChef.Commands MmcDiscStructureFormat.LastBorderOutRmd, 0, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Last-Out Border RMD\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else - { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_lastrmd.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - } } #endregion DVD-R and HD DVD-R @@ -777,15 +734,11 @@ namespace DiscImageChef.Commands sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0, MmcDiscStructureFormat.PreRecordedInfo, 0, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Pre-Recorded Info\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else - { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_pri.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - } } #endregion DVD-R and DVD-RW @@ -796,28 +749,20 @@ namespace DiscImageChef.Commands MmcDiscStructureFormat.DvdrMediaIdentifier, 0, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DVD-R Media ID\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else - { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdr_mediaid.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - } sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0, MmcDiscStructureFormat.DvdrPhysicalInformation, 0, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DVD-R PFI\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else - { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdr_pfi.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - } } #endregion DVD-R, DVD-RW and HD DVD-R @@ -828,28 +773,20 @@ namespace DiscImageChef.Commands sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0, MmcDiscStructureFormat.Adip, 0, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: ADIP\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else - { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd+_adip.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - } sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0, MmcDiscStructureFormat.Dcb, 0, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DCB\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else - { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd+_dcb.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - } } #endregion All DVD+ @@ -860,15 +797,11 @@ namespace DiscImageChef.Commands MmcDiscStructureFormat.HddvdCopyrightInformation, 0, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: HDDVD CMI\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else - { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_hddvd_cmi.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - } } #endregion HD DVD-ROM @@ -879,28 +812,20 @@ namespace DiscImageChef.Commands MmcDiscStructureFormat.HddvdrMediumStatus, 0, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: HDDVD-R Medium Status\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else - { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_hddvdr_status.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - } sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0, MmcDiscStructureFormat.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)); - } else - { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_hddvdr_lastrmd.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - } } #endregion HD DVD-R @@ -912,15 +837,11 @@ namespace DiscImageChef.Commands MmcDiscStructureFormat.DvdrLayerCapacity, 0, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Layer Capacity\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else - { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvdr_layercap.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - } } #endregion DVD-R DL, DVD-RW DL, DVD+R DL, DVD+RW DL @@ -930,55 +851,39 @@ namespace DiscImageChef.Commands sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0, MmcDiscStructureFormat.MiddleZoneStart, 0, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Middle Zone Start\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else - { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_mzs.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - } sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0, MmcDiscStructureFormat.JumpIntervalSize, 0, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Jump Interval Size\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else - { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_jis.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - } sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0, MmcDiscStructureFormat.ManualLayerJumpStartLba, 0, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Manual Layer Jump Start LBA\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else - { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_manuallj.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - } sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0, MmcDiscStructureFormat.RemapAnchorPoint, 0, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Remap Anchor Point\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else - { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_remapanchor.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - } } #endregion DVD-R DL @@ -989,10 +894,8 @@ namespace DiscImageChef.Commands sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0, MmcDiscStructureFormat.DiscInformation, 0, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DI\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_di.bin", @@ -1002,15 +905,11 @@ namespace DiscImageChef.Commands 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)); - } else - { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_pac.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - } } #endregion All Blu-ray @@ -1021,10 +920,8 @@ namespace DiscImageChef.Commands MmcDiscStructureFormat.BdBurstCuttingArea, 0, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: BCA\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_bca.bin", @@ -1041,10 +938,8 @@ namespace DiscImageChef.Commands sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0, MmcDiscStructureFormat.BdDds, 0, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DDS\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_dds.bin", @@ -1055,10 +950,8 @@ namespace DiscImageChef.Commands sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Bd, 0, 0, MmcDiscStructureFormat.CartridgeStatus, 0, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Cartridge Status\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_cartstatus.bin", @@ -1069,11 +962,9 @@ namespace DiscImageChef.Commands MmcDiscStructureFormat.BdSpareAreaInformation, 0, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: Spare Area Information\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_spare.bin", @@ -1084,23 +975,17 @@ namespace DiscImageChef.Commands 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)); - } else - { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_bd_dfl.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - } sense = dev.ReadDiscInformation(out cmdBuf, out senseBuf, MmcDiscInformationDataTypes.TrackResources, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC INFORMATION 001b\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else { DicConsole.WriteLine("Track Resources Information:\n{0}", @@ -1111,10 +996,8 @@ namespace DiscImageChef.Commands sense = dev.ReadDiscInformation(out cmdBuf, out senseBuf, MmcDiscInformationDataTypes.PowResources, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC INFORMATION 010b\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else { DicConsole.WriteLine("POW Resources Information:\n{0}", @@ -1136,10 +1019,8 @@ namespace DiscImageChef.Commands bool tocSense = 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)); - } else { toc = Decoders.CD.TOC.Decode(cmdBuf); @@ -1154,10 +1035,8 @@ namespace DiscImageChef.Commands // ATIP exists on blank CDs 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)); - } else { DataFile.WriteTo("Media-Info command", outputPrefix, "_atip.bin", "SCSI READ TOC/PMA/ATIP", @@ -1178,10 +1057,8 @@ namespace DiscImageChef.Commands MmcDiscInformationDataTypes.DiscInformation, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC INFORMATION 000b\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else { Decoders.SCSI.MMC.DiscInformation.StandardDiscInformation? discInfo = @@ -1195,7 +1072,6 @@ namespace DiscImageChef.Commands // If it is a read-only CD, check CD type if available if(dskType == MediaType.CD) - { switch(discInfo.Value.DiscType) { case 0x10: @@ -1205,7 +1081,6 @@ namespace DiscImageChef.Commands dskType = MediaType.CDROMXA; break; } - } } } @@ -1214,10 +1089,8 @@ 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)); - } else { DataFile.WriteTo("Media-Info command", outputPrefix, "_session.bin", @@ -1239,7 +1112,6 @@ namespace DiscImageChef.Commands bool hasVideoTrack = false; if(toc.HasValue) - { foreach(Decoders.CD.TOC.CDTOCTrackDataDescriptor track in toc.Value.TrackDescriptors) { if(track.TrackNumber == 1 && @@ -1260,7 +1132,6 @@ namespace DiscImageChef.Commands hasVideoTrack |= track.ADR == 4; } - } if(hasDataTrack && hasAudioTrack && allFirstSessionTracksAreAudio && sessions == 2) dskType = MediaType.CDPLUS; @@ -1271,10 +1142,8 @@ 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)); - } else { DataFile.WriteTo("Media-Info command", outputPrefix, "_rawtoc.bin", @@ -1283,10 +1152,8 @@ namespace DiscImageChef.Commands } 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)); - } else { DataFile.WriteTo("Media-Info command", outputPrefix, "_pma.bin", "SCSI READ TOC/PMA/ATIP", @@ -1296,19 +1163,15 @@ namespace DiscImageChef.Commands 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)); - } else { DataFile.WriteTo("Media-Info command", outputPrefix, "_cdtext.bin", "SCSI READ TOC/PMA/ATIP", cmdBuf); if(Decoders.CD.CDTextOnLeadIn.Decode(cmdBuf).HasValue) - { DicConsole.WriteLine("CD-TEXT on Lead-In:\n{0}", Decoders.CD.CDTextOnLeadIn.Prettify(cmdBuf)); - } } } } @@ -1321,10 +1184,8 @@ namespace DiscImageChef.Commands MmcDiscStructureFormat.PhysicalInformation, 0, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: PFI\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_pfi.bin", @@ -1335,26 +1196,20 @@ namespace DiscImageChef.Commands DicConsole.WriteLine("PFI:\n{0}", Decoders.DVD.PFI.Prettify(cmdBuf)); if(nintendoPfi.Value.DiskCategory == Decoders.DVD.DiskCategory.Nintendo && nintendoPfi.Value.PartVersion == 15) - { if(nintendoPfi.Value.DiscSize == Decoders.DVD.DVDSize.Eighty) dskType = MediaType.GOD; else if(nintendoPfi.Value.DiscSize == Decoders.DVD.DVDSize.OneTwenty) dskType = MediaType.WOD; - } } } sense = dev.ReadDiscStructure(out cmdBuf, out senseBuf, MmcDiscStructureMediaType.Dvd, 0, 0, MmcDiscStructureFormat.DiscManufacturingInformation, 0, dev.Timeout, out duration); if(sense) - { DicConsole.DebugWriteLine("Media-Info command", "READ DISC STRUCTURE: DMI\n{0}", Decoders.SCSI.Sense.PrettifySense(senseBuf)); - } else - { DataFile.WriteTo("Media-Info command", outputPrefix, "_readdiscstructure_dvd_dmi.bin", "SCSI READ DISC STRUCTURE", cmdBuf); - } } #endregion Nintendo } @@ -1374,15 +1229,11 @@ namespace DiscImageChef.Commands { 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)); - } 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)); @@ -1486,10 +1337,8 @@ namespace DiscImageChef.Commands #endregion Xbox if(dskType == MediaType.Unknown) - { dskType = MediaTypeFromScsi.Get((byte)dev.ScsiType, dev.Manufacturer, dev.Model, scsiMediumType, scsiDensityCode, blocks, blockSize); - } if(dskType == MediaType.Unknown && dev.IsUsb && containsFloppyPage) dskType = MediaType.FlashDrive; @@ -1498,10 +1347,8 @@ 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)); - } else { DataFile.WriteTo("Media-Info command", outputPrefix, "_mediaserialnumber.bin", diff --git a/DiscImageChef/Commands/MediaScan.cs b/DiscImageChef/Commands/MediaScan.cs index 59f734e7..9f49e62b 100644 --- a/DiscImageChef/Commands/MediaScan.cs +++ b/DiscImageChef/Commands/MediaScan.cs @@ -95,20 +95,16 @@ namespace DiscImageChef.Commands DicConsole.WriteLine("{0} sectors took more than 500 ms.", results.F); DicConsole.WriteLine("{0} sectors could not be read.", results.UnreadableSectors.Count); if(results.UnreadableSectors.Count > 0) - { foreach(ulong bad in results.UnreadableSectors) DicConsole.WriteLine("Sector {0} could not be read", bad); - } DicConsole.WriteLine(); #pragma warning disable RECS0018 // Comparison of floating point numbers with equality operator if(results.SeekTotal != 0 || results.SeekMin != double.MaxValue || results.SeekMax != double.MinValue) #pragma warning restore RECS0018 // Comparison of floating point numbers with equality operator - { DicConsole.WriteLine("Testing {0} seeks, longest seek took {1:F3} ms, fastest one took {2:F3} ms. ({3:F3} ms average)", results.SeekTimes, results.SeekMax, results.SeekMin, results.SeekTotal / 1000); - } Core.Statistics.AddMediaScan((long)results.A, (long)results.B, (long)results.C, (long)results.D, (long)results.E, (long)results.F, (long)results.Blocks, (long)results.Errored, diff --git a/DiscImageChef/Commands/Statistics.cs b/DiscImageChef/Commands/Statistics.cs index e00e76f5..cf9c8a8a 100644 --- a/DiscImageChef/Commands/Statistics.cs +++ b/DiscImageChef/Commands/Statistics.cs @@ -52,80 +52,50 @@ namespace DiscImageChef.Commands DicConsole.WriteLine("Commands statistics"); DicConsole.WriteLine("==================="); if(Core.Statistics.AllStats.Commands.Analyze > 0) - { DicConsole.WriteLine("You have called the Analyze command {0} times", Core.Statistics.AllStats.Commands.Analyze); - } if(Core.Statistics.AllStats.Commands.Benchmark > 0) - { DicConsole.WriteLine("You have called the Benchmark command {0} times", Core.Statistics.AllStats.Commands.Benchmark); - } if(Core.Statistics.AllStats.Commands.Checksum > 0) - { DicConsole.WriteLine("You have called the Checksum command {0} times", Core.Statistics.AllStats.Commands.Checksum); - } if(Core.Statistics.AllStats.Commands.Compare > 0) - { DicConsole.WriteLine("You have called the Compare command {0} times", Core.Statistics.AllStats.Commands.Compare); - } if(Core.Statistics.AllStats.Commands.CreateSidecar > 0) - { DicConsole.WriteLine("You have called the Create-Sidecar command {0} times", Core.Statistics.AllStats.Commands.CreateSidecar); - } if(Core.Statistics.AllStats.Commands.Decode > 0) - { DicConsole.WriteLine("You have called the Decode command {0} times", Core.Statistics.AllStats.Commands.Decode); - } if(Core.Statistics.AllStats.Commands.DeviceInfo > 0) - { DicConsole.WriteLine("You have called the Device-Info command {0} times", Core.Statistics.AllStats.Commands.DeviceInfo); - } if(Core.Statistics.AllStats.Commands.DeviceReport > 0) - { DicConsole.WriteLine("You have called the Device-Report command {0} times", Core.Statistics.AllStats.Commands.DeviceReport); - } if(Core.Statistics.AllStats.Commands.DumpMedia > 0) - { DicConsole.WriteLine("You have called the Dump-Media command {0} times", Core.Statistics.AllStats.Commands.DumpMedia); - } if(Core.Statistics.AllStats.Commands.Entropy > 0) - { DicConsole.WriteLine("You have called the Entropy command {0} times", Core.Statistics.AllStats.Commands.Entropy); - } if(Core.Statistics.AllStats.Commands.Formats > 0) - { DicConsole.WriteLine("You have called the Formats command {0} times", Core.Statistics.AllStats.Commands.Formats); - } if(Core.Statistics.AllStats.Commands.MediaInfo > 0) - { DicConsole.WriteLine("You have called the Media-Info command {0} times", Core.Statistics.AllStats.Commands.MediaInfo); - } if(Core.Statistics.AllStats.Commands.MediaScan > 0) - { DicConsole.WriteLine("You have called the Media-Scan command {0} times", Core.Statistics.AllStats.Commands.MediaScan); - } if(Core.Statistics.AllStats.Commands.PrintHex > 0) - { DicConsole.WriteLine("You have called the Print-Hex command {0} times", Core.Statistics.AllStats.Commands.PrintHex); - } if(Core.Statistics.AllStats.Commands.Verify > 0) - { DicConsole.WriteLine("You have called the Verify command {0} times", Core.Statistics.AllStats.Commands.Verify); - } DicConsole.WriteLine(); thereAreStats = true; } @@ -199,11 +169,9 @@ namespace DiscImageChef.Commands DicConsole.WriteLine("Device statistics"); DicConsole.WriteLine("================="); foreach(DeviceStats ds in Core.Statistics.AllStats.Devices) - { DicConsole .WriteLine("Device model {0}, manufactured by {1}, with revision {2} and attached via {3}.", ds.Model, ds.Manufacturer, ds.Revision, ds.Bus); - } DicConsole.WriteLine(); thereAreStats = true; @@ -214,18 +182,12 @@ namespace DiscImageChef.Commands DicConsole.WriteLine("Media statistics"); DicConsole.WriteLine("================"); foreach(MediaStats ms in Core.Statistics.AllStats.Medias) - { if(ms.real) - { DicConsole.WriteLine("Media type {0} has been found {1} times in a real device.", ms.type, ms.Value); - } else - { DicConsole.WriteLine("Media type {0} has been found {1} times in a media image.", ms.type, ms.Value); - } - } DicConsole.WriteLine(); thereAreStats = true; diff --git a/DiscImageChef/Commands/Verify.cs b/DiscImageChef/Commands/Verify.cs index 169f7a50..9c307c7e 100644 --- a/DiscImageChef/Commands/Verify.cs +++ b/DiscImageChef/Commands/Verify.cs @@ -140,16 +140,12 @@ namespace DiscImageChef.Commands bool? tempStatus; if(remainingSectors < 512) - { tempStatus = inputFormat.VerifySectors(currentSector, (uint)remainingSectors, currentTrack.TrackSequence, out tempfailingLbas, out tempunknownLbas); - } else - { tempStatus = inputFormat.VerifySectors(currentSector, 512, currentTrack.TrackSequence, out tempfailingLbas, out tempunknownLbas); - } if(checkStatus == null || tempStatus == null) checkStatus = null; else if(checkStatus == false || tempStatus == false) checkStatus = false; @@ -192,15 +188,11 @@ namespace DiscImageChef.Commands bool? tempStatus; if(remainingSectors < 512) - { tempStatus = inputFormat.VerifySectors(currentSector, (uint)remainingSectors, out tempfailingLbas, out tempunknownLbas); - } else - { tempStatus = inputFormat.VerifySectors(currentSector, 512, out tempfailingLbas, out tempunknownLbas); - } if(checkStatus == null || tempStatus == null) checkStatus = null; else if(checkStatus == false || tempStatus == false) checkStatus = false;