mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Code cleanup.
This commit is contained in:
@@ -841,17 +841,14 @@ namespace Aaru.Decoders.ATA
|
||||
if(ATAID.Capabilities.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.CapabilitiesBit.LBASupport))
|
||||
if(((ulong)ATAID.LBASectors * logicalsectorsize) / 1024 / 1024 > 1000000)
|
||||
sb.AppendFormat("Device size in 28-bit LBA mode: {0} bytes, {1} Tb, {2} TiB",
|
||||
(ulong)ATAID.LBASectors *
|
||||
logicalsectorsize,
|
||||
(ulong)ATAID.LBASectors * logicalsectorsize,
|
||||
((ulong)ATAID.LBASectors * logicalsectorsize) / 1000 / 1000 / 1000 / 1000,
|
||||
((ulong)ATAID.LBASectors * 512) / 1024 / 1024 / 1024 / 1024).
|
||||
AppendLine();
|
||||
((ulong)ATAID.LBASectors * 512) / 1024 / 1024 / 1024 / 1024).AppendLine();
|
||||
else if(((ulong)ATAID.LBASectors * logicalsectorsize) / 1024 / 1024 > 1000)
|
||||
sb.AppendFormat("Device size in 28-bit LBA mode: {0} bytes, {1} Gb, {2} GiB",
|
||||
(ulong)ATAID.LBASectors * logicalsectorsize,
|
||||
(ulong)ATAID.LBASectors * logicalsectorsize,
|
||||
((ulong)ATAID.LBASectors * logicalsectorsize) / 1000 / 1000 / 1000,
|
||||
((ulong)ATAID.LBASectors * 512) / 1024 / 1024 / 1024).
|
||||
AppendLine();
|
||||
((ulong)ATAID.LBASectors * 512) / 1024 / 1024 / 1024).AppendLine();
|
||||
else
|
||||
sb.AppendFormat("Device size in 28-bit LBA mode: {0} bytes, {1} Mb, {2} MiB",
|
||||
(ulong)ATAID.LBASectors * logicalsectorsize,
|
||||
@@ -862,15 +859,13 @@ namespace Aaru.Decoders.ATA
|
||||
if(ATAID.CommandSet5.HasFlag(CommonTypes.Structs.Devices.ATA.Identify.CommandSetBit5.ExtSectors))
|
||||
if((ATAID.ExtendedUserSectors * logicalsectorsize) / 1024 / 1024 > 1000000)
|
||||
sb.AppendFormat("Device size in 48-bit LBA mode: {0} bytes, {1} Tb, {2} TiB",
|
||||
ATAID.ExtendedUserSectors *
|
||||
logicalsectorsize,
|
||||
ATAID.ExtendedUserSectors * logicalsectorsize,
|
||||
(ATAID.ExtendedUserSectors * logicalsectorsize) / 1000 / 1000 / 1000 / 1000,
|
||||
(ATAID.ExtendedUserSectors * logicalsectorsize) / 1024 / 1024 / 1024 /
|
||||
1024).AppendLine();
|
||||
else if((ATAID.ExtendedUserSectors * logicalsectorsize) / 1024 / 1024 > 1000)
|
||||
sb.AppendFormat("Device size in 48-bit LBA mode: {0} bytes, {1} Gb, {2} GiB",
|
||||
ATAID.ExtendedUserSectors *
|
||||
logicalsectorsize,
|
||||
ATAID.ExtendedUserSectors * logicalsectorsize,
|
||||
(ATAID.ExtendedUserSectors * logicalsectorsize) / 1000 / 1000 / 1000,
|
||||
(ATAID.ExtendedUserSectors * logicalsectorsize) / 1024 / 1024 / 1024).
|
||||
AppendLine();
|
||||
@@ -883,8 +878,7 @@ namespace Aaru.Decoders.ATA
|
||||
{
|
||||
if((ATAID.LBA48Sectors * logicalsectorsize) / 1024 / 1024 > 1000000)
|
||||
sb.AppendFormat("Device size in 48-bit LBA mode: {0} bytes, {1} Tb, {2} TiB",
|
||||
ATAID.LBA48Sectors *
|
||||
logicalsectorsize,
|
||||
ATAID.LBA48Sectors * logicalsectorsize,
|
||||
(ATAID.LBA48Sectors * logicalsectorsize) / 1000 / 1000 / 1000 / 1000,
|
||||
(ATAID.LBA48Sectors * logicalsectorsize) / 1024 / 1024 / 1024 / 1024).
|
||||
AppendLine();
|
||||
|
||||
@@ -83,8 +83,10 @@ namespace Aaru.Decoders.Bluray
|
||||
|
||||
var decoded = new BurstCuttingArea
|
||||
{
|
||||
DataLength = BigEndianBitConverter.ToUInt16(BCAResponse, 0), Reserved1 = BCAResponse[2],
|
||||
Reserved2 = BCAResponse[3], BCA = new byte[64]
|
||||
DataLength = BigEndianBitConverter.ToUInt16(BCAResponse, 0),
|
||||
Reserved1 = BCAResponse[2],
|
||||
Reserved2 = BCAResponse[3],
|
||||
BCA = new byte[64]
|
||||
};
|
||||
|
||||
Array.Copy(BCAResponse, 4, decoded.BCA, 0, 64);
|
||||
|
||||
@@ -99,19 +99,17 @@ namespace Aaru.Decoders.Bluray
|
||||
|
||||
var decoded = new CartridgeStatus
|
||||
{
|
||||
DataLength = BigEndianBitConverter.ToUInt16(CSResponse, 0), Reserved1 = CSResponse[2],
|
||||
DataLength = BigEndianBitConverter.ToUInt16(CSResponse, 0),
|
||||
Reserved1 = CSResponse[2],
|
||||
Reserved2 = CSResponse[3],
|
||||
Cartridge = Convert.ToBoolean(CSResponse[4] & 0x80),
|
||||
OUT =
|
||||
Convert.ToBoolean(CSResponse[4] & 0x40),
|
||||
Reserved3 = (byte)((CSResponse[4] & 0x38) >> 3),
|
||||
CWP =
|
||||
Convert.ToBoolean(CSResponse[4] & 0x04),
|
||||
Reserved4 = (byte)(CSResponse[4] & 0x03),
|
||||
Reserved5 = CSResponse[5],
|
||||
Reserved6 =
|
||||
CSResponse[6],
|
||||
Reserved7 = CSResponse[7]
|
||||
OUT = Convert.ToBoolean(CSResponse[4] & 0x40),
|
||||
Reserved3 = (byte)((CSResponse[4] & 0x38) >> 3),
|
||||
CWP = Convert.ToBoolean(CSResponse[4] & 0x04),
|
||||
Reserved4 = (byte)(CSResponse[4] & 0x03),
|
||||
Reserved5 = CSResponse[5],
|
||||
Reserved6 = CSResponse[6],
|
||||
Reserved7 = CSResponse[7]
|
||||
};
|
||||
|
||||
return decoded;
|
||||
|
||||
@@ -123,7 +123,8 @@ namespace Aaru.Decoders.Bluray
|
||||
|
||||
var decoded = new DiscDefinitionStructure
|
||||
{
|
||||
DataLength = BigEndianBitConverter.ToUInt16(DDSResponse, 0), Reserved1 = DDSResponse[2],
|
||||
DataLength = BigEndianBitConverter.ToUInt16(DDSResponse, 0),
|
||||
Reserved1 = DDSResponse[2],
|
||||
Reserved2 = DDSResponse[3],
|
||||
Signature = BigEndianBitConverter.ToUInt16(DDSResponse, 4)
|
||||
};
|
||||
|
||||
@@ -109,7 +109,8 @@ namespace Aaru.Decoders.Bluray
|
||||
|
||||
var decoded = new DiscInformation
|
||||
{
|
||||
DataLength = BigEndianBitConverter.ToUInt16(DIResponse, 0), Reserved1 = DIResponse[2],
|
||||
DataLength = BigEndianBitConverter.ToUInt16(DIResponse, 0),
|
||||
Reserved1 = DIResponse[2],
|
||||
Reserved2 = DIResponse[3]
|
||||
};
|
||||
|
||||
|
||||
@@ -87,7 +87,8 @@ namespace Aaru.Decoders.Bluray
|
||||
|
||||
var decoded = new SpareAreaInformation
|
||||
{
|
||||
DataLength = BigEndianBitConverter.ToUInt16(SAIResponse, 0), Reserved1 = SAIResponse[2],
|
||||
DataLength = BigEndianBitConverter.ToUInt16(SAIResponse, 0),
|
||||
Reserved1 = SAIResponse[2],
|
||||
Reserved2 = SAIResponse[3],
|
||||
Reserved3 = BigEndianBitConverter.ToUInt32(SAIResponse, 4),
|
||||
FreeSpareBlocks = BigEndianBitConverter.ToUInt32(SAIResponse, 8),
|
||||
|
||||
@@ -98,7 +98,8 @@ namespace Aaru.Decoders.CD
|
||||
|
||||
var decoded = new CDText
|
||||
{
|
||||
DataLength = BigEndianBitConverter.ToUInt16(CDTextResponse, 0), Reserved1 = CDTextResponse[2],
|
||||
DataLength = BigEndianBitConverter.ToUInt16(CDTextResponse, 0),
|
||||
Reserved1 = CDTextResponse[2],
|
||||
Reserved2 = CDTextResponse[3]
|
||||
};
|
||||
|
||||
|
||||
@@ -71,7 +71,8 @@ namespace Aaru.Decoders.CD
|
||||
var decoded = new CDFullTOC
|
||||
{
|
||||
DataLength = BigEndianBitConverter.ToUInt16(CDFullTOCResponse, 0),
|
||||
FirstCompleteSession = CDFullTOCResponse[2], LastCompleteSession = CDFullTOCResponse[3]
|
||||
FirstCompleteSession = CDFullTOCResponse[2],
|
||||
LastCompleteSession = CDFullTOCResponse[3]
|
||||
};
|
||||
|
||||
decoded.TrackDescriptors = new TrackDataDescriptor[(decoded.DataLength - 2) / 11];
|
||||
|
||||
@@ -61,7 +61,8 @@ namespace Aaru.Decoders.CD
|
||||
|
||||
var decoded = new CDPMA
|
||||
{
|
||||
DataLength = BigEndianBitConverter.ToUInt16(CDPMAResponse, 0), Reserved1 = CDPMAResponse[2],
|
||||
DataLength = BigEndianBitConverter.ToUInt16(CDPMAResponse, 0),
|
||||
Reserved1 = CDPMAResponse[2],
|
||||
Reserved2 = CDPMAResponse[3]
|
||||
};
|
||||
|
||||
|
||||
@@ -61,7 +61,8 @@ namespace Aaru.Decoders.CD
|
||||
var decoded = new CDSessionInfo
|
||||
{
|
||||
DataLength = BigEndianBitConverter.ToUInt16(CDSessionInfoResponse, 0),
|
||||
FirstCompleteSession = CDSessionInfoResponse[2], LastCompleteSession = CDSessionInfoResponse[3]
|
||||
FirstCompleteSession = CDSessionInfoResponse[2],
|
||||
LastCompleteSession = CDSessionInfoResponse[3]
|
||||
};
|
||||
|
||||
decoded.TrackDescriptors = new TrackDataDescriptor[(decoded.DataLength - 2) / 8];
|
||||
|
||||
@@ -63,7 +63,8 @@ namespace Aaru.Decoders.CD
|
||||
|
||||
var decoded = new CDTOC
|
||||
{
|
||||
DataLength = BigEndianBitConverter.ToUInt16(CDTOCResponse, 0), FirstTrack = CDTOCResponse[2],
|
||||
DataLength = BigEndianBitConverter.ToUInt16(CDTOCResponse, 0),
|
||||
FirstTrack = CDTOCResponse[2],
|
||||
LastTrack = CDTOCResponse[3]
|
||||
};
|
||||
|
||||
|
||||
@@ -60,10 +60,13 @@ namespace Aaru.Decoders.DVD
|
||||
|
||||
return new LeadInCopyright
|
||||
{
|
||||
DataLength = (ushort)((response[0] << 8) + response[1]), Reserved1 = response[2],
|
||||
Reserved2 = response[3], CopyrightType = (CopyrightType)response[4],
|
||||
DataLength = (ushort)((response[0] << 8) + response[1]),
|
||||
Reserved1 = response[2],
|
||||
Reserved2 = response[3],
|
||||
CopyrightType = (CopyrightType)response[4],
|
||||
RegionInformation = response[5],
|
||||
Reserved3 = response[6], Reserved4 = response[7]
|
||||
Reserved3 = response[6],
|
||||
Reserved4 = response[7]
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -60,14 +60,18 @@ namespace Aaru.Decoders.DVD
|
||||
|
||||
return new MediumStatus
|
||||
{
|
||||
DataLength = (ushort)((response[0] << 8) + response[1]), Reserved1 = response[2],
|
||||
Reserved2 = response[3], Cartridge = (response[4] & 0x80) == 0x80,
|
||||
OUT = (response[4] & 0x40) == 0x40,
|
||||
Reserved3 = (byte)((response[4] & 0x30) >> 4), MSWI = (response[4] & 0x08) == 0x08,
|
||||
CWP = (response[4] & 0x04) == 0x04,
|
||||
PWP = (response[4] & 0x02) == 0x02,
|
||||
Reserved4 = (response[4] & 0x01) == 0x01,
|
||||
DiscType = response[5], Reserved5 = response[6],
|
||||
DataLength = (ushort)((response[0] << 8) + response[1]),
|
||||
Reserved1 = response[2],
|
||||
Reserved2 = response[3],
|
||||
Cartridge = (response[4] & 0x80) == 0x80,
|
||||
OUT = (response[4] & 0x40) == 0x40,
|
||||
Reserved3 = (byte)((response[4] & 0x30) >> 4),
|
||||
MSWI = (response[4] & 0x08) == 0x08,
|
||||
CWP = (response[4] & 0x04) == 0x04,
|
||||
PWP = (response[4] & 0x02) == 0x02,
|
||||
Reserved4 = (response[4] & 0x01) == 0x01,
|
||||
DiscType = response[5],
|
||||
Reserved5 = response[6],
|
||||
RAMSWI = response[7]
|
||||
};
|
||||
}
|
||||
|
||||
@@ -59,7 +59,8 @@ namespace Aaru.Decoders.DVD
|
||||
|
||||
return new SpareAreaInformation
|
||||
{
|
||||
DataLength = (ushort)((response[0] << 8) + response[1]), Reserved1 = response[2],
|
||||
DataLength = (ushort)((response[0] << 8) + response[1]),
|
||||
Reserved1 = response[2],
|
||||
Reserved2 = response[3],
|
||||
UnusedPrimaryBlocks =
|
||||
(uint)((response[4] << 24) + (response[5] << 16) + (response[6] << 8) + response[7]),
|
||||
|
||||
@@ -532,7 +532,8 @@ namespace Aaru.Decoders.Floppy
|
||||
|
||||
var track = new RawTrack
|
||||
{
|
||||
gap = gaps.ToArray(), sectors = sectors.ToArray()
|
||||
gap = gaps.ToArray(),
|
||||
sectors = sectors.ToArray()
|
||||
};
|
||||
|
||||
endOffset = position;
|
||||
|
||||
@@ -167,9 +167,11 @@ namespace Aaru.Decoders.Floppy
|
||||
{
|
||||
data[position], data[position + 1], data[position + 2]
|
||||
},
|
||||
track = data[position + 3], sector = data[position + 4],
|
||||
side = data[position + 5],
|
||||
format = (AppleEncodedFormat)data[position + 6], checksum = data[position + 7],
|
||||
track = data[position + 3],
|
||||
sector = data[position + 4],
|
||||
side = data[position + 5],
|
||||
format = (AppleEncodedFormat)data[position + 6],
|
||||
checksum = data[position + 7],
|
||||
epilogue = new[]
|
||||
{
|
||||
data[position + 8], data[position + 9]
|
||||
@@ -378,7 +380,8 @@ namespace Aaru.Decoders.Floppy
|
||||
|
||||
var track = new RawTrack
|
||||
{
|
||||
gap = gaps.ToArray(), sectors = sectors.ToArray()
|
||||
gap = gaps.ToArray(),
|
||||
sectors = sectors.ToArray()
|
||||
};
|
||||
|
||||
endOffset = position;
|
||||
|
||||
71
LisaTag.cs
71
LisaTag.cs
@@ -47,8 +47,10 @@ namespace Aaru.Decoders
|
||||
|
||||
var snTag = new SonyTag
|
||||
{
|
||||
Version = BigEndianBitConverter.ToUInt16(tag, 0), Kind = (byte)((tag[2] & 0xC0) >> 6),
|
||||
Reserved = (byte)(tag[2] & 0x3F), Volume = tag[3],
|
||||
Version = BigEndianBitConverter.ToUInt16(tag, 0),
|
||||
Kind = (byte)((tag[2] & 0xC0) >> 6),
|
||||
Reserved = (byte)(tag[2] & 0x3F),
|
||||
Volume = tag[3],
|
||||
FileId = BigEndianBitConverter.ToInt16(tag, 4),
|
||||
RelPage = BigEndianBitConverter.ToUInt16(tag, 6),
|
||||
NextBlock = (ushort)(BigEndianBitConverter.ToUInt16(tag, 8) & 0x7FF),
|
||||
@@ -251,10 +253,16 @@ namespace Aaru.Decoders
|
||||
/// <summary>Converts this tag to Priam DataTower format</summary>
|
||||
public PriamTag ToPriam() => new PriamTag
|
||||
{
|
||||
AbsPage = AbsPage, Checksum = Checksum, FileId = FileId, IsFirst = IsFirst,
|
||||
IsLast = IsLast, Kind = Kind, NextBlock = IsLast ? 0xFFFFFF : NextBlock & 0xFFFFFF,
|
||||
PrevBlock = IsFirst ? 0xFFFFFF : PrevBlock & 0xFFFFFF,
|
||||
RelPage = RelPage, UsedBytes = UsedBytes,
|
||||
AbsPage = AbsPage,
|
||||
Checksum = Checksum,
|
||||
FileId = FileId,
|
||||
IsFirst = IsFirst,
|
||||
IsLast = IsLast,
|
||||
Kind = Kind,
|
||||
NextBlock = IsLast ? 0xFFFFFF : NextBlock & 0xFFFFFF,
|
||||
PrevBlock = IsFirst ? 0xFFFFFF : PrevBlock & 0xFFFFFF,
|
||||
RelPage = RelPage,
|
||||
UsedBytes = UsedBytes,
|
||||
ValidChk = ValidChk,
|
||||
Version = Version,
|
||||
Volume = Volume
|
||||
@@ -263,8 +271,14 @@ namespace Aaru.Decoders
|
||||
/// <summary>Converts this tag to Sony format</summary>
|
||||
public SonyTag ToSony() => new SonyTag
|
||||
{
|
||||
FileId = FileId, IsFirst = IsFirst, IsLast = IsLast, Kind = Kind,
|
||||
NextBlock = (ushort)NextBlock, PrevBlock = (ushort)PrevBlock, RelPage = RelPage, Version = Version,
|
||||
FileId = FileId,
|
||||
IsFirst = IsFirst,
|
||||
IsLast = IsLast,
|
||||
Kind = Kind,
|
||||
NextBlock = (ushort)NextBlock,
|
||||
PrevBlock = (ushort)PrevBlock,
|
||||
RelPage = RelPage,
|
||||
Version = Version,
|
||||
Volume = Volume
|
||||
};
|
||||
|
||||
@@ -337,10 +351,16 @@ namespace Aaru.Decoders
|
||||
/// <summary>Converts this tag to Apple Profile format</summary>
|
||||
public ProfileTag ToProfile() => new ProfileTag
|
||||
{
|
||||
AbsPage = AbsPage, Checksum = Checksum, FileId = FileId, IsFirst = IsFirst,
|
||||
IsLast = IsLast, Kind = Kind, NextBlock = IsLast ? 0xFFFFFF : NextBlock & 0xFFFFFF,
|
||||
PrevBlock = IsFirst ? 0xFFFFFF : PrevBlock & 0xFFFFFF,
|
||||
RelPage = RelPage, UsedBytes = UsedBytes,
|
||||
AbsPage = AbsPage,
|
||||
Checksum = Checksum,
|
||||
FileId = FileId,
|
||||
IsFirst = IsFirst,
|
||||
IsLast = IsLast,
|
||||
Kind = Kind,
|
||||
NextBlock = IsLast ? 0xFFFFFF : NextBlock & 0xFFFFFF,
|
||||
PrevBlock = IsFirst ? 0xFFFFFF : PrevBlock & 0xFFFFFF,
|
||||
RelPage = RelPage,
|
||||
UsedBytes = UsedBytes,
|
||||
ValidChk = ValidChk,
|
||||
Version = Version,
|
||||
Volume = Volume
|
||||
@@ -349,9 +369,14 @@ namespace Aaru.Decoders
|
||||
/// <summary>Converts this tag to Sony format</summary>
|
||||
public SonyTag ToSony() => new SonyTag
|
||||
{
|
||||
FileId = FileId, IsFirst = IsFirst, IsLast = IsLast, Kind = Kind,
|
||||
FileId = FileId,
|
||||
IsFirst = IsFirst,
|
||||
IsLast = IsLast,
|
||||
Kind = Kind,
|
||||
NextBlock = (ushort)(IsLast ? 0x7FF : NextBlock & 0x7FF),
|
||||
PrevBlock = (ushort)(IsFirst ? 0x7FF : PrevBlock & 0x7FF), RelPage = RelPage, Version = Version,
|
||||
PrevBlock = (ushort)(IsFirst ? 0x7FF : PrevBlock & 0x7FF),
|
||||
RelPage = RelPage,
|
||||
Version = Version,
|
||||
Volume = Volume
|
||||
};
|
||||
|
||||
@@ -416,18 +441,28 @@ namespace Aaru.Decoders
|
||||
/// <summary>Converts this tag to Apple Profile format</summary>
|
||||
public ProfileTag ToProfile() => new ProfileTag
|
||||
{
|
||||
FileId = FileId, IsFirst = IsFirst, IsLast = IsLast, Kind = Kind,
|
||||
FileId = FileId,
|
||||
IsFirst = IsFirst,
|
||||
IsLast = IsLast,
|
||||
Kind = Kind,
|
||||
NextBlock = (uint)(IsLast ? 0xFFFFFF : NextBlock & 0xFFFFFF),
|
||||
PrevBlock = (uint)(IsFirst ? 0xFFFFFF : PrevBlock & 0xFFFFFF), RelPage = RelPage, Version = Version,
|
||||
PrevBlock = (uint)(IsFirst ? 0xFFFFFF : PrevBlock & 0xFFFFFF),
|
||||
RelPage = RelPage,
|
||||
Version = Version,
|
||||
Volume = Volume
|
||||
};
|
||||
|
||||
/// <summary>Converts this tag to Priam DataTower format</summary>
|
||||
public PriamTag ToPriam() => new PriamTag
|
||||
{
|
||||
FileId = FileId, IsFirst = IsFirst, IsLast = IsLast, Kind = Kind,
|
||||
FileId = FileId,
|
||||
IsFirst = IsFirst,
|
||||
IsLast = IsLast,
|
||||
Kind = Kind,
|
||||
NextBlock = (uint)(IsLast ? 0xFFFFFF : NextBlock & 0xFFFFFF),
|
||||
PrevBlock = (uint)(IsFirst ? 0xFFFFFF : PrevBlock & 0xFFFFFF), RelPage = RelPage, Version = Version,
|
||||
PrevBlock = (uint)(IsFirst ? 0xFFFFFF : PrevBlock & 0xFFFFFF),
|
||||
RelPage = RelPage,
|
||||
Version = Version,
|
||||
Volume = Volume
|
||||
};
|
||||
|
||||
|
||||
@@ -81,8 +81,10 @@ namespace Aaru.Decoders.MMC
|
||||
var cid = new CID
|
||||
{
|
||||
Manufacturer = response[0],
|
||||
DeviceType = (byte)(response[1] & 0x03), ProductRevision = response[9],
|
||||
ProductSerialNumber = BitConverter.ToUInt32(response, 10), ManufacturingDate = response[14],
|
||||
DeviceType = (byte)(response[1] & 0x03),
|
||||
ProductRevision = response[9],
|
||||
ProductSerialNumber = BitConverter.ToUInt32(response, 10),
|
||||
ManufacturingDate = response[14],
|
||||
CRC = (byte)((response[15] & 0xFE) >> 1)
|
||||
};
|
||||
|
||||
|
||||
64
MMC/CSD.cs
64
MMC/CSD.cs
@@ -105,41 +105,39 @@ namespace Aaru.Decoders.MMC
|
||||
|
||||
return new CSD
|
||||
{
|
||||
Structure = (byte)((response[0] & 0xC0) >> 6),
|
||||
Version = (byte)((response[0] & 0x3C) >> 2),
|
||||
TAAC = response[1], NSAC = response[2],
|
||||
Speed = response[3],
|
||||
Classes = (ushort)((response[4] << 4) + ((response[5] & 0xF0) >> 4)),
|
||||
ReadBlockLength = (byte)(response[5] & 0x0F),
|
||||
ReadsPartialBlocks = (response[6] & 0x80) == 0x80,
|
||||
WriteMisalignment =
|
||||
(response[6] & 0x40) == 0x40,
|
||||
Structure = (byte)((response[0] & 0xC0) >> 6),
|
||||
Version = (byte)((response[0] & 0x3C) >> 2),
|
||||
TAAC = response[1],
|
||||
NSAC = response[2],
|
||||
Speed = response[3],
|
||||
Classes = (ushort)((response[4] << 4) + ((response[5] & 0xF0) >> 4)),
|
||||
ReadBlockLength = (byte)(response[5] & 0x0F),
|
||||
ReadsPartialBlocks = (response[6] & 0x80) == 0x80,
|
||||
WriteMisalignment = (response[6] & 0x40) == 0x40,
|
||||
ReadMisalignment = (response[6] & 0x20) == 0x20,
|
||||
DSRImplemented =
|
||||
(response[6] & 0x10) == 0x10,
|
||||
Size =
|
||||
(ushort)(((response[6] & 0x03) << 10) + (response[7] << 2) + ((response[8] & 0xC0) >> 6)),
|
||||
ReadCurrentAtVddMin = (byte)((response[8] & 0x38) >> 3),
|
||||
ReadCurrentAtVddMax = (byte)(response[8] & 0x07),
|
||||
WriteCurrentAtVddMin = (byte)((response[9] & 0xE0) >> 5),
|
||||
WriteCurrentAtVddMax = (byte)((response[9] & 0x1C) >> 2),
|
||||
SizeMultiplier = (byte)(((response[9] & 0x03) << 1) + ((response[10] & 0x80) >> 7)),
|
||||
EraseGroupSize = (byte)((response[10] & 0x7C) >> 2),
|
||||
DSRImplemented = (response[6] & 0x10) == 0x10,
|
||||
Size = (ushort)(((response[6] & 0x03) << 10) + (response[7] << 2) + ((response[8] & 0xC0) >> 6)),
|
||||
ReadCurrentAtVddMin = (byte)((response[8] & 0x38) >> 3),
|
||||
ReadCurrentAtVddMax = (byte)(response[8] & 0x07),
|
||||
WriteCurrentAtVddMin = (byte)((response[9] & 0xE0) >> 5),
|
||||
WriteCurrentAtVddMax = (byte)((response[9] & 0x1C) >> 2),
|
||||
SizeMultiplier = (byte)(((response[9] & 0x03) << 1) + ((response[10] & 0x80) >> 7)),
|
||||
EraseGroupSize = (byte)((response[10] & 0x7C) >> 2),
|
||||
EraseGroupSizeMultiplier = (byte)(((response[10] & 0x03) << 3) + ((response[11] & 0xE0) >> 5)),
|
||||
WriteProtectGroupSize = (byte)(response[11] & 0x1F),
|
||||
WriteProtectGroupEnable = (response[12] & 0x80) == 0x80,
|
||||
DefaultECC = (byte)((response[12] & 0x60) >> 5),
|
||||
WriteSpeedFactor = (byte)((response[12] & 0x1C) >> 2),
|
||||
WriteBlockLength = (byte)(((response[12] & 0x03) << 2) + ((response[13] & 0xC0) >> 6)),
|
||||
WritesPartialBlocks = (response[13] & 0x20) == 0x20,
|
||||
ContentProtection = (response[13] & 0x01) == 0x01,
|
||||
FileFormatGroup = (response[14] & 0x80) == 0x80,
|
||||
Copy = (response[14] & 0x40) == 0x40,
|
||||
PermanentWriteProtect = (response[14] & 0x20) == 0x20,
|
||||
TemporaryWriteProtect = (response[14] & 0x10) == 0x10,
|
||||
FileFormat = (byte)((response[14] & 0x0C) >> 2),
|
||||
ECC = (byte)(response[14] & 0x03),
|
||||
CRC = (byte)((response[15] & 0xFE) >> 1)
|
||||
WriteProtectGroupSize = (byte)(response[11] & 0x1F),
|
||||
WriteProtectGroupEnable = (response[12] & 0x80) == 0x80,
|
||||
DefaultECC = (byte)((response[12] & 0x60) >> 5),
|
||||
WriteSpeedFactor = (byte)((response[12] & 0x1C) >> 2),
|
||||
WriteBlockLength = (byte)(((response[12] & 0x03) << 2) + ((response[13] & 0xC0) >> 6)),
|
||||
WritesPartialBlocks = (response[13] & 0x20) == 0x20,
|
||||
ContentProtection = (response[13] & 0x01) == 0x01,
|
||||
FileFormatGroup = (response[14] & 0x80) == 0x80,
|
||||
Copy = (response[14] & 0x40) == 0x40,
|
||||
PermanentWriteProtect = (response[14] & 0x20) == 0x20,
|
||||
TemporaryWriteProtect = (response[14] & 0x10) == 0x10,
|
||||
FileFormat = (byte)((response[14] & 0x0C) >> 2),
|
||||
ECC = (byte)(response[14] & 0x03),
|
||||
CRC = (byte)((response[15] & 0xFE) >> 1)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
27
MMC/OCR.cs
27
MMC/OCR.cs
@@ -67,15 +67,24 @@ namespace Aaru.Decoders.MMC
|
||||
{
|
||||
public static OCR DecodeOCR(uint response) => new OCR
|
||||
{
|
||||
PowerUp = (response & 0x80000000) == 0x80000000, AccessMode = (byte)((response & 0x60000000) >> 29),
|
||||
ThreeFive = (response & 0x00800000) == 0x00800000, ThreeFour = (response & 0x00400000) == 0x00400000,
|
||||
ThreeThree = (response & 0x00200000) == 0x00200000, ThreeTwo = (response & 0x00100000) == 0x00100000,
|
||||
ThreeOne = (response & 0x00080000) == 0x00080000, ThreeZero = (response & 0x00040000) == 0x00040000,
|
||||
TwoNine = (response & 0x00020000) == 0x00020000, TwoEight = (response & 0x00010000) == 0x00010000,
|
||||
TwoSeven = (response & 0x00008000) == 0x00008000, TwoSix = (response & 0x00004000) == 0x00004000,
|
||||
TwoFive = (response & 0x00002000) == 0x00002000, TwoFour = (response & 0x00001000) == 0x00001000,
|
||||
TwoThree = (response & 0x00000800) == 0x00000800, TwoTwo = (response & 0x00000400) == 0x00000400,
|
||||
TwoOne = (response & 0x00000200) == 0x00000200, TwoZero = (response & 0x00000100) == 0x00000100,
|
||||
PowerUp = (response & 0x80000000) == 0x80000000,
|
||||
AccessMode = (byte)((response & 0x60000000) >> 29),
|
||||
ThreeFive = (response & 0x00800000) == 0x00800000,
|
||||
ThreeFour = (response & 0x00400000) == 0x00400000,
|
||||
ThreeThree = (response & 0x00200000) == 0x00200000,
|
||||
ThreeTwo = (response & 0x00100000) == 0x00100000,
|
||||
ThreeOne = (response & 0x00080000) == 0x00080000,
|
||||
ThreeZero = (response & 0x00040000) == 0x00040000,
|
||||
TwoNine = (response & 0x00020000) == 0x00020000,
|
||||
TwoEight = (response & 0x00010000) == 0x00010000,
|
||||
TwoSeven = (response & 0x00008000) == 0x00008000,
|
||||
TwoSix = (response & 0x00004000) == 0x00004000,
|
||||
TwoFive = (response & 0x00002000) == 0x00002000,
|
||||
TwoFour = (response & 0x00001000) == 0x00001000,
|
||||
TwoThree = (response & 0x00000800) == 0x00000800,
|
||||
TwoTwo = (response & 0x00000400) == 0x00000400,
|
||||
TwoOne = (response & 0x00000200) == 0x00000200,
|
||||
TwoZero = (response & 0x00000100) == 0x00000100,
|
||||
OneSix = (response & 0x00000080) == 0x00000080
|
||||
};
|
||||
|
||||
|
||||
@@ -100,11 +100,12 @@ namespace Aaru.Decoders.PCMCIA
|
||||
{
|
||||
var geometry = new DeviceGeometry
|
||||
{
|
||||
CardInterface = data[position], EraseBlockSize = data[position + 1],
|
||||
ReadBlockSize = data[position + 2],
|
||||
WriteBlockSize = data[position + 3],
|
||||
Partitions = data[position + 4],
|
||||
Interleaving = data[position + 5]
|
||||
CardInterface = data[position],
|
||||
EraseBlockSize = data[position + 1],
|
||||
ReadBlockSize = data[position + 2],
|
||||
WriteBlockSize = data[position + 3],
|
||||
Partitions = data[position + 4],
|
||||
Interleaving = data[position + 5]
|
||||
};
|
||||
|
||||
geometries.Add(geometry);
|
||||
@@ -175,8 +176,10 @@ namespace Aaru.Decoders.PCMCIA
|
||||
|
||||
return new ManufacturerIdentificationTuple
|
||||
{
|
||||
Code = (TupleCodes)data[0], Link = data[1], ManufacturerID = BitConverter.ToUInt16(data, 2),
|
||||
CardID = BitConverter.ToUInt16(data, 4)
|
||||
Code = (TupleCodes)data[0],
|
||||
Link = data[1],
|
||||
ManufacturerID = BitConverter.ToUInt16(data, 2),
|
||||
CardID = BitConverter.ToUInt16(data, 4)
|
||||
};
|
||||
}
|
||||
|
||||
@@ -222,7 +225,10 @@ namespace Aaru.Decoders.PCMCIA
|
||||
|
||||
var tuple = new Level1VersionTuple
|
||||
{
|
||||
Code = (TupleCodes)data[0], Link = data[1], MajorVersion = data[2], MinorVersion = data[3]
|
||||
Code = (TupleCodes)data[0],
|
||||
Link = data[1],
|
||||
MajorVersion = data[2],
|
||||
MinorVersion = data[3]
|
||||
};
|
||||
|
||||
for(int position = 4; position < data.Length; position++)
|
||||
|
||||
@@ -54,8 +54,9 @@ namespace Aaru.Decoders.SCSI
|
||||
{
|
||||
var cap = new Capability
|
||||
{
|
||||
FormatCode = response[offset], SDS = (response[offset + 1] & 0x80) == 0x80,
|
||||
RDS = (response[offset + 1] & 0x40) == 0x40
|
||||
FormatCode = response[offset],
|
||||
SDS = (response[offset + 1] & 0x80) == 0x80,
|
||||
RDS = (response[offset + 1] & 0x40) == 0x40
|
||||
};
|
||||
|
||||
caps.Add(cap);
|
||||
|
||||
127
SCSI/EVPD.cs
127
SCSI/EVPD.cs
@@ -226,9 +226,10 @@ namespace Aaru.Decoders.SCSI
|
||||
var decoded = new Page_81
|
||||
{
|
||||
PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
|
||||
PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
|
||||
PageLength = (byte)(pageResponse[3] + 4), Current = (ScsiDefinitions)(pageResponse[4] & 0x7F),
|
||||
Default = (ScsiDefinitions)(pageResponse[5] & 0x7F)
|
||||
PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
|
||||
PageLength = (byte)(pageResponse[3] + 4),
|
||||
Current = (ScsiDefinitions)(pageResponse[4] & 0x7F),
|
||||
Default = (ScsiDefinitions)(pageResponse[5] & 0x7F)
|
||||
};
|
||||
|
||||
int position = 6;
|
||||
@@ -1160,62 +1161,32 @@ namespace Aaru.Decoders.SCSI
|
||||
PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
|
||||
PageLength = (byte)(pageResponse[3] + 4),
|
||||
ActivateMicrocode = (byte)((pageResponse[4] & 0xC0) >> 6),
|
||||
SPT =
|
||||
(byte)((pageResponse[4] & 0x38) >> 3),
|
||||
GRD_CHK = (pageResponse[4] & 0x04) == 0x04,
|
||||
APP_CHK =
|
||||
(pageResponse
|
||||
[4] &
|
||||
0x02) == 0x02,
|
||||
REF_CHK = (pageResponse[4] & 0x01) == 0x01,
|
||||
UASK_SUP =
|
||||
(pageResponse
|
||||
[5] &
|
||||
0x20) == 0x20,
|
||||
GROUP_SUP = (pageResponse[5] & 0x10) == 0x10,
|
||||
PRIOR_SUP =
|
||||
(pageResponse
|
||||
[5] &
|
||||
0x08) == 0x08,
|
||||
HEADSUP = (pageResponse[5] & 0x04) == 0x04,
|
||||
ORDSUP =
|
||||
(pageResponse
|
||||
[5] &
|
||||
0x02) == 0x02,
|
||||
SIMPSUP = (pageResponse[5] & 0x01) == 0x01,
|
||||
WU_SUP =
|
||||
(pageResponse
|
||||
[6] &
|
||||
0x08) == 0x08,
|
||||
CRD_SUP = (pageResponse[6] & 0x04) == 0x04,
|
||||
NV_SUP =
|
||||
(pageResponse
|
||||
[6] &
|
||||
0x02) == 0x02,
|
||||
V_SUP = (pageResponse[6] & 0x01) == 0x01,
|
||||
NO_PI_CHK =
|
||||
(pageResponse
|
||||
[7] &
|
||||
0x20) == 0x20,
|
||||
P_I_I_SUP = (pageResponse[7] & 0x10) == 0x10,
|
||||
LUICLR =
|
||||
(pageResponse
|
||||
[7] &
|
||||
0x01) == 0x01,
|
||||
R_SUP = (pageResponse[8] & 0x10) == 0x10,
|
||||
HSSRELEF =
|
||||
(pageResponse
|
||||
[8] &
|
||||
0x02) == 0x02,
|
||||
CBCS = (pageResponse[8] & 0x01) == 0x01,
|
||||
Nexus =
|
||||
(byte)(pageResponse
|
||||
[9] &
|
||||
0x0F),
|
||||
ExtendedTestMinutes = (ushort)((pageResponse[10] << 8) + pageResponse[11]),
|
||||
POA_SUP = (pageResponse[12] & 0x80) == 0x80,
|
||||
HRA_SUP = (pageResponse[12] & 0x40) == 0x40,
|
||||
VSA_SUP = (pageResponse[12] & 0x20) == 0x20, MaximumSenseLength = pageResponse[13]
|
||||
SPT = (byte)((pageResponse[4] & 0x38) >> 3),
|
||||
GRD_CHK = (pageResponse[4] & 0x04) == 0x04,
|
||||
APP_CHK = (pageResponse[4] & 0x02) == 0x02,
|
||||
REF_CHK = (pageResponse[4] & 0x01) == 0x01,
|
||||
UASK_SUP = (pageResponse[5] & 0x20) == 0x20,
|
||||
GROUP_SUP = (pageResponse[5] & 0x10) == 0x10,
|
||||
PRIOR_SUP = (pageResponse[5] & 0x08) == 0x08,
|
||||
HEADSUP = (pageResponse[5] & 0x04) == 0x04,
|
||||
ORDSUP = (pageResponse[5] & 0x02) == 0x02,
|
||||
SIMPSUP = (pageResponse[5] & 0x01) == 0x01,
|
||||
WU_SUP = (pageResponse[6] & 0x08) == 0x08,
|
||||
CRD_SUP = (pageResponse[6] & 0x04) == 0x04,
|
||||
NV_SUP = (pageResponse[6] & 0x02) == 0x02,
|
||||
V_SUP = (pageResponse[6] & 0x01) == 0x01,
|
||||
NO_PI_CHK = (pageResponse[7] & 0x20) == 0x20,
|
||||
P_I_I_SUP = (pageResponse[7] & 0x10) == 0x10,
|
||||
LUICLR = (pageResponse[7] & 0x01) == 0x01,
|
||||
R_SUP = (pageResponse[8] & 0x10) == 0x10,
|
||||
HSSRELEF = (pageResponse[8] & 0x02) == 0x02,
|
||||
CBCS = (pageResponse[8] & 0x01) == 0x01,
|
||||
Nexus = (byte)(pageResponse[9] & 0x0F),
|
||||
ExtendedTestMinutes = (ushort)((pageResponse[10] << 8) + pageResponse[11]),
|
||||
POA_SUP = (pageResponse[12] & 0x80) == 0x80,
|
||||
HRA_SUP = (pageResponse[12] & 0x40) == 0x40,
|
||||
VSA_SUP = (pageResponse[12] & 0x20) == 0x20,
|
||||
MaximumSenseLength = pageResponse[13]
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1401,7 +1372,8 @@ namespace Aaru.Decoders.SCSI
|
||||
PageLength = (ushort)((pageResponse[2] << 8) + pageResponse[3] + 4),
|
||||
VendorIdentification = new byte[8],
|
||||
ProductIdentification = new byte[16],
|
||||
ProductRevisionLevel = new byte[4], Signature = new byte[20],
|
||||
ProductRevisionLevel = new byte[4],
|
||||
Signature = new byte[20],
|
||||
IdentifyData = new byte[512]
|
||||
};
|
||||
|
||||
@@ -1595,8 +1567,11 @@ namespace Aaru.Decoders.SCSI
|
||||
{
|
||||
PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
|
||||
PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
|
||||
PageLength = (byte)(pageResponse[3] + 4), Component = new byte[26], Version = new byte[19],
|
||||
Date = new byte[24], Variant = new byte[23]
|
||||
PageLength = (byte)(pageResponse[3] + 4),
|
||||
Component = new byte[26],
|
||||
Version = new byte[19],
|
||||
Date = new byte[24],
|
||||
Variant = new byte[23]
|
||||
};
|
||||
|
||||
Array.Copy(pageResponse, 4, decoded.Component, 0, 26);
|
||||
@@ -1666,7 +1641,8 @@ namespace Aaru.Decoders.SCSI
|
||||
{
|
||||
PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
|
||||
PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
|
||||
PageLength = (byte)(pageResponse[3] + 4), SerialNumber = new byte[12]
|
||||
PageLength = (byte)(pageResponse[3] + 4),
|
||||
SerialNumber = new byte[12]
|
||||
};
|
||||
|
||||
Array.Copy(pageResponse, 4, decoded.SerialNumber, 0, 12);
|
||||
@@ -1789,10 +1765,12 @@ namespace Aaru.Decoders.SCSI
|
||||
Clean = (pageResponse[5] & 0x01) == 0x01,
|
||||
Threaded = (pageResponse[6] & 0x10) == 0x10,
|
||||
Lun1Cmd = (pageResponse[6] & 0x08) == 0x08,
|
||||
AutoloadMode = (byte)(pageResponse[6] & 0x07), CartridgeType = pageResponse[8],
|
||||
AutoloadMode = (byte)(pageResponse[6] & 0x07),
|
||||
CartridgeType = pageResponse[8],
|
||||
CartridgeFormat = pageResponse[9],
|
||||
CartridgeCapacity = (ushort)((pageResponse[10] << 8) + pageResponse[11] + 4),
|
||||
PortATransportType = pageResponse[12], PortASelectionID = pageResponse[15],
|
||||
PortATransportType = pageResponse[12],
|
||||
PortASelectionID = pageResponse[15],
|
||||
OperatingHours = (uint)((pageResponse[20] << 24) + (pageResponse[21] << 16) + (pageResponse[22] << 8) +
|
||||
pageResponse[23]),
|
||||
CartridgeSerialNumber = new byte[32]
|
||||
@@ -1996,7 +1974,9 @@ namespace Aaru.Decoders.SCSI
|
||||
{
|
||||
PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
|
||||
PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
|
||||
PageLength = (byte)(pageResponse[3] + 4), CodeName = new byte[12], Date = new byte[8]
|
||||
PageLength = (byte)(pageResponse[3] + 4),
|
||||
CodeName = new byte[12],
|
||||
Date = new byte[8]
|
||||
};
|
||||
|
||||
Array.Copy(pageResponse, 4, decoded.CodeName, 0, 12);
|
||||
@@ -2056,7 +2036,8 @@ namespace Aaru.Decoders.SCSI
|
||||
{
|
||||
PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
|
||||
PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
|
||||
PageLength = (byte)(pageResponse[3] + 4), ManufacturingSerial = new byte[12],
|
||||
PageLength = (byte)(pageResponse[3] + 4),
|
||||
ManufacturingSerial = new byte[12],
|
||||
ReportedSerial = new byte[12]
|
||||
};
|
||||
|
||||
@@ -2121,7 +2102,8 @@ namespace Aaru.Decoders.SCSI
|
||||
PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
|
||||
PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
|
||||
PageLength = (ushort)((pageResponse[2] << 8) + pageResponse[3] + 4),
|
||||
TSMC = (pageResponse[4] & 0x02) == 0x02, WORM = (pageResponse[4] & 0x01) == 0x01
|
||||
TSMC = (pageResponse[4] & 0x02) == 0x02,
|
||||
WORM = (pageResponse[4] & 0x01) == 0x01
|
||||
};
|
||||
|
||||
return decoded;
|
||||
@@ -2188,7 +2170,8 @@ namespace Aaru.Decoders.SCSI
|
||||
{
|
||||
PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
|
||||
PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
|
||||
PageLength = (byte)(pageResponse[3] + 4), PageCode = pageResponse[1]
|
||||
PageLength = (byte)(pageResponse[3] + 4),
|
||||
PageCode = pageResponse[1]
|
||||
};
|
||||
|
||||
if(pageResponse[3] == 92 &&
|
||||
@@ -2348,9 +2331,11 @@ namespace Aaru.Decoders.SCSI
|
||||
{
|
||||
PeripheralQualifier = (PeripheralQualifiers)((pageResponse[0] & 0xE0) >> 5),
|
||||
PeripheralDeviceType = (PeripheralDeviceTypes)(pageResponse[0] & 0x1F),
|
||||
PageLength = (byte)(pageResponse[3] + 4), PageCode = pageResponse[1],
|
||||
PageLength = (byte)(pageResponse[3] + 4),
|
||||
PageCode = pageResponse[1],
|
||||
ControllerFirmware = new byte[4],
|
||||
BootFirmware = new byte[4], ServoFirmware = new byte[4]
|
||||
BootFirmware = new byte[4],
|
||||
ServoFirmware = new byte[4]
|
||||
};
|
||||
|
||||
Array.Copy(pageResponse, 4, decoded.ControllerFirmware, 0, 4);
|
||||
|
||||
@@ -61,7 +61,8 @@ namespace Aaru.Decoders.SCSI.MMC
|
||||
var decoded = new CPRMMediaKeyBlock
|
||||
{
|
||||
MKBPackData = new byte[CPRMMKBResponse.Length - 4],
|
||||
DataLength = BigEndianBitConverter.ToUInt16(CPRMMKBResponse, 0), Reserved = CPRMMKBResponse[2],
|
||||
DataLength = BigEndianBitConverter.ToUInt16(CPRMMKBResponse, 0),
|
||||
Reserved = CPRMMKBResponse[2],
|
||||
TotalPacks = CPRMMKBResponse[3]
|
||||
};
|
||||
|
||||
|
||||
@@ -63,10 +63,12 @@ namespace Aaru.Decoders.SCSI.MMC
|
||||
var decoded = new RecognizedFormatLayers
|
||||
{
|
||||
DataLength = BigEndianBitConverter.ToUInt16(FormatLayersResponse, 0),
|
||||
Reserved1 = FormatLayersResponse[2], Reserved2 = FormatLayersResponse[3],
|
||||
NumberOfLayers = FormatLayersResponse[4], Reserved3 = (byte)((FormatLayersResponse[5] & 0xC0) >> 6),
|
||||
DefaultFormatLayer = (byte)((FormatLayersResponse[5] & 0x30) >> 4),
|
||||
Reserved4 = (byte)((FormatLayersResponse[5] & 0x0C) >> 2),
|
||||
Reserved1 = FormatLayersResponse[2],
|
||||
Reserved2 = FormatLayersResponse[3],
|
||||
NumberOfLayers = FormatLayersResponse[4],
|
||||
Reserved3 = (byte)((FormatLayersResponse[5] & 0xC0) >> 6),
|
||||
DefaultFormatLayer = (byte)((FormatLayersResponse[5] & 0x30) >> 4),
|
||||
Reserved4 = (byte)((FormatLayersResponse[5] & 0x0C) >> 2),
|
||||
OnlineFormatLayer = (byte)(FormatLayersResponse[5] & 0x03),
|
||||
FormatLayers = new ushort[(FormatLayersResponse.Length - 6) / 2]
|
||||
};
|
||||
|
||||
@@ -61,13 +61,20 @@ namespace Aaru.Decoders.SCSI.MMC
|
||||
|
||||
var decoded = new TrackInformation
|
||||
{
|
||||
DataLength = (ushort)((response[0] << 8) + response[1]), LogicalTrackNumber = response[2],
|
||||
SessionNumber = response[3], LayerJumpRecordingStatus = (LayerJumpRecordingStatus)(response[5] >> 6),
|
||||
Damage = (response[5] & 0x20) == 0x20, Copy = (response[5] & 0x10) == 0x10,
|
||||
TrackMode = (byte)(response[5] & 0xF), RT = (response[6] & 0x80) == 0x80,
|
||||
Blank = (response[6] & 0x40) == 0x40, Packet = (response[6] & 0x20) == 0x20,
|
||||
FP = (response[6] & 0x10) == 0x10, DataMode = (byte)(response[6] & 0xF),
|
||||
LraV = (response[7] & 0x02) == 0x02, NwaV = (response[7] & 0x01) == 0x01,
|
||||
DataLength = (ushort)((response[0] << 8) + response[1]),
|
||||
LogicalTrackNumber = response[2],
|
||||
SessionNumber = response[3],
|
||||
LayerJumpRecordingStatus = (LayerJumpRecordingStatus)(response[5] >> 6),
|
||||
Damage = (response[5] & 0x20) == 0x20,
|
||||
Copy = (response[5] & 0x10) == 0x10,
|
||||
TrackMode = (byte)(response[5] & 0xF),
|
||||
RT = (response[6] & 0x80) == 0x80,
|
||||
Blank = (response[6] & 0x40) == 0x40,
|
||||
Packet = (response[6] & 0x20) == 0x20,
|
||||
FP = (response[6] & 0x10) == 0x10,
|
||||
DataMode = (byte)(response[6] & 0xF),
|
||||
LraV = (response[7] & 0x02) == 0x02,
|
||||
NwaV = (response[7] & 0x01) == 0x01,
|
||||
LogicalTrackStartAddress =
|
||||
(uint)((response[8] << 24) + (response[9] << 16) + (response[10] << 8) + response[11]),
|
||||
NextWritableAddress =
|
||||
|
||||
@@ -60,14 +60,16 @@ namespace Aaru.Decoders.SCSI.MMC
|
||||
|
||||
var decoded = new WriteProtectionStatus
|
||||
{
|
||||
DataLength = BigEndianBitConverter.ToUInt16(WPSResponse, 0), Reserved1 = WPSResponse[2],
|
||||
DataLength = BigEndianBitConverter.ToUInt16(WPSResponse, 0),
|
||||
Reserved1 = WPSResponse[2],
|
||||
Reserved2 = WPSResponse[3],
|
||||
Reserved3 = (byte)((WPSResponse[4] & 0xF0) >> 4),
|
||||
MSWI = Convert.ToBoolean(WPSResponse[4] & 0x08),
|
||||
CWP = Convert.ToBoolean(WPSResponse[4] & 0x04),
|
||||
PWP = Convert.ToBoolean(WPSResponse[4] & 0x02),
|
||||
SWPP = Convert.ToBoolean(WPSResponse[4] & 0x01),
|
||||
Reserved4 = WPSResponse[5], Reserved5 = WPSResponse[6],
|
||||
Reserved4 = WPSResponse[5],
|
||||
Reserved5 = WPSResponse[6],
|
||||
Reserved6 = WPSResponse[7]
|
||||
};
|
||||
|
||||
|
||||
@@ -73,14 +73,17 @@ namespace Aaru.Decoders.SCSI
|
||||
|
||||
return new IBM_ModePage_2F
|
||||
{
|
||||
PS = (pageResponse[0] & 0x80) == 0x80, FenceBehaviour = pageResponse[2],
|
||||
CleanBehaviour = pageResponse[3], WORMEmulation = pageResponse[4],
|
||||
SenseDataBehaviour = pageResponse[5],
|
||||
CCDM = (pageResponse[6] & 0x04) == 0x04,
|
||||
DDEOR = (pageResponse[6] & 0x02) == 0x02,
|
||||
CLNCHK = (pageResponse[6] & 0x01) == 0x01, FirmwareUpdateBehaviour = pageResponse[7],
|
||||
UOE_C = (byte)((pageResponse[8] & 0x30) >> 4),
|
||||
UOE_F = (byte)((pageResponse[8] & 0x0C) >> 2)
|
||||
PS = (pageResponse[0] & 0x80) == 0x80,
|
||||
FenceBehaviour = pageResponse[2],
|
||||
CleanBehaviour = pageResponse[3],
|
||||
WORMEmulation = pageResponse[4],
|
||||
SenseDataBehaviour = pageResponse[5],
|
||||
CCDM = (pageResponse[6] & 0x04) == 0x04,
|
||||
DDEOR = (pageResponse[6] & 0x02) == 0x02,
|
||||
CLNCHK = (pageResponse[6] & 0x01) == 0x01,
|
||||
FirmwareUpdateBehaviour = pageResponse[7],
|
||||
UOE_C = (byte)((pageResponse[8] & 0x30) >> 4),
|
||||
UOE_F = (byte)((pageResponse[8] & 0x0C) >> 2)
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -61,22 +61,17 @@ namespace Aaru.Decoders.SCSI.SSC
|
||||
{
|
||||
var descriptor = new DensitySupportDescriptor
|
||||
{
|
||||
primaryCode = response[offset + 0], secondaryCode = response[offset + 1],
|
||||
writable = (response[offset + 2] & 0x80) == 0x80,
|
||||
duplicate = (response[offset + 2] & 0x40) == 0x40,
|
||||
primaryCode = response[offset + 0],
|
||||
secondaryCode = response[offset + 1],
|
||||
writable = (response[offset + 2] & 0x80) == 0x80,
|
||||
duplicate = (response[offset + 2] & 0x40) == 0x40,
|
||||
defaultDensity = (response[offset + 2] & 0x20) == 0x20,
|
||||
reserved = (byte)((response[offset + 2] & 0x1E) >> 1),
|
||||
lenvalid =
|
||||
(response[offset + 2] &
|
||||
0x01) == 0x01,
|
||||
len =
|
||||
(ushort)((response[offset + 3] << 8) + response[offset + 4]),
|
||||
bpmm = (uint)((response[offset + 5] << 16) + (response[offset + 6] << 8) +
|
||||
response[offset + 7]),
|
||||
width =
|
||||
(ushort)((response[offset + 8] << 8) + response[offset + 9]),
|
||||
tracks = (ushort)((response[offset + 10] << 8) +
|
||||
response[offset + 11]),
|
||||
reserved = (byte)((response[offset + 2] & 0x1E) >> 1),
|
||||
lenvalid = (response[offset + 2] & 0x01) == 0x01,
|
||||
len = (ushort)((response[offset + 3] << 8) + response[offset + 4]),
|
||||
bpmm = (uint)((response[offset + 5] << 16) + (response[offset + 6] << 8) + response[offset + 7]),
|
||||
width = (ushort)((response[offset + 8] << 8) + response[offset + 9]),
|
||||
tracks = (ushort)((response[offset + 10] << 8) + response[offset + 11]),
|
||||
capacity = (uint)((response[offset + 12] << 24) + (response[offset + 13] << 16) +
|
||||
(response[offset + 14] << 8) + response[offset + 15])
|
||||
};
|
||||
@@ -101,7 +96,8 @@ namespace Aaru.Decoders.SCSI.SSC
|
||||
|
||||
var decoded = new DensitySupportHeader
|
||||
{
|
||||
length = responseLen, reserved = (ushort)((response[2] << 8) + response[3] + 2),
|
||||
length = responseLen,
|
||||
reserved = (ushort)((response[2] << 8) + response[3] + 2),
|
||||
descriptors = descriptors.ToArray()
|
||||
};
|
||||
|
||||
@@ -168,7 +164,8 @@ namespace Aaru.Decoders.SCSI.SSC
|
||||
{
|
||||
var descriptor = new MediaTypeSupportDescriptor
|
||||
{
|
||||
mediumType = response[offset + 0], reserved1 = response[offset + 1],
|
||||
mediumType = response[offset + 0],
|
||||
reserved1 = response[offset + 1],
|
||||
len = (ushort)((response[offset + 2] << 8) + response[offset + 3])
|
||||
};
|
||||
|
||||
@@ -199,7 +196,8 @@ namespace Aaru.Decoders.SCSI.SSC
|
||||
|
||||
var decoded = new MediaTypeSupportHeader
|
||||
{
|
||||
length = responseLen, reserved = (ushort)((response[2] << 8) + response[3] + 2),
|
||||
length = responseLen,
|
||||
reserved = (ushort)((response[2] << 8) + response[3] + 2),
|
||||
descriptors = descriptors.ToArray()
|
||||
};
|
||||
|
||||
|
||||
@@ -213,10 +213,13 @@ namespace Aaru.Decoders.SCSI
|
||||
|
||||
var decoded = new FixedSense
|
||||
{
|
||||
InformationValid = (sense[0] & 0x80) == 0x80, SegmentNumber = sense[1],
|
||||
Filemark = (sense[2] & 0x80) == 0x80, EOM = (sense[2] & 0x40) == 0x40, ILI = (sense[2] & 0x20) == 0x20,
|
||||
SenseKey = (SenseKeys)(sense[2] & 0x0F),
|
||||
Information = (uint)((sense[3] << 24) + (sense[4] << 16) + (sense[5] << 8) + sense[6]),
|
||||
InformationValid = (sense[0] & 0x80) == 0x80,
|
||||
SegmentNumber = sense[1],
|
||||
Filemark = (sense[2] & 0x80) == 0x80,
|
||||
EOM = (sense[2] & 0x40) == 0x40,
|
||||
ILI = (sense[2] & 0x20) == 0x20,
|
||||
SenseKey = (SenseKeys)(sense[2] & 0x0F),
|
||||
Information = (uint)((sense[3] << 24) + (sense[4] << 16) + (sense[5] << 8) + sense[6]),
|
||||
AdditionalLength = sense[7]
|
||||
};
|
||||
|
||||
@@ -264,8 +267,11 @@ namespace Aaru.Decoders.SCSI
|
||||
|
||||
var decoded = new DescriptorSense
|
||||
{
|
||||
SenseKey = (SenseKeys)(sense[1] & 0x0F), ASC = sense[2], ASCQ = sense[3],
|
||||
Overflow = (sense[4] & 0x80) == 0x80, Descriptors = new Dictionary<byte, byte[]>()
|
||||
SenseKey = (SenseKeys)(sense[1] & 0x0F),
|
||||
ASC = sense[2],
|
||||
ASCQ = sense[3],
|
||||
Overflow = (sense[4] & 0x80) == 0x80,
|
||||
Descriptors = new Dictionary<byte, byte[]>()
|
||||
};
|
||||
|
||||
senseDescription = GetSenseDescription(decoded.ASC, decoded.ASCQ);
|
||||
@@ -499,7 +505,9 @@ namespace Aaru.Decoders.SCSI
|
||||
|
||||
return new AnotherProgressIndicationSenseDescriptor
|
||||
{
|
||||
SenseKey = (SenseKeys)descriptor[2], ASC = descriptor[3], ASCQ = descriptor[4],
|
||||
SenseKey = (SenseKeys)descriptor[2],
|
||||
ASC = descriptor[3],
|
||||
ASCQ = descriptor[4],
|
||||
Progress = (ushort)((descriptor[6] << 8) + descriptor[7])
|
||||
};
|
||||
}
|
||||
@@ -516,11 +524,13 @@ namespace Aaru.Decoders.SCSI
|
||||
|
||||
public static AtaErrorRegistersLba48 DecodeDescriptor09(byte[] descriptor) => new AtaErrorRegistersLba48
|
||||
{
|
||||
Error = descriptor[3], SectorCount = (ushort)((descriptor[4] << 8) + descriptor[5]),
|
||||
LbaLow = (ushort)((descriptor[6] << 8) + descriptor[7]),
|
||||
LbaMid = (ushort)((descriptor[8] << 8) + descriptor[9]),
|
||||
LbaHigh = (ushort)((descriptor[10] << 8) + descriptor[11]), DeviceHead = descriptor[12],
|
||||
Status = descriptor[13]
|
||||
Error = descriptor[3],
|
||||
SectorCount = (ushort)((descriptor[4] << 8) + descriptor[5]),
|
||||
LbaLow = (ushort)((descriptor[6] << 8) + descriptor[7]),
|
||||
LbaMid = (ushort)((descriptor[8] << 8) + descriptor[9]),
|
||||
LbaHigh = (ushort)((descriptor[10] << 8) + descriptor[11]),
|
||||
DeviceHead = descriptor[12],
|
||||
Status = descriptor[13]
|
||||
};
|
||||
|
||||
public static void DecodeDescriptor0B(byte[] descriptor) => throw new NotImplementedException("Check SBC-3");
|
||||
|
||||
@@ -79,7 +79,8 @@ namespace Aaru.Decoders.SecureDigital
|
||||
|
||||
var cid = new CID
|
||||
{
|
||||
Manufacturer = response[0], ProductRevision = response[8],
|
||||
Manufacturer = response[0],
|
||||
ProductRevision = response[8],
|
||||
ProductSerialNumber = BitConverter.ToUInt32(response, 9),
|
||||
ManufacturingDate = (ushort)(((response[13] & 0x0F) << 4) + response[14]),
|
||||
CRC = (byte)((response[15] & 0xFE) >> 1)
|
||||
@@ -113,8 +114,7 @@ namespace Aaru.Decoders.SecureDigital
|
||||
sb.AppendFormat("\tProduct serial number: {0}", cid.ProductSerialNumber).AppendLine();
|
||||
|
||||
sb.AppendFormat("\tDevice manufactured month {0} of {1}", (cid.ManufacturingDate & 0xF00) >> 8,
|
||||
(cid.ManufacturingDate & 0xFF) + 2000).
|
||||
AppendLine();
|
||||
(cid.ManufacturingDate & 0xFF) + 2000).AppendLine();
|
||||
|
||||
sb.AppendFormat("\tCID CRC: 0x{0:X2}", cid.CRC).AppendLine();
|
||||
|
||||
|
||||
@@ -100,15 +100,17 @@ namespace Aaru.Decoders.SecureDigital
|
||||
|
||||
var csd = new CSD
|
||||
{
|
||||
Structure = (byte)((response[0] & 0xC0) >> 6), TAAC = response[1],
|
||||
Structure = (byte)((response[0] & 0xC0) >> 6),
|
||||
TAAC = response[1],
|
||||
NSAC = response[2],
|
||||
Speed = response[3],
|
||||
Classes = (ushort)((response[4] << 4) + ((response[5] & 0xF0) >> 4)),
|
||||
ReadBlockLength = (byte)(response[5] & 0x0F), ReadsPartialBlocks = (response[6] & 0x80) == 0x80,
|
||||
WriteMisalignment = (response[6] & 0x40) == 0x40,
|
||||
ReadMisalignment = (response[6] & 0x20) == 0x20,
|
||||
DSRImplemented = (response[6] & 0x10) == 0x10,
|
||||
EraseBlockEnable = (response[10] & 0x40) == 0x40,
|
||||
ReadBlockLength = (byte)(response[5] & 0x0F),
|
||||
ReadsPartialBlocks = (response[6] & 0x80) == 0x80,
|
||||
WriteMisalignment = (response[6] & 0x40) == 0x40,
|
||||
ReadMisalignment = (response[6] & 0x20) == 0x20,
|
||||
DSRImplemented = (response[6] & 0x10) == 0x10,
|
||||
EraseBlockEnable = (response[10] & 0x40) == 0x40,
|
||||
EraseSectorSize = (byte)(((response[10] & 0x3F) << 1) + ((response[11] & 0x80) >> 7)),
|
||||
WriteProtectGroupSize = (byte)(response[11] & 0x7F),
|
||||
WriteProtectGroupEnable = (response[12] & 0x80) == 0x80,
|
||||
@@ -120,8 +122,7 @@ namespace Aaru.Decoders.SecureDigital
|
||||
PermanentWriteProtect = (response[14] & 0x20) == 0x20,
|
||||
TemporaryWriteProtect = (response[14] & 0x10) == 0x10,
|
||||
FileFormat = (byte)((response[14] & 0x0C) >> 2),
|
||||
CRC =
|
||||
(byte)((response[15] & 0xFE) >> 1)
|
||||
CRC = (byte)((response[15] & 0xFE) >> 1)
|
||||
};
|
||||
|
||||
if(csd.Structure == 0)
|
||||
|
||||
@@ -62,13 +62,20 @@ namespace Aaru.Decoders.SecureDigital
|
||||
{
|
||||
public static OCR DecodeOCR(uint response) => new OCR
|
||||
{
|
||||
PowerUp = (response & 0x80000000) == 0x80000000, CCS = (response & 0x40000000) == 0x40000000,
|
||||
UHS = (response & 0x20000000) == 0x20000000, OneEight = (response & 0x01000000) == 0x01000000,
|
||||
ThreeFive = (response & 0x00800000) == 0x00800000, ThreeFour = (response & 0x00400000) == 0x00400000,
|
||||
ThreeThree = (response & 0x00200000) == 0x00200000, ThreeTwo = (response & 0x00100000) == 0x00100000,
|
||||
ThreeOne = (response & 0x00080000) == 0x00080000, ThreeZero = (response & 0x00040000) == 0x00040000,
|
||||
TwoNine = (response & 0x00020000) == 0x00020000, TwoEight = (response & 0x00010000) == 0x00010000,
|
||||
TwoSeven = (response & 0x00008000) == 0x00008000, LowPower = (response & 0x00000080) == 0x00000080
|
||||
PowerUp = (response & 0x80000000) == 0x80000000,
|
||||
CCS = (response & 0x40000000) == 0x40000000,
|
||||
UHS = (response & 0x20000000) == 0x20000000,
|
||||
OneEight = (response & 0x01000000) == 0x01000000,
|
||||
ThreeFive = (response & 0x00800000) == 0x00800000,
|
||||
ThreeFour = (response & 0x00400000) == 0x00400000,
|
||||
ThreeThree = (response & 0x00200000) == 0x00200000,
|
||||
ThreeTwo = (response & 0x00100000) == 0x00100000,
|
||||
ThreeOne = (response & 0x00080000) == 0x00080000,
|
||||
ThreeZero = (response & 0x00040000) == 0x00040000,
|
||||
TwoNine = (response & 0x00020000) == 0x00020000,
|
||||
TwoEight = (response & 0x00010000) == 0x00010000,
|
||||
TwoSeven = (response & 0x00008000) == 0x00008000,
|
||||
LowPower = (response & 0x00000080) == 0x00000080
|
||||
};
|
||||
|
||||
public static OCR DecodeOCR(byte[] response) =>
|
||||
|
||||
@@ -78,15 +78,17 @@ namespace Aaru.Decoders.SecureDigital
|
||||
|
||||
var scr = new SCR
|
||||
{
|
||||
Structure = (byte)((response[0] & 0xF0) >> 4), Spec = (byte)(response[0] & 0x0F),
|
||||
DataStatusAfterErase = (response[1] & 0x80) == 0x80,
|
||||
Structure = (byte)((response[0] & 0xF0) >> 4),
|
||||
Spec = (byte)(response[0] & 0x0F),
|
||||
DataStatusAfterErase = (response[1] & 0x80) == 0x80,
|
||||
Security = (byte)((response[1] & 0x70) >> 4),
|
||||
BusWidth = (byte)(response[1] & 0x0F),
|
||||
Spec3 = (response[2] & 0x80) == 0x80,
|
||||
ExtendedSecurity = (byte)((response[2] & 0x78) >> 3),
|
||||
Spec4 = (response[2] & 0x04) == 0x04,
|
||||
SpecX = (byte)(((response[2] & 0x03) << 2) + ((response[3] & 0xC0) >> 6)),
|
||||
CommandSupport = (byte)(response[3] & 0x0F), ManufacturerReserved = new byte[4]
|
||||
CommandSupport = (byte)(response[3] & 0x0F),
|
||||
ManufacturerReserved = new byte[4]
|
||||
};
|
||||
|
||||
Array.Copy(response, 4, scr.ManufacturerReserved, 0, 4);
|
||||
|
||||
15
Xbox/DMI.cs
15
Xbox/DMI.cs
@@ -90,8 +90,10 @@ namespace Aaru.Decoders.Xbox
|
||||
|
||||
var dmi = new XboxDMI
|
||||
{
|
||||
DataLength = (ushort)((response[0] << 8) + response[1]), Reserved1 = response[2],
|
||||
Reserved2 = response[3], Version = BitConverter.ToUInt32(response, 4),
|
||||
DataLength = (ushort)((response[0] << 8) + response[1]),
|
||||
Reserved1 = response[2],
|
||||
Reserved2 = response[3],
|
||||
Version = BitConverter.ToUInt32(response, 4),
|
||||
Timestamp = BitConverter.ToInt64(response, 20)
|
||||
};
|
||||
|
||||
@@ -111,9 +113,12 @@ namespace Aaru.Decoders.Xbox
|
||||
|
||||
var dmi = new Xbox360DMI
|
||||
{
|
||||
DataLength = (ushort)((response[0] << 8) + response[1]), Reserved1 = response[2],
|
||||
Reserved2 = response[3], Version = BitConverter.ToUInt32(response, 4),
|
||||
Timestamp = BitConverter.ToInt64(response, 20), MediaID = new byte[16]
|
||||
DataLength = (ushort)((response[0] << 8) + response[1]),
|
||||
Reserved1 = response[2],
|
||||
Reserved2 = response[3],
|
||||
Version = BitConverter.ToUInt32(response, 4),
|
||||
Timestamp = BitConverter.ToInt64(response, 20),
|
||||
MediaID = new byte[16]
|
||||
};
|
||||
|
||||
Array.Copy(response, 36, dmi.MediaID, 0, 16);
|
||||
|
||||
53
Xbox/SS.cs
53
Xbox/SS.cs
@@ -52,34 +52,34 @@ namespace Aaru.Decoders.Xbox
|
||||
var ss = new SecuritySector
|
||||
{
|
||||
DiskCategory = (DiskCategory)((response[0] & 0xF0) >> 4),
|
||||
PartVersion = (byte)(response[0] & 0x0F),
|
||||
DiscSize = (DVDSize)((response[1] & 0xF0) >> 4),
|
||||
MaximumRate = (MaximumRateField)(response[1] & 0x0F),
|
||||
Reserved3 =
|
||||
(response[2] & 0x80) ==
|
||||
0x80,
|
||||
PartVersion = (byte)(response[0] & 0x0F),
|
||||
DiscSize = (DVDSize)((response[1] & 0xF0) >> 4),
|
||||
MaximumRate = (MaximumRateField)(response[1] & 0x0F),
|
||||
Reserved3 = (response[2] & 0x80) == 0x80,
|
||||
Layers = (byte)((response[2] & 0x60) >> 5),
|
||||
TrackPath =
|
||||
(response[2] & 0x08) ==
|
||||
0x08,
|
||||
LayerType = (LayerTypeFieldMask)(response[2] & 0x07),
|
||||
TrackPath = (response[2] & 0x08) == 0x08,
|
||||
LayerType = (LayerTypeFieldMask)(response[2] & 0x07),
|
||||
LinearDensity = (LinearDensityField)((response[3] & 0xF0) >> 4),
|
||||
TrackDensity = (TrackDensityField)(response[3] & 0x0F),
|
||||
DataAreaStartPSN =
|
||||
(uint)((response[4] << 24) + (response[5] << 16) + (response[6] << 8) + response[7]),
|
||||
DataAreaEndPSN =
|
||||
(uint)((response[8] << 24) + (response[9] << 16) + (response[10] << 8) + response[11]),
|
||||
Layer0EndPSN =
|
||||
(uint)((response[12] << 24) + (response[13] << 16) + (response[14] << 8) + response[15]),
|
||||
Unknown1 = response[27], Unknown2 = new byte[28],
|
||||
Unknown3 = new byte[436], Unknown4 = new byte[4],
|
||||
Unknown5 = new byte[43], ChallengeTableVersion = response[768],
|
||||
TrackDensity = (TrackDensityField)(response[3] & 0x0F),
|
||||
DataAreaStartPSN = (uint)((response[4] << 24) + (response[5] << 16) + (response[6] << 8) + response[7]),
|
||||
DataAreaEndPSN = (uint)((response[8] << 24) + (response[9] << 16) + (response[10] << 8) + response[11]),
|
||||
Layer0EndPSN = (uint)((response[12] << 24) + (response[13] << 16) + (response[14] << 8) + response[15]),
|
||||
Unknown1 = response[27],
|
||||
Unknown2 = new byte[28],
|
||||
Unknown3 = new byte[436],
|
||||
Unknown4 = new byte[4],
|
||||
Unknown5 = new byte[43],
|
||||
ChallengeTableVersion = response[768],
|
||||
NoChallengeEntries = response[769],
|
||||
ChallengeEntries = new ChallengeEntry[23], Unknown6 = response[1023],
|
||||
Unknown7 = new byte[48],
|
||||
Unknown8 = new byte[16], Unknown9 = new byte[16],
|
||||
Unknown10 = new byte[303], Unknown11 = new byte[104],
|
||||
Extents = new SecuritySectorExtent[23], ExtentsCopy = new SecuritySectorExtent[23]
|
||||
ChallengeEntries = new ChallengeEntry[23],
|
||||
Unknown6 = response[1023],
|
||||
Unknown7 = new byte[48],
|
||||
Unknown8 = new byte[16],
|
||||
Unknown9 = new byte[16],
|
||||
Unknown10 = new byte[303],
|
||||
Unknown11 = new byte[104],
|
||||
Extents = new SecuritySectorExtent[23],
|
||||
ExtentsCopy = new SecuritySectorExtent[23]
|
||||
};
|
||||
|
||||
Array.Copy(response, 256, ss.Unknown2, 0, 28);
|
||||
@@ -90,7 +90,8 @@ namespace Aaru.Decoders.Xbox
|
||||
for(int i = 0; i < 23; i++)
|
||||
ss.ChallengeEntries[i] = new ChallengeEntry
|
||||
{
|
||||
Level = response[770 + (i * 11) + 0], ChallengeId = response[770 + (i * 11) + 1],
|
||||
Level = response[770 + (i * 11) + 0],
|
||||
ChallengeId = response[770 + (i * 11) + 1],
|
||||
ChallengeValue = (uint)((response[770 + (i * 11) + 2] << 24) +
|
||||
(response[770 + (i * 11) + 3] << 16) + (response[770 + (i * 11) + 4] << 8) +
|
||||
response[770 + (i * 11) + 5]),
|
||||
|
||||
Reference in New Issue
Block a user