Add option to skip retrying sectors usually used by SafeDisc copy protection.

This commit is contained in:
2026-07-08 10:49:44 +01:00
parent 3e2d251dbc
commit e94fe5d226
5 changed files with 18 additions and 6 deletions

View File

@@ -260,6 +260,8 @@ partial class Dump
break; break;
} }
if(_skipSafedisc && badSector is >= 800 and <= 10000) continue;
if(forward) if(forward)
{ {
PulseProgress?.Invoke(runningPersistent PulseProgress?.Invoke(runningPersistent
@@ -542,9 +544,8 @@ partial class Dump
// MEDIUM ERROR, retry with ignore error below // MEDIUM ERROR, retry with ignore error below
if(decSense is { ASC: 0x11 }) if(decSense is { ASC: 0x11 })
{ if(!sectorsNotEvenPartial.Contains(badSector))
if(!sectorsNotEvenPartial.Contains(badSector)) sectorsNotEvenPartial.Add(badSector); sectorsNotEvenPartial.Add(badSector);
}
} }
// Because one block has been partially used to fix the offset // Because one block has been partially used to fix the offset

View File

@@ -122,6 +122,8 @@ partial class Dump
break; break;
} }
if(_skipSafedisc && badSector is >= 800 and <= 10000) continue;
PulseProgress?.Invoke(string.Format(Localization.Core.Trimming_sector_0, badSector)); PulseProgress?.Invoke(string.Format(Localization.Core.Trimming_sector_0, badSector));
Track track = tracks.OrderBy(static t => t.StartSector).LastOrDefault(t => badSector >= t.StartSector); Track track = tracks.OrderBy(static t => t.StartSector).LastOrDefault(t => badSector >= t.StartSector);

View File

@@ -94,6 +94,7 @@ public partial class Dump
readonly bool _hyperSpeed; readonly bool _hyperSpeed;
readonly uint _ignoreCdrRunOuts; readonly uint _ignoreCdrRunOuts;
readonly Stopwatch _imageCloseStopwatch; readonly Stopwatch _imageCloseStopwatch;
readonly bool _leadout;
readonly bool _metadata; readonly bool _metadata;
readonly string _outputPath; readonly string _outputPath;
readonly IBaseWritableImage _outputPlugin; readonly IBaseWritableImage _outputPlugin;
@@ -121,7 +122,6 @@ public partial class Dump
bool _dumpFirstTrackPregap; bool _dumpFirstTrackPregap;
bool _fixOffset; bool _fixOffset;
int _fixedSectors; int _fixedSectors;
readonly bool _leadout;
uint _maximumReadable; // Maximum number of sectors drive can read at once uint _maximumReadable; // Maximum number of sectors drive can read at once
IMediaGraph _mediaGraph; IMediaGraph _mediaGraph;
bool _missingTitleKeysDirty; bool _missingTitleKeysDirty;
@@ -131,6 +131,7 @@ public partial class Dump
Sidecar _sidecarClass; Sidecar _sidecarClass;
uint _skip; uint _skip;
bool _skipCdireadyHole; bool _skipCdireadyHole;
readonly bool _skipSafedisc;
int _speed; int _speed;
int _speedMultiplier; int _speedMultiplier;
bool _supportsPlextorD8; bool _supportsPlextorD8;
@@ -191,7 +192,7 @@ public partial class Dump
bool generateSubchannels, uint maximumReadable, bool useBufferedReads, bool storeEncrypted, bool generateSubchannels, uint maximumReadable, bool useBufferedReads, bool storeEncrypted,
bool titleKeys, uint ignoreCdrRunOuts, bool createGraph, uint dimensions, bool paranoia, bool titleKeys, uint ignoreCdrRunOuts, bool createGraph, uint dimensions, bool paranoia,
bool cureParanoia, bool bypassWiiDecryption, bool startReverse, int errorRecovery, bool hyperSpeed, bool cureParanoia, bool bypassWiiDecryption, bool startReverse, int errorRecovery, bool hyperSpeed,
bool absurdSpeed, bool leadout) bool absurdSpeed, bool leadout, bool skipSafedisc)
{ {
_doResume = doResume; _doResume = doResume;
_dev = dev; _dev = dev;
@@ -241,6 +242,7 @@ public partial class Dump
_hyperSpeed = hyperSpeed; _hyperSpeed = hyperSpeed;
_absurdSpeed = absurdSpeed; _absurdSpeed = absurdSpeed;
_leadout = leadout; _leadout = leadout;
_skipSafedisc = skipSafedisc;
_dumpStopwatch = new Stopwatch(); _dumpStopwatch = new Stopwatch();
_sidecarStopwatch = new Stopwatch(); _sidecarStopwatch = new Stopwatch();
_speedStopwatch = new Stopwatch(); _speedStopwatch = new Stopwatch();

View File

@@ -766,6 +766,7 @@ public sealed partial class MediaDumpViewModel : ViewModelBase
0, 0,
false, false,
false, false,
false,
false); false);
new Thread(DoWork).Start(); new Thread(DoWork).Start();

View File

@@ -131,6 +131,7 @@ sealed class DumpMediaCommand : Command<DumpMediaCommand.Settings>
AaruLogging.Debug(MODULE_NAME, "--hyper-speed={0}", settings.HyperSpeed); AaruLogging.Debug(MODULE_NAME, "--hyper-speed={0}", settings.HyperSpeed);
AaruLogging.Debug(MODULE_NAME, "--absurd-speed={0}", settings.AbsurdSpeed); AaruLogging.Debug(MODULE_NAME, "--absurd-speed={0}", settings.AbsurdSpeed);
AaruLogging.Debug(MODULE_NAME, "--lead-out={0}", settings.LeadOut); AaruLogging.Debug(MODULE_NAME, "--lead-out={0}", settings.LeadOut);
AaruLogging.Debug(MODULE_NAME, "--skip-safedisc={0}", settings.SkipSafeDisc);
Dictionary<string, string> parsedOptions = Options.Parse(settings.Options); Dictionary<string, string> parsedOptions = Options.Parse(settings.Options);
AaruLogging.Debug(MODULE_NAME, UI.Parsed_options); AaruLogging.Debug(MODULE_NAME, UI.Parsed_options);
@@ -556,7 +557,8 @@ sealed class DumpMediaCommand : Command<DumpMediaCommand.Settings>
settings.ErrorRecovery, settings.ErrorRecovery,
settings.HyperSpeed, settings.HyperSpeed,
settings.AbsurdSpeed, settings.AbsurdSpeed,
settings.LeadOut); settings.LeadOut,
settings.SkipSafeDisc);
AnsiConsole.Progress() AnsiConsole.Progress()
.AutoClear(true) .AutoClear(true)
@@ -848,6 +850,10 @@ sealed class DumpMediaCommand : Command<DumpMediaCommand.Settings>
[DefaultValue(false)] [DefaultValue(false)]
[CommandOption("--lead-out")] [CommandOption("--lead-out")]
public bool LeadOut { get; set; } public bool LeadOut { get; set; }
[Description("Skip retrying sectors from 800 to 10000, that are typically used by SafeDisc protection")]
[DefaultValue(false)]
[CommandOption("--skip-safedisc")]
public bool SkipSafeDisc { get; set; }
} }
#endregion #endregion