mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Added Apple OEM MODE page 30h.
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
2016-10-14 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* Modes.cs: Added Apple OEM MODE page 30h.
|
||||
|
||||
2016-10-14 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* EVPD.cs:
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace DiscImageChef.Decoders.SCSI
|
||||
{
|
||||
@@ -8080,6 +8081,32 @@ namespace DiscImageChef.Decoders.SCSI
|
||||
|
||||
#endregion HP Mode Page 0x3E: CD-ROM Emulation/Disaster Recovery Mode page
|
||||
|
||||
#region Apple Mode Page 0x30: Apple OEM String
|
||||
static readonly byte[] AppleOEMString = { 0x41, 0x50, 0x50, 0x4C, 0x45, 0x20, 0x43, 0x4F, 0x4D, 0x50, 0x55, 0x54, 0x45, 0x52, 0x2C, 0x20, 0x49, 0x4E, 0x43, 0x2E };
|
||||
|
||||
public static bool IsAppleModePage_30(byte[] pageResponse)
|
||||
{
|
||||
if(pageResponse == null)
|
||||
return false;
|
||||
|
||||
if((pageResponse[0] & 0x40) == 0x40)
|
||||
return false;
|
||||
|
||||
if((pageResponse[0] & 0x3F) != 0x30)
|
||||
return false;
|
||||
|
||||
if(pageResponse[1] + 2 != pageResponse.Length)
|
||||
return false;
|
||||
|
||||
if(pageResponse.Length != 30)
|
||||
return false;
|
||||
|
||||
byte[] str = new byte[20];
|
||||
Array.Copy(pageResponse, 10, str, 0, 20);
|
||||
|
||||
return AppleOEMString.SequenceEqual(str);
|
||||
}
|
||||
#endregion Apple Mode Page 0x30: Apple OEM String
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,8 @@
|
||||
2016-10-14 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* Commands/DeviceInfo.cs:
|
||||
Added Apple OEM MODE page 30h.
|
||||
|
||||
2016-10-14 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* Commands/DeviceInfo.cs:
|
||||
|
||||
@@ -730,6 +730,15 @@ namespace DiscImageChef.Commands
|
||||
else
|
||||
goto default;
|
||||
|
||||
break;
|
||||
}
|
||||
case 0x30:
|
||||
{
|
||||
if(Decoders.SCSI.Modes.IsAppleModePage_30(page.PageResponse))
|
||||
DicConsole.WriteLine("Drive identifies as Apple OEM drive");
|
||||
else
|
||||
goto default;
|
||||
|
||||
break;
|
||||
}
|
||||
case 0x3B:
|
||||
|
||||
Reference in New Issue
Block a user