Fix bugs in dumping, and reading/writing aaruformat

This commit is contained in:
Rebecca Wallander
2021-01-15 11:43:05 +01:00
parent 89bbbbc712
commit f30bc69c13
4 changed files with 21 additions and 6 deletions

View File

@@ -63,7 +63,7 @@ namespace Aaru.Core.Devices.Dumping
void ReadSbcData(in ulong blocks, in uint maxBlocksToRead, in uint blockSize, DumpHardwareType currentTry,
ExtentsULong extents, ref double currentSpeed, ref double minSpeed, ref double maxSpeed,
ref double totalDuration, Reader scsiReader, MhddLog mhddLog, IbgLog ibgLog,
ref double imageWriteDuration, ref bool newTrim, DVDDecryption dvdDecrypt, byte[] discKey)
ref double imageWriteDuration, ref bool newTrim, ref DVDDecryption dvdDecrypt, byte[] discKey)
{
ulong sectorSpeedStart = 0;
bool sense;

View File

@@ -667,6 +667,12 @@ namespace Aaru.Core.Devices.Dumping
bool newTrim = false;
if(_decryption && _titleKeys)
{
UpdateStatus?.Invoke("Title keys dumping is enabled. This will be very slow.");
_resume.MissingTitleKeys ??= new List<ulong>(Enumerable.Range(0, (int)blocks).Select(n => (ulong)n));
}
if(_dev.ScsiType == PeripheralDeviceTypes.OpticalDevice)
ReadOpticalData(blocks, blocksToRead, blockSize, currentTry, extents, ref currentSpeed, ref minSpeed,
ref maxSpeed, ref totalDuration, scsiReader, mhddLog, ibgLog, ref imageWriteDuration,
@@ -674,7 +680,7 @@ namespace Aaru.Core.Devices.Dumping
else
ReadSbcData(blocks, blocksToRead, blockSize, currentTry, extents, ref currentSpeed, ref minSpeed,
ref maxSpeed, ref totalDuration, scsiReader, mhddLog, ibgLog, ref imageWriteDuration,
ref newTrim, dvdDecrypt, mediaTags[MediaTagType.DVD_DiscKey_Decrypted]);
ref newTrim, ref dvdDecrypt, mediaTags[MediaTagType.DVD_DiscKey_Decrypted]);
end = DateTime.UtcNow;
mhddLog.Close();

View File

@@ -366,7 +366,7 @@ namespace Aaru.DiscImages
GC.GetTotalMemory(false));
break;
case DataType.DvdDiscKeyDecrypted:
case DataType.DvdSectorTitleKeyDecrypted:
_sectorDecryptedTitleKey = data;
if(!_imageInfo.ReadableSectorTags.Contains(SectorTagType.DvdTitleKeyDecrypted))

View File

@@ -537,6 +537,12 @@ namespace Aaru.DiscImages
case DataType.DvdSectorCpiMai:
_sectorCpiMai = data;
if(!_imageInfo.ReadableSectorTags.Contains(SectorTagType.DvdCmi))
_imageInfo.ReadableSectorTags.Add(SectorTagType.DvdCmi);
if(!_imageInfo.ReadableSectorTags.Contains(SectorTagType.DvdTitleKey))
_imageInfo.ReadableSectorTags.Add(SectorTagType.DvdTitleKey);
AaruConsole.DebugWriteLine("Aaru Format plugin", "Memory snapshot: {0} bytes",
GC.GetTotalMemory(false));
@@ -544,6 +550,9 @@ namespace Aaru.DiscImages
case DataType.DvdSectorTitleKeyDecrypted:
_sectorDecryptedTitleKey = data;
if(!_imageInfo.ReadableSectorTags.Contains(SectorTagType.DvdTitleKeyDecrypted))
_imageInfo.ReadableSectorTags.Add(SectorTagType.DvdTitleKeyDecrypted);
AaruConsole.DebugWriteLine("Aaru Format plugin", "Memory snapshot: {0} bytes",
GC.GetTotalMemory(false));
break;