diff --git a/Aaru.CommonTypes b/Aaru.CommonTypes index 16780e9ba..069a2e39c 160000 --- a/Aaru.CommonTypes +++ b/Aaru.CommonTypes @@ -1 +1 @@ -Subproject commit 16780e9ba347611281018ed421bad0fd9a4fcf95 +Subproject commit 069a2e39cc118e420237022873f8d376b33b2a90 diff --git a/Aaru.Core/Devices/Dumping/MMC.cs b/Aaru.Core/Devices/Dumping/MMC.cs index 81bb073ba..349eefa63 100644 --- a/Aaru.Core/Devices/Dumping/MMC.cs +++ b/Aaru.Core/Devices/Dumping/MMC.cs @@ -59,8 +59,9 @@ namespace Aaru.Core.Devices.Dumping MediaType dskType = MediaType.Unknown; bool sense; byte[] tmpBuf; - bool compactDisc = true; - bool isXbox = false; + bool compactDisc = true; + bool gotConfiguration = false; + bool isXbox = false; _speedMultiplier = 1; // TODO: Log not only what is it reading, but if it was read correctly or not. @@ -69,6 +70,7 @@ namespace Aaru.Core.Devices.Dumping if(!sense) { + gotConfiguration = true; Features.SeparatedFeatures ftr = Features.Separate(cmdBuf); _dumpLog.WriteLine("Device reports current profile is 0x{0:X4}", ftr.CurrentProfile); @@ -248,8 +250,9 @@ namespace Aaru.Core.Devices.Dumping decMode = Modes.DecodeMode10(cmdBuf, PeripheralDeviceTypes.MultiMediaDevice); } - if(decMode.HasValue && - _dev.IsUsb && + if(decMode.HasValue && + _dev.IsUsb && + !gotConfiguration && (decMode.Value.Header.MediumType == MediumTypes.UnknownBlockDevice || decMode.Value.Header.MediumType == MediumTypes.ReadOnlyBlockDevice || decMode.Value.Header.MediumType == MediumTypes.ReadWriteBlockDevice)) diff --git a/Aaru.Core/Devices/Dumping/SSC.cs b/Aaru.Core/Devices/Dumping/SSC.cs index 5e44e607e..f168d3768 100644 --- a/Aaru.Core/Devices/Dumping/SSC.cs +++ b/Aaru.Core/Devices/Dumping/SSC.cs @@ -309,7 +309,7 @@ namespace Aaru.Core.Devices.Dumping if(dskType == MediaType.Unknown) dskType = MediaTypeFromDevice.GetFromScsi((byte)_dev.ScsiType, _dev.Manufacturer, _dev.Model, scsiMediumTypeTape, scsiDensityCodeTape, blocks, blockSize, - _dev.IsUsb); + _dev.IsUsb, false); if(dskType == MediaType.Unknown) dskType = MediaType.UnknownTape; diff --git a/Aaru.Core/Devices/Dumping/Sbc/Dump.cs b/Aaru.Core/Devices/Dumping/Sbc/Dump.cs index f12fd6983..d221dbb29 100644 --- a/Aaru.Core/Devices/Dumping/Sbc/Dump.cs +++ b/Aaru.Core/Devices/Dumping/Sbc/Dump.cs @@ -181,7 +181,7 @@ namespace Aaru.Core.Devices.Dumping if(dskType == MediaType.Unknown) dskType = MediaTypeFromDevice.GetFromScsi((byte)_dev.ScsiType, _dev.Manufacturer, _dev.Model, scsiMediumType, scsiDensityCode, blocks + 1, blockSize, - _dev.IsUsb); + _dev.IsUsb, opticalDisc); if(_dev.ScsiType == PeripheralDeviceTypes.MultiMediaDevice) MMC.DetectDiscType(ref dskType, 1, null, _dev, out _, out _, 0); diff --git a/Aaru.Core/Media/Info/ScsiInfo.cs b/Aaru.Core/Media/Info/ScsiInfo.cs index 53b0ad50e..731115ceb 100644 --- a/Aaru.Core/Media/Info/ScsiInfo.cs +++ b/Aaru.Core/Media/Info/ScsiInfo.cs @@ -283,8 +283,7 @@ namespace Aaru.Core.Media.Info break; } - if(dev.ScsiType == PeripheralDeviceTypes.MultiMediaDevice && - !(dev.IsUsb && (scsiMediumType == 0x40 || scsiMediumType == 0x41 || scsiMediumType == 0x42))) + if(dev.ScsiType == PeripheralDeviceTypes.MultiMediaDevice) { sense = dev.GetConfiguration(out cmdBuf, out senseBuf, 0, MmcGetConfigurationRt.Current, dev.Timeout, out _); @@ -293,6 +292,10 @@ namespace Aaru.Core.Media.Info { AaruConsole.DebugWriteLine("Media-Info command", "READ GET CONFIGURATION:\n{0}", Sense.PrettifySense(senseBuf)); + + if(dev.IsUsb && + (scsiMediumType == 0x40 || scsiMediumType == 0x41 || scsiMediumType == 0x42)) + MediaType = MediaType.FlashDrive; } else { @@ -1398,7 +1401,7 @@ namespace Aaru.Core.Media.Info case MediaType.Unknown: MediaType = MediaTypeFromDevice.GetFromScsi((byte)dev.ScsiType, dev.Manufacturer, dev.Model, scsiMediumType, scsiDensityCode, Blocks, BlockSize, - dev.IsUsb); + dev.IsUsb, true); break; } diff --git a/Aaru.Images/ZZZRawImage/Read.cs b/Aaru.Images/ZZZRawImage/Read.cs index 36727e553..afea09f80 100644 --- a/Aaru.Images/ZZZRawImage/Read.cs +++ b/Aaru.Images/ZZZRawImage/Read.cs @@ -992,7 +992,8 @@ namespace Aaru.DiscImages densityCode, _imageInfo.Sectors, _imageInfo.SectorSize, _mediaTags.ContainsKey(MediaTagType. - USB_Descriptors)); + USB_Descriptors), + _rawCompactDisc); } if(_imageInfo.MediaType == MediaType.Unknown)