mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
REFACTOR: Replace if statement with null-propagating code.
This commit is contained in:
@@ -124,11 +124,9 @@ namespace DiscImageChef.Core.Logging
|
|||||||
|
|
||||||
public void Close()
|
public void Close()
|
||||||
{
|
{
|
||||||
if(logSw == null) return;
|
logSw?.WriteLine("######################################################");
|
||||||
|
logSw?.WriteLine("End logging at {0}", DateTime.Now);
|
||||||
logSw.WriteLine("######################################################");
|
logSw?.Close();
|
||||||
logSw.WriteLine("End logging at {0}", DateTime.Now);
|
|
||||||
logSw.Close();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -68,11 +68,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static ModePage_00_SFF? DecodeModePage_00_SFF(byte[] pageResponse)
|
public static ModePage_00_SFF? DecodeModePage_00_SFF(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x00) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x00) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -113,11 +113,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static ModePage_01? DecodeModePage_01(byte[] pageResponse)
|
public static ModePage_01? DecodeModePage_01(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x01) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x01) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -69,11 +69,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static ModePage_01_MMC? DecodeModePage_01_MMC(byte[] pageResponse)
|
public static ModePage_01_MMC? DecodeModePage_01_MMC(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x01) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x01) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -97,11 +97,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static ModePage_02? DecodeModePage_02(byte[] pageResponse)
|
public static ModePage_02? DecodeModePage_02(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x02) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x02) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -105,11 +105,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static ModePage_03? DecodeModePage_03(byte[] pageResponse)
|
public static ModePage_03? DecodeModePage_03(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x03) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x03) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -88,11 +88,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static ModePage_04? DecodeModePage_04(byte[] pageResponse)
|
public static ModePage_04? DecodeModePage_04(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x04) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x04) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -153,11 +153,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static ModePage_05? DecodeModePage_05(byte[] pageResponse)
|
public static ModePage_05? DecodeModePage_05(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x05) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x05) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -56,11 +56,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static ModePage_06? DecodeModePage_06(byte[] pageResponse)
|
public static ModePage_06? DecodeModePage_06(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x06) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x06) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -80,11 +80,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static ModePage_07? DecodeModePage_07(byte[] pageResponse)
|
public static ModePage_07? DecodeModePage_07(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x07) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x07) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -60,11 +60,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static ModePage_07_MMC? DecodeModePage_07_MMC(byte[] pageResponse)
|
public static ModePage_07_MMC? DecodeModePage_07_MMC(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x07) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x07) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -136,11 +136,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static ModePage_08? DecodeModePage_08(byte[] pageResponse)
|
public static ModePage_08? DecodeModePage_08(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x08) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x08) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -161,11 +161,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static ModePage_0A? DecodeModePage_0A(byte[] pageResponse)
|
public static ModePage_0A? DecodeModePage_0A(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x0A) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x0A) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -56,11 +56,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static ModePage_0B? DecodeModePage_0B(byte[] pageResponse)
|
public static ModePage_0B? DecodeModePage_0B(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x0B) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x0B) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -64,11 +64,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static ModePage_0D? DecodeModePage_0D(byte[] pageResponse)
|
public static ModePage_0D? DecodeModePage_0D(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x0D) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x0D) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -104,11 +104,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static ModePage_0E? DecodeModePage_0E(byte[] pageResponse)
|
public static ModePage_0E? DecodeModePage_0E(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x0E) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x0E) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -76,11 +76,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static ModePage_0F? DecodeModePage_0F(byte[] pageResponse)
|
public static ModePage_0F? DecodeModePage_0F(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x0F) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x0F) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -72,11 +72,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static ModePage_10? DecodeModePage_10(byte[] pageResponse)
|
public static ModePage_10? DecodeModePage_10(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x10) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x10) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -162,11 +162,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static ModePage_10_SSC? DecodeModePage_10_SSC(byte[] pageResponse)
|
public static ModePage_10_SSC? DecodeModePage_10_SSC(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x10) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x10) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -128,11 +128,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static ModePage_11? DecodeModePage_11(byte[] pageResponse)
|
public static ModePage_11? DecodeModePage_11(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x11) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x11) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -101,11 +101,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static ModePage_1A? DecodeModePage_1A(byte[] pageResponse)
|
public static ModePage_1A? DecodeModePage_1A(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x1A) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x1A) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -72,11 +72,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static ModePage_1B? DecodeModePage_1B(byte[] pageResponse)
|
public static ModePage_1B? DecodeModePage_1B(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x1B) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x1B) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -94,11 +94,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static ModePage_1C? DecodeModePage_1C(byte[] pageResponse)
|
public static ModePage_1C? DecodeModePage_1C(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x1C) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x1C) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -64,11 +64,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static ModePage_1C_SFF? DecodeModePage_1C_SFF(byte[] pageResponse)
|
public static ModePage_1C_SFF? DecodeModePage_1C_SFF(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x1C) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x1C) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -50,11 +50,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static ModePage_1D? DecodeModePage_1D(byte[] pageResponse)
|
public static ModePage_1D? DecodeModePage_1D(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x1D) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x1D) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -55,11 +55,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static Certance_ModePage_21? DecodeCertanceModePage_21(byte[] pageResponse)
|
public static Certance_ModePage_21? DecodeCertanceModePage_21(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x21) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x21) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -58,11 +58,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static Certance_ModePage_22? DecodeCertanceModePage_22(byte[] pageResponse)
|
public static Certance_ModePage_22? DecodeCertanceModePage_22(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x22) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x22) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -51,11 +51,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static IBM_ModePage_24? DecodeIBMModePage_24(byte[] pageResponse)
|
public static IBM_ModePage_24? DecodeIBMModePage_24(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x24) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x24) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -186,11 +186,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static ModePage_2A? DecodeModePage_2A(byte[] pageResponse)
|
public static ModePage_2A? DecodeModePage_2A(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x2A) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x2A) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -58,11 +58,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static IBM_ModePage_2F? DecodeIBMModePage_2F(byte[] pageResponse)
|
public static IBM_ModePage_2F? DecodeIBMModePage_2F(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x2F) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x2F) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -46,11 +46,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static bool IsAppleModePage_30(byte[] pageResponse)
|
public static bool IsAppleModePage_30(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return false;
|
if((pageResponse?[0] & 0x40) == 0x40) return false;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return false;
|
if((pageResponse?[0] & 0x3F) != 0x30) return false;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x30) return false;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return false;
|
if(pageResponse[1] + 2 != pageResponse.Length) return false;
|
||||||
|
|
||||||
|
|||||||
@@ -50,11 +50,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static HP_ModePage_3B? DecodeHPModePage_3B(byte[] pageResponse)
|
public static HP_ModePage_3B? DecodeHPModePage_3B(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x3B) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x3B) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -60,11 +60,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static HP_ModePage_3C? DecodeHPModePage_3C(byte[] pageResponse)
|
public static HP_ModePage_3C? DecodeHPModePage_3C(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x3C) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x3C) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -48,11 +48,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static HP_ModePage_3D? DecodeHPModePage_3D(byte[] pageResponse)
|
public static HP_ModePage_3D? DecodeHPModePage_3D(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x3D) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x3D) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -48,11 +48,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static IBM_ModePage_3D? DecodeIBMModePage_3D(byte[] pageResponse)
|
public static IBM_ModePage_3D? DecodeIBMModePage_3D(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x3D) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x3D) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -84,11 +84,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static Fujitsu_ModePage_3E? DecodeFujitsuModePage_3E(byte[] pageResponse)
|
public static Fujitsu_ModePage_3E? DecodeFujitsuModePage_3E(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x3E) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x3E) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -49,11 +49,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
|
|
||||||
public static HP_ModePage_3E? DecodeHPModePage_3E(byte[] pageResponse)
|
public static HP_ModePage_3E? DecodeHPModePage_3E(byte[] pageResponse)
|
||||||
{
|
{
|
||||||
if(pageResponse == null) return null;
|
if((pageResponse?[0] & 0x40) == 0x40) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x40) == 0x40) return null;
|
if((pageResponse?[0] & 0x3F) != 0x3E) return null;
|
||||||
|
|
||||||
if((pageResponse[0] & 0x3F) != 0x3E) return null;
|
|
||||||
|
|
||||||
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
if(pageResponse[1] + 2 != pageResponse.Length) return null;
|
||||||
|
|
||||||
|
|||||||
@@ -359,14 +359,12 @@ namespace DiscImageChef.DiscImages
|
|||||||
if(rsrcFork.ContainsKey(0x434B534D))
|
if(rsrcFork.ContainsKey(0x434B534D))
|
||||||
{
|
{
|
||||||
Resource cksmRsrc = rsrcFork.GetResource(0x434B534D);
|
Resource cksmRsrc = rsrcFork.GetResource(0x434B534D);
|
||||||
if(cksmRsrc != null)
|
if(cksmRsrc?.ContainsId(1) == true)
|
||||||
{
|
|
||||||
if(cksmRsrc.ContainsId(1))
|
|
||||||
{
|
{
|
||||||
byte[] tagChk = cksmRsrc.GetResource(1);
|
byte[] tagChk = cksmRsrc.GetResource(1);
|
||||||
tagChecksum = BigEndianBitConverter.ToUInt32(tagChk, 0);
|
tagChecksum = BigEndianBitConverter.ToUInt32(tagChk, 0);
|
||||||
}
|
}
|
||||||
if(cksmRsrc.ContainsId(2))
|
if(cksmRsrc?.ContainsId(2) == true)
|
||||||
{
|
{
|
||||||
byte[] dataChk = cksmRsrc.GetResource(1);
|
byte[] dataChk = cksmRsrc.GetResource(1);
|
||||||
dataChecksum = BigEndianBitConverter.ToUInt32(dataChk, 0);
|
dataChecksum = BigEndianBitConverter.ToUInt32(dataChk, 0);
|
||||||
@@ -374,7 +372,6 @@ namespace DiscImageChef.DiscImages
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
catch(InvalidCastException) { }
|
catch(InvalidCastException) { }
|
||||||
|
|
||||||
DicConsole.DebugWriteLine("DART plugin", "Image application = {0} version {1}", ImageInfo.ImageApplication,
|
DicConsole.DebugWriteLine("DART plugin", "Image application = {0} version {1}", ImageInfo.ImageApplication,
|
||||||
|
|||||||
@@ -212,10 +212,9 @@ namespace DiscImageChef.Filters
|
|||||||
|
|
||||||
public override string GetFilename()
|
public override string GetFilename()
|
||||||
{
|
{
|
||||||
if(basePath == null) return null;
|
if(basePath?.EndsWith(".bz2", StringComparison.InvariantCultureIgnoreCase) == true)
|
||||||
if(basePath.EndsWith(".bz2", StringComparison.InvariantCultureIgnoreCase))
|
|
||||||
return basePath.Substring(0, basePath.Length - 4);
|
return basePath.Substring(0, basePath.Length - 4);
|
||||||
if(basePath.EndsWith(".bzip2", StringComparison.InvariantCultureIgnoreCase))
|
if(basePath?.EndsWith(".bzip2", StringComparison.InvariantCultureIgnoreCase) == true)
|
||||||
return basePath.Substring(0, basePath.Length - 6);
|
return basePath.Substring(0, basePath.Length - 6);
|
||||||
|
|
||||||
return basePath;
|
return basePath;
|
||||||
|
|||||||
@@ -221,10 +221,9 @@ namespace DiscImageChef.Filters
|
|||||||
|
|
||||||
public override string GetFilename()
|
public override string GetFilename()
|
||||||
{
|
{
|
||||||
if(basePath == null) return null;
|
if(basePath?.EndsWith(".gz", StringComparison.InvariantCultureIgnoreCase) == true)
|
||||||
if(basePath.EndsWith(".gz", StringComparison.InvariantCultureIgnoreCase))
|
|
||||||
return basePath.Substring(0, basePath.Length - 3);
|
return basePath.Substring(0, basePath.Length - 3);
|
||||||
if(basePath.EndsWith(".gzip", StringComparison.InvariantCultureIgnoreCase))
|
if(basePath?.EndsWith(".gzip", StringComparison.InvariantCultureIgnoreCase) == true)
|
||||||
return basePath.Substring(0, basePath.Length - 5);
|
return basePath.Substring(0, basePath.Length - 5);
|
||||||
|
|
||||||
return basePath;
|
return basePath;
|
||||||
|
|||||||
@@ -195,10 +195,9 @@ namespace DiscImageChef.Filters
|
|||||||
|
|
||||||
public override string GetFilename()
|
public override string GetFilename()
|
||||||
{
|
{
|
||||||
if(basePath == null) return null;
|
if(basePath?.EndsWith(".lz", StringComparison.InvariantCultureIgnoreCase) == true)
|
||||||
if(basePath.EndsWith(".lz", StringComparison.InvariantCultureIgnoreCase))
|
|
||||||
return basePath.Substring(0, basePath.Length - 3);
|
return basePath.Substring(0, basePath.Length - 3);
|
||||||
if(basePath.EndsWith(".lzip", StringComparison.InvariantCultureIgnoreCase))
|
if(basePath?.EndsWith(".lzip", StringComparison.InvariantCultureIgnoreCase) == true)
|
||||||
return basePath.Substring(0, basePath.Length - 5);
|
return basePath.Substring(0, basePath.Length - 5);
|
||||||
|
|
||||||
return basePath;
|
return basePath;
|
||||||
|
|||||||
@@ -237,10 +237,9 @@ namespace DiscImageChef.Filters
|
|||||||
|
|
||||||
public override string GetFilename()
|
public override string GetFilename()
|
||||||
{
|
{
|
||||||
if(basePath == null) return null;
|
if(basePath?.EndsWith(".xz", StringComparison.InvariantCultureIgnoreCase) == true)
|
||||||
if(basePath.EndsWith(".xz", StringComparison.InvariantCultureIgnoreCase))
|
|
||||||
return basePath.Substring(0, basePath.Length - 3);
|
return basePath.Substring(0, basePath.Length - 3);
|
||||||
if(basePath.EndsWith(".xzip", StringComparison.InvariantCultureIgnoreCase))
|
if(basePath?.EndsWith(".xzip", StringComparison.InvariantCultureIgnoreCase) == true)
|
||||||
return basePath.Substring(0, basePath.Length - 5);
|
return basePath.Substring(0, basePath.Length - 5);
|
||||||
|
|
||||||
return basePath;
|
return basePath;
|
||||||
|
|||||||
Reference in New Issue
Block a user