mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Add --title-keys and --store-encrypted commands
This commit is contained in:
@@ -96,6 +96,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
int _speedMultiplier;
|
||||
bool _supportsPlextorD8;
|
||||
bool _decryption;
|
||||
bool _storeEncrypted;
|
||||
bool _titleKeys;
|
||||
|
||||
/// <summary>Initializes dumpers</summary>
|
||||
/// <param name="doResume">Should resume?</param>
|
||||
@@ -133,6 +135,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
/// <param name="maximumReadable">Number of maximum blocks to be read at once (can be overriden by database)</param>
|
||||
/// <param name="useBufferedReads">
|
||||
/// <param name="decryption">If decryption should be used.</param>
|
||||
/// <param name="storeEncrypted">Store encrypted data as is</param>
|
||||
/// <param name="titleKeys">Dump DVD CSS title keys</param>
|
||||
/// If MMC/SD does not support CMD23, use OS buffered reads instead of multiple single block
|
||||
/// commands
|
||||
/// </param>
|
||||
@@ -143,7 +147,7 @@ namespace Aaru.Core.Devices.Dumping
|
||||
bool fixOffset, bool debug, DumpSubchannel subchannel, int speed, bool @private,
|
||||
bool fixSubchannelPosition, bool retrySubchannel, bool fixSubchannel, bool fixSubchannelCrc,
|
||||
bool skipCdireadyHole, ErrorLog errorLog, bool generateSubchannels, uint maximumReadable,
|
||||
bool useBufferedReads, bool decryption)
|
||||
bool useBufferedReads, bool decryption, bool storeEncrypted, bool titleKeys)
|
||||
{
|
||||
_doResume = doResume;
|
||||
_dev = dev;
|
||||
@@ -182,6 +186,8 @@ namespace Aaru.Core.Devices.Dumping
|
||||
_generateSubchannels = generateSubchannels;
|
||||
_useBufferedReads = useBufferedReads;
|
||||
_decryption = decryption;
|
||||
_storeEncrypted = storeEncrypted;
|
||||
_titleKeys = titleKeys;
|
||||
}
|
||||
|
||||
/// <summary>Starts dumping with the established fields and autodetecting the device type</summary>
|
||||
|
||||
@@ -289,6 +289,24 @@ namespace Aaru.Commands.Media
|
||||
Required = false
|
||||
});
|
||||
|
||||
Add(new Option(new[]
|
||||
{
|
||||
"--store-encrypted"
|
||||
}, "Store encrypted data as is.")
|
||||
{
|
||||
Argument = new Argument<bool>(() => true),
|
||||
Required = false
|
||||
});
|
||||
|
||||
Add(new Option(new[]
|
||||
{
|
||||
"--title-keys"
|
||||
}, "Try to read the title keys from CSS encrypted DVDs (very slow).")
|
||||
{
|
||||
Argument = new Argument<bool>(() => true),
|
||||
Required = false
|
||||
});
|
||||
|
||||
Handler = CommandHandler.Create(GetType().GetMethod(nameof(Invoke)));
|
||||
}
|
||||
|
||||
@@ -298,7 +316,8 @@ namespace Aaru.Commands.Media
|
||||
uint skip, byte speed, bool stopOnError, string format, string subchannel,
|
||||
bool @private, bool fixSubchannelPosition, bool retrySubchannel, bool fixSubchannel,
|
||||
bool fixSubchannelCrc, bool generateSubchannels, bool skipCdiReadyHole, bool eject,
|
||||
uint maxBlocks, bool useBufferedReads, bool decryption)
|
||||
uint maxBlocks, bool useBufferedReads, bool decryption, bool storeEncrypted,
|
||||
bool titleKeys)
|
||||
{
|
||||
MainClass.PrintCopyright();
|
||||
|
||||
@@ -348,6 +367,8 @@ namespace Aaru.Commands.Media
|
||||
AaruConsole.DebugWriteLine("Dump-Media command", "--eject={0}", eject);
|
||||
AaruConsole.DebugWriteLine("Dump-Media command", "--max-blocks={0}", maxBlocks);
|
||||
AaruConsole.DebugWriteLine("Dump-Media command", "--use-buffered-reads={0}", useBufferedReads);
|
||||
AaruConsole.DebugWriteLine("Dump-Media command", "--store-encrypted={0}", storeEncrypted);
|
||||
AaruConsole.DebugWriteLine("Dump-Media command", "--title-keys={0}", titleKeys);
|
||||
|
||||
// TODO: Disabled temporarily
|
||||
//AaruConsole.DebugWriteLine("Dump-Media command", "--raw={0}", raw);
|
||||
@@ -546,11 +567,12 @@ namespace Aaru.Commands.Media
|
||||
return (int)ErrorNumber.InvalidResume;
|
||||
}
|
||||
|
||||
if(resumeClass != null &&
|
||||
resumeClass.NextBlock > resumeClass.LastBlock &&
|
||||
resumeClass.BadBlocks.Count == 0 &&
|
||||
!resumeClass.Tape &&
|
||||
(resumeClass.BadSubchannels is null || resumeClass.BadSubchannels.Count == 0))
|
||||
if(resumeClass != null &&
|
||||
resumeClass.NextBlock > resumeClass.LastBlock &&
|
||||
resumeClass.BadBlocks.Count == 0 &&
|
||||
!resumeClass.Tape &&
|
||||
(resumeClass.BadSubchannels is null || resumeClass.BadSubchannels.Count == 0) &&
|
||||
(resumeClass.MissingTitleKeys is null || resumeClass.MissingTitleKeys.Count == 0))
|
||||
{
|
||||
AaruConsole.WriteLine("Media already dumped correctly, not continuing...");
|
||||
|
||||
@@ -635,7 +657,7 @@ namespace Aaru.Commands.Media
|
||||
firstPregap, fixOffset, debug, wantedSubchannel, speed, @private,
|
||||
fixSubchannelPosition, retrySubchannel, fixSubchannel, fixSubchannelCrc,
|
||||
skipCdiReadyHole, errorLog, generateSubchannels, maxBlocks, useBufferedReads,
|
||||
decryption);
|
||||
decryption, storeEncrypted, titleKeys);
|
||||
|
||||
dumper.UpdateStatus += Progress.UpdateStatus;
|
||||
dumper.ErrorMessage += Progress.ErrorMessage;
|
||||
|
||||
Reference in New Issue
Block a user