mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Prevent decoding subpages on subpage 00h decoders.
This commit is contained in:
@@ -1,3 +1,8 @@
|
|||||||
|
2015-10-30 Natalia Portillo <claunia@claunia.com>
|
||||||
|
|
||||||
|
* SCSI/Modes.cs:
|
||||||
|
Prevent decoding subpages on subpage 00h decoders.
|
||||||
|
|
||||||
2015-10-30 Natalia Portillo <claunia@claunia.com>
|
2015-10-30 Natalia Portillo <claunia@claunia.com>
|
||||||
|
|
||||||
* SCSI/Modes.cs:
|
* SCSI/Modes.cs:
|
||||||
|
|||||||
@@ -1269,6 +1269,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
if (pageResponse == null)
|
if (pageResponse == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
if ((pageResponse[0] & 0x40) == 0x40)
|
||||||
|
return null;
|
||||||
|
|
||||||
if ((pageResponse[0] & 0x3F) != 0x0A)
|
if ((pageResponse[0] & 0x3F) != 0x0A)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@@ -1477,7 +1480,7 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Disconnect-reconnect page
|
/// Disconnect-reconnect page
|
||||||
/// Page code 0x02
|
/// Page code 0x02
|
||||||
/// 16 bytes in SCSI-2, SPC-1
|
/// 16 bytes in SCSI-2, SPC-1, SPC-2
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public struct ModePage_02
|
public struct ModePage_02
|
||||||
{
|
{
|
||||||
@@ -1537,6 +1540,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
if (pageResponse == null)
|
if (pageResponse == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
if ((pageResponse[0] & 0x40) == 0x40)
|
||||||
|
return null;
|
||||||
|
|
||||||
if ((pageResponse[0] & 0x3F) != 0x02)
|
if ((pageResponse[0] & 0x3F) != 0x02)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@@ -1676,6 +1682,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
if (pageResponse == null)
|
if (pageResponse == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
if ((pageResponse[0] & 0x40) == 0x40)
|
||||||
|
return null;
|
||||||
|
|
||||||
if ((pageResponse[0] & 0x3F) != 0x08)
|
if ((pageResponse[0] & 0x3F) != 0x08)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@@ -1897,6 +1906,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
if (pageResponse == null)
|
if (pageResponse == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
if ((pageResponse[0] & 0x40) == 0x40)
|
||||||
|
return null;
|
||||||
|
|
||||||
if ((pageResponse[0] & 0x3F) != 0x05)
|
if ((pageResponse[0] & 0x3F) != 0x05)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@@ -2177,6 +2189,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
if (pageResponse == null)
|
if (pageResponse == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
if ((pageResponse[0] & 0x40) == 0x40)
|
||||||
|
return null;
|
||||||
|
|
||||||
if ((pageResponse[0] & 0x3F) != 0x03)
|
if ((pageResponse[0] & 0x3F) != 0x03)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@@ -2271,6 +2286,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
if (pageResponse == null)
|
if (pageResponse == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
if ((pageResponse[0] & 0x40) == 0x40)
|
||||||
|
return null;
|
||||||
|
|
||||||
if ((pageResponse[0] & 0x3F) != 0x0B)
|
if ((pageResponse[0] & 0x3F) != 0x0B)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@@ -2395,6 +2413,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
if (pageResponse == null)
|
if (pageResponse == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
if ((pageResponse[0] & 0x40) == 0x40)
|
||||||
|
return null;
|
||||||
|
|
||||||
if ((pageResponse[0] & 0x3F) != 0x01)
|
if ((pageResponse[0] & 0x3F) != 0x01)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@@ -2530,6 +2551,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
if (pageResponse == null)
|
if (pageResponse == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
if ((pageResponse[0] & 0x40) == 0x40)
|
||||||
|
return null;
|
||||||
|
|
||||||
if ((pageResponse[0] & 0x3F) != 0x04)
|
if ((pageResponse[0] & 0x3F) != 0x04)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@@ -2654,6 +2678,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
if (pageResponse == null)
|
if (pageResponse == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
if ((pageResponse[0] & 0x40) == 0x40)
|
||||||
|
return null;
|
||||||
|
|
||||||
if ((pageResponse[0] & 0x3F) != 0x07)
|
if ((pageResponse[0] & 0x3F) != 0x07)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@@ -2812,6 +2839,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
if (pageResponse == null)
|
if (pageResponse == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
if ((pageResponse[0] & 0x40) == 0x40)
|
||||||
|
return null;
|
||||||
|
|
||||||
if ((pageResponse[0] & 0x3F) != 0x10)
|
if ((pageResponse[0] & 0x3F) != 0x10)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@@ -3023,6 +3053,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
if (pageResponse == null)
|
if (pageResponse == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
if ((pageResponse[0] & 0x40) == 0x40)
|
||||||
|
return null;
|
||||||
|
|
||||||
if ((pageResponse[0] & 0x3F) != 0x0E)
|
if ((pageResponse[0] & 0x3F) != 0x0E)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@@ -3226,6 +3259,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
if (pageResponse == null)
|
if (pageResponse == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
if ((pageResponse[0] & 0x40) == 0x40)
|
||||||
|
return null;
|
||||||
|
|
||||||
if ((pageResponse[0] & 0x3F) != 0x0D)
|
if ((pageResponse[0] & 0x3F) != 0x0D)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@@ -3350,6 +3386,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
if (pageResponse == null)
|
if (pageResponse == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
if ((pageResponse[0] & 0x40) == 0x40)
|
||||||
|
return null;
|
||||||
|
|
||||||
if ((pageResponse[0] & 0x3F) != 0x01)
|
if ((pageResponse[0] & 0x3F) != 0x01)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@@ -3495,6 +3534,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
if (pageResponse == null)
|
if (pageResponse == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
if ((pageResponse[0] & 0x40) == 0x40)
|
||||||
|
return null;
|
||||||
|
|
||||||
if ((pageResponse[0] & 0x3F) != 0x07)
|
if ((pageResponse[0] & 0x3F) != 0x07)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@@ -3636,6 +3678,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
if (pageResponse == null)
|
if (pageResponse == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
if ((pageResponse[0] & 0x40) == 0x40)
|
||||||
|
return null;
|
||||||
|
|
||||||
if ((pageResponse[0] & 0x3F) != 0x06)
|
if ((pageResponse[0] & 0x3F) != 0x06)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@@ -3800,6 +3845,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
if (pageResponse == null)
|
if (pageResponse == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
if ((pageResponse[0] & 0x40) == 0x40)
|
||||||
|
return null;
|
||||||
|
|
||||||
if ((pageResponse[0] & 0x3F) != 0x2A)
|
if ((pageResponse[0] & 0x3F) != 0x2A)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@@ -4000,7 +4048,7 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Informational exceptions control page
|
/// Informational exceptions control page
|
||||||
/// Page code 0x1C
|
/// Page code 0x1C
|
||||||
/// 12 bytes in SPC-1
|
/// 12 bytes in SPC-1, SPC-2
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public struct ModePage_1C
|
public struct ModePage_1C
|
||||||
{
|
{
|
||||||
@@ -4036,6 +4084,15 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
/// How many times to report informational exceptions
|
/// How many times to report informational exceptions
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public uint ReportCount;
|
public uint ReportCount;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Enable background functions
|
||||||
|
/// </summary>
|
||||||
|
public bool EBF;
|
||||||
|
/// <summary>
|
||||||
|
/// Warning reporting enabled
|
||||||
|
/// </summary>
|
||||||
|
public bool EWasc;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ModePage_1C? DecodeModePage_1C(byte[] pageResponse)
|
public static ModePage_1C? DecodeModePage_1C(byte[] pageResponse)
|
||||||
@@ -4043,6 +4100,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
if (pageResponse == null)
|
if (pageResponse == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
if ((pageResponse[0] & 0x40) == 0x40)
|
||||||
|
return null;
|
||||||
|
|
||||||
if ((pageResponse[0] & 0x3F) != 0x1C)
|
if ((pageResponse[0] & 0x3F) != 0x1C)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
@@ -4066,6 +4126,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
decoded.IntervalTimer = (uint)((pageResponse[4] << 24) + (pageResponse[5] << 16) + (pageResponse[6] << 8) + pageResponse[7]);
|
decoded.IntervalTimer = (uint)((pageResponse[4] << 24) + (pageResponse[5] << 16) + (pageResponse[6] << 8) + pageResponse[7]);
|
||||||
decoded.ReportCount = (uint)((pageResponse[8] << 24) + (pageResponse[9] << 16) + (pageResponse[10] << 8) + pageResponse[11]);
|
decoded.ReportCount = (uint)((pageResponse[8] << 24) + (pageResponse[9] << 16) + (pageResponse[10] << 8) + pageResponse[11]);
|
||||||
|
|
||||||
|
decoded.EBF |= (pageResponse[2] & 0x20) == 0x20;
|
||||||
|
decoded.EWasc |= (pageResponse[2] & 0x10) == 0x10;
|
||||||
|
|
||||||
return decoded;
|
return decoded;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4140,6 +4203,11 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
sb.AppendFormat("\tInformational exception conditions will be reported a maximum of {0} times", page.ReportCount);
|
sb.AppendFormat("\tInformational exception conditions will be reported a maximum of {0} times", page.ReportCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (page.EWasc)
|
||||||
|
sb.AppendLine("\tWarning reporting is enabled");
|
||||||
|
if (page.EBF)
|
||||||
|
sb.AppendLine("\tBackground functions are enabled");
|
||||||
|
|
||||||
return sb.ToString();
|
return sb.ToString();
|
||||||
}
|
}
|
||||||
#endregion Mode Page 0x1C: Informational exceptions control page
|
#endregion Mode Page 0x1C: Informational exceptions control page
|
||||||
@@ -4148,7 +4216,7 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Power condition page
|
/// Power condition page
|
||||||
/// Page code 0x1A
|
/// Page code 0x1A
|
||||||
/// 12 bytes in SPC-1
|
/// 12 bytes in SPC-1, SPC-2
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public struct ModePage_1A
|
public struct ModePage_1A
|
||||||
{
|
{
|
||||||
@@ -4179,6 +4247,9 @@ namespace DiscImageChef.Decoders.SCSI
|
|||||||
if (pageResponse == null)
|
if (pageResponse == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
if ((pageResponse[0] & 0x40) == 0x40)
|
||||||
|
return null;
|
||||||
|
|
||||||
if ((pageResponse[0] & 0x3F) != 0x1A)
|
if ((pageResponse[0] & 0x3F) != 0x1A)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user