diff --git a/Aaru.CommonTypes b/Aaru.CommonTypes
index a9fdbe558..365386412 160000
--- a/Aaru.CommonTypes
+++ b/Aaru.CommonTypes
@@ -1 +1 @@
-Subproject commit a9fdbe55855c6e74e36a8cb6e4b905c1d2ef3c80
+Subproject commit 36538641284bdec1a8104edc6fb6eec5a0441a88
diff --git a/Aaru.Core/Checksum.cs b/Aaru.Core/Checksum.cs
index 4afa8972b..4012ebee7 100644
--- a/Aaru.Core/Checksum.cs
+++ b/Aaru.Core/Checksum.cs
@@ -842,16 +842,16 @@ public sealed class Checksum
dataChecksums.Add(chk);
}
- if(enabled.HasFlag(EnableChecksum.Fletcher32))
- {
- chk = new ChecksumType
- {
- type = ChecksumTypeType.fletcher32,
- Value = f32CtxData.End()
- };
+ if(!enabled.HasFlag(EnableChecksum.Fletcher32))
+ return dataChecksums;
- dataChecksums.Add(chk);
- }
+ chk = new ChecksumType
+ {
+ type = ChecksumTypeType.fletcher32,
+ Value = f32CtxData.End()
+ };
+
+ dataChecksums.Add(chk);
return dataChecksums;
}
diff --git a/Aaru.Core/Devices/Dumping/LinearMemory/Retrode.cs b/Aaru.Core/Devices/Dumping/LinearMemory/Retrode.cs
index a110c125d..2c45f3a76 100644
--- a/Aaru.Core/Devices/Dumping/LinearMemory/Retrode.cs
+++ b/Aaru.Core/Devices/Dumping/LinearMemory/Retrode.cs
@@ -179,12 +179,12 @@ public partial class Dump
break;
}
- if(tmp.SequenceEqual(_gbaExtension))
- {
- gbaFound = true;
+ if(!tmp.SequenceEqual(_gbaExtension))
+ continue;
- break;
- }
+ gbaFound = true;
+
+ break;
}
if(!sfcFound &&
diff --git a/Aaru.Core/Devices/Dumping/Sbc/Data.cs b/Aaru.Core/Devices/Dumping/Sbc/Data.cs
index 9a990cc2f..4abe1c620 100644
--- a/Aaru.Core/Devices/Dumping/Sbc/Data.cs
+++ b/Aaru.Core/Devices/Dumping/Sbc/Data.cs
@@ -128,62 +128,62 @@ partial class Dump
bool tmpSense = dvdDecrypt.ReadTitleKey(out tmpBuf, out _, DvdCssKeyClass.DvdCssCppmOrCprm,
i + j, _dev.Timeout, out _);
- if(!tmpSense)
+ if(tmpSense)
+ continue;
+
+ CSS_CPRM.TitleKey? titleKey = CSS.DecodeTitleKey(tmpBuf, dvdDecrypt.BusKey);
+
+ if(titleKey.HasValue)
+ outputFormat.WriteSectorTag(new[]
+ {
+ titleKey.Value.CMI
+ }, i + j, SectorTagType.DvdCmi);
+ else
+ continue;
+
+ // If the CMI bit is 1, the sector is using copy protection, else it is not
+ if((titleKey.Value.CMI & 0x80) >> 7 == 0)
{
- CSS_CPRM.TitleKey? titleKey = CSS.DecodeTitleKey(tmpBuf, dvdDecrypt.BusKey);
-
- if(titleKey.HasValue)
- outputFormat.WriteSectorTag(new[]
- {
- titleKey.Value.CMI
- }, i + j, SectorTagType.DvdCmi);
- else
- continue;
-
- // If the CMI bit is 1, the sector is using copy protection, else it is not
- if((titleKey.Value.CMI & 0x80) >> 7 == 0)
+ // The CMI indicates this sector is not encrypted.
+ outputFormat.WriteSectorTag(new byte[]
{
- // The CMI indicates this sector is not encrypted.
- outputFormat.WriteSectorTag(new byte[]
- {
- 0, 0, 0, 0, 0
- }, i + j, SectorTagType.DvdTitleKey);
+ 0, 0, 0, 0, 0
+ }, i + j, SectorTagType.DvdTitleKey);
- outputFormat.WriteSectorTag(new byte[]
- {
- 0, 0, 0, 0, 0
- }, i + j, SectorTagType.DvdTitleKeyDecrypted);
-
- _resume.MissingTitleKeys.Remove(i + j);
-
- continue;
- }
-
- // According to libdvdcss, if the key is all zeroes, the sector is actually
- // not encrypted even if the CMI says it is.
- if(titleKey.Value.Key.All(k => k == 0))
+ outputFormat.WriteSectorTag(new byte[]
{
- outputFormat.WriteSectorTag(new byte[]
- {
- 0, 0, 0, 0, 0
- }, i + j, SectorTagType.DvdTitleKey);
+ 0, 0, 0, 0, 0
+ }, i + j, SectorTagType.DvdTitleKeyDecrypted);
- outputFormat.WriteSectorTag(new byte[]
- {
- 0, 0, 0, 0, 0
- }, i + j, SectorTagType.DvdTitleKeyDecrypted);
+ _resume.MissingTitleKeys.Remove(i + j);
- _resume.MissingTitleKeys.Remove(i + j);
-
- continue;
- }
-
- outputFormat.WriteSectorTag(titleKey.Value.Key, i + j, SectorTagType.DvdTitleKey);
- _resume.MissingTitleKeys.Remove(i + j);
-
- CSS.DecryptTitleKey(0, discKey, titleKey.Value.Key, out tmpBuf);
- outputFormat.WriteSectorTag(tmpBuf, i + j, SectorTagType.DvdTitleKeyDecrypted);
+ continue;
}
+
+ // According to libdvdcss, if the key is all zeroes, the sector is actually
+ // not encrypted even if the CMI says it is.
+ if(titleKey.Value.Key.All(k => k == 0))
+ {
+ outputFormat.WriteSectorTag(new byte[]
+ {
+ 0, 0, 0, 0, 0
+ }, i + j, SectorTagType.DvdTitleKey);
+
+ outputFormat.WriteSectorTag(new byte[]
+ {
+ 0, 0, 0, 0, 0
+ }, i + j, SectorTagType.DvdTitleKeyDecrypted);
+
+ _resume.MissingTitleKeys.Remove(i + j);
+
+ continue;
+ }
+
+ outputFormat.WriteSectorTag(titleKey.Value.Key, i + j, SectorTagType.DvdTitleKey);
+ _resume.MissingTitleKeys.Remove(i + j);
+
+ CSS.DecryptTitleKey(0, discKey, titleKey.Value.Key, out tmpBuf);
+ outputFormat.WriteSectorTag(tmpBuf, i + j, SectorTagType.DvdTitleKeyDecrypted);
}
if(!_storeEncrypted)
diff --git a/Aaru.Core/Devices/Dumping/Sbc/Error.cs b/Aaru.Core/Devices/Dumping/Sbc/Error.cs
index ee3a79b8a..b44ba0ca9 100644
--- a/Aaru.Core/Devices/Dumping/Sbc/Error.cs
+++ b/Aaru.Core/Devices/Dumping/Sbc/Error.cs
@@ -89,7 +89,7 @@ partial class Dump
if(dcMode10?.Pages != null)
foreach(Modes.ModePage modePage in dcMode10.Value.Pages.Where(modePage =>
- modePage.Page == 0x01 && modePage.Subpage == 0x00))
+ modePage.Page == 0x01 && modePage.Subpage == 0x00))
currentModePage = modePage;
}
}
@@ -99,7 +99,7 @@ partial class Dump
if(dcMode6?.Pages != null)
foreach(Modes.ModePage modePage in dcMode6.Value.Pages.Where(modePage => modePage.Page == 0x01 &&
- modePage.Subpage == 0x00))
+ modePage.Subpage == 0x00))
currentModePage = modePage;
}
@@ -347,52 +347,51 @@ partial class Dump
totalDuration += cmdDuration;
- if(!sense &&
- !_dev.Error)
+ if(sense || _dev.Error)
+ continue;
+
+ CSS_CPRM.TitleKey? titleKey = CSS.DecodeTitleKey(buffer, dvdDecrypt.BusKey);
+
+ if(!titleKey.HasValue)
+ continue;
+
+ outputFormat.WriteSectorTag(new[]
{
- CSS_CPRM.TitleKey? titleKey = CSS.DecodeTitleKey(buffer, dvdDecrypt.BusKey);
+ titleKey.Value.CMI
+ }, missingKey, SectorTagType.DvdCmi);
- if(titleKey.HasValue)
+ // If the CMI bit is 1, the sector is using copy protection, else it is not
+ // If the decoded title key is zeroed, there should be no copy protection
+ if((titleKey.Value.CMI & 0x80) >> 7 == 0 ||
+ titleKey.Value.Key.All(k => k == 0))
+ {
+ outputFormat.WriteSectorTag(new byte[]
{
- outputFormat.WriteSectorTag(new[]
- {
- titleKey.Value.CMI
- }, missingKey, SectorTagType.DvdCmi);
+ 0, 0, 0, 0, 0
+ }, missingKey, SectorTagType.DvdTitleKey);
- // If the CMI bit is 1, the sector is using copy protection, else it is not
- // If the decoded title key is zeroed, there should be no copy protection
- if((titleKey.Value.CMI & 0x80) >> 7 == 0 ||
- titleKey.Value.Key.All(k => k == 0))
- {
- outputFormat.WriteSectorTag(new byte[]
- {
- 0, 0, 0, 0, 0
- }, missingKey, SectorTagType.DvdTitleKey);
+ outputFormat.WriteSectorTag(new byte[]
+ {
+ 0, 0, 0, 0, 0
+ }, missingKey, SectorTagType.DvdTitleKeyDecrypted);
- outputFormat.WriteSectorTag(new byte[]
- {
- 0, 0, 0, 0, 0
- }, missingKey, SectorTagType.DvdTitleKeyDecrypted);
+ _resume.MissingTitleKeys.Remove(missingKey);
+ UpdateStatus?.Invoke($"Correctly retried title key {missingKey} in pass {pass}.");
+ _dumpLog.WriteLine("Correctly retried title key {0} in pass {1}.", missingKey, pass);
+ }
+ else
+ {
+ outputFormat.WriteSectorTag(titleKey.Value.Key, missingKey, SectorTagType.DvdTitleKey);
+ _resume.MissingTitleKeys.Remove(missingKey);
- _resume.MissingTitleKeys.Remove(missingKey);
- UpdateStatus?.Invoke($"Correctly retried title key {missingKey} in pass {pass}.");
- _dumpLog.WriteLine("Correctly retried title key {0} in pass {1}.", missingKey, pass);
- }
- else
- {
- outputFormat.WriteSectorTag(titleKey.Value.Key, missingKey, SectorTagType.DvdTitleKey);
- _resume.MissingTitleKeys.Remove(missingKey);
-
- if(discKey != null)
- {
- CSS.DecryptTitleKey(0, discKey, titleKey.Value.Key, out buffer);
- outputFormat.WriteSectorTag(buffer, missingKey, SectorTagType.DvdTitleKeyDecrypted);
- }
-
- UpdateStatus?.Invoke($"Correctly retried title key {missingKey} in pass {pass}.");
- _dumpLog.WriteLine("Correctly retried title key {0} in pass {1}.", missingKey, pass);
- }
+ if(discKey != null)
+ {
+ CSS.DecryptTitleKey(0, discKey, titleKey.Value.Key, out buffer);
+ outputFormat.WriteSectorTag(buffer, missingKey, SectorTagType.DvdTitleKeyDecrypted);
}
+
+ UpdateStatus?.Invoke($"Correctly retried title key {missingKey} in pass {pass}.");
+ _dumpLog.WriteLine("Correctly retried title key {0} in pass {1}.", missingKey, pass);
}
}
diff --git a/Aaru.Core/Devices/Report/MMC.cs b/Aaru.Core/Devices/Report/MMC.cs
index 5b818de29..30ac76e3f 100644
--- a/Aaru.Core/Devices/Report/MMC.cs
+++ b/Aaru.Core/Devices/Report/MMC.cs
@@ -2022,83 +2022,83 @@ public sealed partial class DeviceReport
{
ctx.AddTask("Trying MediaTek READ DRAM command for Lead-Out...").IsIndeterminate();
- if(mediaTest.Blocks > 0)
+ if(!(mediaTest.Blocks > 0))
+ return;
+
+ if(mediaType == "Audio CD" &&
+ mediaTest.SupportsReadCd == true)
{
- if(mediaType == "Audio CD" &&
- mediaTest.SupportsReadCd == true)
- {
- _dev.ReadCd(out _, out _, (uint)(mediaTest.Blocks + 1), 2352, 1, MmcSectorTypes.Cdda, false,
- false, false, MmcHeaderCodes.None, true, false, MmcErrorField.None,
- MmcSubchannel.None, _dev.Timeout, out _);
+ _dev.ReadCd(out _, out _, (uint)(mediaTest.Blocks + 1), 2352, 1, MmcSectorTypes.Cdda, false, false,
+ false, MmcHeaderCodes.None, true, false, MmcErrorField.None, MmcSubchannel.None,
+ _dev.Timeout, out _);
- triedLeadOut = true;
- }
- else if((mediaType.StartsWith("CD", StringComparison.OrdinalIgnoreCase) ||
- mediaType == "Enhanced CD (aka E-CD, CD-Plus or CD+)") &&
- mediaTest.SupportsReadCdRaw == true)
- {
- _dev.ReadCd(out _, out _, (uint)(mediaTest.Blocks + 1), 2352, 1, MmcSectorTypes.AllTypes, false,
- false, true, MmcHeaderCodes.AllHeaders, true, true, MmcErrorField.None,
- MmcSubchannel.None, _dev.Timeout, out _);
-
- triedLeadOut = true;
- }
- else if((mediaType.StartsWith("CD", StringComparison.OrdinalIgnoreCase) ||
- mediaType == "Enhanced CD (aka E-CD, CD-Plus or CD+)") &&
- mediaTest.SupportsReadCd == true)
- {
- _dev.ReadCd(out _, out _, (uint)(mediaTest.Blocks + 1), 2048, 1, MmcSectorTypes.AllTypes, false,
- false, false, MmcHeaderCodes.None, true, false, MmcErrorField.None,
- MmcSubchannel.None, _dev.Timeout, out _);
-
- triedLeadOut = true;
- }
- else if(mediaTest.SupportsRead6 == true)
- {
- _dev.Read6(out _, out _, (uint)(mediaTest.Blocks + 1), 2048, _dev.Timeout, out _);
- triedLeadOut = true;
- }
- else if(mediaTest.SupportsRead10 == true)
- {
- _dev.Read10(out _, out _, 0, false, true, false, false, (uint)(mediaTest.Blocks + 1), 2048, 0,
- 1, _dev.Timeout, out _);
-
- triedLeadOut = true;
- }
- else if(mediaTest.SupportsRead12 == true)
- {
- _dev.Read12(out _, out _, 0, false, true, false, false, (uint)(mediaTest.Blocks + 1), 2048, 0,
- 1, false, _dev.Timeout, out _);
-
- triedLeadOut = true;
- }
- else if(mediaTest.SupportsRead16 == true)
- {
- _dev.Read16(out _, out _, 0, false, true, false, (ulong)(mediaTest.Blocks + 1), 2048, 0, 1,
- false, _dev.Timeout, out _);
-
- triedLeadOut = true;
- }
-
- if(triedLeadOut)
- {
- mediaTest.CanReadF1_06LeadOut =
- !_dev.MediaTekReadDram(out buffer, out senseBuffer, 0, 0xB00, _dev.Timeout, out _);
-
- mediaTest.ReadF1_06LeadOutData = mediaTest.CanReadF1_06LeadOut == true ? buffer : senseBuffer;
-
- // This means it has returned the same as previous read, so not really lead-out.
- if(mediaTest.CanReadF1_06 == true &&
- mediaTest.CanReadF1_06LeadOut == true &&
- mediaTest.ReadF1_06Data.SequenceEqual(mediaTest.ReadF1_06LeadOutData))
- {
- mediaTest.CanReadF1_06LeadOut = false;
- mediaTest.ReadF1_06LeadOutData = senseBuffer;
- }
-
- AaruConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadF1_06LeadOut);
- }
+ triedLeadOut = true;
}
+ else if((mediaType.StartsWith("CD", StringComparison.OrdinalIgnoreCase) ||
+ mediaType == "Enhanced CD (aka E-CD, CD-Plus or CD+)") &&
+ mediaTest.SupportsReadCdRaw == true)
+ {
+ _dev.ReadCd(out _, out _, (uint)(mediaTest.Blocks + 1), 2352, 1, MmcSectorTypes.AllTypes, false,
+ false, true, MmcHeaderCodes.AllHeaders, true, true, MmcErrorField.None,
+ MmcSubchannel.None, _dev.Timeout, out _);
+
+ triedLeadOut = true;
+ }
+ else if((mediaType.StartsWith("CD", StringComparison.OrdinalIgnoreCase) ||
+ mediaType == "Enhanced CD (aka E-CD, CD-Plus or CD+)") &&
+ mediaTest.SupportsReadCd == true)
+ {
+ _dev.ReadCd(out _, out _, (uint)(mediaTest.Blocks + 1), 2048, 1, MmcSectorTypes.AllTypes, false,
+ false, false, MmcHeaderCodes.None, true, false, MmcErrorField.None, MmcSubchannel.None,
+ _dev.Timeout, out _);
+
+ triedLeadOut = true;
+ }
+ else if(mediaTest.SupportsRead6 == true)
+ {
+ _dev.Read6(out _, out _, (uint)(mediaTest.Blocks + 1), 2048, _dev.Timeout, out _);
+ triedLeadOut = true;
+ }
+ else if(mediaTest.SupportsRead10 == true)
+ {
+ _dev.Read10(out _, out _, 0, false, true, false, false, (uint)(mediaTest.Blocks + 1), 2048, 0, 1,
+ _dev.Timeout, out _);
+
+ triedLeadOut = true;
+ }
+ else if(mediaTest.SupportsRead12 == true)
+ {
+ _dev.Read12(out _, out _, 0, false, true, false, false, (uint)(mediaTest.Blocks + 1), 2048, 0, 1,
+ false, _dev.Timeout, out _);
+
+ triedLeadOut = true;
+ }
+ else if(mediaTest.SupportsRead16 == true)
+ {
+ _dev.Read16(out _, out _, 0, false, true, false, (ulong)(mediaTest.Blocks + 1), 2048, 0, 1, false,
+ _dev.Timeout, out _);
+
+ triedLeadOut = true;
+ }
+
+ if(!triedLeadOut)
+ return;
+
+ mediaTest.CanReadF1_06LeadOut =
+ !_dev.MediaTekReadDram(out buffer, out senseBuffer, 0, 0xB00, _dev.Timeout, out _);
+
+ mediaTest.ReadF1_06LeadOutData = mediaTest.CanReadF1_06LeadOut == true ? buffer : senseBuffer;
+
+ // This means it has returned the same as previous read, so not really lead-out.
+ if(mediaTest.CanReadF1_06 == true &&
+ mediaTest.CanReadF1_06LeadOut == true &&
+ mediaTest.ReadF1_06Data.SequenceEqual(mediaTest.ReadF1_06LeadOutData))
+ {
+ mediaTest.CanReadF1_06LeadOut = false;
+ mediaTest.ReadF1_06LeadOutData = senseBuffer;
+ }
+
+ AaruConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadF1_06LeadOut);
});
}
@@ -2177,25 +2177,23 @@ public sealed partial class DeviceReport
false, MmcErrorField.None,
MmcSubchannel.Raw, _dev.Timeout, out _);
+ if(mediaTest.CanReadingIntersessionLeadOut != false)
+ return;
+
+ mediaTest.CanReadingIntersessionLeadOut = !_dev.ReadCd(out buffer, out senseBuffer,
+ firstSessionLeadOutLba, 2368, 1,
+ MmcSectorTypes.AllTypes, false, false,
+ false, MmcHeaderCodes.AllHeaders, true,
+ false, MmcErrorField.None,
+ MmcSubchannel.Q16, _dev.Timeout, out _);
+
if(mediaTest.CanReadingIntersessionLeadOut == false)
- {
mediaTest.CanReadingIntersessionLeadOut = !_dev.ReadCd(out buffer, out senseBuffer,
- firstSessionLeadOutLba, 2368, 1,
+ firstSessionLeadOutLba, 2352, 1,
MmcSectorTypes.AllTypes, false, false,
false, MmcHeaderCodes.AllHeaders, true,
false, MmcErrorField.None,
- MmcSubchannel.Q16, _dev.Timeout, out _);
-
- if(mediaTest.CanReadingIntersessionLeadOut == false)
- mediaTest.CanReadingIntersessionLeadOut = !_dev.ReadCd(out buffer, out senseBuffer,
- firstSessionLeadOutLba, 2352, 1,
- MmcSectorTypes.AllTypes, false,
- false, false,
- MmcHeaderCodes.AllHeaders, true,
- false, MmcErrorField.None,
- MmcSubchannel.None, _dev.Timeout,
- out _);
- }
+ MmcSubchannel.None, _dev.Timeout, out _);
});
AaruConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadingIntersessionLeadOut);
@@ -2213,24 +2211,23 @@ public sealed partial class DeviceReport
false, MmcErrorField.None,
MmcSubchannel.Raw, _dev.Timeout, out _);
+ if(mediaTest.CanReadingIntersessionLeadIn != false)
+ return;
+
+ mediaTest.CanReadingIntersessionLeadIn = !_dev.ReadCd(out buffer, out senseBuffer,
+ secondSessionLeadInLba, 2368, 1,
+ MmcSectorTypes.AllTypes, false, false,
+ false, MmcHeaderCodes.AllHeaders, true,
+ false, MmcErrorField.None,
+ MmcSubchannel.Q16, _dev.Timeout, out _);
+
if(mediaTest.CanReadingIntersessionLeadIn == false)
- {
mediaTest.CanReadingIntersessionLeadIn = !_dev.ReadCd(out buffer, out senseBuffer,
- secondSessionLeadInLba, 2368, 1,
+ secondSessionLeadInLba, 2352, 1,
MmcSectorTypes.AllTypes, false, false,
false, MmcHeaderCodes.AllHeaders, true,
false, MmcErrorField.None,
- MmcSubchannel.Q16, _dev.Timeout, out _);
-
- if(mediaTest.CanReadingIntersessionLeadIn == false)
- mediaTest.CanReadingIntersessionLeadIn = !_dev.ReadCd(out buffer, out senseBuffer,
- secondSessionLeadInLba, 2352, 1,
- MmcSectorTypes.AllTypes, false, false,
- false, MmcHeaderCodes.AllHeaders,
- true, false, MmcErrorField.None,
- MmcSubchannel.None, _dev.Timeout,
- out _);
- }
+ MmcSubchannel.None, _dev.Timeout, out _);
});
AaruConsole.DebugWriteLine("SCSI Report", "Sense = {0}", !mediaTest.CanReadingIntersessionLeadIn);
diff --git a/Aaru.Core/Devices/Report/Scsi.cs b/Aaru.Core/Devices/Report/Scsi.cs
index 0ab19f741..7f61b8c8e 100644
--- a/Aaru.Core/Devices/Report/Scsi.cs
+++ b/Aaru.Core/Devices/Report/Scsi.cs
@@ -650,105 +650,107 @@ public sealed partial class DeviceReport
}
}
- if((mediaTest.SupportsReadLong == true || mediaTest.SupportsReadLong16 == true) &&
- mediaTest.LongBlockSize == mediaTest.BlockSize)
- switch(mediaTest.BlockSize)
+ if(mediaTest.SupportsReadLong != true && mediaTest.SupportsReadLong16 != true ||
+ mediaTest.LongBlockSize != mediaTest.BlockSize)
+ return;
+
+ switch(mediaTest.BlockSize)
+ {
+ case 512:
{
- case 512:
- {
- foreach(ushort testSize in new ushort[]
- {
- // Long sector sizes for floppies
- 514,
+ foreach(ushort testSize in new ushort[]
+ {
+ // Long sector sizes for floppies
+ 514,
- // Long sector sizes for SuperDisk
- 536, 558,
+ // Long sector sizes for SuperDisk
+ 536, 558,
- // Long sector sizes for 512-byte magneto-opticals
- 600, 610, 630
- })
- {
- sense = mediaTest.SupportsReadLong16 == true
- ? _dev.ReadLong16(out buffer, out senseBuffer, false, 0, testSize, _dev.Timeout,
- out _) : _dev.ReadLong10(out buffer, out senseBuffer, false,
- false, 0, testSize, _dev.Timeout, out _);
-
- if(sense || _dev.Error)
- continue;
-
- mediaTest.LongBlockSize = testSize;
-
- break;
- }
-
- break;
- }
- case 1024:
- {
- foreach(ushort testSize in new ushort[]
- {
- // Long sector sizes for floppies
- 1026,
-
- // Long sector sizes for 1024-byte magneto-opticals
- 1200
- })
- {
- sense = mediaTest.SupportsReadLong16 == true
- ? _dev.ReadLong16(out buffer, out senseBuffer, false, 0, testSize, _dev.Timeout,
- out _) : _dev.ReadLong10(out buffer, out senseBuffer, false,
- false, 0, testSize, _dev.Timeout, out _);
-
- if(sense || _dev.Error)
- continue;
-
- mediaTest.LongBlockSize = testSize;
-
- break;
- }
-
- break;
- }
- case 2048:
+ // Long sector sizes for 512-byte magneto-opticals
+ 600, 610, 630
+ })
{
sense = mediaTest.SupportsReadLong16 == true
- ? _dev.ReadLong16(out buffer, out senseBuffer, false, 0, 2380, _dev.Timeout, out _)
- : _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 2380, _dev.Timeout,
- out _);
+ ? _dev.ReadLong16(out buffer, out senseBuffer, false, 0, testSize, _dev.Timeout,
+ out _) : _dev.ReadLong10(out buffer, out senseBuffer, false,
+ false, 0, testSize, _dev.Timeout, out _);
- if(!sense &&
- !_dev.Error)
- mediaTest.LongBlockSize = 2380;
+ if(sense || _dev.Error)
+ continue;
+
+ mediaTest.LongBlockSize = testSize;
break;
}
- case 4096:
- {
- sense = mediaTest.SupportsReadLong16 == true
- ? _dev.ReadLong16(out buffer, out senseBuffer, false, 0, 4760, _dev.Timeout, out _)
- : _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 4760, _dev.Timeout,
- out _);
- if(!sense &&
- !_dev.Error)
- mediaTest.LongBlockSize = 4760;
-
- break;
- }
- case 8192:
- {
- sense = mediaTest.SupportsReadLong16 == true
- ? _dev.ReadLong16(out buffer, out senseBuffer, false, 0, 9424, _dev.Timeout, out _)
- : _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 9424, _dev.Timeout,
- out _);
-
- if(!sense &&
- !_dev.Error)
- mediaTest.LongBlockSize = 9424;
-
- break;
- }
+ break;
}
+ case 1024:
+ {
+ foreach(ushort testSize in new ushort[]
+ {
+ // Long sector sizes for floppies
+ 1026,
+
+ // Long sector sizes for 1024-byte magneto-opticals
+ 1200
+ })
+ {
+ sense = mediaTest.SupportsReadLong16 == true
+ ? _dev.ReadLong16(out buffer, out senseBuffer, false, 0, testSize, _dev.Timeout,
+ out _) : _dev.ReadLong10(out buffer, out senseBuffer, false,
+ false, 0, testSize, _dev.Timeout, out _);
+
+ if(sense || _dev.Error)
+ continue;
+
+ mediaTest.LongBlockSize = testSize;
+
+ break;
+ }
+
+ break;
+ }
+ case 2048:
+ {
+ sense = mediaTest.SupportsReadLong16 == true
+ ? _dev.ReadLong16(out buffer, out senseBuffer, false, 0, 2380, _dev.Timeout, out _)
+ : _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 2380, _dev.Timeout,
+ out _);
+
+ if(!sense &&
+ !_dev.Error)
+ mediaTest.LongBlockSize = 2380;
+
+ break;
+ }
+ case 4096:
+ {
+ sense = mediaTest.SupportsReadLong16 == true
+ ? _dev.ReadLong16(out buffer, out senseBuffer, false, 0, 4760, _dev.Timeout, out _)
+ : _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 4760, _dev.Timeout,
+ out _);
+
+ if(!sense &&
+ !_dev.Error)
+ mediaTest.LongBlockSize = 4760;
+
+ break;
+ }
+ case 8192:
+ {
+ sense = mediaTest.SupportsReadLong16 == true
+ ? _dev.ReadLong16(out buffer, out senseBuffer, false, 0, 9424, _dev.Timeout, out _)
+ : _dev.ReadLong10(out buffer, out senseBuffer, false, false, 0, 9424, _dev.Timeout,
+ out _);
+
+ if(!sense &&
+ !_dev.Error)
+ mediaTest.LongBlockSize = 9424;
+
+ break;
+ }
+ }
});
Spectre.ProgressSingleSpinner(ctx =>
diff --git a/Aaru.Core/Media/Detection/MMC.cs b/Aaru.Core/Media/Detection/MMC.cs
index 5015c2fc7..33b9e5e34 100644
--- a/Aaru.Core/Media/Detection/MMC.cs
+++ b/Aaru.Core/Media/Detection/MMC.cs
@@ -2222,18 +2222,18 @@ public static class MMC
break;
}
- if(line.StartsWith("BOOT2=cdrom0:", StringComparison.InvariantCultureIgnoreCase))
- {
- ps2BootFile = line.Substring(13);
+ if(!line.StartsWith("BOOT2=cdrom0:", StringComparison.InvariantCultureIgnoreCase))
+ continue;
- if(ps2BootFile.StartsWith('\\'))
- ps2BootFile = ps2BootFile.Substring(1);
+ ps2BootFile = line.Substring(13);
- if(ps2BootFile.EndsWith(";1", StringComparison.InvariantCultureIgnoreCase))
- ps2BootFile = ps2BootFile.Substring(0, ps2BootFile.Length - 2);
+ if(ps2BootFile.StartsWith('\\'))
+ ps2BootFile = ps2BootFile.Substring(1);
- break;
- }
+ if(ps2BootFile.EndsWith(";1", StringComparison.InvariantCultureIgnoreCase))
+ ps2BootFile = ps2BootFile.Substring(0, ps2BootFile.Length - 2);
+
+ break;
}
if(ps1BootFile != null &&
diff --git a/Aaru.Decryption b/Aaru.Decryption
index 603379482..2a6ca74a7 160000
--- a/Aaru.Decryption
+++ b/Aaru.Decryption
@@ -1 +1 @@
-Subproject commit 603379482318d1a4fdcdfa5591f2a409c229b122
+Subproject commit 2a6ca74a7855a04f902c37d669af8d5e39708163
diff --git a/Aaru.Devices/Remote/Device.cs b/Aaru.Devices/Remote/Device.cs
index 4820e71d8..a11733e41 100644
--- a/Aaru.Devices/Remote/Device.cs
+++ b/Aaru.Devices/Remote/Device.cs
@@ -216,11 +216,11 @@ public sealed partial class Device : Devices.Device
}
#endregion FireWire
#region PCMCIA
- if(dev._remote.GetPcmciaData(out byte[] cisBuf))
- {
- dev.IsPcmcia = true;
- dev.Cis = cisBuf;
- }
+ if(!dev._remote.GetPcmciaData(out byte[] cisBuf))
+ return dev;
+
+ dev.IsPcmcia = true;
+ dev.Cis = cisBuf;
#endregion PCMCIA
return dev;
diff --git a/Aaru.Devices/Remote/Remote.cs b/Aaru.Devices/Remote/Remote.cs
index 2736e3c24..c020e8431 100644
--- a/Aaru.Devices/Remote/Remote.cs
+++ b/Aaru.Devices/Remote/Remote.cs
@@ -1238,15 +1238,15 @@ public class Remote : IDisposable
Array.Copy(res.ocr, 0, ocr, 0, res.ocr_len);
}
- if(res.scr_len > 0)
- {
- if(res.scr_len > 16)
- res.scr_len = 16;
+ if(res.scr_len <= 0)
+ return res.isSdhci;
- scr = new byte[res.scr_len];
+ if(res.scr_len > 16)
+ res.scr_len = 16;
- Array.Copy(res.scr, 0, scr, 0, res.scr_len);
- }
+ scr = new byte[res.scr_len];
+
+ Array.Copy(res.scr, 0, scr, 0, res.scr_len);
return res.isSdhci;
}
@@ -1576,7 +1576,7 @@ public class Remote : IDisposable
/// Set to true if any of the commands returned an error status, false otherwise
/// Maximum allowed time to execute a single command
/// 0 if no error occurred, otherwise, errno
- public int SendMultipleMmcCommands(Device.MmcSingleCommand[] commands, out double duration, out bool sense,
+ public int SendMultipleMmcCommands(Devices.Device.MmcSingleCommand[] commands, out double duration, out bool sense,
uint timeout = 0)
{
if(ServerProtocolVersion < 2)
@@ -1588,7 +1588,7 @@ public class Remote : IDisposable
long packetSize = Marshal.SizeOf() +
Marshal.SizeOf() * commands.LongLength;
- foreach(Device.MmcSingleCommand command in commands)
+ foreach(Devices.Device.MmcSingleCommand command in commands)
packetSize += command.buffer?.Length ?? 0;
var packet = new AaruPacketMultiCmdSdhci
@@ -1630,7 +1630,7 @@ public class Remote : IDisposable
off += tmp.Length;
}
- foreach(Device.MmcSingleCommand command in commands.Where(command => (command.buffer?.Length ?? 0) != 0))
+ foreach(Devices.Device.MmcSingleCommand command in commands.Where(command => (command.buffer?.Length ?? 0) != 0))
{
Array.Copy(command.buffer, 0, buf, off, command.buffer.Length);
@@ -1699,7 +1699,7 @@ public class Remote : IDisposable
var error = 0;
- foreach(Device.MmcSingleCommand command in commands)
+ foreach(Devices.Device.MmcSingleCommand command in commands)
{
AaruResSdhci cmdRes =
Marshal.ByteArrayToStructureLittleEndian(buf, off, Marshal.SizeOf());
@@ -1720,7 +1720,7 @@ public class Remote : IDisposable
off += Marshal.SizeOf();
}
- foreach(Device.MmcSingleCommand command in commands)
+ foreach(Devices.Device.MmcSingleCommand command in commands)
{
Array.Copy(buf, off, command.buffer, 0, command.buffer.Length);
off += command.buffer.Length;
@@ -1738,13 +1738,13 @@ public class Remote : IDisposable
/// Set to true if any of the commands returned an error status, false otherwise
/// Maximum allowed time to execute a single command
/// 0 if no error occurred, otherwise, errno
- int SendMultipleMmcCommandsV1(Device.MmcSingleCommand[] commands, out double duration, out bool sense, uint timeout)
+ int SendMultipleMmcCommandsV1(Devices.Device.MmcSingleCommand[] commands, out double duration, out bool sense, uint timeout)
{
sense = false;
duration = 0;
var error = 0;
- foreach(Device.MmcSingleCommand command in commands)
+ foreach(Devices.Device.MmcSingleCommand command in commands)
{
error = SendMmcCommand(command.command, command.write, command.isApplication, command.flags,
command.argument, command.blockSize, command.blocks, ref command.buffer,
diff --git a/Aaru.Filesystems/FAT/BPB.cs b/Aaru.Filesystems/FAT/BPB.cs
index a1e9e5938..3eb20be5e 100644
--- a/Aaru.Filesystems/FAT/BPB.cs
+++ b/Aaru.Filesystems/FAT/BPB.cs
@@ -785,28 +785,27 @@ public sealed partial class FAT
return BpbKind.Atari;
}
- if(useApricotBpb)
- {
- fakeBpb.bps = apricotBpb.mainBPB.bps;
- fakeBpb.spc = apricotBpb.mainBPB.spc;
- fakeBpb.rsectors = apricotBpb.mainBPB.rsectors;
- fakeBpb.fats_no = apricotBpb.mainBPB.fats_no;
- fakeBpb.root_ent = apricotBpb.mainBPB.root_ent;
- fakeBpb.sectors = apricotBpb.mainBPB.sectors;
- fakeBpb.media = apricotBpb.mainBPB.media;
- fakeBpb.spfat = apricotBpb.mainBPB.spfat;
- fakeBpb.sptrk = apricotBpb.spt;
- bootable = apricotBpb.bootType > 0;
+ if(!useApricotBpb)
+ return BpbKind.None;
- if(apricotBpb.bootLocation > 0 &&
- apricotBpb.bootLocation + apricotBpb.bootSize < imagePlugin.Info.Sectors)
- imagePlugin.ReadSectors(apricotBpb.bootLocation,
- (uint)(apricotBpb.sectorSize * apricotBpb.bootSize) /
- imagePlugin.Info.SectorSize, out fakeBpb.boot_code);
+ fakeBpb.bps = apricotBpb.mainBPB.bps;
+ fakeBpb.spc = apricotBpb.mainBPB.spc;
+ fakeBpb.rsectors = apricotBpb.mainBPB.rsectors;
+ fakeBpb.fats_no = apricotBpb.mainBPB.fats_no;
+ fakeBpb.root_ent = apricotBpb.mainBPB.root_ent;
+ fakeBpb.sectors = apricotBpb.mainBPB.sectors;
+ fakeBpb.media = apricotBpb.mainBPB.media;
+ fakeBpb.spfat = apricotBpb.mainBPB.spfat;
+ fakeBpb.sptrk = apricotBpb.spt;
+ bootable = apricotBpb.bootType > 0;
- return BpbKind.Apricot;
- }
+ if(apricotBpb.bootLocation > 0 &&
+ apricotBpb.bootLocation + apricotBpb.bootSize < imagePlugin.Info.Sectors)
+ imagePlugin.ReadSectors(apricotBpb.bootLocation,
+ (uint)(apricotBpb.sectorSize * apricotBpb.bootSize) / imagePlugin.Info.SectorSize,
+ out fakeBpb.boot_code);
+
+ return BpbKind.Apricot;
- return BpbKind.None;
}
}
\ No newline at end of file
diff --git a/Aaru.Filesystems/ISO9660/File.cs b/Aaru.Filesystems/ISO9660/File.cs
index 189b09fe7..601fcb670 100644
--- a/Aaru.Filesystems/ISO9660/File.cs
+++ b/Aaru.Filesystems/ISO9660/File.cs
@@ -127,35 +127,40 @@ public sealed partial class ISO9660
offset += entry.XattrLength * _blockSize;
- if(entry.CdiSystemArea?.attributes.HasFlag(CdiAttributes.DigitalAudio) == true &&
- entry.Extents.Count == 1)
- try
- {
- long firstSector = offset / 2352;
- long offsetInSector = offset % 2352;
- long sizeInSectors = (size + offsetInSector) / 2352;
+ if(entry.CdiSystemArea?.attributes.HasFlag(CdiAttributes.DigitalAudio) != true ||
+ entry.Extents.Count != 1)
+ return ReadWithExtents(offset, size, entry.Extents,
+ entry.XA?.signature == XA_MAGIC &&
+ entry.XA?.attributes.HasFlag(XaAttributes.Interleaved) == true,
+ entry.XA?.filenumber ?? 0, out buf);
- if((size + offsetInSector) % 2352 > 0)
- sizeInSectors++;
+ try
+ {
+ long firstSector = offset / 2352;
+ long offsetInSector = offset % 2352;
+ long sizeInSectors = (size + offsetInSector) / 2352;
- ErrorNumber errno = _image.ReadSectorsLong((ulong)(entry.Extents[0].extent + firstSector),
- (uint)sizeInSectors, out byte[] buffer);
+ if((size + offsetInSector) % 2352 > 0)
+ sizeInSectors++;
- if(errno != ErrorNumber.NoError)
- return errno;
+ ErrorNumber errno = _image.ReadSectorsLong((ulong)(entry.Extents[0].extent + firstSector),
+ (uint)sizeInSectors, out byte[] buffer);
- buf = new byte[size];
- Array.Copy(buffer, offsetInSector, buf, 0, size);
+ if(errno != ErrorNumber.NoError)
+ return errno;
- return ErrorNumber.NoError;
- }
- catch(Exception e)
- {
- AaruConsole.DebugWriteLine("ISO9660 plugin", "Exception reading CD-i audio file");
- AaruConsole.DebugWriteLine("ISO9660 plugin", "{0}", e);
+ buf = new byte[size];
+ Array.Copy(buffer, offsetInSector, buf, 0, size);
- return ErrorNumber.UnexpectedException;
- }
+ return ErrorNumber.NoError;
+ }
+ catch(Exception e)
+ {
+ AaruConsole.DebugWriteLine("ISO9660 plugin", "Exception reading CD-i audio file");
+ AaruConsole.DebugWriteLine("ISO9660 plugin", "{0}", e);
+
+ return ErrorNumber.UnexpectedException;
+ }
return ReadWithExtents(offset, size, entry.Extents,
entry.XA?.signature == XA_MAGIC &&
diff --git a/Aaru.Filesystems/ISO9660/Xattr.cs b/Aaru.Filesystems/ISO9660/Xattr.cs
index 218de21f3..ef91b1fb9 100644
--- a/Aaru.Filesystems/ISO9660/Xattr.cs
+++ b/Aaru.Filesystems/ISO9660/Xattr.cs
@@ -127,17 +127,16 @@ public sealed partial class ISO9660
if(entry.AssociatedFile.Extents is null)
return ErrorNumber.InvalidArgument;
- if(entry.AssociatedFile.Size == 0)
- {
- buf = Array.Empty();
+ if(entry.AssociatedFile.Size != 0)
+ return ReadWithExtents(0, (long)entry.AssociatedFile.Size, entry.AssociatedFile.Extents,
+ entry.AssociatedFile.XA?.signature == XA_MAGIC &&
+ entry.AssociatedFile.XA?.attributes.HasFlag(XaAttributes.Interleaved) ==
+ true, entry.AssociatedFile.XA?.filenumber ?? 0, out buf);
- return ErrorNumber.NoError;
- }
+ buf = Array.Empty();
+
+ return ErrorNumber.NoError;
- return ReadWithExtents(0, (long)entry.AssociatedFile.Size, entry.AssociatedFile.Extents,
- entry.AssociatedFile.XA?.signature == XA_MAGIC &&
- entry.AssociatedFile.XA?.attributes.HasFlag(XaAttributes.Interleaved) == true,
- entry.AssociatedFile.XA?.filenumber ?? 0, out buf);
case "com.apple.dos.type":
if(entry.AppleDosType is null)
return ErrorNumber.NoSuchExtendedAttribute;
@@ -160,17 +159,16 @@ public sealed partial class ISO9660
if(entry.ResourceFork.Extents is null)
return ErrorNumber.InvalidArgument;
- if(entry.ResourceFork.Size == 0)
- {
- buf = Array.Empty();
+ if(entry.ResourceFork.Size != 0)
+ return ReadWithExtents(0, (long)entry.ResourceFork.Size, entry.ResourceFork.Extents,
+ entry.ResourceFork.XA?.signature == XA_MAGIC &&
+ entry.ResourceFork.XA?.attributes.HasFlag(XaAttributes.Interleaved) == true,
+ entry.ResourceFork.XA?.filenumber ?? 0, out buf);
- return ErrorNumber.NoError;
- }
+ buf = Array.Empty();
+
+ return ErrorNumber.NoError;
- return ReadWithExtents(0, (long)entry.ResourceFork.Size, entry.ResourceFork.Extents,
- entry.ResourceFork.XA?.signature == XA_MAGIC &&
- entry.ResourceFork.XA?.attributes.HasFlag(XaAttributes.Interleaved) == true,
- entry.ResourceFork.XA?.filenumber ?? 0, out buf);
case "com.apple.FinderInfo":
if(entry.FinderInfo is null)
return ErrorNumber.NoSuchExtendedAttribute;
diff --git a/Aaru.Gui/Controls/BlockMap.cs b/Aaru.Gui/Controls/BlockMap.cs
index 1cbfd52f8..f79208a69 100644
--- a/Aaru.Gui/Controls/BlockMap.cs
+++ b/Aaru.Gui/Controls/BlockMap.cs
@@ -454,11 +454,11 @@ public sealed class BlockMap : ItemsControl
ctx.FillRectangle(new SolidColorBrush(color), new Rect(x, y, squareWidth, squareHeight));
x += squareWidth + 2 * borderWidth;
- if(x >= sideLength)
- {
- x = 0;
- y += squareHeight + 2 * borderWidth;
- }
+ if(x < sideLength)
+ continue;
+
+ x = 0;
+ y += squareHeight + 2 * borderWidth;
}
}
diff --git a/Aaru.Gui/ViewModels/Tabs/ScsiInfoViewModel.cs b/Aaru.Gui/ViewModels/Tabs/ScsiInfoViewModel.cs
index d7bf90a12..b219bc5f8 100644
--- a/Aaru.Gui/ViewModels/Tabs/ScsiInfoViewModel.cs
+++ b/Aaru.Gui/ViewModels/Tabs/ScsiInfoViewModel.cs
@@ -595,93 +595,93 @@ public sealed class ScsiInfoViewModel : ViewModelBase
});
}
- if(_configuration != null)
- {
- Features.SeparatedFeatures ftr = Features.Separate(_configuration);
+ if(_configuration == null)
+ return;
- AaruConsole.DebugWriteLine("Device-Info command", "GET CONFIGURATION length is {0} bytes", ftr.DataLength);
+ Features.SeparatedFeatures ftr = Features.Separate(_configuration);
- AaruConsole.DebugWriteLine("Device-Info command", "GET CONFIGURATION current profile is {0:X4}h",
- ftr.CurrentProfile);
+ AaruConsole.DebugWriteLine("Device-Info command", "GET CONFIGURATION length is {0} bytes", ftr.DataLength);
- if(ftr.Descriptors != null)
- foreach(Features.FeatureDescriptor desc in ftr.Descriptors)
+ AaruConsole.DebugWriteLine("Device-Info command", "GET CONFIGURATION current profile is {0:X4}h",
+ ftr.CurrentProfile);
+
+ if(ftr.Descriptors != null)
+ foreach(Features.FeatureDescriptor desc in ftr.Descriptors)
+ {
+ string featureNumber = $"Feature {desc.Code:X4}h";
+ AaruConsole.DebugWriteLine("Device-Info command", "Feature {0:X4}h", desc.Code);
+
+ string featureDescription = desc.Code switch
+ {
+ 0x0000 => Features.Prettify_0000(desc.Data),
+ 0x0001 => Features.Prettify_0001(desc.Data),
+ 0x0002 => Features.Prettify_0002(desc.Data),
+ 0x0003 => Features.Prettify_0003(desc.Data),
+ 0x0004 => Features.Prettify_0004(desc.Data),
+ 0x0010 => Features.Prettify_0010(desc.Data),
+ 0x001D => Features.Prettify_001D(desc.Data),
+ 0x001E => Features.Prettify_001E(desc.Data),
+ 0x001F => Features.Prettify_001F(desc.Data),
+ 0x0020 => Features.Prettify_0020(desc.Data),
+ 0x0021 => Features.Prettify_0021(desc.Data),
+ 0x0022 => Features.Prettify_0022(desc.Data),
+ 0x0023 => Features.Prettify_0023(desc.Data),
+ 0x0024 => Features.Prettify_0024(desc.Data),
+ 0x0025 => Features.Prettify_0025(desc.Data),
+ 0x0026 => Features.Prettify_0026(desc.Data),
+ 0x0027 => Features.Prettify_0027(desc.Data),
+ 0x0028 => Features.Prettify_0028(desc.Data),
+ 0x0029 => Features.Prettify_0029(desc.Data),
+ 0x002A => Features.Prettify_002A(desc.Data),
+ 0x002B => Features.Prettify_002B(desc.Data),
+ 0x002C => Features.Prettify_002C(desc.Data),
+ 0x002D => Features.Prettify_002D(desc.Data),
+ 0x002E => Features.Prettify_002E(desc.Data),
+ 0x002F => Features.Prettify_002F(desc.Data),
+ 0x0030 => Features.Prettify_0030(desc.Data),
+ 0x0031 => Features.Prettify_0031(desc.Data),
+ 0x0032 => Features.Prettify_0032(desc.Data),
+ 0x0033 => Features.Prettify_0033(desc.Data),
+ 0x0035 => Features.Prettify_0035(desc.Data),
+ 0x0037 => Features.Prettify_0037(desc.Data),
+ 0x0038 => Features.Prettify_0038(desc.Data),
+ 0x003A => Features.Prettify_003A(desc.Data),
+ 0x003B => Features.Prettify_003B(desc.Data),
+ 0x0040 => Features.Prettify_0040(desc.Data),
+ 0x0041 => Features.Prettify_0041(desc.Data),
+ 0x0042 => Features.Prettify_0042(desc.Data),
+ 0x0050 => Features.Prettify_0050(desc.Data),
+ 0x0051 => Features.Prettify_0051(desc.Data),
+ 0x0080 => Features.Prettify_0080(desc.Data),
+ 0x0100 => Features.Prettify_0100(desc.Data),
+ 0x0101 => Features.Prettify_0101(desc.Data),
+ 0x0102 => Features.Prettify_0102(desc.Data),
+ 0x0103 => Features.Prettify_0103(desc.Data),
+ 0x0104 => Features.Prettify_0104(desc.Data),
+ 0x0105 => Features.Prettify_0105(desc.Data),
+ 0x0106 => Features.Prettify_0106(desc.Data),
+ 0x0107 => Features.Prettify_0107(desc.Data),
+ 0x0108 => Features.Prettify_0108(desc.Data),
+ 0x0109 => Features.Prettify_0109(desc.Data),
+ 0x010A => Features.Prettify_010A(desc.Data),
+ 0x010B => Features.Prettify_010B(desc.Data),
+ 0x010C => Features.Prettify_010C(desc.Data),
+ 0x010D => Features.Prettify_010D(desc.Data),
+ 0x010E => Features.Prettify_010E(desc.Data),
+ 0x0110 => Features.Prettify_0110(desc.Data),
+ 0x0113 => Features.Prettify_0113(desc.Data),
+ 0x0142 => Features.Prettify_0142(desc.Data),
+ _ => "Unknown feature"
+ };
+
+ MmcFeatures.Add(new ScsiPageModel
{
- string featureNumber = $"Feature {desc.Code:X4}h";
- AaruConsole.DebugWriteLine("Device-Info command", "Feature {0:X4}h", desc.Code);
-
- string featureDescription = desc.Code switch
- {
- 0x0000 => Features.Prettify_0000(desc.Data),
- 0x0001 => Features.Prettify_0001(desc.Data),
- 0x0002 => Features.Prettify_0002(desc.Data),
- 0x0003 => Features.Prettify_0003(desc.Data),
- 0x0004 => Features.Prettify_0004(desc.Data),
- 0x0010 => Features.Prettify_0010(desc.Data),
- 0x001D => Features.Prettify_001D(desc.Data),
- 0x001E => Features.Prettify_001E(desc.Data),
- 0x001F => Features.Prettify_001F(desc.Data),
- 0x0020 => Features.Prettify_0020(desc.Data),
- 0x0021 => Features.Prettify_0021(desc.Data),
- 0x0022 => Features.Prettify_0022(desc.Data),
- 0x0023 => Features.Prettify_0023(desc.Data),
- 0x0024 => Features.Prettify_0024(desc.Data),
- 0x0025 => Features.Prettify_0025(desc.Data),
- 0x0026 => Features.Prettify_0026(desc.Data),
- 0x0027 => Features.Prettify_0027(desc.Data),
- 0x0028 => Features.Prettify_0028(desc.Data),
- 0x0029 => Features.Prettify_0029(desc.Data),
- 0x002A => Features.Prettify_002A(desc.Data),
- 0x002B => Features.Prettify_002B(desc.Data),
- 0x002C => Features.Prettify_002C(desc.Data),
- 0x002D => Features.Prettify_002D(desc.Data),
- 0x002E => Features.Prettify_002E(desc.Data),
- 0x002F => Features.Prettify_002F(desc.Data),
- 0x0030 => Features.Prettify_0030(desc.Data),
- 0x0031 => Features.Prettify_0031(desc.Data),
- 0x0032 => Features.Prettify_0032(desc.Data),
- 0x0033 => Features.Prettify_0033(desc.Data),
- 0x0035 => Features.Prettify_0035(desc.Data),
- 0x0037 => Features.Prettify_0037(desc.Data),
- 0x0038 => Features.Prettify_0038(desc.Data),
- 0x003A => Features.Prettify_003A(desc.Data),
- 0x003B => Features.Prettify_003B(desc.Data),
- 0x0040 => Features.Prettify_0040(desc.Data),
- 0x0041 => Features.Prettify_0041(desc.Data),
- 0x0042 => Features.Prettify_0042(desc.Data),
- 0x0050 => Features.Prettify_0050(desc.Data),
- 0x0051 => Features.Prettify_0051(desc.Data),
- 0x0080 => Features.Prettify_0080(desc.Data),
- 0x0100 => Features.Prettify_0100(desc.Data),
- 0x0101 => Features.Prettify_0101(desc.Data),
- 0x0102 => Features.Prettify_0102(desc.Data),
- 0x0103 => Features.Prettify_0103(desc.Data),
- 0x0104 => Features.Prettify_0104(desc.Data),
- 0x0105 => Features.Prettify_0105(desc.Data),
- 0x0106 => Features.Prettify_0106(desc.Data),
- 0x0107 => Features.Prettify_0107(desc.Data),
- 0x0108 => Features.Prettify_0108(desc.Data),
- 0x0109 => Features.Prettify_0109(desc.Data),
- 0x010A => Features.Prettify_010A(desc.Data),
- 0x010B => Features.Prettify_010B(desc.Data),
- 0x010C => Features.Prettify_010C(desc.Data),
- 0x010D => Features.Prettify_010D(desc.Data),
- 0x010E => Features.Prettify_010E(desc.Data),
- 0x0110 => Features.Prettify_0110(desc.Data),
- 0x0113 => Features.Prettify_0113(desc.Data),
- 0x0142 => Features.Prettify_0142(desc.Data),
- _ => "Unknown feature"
- };
-
- MmcFeatures.Add(new ScsiPageModel
- {
- Page = featureNumber,
- Description = featureDescription
- });
- }
- else
- AaruConsole.DebugWriteLine("Device-Info command", "GET CONFIGURATION returned no feature descriptors");
- }
+ Page = featureNumber,
+ Description = featureDescription
+ });
+ }
+ else
+ AaruConsole.DebugWriteLine("Device-Info command", "GET CONFIGURATION returned no feature descriptors");
}
public byte[] InquiryData { get; }
diff --git a/Aaru.Images/Alcohol120/Write.cs b/Aaru.Images/Alcohol120/Write.cs
index e5bd2eac9..ff8e07bc6 100644
--- a/Aaru.Images/Alcohol120/Write.cs
+++ b/Aaru.Images/Alcohol120/Write.cs
@@ -563,11 +563,11 @@ public sealed partial class Alcohol120
extraCount += _writingTracks.Count(t => t.Session == i);
- if(i < sessions)
- {
- currentExtraOffset += Marshal.SizeOf