diff --git a/Aaru.Core/Devices/Dumping/ATA.cs b/Aaru.Core/Devices/Dumping/ATA.cs index 32fa3f7eb..529ed3cdb 100644 --- a/Aaru.Core/Devices/Dumping/ATA.cs +++ b/Aaru.Core/Devices/Dumping/ATA.cs @@ -228,8 +228,7 @@ namespace Aaru.Core.Devices.Dumping _dumpLog.WriteLine(_outputPlugin.ErrorMessage); StoppingErrorMessage?.Invoke("Error creating output image, not continuing." + - Environment.NewLine + - _outputPlugin.ErrorMessage); + Environment.NewLine + _outputPlugin.ErrorMessage); return; } @@ -337,8 +336,7 @@ namespace Aaru.Core.Devices.Dumping mhddLog.Close(); ibgLog.Close(_dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024, - (blockSize * (double)(blocks + 1)) / 1024 / - (totalDuration / 1000), _devicePath); + (blockSize * (double)(blocks + 1)) / 1024 / (totalDuration / 1000), _devicePath); UpdateStatus?.Invoke($"Dump finished in {(end - start).TotalSeconds} seconds."); @@ -451,7 +449,9 @@ namespace Aaru.Core.Devices.Dumping pass++; forward = !forward; _resume.BadBlocks.Sort(); - _resume.BadBlocks.Reverse(); + + if(!forward) + _resume.BadBlocks.Reverse(); goto repeatRetryLba; } @@ -557,8 +557,7 @@ namespace Aaru.Core.Devices.Dumping mhddLog.Close(); ibgLog.Close(_dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024, - (blockSize * (double)(blocks + 1)) / 1024 / - (totalDuration / 1000), _devicePath); + (blockSize * (double)(blocks + 1)) / 1024 / (totalDuration / 1000), _devicePath); UpdateStatus?.Invoke($"Dump finished in {(end - start).TotalSeconds} seconds."); diff --git a/Aaru.Core/Devices/Dumping/CompactDisc/Error.cs b/Aaru.Core/Devices/Dumping/CompactDisc/Error.cs index 97ff24af5..7359e50ff 100644 --- a/Aaru.Core/Devices/Dumping/CompactDisc/Error.cs +++ b/Aaru.Core/Devices/Dumping/CompactDisc/Error.cs @@ -312,7 +312,9 @@ namespace Aaru.Core.Devices.Dumping pass++; forward = !forward; _resume.BadBlocks.Sort(); - _resume.BadBlocks.Reverse(); + + if(!forward) + _resume.BadBlocks.Reverse(); goto cdRepeatRetry; } diff --git a/Aaru.Core/Devices/Dumping/MiniDisc.cs b/Aaru.Core/Devices/Dumping/MiniDisc.cs index 38e2e3bcd..ce025fbc8 100644 --- a/Aaru.Core/Devices/Dumping/MiniDisc.cs +++ b/Aaru.Core/Devices/Dumping/MiniDisc.cs @@ -589,7 +589,9 @@ namespace Aaru.Core.Devices.Dumping pass++; forward = !forward; _resume.BadBlocks.Sort(); - _resume.BadBlocks.Reverse(); + + if(!forward) + _resume.BadBlocks.Reverse(); goto repeatRetry; } diff --git a/Aaru.Core/Devices/Dumping/PlayStationPortable/MemoryStick.cs b/Aaru.Core/Devices/Dumping/PlayStationPortable/MemoryStick.cs index bca2c96c2..e622fc789 100644 --- a/Aaru.Core/Devices/Dumping/PlayStationPortable/MemoryStick.cs +++ b/Aaru.Core/Devices/Dumping/PlayStationPortable/MemoryStick.cs @@ -238,8 +238,7 @@ namespace Aaru.Core.Devices.Dumping mhddLog.Close(); ibgLog.Close(_dev, blocks, BLOCK_SIZE, (end - start).TotalSeconds, currentSpeed * 1024, - (BLOCK_SIZE * (double)(blocks + 1)) / 1024 / (totalDuration / 1000), - _devicePath); + (BLOCK_SIZE * (double)(blocks + 1)) / 1024 / (totalDuration / 1000), _devicePath); UpdateStatus?.Invoke($"Dump finished in {(end - start).TotalSeconds} seconds."); @@ -442,7 +441,9 @@ namespace Aaru.Core.Devices.Dumping pass++; forward = !forward; _resume.BadBlocks.Sort(); - _resume.BadBlocks.Reverse(); + + if(!forward) + _resume.BadBlocks.Reverse(); goto repeatRetry; } diff --git a/Aaru.Core/Devices/Dumping/PlayStationPortable/UMD.cs b/Aaru.Core/Devices/Dumping/PlayStationPortable/UMD.cs index 92bb05429..fe51bb24e 100644 --- a/Aaru.Core/Devices/Dumping/PlayStationPortable/UMD.cs +++ b/Aaru.Core/Devices/Dumping/PlayStationPortable/UMD.cs @@ -255,8 +255,7 @@ namespace Aaru.Core.Devices.Dumping mhddLog.Close(); ibgLog.Close(_dev, blocks, BLOCK_SIZE, (end - start).TotalSeconds, currentSpeed * 1024, - (BLOCK_SIZE * (double)(blocks + 1)) / 1024 / (totalDuration / 1000), - _devicePath); + (BLOCK_SIZE * (double)(blocks + 1)) / 1024 / (totalDuration / 1000), _devicePath); UpdateStatus?.Invoke($"Dump finished in {(end - start).TotalSeconds} seconds."); @@ -444,7 +443,9 @@ namespace Aaru.Core.Devices.Dumping pass++; forward = !forward; _resume.BadBlocks.Sort(); - _resume.BadBlocks.Reverse(); + + if(!forward) + _resume.BadBlocks.Reverse(); goto repeatRetry; } diff --git a/Aaru.Core/Devices/Dumping/SBC.cs b/Aaru.Core/Devices/Dumping/SBC.cs index f0b6c0530..98217b8f3 100644 --- a/Aaru.Core/Devices/Dumping/SBC.cs +++ b/Aaru.Core/Devices/Dumping/SBC.cs @@ -800,7 +800,9 @@ namespace Aaru.Core.Devices.Dumping pass++; forward = !forward; _resume.BadBlocks.Sort(); - _resume.BadBlocks.Reverse(); + + if(!forward) + _resume.BadBlocks.Reverse(); goto repeatRetry; } diff --git a/Aaru.Core/Devices/Dumping/SSC.cs b/Aaru.Core/Devices/Dumping/SSC.cs index f9fc7ce7c..45b591657 100644 --- a/Aaru.Core/Devices/Dumping/SSC.cs +++ b/Aaru.Core/Devices/Dumping/SSC.cs @@ -168,8 +168,7 @@ namespace Aaru.Core.Devices.Dumping if(sense) { StoppingErrorMessage?.Invoke("Drive could not rewind, please correct. Sense follows..." + - Environment.NewLine + - strSense); + Environment.NewLine + strSense); _dumpLog.WriteLine("Drive could not rewind, please correct. Sense follows..."); @@ -197,8 +196,7 @@ namespace Aaru.Core.Devices.Dumping fxSense?.ASC != 0x00)) { StoppingErrorMessage?.Invoke("Drive could not rewind, please correct. Sense follows..." + - Environment.NewLine + - strSense); + Environment.NewLine + strSense); _dumpLog.WriteLine("Drive could not rewind, please correct. Sense follows..."); @@ -216,8 +214,7 @@ namespace Aaru.Core.Devices.Dumping fxSense = Sense.DecodeFixed(senseBuf, out strSense); StoppingErrorMessage?.Invoke("Drive could not rewind, please correct. Sense follows..." + - Environment.NewLine + - strSense); + Environment.NewLine + strSense); _dumpLog.WriteLine("Drive could not rewind, please correct. Sense follows..."); @@ -356,8 +353,7 @@ namespace Aaru.Core.Devices.Dumping !fxSense?.EOM == true) { StoppingErrorMessage?.Invoke("Drive could not return back. Sense follows..." + - Environment.NewLine + - strSense); + Environment.NewLine + strSense); _dumpLog.WriteLine("Drive could not return back. Sense follows..."); @@ -411,8 +407,7 @@ namespace Aaru.Core.Devices.Dumping fxSense = Sense.DecodeFixed(senseBuf, out strSense); StoppingErrorMessage?.Invoke("Drive could not go back one block. Sense follows..." + - Environment.NewLine + - strSense); + Environment.NewLine + strSense); _dumpLog.WriteLine("Drive could not go back one block. Sense follows..."); @@ -744,8 +739,7 @@ namespace Aaru.Core.Devices.Dumping _dumpLog.WriteLine(_outputPlugin.ErrorMessage); StoppingErrorMessage?.Invoke("Error setting output image in tape mode, not continuing." + - Environment.NewLine + - _outputPlugin.ErrorMessage); + Environment.NewLine + _outputPlugin.ErrorMessage); return; } @@ -902,8 +896,7 @@ namespace Aaru.Core.Devices.Dumping fxSense = Sense.DecodeFixed(senseBuf, out strSense); StoppingErrorMessage?.Invoke("Drive could not go back one block. Sense follows..." + - Environment.NewLine + - strSense); + Environment.NewLine + strSense); _outputPlugin.Close(); _dumpLog.WriteLine("Drive could not go back one block. Sense follows..."); @@ -944,8 +937,7 @@ namespace Aaru.Core.Devices.Dumping continue; } - if((fxSense?.SenseKey == SenseKeys.NoSense || - fxSense?.SenseKey == SenseKeys.RecoveredError) && + if((fxSense?.SenseKey == SenseKeys.NoSense || fxSense?.SenseKey == SenseKeys.RecoveredError) && (fxSense?.ASCQ == 0x02 || fxSense?.ASCQ == 0x05 || fxSense?.EOM == true)) { // TODO: Detect end of partition @@ -1048,8 +1040,7 @@ namespace Aaru.Core.Devices.Dumping mhddLog.Close(); ibgLog.Close(_dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024, - (blockSize * (double)(blocks + 1)) / 1024 / (totalDuration / 1000), - _devicePath); + (blockSize * (double)(blocks + 1)) / 1024 / (totalDuration / 1000), _devicePath); UpdateStatus?.Invoke($"Dump finished in {(end - start).TotalSeconds} seconds."); @@ -1200,7 +1191,9 @@ namespace Aaru.Core.Devices.Dumping pass++; forward = !forward; _resume.BadBlocks.Sort(); - _resume.BadBlocks.Reverse(); + + if(!forward) + _resume.BadBlocks.Reverse(); goto repeatRetry; } diff --git a/Aaru.Core/Devices/Dumping/SecureDigital.cs b/Aaru.Core/Devices/Dumping/SecureDigital.cs index 958235360..343453419 100644 --- a/Aaru.Core/Devices/Dumping/SecureDigital.cs +++ b/Aaru.Core/Devices/Dumping/SecureDigital.cs @@ -394,8 +394,7 @@ namespace Aaru.Core.Devices.Dumping mhddLog.Close(); ibgLog.Close(_dev, blocks, blockSize, (end - start).TotalSeconds, currentSpeed * 1024, - (blockSize * (double)(blocks + 1)) / 1024 / (totalDuration / 1000), - _devicePath); + (blockSize * (double)(blocks + 1)) / 1024 / (totalDuration / 1000), _devicePath); UpdateStatus?.Invoke($"Dump finished in {(end - start).TotalSeconds} seconds."); @@ -511,7 +510,9 @@ namespace Aaru.Core.Devices.Dumping pass++; forward = !forward; _resume.BadBlocks.Sort(); - _resume.BadBlocks.Reverse(); + + if(!forward) + _resume.BadBlocks.Reverse(); goto repeatRetryLba; } @@ -686,8 +687,7 @@ namespace Aaru.Core.Devices.Dumping _dumpLog.WriteLine("Cannot write Extended CSD to output image."); StoppingErrorMessage?.Invoke("Cannot write Extended CSD to output image." + - Environment.NewLine + - _outputPlugin.ErrorMessage); + Environment.NewLine + _outputPlugin.ErrorMessage); return; } diff --git a/Aaru.Core/Devices/Dumping/XGD.cs b/Aaru.Core/Devices/Dumping/XGD.cs index 66c4fb7a9..0c1ad1153 100644 --- a/Aaru.Core/Devices/Dumping/XGD.cs +++ b/Aaru.Core/Devices/Dumping/XGD.cs @@ -864,8 +864,7 @@ namespace Aaru.Core.Devices.Dumping mhddLog.Close(); ibgLog.Close(_dev, blocks, BLOCK_SIZE, (end - start).TotalSeconds, currentSpeed * 1024, - (BLOCK_SIZE * (double)(blocks + 1)) / 1024 / (totalDuration / 1000), - _devicePath); + (BLOCK_SIZE * (double)(blocks + 1)) / 1024 / (totalDuration / 1000), _devicePath); UpdateStatus?.Invoke($"Dump finished in {(end - start).TotalSeconds} seconds."); @@ -1083,7 +1082,9 @@ namespace Aaru.Core.Devices.Dumping pass++; forward = !forward; _resume.BadBlocks.Sort(); - _resume.BadBlocks.Reverse(); + + if(!forward) + _resume.BadBlocks.Reverse(); goto repeatRetry; }