mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Strengthen the detection of needing to dump DVD title keys
This commit is contained in:
@@ -105,9 +105,9 @@ namespace Aaru.Core.Devices.Dumping
|
||||
if(!sense &&
|
||||
!_dev.Error)
|
||||
{
|
||||
if(Settings.Settings.Current.EnableDecryption)
|
||||
{
|
||||
if(_titleKeys && discKey != null)
|
||||
if(Settings.Settings.Current.EnableDecryption &&
|
||||
discKey != null &&
|
||||
_titleKeys)
|
||||
{
|
||||
for(ulong j = 0; j < blocksToRead; j++)
|
||||
{
|
||||
@@ -115,14 +115,14 @@ namespace Aaru.Core.Devices.Dumping
|
||||
break;
|
||||
|
||||
if(!_resume.MissingTitleKeys.Contains(i + j))
|
||||
|
||||
// Key is already dumped.
|
||||
continue;
|
||||
|
||||
byte[] tmpBuf;
|
||||
|
||||
bool tmpSense = dvdDecrypt.ReadTitleKey(out tmpBuf, out _,
|
||||
DvdCssKeyClass.DvdCssCppmOrCprm, i + j,
|
||||
_dev.Timeout, out _);
|
||||
bool tmpSense = dvdDecrypt.ReadTitleKey(out tmpBuf, out _, DvdCssKeyClass.DvdCssCppmOrCprm,
|
||||
i + j, _dev.Timeout, out _);
|
||||
|
||||
if(!tmpSense)
|
||||
{
|
||||
@@ -181,15 +181,16 @@ namespace Aaru.Core.Devices.Dumping
|
||||
_outputPlugin.WriteSectorTag(tmpBuf, i + j, SectorTagType.DvdTitleKeyDecrypted);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!_storeEncrypted && _titleKeys)
|
||||
if(!_storeEncrypted)
|
||||
|
||||
// Todo: Flag in the _outputPlugin that a sector has been decrypted
|
||||
buffer = CSS.DecryptSector(buffer,
|
||||
_outputPlugin.ReadSectorsTag(i, blocksToRead, SectorTagType.DvdCmi),
|
||||
_outputPlugin.ReadSectorsTag(i, blocksToRead,
|
||||
SectorTagType.DvdTitleKeyDecrypted),
|
||||
blocksToRead, blockSize);
|
||||
SectorTagType.DvdCmi),
|
||||
_outputPlugin.ReadSectorsTag(i, blocksToRead,
|
||||
SectorTagType.DvdTitleKeyDecrypted), blocksToRead,
|
||||
blockSize);
|
||||
}
|
||||
|
||||
mhddLog.Write(i, cmdDuration);
|
||||
|
||||
@@ -668,7 +668,9 @@ namespace Aaru.Core.Devices.Dumping
|
||||
|
||||
bool newTrim = false;
|
||||
|
||||
if(Settings.Settings.Current.EnableDecryption && _titleKeys)
|
||||
if(Settings.Settings.Current.EnableDecryption &&
|
||||
_titleKeys &&
|
||||
dskType == MediaType.DVDROM)
|
||||
{
|
||||
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));
|
||||
|
||||
Reference in New Issue
Block a user