mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Remove separate dump log, use central log facility.
This commit is contained in:
@@ -45,6 +45,7 @@ using Aaru.Core.Graphics;
|
|||||||
using Aaru.Core.Logging;
|
using Aaru.Core.Logging;
|
||||||
using Aaru.Decoders.ATA;
|
using Aaru.Decoders.ATA;
|
||||||
using Aaru.Decoders.PCMCIA;
|
using Aaru.Decoders.PCMCIA;
|
||||||
|
using Aaru.Logging;
|
||||||
using Humanizer;
|
using Humanizer;
|
||||||
using Humanizer.Bytes;
|
using Humanizer.Bytes;
|
||||||
using Humanizer.Localisation;
|
using Humanizer.Localisation;
|
||||||
@@ -85,7 +86,6 @@ public partial class Dump
|
|||||||
MediaType mediaType = MediaType.Unknown;
|
MediaType mediaType = MediaType.Unknown;
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Requesting_ATA_IDENTIFY_DEVICE);
|
UpdateStatus?.Invoke(Localization.Core.Requesting_ATA_IDENTIFY_DEVICE);
|
||||||
_dumpLog.WriteLine(Localization.Core.Requesting_ATA_IDENTIFY_DEVICE);
|
|
||||||
bool sense = _dev.AtaIdentify(out byte[] cmdBuf, out AtaErrorRegistersChs errorChs);
|
bool sense = _dev.AtaIdentify(out byte[] cmdBuf, out AtaErrorRegistersChs errorChs);
|
||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
@@ -107,7 +107,6 @@ public partial class Dump
|
|||||||
|
|
||||||
// Initialize reader
|
// Initialize reader
|
||||||
UpdateStatus?.Invoke(Localization.Core.Initializing_reader);
|
UpdateStatus?.Invoke(Localization.Core.Initializing_reader);
|
||||||
_dumpLog.WriteLine(Localization.Core.Initializing_reader);
|
|
||||||
var ataReader = new Reader(_dev, timeout, ataIdentify, _errorLog);
|
var ataReader = new Reader(_dev, timeout, ataIdentify, _errorLog);
|
||||||
|
|
||||||
// Fill reader blocks
|
// Fill reader blocks
|
||||||
@@ -116,7 +115,7 @@ public partial class Dump
|
|||||||
// Check block sizes
|
// Check block sizes
|
||||||
if(ataReader.GetBlockSize())
|
if(ataReader.GetBlockSize())
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.ERROR_Cannot_get_block_size_0, ataReader.ErrorMessage);
|
AaruLogging.Error(Localization.Core.ERROR_Cannot_get_block_size_0, ataReader.ErrorMessage);
|
||||||
ErrorMessage(ataReader.ErrorMessage);
|
ErrorMessage(ataReader.ErrorMessage);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -127,8 +126,8 @@ public partial class Dump
|
|||||||
|
|
||||||
if(ataReader.FindReadCommand())
|
if(ataReader.FindReadCommand())
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.ERROR_Cannot_find_correct_read_command_0,
|
AaruLogging.Error(Localization.Core.ERROR_Cannot_find_correct_read_command_0,
|
||||||
ataReader.ErrorMessage);
|
ataReader.ErrorMessage);
|
||||||
|
|
||||||
ErrorMessage(ataReader.ErrorMessage);
|
ErrorMessage(ataReader.ErrorMessage);
|
||||||
|
|
||||||
@@ -138,7 +137,7 @@ public partial class Dump
|
|||||||
// Check how many blocks to read, if error show and return
|
// Check how many blocks to read, if error show and return
|
||||||
if(ataReader.GetBlocksToRead(_maximumReadable))
|
if(ataReader.GetBlocksToRead(_maximumReadable))
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.ERROR_Cannot_get_blocks_to_read_0, ataReader.ErrorMessage);
|
AaruLogging.Error(Localization.Core.ERROR_Cannot_get_blocks_to_read_0, ataReader.ErrorMessage);
|
||||||
ErrorMessage(ataReader.ErrorMessage);
|
ErrorMessage(ataReader.ErrorMessage);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -167,17 +166,6 @@ public partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Device_reports_0_bytes_per_physical_block,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Device_reports_0_bytes_per_physical_block,
|
||||||
physicalSectorSize));
|
physicalSectorSize));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_reports_0_blocks_1_bytes, blocks, blocks * blockSize);
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_reports_0_cylinders_1_heads_2_sectors_per_track,
|
|
||||||
cylinders,
|
|
||||||
heads,
|
|
||||||
sectors);
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_can_read_0_blocks_at_a_time, blocksToRead);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_reports_0_bytes_per_logical_block, blockSize);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_reports_0_bytes_per_physical_block, physicalSectorSize);
|
|
||||||
|
|
||||||
bool removable = !_dev.IsCompactFlash &&
|
bool removable = !_dev.IsCompactFlash &&
|
||||||
ataId.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.Removable);
|
ataId.GeneralConfiguration.HasFlag(Identify.GeneralConfigurationBit.Removable);
|
||||||
|
|
||||||
@@ -209,14 +197,13 @@ public partial class Dump
|
|||||||
IbgLog ibgLog;
|
IbgLog ibgLog;
|
||||||
double duration;
|
double duration;
|
||||||
|
|
||||||
var ret = true;
|
bool ret = true;
|
||||||
|
|
||||||
if(_dev.IsUsb &&
|
if(_dev.IsUsb &&
|
||||||
_dev.UsbDescriptors != null &&
|
_dev.UsbDescriptors != null &&
|
||||||
!outputFormat.SupportedMediaTags.Contains(MediaTagType.USB_Descriptors))
|
!outputFormat.SupportedMediaTags.Contains(MediaTagType.USB_Descriptors))
|
||||||
{
|
{
|
||||||
ret = false;
|
ret = false;
|
||||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_USB_descriptors);
|
|
||||||
ErrorMessage(Localization.Core.Output_format_does_not_support_USB_descriptors);
|
ErrorMessage(Localization.Core.Output_format_does_not_support_USB_descriptors);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -225,27 +212,21 @@ public partial class Dump
|
|||||||
!outputFormat.SupportedMediaTags.Contains(MediaTagType.PCMCIA_CIS))
|
!outputFormat.SupportedMediaTags.Contains(MediaTagType.PCMCIA_CIS))
|
||||||
{
|
{
|
||||||
ret = false;
|
ret = false;
|
||||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_PCMCIA_CIS_descriptors);
|
|
||||||
ErrorMessage(Localization.Core.Output_format_does_not_support_PCMCIA_CIS_descriptors);
|
ErrorMessage(Localization.Core.Output_format_does_not_support_PCMCIA_CIS_descriptors);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!outputFormat.SupportedMediaTags.Contains(MediaTagType.ATA_IDENTIFY))
|
if(!outputFormat.SupportedMediaTags.Contains(MediaTagType.ATA_IDENTIFY))
|
||||||
{
|
{
|
||||||
ret = false;
|
ret = false;
|
||||||
_dumpLog.WriteLine(Localization.Core.Dump_Ata_Output_format_does_not_support_ATA_IDENTIFY_);
|
|
||||||
ErrorMessage(Localization.Core.Dump_Ata_Output_format_does_not_support_ATA_IDENTIFY_);
|
ErrorMessage(Localization.Core.Dump_Ata_Output_format_does_not_support_ATA_IDENTIFY_);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!ret)
|
if(!ret)
|
||||||
{
|
{
|
||||||
if(_force)
|
if(_force)
|
||||||
{
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Several_media_tags_not_supported_continuing);
|
|
||||||
ErrorMessage(Localization.Core.Several_media_tags_not_supported_continuing);
|
ErrorMessage(Localization.Core.Several_media_tags_not_supported_continuing);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Several_media_tags_not_supported_not_continuing);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Several_media_tags_not_supported_not_continuing);
|
StoppingErrorMessage?.Invoke(Localization.Core.Several_media_tags_not_supported_not_continuing);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -264,9 +245,6 @@ public partial class Dump
|
|||||||
// Cannot create image
|
// Cannot create image
|
||||||
if(!ret)
|
if(!ret)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Error_creating_output_image_not_continuing);
|
|
||||||
_dumpLog.WriteLine(outputFormat.ErrorMessage);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
|
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
outputFormat.ErrorMessage);
|
outputFormat.ErrorMessage);
|
||||||
@@ -296,10 +274,7 @@ public partial class Dump
|
|||||||
ibgLog = new IbgLog(_outputPrefix + ".ibg", ataProfile);
|
ibgLog = new IbgLog(_outputPrefix + ".ibg", ataProfile);
|
||||||
|
|
||||||
if(_resume.NextBlock > 0)
|
if(_resume.NextBlock > 0)
|
||||||
{
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Resuming_from_block_0, _resume.NextBlock));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Resuming_from_block_0, _resume.NextBlock));
|
||||||
_dumpLog.WriteLine(Localization.Core.Resuming_from_block_0, _resume.NextBlock);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(_createGraph)
|
if(_createGraph)
|
||||||
{
|
{
|
||||||
@@ -319,7 +294,7 @@ public partial class Dump
|
|||||||
_mediaGraph?.PaintSectorsBad(_resume.BadBlocks);
|
_mediaGraph?.PaintSectorsBad(_resume.BadBlocks);
|
||||||
}
|
}
|
||||||
|
|
||||||
var newTrim = false;
|
bool newTrim = false;
|
||||||
|
|
||||||
_dumpStopwatch.Restart();
|
_dumpStopwatch.Restart();
|
||||||
_speedStopwatch.Reset();
|
_speedStopwatch.Reset();
|
||||||
@@ -332,7 +307,6 @@ public partial class Dump
|
|||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -378,7 +352,11 @@ public partial class Dump
|
|||||||
ibgLog.Write(i, 0);
|
ibgLog.Write(i, 0);
|
||||||
outputFormat.WriteSectors(new byte[blockSize * _skip], i, _skip);
|
outputFormat.WriteSectors(new byte[blockSize * _skip], i, _skip);
|
||||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||||
_dumpLog.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
|
||||||
|
UpdateProgress?.Invoke(Localization.Core.Skipping_0_blocks_from_errored_block_1,
|
||||||
|
_skip,
|
||||||
|
(long)i);
|
||||||
|
|
||||||
i += _skip - blocksToRead;
|
i += _skip - blocksToRead;
|
||||||
newTrim = true;
|
newTrim = true;
|
||||||
}
|
}
|
||||||
@@ -426,18 +404,6 @@ public partial class Dump
|
|||||||
.Per(imageWriteDuration.Seconds())
|
.Per(imageWriteDuration.Seconds())
|
||||||
.Humanize()));
|
.Humanize()));
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Dump_finished_in_0,
|
|
||||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Average_dump_speed_0,
|
|
||||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
|
||||||
.Per(totalDuration.Milliseconds())
|
|
||||||
.Humanize());
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_write_speed_0,
|
|
||||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
|
||||||
.Per(imageWriteDuration.Seconds())
|
|
||||||
.Humanize()));
|
|
||||||
|
|
||||||
#region Trimming
|
#region Trimming
|
||||||
|
|
||||||
@@ -445,7 +411,6 @@ public partial class Dump
|
|||||||
{
|
{
|
||||||
_trimStopwatch.Restart();
|
_trimStopwatch.Restart();
|
||||||
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
|
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
|
||||||
_dumpLog.WriteLine(Localization.Core.Trimming_skipped_sectors);
|
|
||||||
|
|
||||||
ulong[] tmpArray = _resume.BadBlocks.ToArray();
|
ulong[] tmpArray = _resume.BadBlocks.ToArray();
|
||||||
InitProgress?.Invoke();
|
InitProgress?.Invoke();
|
||||||
@@ -456,7 +421,6 @@ public partial class Dump
|
|||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -481,9 +445,6 @@ public partial class Dump
|
|||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Trimming_finished_in_0,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Trimming_finished_in_0,
|
||||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Trimming_finished_in_0,
|
|
||||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Trimming
|
#endregion Trimming
|
||||||
@@ -492,8 +453,8 @@ public partial class Dump
|
|||||||
|
|
||||||
if(_resume.BadBlocks.Count > 0 && !_aborted && _retryPasses > 0)
|
if(_resume.BadBlocks.Count > 0 && !_aborted && _retryPasses > 0)
|
||||||
{
|
{
|
||||||
var pass = 1;
|
int pass = 1;
|
||||||
var forward = true;
|
bool forward = true;
|
||||||
|
|
||||||
InitProgress?.Invoke();
|
InitProgress?.Invoke();
|
||||||
repeatRetryLba:
|
repeatRetryLba:
|
||||||
@@ -505,7 +466,6 @@ public partial class Dump
|
|||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -551,10 +511,6 @@ public partial class Dump
|
|||||||
.Correctly_retried_block_0_in_pass_1,
|
.Correctly_retried_block_0_in_pass_1,
|
||||||
badSector,
|
badSector,
|
||||||
pass));
|
pass));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Correctly_retried_block_0_in_pass_1,
|
|
||||||
badSector,
|
|
||||||
pass);
|
|
||||||
}
|
}
|
||||||
else if(_persistent) outputFormat.WriteSector(cmdBuf, badSector);
|
else if(_persistent) outputFormat.WriteSector(cmdBuf, badSector);
|
||||||
}
|
}
|
||||||
@@ -624,7 +580,6 @@ public partial class Dump
|
|||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -663,11 +618,6 @@ public partial class Dump
|
|||||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||||
extents.Add(currentBlock);
|
extents.Add(currentBlock);
|
||||||
_mediaGraph?.PaintSectorGood((ulong)((cy * heads + hd) * sectors + (sc - 1)));
|
_mediaGraph?.PaintSectorGood((ulong)((cy * heads + hd) * sectors + (sc - 1)));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Error_reading_cylinder_0_head_1_sector_2,
|
|
||||||
cy,
|
|
||||||
hd,
|
|
||||||
sc);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -725,23 +675,10 @@ public partial class Dump
|
|||||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
ByteSize.FromBytes(blockSize * (blocks + 1))
|
||||||
.Per(imageWriteDuration.Seconds())
|
.Per(imageWriteDuration.Seconds())
|
||||||
.Humanize()));
|
.Humanize()));
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Dump_finished_in_0,
|
|
||||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Average_dump_speed_0,
|
|
||||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
|
||||||
.Per(totalDuration.Milliseconds())
|
|
||||||
.Humanize());
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Average_write_speed_0,
|
|
||||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
|
||||||
.Per(imageWriteDuration.Seconds())
|
|
||||||
.Humanize());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach(ulong bad in _resume.BadBlocks)
|
foreach(ulong bad in _resume.BadBlocks)
|
||||||
_dumpLog.WriteLine(Localization.Core.Sector_0_could_not_be_read, bad);
|
AaruLogging.Information(Localization.Core.Sector_0_could_not_be_read, bad);
|
||||||
|
|
||||||
outputFormat.SetDumpHardware(_resume.Tries);
|
outputFormat.SetDumpHardware(_resume.Tries);
|
||||||
|
|
||||||
@@ -761,7 +698,6 @@ public partial class Dump
|
|||||||
|
|
||||||
if(_preSidecar != null) outputFormat.SetMetadata(_preSidecar);
|
if(_preSidecar != null) outputFormat.SetMetadata(_preSidecar);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Closing_output_file);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
||||||
_imageCloseStopwatch.Restart();
|
_imageCloseStopwatch.Restart();
|
||||||
outputFormat.Close();
|
outputFormat.Close();
|
||||||
@@ -770,12 +706,9 @@ public partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Closed_in_0,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Closed_in_0,
|
||||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Closed_in_0,
|
|
||||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
|
||||||
|
|
||||||
if(_aborted)
|
if(_aborted)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -792,7 +725,6 @@ public partial class Dump
|
|||||||
|
|
||||||
if(_metadata)
|
if(_metadata)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Creating_sidecar);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Creating_sidecar);
|
UpdateStatus?.Invoke(Localization.Core.Creating_sidecar);
|
||||||
IFilter filter = PluginRegister.Singleton.GetFilter(_outputPath);
|
IFilter filter = PluginRegister.Singleton.GetFilter(_outputPath);
|
||||||
var inputPlugin = ImageFormat.Detect(filter) as IMediaImage;
|
var inputPlugin = ImageFormat.Detect(filter) as IMediaImage;
|
||||||
@@ -829,7 +761,6 @@ public partial class Dump
|
|||||||
|
|
||||||
if(_dev.IsUsb && _dev.UsbDescriptors != null)
|
if(_dev.IsUsb && _dev.UsbDescriptors != null)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_USB_descriptors);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_USB_descriptors);
|
UpdateStatus?.Invoke(Localization.Core.Reading_USB_descriptors);
|
||||||
|
|
||||||
sidecar.BlockMedias[0].Usb = new Usb
|
sidecar.BlockMedias[0].Usb = new Usb
|
||||||
@@ -847,7 +778,6 @@ public partial class Dump
|
|||||||
|
|
||||||
if(_dev.IsPcmcia && _dev.Cis != null)
|
if(_dev.IsPcmcia && _dev.Cis != null)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_PCMCIA_CIS);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_PCMCIA_CIS);
|
UpdateStatus?.Invoke(Localization.Core.Reading_PCMCIA_CIS);
|
||||||
|
|
||||||
sidecar.BlockMedias[0].Pcmcia = new Pcmcia
|
sidecar.BlockMedias[0].Pcmcia = new Pcmcia
|
||||||
@@ -860,7 +790,6 @@ public partial class Dump
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Decoding_PCMCIA_CIS);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Decoding_PCMCIA_CIS);
|
UpdateStatus?.Invoke(Localization.Core.Decoding_PCMCIA_CIS);
|
||||||
Tuple[] tuples = CIS.GetTuples(_dev.Cis);
|
Tuple[] tuples = CIS.GetTuples(_dev.Cis);
|
||||||
|
|
||||||
@@ -931,14 +860,6 @@ public partial class Dump
|
|||||||
.Per(totalChkDuration.Milliseconds())
|
.Per(totalChkDuration.Milliseconds())
|
||||||
.Humanize()));
|
.Humanize()));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Sidecar_created_in_0,
|
|
||||||
_sidecarStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Average_checksum_speed_0,
|
|
||||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
|
||||||
.Per(totalChkDuration.Milliseconds())
|
|
||||||
.Humanize());
|
|
||||||
|
|
||||||
List<(ulong start, string type)> filesystems = [];
|
List<(ulong start, string type)> filesystems = [];
|
||||||
|
|
||||||
if(sidecar.BlockMedias[0].FileSystemInformation != null)
|
if(sidecar.BlockMedias[0].FileSystemInformation != null)
|
||||||
@@ -961,10 +882,6 @@ public partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Found_filesystem_0_at_sector_1,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Found_filesystem_0_at_sector_1,
|
||||||
filesystem.type,
|
filesystem.type,
|
||||||
filesystem.start));
|
filesystem.start));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Found_filesystem_0_at_sector_1,
|
|
||||||
filesystem.type,
|
|
||||||
filesystem.start);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ partial class Dump
|
|||||||
|
|
||||||
byte[] syncMark = [0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00];
|
byte[] syncMark = [0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00];
|
||||||
|
|
||||||
var testMark = new byte[12];
|
byte[] testMark = new byte[12];
|
||||||
Array.Copy(sector, 0, testMark, 0, 12);
|
Array.Copy(sector, 0, testMark, 0, 12);
|
||||||
|
|
||||||
return syncMark.SequenceEqual(testMark) && (sector[0xF] == 0 || sector[0xF] == 1 || sector[0xF] == 2);
|
return syncMark.SequenceEqual(testMark) && (sector[0xF] == 0 || sector[0xF] == 1 || sector[0xF] == 2);
|
||||||
@@ -79,9 +79,9 @@ partial class Dump
|
|||||||
|
|
||||||
byte[] syncMark = [0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00];
|
byte[] syncMark = [0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00];
|
||||||
|
|
||||||
var testMark = new byte[12];
|
byte[] testMark = new byte[12];
|
||||||
|
|
||||||
for(var i = 0; i <= 2336; i++)
|
for(int i = 0; i <= 2336; i++)
|
||||||
{
|
{
|
||||||
Array.Copy(sector, i, testMark, 0, 12);
|
Array.Copy(sector, i, testMark, 0, 12);
|
||||||
|
|
||||||
@@ -162,7 +162,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(cdiReadyReadAsAudio)
|
if(cdiReadyReadAsAudio)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Setting_speed_to_8x_for_CD_i_Ready_reading_as_audio);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Setting_speed_to_8x_for_CD_i_Ready_reading_as_audio);
|
UpdateStatus?.Invoke(Localization.Core.Setting_speed_to_8x_for_CD_i_Ready_reading_as_audio);
|
||||||
|
|
||||||
_dev.SetCdSpeed(out _, RotationalControl.ClvAndImpureCav, 1416, 0, _dev.Timeout, out _);
|
_dev.SetCdSpeed(out _, RotationalControl.ClvAndImpureCav, 1416, 0, _dev.Timeout, out _);
|
||||||
@@ -176,12 +175,11 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
var firstSectorToRead = (uint)i;
|
uint firstSectorToRead = (uint)i;
|
||||||
|
|
||||||
blocksToRead = _maximumReadable;
|
blocksToRead = _maximumReadable;
|
||||||
|
|
||||||
@@ -290,8 +288,8 @@ partial class Dump
|
|||||||
|
|
||||||
if(supportedSubchannel != MmcSubchannel.None)
|
if(supportedSubchannel != MmcSubchannel.None)
|
||||||
{
|
{
|
||||||
var data = new byte[sectorSize];
|
byte[] data = new byte[sectorSize];
|
||||||
var sub = new byte[subSize];
|
byte[] sub = new byte[subSize];
|
||||||
|
|
||||||
Array.Copy(cmdBuf, 0, data, 0, sectorSize);
|
Array.Copy(cmdBuf, 0, data, 0, sectorSize);
|
||||||
|
|
||||||
@@ -316,7 +314,6 @@ partial class Dump
|
|||||||
outputOptical,
|
outputOptical,
|
||||||
_fixSubchannel,
|
_fixSubchannel,
|
||||||
_fixSubchannelCrc,
|
_fixSubchannelCrc,
|
||||||
_dumpLog,
|
|
||||||
UpdateStatus,
|
UpdateStatus,
|
||||||
smallestPregapLbaPerTrack,
|
smallestPregapLbaPerTrack,
|
||||||
true,
|
true,
|
||||||
@@ -349,10 +346,6 @@ partial class Dump
|
|||||||
i + r,
|
i + r,
|
||||||
firstTrack.EndSector));
|
firstTrack.EndSector));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Adding_CD_i_Ready_hole_from_LBA_0_to_1_inclusive,
|
|
||||||
i + r,
|
|
||||||
firstTrack.EndSector);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -393,11 +386,11 @@ partial class Dump
|
|||||||
|
|
||||||
if(supportedSubchannel != MmcSubchannel.None)
|
if(supportedSubchannel != MmcSubchannel.None)
|
||||||
{
|
{
|
||||||
var data = new byte[sectorSize * blocksToRead];
|
byte[] data = new byte[sectorSize * blocksToRead];
|
||||||
var sub = new byte[subSize * blocksToRead];
|
byte[] sub = new byte[subSize * blocksToRead];
|
||||||
var tmpData = new byte[sectorSize];
|
byte[] tmpData = new byte[sectorSize];
|
||||||
|
|
||||||
for(var b = 0; b < blocksToRead; b++)
|
for(int b = 0; b < blocksToRead; b++)
|
||||||
{
|
{
|
||||||
if(cdiReadyReadAsAudio)
|
if(cdiReadyReadAsAudio)
|
||||||
{
|
{
|
||||||
@@ -428,7 +421,6 @@ partial class Dump
|
|||||||
outputOptical,
|
outputOptical,
|
||||||
_fixSubchannel,
|
_fixSubchannel,
|
||||||
_fixSubchannelCrc,
|
_fixSubchannelCrc,
|
||||||
_dumpLog,
|
|
||||||
UpdateStatus,
|
UpdateStatus,
|
||||||
smallestPregapLbaPerTrack,
|
smallestPregapLbaPerTrack,
|
||||||
true,
|
true,
|
||||||
@@ -455,10 +447,10 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
if(cdiReadyReadAsAudio)
|
if(cdiReadyReadAsAudio)
|
||||||
{
|
{
|
||||||
var tmpData = new byte[sectorSize];
|
byte[] tmpData = new byte[sectorSize];
|
||||||
var data = new byte[sectorSize * blocksToRead];
|
byte[] data = new byte[sectorSize * blocksToRead];
|
||||||
|
|
||||||
for(var b = 0; b < blocksToRead; b++)
|
for(int b = 0; b < blocksToRead; b++)
|
||||||
{
|
{
|
||||||
Array.Copy(cmdBuf, (int)(b * sectorSize), tmpData, 0, sectorSize);
|
Array.Copy(cmdBuf, (int)(b * sectorSize), tmpData, 0, sectorSize);
|
||||||
tmpData = Sector.Scramble(tmpData);
|
tmpData = Sector.Scramble(tmpData);
|
||||||
|
|||||||
@@ -133,7 +133,6 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -218,7 +217,6 @@ partial class Dump
|
|||||||
switch(inData)
|
switch(inData)
|
||||||
{
|
{
|
||||||
case false when currentReadSpeed == 0xFFFF:
|
case false when currentReadSpeed == 0xFFFF:
|
||||||
_dumpLog.WriteLine(Localization.Core.Setting_speed_to_8x_for_audio_reading);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Setting_speed_to_8x_for_audio_reading);
|
UpdateStatus?.Invoke(Localization.Core.Setting_speed_to_8x_for_audio_reading);
|
||||||
|
|
||||||
_dev.SetCdSpeed(out _, RotationalControl.ClvAndImpureCav, 1416, 0, _dev.Timeout, out _);
|
_dev.SetCdSpeed(out _, RotationalControl.ClvAndImpureCav, 1416, 0, _dev.Timeout, out _);
|
||||||
@@ -228,11 +226,6 @@ partial class Dump
|
|||||||
break;
|
break;
|
||||||
case true when currentReadSpeed != _speed:
|
case true when currentReadSpeed != _speed:
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(_speed == 0xFFFF
|
|
||||||
? Localization.Core.Setting_speed_to_MAX_for_data_reading
|
|
||||||
: string.Format(Localization.Core.Setting_speed_to_0_x_for_data_reading,
|
|
||||||
_speed));
|
|
||||||
|
|
||||||
UpdateStatus?.Invoke(_speed == 0xFFFF
|
UpdateStatus?.Invoke(_speed == 0xFFFF
|
||||||
? Localization.Core.Setting_speed_to_MAX_for_data_reading
|
? Localization.Core.Setting_speed_to_MAX_for_data_reading
|
||||||
: string.Format(Localization.Core.Setting_speed_to_0_x_for_data_reading,
|
: string.Format(Localization.Core.Setting_speed_to_0_x_for_data_reading,
|
||||||
@@ -814,7 +807,6 @@ partial class Dump
|
|||||||
outputFormat as IWritableOpticalImage,
|
outputFormat as IWritableOpticalImage,
|
||||||
_fixSubchannel,
|
_fixSubchannel,
|
||||||
_fixSubchannelCrc,
|
_fixSubchannelCrc,
|
||||||
_dumpLog,
|
|
||||||
UpdateStatus,
|
UpdateStatus,
|
||||||
smallestPregapLbaPerTrack,
|
smallestPregapLbaPerTrack,
|
||||||
true,
|
true,
|
||||||
@@ -903,14 +895,12 @@ partial class Dump
|
|||||||
|
|
||||||
_resume.BadBlocks.Add(i + r);
|
_resume.BadBlocks.Add(i + r);
|
||||||
|
|
||||||
AaruLogging.Debug(MODULE_NAME,
|
AaruLogging.Debug(MODULE_NAME, Localization.Core.READ_error_0, Sense.PrettifySense(senseBuf));
|
||||||
Localization.Core.READ_error_0,
|
|
||||||
Sense.PrettifySense(senseBuf));
|
|
||||||
|
|
||||||
mhddLog.Write(i + r, cmdDuration < 500 ? 65535 : cmdDuration);
|
mhddLog.Write(i + r, cmdDuration < 500 ? 65535 : cmdDuration);
|
||||||
|
|
||||||
ibgLog.Write(i + r, 0);
|
ibgLog.Write(i + r, 0);
|
||||||
_dumpLog.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, 1, i + r);
|
AaruLogging.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, 1, i + r);
|
||||||
newTrim = true;
|
newTrim = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1003,7 +993,6 @@ partial class Dump
|
|||||||
outputFormat as IWritableOpticalImage,
|
outputFormat as IWritableOpticalImage,
|
||||||
_fixSubchannel,
|
_fixSubchannel,
|
||||||
_fixSubchannelCrc,
|
_fixSubchannelCrc,
|
||||||
_dumpLog,
|
|
||||||
UpdateStatus,
|
UpdateStatus,
|
||||||
smallestPregapLbaPerTrack,
|
smallestPregapLbaPerTrack,
|
||||||
true,
|
true,
|
||||||
@@ -1108,7 +1097,7 @@ partial class Dump
|
|||||||
mhddLog.Write(i, cmdDuration < 500 ? 65535 : cmdDuration, _skip);
|
mhddLog.Write(i, cmdDuration < 500 ? 65535 : cmdDuration, _skip);
|
||||||
|
|
||||||
ibgLog.Write(i, 0);
|
ibgLog.Write(i, 0);
|
||||||
_dumpLog.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
AaruLogging.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
||||||
i += _skip - blocksToRead;
|
i += _skip - blocksToRead;
|
||||||
newTrim = true;
|
newTrim = true;
|
||||||
}
|
}
|
||||||
@@ -1135,7 +1124,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(!failedCrossingLeadOut) return;
|
if(!failedCrossingLeadOut) return;
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Failed_crossing_into_Lead_Out);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Failed_crossing_into_Lead_Out);
|
UpdateStatus?.Invoke(Localization.Core.Failed_crossing_into_Lead_Out);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -127,14 +127,13 @@ sealed partial class Dump
|
|||||||
|
|
||||||
if(_dumpRaw)
|
if(_dumpRaw)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Raw_CD_dumping_not_yet_implemented);
|
AaruLogging.WriteLine(Localization.Core.Raw_CD_dumping_not_yet_implemented);
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Raw_CD_dumping_not_yet_implemented);
|
StoppingErrorMessage?.Invoke(Localization.Core.Raw_CD_dumping_not_yet_implemented);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
tracks = GetCdTracks(_dev,
|
tracks = GetCdTracks(_dev,
|
||||||
_dumpLog,
|
|
||||||
_force,
|
_force,
|
||||||
out lastSector,
|
out lastSector,
|
||||||
leadOutStarts,
|
leadOutStarts,
|
||||||
@@ -146,7 +145,7 @@ sealed partial class Dump
|
|||||||
|
|
||||||
if(tracks is null)
|
if(tracks is null)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Could_not_get_tracks);
|
AaruLogging.WriteLine(Localization.Core.Could_not_get_tracks);
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_get_tracks);
|
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_get_tracks);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -155,11 +154,11 @@ sealed partial class Dump
|
|||||||
firstLba = (uint)tracks.Min(t => t.StartSector);
|
firstLba = (uint)tracks.Min(t => t.StartSector);
|
||||||
|
|
||||||
// Check subchannels support
|
// Check subchannels support
|
||||||
supportsPqSubchannel = SupportsPqSubchannel(_dev, _dumpLog, UpdateStatus, firstLba) ||
|
supportsPqSubchannel = SupportsPqSubchannel(_dev, UpdateStatus, firstLba) ||
|
||||||
SupportsPqSubchannel(_dev, _dumpLog, UpdateStatus, firstLba + 5);
|
SupportsPqSubchannel(_dev, UpdateStatus, firstLba + 5);
|
||||||
|
|
||||||
supportsRwSubchannel = SupportsRwSubchannel(_dev, _dumpLog, UpdateStatus, firstLba) ||
|
supportsRwSubchannel = SupportsRwSubchannel(_dev, UpdateStatus, firstLba) ||
|
||||||
SupportsRwSubchannel(_dev, _dumpLog, UpdateStatus, firstLba + 5);
|
SupportsRwSubchannel(_dev, UpdateStatus, firstLba + 5);
|
||||||
|
|
||||||
if(supportsRwSubchannel)
|
if(supportsRwSubchannel)
|
||||||
supportedSubchannel = MmcSubchannel.Raw;
|
supportedSubchannel = MmcSubchannel.Raw;
|
||||||
@@ -184,8 +183,8 @@ sealed partial class Dump
|
|||||||
desiredSubchannel = MmcSubchannel.Raw;
|
desiredSubchannel = MmcSubchannel.Raw;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core
|
AaruLogging.WriteLine(Localization.Core
|
||||||
.Drive_does_not_support_the_requested_subchannel_format_not_continuing);
|
.Drive_does_not_support_the_requested_subchannel_format_not_continuing);
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Drive_does_not_support_the_requested_subchannel_format_not_continuing);
|
.Drive_does_not_support_the_requested_subchannel_format_not_continuing);
|
||||||
@@ -201,8 +200,8 @@ sealed partial class Dump
|
|||||||
desiredSubchannel = MmcSubchannel.Q16;
|
desiredSubchannel = MmcSubchannel.Q16;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core
|
AaruLogging.WriteLine(Localization.Core
|
||||||
.Drive_does_not_support_the_requested_subchannel_format_not_continuing);
|
.Drive_does_not_support_the_requested_subchannel_format_not_continuing);
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Drive_does_not_support_the_requested_subchannel_format_not_continuing);
|
.Drive_does_not_support_the_requested_subchannel_format_not_continuing);
|
||||||
@@ -216,8 +215,8 @@ sealed partial class Dump
|
|||||||
desiredSubchannel = MmcSubchannel.Q16;
|
desiredSubchannel = MmcSubchannel.Q16;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core
|
AaruLogging.WriteLine(Localization.Core
|
||||||
.Drive_does_not_support_the_requested_subchannel_format_not_continuing);
|
.Drive_does_not_support_the_requested_subchannel_format_not_continuing);
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Drive_does_not_support_the_requested_subchannel_format_not_continuing);
|
.Drive_does_not_support_the_requested_subchannel_format_not_continuing);
|
||||||
@@ -242,12 +241,12 @@ sealed partial class Dump
|
|||||||
{
|
{
|
||||||
if(_force || _subchannel == DumpSubchannel.None)
|
if(_force || _subchannel == DumpSubchannel.None)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_subchannels_continuing);
|
AaruLogging.WriteLine(Localization.Core.Output_format_does_not_support_subchannels_continuing);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Output_format_does_not_support_subchannels_continuing);
|
UpdateStatus?.Invoke(Localization.Core.Output_format_does_not_support_subchannels_continuing);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_subchannels_not_continuing);
|
AaruLogging.WriteLine(Localization.Core.Output_format_does_not_support_subchannels_not_continuing);
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Output_format_does_not_support_subchannels_not_continuing);
|
.Output_format_does_not_support_subchannels_not_continuing);
|
||||||
@@ -261,7 +260,6 @@ sealed partial class Dump
|
|||||||
switch(supportedSubchannel)
|
switch(supportedSubchannel)
|
||||||
{
|
{
|
||||||
case MmcSubchannel.None:
|
case MmcSubchannel.None:
|
||||||
_dumpLog.WriteLine(Localization.Core.Checking_if_drive_supports_reading_without_subchannel);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Checking_if_drive_supports_reading_without_subchannel);
|
UpdateStatus?.Invoke(Localization.Core.Checking_if_drive_supports_reading_without_subchannel);
|
||||||
|
|
||||||
readcd = !_dev.ReadCd(out cmdBuf,
|
readcd = !_dev.ReadCd(out cmdBuf,
|
||||||
@@ -299,16 +297,14 @@ sealed partial class Dump
|
|||||||
|
|
||||||
if(!readcd)
|
if(!readcd)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Drive_does_not_support_READ_CD_trying_SCSI_READ_commands);
|
AaruLogging.WriteLine(Localization.Core.Drive_does_not_support_READ_CD_trying_SCSI_READ_commands);
|
||||||
ErrorMessage?.Invoke(Localization.Core.Drive_does_not_support_READ_CD_trying_SCSI_READ_commands);
|
ErrorMessage?.Invoke(Localization.Core.Drive_does_not_support_READ_CD_trying_SCSI_READ_commands);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Checking_if_drive_supports_READ_6);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Checking_if_drive_supports_READ_6);
|
UpdateStatus?.Invoke(Localization.Core.Checking_if_drive_supports_READ_6);
|
||||||
|
|
||||||
read6 = !_dev.Read6(out cmdBuf, out _, firstLba, 2048, 1, _dev.Timeout, out _) ||
|
read6 = !_dev.Read6(out cmdBuf, out _, firstLba, 2048, 1, _dev.Timeout, out _) ||
|
||||||
!_dev.Read6(out cmdBuf, out _, firstLba + 5, 2048, 1, _dev.Timeout, out _);
|
!_dev.Read6(out cmdBuf, out _, firstLba + 5, 2048, 1, _dev.Timeout, out _);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Checking_if_drive_supports_READ_10);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Checking_if_drive_supports_READ_10);
|
UpdateStatus?.Invoke(Localization.Core.Checking_if_drive_supports_READ_10);
|
||||||
|
|
||||||
read10 =
|
read10 =
|
||||||
@@ -339,7 +335,6 @@ sealed partial class Dump
|
|||||||
_dev.Timeout,
|
_dev.Timeout,
|
||||||
out _);
|
out _);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Checking_if_drive_supports_READ_12);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Checking_if_drive_supports_READ_12);
|
UpdateStatus?.Invoke(Localization.Core.Checking_if_drive_supports_READ_12);
|
||||||
|
|
||||||
read12 =
|
read12 =
|
||||||
@@ -372,7 +367,6 @@ sealed partial class Dump
|
|||||||
_dev.Timeout,
|
_dev.Timeout,
|
||||||
out _);
|
out _);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Checking_if_drive_supports_READ_16);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Checking_if_drive_supports_READ_16);
|
UpdateStatus?.Invoke(Localization.Core.Checking_if_drive_supports_READ_16);
|
||||||
|
|
||||||
read16 =
|
read16 =
|
||||||
@@ -406,51 +400,34 @@ sealed partial class Dump
|
|||||||
switch(read6)
|
switch(read6)
|
||||||
{
|
{
|
||||||
case false when !read10 && !read12 && !read16:
|
case false when !read10 && !read12 && !read16:
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_read_from_disc_not_continuing);
|
AaruLogging.WriteLine(Localization.Core.Cannot_read_from_disc_not_continuing);
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_read_from_disc_not_continuing);
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_read_from_disc_not_continuing);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
case true:
|
case true:
|
||||||
_dumpLog.WriteLine(Localization.Core.Drive_supports_READ_6);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Drive_supports_READ_6);
|
UpdateStatus?.Invoke(Localization.Core.Drive_supports_READ_6);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(read10)
|
if(read10) UpdateStatus?.Invoke(Localization.Core.Drive_supports_READ_10);
|
||||||
{
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Drive_supports_READ_10);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Drive_supports_READ_10);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(read12)
|
if(read12) UpdateStatus?.Invoke(Localization.Core.Drive_supports_READ_12);
|
||||||
{
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Drive_supports_READ_12);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Drive_supports_READ_12);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(read16)
|
if(read16) UpdateStatus?.Invoke(Localization.Core.Drive_supports_READ_16);
|
||||||
{
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Drive_supports_READ_16);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Drive_supports_READ_16);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Drive_can_read_without_subchannel);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Drive_can_read_without_subchannel);
|
UpdateStatus?.Invoke(Localization.Core.Drive_can_read_without_subchannel);
|
||||||
|
|
||||||
subSize = 0;
|
subSize = 0;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case MmcSubchannel.Raw:
|
case MmcSubchannel.Raw:
|
||||||
_dumpLog.WriteLine(Localization.Core.Full_raw_subchannel_reading_supported);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Full_raw_subchannel_reading_supported);
|
UpdateStatus?.Invoke(Localization.Core.Full_raw_subchannel_reading_supported);
|
||||||
subSize = 96;
|
subSize = 96;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case MmcSubchannel.Q16:
|
case MmcSubchannel.Q16:
|
||||||
_dumpLog.WriteLine(Localization.Core.PQ_subchannel_reading_supported);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.WARNING_If_disc_says_CDG_CDEG_CDMIDI_dump_will_be_incorrect);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.PQ_subchannel_reading_supported);
|
UpdateStatus?.Invoke(Localization.Core.PQ_subchannel_reading_supported);
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.WARNING_If_disc_says_CDG_CDEG_CDMIDI_dump_will_be_incorrect);
|
UpdateStatus?.Invoke(Localization.Core.WARNING_If_disc_says_CDG_CDEG_CDMIDI_dump_will_be_incorrect);
|
||||||
@@ -504,25 +481,17 @@ sealed partial class Dump
|
|||||||
bcdSubchannel = (tmpBuf[21] & 0x30) > 0;
|
bcdSubchannel = (tmpBuf[21] & 0x30) > 0;
|
||||||
|
|
||||||
if(bcdSubchannel)
|
if(bcdSubchannel)
|
||||||
{
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Drive_returns_subchannel_in_BCD);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Drive_returns_subchannel_in_BCD);
|
UpdateStatus?.Invoke(Localization.Core.Drive_returns_subchannel_in_BCD);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Drive_does_not_returns_subchannel_in_BCD);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Drive_does_not_returns_subchannel_in_BCD);
|
UpdateStatus?.Invoke(Localization.Core.Drive_does_not_returns_subchannel_in_BCD);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach(Track trk in tracks) trk.SubchannelType = subType;
|
foreach(Track trk in tracks) trk.SubchannelType = subType;
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Calculating_pregaps__can_take_some_time);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Calculating_pregaps__can_take_some_time);
|
UpdateStatus?.Invoke(Localization.Core.Calculating_pregaps__can_take_some_time);
|
||||||
|
|
||||||
SolveTrackPregaps(_dev,
|
SolveTrackPregaps(_dev,
|
||||||
_dumpLog,
|
|
||||||
UpdateStatus,
|
UpdateStatus,
|
||||||
tracks,
|
tracks,
|
||||||
supportsPqSubchannel,
|
supportsPqSubchannel,
|
||||||
@@ -532,25 +501,18 @@ sealed partial class Dump
|
|||||||
true);
|
true);
|
||||||
|
|
||||||
if(inexactPositioning)
|
if(inexactPositioning)
|
||||||
{
|
|
||||||
_dumpLog.WriteLine(Localization.Core.The_drive_has_returned_incorrect_Q_positioning_calculating_pregaps);
|
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.The_drive_has_returned_incorrect_Q_positioning_calculating_pregaps);
|
UpdateStatus?.Invoke(Localization.Core.The_drive_has_returned_incorrect_Q_positioning_calculating_pregaps);
|
||||||
}
|
|
||||||
|
|
||||||
if(!outputOptical.OpticalCapabilities.HasFlag(OpticalImageCapabilities.CanStoreRawData))
|
if(!outputOptical.OpticalCapabilities.HasFlag(OpticalImageCapabilities.CanStoreRawData))
|
||||||
{
|
{
|
||||||
if(!_force)
|
if(!_force)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_storing_raw_data_not_continuing);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Output_format_does_not_support_storing_raw_data_not_continuing);
|
.Output_format_does_not_support_storing_raw_data_not_continuing);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_storing_raw_data_continuing);
|
|
||||||
|
|
||||||
ErrorMessage?.Invoke(Localization.Core.Output_format_does_not_support_storing_raw_data_continuing);
|
ErrorMessage?.Invoke(Localization.Core.Output_format_does_not_support_storing_raw_data_continuing);
|
||||||
}
|
}
|
||||||
@@ -558,8 +520,6 @@ sealed partial class Dump
|
|||||||
if(!outputOptical.OpticalCapabilities.HasFlag(OpticalImageCapabilities.CanStoreAudioTracks) &&
|
if(!outputOptical.OpticalCapabilities.HasFlag(OpticalImageCapabilities.CanStoreAudioTracks) &&
|
||||||
tracks.Any(track => track.Type == TrackType.Audio))
|
tracks.Any(track => track.Type == TrackType.Audio))
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_audio_tracks_cannot_continue);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Output_format_does_not_support_audio_tracks_cannot_continue);
|
StoppingErrorMessage?.Invoke(Localization.Core.Output_format_does_not_support_audio_tracks_cannot_continue);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -571,14 +531,11 @@ sealed partial class Dump
|
|||||||
{
|
{
|
||||||
if(!_force)
|
if(!_force)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_pregaps_not_continuing);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Output_format_does_not_support_pregaps_not_continuing);
|
StoppingErrorMessage?.Invoke(Localization.Core.Output_format_does_not_support_pregaps_not_continuing);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_pregaps_continuing);
|
|
||||||
|
|
||||||
ErrorMessage?.Invoke(Localization.Core.Output_format_does_not_support_pregaps_continuing);
|
ErrorMessage?.Invoke(Localization.Core.Output_format_does_not_support_pregaps_continuing);
|
||||||
}
|
}
|
||||||
@@ -624,7 +581,6 @@ sealed partial class Dump
|
|||||||
// TODO: Disabled until 6.0
|
// TODO: Disabled until 6.0
|
||||||
/*if(!_force)
|
/*if(!_force)
|
||||||
{*/
|
{*/
|
||||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_sessions);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Output_format_does_not_support_sessions);
|
StoppingErrorMessage?.Invoke(Localization.Core.Output_format_does_not_support_sessions);
|
||||||
|
|
||||||
@@ -641,14 +597,9 @@ sealed partial class Dump
|
|||||||
foreach(MediaTagType tag in mediaTags.Keys.Where(tag => !outputOptical.SupportedMediaTags.Contains(tag)))
|
foreach(MediaTagType tag in mediaTags.Keys.Where(tag => !outputOptical.SupportedMediaTags.Contains(tag)))
|
||||||
{
|
{
|
||||||
if(_force)
|
if(_force)
|
||||||
{
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_0_continuing, tag);
|
|
||||||
ErrorMessage?.Invoke(string.Format(Localization.Core.Output_format_does_not_support_0_continuing, tag));
|
ErrorMessage?.Invoke(string.Format(Localization.Core.Output_format_does_not_support_0_continuing, tag));
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_0_not_continuing, tag);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(string.Format(Localization.Core
|
StoppingErrorMessage?.Invoke(string.Format(Localization.Core
|
||||||
.Output_format_does_not_support_0_not_continuing,
|
.Output_format_does_not_support_0_not_continuing,
|
||||||
tag));
|
tag));
|
||||||
@@ -678,7 +629,6 @@ sealed partial class Dump
|
|||||||
leadOutExtents.Add(dataExtentsArray[i].Item2 + 1, dataExtentsArray[i + 1].Item1 - 1);
|
leadOutExtents.Add(dataExtentsArray[i].Item2 + 1, dataExtentsArray[i + 1].Item1 - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Detecting_disc_type);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Detecting_disc_type);
|
UpdateStatus?.Invoke(Localization.Core.Detecting_disc_type);
|
||||||
|
|
||||||
MMC.DetectDiscType(ref dskType,
|
MMC.DetectDiscType(ref dskType,
|
||||||
@@ -696,13 +646,11 @@ sealed partial class Dump
|
|||||||
|
|
||||||
if(hiddenTrack || firstLba > 0)
|
if(hiddenTrack || firstLba > 0)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Disc_contains_a_hidden_track);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Disc_contains_a_hidden_track);
|
UpdateStatus?.Invoke(Localization.Core.Disc_contains_a_hidden_track);
|
||||||
|
|
||||||
if(!outputOptical.OpticalCapabilities.HasFlag(OpticalImageCapabilities.CanStoreHiddenTracks))
|
if(!outputOptical.OpticalCapabilities.HasFlag(OpticalImageCapabilities.CanStoreHiddenTracks))
|
||||||
{
|
{
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Output_format_does_not_support_hidden_tracks);
|
StoppingErrorMessage?.Invoke(Localization.Core.Output_format_does_not_support_hidden_tracks);
|
||||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_hidden_tracks);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -727,11 +675,7 @@ sealed partial class Dump
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(tracks.Any(t => t.Type == TrackType.Audio) && desiredSubchannel != MmcSubchannel.Raw)
|
if(tracks.Any(t => t.Type == TrackType.Audio) && desiredSubchannel != MmcSubchannel.Raw)
|
||||||
{
|
|
||||||
_dumpLog.WriteLine(Localization.Core.WARNING_If_disc_says_CDG_CDEG_CDMIDI_dump_will_be_incorrect);
|
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.WARNING_If_disc_says_CDG_CDEG_CDMIDI_dump_will_be_incorrect);
|
UpdateStatus?.Invoke(Localization.Core.WARNING_If_disc_says_CDG_CDEG_CDMIDI_dump_will_be_incorrect);
|
||||||
}
|
|
||||||
|
|
||||||
// Check mode for tracks
|
// Check mode for tracks
|
||||||
foreach(Track trk in tracks.Where(t => t.Type != TrackType.Audio))
|
foreach(Track trk in tracks.Where(t => t.Type != TrackType.Audio))
|
||||||
@@ -743,7 +687,6 @@ sealed partial class Dump
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Checking_mode_for_track_0, trk.Sequence);
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Checking_mode_for_track_0, trk.Sequence));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Checking_mode_for_track_0, trk.Sequence));
|
||||||
|
|
||||||
sense = _dev.ReadCd(out cmdBuf,
|
sense = _dev.ReadCd(out cmdBuf,
|
||||||
@@ -765,8 +708,6 @@ sealed partial class Dump
|
|||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Unable_to_guess_mode_for_track_0_continuing, trk.Sequence);
|
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Unable_to_guess_mode_for_track_0_continuing,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Unable_to_guess_mode_for_track_0_continuing,
|
||||||
trk.Sequence));
|
trk.Sequence));
|
||||||
|
|
||||||
@@ -798,7 +739,6 @@ sealed partial class Dump
|
|||||||
case 1:
|
case 1:
|
||||||
case 0x61: // Scrambled
|
case 0x61: // Scrambled
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Track_0_is_MODE1, trk.Sequence));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Track_0_is_MODE1, trk.Sequence));
|
||||||
_dumpLog.WriteLine(Localization.Core.Track_0_is_MODE1, trk.Sequence);
|
|
||||||
trk.Type = TrackType.CdMode1;
|
trk.Type = TrackType.CdMode1;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -807,7 +747,6 @@ sealed partial class Dump
|
|||||||
if(dskType is MediaType.CDI or MediaType.CDIREADY)
|
if(dskType is MediaType.CDI or MediaType.CDIREADY)
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Track_0_is_MODE2, trk.Sequence));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Track_0_is_MODE2, trk.Sequence));
|
||||||
_dumpLog.WriteLine(Localization.Core.Track_0_is_MODE2, trk.Sequence);
|
|
||||||
trk.Type = TrackType.CdMode2Formless;
|
trk.Type = TrackType.CdMode2Formless;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -816,14 +755,12 @@ sealed partial class Dump
|
|||||||
if((cmdBuf[0x012] & 0x20) == 0x20) // mode 2 form 2
|
if((cmdBuf[0x012] & 0x20) == 0x20) // mode 2 form 2
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Track_0_is_MODE2_FORM_2, trk.Sequence));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Track_0_is_MODE2_FORM_2, trk.Sequence));
|
||||||
_dumpLog.WriteLine(Localization.Core.Track_0_is_MODE2_FORM_2, trk.Sequence);
|
|
||||||
trk.Type = TrackType.CdMode2Form2;
|
trk.Type = TrackType.CdMode2Form2;
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Track_0_is_MODE2_FORM_1, trk.Sequence));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Track_0_is_MODE2_FORM_1, trk.Sequence));
|
||||||
_dumpLog.WriteLine(Localization.Core.Track_0_is_MODE2_FORM_1, trk.Sequence);
|
|
||||||
trk.Type = TrackType.CdMode2Form1;
|
trk.Type = TrackType.CdMode2Form1;
|
||||||
|
|
||||||
// These media type specifications do not legally allow mode 2 tracks to be present
|
// These media type specifications do not legally allow mode 2 tracks to be present
|
||||||
@@ -835,7 +772,6 @@ sealed partial class Dump
|
|||||||
trk.Sequence,
|
trk.Sequence,
|
||||||
cmdBuf[15]));
|
cmdBuf[15]));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Track_0_is_unknown_mode_1, trk.Sequence, cmdBuf[15]);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -848,7 +784,6 @@ sealed partial class Dump
|
|||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Output_format_does_not_support_more_than_1_track_not_continuing);
|
.Output_format_does_not_support_more_than_1_track_not_continuing);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_more_than_1_track_not_continuing);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -858,7 +793,6 @@ sealed partial class Dump
|
|||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Output_format_does_not_support_audio_tracks_not_continuing);
|
.Output_format_does_not_support_audio_tracks_not_continuing);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_audio_tracks_not_continuing);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -868,7 +802,6 @@ sealed partial class Dump
|
|||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Output_format_only_supports_MODE_1_tracks_not_continuing);
|
.Output_format_only_supports_MODE_1_tracks_not_continuing);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Output_format_only_supports_MODE_1_tracks_not_continuing);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -883,17 +816,11 @@ sealed partial class Dump
|
|||||||
{
|
{
|
||||||
if(_force)
|
if(_force)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Output_format_does_not_support_CD_first_track_pregap_continuing);
|
|
||||||
|
|
||||||
ErrorMessage?.Invoke(Localization.Core
|
ErrorMessage?.Invoke(Localization.Core
|
||||||
.Output_format_does_not_support_CD_first_track_pregap_continuing);
|
.Output_format_does_not_support_CD_first_track_pregap_continuing);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Output_format_does_not_support_CD_first_track_pregap_not_continuing);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Output_format_does_not_support_CD_first_track_pregap_not_continuing);
|
.Output_format_does_not_support_CD_first_track_pregap_not_continuing);
|
||||||
|
|
||||||
@@ -995,8 +922,6 @@ sealed partial class Dump
|
|||||||
|
|
||||||
if(_dev.Error || sense)
|
if(_dev.Error || sense)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_error_0_trying_to_guess_ideal_transfer_length, _dev.LastError);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(string.Format(Localization.Core
|
StoppingErrorMessage?.Invoke(string.Format(Localization.Core
|
||||||
.Device_error_0_trying_to_guess_ideal_transfer_length,
|
.Device_error_0_trying_to_guess_ideal_transfer_length,
|
||||||
_dev.LastError));
|
_dev.LastError));
|
||||||
@@ -1014,13 +939,6 @@ sealed partial class Dump
|
|||||||
if(_dumpFirstTrackPregap && readcd)
|
if(_dumpFirstTrackPregap && readcd)
|
||||||
ReadCdFirstTrackPregap(blockSize, ref currentSpeed, mediaTags, supportedSubchannel, ref totalDuration);
|
ReadCdFirstTrackPregap(blockSize, ref currentSpeed, mediaTags, supportedSubchannel, ref totalDuration);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_0_sectors_at_a_time, _maximumReadable);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_reports_0_blocks_1_bytes, blocks, blocks * blockSize);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_can_read_0_blocks_at_a_time, _maximumReadable);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_reports_0_bytes_per_logical_block, blockSize);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.SCSI_device_type_0, _dev.ScsiType);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Media_identified_as_0, dskType);
|
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Reading_0_sectors_at_a_time, _maximumReadable));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Reading_0_sectors_at_a_time, _maximumReadable));
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Device_reports_0_blocks_1_bytes,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Device_reports_0_blocks_1_bytes,
|
||||||
@@ -1041,8 +959,8 @@ sealed partial class Dump
|
|||||||
// Cannot create image
|
// Cannot create image
|
||||||
if(!ret)
|
if(!ret)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Error_creating_output_image_not_continuing);
|
AaruLogging.WriteLine(Localization.Core.Error_creating_output_image_not_continuing);
|
||||||
_dumpLog.WriteLine(outputOptical.ErrorMessage);
|
AaruLogging.WriteLine(outputOptical.ErrorMessage);
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
|
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
@@ -1080,8 +998,8 @@ sealed partial class Dump
|
|||||||
|
|
||||||
if(!ret && desiredSubchannel == MmcSubchannel.None)
|
if(!ret && desiredSubchannel == MmcSubchannel.None)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Error_sending_tracks_to_output_image_not_continuing);
|
AaruLogging.WriteLine(Localization.Core.Error_sending_tracks_to_output_image_not_continuing);
|
||||||
_dumpLog.WriteLine(outputOptical.ErrorMessage);
|
AaruLogging.WriteLine(outputOptical.ErrorMessage);
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Error_sending_tracks_to_output_image_not_continuing +
|
StoppingErrorMessage?.Invoke(Localization.Core.Error_sending_tracks_to_output_image_not_continuing +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
@@ -1095,14 +1013,9 @@ sealed partial class Dump
|
|||||||
!outputOptical.OpticalCapabilities.HasFlag(OpticalImageCapabilities.CanStoreSubchannelRw))
|
!outputOptical.OpticalCapabilities.HasFlag(OpticalImageCapabilities.CanStoreSubchannelRw))
|
||||||
{
|
{
|
||||||
if(_force)
|
if(_force)
|
||||||
{
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_subchannels_continuing);
|
|
||||||
ErrorMessage?.Invoke(Localization.Core.Output_format_does_not_support_subchannels_continuing);
|
ErrorMessage?.Invoke(Localization.Core.Output_format_does_not_support_subchannels_continuing);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Output_format_does_not_support_subchannels_not_continuing);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Output_format_does_not_support_subchannels_not_continuing);
|
.Output_format_does_not_support_subchannels_not_continuing);
|
||||||
|
|
||||||
@@ -1112,8 +1025,8 @@ sealed partial class Dump
|
|||||||
|
|
||||||
if(supportedSubchannel != MmcSubchannel.None)
|
if(supportedSubchannel != MmcSubchannel.None)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Creating_subchannel_log_in_0,
|
AaruLogging.WriteLine(string.Format(Localization.Core.Creating_subchannel_log_in_0,
|
||||||
_outputPrefix + ".sub.log"));
|
_outputPrefix + ".sub.log"));
|
||||||
|
|
||||||
subLog = new SubchannelLog(_outputPrefix + ".sub.log", bcdSubchannel);
|
subLog = new SubchannelLog(_outputPrefix + ".sub.log", bcdSubchannel);
|
||||||
}
|
}
|
||||||
@@ -1125,7 +1038,6 @@ sealed partial class Dump
|
|||||||
|
|
||||||
if(track is null) continue;
|
if(track is null) continue;
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Setting_flags_for_track_0, track.Sequence);
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Setting_flags_for_track_0, track.Sequence));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Setting_flags_for_track_0, track.Sequence));
|
||||||
|
|
||||||
outputOptical.WriteSectorTag([kvp.Value], kvp.Key, SectorTagType.CdTrackFlags);
|
outputOptical.WriteSectorTag([kvp.Value], kvp.Key, SectorTagType.CdTrackFlags);
|
||||||
@@ -1137,10 +1049,7 @@ sealed partial class Dump
|
|||||||
sense = _dev.ReadMcn(out mcn, out _, out _, _dev.Timeout, out _);
|
sense = _dev.ReadMcn(out mcn, out _, out _, _dev.Timeout, out _);
|
||||||
|
|
||||||
if(!sense && mcn != null && mcn != "0000000000000")
|
if(!sense && mcn != null && mcn != "0000000000000")
|
||||||
{
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Found_Media_Catalogue_Number_0, mcn));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Found_Media_Catalogue_Number_0, mcn));
|
||||||
_dumpLog.WriteLine(Localization.Core.Found_Media_Catalogue_Number_0, mcn);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
mcn = null;
|
mcn = null;
|
||||||
}
|
}
|
||||||
@@ -1157,7 +1066,6 @@ sealed partial class Dump
|
|||||||
isrcs[(byte)trk.Sequence] = isrc;
|
isrcs[(byte)trk.Sequence] = isrc;
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Found_ISRC_for_track_0_1, trk.Sequence, isrc));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Found_ISRC_for_track_0_1, trk.Sequence, isrc));
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Found_ISRC_for_track_0_1, trk.Sequence, isrc));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1170,16 +1078,12 @@ sealed partial class Dump
|
|||||||
foreach(int sub in _resume.BadSubchannels) subchannelExtents.Add(sub);
|
foreach(int sub in _resume.BadSubchannels) subchannelExtents.Add(sub);
|
||||||
|
|
||||||
if(_resume.NextBlock < blocks)
|
if(_resume.NextBlock < blocks)
|
||||||
{
|
for(ulong i = _resume.NextBlock; i < blocks; i++)
|
||||||
for(ulong i = _resume.NextBlock; i < blocks; i++) subchannelExtents.Add((int)i);
|
subchannelExtents.Add((int)i);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_resume.NextBlock > 0)
|
if(_resume.NextBlock > 0)
|
||||||
{
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Resuming_from_block_0, _resume.NextBlock));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Resuming_from_block_0, _resume.NextBlock));
|
||||||
_dumpLog.WriteLine(Localization.Core.Resuming_from_block_0, _resume.NextBlock);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(_skip < _maximumReadable) _skip = _maximumReadable;
|
if(_skip < _maximumReadable) _skip = _maximumReadable;
|
||||||
|
|
||||||
@@ -1199,7 +1103,6 @@ sealed partial class Dump
|
|||||||
if(tracks.All(t => t.Type != TrackType.Audio))
|
if(tracks.All(t => t.Type != TrackType.Audio))
|
||||||
{
|
{
|
||||||
// No audio tracks so no need to fix offset
|
// No audio tracks so no need to fix offset
|
||||||
_dumpLog.WriteLine(Localization.Core.No_audio_tracks_disabling_offset_fix);
|
|
||||||
UpdateStatus.Invoke(Localization.Core.No_audio_tracks_disabling_offset_fix);
|
UpdateStatus.Invoke(Localization.Core.No_audio_tracks_disabling_offset_fix);
|
||||||
|
|
||||||
_fixOffset = false;
|
_fixOffset = false;
|
||||||
@@ -1207,9 +1110,6 @@ sealed partial class Dump
|
|||||||
|
|
||||||
if(!readcd)
|
if(!readcd)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.READ_CD_command_is_not_supported_disabling_offset_fix_Dump_may_not_be_correct);
|
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core
|
UpdateStatus?.Invoke(Localization.Core
|
||||||
.READ_CD_command_is_not_supported_disabling_offset_fix_Dump_may_not_be_correct);
|
.READ_CD_command_is_not_supported_disabling_offset_fix_Dump_may_not_be_correct);
|
||||||
|
|
||||||
@@ -1218,9 +1118,6 @@ sealed partial class Dump
|
|||||||
}
|
}
|
||||||
else if(tracks.Any(t => t.Type == TrackType.Audio))
|
else if(tracks.Any(t => t.Type == TrackType.Audio))
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.There_are_audio_tracks_and_offset_fixing_is_disabled_dump_may_not_be_correct);
|
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core
|
UpdateStatus?.Invoke(Localization.Core
|
||||||
.There_are_audio_tracks_and_offset_fixing_is_disabled_dump_may_not_be_correct);
|
.There_are_audio_tracks_and_offset_fixing_is_disabled_dump_may_not_be_correct);
|
||||||
}
|
}
|
||||||
@@ -1236,7 +1133,6 @@ sealed partial class Dump
|
|||||||
_debug,
|
_debug,
|
||||||
_dev,
|
_dev,
|
||||||
dskType,
|
dskType,
|
||||||
_dumpLog,
|
|
||||||
tracks,
|
tracks,
|
||||||
UpdateStatus,
|
UpdateStatus,
|
||||||
out int? driveOffset,
|
out int? driveOffset,
|
||||||
@@ -1247,31 +1143,20 @@ sealed partial class Dump
|
|||||||
{
|
{
|
||||||
if(driveOffset is null)
|
if(driveOffset is null)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Drive_reading_offset_not_found_in_database);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Drive_reading_offset_not_found_in_database);
|
UpdateStatus?.Invoke(Localization.Core.Drive_reading_offset_not_found_in_database);
|
||||||
_dumpLog.WriteLine(Localization.Core.Disc_offset_cannot_be_calculated);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Disc_offset_cannot_be_calculated);
|
UpdateStatus?.Invoke(Localization.Core.Disc_offset_cannot_be_calculated);
|
||||||
|
|
||||||
if(tracks.Any(t => t.Type == TrackType.Audio))
|
if(tracks.Any(t => t.Type == TrackType.Audio))
|
||||||
{
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Dump_may_not_be_correct);
|
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Dump_may_not_be_correct);
|
UpdateStatus?.Invoke(Localization.Core.Dump_may_not_be_correct);
|
||||||
}
|
|
||||||
|
|
||||||
if(_fixOffset) _fixOffset = false;
|
if(_fixOffset) _fixOffset = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Drive_reading_offset_is_0_bytes_1_samples,
|
|
||||||
driveOffset,
|
|
||||||
driveOffset / 4));
|
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Drive_reading_offset_is_0_bytes_1_samples,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Drive_reading_offset_is_0_bytes_1_samples,
|
||||||
driveOffset,
|
driveOffset,
|
||||||
driveOffset / 4));
|
driveOffset / 4));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Disc_write_offset_is_unknown_dump_may_not_be_correct);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Disc_write_offset_is_unknown_dump_may_not_be_correct);
|
UpdateStatus?.Invoke(Localization.Core.Disc_write_offset_is_unknown_dump_may_not_be_correct);
|
||||||
|
|
||||||
offsetBytes = driveOffset.Value;
|
offsetBytes = driveOffset.Value;
|
||||||
@@ -1294,13 +1179,8 @@ sealed partial class Dump
|
|||||||
|
|
||||||
if(driveOffset is null)
|
if(driveOffset is null)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Drive_reading_offset_not_found_in_database);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Drive_reading_offset_not_found_in_database);
|
UpdateStatus?.Invoke(Localization.Core.Drive_reading_offset_not_found_in_database);
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Combined_disc_and_drive_offset_are_0_bytes_1_samples,
|
|
||||||
offsetBytes,
|
|
||||||
offsetBytes / 4));
|
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core
|
UpdateStatus?.Invoke(string.Format(Localization.Core
|
||||||
.Combined_disc_and_drive_offset_are_0_bytes_1_samples,
|
.Combined_disc_and_drive_offset_are_0_bytes_1_samples,
|
||||||
offsetBytes,
|
offsetBytes,
|
||||||
@@ -1308,19 +1188,12 @@ sealed partial class Dump
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Drive_reading_offset_is_0_bytes_1_samples,
|
|
||||||
driveOffset,
|
|
||||||
driveOffset / 4));
|
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Drive_reading_offset_is_0_bytes_1_samples,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Drive_reading_offset_is_0_bytes_1_samples,
|
||||||
driveOffset,
|
driveOffset,
|
||||||
driveOffset / 4));
|
driveOffset / 4));
|
||||||
|
|
||||||
discOffset = offsetBytes - driveOffset;
|
discOffset = offsetBytes - driveOffset;
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Disc_offset_is_0_bytes_1_samples,
|
|
||||||
discOffset,
|
|
||||||
discOffset / 4));
|
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Disc_offset_is_0_bytes_1_samples,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Disc_offset_is_0_bytes_1_samples,
|
||||||
discOffset,
|
discOffset,
|
||||||
@@ -1364,10 +1237,6 @@ sealed partial class Dump
|
|||||||
// Set speed
|
// Set speed
|
||||||
if(_speedMultiplier >= 0)
|
if(_speedMultiplier >= 0)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(_speed == 0xFFFF
|
|
||||||
? Localization.Core.Setting_speed_to_MAX_for_data_reading
|
|
||||||
: string.Format(Localization.Core.Setting_speed_to_0_x_for_data_reading, _speed));
|
|
||||||
|
|
||||||
UpdateStatus?.Invoke(_speed == 0xFFFF
|
UpdateStatus?.Invoke(_speed == 0xFFFF
|
||||||
? Localization.Core.Setting_speed_to_MAX_for_data_reading
|
? Localization.Core.Setting_speed_to_MAX_for_data_reading
|
||||||
: string.Format(Localization.Core.Setting_speed_to_0_x_for_data_reading, _speed));
|
: string.Format(Localization.Core.Setting_speed_to_0_x_for_data_reading, _speed));
|
||||||
@@ -1390,9 +1259,6 @@ sealed partial class Dump
|
|||||||
|
|
||||||
if(!supportsLongSectors)
|
if(!supportsLongSectors)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Dumping_CD_i_Ready_requires_the_output_image_format_to_support_long_sectors);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Dumping_CD_i_Ready_requires_the_output_image_format_to_support_long_sectors);
|
.Dumping_CD_i_Ready_requires_the_output_image_format_to_support_long_sectors);
|
||||||
|
|
||||||
@@ -1401,9 +1267,6 @@ sealed partial class Dump
|
|||||||
|
|
||||||
if(!readcd)
|
if(!readcd)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Dumping_CD_i_Ready_requires_the_drive_to_support_the_READ_CD_command);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Dumping_CD_i_Ready_requires_the_drive_to_support_the_READ_CD_command);
|
.Dumping_CD_i_Ready_requires_the_drive_to_support_the_READ_CD_command);
|
||||||
|
|
||||||
@@ -1442,9 +1305,6 @@ sealed partial class Dump
|
|||||||
|
|
||||||
if(offsetBytes % sectorSize != 0) sectorsForOffset++;
|
if(offsetBytes % sectorSize != 0) sectorsForOffset++;
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Enabling_skipping_CD_i_Ready_hole_because_drive_returns_data_as_audio);
|
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core
|
UpdateStatus?.Invoke(Localization.Core
|
||||||
.Enabling_skipping_CD_i_Ready_hole_because_drive_returns_data_as_audio);
|
.Enabling_skipping_CD_i_Ready_hole_because_drive_returns_data_as_audio);
|
||||||
|
|
||||||
@@ -1452,13 +1312,8 @@ sealed partial class Dump
|
|||||||
|
|
||||||
if(driveOffset is null)
|
if(driveOffset is null)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Drive_reading_offset_not_found_in_database);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Drive_reading_offset_not_found_in_database);
|
UpdateStatus?.Invoke(Localization.Core.Drive_reading_offset_not_found_in_database);
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core
|
|
||||||
.Combined_disc_and_drive_offset_are_0_bytes_1_samples,
|
|
||||||
offsetBytes,
|
|
||||||
offsetBytes / 4));
|
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core
|
UpdateStatus?.Invoke(string.Format(Localization.Core
|
||||||
.Combined_disc_and_drive_offset_are_0_bytes_1_samples,
|
.Combined_disc_and_drive_offset_are_0_bytes_1_samples,
|
||||||
@@ -1467,19 +1322,12 @@ sealed partial class Dump
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Drive_reading_offset_is_0_bytes_1_samples,
|
|
||||||
driveOffset,
|
|
||||||
driveOffset / 4));
|
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Drive_reading_offset_is_0_bytes_1_samples,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Drive_reading_offset_is_0_bytes_1_samples,
|
||||||
driveOffset,
|
driveOffset,
|
||||||
driveOffset / 4));
|
driveOffset / 4));
|
||||||
|
|
||||||
discOffset = offsetBytes - driveOffset;
|
discOffset = offsetBytes - driveOffset;
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Disc_offset_is_0_bytes_1_samples,
|
|
||||||
discOffset,
|
|
||||||
discOffset / 4));
|
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Disc_offset_is_0_bytes_1_samples,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Disc_offset_is_0_bytes_1_samples,
|
||||||
discOffset,
|
discOffset,
|
||||||
@@ -1490,9 +1338,6 @@ sealed partial class Dump
|
|||||||
|
|
||||||
if(!_skipCdireadyHole)
|
if(!_skipCdireadyHole)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.There_will_be_thousand_of_errors_between_track_0_and_track_1_that_is_normal_and_you_can_ignore_them);
|
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core
|
UpdateStatus?.Invoke(Localization.Core
|
||||||
.There_will_be_thousand_of_errors_between_track_0_and_track_1_that_is_normal_and_you_can_ignore_them);
|
.There_will_be_thousand_of_errors_between_track_0_and_track_1_that_is_normal_and_you_can_ignore_them);
|
||||||
}
|
}
|
||||||
@@ -1592,18 +1437,6 @@ sealed partial class Dump
|
|||||||
.Per(imageWriteDuration.Seconds())
|
.Per(imageWriteDuration.Seconds())
|
||||||
.Humanize()));
|
.Humanize()));
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Dump_finished_in_0,
|
|
||||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_dump_speed_0,
|
|
||||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
|
||||||
.Per(totalDuration.Milliseconds())
|
|
||||||
.Humanize()));
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_write_speed_0,
|
|
||||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
|
||||||
.Per(imageWriteDuration.Seconds())
|
|
||||||
.Humanize()));
|
|
||||||
|
|
||||||
TrimCdUserData(audioExtents,
|
TrimCdUserData(audioExtents,
|
||||||
blockSize,
|
blockSize,
|
||||||
@@ -1661,9 +1494,8 @@ sealed partial class Dump
|
|||||||
supportsLongSectors);
|
supportsLongSectors);
|
||||||
|
|
||||||
foreach(Tuple<ulong, ulong> leadoutExtent in leadOutExtents.ToArray())
|
foreach(Tuple<ulong, ulong> leadoutExtent in leadOutExtents.ToArray())
|
||||||
{
|
for(ulong e = leadoutExtent.Item1; e <= leadoutExtent.Item2; e++)
|
||||||
for(ulong e = leadoutExtent.Item1; e <= leadoutExtent.Item2; e++) subchannelExtents.Remove((int)e);
|
subchannelExtents.Remove((int)e);
|
||||||
}
|
|
||||||
|
|
||||||
if(subchannelExtents.Count > 0 && _retryPasses > 0 && _retrySubchannel)
|
if(subchannelExtents.Count > 0 && _retryPasses > 0 && _retrySubchannel)
|
||||||
{
|
{
|
||||||
@@ -1697,7 +1529,6 @@ sealed partial class Dump
|
|||||||
if(ret || _force) continue;
|
if(ret || _force) continue;
|
||||||
|
|
||||||
// Cannot write tag to image
|
// Cannot write tag to image
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Cannot_write_tag_0, tag.Key));
|
|
||||||
StoppingErrorMessage?.Invoke(outputOptical.ErrorMessage);
|
StoppingErrorMessage?.Invoke(outputOptical.ErrorMessage);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -1706,7 +1537,8 @@ sealed partial class Dump
|
|||||||
|
|
||||||
_resume.BadBlocks.Sort();
|
_resume.BadBlocks.Sort();
|
||||||
|
|
||||||
foreach(ulong bad in _resume.BadBlocks) _dumpLog.WriteLine(Localization.Core.Sector_0_could_not_be_read, bad);
|
foreach(ulong bad in _resume.BadBlocks)
|
||||||
|
AaruLogging.Information(Localization.Core.Sector_0_could_not_be_read, bad);
|
||||||
|
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
|
|
||||||
@@ -1723,7 +1555,6 @@ sealed partial class Dump
|
|||||||
trackFlags,
|
trackFlags,
|
||||||
blocks,
|
blocks,
|
||||||
subLog,
|
subLog,
|
||||||
_dumpLog,
|
|
||||||
InitProgress,
|
InitProgress,
|
||||||
UpdateProgress,
|
UpdateProgress,
|
||||||
EndProgress,
|
EndProgress,
|
||||||
@@ -1755,14 +1586,10 @@ sealed partial class Dump
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Setting_ISRC_for_track_0_to_1, isrc.Key, isrc.Value));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Setting_ISRC_for_track_0_to_1, isrc.Key, isrc.Value));
|
||||||
_dumpLog.WriteLine(Localization.Core.Setting_ISRC_for_track_0_to_1, isrc.Key, isrc.Value);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(mcn != null && outputOptical.WriteMediaTag(Encoding.ASCII.GetBytes(mcn), MediaTagType.CD_MCN))
|
if(mcn != null && outputOptical.WriteMediaTag(Encoding.ASCII.GetBytes(mcn), MediaTagType.CD_MCN))
|
||||||
{
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Setting_disc_Media_Catalogue_Number_to_0, mcn));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Setting_disc_Media_Catalogue_Number_to_0, mcn));
|
||||||
_dumpLog.WriteLine(Localization.Core.Setting_disc_Media_Catalogue_Number_to_0, mcn);
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach(Track trk in tracks)
|
foreach(Track trk in tracks)
|
||||||
{
|
{
|
||||||
@@ -1783,7 +1610,6 @@ sealed partial class Dump
|
|||||||
|
|
||||||
outputOptical.SetTracks(tracks.ToList());
|
outputOptical.SetTracks(tracks.ToList());
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Closing_output_file);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
||||||
_imageCloseStopwatch.Restart();
|
_imageCloseStopwatch.Restart();
|
||||||
outputOptical.Close();
|
outputOptical.Close();
|
||||||
@@ -1796,7 +1622,7 @@ sealed partial class Dump
|
|||||||
|
|
||||||
if(_aborted)
|
if(_aborted)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
AaruLogging.WriteLine(Localization.Core.Aborted);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -197,7 +197,6 @@ partial class Dump
|
|||||||
md10 = Modes.EncodeMode10(md, _dev.ScsiType);
|
md10 = Modes.EncodeMode10(md, _dev.ScsiType);
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Sending_MODE_SELECT_to_drive_return_damaged_blocks);
|
UpdateStatus?.Invoke(Localization.Core.Sending_MODE_SELECT_to_drive_return_damaged_blocks);
|
||||||
_dumpLog.WriteLine(Localization.Core.Sending_MODE_SELECT_to_drive_return_damaged_blocks);
|
|
||||||
sense = _dev.ModeSelect(md6, out senseBuf, true, false, _dev.Timeout, out _);
|
sense = _dev.ModeSelect(md6, out senseBuf, true, false, _dev.Timeout, out _);
|
||||||
|
|
||||||
if(sense) sense = _dev.ModeSelect10(md10, out senseBuf, true, false, _dev.Timeout, out _);
|
if(sense) sense = _dev.ModeSelect10(md10, out senseBuf, true, false, _dev.Timeout, out _);
|
||||||
@@ -208,9 +207,6 @@ partial class Dump
|
|||||||
.Drive_did_not_accept_MODE_SELECT_command_for_persistent_error_reading);
|
.Drive_did_not_accept_MODE_SELECT_command_for_persistent_error_reading);
|
||||||
|
|
||||||
AaruLogging.Debug(Localization.Core.Error_0, Sense.PrettifySense(senseBuf));
|
AaruLogging.Debug(Localization.Core.Error_0, Sense.PrettifySense(senseBuf));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Drive_did_not_accept_MODE_SELECT_command_for_persistent_error_reading);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
runningPersistent = true;
|
runningPersistent = true;
|
||||||
@@ -228,7 +224,7 @@ partial class Dump
|
|||||||
if(_aborted)
|
if(_aborted)
|
||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
AaruLogging.WriteLine(Localization.Core.Aborted);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -469,8 +465,9 @@ 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))
|
{
|
||||||
sectorsNotEvenPartial.Add(badSector);
|
if(!sectorsNotEvenPartial.Contains(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
|
||||||
@@ -499,7 +496,6 @@ partial class Dump
|
|||||||
badSector,
|
badSector,
|
||||||
pass));
|
pass));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Correctly_retried_sector_0_in_pass_1, badSector, pass);
|
|
||||||
sectorsNotEvenPartial.Remove(badSector);
|
sectorsNotEvenPartial.Remove(badSector);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -532,7 +528,6 @@ partial class Dump
|
|||||||
outputOptical,
|
outputOptical,
|
||||||
_fixSubchannel,
|
_fixSubchannel,
|
||||||
_fixSubchannelCrc,
|
_fixSubchannelCrc,
|
||||||
_dumpLog,
|
|
||||||
UpdateStatus,
|
UpdateStatus,
|
||||||
smallestPregapLbaPerTrack,
|
smallestPregapLbaPerTrack,
|
||||||
true,
|
true,
|
||||||
@@ -600,7 +595,7 @@ partial class Dump
|
|||||||
md6 = Modes.EncodeMode6(md, _dev.ScsiType);
|
md6 = Modes.EncodeMode6(md, _dev.ScsiType);
|
||||||
md10 = Modes.EncodeMode10(md, _dev.ScsiType);
|
md10 = Modes.EncodeMode10(md, _dev.ScsiType);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Sending_MODE_SELECT_to_drive_ignore_error_correction);
|
AaruLogging.WriteLine(Localization.Core.Sending_MODE_SELECT_to_drive_ignore_error_correction);
|
||||||
sense = _dev.ModeSelect(md6, out senseBuf, true, false, _dev.Timeout, out _);
|
sense = _dev.ModeSelect(md6, out senseBuf, true, false, _dev.Timeout, out _);
|
||||||
|
|
||||||
if(sense) sense = _dev.ModeSelect10(md10, out senseBuf, true, false, _dev.Timeout, out _);
|
if(sense) sense = _dev.ModeSelect10(md10, out senseBuf, true, false, _dev.Timeout, out _);
|
||||||
@@ -618,7 +613,7 @@ partial class Dump
|
|||||||
if(_aborted)
|
if(_aborted)
|
||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
AaruLogging.WriteLine(Localization.Core.Aborted);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -657,7 +652,7 @@ partial class Dump
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Got_partial_data_for_sector_0_in_pass_1, badSector, pass);
|
AaruLogging.WriteLine(Localization.Core.Got_partial_data_for_sector_0_in_pass_1, badSector, pass);
|
||||||
|
|
||||||
if(supportedSubchannel != MmcSubchannel.None)
|
if(supportedSubchannel != MmcSubchannel.None)
|
||||||
{
|
{
|
||||||
@@ -686,7 +681,6 @@ partial class Dump
|
|||||||
outputOptical,
|
outputOptical,
|
||||||
_fixSubchannel,
|
_fixSubchannel,
|
||||||
_fixSubchannelCrc,
|
_fixSubchannelCrc,
|
||||||
_dumpLog,
|
|
||||||
UpdateStatus,
|
UpdateStatus,
|
||||||
smallestPregapLbaPerTrack,
|
smallestPregapLbaPerTrack,
|
||||||
true,
|
true,
|
||||||
@@ -722,7 +716,7 @@ partial class Dump
|
|||||||
md6 = Modes.EncodeMode6(md, _dev.ScsiType);
|
md6 = Modes.EncodeMode6(md, _dev.ScsiType);
|
||||||
md10 = Modes.EncodeMode10(md, _dev.ScsiType);
|
md10 = Modes.EncodeMode10(md, _dev.ScsiType);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Sending_MODE_SELECT_to_drive_return_device_to_previous_status);
|
AaruLogging.WriteLine(Localization.Core.Sending_MODE_SELECT_to_drive_return_device_to_previous_status);
|
||||||
sense = _dev.ModeSelect(md6, out senseBuf, true, false, _dev.Timeout, out _);
|
sense = _dev.ModeSelect(md6, out senseBuf, true, false, _dev.Timeout, out _);
|
||||||
|
|
||||||
if(sense) _dev.ModeSelect10(md10, out senseBuf, true, false, _dev.Timeout, out _);
|
if(sense) _dev.ModeSelect10(md10, out senseBuf, true, false, _dev.Timeout, out _);
|
||||||
@@ -790,7 +784,7 @@ partial class Dump
|
|||||||
|
|
||||||
if(_aborted)
|
if(_aborted)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
AaruLogging.WriteLine(Localization.Core.Aborted);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -862,7 +856,6 @@ partial class Dump
|
|||||||
outputOptical,
|
outputOptical,
|
||||||
_fixSubchannel,
|
_fixSubchannel,
|
||||||
_fixSubchannelCrc,
|
_fixSubchannelCrc,
|
||||||
_dumpLog,
|
|
||||||
UpdateStatus,
|
UpdateStatus,
|
||||||
smallestPregapLbaPerTrack,
|
smallestPregapLbaPerTrack,
|
||||||
true,
|
true,
|
||||||
@@ -873,8 +866,6 @@ partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Correctly_retried_sector_0_subchannel_in_pass_1,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Correctly_retried_sector_0_subchannel_in_pass_1,
|
||||||
badSector,
|
badSector,
|
||||||
pass));
|
pass));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Correctly_retried_sector_0_subchannel_in_pass_1, badSector, pass);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pass < _retryPasses && !_aborted && subchannelExtents.Count > 0)
|
if(pass < _retryPasses && !_aborted && subchannelExtents.Count > 0)
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ using Aaru.CommonTypes.Extents;
|
|||||||
using Aaru.CommonTypes.Interfaces;
|
using Aaru.CommonTypes.Interfaces;
|
||||||
using Aaru.Core.Logging;
|
using Aaru.Core.Logging;
|
||||||
using Aaru.Devices;
|
using Aaru.Devices;
|
||||||
|
using Aaru.Logging;
|
||||||
using Humanizer;
|
using Humanizer;
|
||||||
using Humanizer.Bytes;
|
using Humanizer.Bytes;
|
||||||
using Track = Aaru.CommonTypes.Structs.Track;
|
using Track = Aaru.CommonTypes.Structs.Track;
|
||||||
@@ -91,12 +92,11 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
byte[] cmdBuf = null; // Data buffer
|
byte[] cmdBuf = null; // Data buffer
|
||||||
const uint sectorSize = 2352; // Full sector size
|
const uint sectorSize = 2352; // Full sector size
|
||||||
var sense = true; // Sense indicator
|
bool sense = true; // Sense indicator
|
||||||
byte[] senseBuf = null;
|
byte[] senseBuf = null;
|
||||||
var outputOptical = _outputPlugin as IWritableOpticalImage;
|
var outputOptical = _outputPlugin as IWritableOpticalImage;
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_lead_outs);
|
UpdateStatus?.Invoke(Localization.Core.Reading_lead_outs);
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_lead_outs);
|
|
||||||
|
|
||||||
InitProgress?.Invoke();
|
InitProgress?.Invoke();
|
||||||
|
|
||||||
@@ -107,7 +107,7 @@ partial class Dump
|
|||||||
if(_aborted)
|
if(_aborted)
|
||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
AaruLogging.WriteLine(Localization.Core.Aborted);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -205,10 +205,10 @@ partial class Dump
|
|||||||
|
|
||||||
if(supportedSubchannel != MmcSubchannel.None)
|
if(supportedSubchannel != MmcSubchannel.None)
|
||||||
{
|
{
|
||||||
var data = new byte[sectorSize * _maximumReadable];
|
byte[] data = new byte[sectorSize * _maximumReadable];
|
||||||
var sub = new byte[subSize * _maximumReadable];
|
byte[] sub = new byte[subSize * _maximumReadable];
|
||||||
|
|
||||||
for(var b = 0; b < _maximumReadable; b++)
|
for(int b = 0; b < _maximumReadable; b++)
|
||||||
{
|
{
|
||||||
Array.Copy(cmdBuf, (int)(0 + b * blockSize), data, sectorSize * b, sectorSize);
|
Array.Copy(cmdBuf, (int)(0 + b * blockSize), data, sectorSize * b, sectorSize);
|
||||||
|
|
||||||
@@ -232,7 +232,6 @@ partial class Dump
|
|||||||
outputOptical,
|
outputOptical,
|
||||||
_fixSubchannel,
|
_fixSubchannel,
|
||||||
_fixSubchannelCrc,
|
_fixSubchannelCrc,
|
||||||
_dumpLog,
|
|
||||||
UpdateStatus,
|
UpdateStatus,
|
||||||
smallestPregapLbaPerTrack,
|
smallestPregapLbaPerTrack,
|
||||||
true,
|
true,
|
||||||
@@ -332,11 +331,11 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
byte[] cmdBuf = null; // Data buffer
|
byte[] cmdBuf = null; // Data buffer
|
||||||
const uint sectorSize = 2352; // Full sector size
|
const uint sectorSize = 2352; // Full sector size
|
||||||
var sense = true; // Sense indicator
|
bool sense = true; // Sense indicator
|
||||||
byte[] senseBuf = null;
|
byte[] senseBuf = null;
|
||||||
var outputOptical = _outputPlugin as IWritableOpticalImage;
|
var outputOptical = _outputPlugin as IWritableOpticalImage;
|
||||||
|
|
||||||
_dumpLog.WriteLine("Retrying lead-outs");
|
AaruLogging.WriteLine("Retrying lead-outs");
|
||||||
|
|
||||||
InitProgress?.Invoke();
|
InitProgress?.Invoke();
|
||||||
|
|
||||||
@@ -347,7 +346,7 @@ partial class Dump
|
|||||||
if(_aborted)
|
if(_aborted)
|
||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
AaruLogging.WriteLine(Localization.Core.Aborted);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -445,10 +444,10 @@ partial class Dump
|
|||||||
|
|
||||||
if(supportedSubchannel != MmcSubchannel.None)
|
if(supportedSubchannel != MmcSubchannel.None)
|
||||||
{
|
{
|
||||||
var data = new byte[sectorSize * _maximumReadable];
|
byte[] data = new byte[sectorSize * _maximumReadable];
|
||||||
var sub = new byte[subSize * _maximumReadable];
|
byte[] sub = new byte[subSize * _maximumReadable];
|
||||||
|
|
||||||
for(var b = 0; b < _maximumReadable; b++)
|
for(int b = 0; b < _maximumReadable; b++)
|
||||||
{
|
{
|
||||||
Array.Copy(cmdBuf, (int)(0 + b * blockSize), data, sectorSize * b, sectorSize);
|
Array.Copy(cmdBuf, (int)(0 + b * blockSize), data, sectorSize * b, sectorSize);
|
||||||
|
|
||||||
@@ -472,7 +471,6 @@ partial class Dump
|
|||||||
outputOptical,
|
outputOptical,
|
||||||
_fixSubchannel,
|
_fixSubchannel,
|
||||||
_fixSubchannelCrc,
|
_fixSubchannelCrc,
|
||||||
_dumpLog,
|
|
||||||
UpdateStatus,
|
UpdateStatus,
|
||||||
smallestPregapLbaPerTrack,
|
smallestPregapLbaPerTrack,
|
||||||
true,
|
true,
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ using Aaru.Checksums;
|
|||||||
using Aaru.CommonTypes;
|
using Aaru.CommonTypes;
|
||||||
using Aaru.CommonTypes.Enums;
|
using Aaru.CommonTypes.Enums;
|
||||||
using Aaru.CommonTypes.Structs;
|
using Aaru.CommonTypes.Structs;
|
||||||
using Aaru.Core.Logging;
|
|
||||||
using Aaru.Devices;
|
using Aaru.Devices;
|
||||||
using Aaru.Logging;
|
using Aaru.Logging;
|
||||||
using Humanizer;
|
using Humanizer;
|
||||||
@@ -70,7 +69,6 @@ partial class Dump
|
|||||||
int firstTrackPregapSectorsGood = 0;
|
int firstTrackPregapSectorsGood = 0;
|
||||||
var firstTrackPregapMs = new MemoryStream();
|
var firstTrackPregapMs = new MemoryStream();
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_first_track_pregap);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_first_track_pregap);
|
UpdateStatus?.Invoke(Localization.Core.Reading_first_track_pregap);
|
||||||
InitProgress?.Invoke();
|
InitProgress?.Invoke();
|
||||||
_speedStopwatch.Restart();
|
_speedStopwatch.Restart();
|
||||||
@@ -81,7 +79,6 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
if(_aborted)
|
if(_aborted)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -145,8 +142,6 @@ partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Got_0_first_track_pregap_sectors,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Got_0_first_track_pregap_sectors,
|
||||||
firstTrackPregapSectorsGood));
|
firstTrackPregapSectorsGood));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Got_0_first_track_pregap_sectors, firstTrackPregapSectorsGood);
|
|
||||||
|
|
||||||
firstTrackPregapMs.Close();
|
firstTrackPregapMs.Close();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -160,8 +155,8 @@ partial class Dump
|
|||||||
/// <param name="dbDev">Database entry for device</param>
|
/// <param name="dbDev">Database entry for device</param>
|
||||||
/// <param name="inexactPositioning">Set if we found the drive does not return the exact subchannel we requested</param>
|
/// <param name="inexactPositioning">Set if we found the drive does not return the exact subchannel we requested</param>
|
||||||
/// <param name="dumping">Set if dumping, otherwise media info</param>
|
/// <param name="dumping">Set if dumping, otherwise media info</param>
|
||||||
public static void SolveTrackPregaps(Device dev, DumpLog dumpLog, UpdateStatusHandler updateStatus, Track[] tracks,
|
public static void SolveTrackPregaps(Device dev, UpdateStatusHandler updateStatus, Track[] tracks,
|
||||||
bool supportsPqSubchannel, bool supportsRwSubchannel,
|
bool supportsPqSubchannel, bool supportsRwSubchannel,
|
||||||
Database.Models.Device dbDev, out bool inexactPositioning, bool dumping)
|
Database.Models.Device dbDev, out bool inexactPositioning, bool dumping)
|
||||||
{
|
{
|
||||||
bool sense = true; // Sense indicator
|
bool sense = true; // Sense indicator
|
||||||
@@ -190,18 +185,15 @@ partial class Dump
|
|||||||
}
|
}
|
||||||
|
|
||||||
AaruLogging.Debug(PREGAP_MODULE_NAME,
|
AaruLogging.Debug(PREGAP_MODULE_NAME,
|
||||||
bcd switch
|
bcd switch
|
||||||
{
|
{
|
||||||
true => Localization.Core.Subchannel_is_BCD,
|
true => Localization.Core.Subchannel_is_BCD,
|
||||||
false => Localization.Core.Subchannel_is_not_BCD,
|
false => Localization.Core.Subchannel_is_not_BCD,
|
||||||
_ => Localization.Core.Could_not_detect_drive_subchannel_BCD
|
_ => Localization.Core.Could_not_detect_drive_subchannel_BCD
|
||||||
});
|
});
|
||||||
|
|
||||||
if(bcd is null)
|
if(bcd is null)
|
||||||
{
|
{
|
||||||
dumpLog?.WriteLine(Localization.Core
|
|
||||||
.Could_not_detect_if_drive_subchannel_is_BCD_or_not_pregaps_could_not_be_calculated_dump_may_be_incorrect);
|
|
||||||
|
|
||||||
updateStatus?.Invoke(Localization.Core
|
updateStatus?.Invoke(Localization.Core
|
||||||
.Could_not_detect_if_drive_subchannel_is_BCD_or_not_pregaps_could_not_be_calculated_dump_may_be_incorrect);
|
.Could_not_detect_if_drive_subchannel_is_BCD_or_not_pregaps_could_not_be_calculated_dump_may_be_incorrect);
|
||||||
|
|
||||||
@@ -236,8 +228,8 @@ partial class Dump
|
|||||||
if(dumping && dev.Manufacturer.ToLowerInvariant().StartsWith("plextor", StringComparison.Ordinal))
|
if(dumping && dev.Manufacturer.ToLowerInvariant().StartsWith("plextor", StringComparison.Ordinal))
|
||||||
{
|
{
|
||||||
AaruLogging.Debug(PREGAP_MODULE_NAME,
|
AaruLogging.Debug(PREGAP_MODULE_NAME,
|
||||||
Localization.Core.Skipping_track_0_due_to_Plextor_firmware_bug,
|
Localization.Core.Skipping_track_0_due_to_Plextor_firmware_bug,
|
||||||
track.Sequence);
|
track.Sequence);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -264,10 +256,10 @@ partial class Dump
|
|||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
AaruLogging.Debug(PREGAP_MODULE_NAME,
|
AaruLogging.Debug(PREGAP_MODULE_NAME,
|
||||||
Localization.Core.LBA_0_Try_1_Sense_2,
|
Localization.Core.LBA_0_Try_1_Sense_2,
|
||||||
lba,
|
lba,
|
||||||
retries + 1,
|
retries + 1,
|
||||||
sense);
|
sense);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -277,25 +269,25 @@ partial class Dump
|
|||||||
CRC16CcittContext.Data(subBuf, 10, out crc);
|
CRC16CcittContext.Data(subBuf, 10, out crc);
|
||||||
|
|
||||||
AaruLogging.Debug(PREGAP_MODULE_NAME,
|
AaruLogging.Debug(PREGAP_MODULE_NAME,
|
||||||
Localization.Core
|
Localization.Core
|
||||||
.LBA_0_Try_1_Sense_2_Q_3_4_5_6_7_8_9_10_11_12_CRC_13_14_Calculated_CRC_15_16,
|
.LBA_0_Try_1_Sense_2_Q_3_4_5_6_7_8_9_10_11_12_CRC_13_14_Calculated_CRC_15_16,
|
||||||
lba,
|
lba,
|
||||||
retries + 1,
|
retries + 1,
|
||||||
sense,
|
sense,
|
||||||
subBuf[0],
|
subBuf[0],
|
||||||
subBuf[1],
|
subBuf[1],
|
||||||
subBuf[2],
|
subBuf[2],
|
||||||
subBuf[3],
|
subBuf[3],
|
||||||
subBuf[4],
|
subBuf[4],
|
||||||
subBuf[5],
|
subBuf[5],
|
||||||
subBuf[6],
|
subBuf[6],
|
||||||
subBuf[7],
|
subBuf[7],
|
||||||
subBuf[8],
|
subBuf[8],
|
||||||
subBuf[9],
|
subBuf[9],
|
||||||
subBuf[10],
|
subBuf[10],
|
||||||
subBuf[11],
|
subBuf[11],
|
||||||
crc[0],
|
crc[0],
|
||||||
crc[1]);
|
crc[1]);
|
||||||
|
|
||||||
crcOk = crc[0] == subBuf[10] && crc[1] == subBuf[11];
|
crcOk = crc[0] == subBuf[10] && crc[1] == subBuf[11];
|
||||||
|
|
||||||
@@ -330,25 +322,25 @@ partial class Dump
|
|||||||
if(crcOk)
|
if(crcOk)
|
||||||
{
|
{
|
||||||
AaruLogging.Debug(PREGAP_MODULE_NAME,
|
AaruLogging.Debug(PREGAP_MODULE_NAME,
|
||||||
Localization.Core
|
Localization.Core
|
||||||
.LBA_0_Try_1_Sense_2_Q_FIXED_3_4_5_6_7_8_9_10_11_12_CRC_13_14_Calculated_CRC_15_16,
|
.LBA_0_Try_1_Sense_2_Q_FIXED_3_4_5_6_7_8_9_10_11_12_CRC_13_14_Calculated_CRC_15_16,
|
||||||
lba,
|
lba,
|
||||||
retries + 1,
|
retries + 1,
|
||||||
sense,
|
sense,
|
||||||
subBuf[0],
|
subBuf[0],
|
||||||
subBuf[1],
|
subBuf[1],
|
||||||
subBuf[2],
|
subBuf[2],
|
||||||
subBuf[3],
|
subBuf[3],
|
||||||
subBuf[4],
|
subBuf[4],
|
||||||
subBuf[5],
|
subBuf[5],
|
||||||
subBuf[6],
|
subBuf[6],
|
||||||
subBuf[7],
|
subBuf[7],
|
||||||
subBuf[8],
|
subBuf[8],
|
||||||
subBuf[9],
|
subBuf[9],
|
||||||
subBuf[10],
|
subBuf[10],
|
||||||
subBuf[11],
|
subBuf[11],
|
||||||
crc[0],
|
crc[0],
|
||||||
crc[1]);
|
crc[1]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
continue;
|
continue;
|
||||||
@@ -404,25 +396,25 @@ partial class Dump
|
|||||||
CRC16CcittContext.Data(subBuf, 10, out crc);
|
CRC16CcittContext.Data(subBuf, 10, out crc);
|
||||||
|
|
||||||
AaruLogging.Debug(PREGAP_MODULE_NAME,
|
AaruLogging.Debug(PREGAP_MODULE_NAME,
|
||||||
Localization.Core
|
Localization.Core
|
||||||
.LBA_0_Try_1_Sense_2_Q_3_4_5_6_7_8_9_10_11_12_CRC_13_14_Calculated_CRC_15_16,
|
.LBA_0_Try_1_Sense_2_Q_3_4_5_6_7_8_9_10_11_12_CRC_13_14_Calculated_CRC_15_16,
|
||||||
lba,
|
lba,
|
||||||
retries + 1,
|
retries + 1,
|
||||||
sense,
|
sense,
|
||||||
subBuf[0],
|
subBuf[0],
|
||||||
subBuf[1],
|
subBuf[1],
|
||||||
subBuf[2],
|
subBuf[2],
|
||||||
subBuf[3],
|
subBuf[3],
|
||||||
subBuf[4],
|
subBuf[4],
|
||||||
subBuf[5],
|
subBuf[5],
|
||||||
subBuf[6],
|
subBuf[6],
|
||||||
subBuf[7],
|
subBuf[7],
|
||||||
subBuf[8],
|
subBuf[8],
|
||||||
subBuf[9],
|
subBuf[9],
|
||||||
subBuf[10],
|
subBuf[10],
|
||||||
subBuf[11],
|
subBuf[11],
|
||||||
crc[0],
|
crc[0],
|
||||||
crc[1]);
|
crc[1]);
|
||||||
|
|
||||||
crcOk = crc[0] == subBuf[10] && crc[1] == subBuf[11];
|
crcOk = crc[0] == subBuf[10] && crc[1] == subBuf[11];
|
||||||
|
|
||||||
@@ -457,25 +449,25 @@ partial class Dump
|
|||||||
if(crcOk)
|
if(crcOk)
|
||||||
{
|
{
|
||||||
AaruLogging.Debug(PREGAP_MODULE_NAME,
|
AaruLogging.Debug(PREGAP_MODULE_NAME,
|
||||||
Localization.Core
|
Localization.Core
|
||||||
.LBA_0_Try_1_Sense_2_Q_FIXED_3_4_5_6_7_8_9_10_11_12_CRC_13_14_Calculated_CRC_15_16,
|
.LBA_0_Try_1_Sense_2_Q_FIXED_3_4_5_6_7_8_9_10_11_12_CRC_13_14_Calculated_CRC_15_16,
|
||||||
lba,
|
lba,
|
||||||
retries + 1,
|
retries + 1,
|
||||||
sense,
|
sense,
|
||||||
subBuf[0],
|
subBuf[0],
|
||||||
subBuf[1],
|
subBuf[1],
|
||||||
subBuf[2],
|
subBuf[2],
|
||||||
subBuf[3],
|
subBuf[3],
|
||||||
subBuf[4],
|
subBuf[4],
|
||||||
subBuf[5],
|
subBuf[5],
|
||||||
subBuf[6],
|
subBuf[6],
|
||||||
subBuf[7],
|
subBuf[7],
|
||||||
subBuf[8],
|
subBuf[8],
|
||||||
subBuf[9],
|
subBuf[9],
|
||||||
subBuf[10],
|
subBuf[10],
|
||||||
subBuf[11],
|
subBuf[11],
|
||||||
crc[0],
|
crc[0],
|
||||||
crc[1]);
|
crc[1]);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -497,27 +489,17 @@ partial class Dump
|
|||||||
if(previousTrack.Type == TrackType.Audio && track.Type != TrackType.Audio ||
|
if(previousTrack.Type == TrackType.Audio && track.Type != TrackType.Audio ||
|
||||||
previousTrack.Type != TrackType.Audio && track.Type == TrackType.Audio)
|
previousTrack.Type != TrackType.Audio && track.Type == TrackType.Audio)
|
||||||
{
|
{
|
||||||
dumpLog?.WriteLine(Localization.Core
|
|
||||||
.Could_not_read_subchannel_for_this_track_supposing_hundred_fifty_sectors);
|
|
||||||
|
|
||||||
updateStatus?.Invoke(Localization.Core
|
updateStatus?.Invoke(Localization.Core
|
||||||
.Could_not_read_subchannel_for_this_track_supposing_hundred_fifty_sectors);
|
.Could_not_read_subchannel_for_this_track_supposing_hundred_fifty_sectors);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dumpLog?.WriteLine(Localization.Core
|
|
||||||
.Could_not_read_subchannel_for_this_track_supposing_zero_sectors);
|
|
||||||
|
|
||||||
updateStatus?.Invoke(Localization.Core
|
updateStatus?.Invoke(Localization.Core
|
||||||
.Could_not_read_subchannel_for_this_track_supposing_zero_sectors);
|
.Could_not_read_subchannel_for_this_track_supposing_zero_sectors);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dumpLog?.WriteLine(string.Format(Localization.Core
|
|
||||||
.Could_not_read_subchannel_for_this_track_supposing_0_sectors,
|
|
||||||
pregaps[track.Sequence]));
|
|
||||||
|
|
||||||
updateStatus?.Invoke(string.Format(Localization.Core
|
updateStatus?.Invoke(string.Format(Localization.Core
|
||||||
.Could_not_read_subchannel_for_this_track_supposing_0_sectors,
|
.Could_not_read_subchannel_for_this_track_supposing_0_sectors,
|
||||||
pregaps[track.Sequence]));
|
pregaps[track.Sequence]));
|
||||||
@@ -526,9 +508,6 @@ partial class Dump
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
dumpLog?.WriteLine(string.Format(Localization.Core.Could_not_read_subchannel_for_sector_0,
|
|
||||||
lba));
|
|
||||||
|
|
||||||
updateStatus?.Invoke(string.Format(Localization.Core.Could_not_read_subchannel_for_sector_0,
|
updateStatus?.Invoke(string.Format(Localization.Core.Could_not_read_subchannel_for_sector_0,
|
||||||
lba));
|
lba));
|
||||||
|
|
||||||
@@ -538,9 +517,6 @@ partial class Dump
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
dumpLog?.WriteLine(string.Format(Localization.Core.Could_not_get_correct_subchannel_for_sector_0,
|
|
||||||
lba));
|
|
||||||
|
|
||||||
updateStatus?.Invoke(string.Format(Localization.Core.Could_not_get_correct_subchannel_for_sector_0,
|
updateStatus?.Invoke(string.Format(Localization.Core.Could_not_get_correct_subchannel_for_sector_0,
|
||||||
lba));
|
lba));
|
||||||
}
|
}
|
||||||
@@ -612,9 +588,9 @@ partial class Dump
|
|||||||
if(diff != 0)
|
if(diff != 0)
|
||||||
{
|
{
|
||||||
AaruLogging.Debug(PREGAP_MODULE_NAME,
|
AaruLogging.Debug(PREGAP_MODULE_NAME,
|
||||||
Localization.Core.Invalid_Q_position_for_LBA_0_got_1,
|
Localization.Core.Invalid_Q_position_for_LBA_0_got_1,
|
||||||
lba,
|
lba,
|
||||||
posQ);
|
posQ);
|
||||||
|
|
||||||
inexactPositioning = true;
|
inexactPositioning = true;
|
||||||
}
|
}
|
||||||
@@ -636,9 +612,9 @@ partial class Dump
|
|||||||
if(crcOk || pregapQ - pregaps[track.Sequence] < 10)
|
if(crcOk || pregapQ - pregaps[track.Sequence] < 10)
|
||||||
{
|
{
|
||||||
AaruLogging.Debug(PREGAP_MODULE_NAME,
|
AaruLogging.Debug(PREGAP_MODULE_NAME,
|
||||||
Localization.Core.Pregap_for_track_0_1,
|
Localization.Core.Pregap_for_track_0_1,
|
||||||
track.Sequence,
|
track.Sequence,
|
||||||
pregapQ);
|
pregapQ);
|
||||||
|
|
||||||
pregaps[track.Sequence] = pregapQ;
|
pregaps[track.Sequence] = pregapQ;
|
||||||
}
|
}
|
||||||
@@ -680,8 +656,6 @@ partial class Dump
|
|||||||
trk.StartSector -= trk.Pregap;
|
trk.StartSector -= trk.Pregap;
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
dumpLog?.WriteLine(string.Format(Localization.Core.Track_0_pregap_is_1_sectors, trk.Sequence, trk.Pregap));
|
|
||||||
|
|
||||||
updateStatus?.Invoke(string.Format(Localization.Core.Track_0_pregap_is_1_sectors,
|
updateStatus?.Invoke(string.Format(Localization.Core.Track_0_pregap_is_1_sectors,
|
||||||
trk.Sequence,
|
trk.Sequence,
|
||||||
trk.Pregap));
|
trk.Pregap));
|
||||||
|
|||||||
@@ -63,9 +63,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(runOutSectors.Count == 0) return;
|
if(runOutSectors.Count == 0) return;
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core._0_sectors_at_the_end_of_the_disc_are_unreadable,
|
|
||||||
runOutSectors.Count));
|
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core._0_sectors_at_the_end_of_the_disc_are_unreadable,
|
UpdateStatus?.Invoke(string.Format(Localization.Core._0_sectors_at_the_end_of_the_disc_are_unreadable,
|
||||||
runOutSectors.Count));
|
runOutSectors.Count));
|
||||||
|
|
||||||
@@ -75,7 +72,7 @@ partial class Dump
|
|||||||
|
|
||||||
if(track is null) continue;
|
if(track is null) continue;
|
||||||
|
|
||||||
var sector = new byte[2352];
|
byte[] sector = new byte[2352];
|
||||||
|
|
||||||
switch(track.Type)
|
switch(track.Type)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -35,7 +35,6 @@
|
|||||||
// ReSharper disable TooWideLocalVariableScope
|
// ReSharper disable TooWideLocalVariableScope
|
||||||
|
|
||||||
using Aaru.CommonTypes;
|
using Aaru.CommonTypes;
|
||||||
using Aaru.Core.Logging;
|
|
||||||
using Aaru.Devices;
|
using Aaru.Devices;
|
||||||
|
|
||||||
namespace Aaru.Core.Devices.Dumping;
|
namespace Aaru.Core.Devices.Dumping;
|
||||||
@@ -48,9 +47,8 @@ partial class Dump
|
|||||||
/// <param name="updateStatus">Progress update callback</param>
|
/// <param name="updateStatus">Progress update callback</param>
|
||||||
/// <param name="lba">LBA to try</param>
|
/// <param name="lba">LBA to try</param>
|
||||||
/// <returns><c>true</c> if read correctly, <c>false</c> otherwise</returns>
|
/// <returns><c>true</c> if read correctly, <c>false</c> otherwise</returns>
|
||||||
public static bool SupportsRwSubchannel(Device dev, DumpLog dumpLog, UpdateStatusHandler updateStatus, uint lba)
|
public static bool SupportsRwSubchannel(Device dev, UpdateStatusHandler updateStatus, uint lba)
|
||||||
{
|
{
|
||||||
dumpLog?.WriteLine(Localization.Core.Checking_if_drive_supports_full_raw_subchannel_reading);
|
|
||||||
updateStatus?.Invoke(Localization.Core.Checking_if_drive_supports_full_raw_subchannel_reading);
|
updateStatus?.Invoke(Localization.Core.Checking_if_drive_supports_full_raw_subchannel_reading);
|
||||||
|
|
||||||
return !dev.ReadCd(out _,
|
return !dev.ReadCd(out _,
|
||||||
@@ -77,9 +75,8 @@ partial class Dump
|
|||||||
/// <param name="updateStatus">Progress update callback</param>
|
/// <param name="updateStatus">Progress update callback</param>
|
||||||
/// <param name="lba">LBA to try</param>
|
/// <param name="lba">LBA to try</param>
|
||||||
/// <returns><c>true</c> if read correctly, <c>false</c> otherwise</returns>
|
/// <returns><c>true</c> if read correctly, <c>false</c> otherwise</returns>
|
||||||
public static bool SupportsPqSubchannel(Device dev, DumpLog dumpLog, UpdateStatusHandler updateStatus, uint lba)
|
public static bool SupportsPqSubchannel(Device dev, UpdateStatusHandler updateStatus, uint lba)
|
||||||
{
|
{
|
||||||
dumpLog?.WriteLine(Localization.Core.Checking_if_drive_supports_PQ_subchannel_reading);
|
|
||||||
updateStatus?.Invoke(Localization.Core.Checking_if_drive_supports_PQ_subchannel_reading);
|
updateStatus?.Invoke(Localization.Core.Checking_if_drive_supports_PQ_subchannel_reading);
|
||||||
|
|
||||||
return !dev.ReadCd(out _,
|
return !dev.ReadCd(out _,
|
||||||
|
|||||||
@@ -61,7 +61,6 @@ partial class Dump
|
|||||||
firstTrackLastSession = 1;
|
firstTrackLastSession = 1;
|
||||||
|
|
||||||
// ATIP exists on blank CDs
|
// ATIP exists on blank CDs
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_ATIP);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_ATIP);
|
UpdateStatus?.Invoke(Localization.Core.Reading_ATIP);
|
||||||
sense = _dev.ReadAtip(out cmdBuf, out _, _dev.Timeout, out _);
|
sense = _dev.ReadAtip(out cmdBuf, out _, _dev.Timeout, out _);
|
||||||
|
|
||||||
@@ -81,7 +80,6 @@ partial class Dump
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_Disc_Information);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_Disc_Information);
|
UpdateStatus?.Invoke(Localization.Core.Reading_Disc_Information);
|
||||||
|
|
||||||
sense = _dev.ReadDiscInformation(out cmdBuf,
|
sense = _dev.ReadDiscInformation(out cmdBuf,
|
||||||
@@ -105,7 +103,6 @@ partial class Dump
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_PMA);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_PMA);
|
UpdateStatus?.Invoke(Localization.Core.Reading_PMA);
|
||||||
sense = _dev.ReadPma(out cmdBuf, out _, _dev.Timeout, out _);
|
sense = _dev.ReadPma(out cmdBuf, out _, _dev.Timeout, out _);
|
||||||
|
|
||||||
@@ -117,7 +114,6 @@ partial class Dump
|
|||||||
_mediaGraph?.PaintRecordableInformationGood();
|
_mediaGraph?.PaintRecordableInformationGood();
|
||||||
}
|
}
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_Session_Information);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_Session_Information);
|
UpdateStatus?.Invoke(Localization.Core.Reading_Session_Information);
|
||||||
sense = _dev.ReadSessionInfo(out cmdBuf, out _, _dev.Timeout, out _);
|
sense = _dev.ReadSessionInfo(out cmdBuf, out _, _dev.Timeout, out _);
|
||||||
|
|
||||||
@@ -132,7 +128,6 @@ partial class Dump
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_CD_Text_from_Lead_In);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_CD_Text_from_Lead_In);
|
UpdateStatus?.Invoke(Localization.Core.Reading_CD_Text_from_Lead_In);
|
||||||
sense = _dev.ReadCdText(out cmdBuf, out _, _dev.Timeout, out _);
|
sense = _dev.ReadCdText(out cmdBuf, out _, _dev.Timeout, out _);
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,6 @@ using System.Linq;
|
|||||||
using Aaru.CommonTypes;
|
using Aaru.CommonTypes;
|
||||||
using Aaru.CommonTypes.Enums;
|
using Aaru.CommonTypes.Enums;
|
||||||
using Aaru.CommonTypes.Structs;
|
using Aaru.CommonTypes.Structs;
|
||||||
using Aaru.Core.Logging;
|
|
||||||
using Aaru.Decoders.CD;
|
using Aaru.Decoders.CD;
|
||||||
using Aaru.Devices;
|
using Aaru.Devices;
|
||||||
|
|
||||||
@@ -60,9 +59,9 @@ partial class Dump
|
|||||||
/// <param name="trackFlags">Track flags</param>
|
/// <param name="trackFlags">Track flags</param>
|
||||||
/// <param name="updateStatus">Update status handler</param>
|
/// <param name="updateStatus">Update status handler</param>
|
||||||
/// <returns>List of tracks</returns>
|
/// <returns>List of tracks</returns>
|
||||||
public static Track[] GetCdTracks(Device dev, DumpLog dumpLog, bool force, out long lastSector,
|
public static Track[] GetCdTracks(Device dev, bool force, out long lastSector, Dictionary<int, long> leadOutStarts,
|
||||||
Dictionary<int, long> leadOutStarts, Dictionary<MediaTagType, byte[]> mediaTags,
|
Dictionary<MediaTagType, byte[]> mediaTags,
|
||||||
ErrorMessageHandler stoppingErrorMessage, out FullTOC.CDFullTOC? toc,
|
ErrorMessageHandler stoppingErrorMessage, out FullTOC.CDFullTOC? toc,
|
||||||
Dictionary<byte, byte> trackFlags, UpdateStatusHandler updateStatus)
|
Dictionary<byte, byte> trackFlags, UpdateStatusHandler updateStatus)
|
||||||
{
|
{
|
||||||
byte[] cmdBuf; // Data buffer
|
byte[] cmdBuf; // Data buffer
|
||||||
@@ -76,7 +75,6 @@ partial class Dump
|
|||||||
|
|
||||||
// We discarded all discs that falsify a TOC before requesting a real TOC
|
// We discarded all discs that falsify a TOC before requesting a real TOC
|
||||||
// No TOC, no CD (or an empty one)
|
// No TOC, no CD (or an empty one)
|
||||||
dumpLog?.WriteLine(Localization.Core.Reading_full_TOC);
|
|
||||||
updateStatus?.Invoke(Localization.Core.Reading_full_TOC);
|
updateStatus?.Invoke(Localization.Core.Reading_full_TOC);
|
||||||
sense = dev.ReadRawToc(out cmdBuf, out _, 0, dev.Timeout, out _);
|
sense = dev.ReadRawToc(out cmdBuf, out _, 0, dev.Timeout, out _);
|
||||||
|
|
||||||
@@ -93,7 +91,6 @@ partial class Dump
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateStatus?.Invoke(Localization.Core.Building_track_map);
|
updateStatus?.Invoke(Localization.Core.Building_track_map);
|
||||||
dumpLog?.WriteLine(Localization.Core.Building_track_map);
|
|
||||||
|
|
||||||
if(toc.HasValue)
|
if(toc.HasValue)
|
||||||
{
|
{
|
||||||
@@ -179,16 +176,12 @@ partial class Dump
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
updateStatus?.Invoke(Localization.Core.Cannot_read_RAW_TOC_requesting_processed_one);
|
updateStatus?.Invoke(Localization.Core.Cannot_read_RAW_TOC_requesting_processed_one);
|
||||||
dumpLog?.WriteLine(Localization.Core.Cannot_read_RAW_TOC_requesting_processed_one);
|
|
||||||
sense = dev.ReadToc(out cmdBuf, out _, false, 0, dev.Timeout, out _);
|
sense = dev.ReadToc(out cmdBuf, out _, false, 0, dev.Timeout, out _);
|
||||||
|
|
||||||
TOC.CDTOC? oldToc = TOC.Decode(cmdBuf);
|
TOC.CDTOC? oldToc = TOC.Decode(cmdBuf);
|
||||||
|
|
||||||
if((sense || !oldToc.HasValue) && !force)
|
if((sense || !oldToc.HasValue) && !force)
|
||||||
{
|
{
|
||||||
dumpLog?.WriteLine(Localization.Core
|
|
||||||
.Could_not_read_TOC_if_you_want_to_continue_use_force_and_will_try_from_LBA_0_to_360000);
|
|
||||||
|
|
||||||
stoppingErrorMessage?.Invoke(Localization.Core
|
stoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Could_not_read_TOC_if_you_want_to_continue_use_force_and_will_try_from_LBA_0_to_360000);
|
.Could_not_read_TOC_if_you_want_to_continue_use_force_and_will_try_from_LBA_0_to_360000);
|
||||||
|
|
||||||
@@ -237,7 +230,6 @@ partial class Dump
|
|||||||
if(trackList.Count == 0)
|
if(trackList.Count == 0)
|
||||||
{
|
{
|
||||||
updateStatus?.Invoke(Localization.Core.No_tracks_found_adding_a_single_track_from_zero_to_Lead_Out);
|
updateStatus?.Invoke(Localization.Core.No_tracks_found_adding_a_single_track_from_zero_to_Lead_Out);
|
||||||
dumpLog?.WriteLine(Localization.Core.No_tracks_found_adding_a_single_track_from_zero_to_Lead_Out);
|
|
||||||
|
|
||||||
trackList.Add(new Track
|
trackList.Add(new Track
|
||||||
{
|
{
|
||||||
@@ -258,7 +250,7 @@ partial class Dump
|
|||||||
|
|
||||||
if(!sense)
|
if(!sense)
|
||||||
{
|
{
|
||||||
var temp = new byte[8];
|
byte[] temp = new byte[8];
|
||||||
|
|
||||||
Array.Copy(cmdBuf, 0, temp, 0, 8);
|
Array.Copy(cmdBuf, 0, temp, 0, 8);
|
||||||
Array.Reverse(temp);
|
Array.Reverse(temp);
|
||||||
@@ -278,14 +270,12 @@ partial class Dump
|
|||||||
stoppingErrorMessage?.Invoke(Localization.Core
|
stoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Could_not_find_Lead_Out_if_you_want_to_continue_use_force_option);
|
.Could_not_find_Lead_Out_if_you_want_to_continue_use_force_option);
|
||||||
|
|
||||||
dumpLog?.WriteLine(Localization.Core.Could_not_find_Lead_Out_if_you_want_to_continue_use_force_option);
|
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
updateStatus?.Invoke(Localization.Core.WARNING_Could_not_find_Lead_Out_start_will_try_to_read_up_to);
|
updateStatus?.Invoke(Localization.Core.WARNING_Could_not_find_Lead_Out_start_will_try_to_read_up_to);
|
||||||
|
|
||||||
dumpLog?.WriteLine(Localization.Core.WARNING_Could_not_find_Lead_Out_start_will_try_to_read_up_to);
|
|
||||||
lastSector = 360000;
|
lastSector = 360000;
|
||||||
|
|
||||||
return trackList.ToArray();
|
return trackList.ToArray();
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ partial class Dump
|
|||||||
Dictionary<byte, string> isrcs, ref string mcn, HashSet<int> subchannelExtents,
|
Dictionary<byte, string> isrcs, ref string mcn, HashSet<int> subchannelExtents,
|
||||||
Dictionary<byte, int> smallestPregapLbaPerTrack)
|
Dictionary<byte, int> smallestPregapLbaPerTrack)
|
||||||
{
|
{
|
||||||
var sense = true; // Sense indicator
|
bool sense = true; // Sense indicator
|
||||||
byte[] cmdBuf = null; // Data buffer
|
byte[] cmdBuf = null; // Data buffer
|
||||||
double cmdDuration = 0; // Command execution time
|
double cmdDuration = 0; // Command execution time
|
||||||
const uint sectorSize = 2352; // Full sector size
|
const uint sectorSize = 2352; // Full sector size
|
||||||
@@ -103,14 +103,13 @@ partial class Dump
|
|||||||
if(_resume.BadBlocks.Count <= 0 || _aborted || !_trim || !newTrim) return;
|
if(_resume.BadBlocks.Count <= 0 || _aborted || !_trim || !newTrim) return;
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
|
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
|
||||||
_dumpLog.WriteLine(Localization.Core.Trimming_skipped_sectors);
|
|
||||||
InitProgress?.Invoke();
|
InitProgress?.Invoke();
|
||||||
_trimStopwatch.Restart();
|
_trimStopwatch.Restart();
|
||||||
|
|
||||||
trimStart:
|
trimStart:
|
||||||
ulong[] tmpArray = _resume.BadBlocks.ToArray();
|
ulong[] tmpArray = _resume.BadBlocks.ToArray();
|
||||||
|
|
||||||
for(var b = 0; b < tmpArray.Length; b++)
|
for(int b = 0; b < tmpArray.Length; b++)
|
||||||
{
|
{
|
||||||
ulong badSector = tmpArray[b];
|
ulong badSector = tmpArray[b];
|
||||||
|
|
||||||
@@ -118,7 +117,6 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -128,7 +126,7 @@ partial class Dump
|
|||||||
Track track = tracks.OrderBy(t => t.StartSector).LastOrDefault(t => badSector >= t.StartSector);
|
Track track = tracks.OrderBy(t => t.StartSector).LastOrDefault(t => badSector >= t.StartSector);
|
||||||
|
|
||||||
byte sectorsToTrim = 1;
|
byte sectorsToTrim = 1;
|
||||||
var badSectorToRead = (uint)badSector;
|
uint badSectorToRead = (uint)badSector;
|
||||||
|
|
||||||
if(_fixOffset && audioExtents.Contains(badSector) && offsetBytes != 0)
|
if(_fixOffset && audioExtents.Contains(badSector) && offsetBytes != 0)
|
||||||
{
|
{
|
||||||
@@ -292,7 +290,7 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
|
|
||||||
for(var c = 16; c < 2352; c++)
|
for(int c = 16; c < 2352; c++)
|
||||||
{
|
{
|
||||||
if(cmdBuf[c] == 0x00) continue;
|
if(cmdBuf[c] == 0x00) continue;
|
||||||
|
|
||||||
@@ -419,8 +417,8 @@ partial class Dump
|
|||||||
|
|
||||||
if(supportedSubchannel != MmcSubchannel.None)
|
if(supportedSubchannel != MmcSubchannel.None)
|
||||||
{
|
{
|
||||||
var data = new byte[sectorSize];
|
byte[] data = new byte[sectorSize];
|
||||||
var sub = new byte[subSize];
|
byte[] sub = new byte[subSize];
|
||||||
Array.Copy(cmdBuf, 0, data, 0, sectorSize);
|
Array.Copy(cmdBuf, 0, data, 0, sectorSize);
|
||||||
Array.Copy(cmdBuf, sectorSize, sub, 0, subSize);
|
Array.Copy(cmdBuf, sectorSize, sub, 0, subSize);
|
||||||
|
|
||||||
@@ -446,7 +444,6 @@ partial class Dump
|
|||||||
outputOptical,
|
outputOptical,
|
||||||
_fixSubchannel,
|
_fixSubchannel,
|
||||||
_fixSubchannelCrc,
|
_fixSubchannelCrc,
|
||||||
_dumpLog,
|
|
||||||
UpdateStatus,
|
UpdateStatus,
|
||||||
smallestPregapLbaPerTrack,
|
smallestPregapLbaPerTrack,
|
||||||
true,
|
true,
|
||||||
@@ -480,8 +477,5 @@ partial class Dump
|
|||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Trimming_finished_in_0,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Trimming_finished_in_0,
|
||||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Trimming_finished_in_0,
|
|
||||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -77,7 +77,6 @@ public partial class Dump
|
|||||||
readonly string _devicePath;
|
readonly string _devicePath;
|
||||||
readonly uint _dimensions;
|
readonly uint _dimensions;
|
||||||
readonly bool _doResume;
|
readonly bool _doResume;
|
||||||
readonly DumpLog _dumpLog;
|
|
||||||
readonly bool _dumpRaw;
|
readonly bool _dumpRaw;
|
||||||
readonly Stopwatch _dumpStopwatch;
|
readonly Stopwatch _dumpStopwatch;
|
||||||
readonly Encoding _encoding;
|
readonly Encoding _encoding;
|
||||||
@@ -128,7 +127,6 @@ public partial class Dump
|
|||||||
/// <param name="doResume">Should resume?</param>
|
/// <param name="doResume">Should resume?</param>
|
||||||
/// <param name="dev">Device</param>
|
/// <param name="dev">Device</param>
|
||||||
/// <param name="devicePath">Path to the device</param>
|
/// <param name="devicePath">Path to the device</param>
|
||||||
/// <param name="outputPrefix">Prefix for output log files</param>
|
|
||||||
/// <param name="outputPlugin">Plugin for output file</param>
|
/// <param name="outputPlugin">Plugin for output file</param>
|
||||||
/// <param name="retryPasses">How many times to retry</param>
|
/// <param name="retryPasses">How many times to retry</param>
|
||||||
/// <param name="force">Force to continue dump whenever possible</param>
|
/// <param name="force">Force to continue dump whenever possible</param>
|
||||||
@@ -136,15 +134,15 @@ public partial class Dump
|
|||||||
/// <param name="persistent">Store whatever data the drive returned on error</param>
|
/// <param name="persistent">Store whatever data the drive returned on error</param>
|
||||||
/// <param name="stopOnError">Stop dump on first error</param>
|
/// <param name="stopOnError">Stop dump on first error</param>
|
||||||
/// <param name="resume">Information for dump resuming</param>
|
/// <param name="resume">Information for dump resuming</param>
|
||||||
/// <param name="dumpLog">Dump logger</param>
|
|
||||||
/// <param name="encoding">Encoding to use when analyzing dump</param>
|
/// <param name="encoding">Encoding to use when analyzing dump</param>
|
||||||
|
/// <param name="outputPrefix">Prefix for output log files</param>
|
||||||
/// <param name="outputPath">Path to output file</param>
|
/// <param name="outputPath">Path to output file</param>
|
||||||
/// <param name="formatOptions">Formats to pass to output file plugin</param>
|
/// <param name="formatOptions">Formats to pass to output file plugin</param>
|
||||||
/// <param name="trim">Trim errors from skipped sectors</param>
|
|
||||||
/// <param name="dumpFirstTrackPregap">Try to read and dump as much first track pregap as possible</param>
|
|
||||||
/// <param name="preSidecar">Sidecar to store in dumped image</param>
|
/// <param name="preSidecar">Sidecar to store in dumped image</param>
|
||||||
/// <param name="skip">How many sectors to skip reading on error</param>
|
/// <param name="skip">How many sectors to skip reading on error</param>
|
||||||
/// <param name="metadata">Create metadata sidecar after dump?</param>
|
/// <param name="metadata">Create metadata sidecar after dump?</param>
|
||||||
|
/// <param name="trim">Trim errors from skipped sectors</param>
|
||||||
|
/// <param name="dumpFirstTrackPregap">Try to read and dump as much first track pregap as possible</param>
|
||||||
/// <param name="fixOffset">Fix audio offset</param>
|
/// <param name="fixOffset">Fix audio offset</param>
|
||||||
/// <param name="debug">Debug mode</param>
|
/// <param name="debug">Debug mode</param>
|
||||||
/// <param name="subchannel">Desired subchannel to save to image</param>
|
/// <param name="subchannel">Desired subchannel to save to image</param>
|
||||||
@@ -167,14 +165,14 @@ public partial class Dump
|
|||||||
/// <param name="ignoreCdrRunOuts">How many CD-R(W) run end sectors to ignore and regenerate</param>
|
/// <param name="ignoreCdrRunOuts">How many CD-R(W) run end sectors to ignore and regenerate</param>
|
||||||
/// <param name="createGraph">If set to <c>true</c> creates a graph of the dump.</param>
|
/// <param name="createGraph">If set to <c>true</c> creates a graph of the dump.</param>
|
||||||
/// <param name="dimensions">Dimensions of graph in pixels for a square</param>
|
/// <param name="dimensions">Dimensions of graph in pixels for a square</param>
|
||||||
public Dump(bool doResume, Device dev, string devicePath, IBaseWritableImage outputPlugin, ushort retryPasses,
|
public Dump(bool doResume, Device dev, string devicePath, IBaseWritableImage outputPlugin, ushort retryPasses,
|
||||||
bool force, bool dumpRaw, bool persistent, bool stopOnError, Resume resume, DumpLog dumpLog,
|
bool force, bool dumpRaw, bool persistent, bool stopOnError, Resume resume, Encoding encoding,
|
||||||
Encoding encoding, string outputPrefix, string outputPath, Dictionary<string, string> formatOptions,
|
string outputPrefix, string outputPath, Dictionary<string, string> formatOptions, Metadata preSidecar,
|
||||||
Metadata preSidecar, uint skip, bool metadata, bool trim, bool dumpFirstTrackPregap, bool fixOffset,
|
uint skip, bool metadata, bool trim, bool dumpFirstTrackPregap, bool fixOffset, bool debug,
|
||||||
bool debug, DumpSubchannel subchannel, int speed, bool @private, bool fixSubchannelPosition,
|
DumpSubchannel subchannel, int speed, bool @private, bool fixSubchannelPosition, bool retrySubchannel,
|
||||||
bool retrySubchannel, bool fixSubchannel, bool fixSubchannelCrc, bool skipCdireadyHole,
|
bool fixSubchannel, bool fixSubchannelCrc, bool skipCdireadyHole, ErrorLog errorLog,
|
||||||
ErrorLog errorLog, bool generateSubchannels, uint maximumReadable, bool useBufferedReads,
|
bool generateSubchannels, uint maximumReadable, bool useBufferedReads, bool storeEncrypted,
|
||||||
bool storeEncrypted, bool titleKeys, uint ignoreCdrRunOuts, bool createGraph, uint dimensions)
|
bool titleKeys, uint ignoreCdrRunOuts, bool createGraph, uint dimensions)
|
||||||
{
|
{
|
||||||
_doResume = doResume;
|
_doResume = doResume;
|
||||||
_dev = dev;
|
_dev = dev;
|
||||||
@@ -186,7 +184,6 @@ public partial class Dump
|
|||||||
_persistent = persistent;
|
_persistent = persistent;
|
||||||
_stopOnError = stopOnError;
|
_stopOnError = stopOnError;
|
||||||
_resume = resume;
|
_resume = resume;
|
||||||
_dumpLog = dumpLog;
|
|
||||||
_encoding = encoding;
|
_encoding = encoding;
|
||||||
_outputPrefix = outputPrefix;
|
_outputPrefix = outputPrefix;
|
||||||
_outputPath = outputPath;
|
_outputPath = outputPath;
|
||||||
@@ -237,14 +234,9 @@ public partial class Dump
|
|||||||
d.Revision == _dev.FirmwareRevision);
|
d.Revision == _dev.FirmwareRevision);
|
||||||
|
|
||||||
if(_dbDev is null)
|
if(_dbDev is null)
|
||||||
{
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_not_in_database);
|
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Device_not_in_database);
|
UpdateStatus?.Invoke(Localization.Core.Device_not_in_database);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Device_in_database_since_0, _dbDev.LastSynchronized));
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Device_in_database_since_0, _dbDev.LastSynchronized));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Device_in_database_since_0, _dbDev.LastSynchronized));
|
||||||
|
|
||||||
if(_dbDev.OptimalMultipleSectorsRead > 0) _maximumReadable = (uint)_dbDev.OptimalMultipleSectorsRead;
|
if(_dbDev.OptimalMultipleSectorsRead > 0) _maximumReadable = (uint)_dbDev.OptimalMultipleSectorsRead;
|
||||||
@@ -282,8 +274,6 @@ public partial class Dump
|
|||||||
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
_dumpLog.WriteLine(Localization.Core.Unknown_device_type);
|
|
||||||
_dumpLog.Close();
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Unknown_device_type);
|
StoppingErrorMessage?.Invoke(Localization.Core.Unknown_device_type);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -293,7 +283,6 @@ public partial class Dump
|
|||||||
}
|
}
|
||||||
|
|
||||||
_errorLog.Close();
|
_errorLog.Close();
|
||||||
_dumpLog.Close();
|
|
||||||
|
|
||||||
if(_resume == null || !_doResume) return;
|
if(_resume == null || !_doResume) return;
|
||||||
|
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ using Aaru.CommonTypes;
|
|||||||
using Aaru.CommonTypes.Enums;
|
using Aaru.CommonTypes.Enums;
|
||||||
using Aaru.CommonTypes.Interfaces;
|
using Aaru.CommonTypes.Interfaces;
|
||||||
using Aaru.Core.Graphics;
|
using Aaru.Core.Graphics;
|
||||||
|
using Aaru.Logging;
|
||||||
using Humanizer;
|
using Humanizer;
|
||||||
using Humanizer.Bytes;
|
using Humanizer.Bytes;
|
||||||
using Humanizer.Localisation;
|
using Humanizer.Localisation;
|
||||||
@@ -72,52 +73,48 @@ public partial class Dump
|
|||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Could_not_read);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_read);
|
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_read);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var tmp = new byte[8];
|
byte[] tmp = new byte[8];
|
||||||
|
|
||||||
Array.Copy(buffer, 0x36, tmp, 0, 8);
|
Array.Copy(buffer, 0x36, tmp, 0, 8);
|
||||||
|
|
||||||
// UMDs are stored inside a FAT16 volume
|
// UMDs are stored inside a FAT16 volume
|
||||||
if(!tmp.SequenceEqual(_fatSignature))
|
if(!tmp.SequenceEqual(_fatSignature))
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Retrode_partition_not_recognized_not_dumping);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Retrode_partition_not_recognized_not_dumping);
|
StoppingErrorMessage?.Invoke(Localization.Core.Retrode_partition_not_recognized_not_dumping);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var fatStart = (ushort)((buffer[0x0F] << 8) + buffer[0x0E]);
|
ushort fatStart = (ushort)((buffer[0x0F] << 8) + buffer[0x0E]);
|
||||||
var sectorsPerFat = (ushort)((buffer[0x17] << 8) + buffer[0x16]);
|
ushort sectorsPerFat = (ushort)((buffer[0x17] << 8) + buffer[0x16]);
|
||||||
var rootStart = (ushort)(sectorsPerFat * 2 + fatStart);
|
ushort rootStart = (ushort)(sectorsPerFat * 2 + fatStart);
|
||||||
var rootSize = (ushort)(((buffer[0x12] << 8) + buffer[0x11]) * 32 / 512);
|
ushort rootSize = (ushort)(((buffer[0x12] << 8) + buffer[0x11]) * 32 / 512);
|
||||||
byte sectorsPerCluster = buffer[0x0D];
|
byte sectorsPerCluster = buffer[0x0D];
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Reading_root_directory_in_sector_0, rootStart));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Reading_root_directory_in_sector_0, rootStart));
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_root_directory_in_sector_0, rootStart);
|
|
||||||
|
|
||||||
sense = _dev.Read10(out buffer, out _, 0, false, true, false, false, rootStart, 512, 0, 1, _dev.Timeout, out _);
|
sense = _dev.Read10(out buffer, out _, 0, false, true, false, false, rootStart, 512, 0, 1, _dev.Timeout, out _);
|
||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_read);
|
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_read);
|
||||||
_dumpLog.WriteLine(Localization.Core.Could_not_read);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
int romPos;
|
int romPos;
|
||||||
var sfcFound = false;
|
bool sfcFound = false;
|
||||||
var genesisFound = false;
|
bool genesisFound = false;
|
||||||
var smsFound = false;
|
bool smsFound = false;
|
||||||
var n64Found = false;
|
bool n64Found = false;
|
||||||
var gbFound = false;
|
bool gbFound = false;
|
||||||
var gbcFound = false;
|
bool gbcFound = false;
|
||||||
var gbaFound = false;
|
bool gbaFound = false;
|
||||||
tmp = new byte[3];
|
tmp = new byte[3];
|
||||||
|
|
||||||
for(romPos = 0; romPos < buffer.Length; romPos += 0x20)
|
for(romPos = 0; romPos < buffer.Length; romPos += 0x20)
|
||||||
@@ -176,13 +173,12 @@ public partial class Dump
|
|||||||
if(!sfcFound && !genesisFound && !smsFound && !n64Found && !gbaFound && !gbFound && !gbcFound)
|
if(!sfcFound && !genesisFound && !smsFound && !n64Found && !gbaFound && !gbFound && !gbcFound)
|
||||||
{
|
{
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.No_cartridge_found_not_dumping);
|
StoppingErrorMessage?.Invoke(Localization.Core.No_cartridge_found_not_dumping);
|
||||||
_dumpLog.WriteLine(Localization.Core.No_cartridge_found_not_dumping);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var cluster = BitConverter.ToUInt16(buffer, romPos + 0x1A);
|
ushort cluster = BitConverter.ToUInt16(buffer, romPos + 0x1A);
|
||||||
var romSize = BitConverter.ToUInt32(buffer, romPos + 0x1C);
|
uint romSize = BitConverter.ToUInt32(buffer, romPos + 0x1C);
|
||||||
|
|
||||||
MediaType mediaType = gbaFound
|
MediaType mediaType = gbaFound
|
||||||
? MediaType.GameBoyAdvanceGamePak
|
? MediaType.GameBoyAdvanceGamePak
|
||||||
@@ -205,8 +201,6 @@ public partial class Dump
|
|||||||
|
|
||||||
if(_outputPlugin is not IByteAddressableImage outputBai || !outputBai.SupportedMediaTypes.Contains(mediaType))
|
if(_outputPlugin is not IByteAddressableImage outputBai || !outputBai.SupportedMediaTypes.Contains(mediaType))
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.The_specified_format_does_not_support_the_inserted_cartridge);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.The_specified_format_does_not_support_the_inserted_cartridge);
|
.The_specified_format_does_not_support_the_inserted_cartridge);
|
||||||
|
|
||||||
@@ -229,13 +223,12 @@ public partial class Dump
|
|||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Could_not_read);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_read);
|
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_read);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var startSector = (uint)(rootStart + rootSize + (cluster - 2) * sectorsPerCluster);
|
uint startSector = (uint)(rootStart + rootSize + (cluster - 2) * sectorsPerCluster);
|
||||||
uint romSectors = romSize / 512;
|
uint romSectors = romSize / 512;
|
||||||
uint romRemaining = romSize % 512;
|
uint romRemaining = romSize % 512;
|
||||||
|
|
||||||
@@ -266,16 +259,12 @@ public partial class Dump
|
|||||||
}
|
}
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Media_identified_as_0, mediaType));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Media_identified_as_0, mediaType));
|
||||||
_dumpLog.WriteLine(Localization.Core.Media_identified_as_0, mediaType);
|
|
||||||
|
|
||||||
ErrorNumber ret = outputBai.Create(_outputPath, mediaType, _formatOptions, romSize);
|
ErrorNumber ret = outputBai.Create(_outputPath, mediaType, _formatOptions, romSize);
|
||||||
|
|
||||||
// Cannot create image
|
// Cannot create image
|
||||||
if(ret != ErrorNumber.NoError)
|
if(ret != ErrorNumber.NoError)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Error_0_creating_output_image_not_continuing, ret);
|
|
||||||
_dumpLog.WriteLine(outputBai.ErrorMessage);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
|
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
outputBai.ErrorMessage);
|
outputBai.ErrorMessage);
|
||||||
@@ -297,7 +286,6 @@ public partial class Dump
|
|||||||
if(_aborted)
|
if(_aborted)
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -349,7 +337,7 @@ public partial class Dump
|
|||||||
// TODO: Reset device after X errors
|
// TODO: Reset device after X errors
|
||||||
if(_stopOnError) return; // TODO: Return more cleanly
|
if(_stopOnError) return; // TODO: Return more cleanly
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Skipping_0_bytes_from_errored_byte_1, _skip * 512, i * 512);
|
AaruLogging.WriteLine(Localization.Core.Skipping_0_bytes_from_errored_byte_1, _skip * 512, i * 512);
|
||||||
i += _skip - blocksToRead;
|
i += _skip - blocksToRead;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -411,9 +399,9 @@ public partial class Dump
|
|||||||
// TODO: Reset device after X errors
|
// TODO: Reset device after X errors
|
||||||
if(_stopOnError) return; // TODO: Return more cleanly
|
if(_stopOnError) return; // TODO: Return more cleanly
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Skipping_0_bytes_from_errored_byte_1,
|
AaruLogging.WriteLine(Localization.Core.Skipping_0_bytes_from_errored_byte_1,
|
||||||
_skip * 512,
|
_skip * 512,
|
||||||
romSectors * 512);
|
romSectors * 512);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -432,19 +420,6 @@ public partial class Dump
|
|||||||
.Per(imageWriteDuration.Seconds())
|
.Per(imageWriteDuration.Seconds())
|
||||||
.Humanize()));
|
.Humanize()));
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Dump_finished_in_0,
|
|
||||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_dump_speed_0,
|
|
||||||
ByteSize.FromBytes(512 * (romSectors + 1))
|
|
||||||
.Per(totalDuration.Milliseconds())
|
|
||||||
.Humanize()));
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_write_speed_0,
|
|
||||||
ByteSize.FromBytes(512 * (romSectors + 1))
|
|
||||||
.Per(imageWriteDuration.Seconds())
|
|
||||||
.Humanize()));
|
|
||||||
|
|
||||||
var metadata = new CommonTypes.Structs.ImageInfo
|
var metadata = new CommonTypes.Structs.ImageInfo
|
||||||
{
|
{
|
||||||
Application = "Aaru",
|
Application = "Aaru",
|
||||||
@@ -463,19 +438,17 @@ public partial class Dump
|
|||||||
|
|
||||||
if(_preSidecar != null) outputBai.SetMetadata(_preSidecar);
|
if(_preSidecar != null) outputBai.SetMetadata(_preSidecar);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Closing_output_file);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
||||||
_imageCloseStopwatch.Restart();
|
_imageCloseStopwatch.Restart();
|
||||||
outputBai.Close();
|
outputBai.Close();
|
||||||
_imageCloseStopwatch.Stop();
|
_imageCloseStopwatch.Stop();
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Closed_in_0,
|
AaruLogging.WriteLine(Localization.Core.Closed_in_0,
|
||||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
||||||
|
|
||||||
if(_aborted)
|
if(_aborted)
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ using Aaru.Decoders.SCSI.MMC;
|
|||||||
using Aaru.Decryption;
|
using Aaru.Decryption;
|
||||||
using Aaru.Decryption.DVD;
|
using Aaru.Decryption.DVD;
|
||||||
using Aaru.Devices;
|
using Aaru.Devices;
|
||||||
|
using Aaru.Logging;
|
||||||
using DDS = Aaru.Decoders.DVD.DDS;
|
using DDS = Aaru.Decoders.DVD.DDS;
|
||||||
using DMI = Aaru.Decoders.Xbox.DMI;
|
using DMI = Aaru.Decoders.Xbox.DMI;
|
||||||
using DVDDecryption = Aaru.Decryption.DVD.Dump;
|
using DVDDecryption = Aaru.Decryption.DVD.Dump;
|
||||||
@@ -63,9 +64,9 @@ partial class Dump
|
|||||||
MediaType dskType = MediaType.Unknown;
|
MediaType dskType = MediaType.Unknown;
|
||||||
bool sense;
|
bool sense;
|
||||||
byte[] tmpBuf;
|
byte[] tmpBuf;
|
||||||
var compactDisc = true;
|
bool compactDisc = true;
|
||||||
var gotConfiguration = false;
|
bool gotConfiguration = false;
|
||||||
var isXbox = false;
|
bool isXbox = false;
|
||||||
DVDDecryption dvdDecrypt = null;
|
DVDDecryption dvdDecrypt = null;
|
||||||
_speedMultiplier = 1;
|
_speedMultiplier = 1;
|
||||||
|
|
||||||
@@ -76,7 +77,7 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
gotConfiguration = true;
|
gotConfiguration = true;
|
||||||
Features.SeparatedFeatures ftr = Features.Separate(cmdBuf);
|
Features.SeparatedFeatures ftr = Features.Separate(cmdBuf);
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_reports_current_profile_is_0, ftr.CurrentProfile);
|
AaruLogging.WriteLine(Localization.Core.Device_reports_current_profile_is_0, ftr.CurrentProfile);
|
||||||
|
|
||||||
switch(ftr.CurrentProfile)
|
switch(ftr.CurrentProfile)
|
||||||
{
|
{
|
||||||
@@ -308,7 +309,7 @@ partial class Dump
|
|||||||
|
|
||||||
var scsiReader = new Reader(_dev, _dev.Timeout, null, _errorLog, _dumpRaw);
|
var scsiReader = new Reader(_dev, _dev.Timeout, null, _errorLog, _dumpRaw);
|
||||||
ulong blocks = scsiReader.GetDeviceBlocks();
|
ulong blocks = scsiReader.GetDeviceBlocks();
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_reports_disc_has_0_blocks, blocks);
|
AaruLogging.WriteLine(Localization.Core.Device_reports_disc_has_0_blocks, blocks);
|
||||||
Dictionary<MediaTagType, byte[]> mediaTags = new();
|
Dictionary<MediaTagType, byte[]> mediaTags = new();
|
||||||
|
|
||||||
if(dskType == MediaType.PD650)
|
if(dskType == MediaType.PD650)
|
||||||
@@ -328,7 +329,7 @@ partial class Dump
|
|||||||
switch(dskType)
|
switch(dskType)
|
||||||
{
|
{
|
||||||
case MediaType.Unknown when blocks > 0:
|
case MediaType.Unknown when blocks > 0:
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_Physical_Format_Information);
|
AaruLogging.WriteLine(Localization.Core.Reading_Physical_Format_Information);
|
||||||
|
|
||||||
sense = _dev.ReadDiscStructure(out cmdBuf,
|
sense = _dev.ReadDiscStructure(out cmdBuf,
|
||||||
out _,
|
out _,
|
||||||
@@ -346,9 +347,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(nintendoPfi is { DiskCategory: DiskCategory.Nintendo, PartVersion: 15 })
|
if(nintendoPfi is { DiskCategory: DiskCategory.Nintendo, PartVersion: 15 })
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Dumping_Nintendo_GameCube_or_Wii_discs_is_not_yet_implemented);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Dumping_Nintendo_GameCube_or_Wii_discs_is_not_yet_implemented);
|
.Dumping_Nintendo_GameCube_or_Wii_discs_is_not_yet_implemented);
|
||||||
|
|
||||||
@@ -374,7 +372,8 @@ partial class Dump
|
|||||||
case MediaType.HDDVDROM:
|
case MediaType.HDDVDROM:
|
||||||
case MediaType.HDDVDRW:
|
case MediaType.HDDVDRW:
|
||||||
case MediaType.HDDVDRWDL:
|
case MediaType.HDDVDRWDL:
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_Physical_Format_Information);
|
|
||||||
|
AaruLogging.WriteLine(Localization.Core.Reading_Physical_Format_Information);
|
||||||
|
|
||||||
sense = _dev.ReadDiscStructure(out cmdBuf,
|
sense = _dev.ReadDiscStructure(out cmdBuf,
|
||||||
out _,
|
out _,
|
||||||
@@ -424,7 +423,7 @@ partial class Dump
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_Disc_Manufacturing_Information);
|
AaruLogging.WriteLine(Localization.Core.Reading_Disc_Manufacturing_Information);
|
||||||
|
|
||||||
sense = _dev.ReadDiscStructure(out cmdBuf,
|
sense = _dev.ReadDiscStructure(out cmdBuf,
|
||||||
out _,
|
out _,
|
||||||
@@ -459,9 +458,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(sense || Inquiry.Decode(inqBuf)?.KreonPresent != true)
|
if(sense || Inquiry.Decode(inqBuf)?.KreonPresent != true)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Dumping_Xbox_Game_Discs_requires_a_drive_with_Kreon_firmware);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Dumping_Xbox_Game_Discs_requires_a_drive_with_Kreon_firmware);
|
.Dumping_Xbox_Game_Discs_requires_a_drive_with_Kreon_firmware);
|
||||||
|
|
||||||
@@ -493,15 +489,11 @@ partial class Dump
|
|||||||
|
|
||||||
#endregion Nintendo
|
#endregion Nintendo
|
||||||
|
|
||||||
#region All DVD and HD DVD types
|
|
||||||
|
|
||||||
#endregion All DVD and HD DVD types
|
|
||||||
|
|
||||||
#region DVD-ROM
|
#region DVD-ROM
|
||||||
|
|
||||||
if(dskType is MediaType.DVDDownload or MediaType.DVDROM)
|
if(dskType is MediaType.DVDDownload or MediaType.DVDROM)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_Lead_in_Copyright_Information);
|
AaruLogging.WriteLine(Localization.Core.Reading_Lead_in_Copyright_Information);
|
||||||
|
|
||||||
sense = _dev.ReadDiscStructure(out cmdBuf,
|
sense = _dev.ReadDiscStructure(out cmdBuf,
|
||||||
out _,
|
out _,
|
||||||
@@ -641,7 +633,7 @@ partial class Dump
|
|||||||
case MediaType.DVDDownload:
|
case MediaType.DVDDownload:
|
||||||
case MediaType.DVDROM:
|
case MediaType.DVDROM:
|
||||||
case MediaType.HDDVDROM:
|
case MediaType.HDDVDROM:
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_Burst_Cutting_Area);
|
AaruLogging.WriteLine(Localization.Core.Reading_Burst_Cutting_Area);
|
||||||
|
|
||||||
sense = _dev.ReadDiscStructure(out cmdBuf,
|
sense = _dev.ReadDiscStructure(out cmdBuf,
|
||||||
out _,
|
out _,
|
||||||
@@ -668,7 +660,7 @@ partial class Dump
|
|||||||
|
|
||||||
case MediaType.DVDRAM:
|
case MediaType.DVDRAM:
|
||||||
case MediaType.HDDVDRAM:
|
case MediaType.HDDVDRAM:
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_Disc_Description_Structure);
|
AaruLogging.WriteLine(Localization.Core.Reading_Disc_Description_Structure);
|
||||||
|
|
||||||
sense = _dev.ReadDiscStructure(out cmdBuf,
|
sense = _dev.ReadDiscStructure(out cmdBuf,
|
||||||
out _,
|
out _,
|
||||||
@@ -690,7 +682,7 @@ partial class Dump
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_Spare_Area_Information);
|
AaruLogging.WriteLine(Localization.Core.Reading_Spare_Area_Information);
|
||||||
|
|
||||||
sense = _dev.ReadDiscStructure(out cmdBuf,
|
sense = _dev.ReadDiscStructure(out cmdBuf,
|
||||||
out _,
|
out _,
|
||||||
@@ -720,7 +712,7 @@ partial class Dump
|
|||||||
|
|
||||||
case MediaType.DVDR:
|
case MediaType.DVDR:
|
||||||
case MediaType.DVDRW:
|
case MediaType.DVDRW:
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_Pre_Recorded_Information);
|
AaruLogging.WriteLine(Localization.Core.Reading_Pre_Recorded_Information);
|
||||||
|
|
||||||
sense = _dev.ReadDiscStructure(out cmdBuf,
|
sense = _dev.ReadDiscStructure(out cmdBuf,
|
||||||
out _,
|
out _,
|
||||||
@@ -751,7 +743,7 @@ partial class Dump
|
|||||||
case MediaType.DVDR:
|
case MediaType.DVDR:
|
||||||
case MediaType.DVDRW:
|
case MediaType.DVDRW:
|
||||||
case MediaType.HDDVDR:
|
case MediaType.HDDVDR:
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_Media_Identifier);
|
AaruLogging.WriteLine(Localization.Core.Reading_Media_Identifier);
|
||||||
|
|
||||||
sense = _dev.ReadDiscStructure(out cmdBuf,
|
sense = _dev.ReadDiscStructure(out cmdBuf,
|
||||||
out _,
|
out _,
|
||||||
@@ -770,7 +762,7 @@ partial class Dump
|
|||||||
mediaTags.Add(MediaTagType.DVDR_MediaIdentifier, tmpBuf);
|
mediaTags.Add(MediaTagType.DVDR_MediaIdentifier, tmpBuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_Recordable_Physical_Information);
|
AaruLogging.WriteLine(Localization.Core.Reading_Recordable_Physical_Information);
|
||||||
|
|
||||||
sense = _dev.ReadDiscStructure(out cmdBuf,
|
sense = _dev.ReadDiscStructure(out cmdBuf,
|
||||||
out _,
|
out _,
|
||||||
@@ -799,7 +791,7 @@ partial class Dump
|
|||||||
case MediaType.DVDPRDL:
|
case MediaType.DVDPRDL:
|
||||||
case MediaType.DVDPRW:
|
case MediaType.DVDPRW:
|
||||||
case MediaType.DVDPRWDL:
|
case MediaType.DVDPRWDL:
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_ADdress_In_Pregroove);
|
AaruLogging.WriteLine(Localization.Core.Reading_ADdress_In_Pregroove);
|
||||||
|
|
||||||
sense = _dev.ReadDiscStructure(out cmdBuf,
|
sense = _dev.ReadDiscStructure(out cmdBuf,
|
||||||
out _,
|
out _,
|
||||||
@@ -818,7 +810,7 @@ partial class Dump
|
|||||||
mediaTags.Add(MediaTagType.DVD_ADIP, tmpBuf);
|
mediaTags.Add(MediaTagType.DVD_ADIP, tmpBuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_Disc_Control_Blocks);
|
AaruLogging.WriteLine(Localization.Core.Reading_Disc_Control_Blocks);
|
||||||
|
|
||||||
sense = _dev.ReadDiscStructure(out cmdBuf,
|
sense = _dev.ReadDiscStructure(out cmdBuf,
|
||||||
out _,
|
out _,
|
||||||
@@ -844,7 +836,7 @@ partial class Dump
|
|||||||
#region HD DVD-ROM
|
#region HD DVD-ROM
|
||||||
|
|
||||||
case MediaType.HDDVDROM:
|
case MediaType.HDDVDROM:
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_Lead_in_Copyright_Information);
|
AaruLogging.WriteLine(Localization.Core.Reading_Lead_in_Copyright_Information);
|
||||||
|
|
||||||
sense = _dev.ReadDiscStructure(out cmdBuf,
|
sense = _dev.ReadDiscStructure(out cmdBuf,
|
||||||
out _,
|
out _,
|
||||||
@@ -875,7 +867,7 @@ partial class Dump
|
|||||||
case MediaType.BDRXL:
|
case MediaType.BDRXL:
|
||||||
case MediaType.BDREXL:
|
case MediaType.BDREXL:
|
||||||
case MediaType.UHDBD:
|
case MediaType.UHDBD:
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_Disc_Information);
|
AaruLogging.WriteLine(Localization.Core.Reading_Disc_Information);
|
||||||
|
|
||||||
sense = _dev.ReadDiscStructure(out cmdBuf,
|
sense = _dev.ReadDiscStructure(out cmdBuf,
|
||||||
out _,
|
out _,
|
||||||
@@ -919,7 +911,7 @@ partial class Dump
|
|||||||
|
|
||||||
case MediaType.BDROM:
|
case MediaType.BDROM:
|
||||||
case MediaType.UHDBD:
|
case MediaType.UHDBD:
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_Burst_Cutting_Area);
|
AaruLogging.WriteLine(Localization.Core.Reading_Burst_Cutting_Area);
|
||||||
|
|
||||||
sense = _dev.ReadDiscStructure(out cmdBuf,
|
sense = _dev.ReadDiscStructure(out cmdBuf,
|
||||||
out _,
|
out _,
|
||||||
@@ -948,7 +940,7 @@ partial class Dump
|
|||||||
case MediaType.BDRE:
|
case MediaType.BDRE:
|
||||||
case MediaType.BDRXL:
|
case MediaType.BDRXL:
|
||||||
case MediaType.BDREXL:
|
case MediaType.BDREXL:
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_Disc_Definition_Structure);
|
AaruLogging.WriteLine(Localization.Core.Reading_Disc_Definition_Structure);
|
||||||
|
|
||||||
sense = _dev.ReadDiscStructure(out cmdBuf,
|
sense = _dev.ReadDiscStructure(out cmdBuf,
|
||||||
out _,
|
out _,
|
||||||
@@ -967,7 +959,7 @@ partial class Dump
|
|||||||
mediaTags.Add(MediaTagType.BD_DDS, tmpBuf);
|
mediaTags.Add(MediaTagType.BD_DDS, tmpBuf);
|
||||||
}
|
}
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_Spare_Area_Information);
|
AaruLogging.WriteLine(Localization.Core.Reading_Spare_Area_Information);
|
||||||
|
|
||||||
sense = _dev.ReadDiscStructure(out cmdBuf,
|
sense = _dev.ReadDiscStructure(out cmdBuf,
|
||||||
out _,
|
out _,
|
||||||
@@ -1033,7 +1025,7 @@ partial class Dump
|
|||||||
Checksums = Checksum.GetChecksums(tag)
|
Checksums = Checksum.GetChecksums(tag)
|
||||||
};
|
};
|
||||||
|
|
||||||
var tmp = new byte[tag.Length + 4];
|
byte[] tmp = new byte[tag.Length + 4];
|
||||||
Array.Copy(tag, 0, tmp, 4, tag.Length);
|
Array.Copy(tag, 0, tmp, 4, tag.Length);
|
||||||
tmp[0] = (byte)((tag.Length & 0xFF00) >> 8);
|
tmp[0] = (byte)((tag.Length & 0xFF00) >> 8);
|
||||||
tmp[1] = (byte)(tag.Length & 0xFF);
|
tmp[1] = (byte)(tag.Length & 0xFF);
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ using Aaru.CommonTypes;
|
|||||||
using Aaru.CommonTypes.AaruMetadata;
|
using Aaru.CommonTypes.AaruMetadata;
|
||||||
using Aaru.CommonTypes.Enums;
|
using Aaru.CommonTypes.Enums;
|
||||||
using Aaru.CommonTypes.Interfaces;
|
using Aaru.CommonTypes.Interfaces;
|
||||||
|
using Aaru.Logging;
|
||||||
using Humanizer;
|
using Humanizer;
|
||||||
using Humanizer.Bytes;
|
using Humanizer.Bytes;
|
||||||
using Humanizer.Localisation;
|
using Humanizer.Localisation;
|
||||||
@@ -59,7 +60,7 @@ partial class Dump
|
|||||||
Dictionary<MediaTagType, byte[]> mediaTags, int sessions, out double totalChkDuration,
|
Dictionary<MediaTagType, byte[]> mediaTags, int sessions, out double totalChkDuration,
|
||||||
int? discOffset)
|
int? discOffset)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Creating_sidecar);
|
AaruLogging.WriteLine(Localization.Core.Creating_sidecar);
|
||||||
IFilter filter = PluginRegister.Singleton.GetFilter(_outputPath);
|
IFilter filter = PluginRegister.Singleton.GetFilter(_outputPath);
|
||||||
totalChkDuration = 0;
|
totalChkDuration = 0;
|
||||||
|
|
||||||
@@ -97,13 +98,13 @@ partial class Dump
|
|||||||
|
|
||||||
totalChkDuration = _sidecarStopwatch.Elapsed.TotalMilliseconds;
|
totalChkDuration = _sidecarStopwatch.Elapsed.TotalMilliseconds;
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Sidecar_created_in_0,
|
AaruLogging.WriteLine(Localization.Core.Sidecar_created_in_0,
|
||||||
_sidecarStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
_sidecarStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Average_checksum_speed_0,
|
AaruLogging.WriteLine(Localization.Core.Average_checksum_speed_0,
|
||||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
ByteSize.FromBytes(blockSize * (blocks + 1))
|
||||||
.Per(totalChkDuration.Milliseconds())
|
.Per(totalChkDuration.Milliseconds())
|
||||||
.Humanize());
|
.Humanize());
|
||||||
|
|
||||||
if(_preSidecar != null)
|
if(_preSidecar != null)
|
||||||
{
|
{
|
||||||
@@ -131,7 +132,9 @@ partial class Dump
|
|||||||
o.type
|
o.type
|
||||||
})
|
})
|
||||||
.Distinct())
|
.Distinct())
|
||||||
_dumpLog.WriteLine(Localization.Core.Found_filesystem_0_at_sector_1, filesystem.type, filesystem.start);
|
AaruLogging.WriteLine(Localization.Core.Found_filesystem_0_at_sector_1,
|
||||||
|
filesystem.type,
|
||||||
|
filesystem.start);
|
||||||
}
|
}
|
||||||
|
|
||||||
sidecar.OpticalDiscs[0].Dimensions = Dimensions.FromMediaType(mediaType);
|
sidecar.OpticalDiscs[0].Dimensions = Dimensions.FromMediaType(mediaType);
|
||||||
|
|||||||
@@ -79,12 +79,11 @@ partial class Dump
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Initializing_reader);
|
AaruLogging.WriteLine(Localization.Core.Initializing_reader);
|
||||||
var scsiReader = new Reader(_dev, _dev.Timeout, null, _errorLog);
|
var scsiReader = new Reader(_dev, _dev.Timeout, null, _errorLog);
|
||||||
ulong blocks = scsiReader.GetDeviceBlocks();
|
ulong blocks = scsiReader.GetDeviceBlocks();
|
||||||
uint blockSize = scsiReader.LogicalBlockSize;
|
uint blockSize = scsiReader.LogicalBlockSize;
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Requesting_MODE_SENSE_6);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Requesting_MODE_SENSE_6);
|
UpdateStatus?.Invoke(Localization.Core.Requesting_MODE_SENSE_6);
|
||||||
|
|
||||||
sense = _dev.ModeSense6(out byte[] cmdBuf, out _, true, ScsiModeSensePageControl.Current, 0x3F, 5, out _);
|
sense = _dev.ModeSense6(out byte[] cmdBuf, out _, true, ScsiModeSensePageControl.Current, 0x3F, 5, out _);
|
||||||
@@ -96,9 +95,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(blockSize != 2048)
|
if(blockSize != 2048)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.MiniDisc_albums_NetMD_discs_or_user_written_audio_MiniDisc_cannot_be_dumped);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.MiniDisc_albums_NetMD_discs_or_user_written_audio_MiniDisc_cannot_be_dumped);
|
.MiniDisc_albums_NetMD_discs_or_user_written_audio_MiniDisc_cannot_be_dumped);
|
||||||
|
|
||||||
@@ -109,7 +105,7 @@ partial class Dump
|
|||||||
|
|
||||||
if(scsiReader.FindReadCommand())
|
if(scsiReader.FindReadCommand())
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.ERROR_Cannot_find_correct_read_command_0, scsiReader.ErrorMessage);
|
AaruLogging.Error(Localization.Core.ERROR_Cannot_find_correct_read_command_0, scsiReader.ErrorMessage);
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Unable_to_read_medium);
|
StoppingErrorMessage?.Invoke(Localization.Core.Unable_to_read_medium);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -129,7 +125,7 @@ partial class Dump
|
|||||||
// 64 works, gets maximum speed (150KiB/s), slow I know...
|
// 64 works, gets maximum speed (150KiB/s), slow I know...
|
||||||
if(scsiReader.GetBlocksToRead())
|
if(scsiReader.GetBlocksToRead())
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.ERROR_Cannot_get_blocks_to_read_0, scsiReader.ErrorMessage);
|
AaruLogging.Error(Localization.Core.ERROR_Cannot_get_blocks_to_read_0, scsiReader.ErrorMessage);
|
||||||
StoppingErrorMessage?.Invoke(scsiReader.ErrorMessage);
|
StoppingErrorMessage?.Invoke(scsiReader.ErrorMessage);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -140,7 +136,7 @@ partial class Dump
|
|||||||
|
|
||||||
if(blocks == 0)
|
if(blocks == 0)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.ERROR_Unable_to_read_medium_or_empty_medium_present);
|
AaruLogging.Error(Localization.Core.ERROR_Unable_to_read_medium_or_empty_medium_present);
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Unable_to_read_medium_or_empty_medium_present);
|
StoppingErrorMessage?.Invoke(Localization.Core.Unable_to_read_medium_or_empty_medium_present);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -160,13 +156,6 @@ partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.SCSI_medium_type_0, scsiMediumType));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.SCSI_medium_type_0, scsiMediumType));
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Media_identified_as_0, dskType));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Media_identified_as_0, dskType));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_reports_0_blocks_1_bytes, blocks, blocks * blockSize);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_can_read_0_blocks_at_a_time, blocksToRead);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_reports_0_bytes_per_logical_block, blockSize);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_reports_0_bytes_per_physical_block, scsiReader.LongBlockSize);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.SCSI_device_type_0, _dev.ScsiType);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.SCSI_medium_type_0, scsiMediumType);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Media_identified_as_0, dskType);
|
|
||||||
|
|
||||||
sense = _dev.MiniDiscGetType(out cmdBuf, out _, _dev.Timeout, out _);
|
sense = _dev.MiniDiscGetType(out cmdBuf, out _, _dev.Timeout, out _);
|
||||||
|
|
||||||
@@ -198,20 +187,15 @@ partial class Dump
|
|||||||
foreach(MediaTagType tag in mediaTags.Keys.Where(tag => !outputFormat.SupportedMediaTags.Contains(tag)))
|
foreach(MediaTagType tag in mediaTags.Keys.Where(tag => !outputFormat.SupportedMediaTags.Contains(tag)))
|
||||||
{
|
{
|
||||||
ret = false;
|
ret = false;
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Output_format_does_not_support_0, tag));
|
|
||||||
ErrorMessage?.Invoke(string.Format(Localization.Core.Output_format_does_not_support_0, tag));
|
ErrorMessage?.Invoke(string.Format(Localization.Core.Output_format_does_not_support_0, tag));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!ret)
|
if(!ret)
|
||||||
{
|
{
|
||||||
if(_force)
|
if(_force)
|
||||||
{
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Several_media_tags_not_supported_continuing);
|
|
||||||
ErrorMessage?.Invoke(Localization.Core.Several_media_tags_not_supported_continuing);
|
ErrorMessage?.Invoke(Localization.Core.Several_media_tags_not_supported_continuing);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Several_media_tags_not_supported_not_continuing);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Several_media_tags_not_supported_not_continuing);
|
StoppingErrorMessage?.Invoke(Localization.Core.Several_media_tags_not_supported_not_continuing);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -219,7 +203,6 @@ partial class Dump
|
|||||||
}
|
}
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Reading_0_sectors_at_a_time, blocksToRead));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Reading_0_sectors_at_a_time, blocksToRead));
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_0_sectors_at_a_time, blocksToRead);
|
|
||||||
|
|
||||||
var mhddLog = new MhddLog(_outputPrefix + ".mhddlog.bin",
|
var mhddLog = new MhddLog(_outputPrefix + ".mhddlog.bin",
|
||||||
_dev,
|
_dev,
|
||||||
@@ -235,9 +218,6 @@ partial class Dump
|
|||||||
// Cannot create image
|
// Cannot create image
|
||||||
if(!ret)
|
if(!ret)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Error_creating_output_image_not_continuing);
|
|
||||||
_dumpLog.WriteLine(outputFormat.ErrorMessage);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
|
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
outputFormat.ErrorMessage);
|
outputFormat.ErrorMessage);
|
||||||
@@ -262,12 +242,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(!rigidPage.HasValue || setGeometry) continue;
|
if(!rigidPage.HasValue || setGeometry) continue;
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Setting_geometry_to_0_cylinders_1_heads_2_sectors_per_track,
|
|
||||||
rigidPage.Value.Cylinders,
|
|
||||||
rigidPage.Value.Heads,
|
|
||||||
(uint)(blocks / (rigidPage.Value.Cylinders * rigidPage.Value.Heads)));
|
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core
|
UpdateStatus?.Invoke(string.Format(Localization.Core
|
||||||
.Setting_geometry_to_0_cylinders_1_heads_2_sectors_per_track,
|
.Setting_geometry_to_0_cylinders_1_heads_2_sectors_per_track,
|
||||||
rigidPage.Value.Cylinders,
|
rigidPage.Value.Cylinders,
|
||||||
@@ -290,12 +264,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(!flexiblePage.HasValue) continue;
|
if(!flexiblePage.HasValue) continue;
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Setting_geometry_to_0_cylinders_1_heads_2_sectors_per_track,
|
|
||||||
flexiblePage.Value.Cylinders,
|
|
||||||
flexiblePage.Value.Heads,
|
|
||||||
flexiblePage.Value.SectorsPerTrack);
|
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core
|
UpdateStatus?.Invoke(string.Format(Localization.Core
|
||||||
.Setting_geometry_to_0_cylinders_1_heads_2_sectors_per_track,
|
.Setting_geometry_to_0_cylinders_1_heads_2_sectors_per_track,
|
||||||
flexiblePage.Value.Cylinders,
|
flexiblePage.Value.Cylinders,
|
||||||
@@ -339,10 +307,7 @@ partial class Dump
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(_resume.NextBlock > 0)
|
if(_resume.NextBlock > 0)
|
||||||
{
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Resuming_from_block_0, _resume.NextBlock));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Resuming_from_block_0, _resume.NextBlock));
|
||||||
_dumpLog.WriteLine(Localization.Core.Resuming_from_block_0, _resume.NextBlock);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(_createGraph)
|
if(_createGraph)
|
||||||
{
|
{
|
||||||
@@ -373,7 +338,6 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -432,7 +396,7 @@ partial class Dump
|
|||||||
mhddLog.Write(i, cmdDuration < 500 ? 65535 : cmdDuration, _skip);
|
mhddLog.Write(i, cmdDuration < 500 ? 65535 : cmdDuration, _skip);
|
||||||
|
|
||||||
ibgLog.Write(i, 0);
|
ibgLog.Write(i, 0);
|
||||||
_dumpLog.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
AaruLogging.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
||||||
i += _skip - blocksToRead;
|
i += _skip - blocksToRead;
|
||||||
newTrim = true;
|
newTrim = true;
|
||||||
}
|
}
|
||||||
@@ -478,26 +442,12 @@ partial class Dump
|
|||||||
.Per(imageWriteDuration.Seconds())
|
.Per(imageWriteDuration.Seconds())
|
||||||
.Humanize()));
|
.Humanize()));
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Dump_finished_in_0,
|
|
||||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_dump_speed_0,
|
|
||||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
|
||||||
.Per(totalDuration.Milliseconds())
|
|
||||||
.Humanize()));
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_write_speed_0,
|
|
||||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
|
||||||
.Per(imageWriteDuration.Seconds())
|
|
||||||
.Humanize()));
|
|
||||||
|
|
||||||
#region Trimming
|
#region Trimming
|
||||||
|
|
||||||
if(_resume.BadBlocks.Count > 0 && !_aborted && _trim && newTrim)
|
if(_resume.BadBlocks.Count > 0 && !_aborted && _trim && newTrim)
|
||||||
{
|
{
|
||||||
_trimStopwatch.Restart();
|
_trimStopwatch.Restart();
|
||||||
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
|
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
|
||||||
_dumpLog.WriteLine(Localization.Core.Trimming_skipped_sectors);
|
|
||||||
|
|
||||||
ulong[] tmpArray = _resume.BadBlocks.ToArray();
|
ulong[] tmpArray = _resume.BadBlocks.ToArray();
|
||||||
InitProgress?.Invoke();
|
InitProgress?.Invoke();
|
||||||
@@ -508,7 +458,6 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -530,9 +479,6 @@ partial class Dump
|
|||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Trimming_finished_in_0,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Trimming_finished_in_0,
|
||||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Trimming_finished_in_0,
|
|
||||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Trimming
|
#endregion Trimming
|
||||||
@@ -627,7 +573,6 @@ partial class Dump
|
|||||||
md6 = Modes.EncodeMode6(md, _dev.ScsiType);
|
md6 = Modes.EncodeMode6(md, _dev.ScsiType);
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Sending_MODE_SELECT_to_drive_return_damaged_blocks);
|
UpdateStatus?.Invoke(Localization.Core.Sending_MODE_SELECT_to_drive_return_damaged_blocks);
|
||||||
_dumpLog.WriteLine(Localization.Core.Sending_MODE_SELECT_to_drive_return_damaged_blocks);
|
|
||||||
sense = _dev.ModeSelect(md6, out byte[] senseBuf, true, false, _dev.Timeout, out _);
|
sense = _dev.ModeSelect(md6, out byte[] senseBuf, true, false, _dev.Timeout, out _);
|
||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
@@ -636,9 +581,6 @@ partial class Dump
|
|||||||
.Drive_did_not_accept_MODE_SELECT_command_for_persistent_error_reading);
|
.Drive_did_not_accept_MODE_SELECT_command_for_persistent_error_reading);
|
||||||
|
|
||||||
AaruLogging.Debug(Localization.Core.Error_0, Sense.PrettifySense(senseBuf));
|
AaruLogging.Debug(Localization.Core.Error_0, Sense.PrettifySense(senseBuf));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Drive_did_not_accept_MODE_SELECT_command_for_persistent_error_reading);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
runningPersistent = true;
|
runningPersistent = true;
|
||||||
@@ -654,7 +596,6 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -702,8 +643,6 @@ partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Correctly_retried_block_0_in_pass_1,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Correctly_retried_block_0_in_pass_1,
|
||||||
badSector,
|
badSector,
|
||||||
pass));
|
pass));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Correctly_retried_block_0_in_pass_1, badSector, pass);
|
|
||||||
}
|
}
|
||||||
else if(runningPersistent) outputFormat.WriteSector(readBuffer, badSector);
|
else if(runningPersistent) outputFormat.WriteSector(readBuffer, badSector);
|
||||||
}
|
}
|
||||||
@@ -730,7 +669,6 @@ partial class Dump
|
|||||||
md6 = Modes.EncodeMode6(md, _dev.ScsiType);
|
md6 = Modes.EncodeMode6(md, _dev.ScsiType);
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Sending_MODE_SELECT_to_drive_return_device_to_previous_status);
|
UpdateStatus?.Invoke(Localization.Core.Sending_MODE_SELECT_to_drive_return_device_to_previous_status);
|
||||||
_dumpLog.WriteLine(Localization.Core.Sending_MODE_SELECT_to_drive_return_device_to_previous_status);
|
|
||||||
_dev.ModeSelect(md6, out _, true, false, _dev.Timeout, out _);
|
_dev.ModeSelect(md6, out _, true, false, _dev.Timeout, out _);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -741,7 +679,8 @@ partial class Dump
|
|||||||
|
|
||||||
_resume.BadBlocks.Sort();
|
_resume.BadBlocks.Sort();
|
||||||
|
|
||||||
foreach(ulong bad in _resume.BadBlocks) _dumpLog.WriteLine(Localization.Core.Sector_0_could_not_be_read, bad);
|
foreach(ulong bad in _resume.BadBlocks)
|
||||||
|
AaruLogging.Information(Localization.Core.Sector_0_could_not_be_read, bad);
|
||||||
|
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
|
|
||||||
@@ -762,7 +701,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(_preSidecar != null) outputFormat.SetMetadata(_preSidecar);
|
if(_preSidecar != null) outputFormat.SetMetadata(_preSidecar);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Closing_output_file);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
||||||
_imageCloseStopwatch.Restart();
|
_imageCloseStopwatch.Restart();
|
||||||
outputFormat.Close();
|
outputFormat.Close();
|
||||||
@@ -771,13 +709,10 @@ partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Closed_in_0,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Closed_in_0,
|
||||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Closed_in_0,
|
|
||||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
|
||||||
|
|
||||||
if(_aborted)
|
if(_aborted)
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -787,7 +722,6 @@ partial class Dump
|
|||||||
if(_metadata)
|
if(_metadata)
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(Localization.Core.Creating_sidecar);
|
UpdateStatus?.Invoke(Localization.Core.Creating_sidecar);
|
||||||
_dumpLog.WriteLine(Localization.Core.Creating_sidecar);
|
|
||||||
IFilter filter = PluginRegister.Singleton.GetFilter(_outputPath);
|
IFilter filter = PluginRegister.Singleton.GetFilter(_outputPath);
|
||||||
var inputPlugin = ImageFormat.Detect(filter) as IMediaImage;
|
var inputPlugin = ImageFormat.Detect(filter) as IMediaImage;
|
||||||
ErrorNumber opened = inputPlugin.Open(filter);
|
ErrorNumber opened = inputPlugin.Open(filter);
|
||||||
@@ -823,14 +757,6 @@ partial class Dump
|
|||||||
.Per(totalChkDuration.Milliseconds())
|
.Per(totalChkDuration.Milliseconds())
|
||||||
.Humanize()));
|
.Humanize()));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Sidecar_created_in_0,
|
|
||||||
_sidecarStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Average_checksum_speed_0,
|
|
||||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
|
||||||
.Per(totalChkDuration.Milliseconds())
|
|
||||||
.Humanize());
|
|
||||||
|
|
||||||
if(_preSidecar != null)
|
if(_preSidecar != null)
|
||||||
{
|
{
|
||||||
_preSidecar.BlockMedias = sidecar.BlockMedias;
|
_preSidecar.BlockMedias = sidecar.BlockMedias;
|
||||||
@@ -859,10 +785,6 @@ partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Found_filesystem_0_at_sector_1,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Found_filesystem_0_at_sector_1,
|
||||||
filesystem.type,
|
filesystem.type,
|
||||||
filesystem.start));
|
filesystem.start));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Found_filesystem_0_at_sector_1,
|
|
||||||
filesystem.type,
|
|
||||||
filesystem.start);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -81,7 +81,6 @@ public partial class Dump
|
|||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Could_not_detect_capacity);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_detect_capacity);
|
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_detect_capacity);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -98,7 +97,6 @@ public partial class Dump
|
|||||||
|
|
||||||
if(blocks == 0)
|
if(blocks == 0)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.ERROR_Unable_to_read_medium_or_empty_medium_present);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Unable_to_read_medium_or_empty_medium_present);
|
StoppingErrorMessage?.Invoke(Localization.Core.Unable_to_read_medium_or_empty_medium_present);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -115,13 +113,11 @@ public partial class Dump
|
|||||||
if(blocks > 262144)
|
if(blocks > 262144)
|
||||||
{
|
{
|
||||||
dskType = MediaType.MemoryStickProDuo;
|
dskType = MediaType.MemoryStickProDuo;
|
||||||
_dumpLog.WriteLine(Localization.Core.Media_detected_as_MemoryStick_Pro_Duo);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Media_detected_as_MemoryStick_Pro_Duo);
|
UpdateStatus?.Invoke(Localization.Core.Media_detected_as_MemoryStick_Pro_Duo);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dskType = MediaType.MemoryStickDuo;
|
dskType = MediaType.MemoryStickDuo;
|
||||||
_dumpLog.WriteLine(Localization.Core.Media_detected_as_MemoryStick_Duo);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Media_detected_as_MemoryStick_Duo);
|
UpdateStatus?.Invoke(Localization.Core.Media_detected_as_MemoryStick_Duo);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -141,9 +137,6 @@ public partial class Dump
|
|||||||
// Cannot create image
|
// Cannot create image
|
||||||
if(!ret)
|
if(!ret)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Error_creating_output_image_not_continuing);
|
|
||||||
_dumpLog.WriteLine(outputFormat.ErrorMessage);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
|
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
outputFormat.ErrorMessage);
|
outputFormat.ErrorMessage);
|
||||||
@@ -178,7 +171,7 @@ public partial class Dump
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_resume.NextBlock > 0) _dumpLog.WriteLine(Localization.Core.Resuming_from_block_0, _resume.NextBlock);
|
if(_resume.NextBlock > 0) AaruLogging.WriteLine(Localization.Core.Resuming_from_block_0, _resume.NextBlock);
|
||||||
|
|
||||||
if(_createGraph)
|
if(_createGraph)
|
||||||
{
|
{
|
||||||
@@ -210,7 +203,6 @@ public partial class Dump
|
|||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -278,7 +270,7 @@ public partial class Dump
|
|||||||
mhddLog.Write(i, cmdDuration < 500 ? 65535 : cmdDuration, _skip);
|
mhddLog.Write(i, cmdDuration < 500 ? 65535 : cmdDuration, _skip);
|
||||||
|
|
||||||
ibgLog.Write(i, 0);
|
ibgLog.Write(i, 0);
|
||||||
_dumpLog.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
AaruLogging.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
||||||
i += _skip - blocksToRead;
|
i += _skip - blocksToRead;
|
||||||
newTrim = true;
|
newTrim = true;
|
||||||
}
|
}
|
||||||
@@ -324,18 +316,6 @@ public partial class Dump
|
|||||||
.Per(imageWriteDuration.Seconds())
|
.Per(imageWriteDuration.Seconds())
|
||||||
.Humanize()));
|
.Humanize()));
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Dump_finished_in_0,
|
|
||||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_dump_speed_0,
|
|
||||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
|
||||||
.Per(totalDuration.Milliseconds())
|
|
||||||
.Humanize()));
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_write_speed_0,
|
|
||||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
|
||||||
.Per(imageWriteDuration.Seconds())
|
|
||||||
.Humanize()));
|
|
||||||
|
|
||||||
#region Trimming
|
#region Trimming
|
||||||
|
|
||||||
@@ -343,7 +323,6 @@ public partial class Dump
|
|||||||
{
|
{
|
||||||
_trimStopwatch.Restart();
|
_trimStopwatch.Restart();
|
||||||
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
|
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
|
||||||
_dumpLog.WriteLine(Localization.Core.Trimming_skipped_sectors);
|
|
||||||
|
|
||||||
ulong[] tmpArray = _resume.BadBlocks.ToArray();
|
ulong[] tmpArray = _resume.BadBlocks.ToArray();
|
||||||
InitProgress?.Invoke();
|
InitProgress?.Invoke();
|
||||||
@@ -354,7 +333,6 @@ public partial class Dump
|
|||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -392,8 +370,8 @@ public partial class Dump
|
|||||||
EndProgress?.Invoke();
|
EndProgress?.Invoke();
|
||||||
_trimStopwatch.Stop();
|
_trimStopwatch.Stop();
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Trimming_finished_in_0,
|
AaruLogging.WriteLine(string.Format(Localization.Core.Trimming_finished_in_0,
|
||||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Trimming
|
#endregion Trimming
|
||||||
@@ -511,7 +489,6 @@ public partial class Dump
|
|||||||
md6 = Modes.EncodeMode6(md, _dev.ScsiType);
|
md6 = Modes.EncodeMode6(md, _dev.ScsiType);
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Sending_MODE_SELECT_to_drive_return_damaged_blocks);
|
UpdateStatus?.Invoke(Localization.Core.Sending_MODE_SELECT_to_drive_return_damaged_blocks);
|
||||||
_dumpLog.WriteLine(Localization.Core.Sending_MODE_SELECT_to_drive_return_damaged_blocks);
|
|
||||||
sense = _dev.ModeSelect(md6, out senseBuf, true, false, _dev.Timeout, out _);
|
sense = _dev.ModeSelect(md6, out senseBuf, true, false, _dev.Timeout, out _);
|
||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
@@ -520,9 +497,6 @@ public partial class Dump
|
|||||||
.Drive_did_not_accept_MODE_SELECT_command_for_persistent_error_reading);
|
.Drive_did_not_accept_MODE_SELECT_command_for_persistent_error_reading);
|
||||||
|
|
||||||
AaruLogging.Debug(Localization.Core.Error_0, Sense.PrettifySense(senseBuf));
|
AaruLogging.Debug(Localization.Core.Error_0, Sense.PrettifySense(senseBuf));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Drive_did_not_accept_MODE_SELECT_command_for_persistent_error_reading);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
runningPersistent = true;
|
runningPersistent = true;
|
||||||
@@ -537,7 +511,7 @@ public partial class Dump
|
|||||||
if(_aborted)
|
if(_aborted)
|
||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
AaruLogging.WriteLine(Localization.Core.Aborted);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -594,8 +568,6 @@ public partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Correctly_retried_block_0_in_pass_1,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Correctly_retried_block_0_in_pass_1,
|
||||||
badSector,
|
badSector,
|
||||||
pass));
|
pass));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Correctly_retried_block_0_in_pass_1, badSector, pass);
|
|
||||||
}
|
}
|
||||||
else if(runningPersistent) outputFormat.WriteSector(readBuffer, badSector);
|
else if(runningPersistent) outputFormat.WriteSector(readBuffer, badSector);
|
||||||
}
|
}
|
||||||
@@ -622,7 +594,6 @@ public partial class Dump
|
|||||||
md6 = Modes.EncodeMode6(md, _dev.ScsiType);
|
md6 = Modes.EncodeMode6(md, _dev.ScsiType);
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Sending_MODE_SELECT_to_drive_return_device_to_previous_status);
|
UpdateStatus?.Invoke(Localization.Core.Sending_MODE_SELECT_to_drive_return_device_to_previous_status);
|
||||||
_dumpLog.WriteLine(Localization.Core.Sending_MODE_SELECT_to_drive_return_device_to_previous_status);
|
|
||||||
_dev.ModeSelect(md6, out _, true, false, _dev.Timeout, out _);
|
_dev.ModeSelect(md6, out _, true, false, _dev.Timeout, out _);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -633,7 +604,8 @@ public partial class Dump
|
|||||||
|
|
||||||
_resume.BadBlocks.Sort();
|
_resume.BadBlocks.Sort();
|
||||||
|
|
||||||
foreach(ulong bad in _resume.BadBlocks) _dumpLog.WriteLine(Localization.Core.Sector_0_could_not_be_read, bad);
|
foreach(ulong bad in _resume.BadBlocks)
|
||||||
|
AaruLogging.WriteLine(Localization.Core.Sector_0_could_not_be_read, bad);
|
||||||
|
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
|
|
||||||
@@ -654,7 +626,6 @@ public partial class Dump
|
|||||||
|
|
||||||
if(_preSidecar != null) outputFormat.SetMetadata(_preSidecar);
|
if(_preSidecar != null) outputFormat.SetMetadata(_preSidecar);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Closing_output_file);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
||||||
_imageCloseStopwatch.Restart();
|
_imageCloseStopwatch.Restart();
|
||||||
outputFormat.Close();
|
outputFormat.Close();
|
||||||
@@ -663,13 +634,9 @@ public partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Closed_in_0,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Closed_in_0,
|
||||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Closed_in_0,
|
|
||||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
|
||||||
|
|
||||||
if(_aborted)
|
if(_aborted)
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -679,7 +646,6 @@ public partial class Dump
|
|||||||
if(_metadata)
|
if(_metadata)
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(Localization.Core.Creating_sidecar);
|
UpdateStatus?.Invoke(Localization.Core.Creating_sidecar);
|
||||||
_dumpLog.WriteLine(Localization.Core.Creating_sidecar);
|
|
||||||
IFilter filter = PluginRegister.Singleton.GetFilter(_outputPath);
|
IFilter filter = PluginRegister.Singleton.GetFilter(_outputPath);
|
||||||
var inputPlugin = ImageFormat.Detect(filter) as IMediaImage;
|
var inputPlugin = ImageFormat.Detect(filter) as IMediaImage;
|
||||||
ErrorNumber opened = inputPlugin.Open(filter);
|
ErrorNumber opened = inputPlugin.Open(filter);
|
||||||
@@ -715,14 +681,6 @@ public partial class Dump
|
|||||||
.Per(totalChkDuration.Milliseconds())
|
.Per(totalChkDuration.Milliseconds())
|
||||||
.Humanize()));
|
.Humanize()));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Sidecar_created_in_0,
|
|
||||||
_sidecarStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Average_checksum_speed_0,
|
|
||||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
|
||||||
.Per(totalChkDuration.Milliseconds())
|
|
||||||
.Humanize());
|
|
||||||
|
|
||||||
if(_preSidecar != null)
|
if(_preSidecar != null)
|
||||||
{
|
{
|
||||||
_preSidecar.BlockMedias = sidecar.BlockMedias;
|
_preSidecar.BlockMedias = sidecar.BlockMedias;
|
||||||
@@ -751,10 +709,6 @@ public partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Found_filesystem_0_at_sector_1,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Found_filesystem_0_at_sector_1,
|
||||||
filesystem.type,
|
filesystem.type,
|
||||||
filesystem.start));
|
filesystem.start));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Found_filesystem_0_at_sector_1,
|
|
||||||
filesystem.type,
|
|
||||||
filesystem.start);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ using Aaru.CommonTypes.Interfaces;
|
|||||||
using Aaru.CommonTypes.Structs.Devices.SCSI;
|
using Aaru.CommonTypes.Structs.Devices.SCSI;
|
||||||
using Aaru.Decoders.SCSI;
|
using Aaru.Decoders.SCSI;
|
||||||
using Aaru.Devices;
|
using Aaru.Devices;
|
||||||
|
using Aaru.Logging;
|
||||||
|
|
||||||
namespace Aaru.Core.Devices.Dumping;
|
namespace Aaru.Core.Devices.Dumping;
|
||||||
|
|
||||||
@@ -52,9 +53,6 @@ public partial class Dump
|
|||||||
!_outputPlugin.SupportedMediaTypes.Contains(MediaType.MemoryStickProDuo) &&
|
!_outputPlugin.SupportedMediaTypes.Contains(MediaType.MemoryStickProDuo) &&
|
||||||
!_outputPlugin.SupportedMediaTypes.Contains(MediaType.UMD))
|
!_outputPlugin.SupportedMediaTypes.Contains(MediaType.UMD))
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Selected_output_format_does_not_support_MemoryStick_Duo_or_UMD_cannot_dump);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Selected_output_format_does_not_support_MemoryStick_Duo_or_UMD_cannot_dump);
|
.Selected_output_format_does_not_support_MemoryStick_Duo_or_UMD_cannot_dump);
|
||||||
|
|
||||||
@@ -62,7 +60,6 @@ public partial class Dump
|
|||||||
}
|
}
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Checking_if_media_is_UMD_or_MemoryStick);
|
UpdateStatus?.Invoke(Localization.Core.Checking_if_media_is_UMD_or_MemoryStick);
|
||||||
_dumpLog.WriteLine(Localization.Core.Checking_if_media_is_UMD_or_MemoryStick);
|
|
||||||
|
|
||||||
bool sense = _dev.ModeSense6(out byte[] buffer,
|
bool sense = _dev.ModeSense6(out byte[] buffer,
|
||||||
out _,
|
out _,
|
||||||
@@ -74,7 +71,6 @@ public partial class Dump
|
|||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Could_not_get_MODE_SENSE);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_get_MODE_SENSE);
|
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_get_MODE_SENSE);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -84,7 +80,6 @@ public partial class Dump
|
|||||||
|
|
||||||
if(!decoded.HasValue)
|
if(!decoded.HasValue)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Could_not_decode_MODE_SENSE);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_decode_MODE_SENSE);
|
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_decode_MODE_SENSE);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -102,13 +97,12 @@ public partial class Dump
|
|||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Could_not_read);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_read);
|
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_read);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var tmp = new byte[8];
|
byte[] tmp = new byte[8];
|
||||||
|
|
||||||
Array.Copy(buffer, 0x36, tmp, 0, 8);
|
Array.Copy(buffer, 0x36, tmp, 0, 8);
|
||||||
|
|
||||||
@@ -120,12 +114,11 @@ public partial class Dump
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var fatStart = (ushort)((buffer[0x0F] << 8) + buffer[0x0E]);
|
ushort fatStart = (ushort)((buffer[0x0F] << 8) + buffer[0x0E]);
|
||||||
var sectorsPerFat = (ushort)((buffer[0x17] << 8) + buffer[0x16]);
|
ushort sectorsPerFat = (ushort)((buffer[0x17] << 8) + buffer[0x16]);
|
||||||
var rootStart = (ushort)(sectorsPerFat * 2 + fatStart);
|
ushort rootStart = (ushort)(sectorsPerFat * 2 + fatStart);
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Reading_root_directory_in_sector_0, rootStart));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Reading_root_directory_in_sector_0, rootStart));
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_root_directory_in_sector_0, rootStart);
|
|
||||||
|
|
||||||
sense = _dev.Read12(out buffer,
|
sense = _dev.Read12(out buffer,
|
||||||
out _,
|
out _,
|
||||||
@@ -145,7 +138,6 @@ public partial class Dump
|
|||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_read);
|
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_read);
|
||||||
_dumpLog.WriteLine(Localization.Core.Could_not_read);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -164,12 +156,11 @@ public partial class Dump
|
|||||||
fatStart,
|
fatStart,
|
||||||
sectorsPerFat));
|
sectorsPerFat));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.FAT_starts_at_sector_0_and_runs_for_1_sectors, fatStart, sectorsPerFat);
|
AaruLogging.WriteLine(Localization.Core.FAT_starts_at_sector_0_and_runs_for_1_sectors, fatStart, sectorsPerFat);
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_FAT);
|
UpdateStatus?.Invoke(Localization.Core.Reading_FAT);
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_FAT);
|
|
||||||
|
|
||||||
var fat = new byte[sectorsPerFat * 512];
|
byte[] fat = new byte[sectorsPerFat * 512];
|
||||||
|
|
||||||
uint position = 0;
|
uint position = 0;
|
||||||
|
|
||||||
@@ -197,7 +188,6 @@ public partial class Dump
|
|||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_read);
|
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_read);
|
||||||
_dumpLog.WriteLine(Localization.Core.Could_not_read);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -208,13 +198,12 @@ public partial class Dump
|
|||||||
}
|
}
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Traversing_FAT);
|
UpdateStatus?.Invoke(Localization.Core.Traversing_FAT);
|
||||||
_dumpLog.WriteLine(Localization.Core.Traversing_FAT);
|
|
||||||
|
|
||||||
var previousCluster = BitConverter.ToUInt16(fat, 4);
|
ushort previousCluster = BitConverter.ToUInt16(fat, 4);
|
||||||
|
|
||||||
for(var i = 3; i < fat.Length / 2; i++)
|
for(int i = 3; i < fat.Length / 2; i++)
|
||||||
{
|
{
|
||||||
var nextCluster = BitConverter.ToUInt16(fat, i * 2);
|
ushort nextCluster = BitConverter.ToUInt16(fat, i * 2);
|
||||||
|
|
||||||
if(nextCluster == previousCluster + 1)
|
if(nextCluster == previousCluster + 1)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -91,7 +91,6 @@ public partial class Dump
|
|||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Could_not_read);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_read);
|
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_read);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -104,7 +103,6 @@ public partial class Dump
|
|||||||
ushort umdStart = (ushort)(rootStart + rootSize);
|
ushort umdStart = (ushort)(rootStart + rootSize);
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Reading_root_directory_in_sector_0, rootStart));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Reading_root_directory_in_sector_0, rootStart));
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_root_directory_in_sector_0, rootStart);
|
|
||||||
|
|
||||||
sense = _dev.Read12(out readBuffer,
|
sense = _dev.Read12(out readBuffer,
|
||||||
out _,
|
out _,
|
||||||
@@ -123,7 +121,6 @@ public partial class Dump
|
|||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Could_not_read);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_read);
|
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_read);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -148,13 +145,6 @@ public partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.SCSI_device_type_0, _dev.ScsiType));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.SCSI_device_type_0, _dev.ScsiType));
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Media_identified_as_0, dskType));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Media_identified_as_0, dskType));
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Media_part_number_is_0, mediaPartNumber));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Media_part_number_is_0, mediaPartNumber));
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_reports_0_blocks_1_bytes, blocks, blocks * blockSize);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_can_read_0_blocks_at_a_time, blocksToRead);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_reports_0_bytes_per_logical_block, blockSize);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_reports_0_bytes_per_physical_block, blockSize);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.SCSI_device_type_0, _dev.ScsiType);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Media_identified_as_0, dskType);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Media_part_number_is_0, mediaPartNumber);
|
|
||||||
|
|
||||||
bool ret;
|
bool ret;
|
||||||
|
|
||||||
@@ -172,9 +162,6 @@ public partial class Dump
|
|||||||
// Cannot create image
|
// Cannot create image
|
||||||
if(!ret)
|
if(!ret)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Error_creating_output_image_not_continuing);
|
|
||||||
_dumpLog.WriteLine(outputOptical.ErrorMessage);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
|
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
outputOptical.ErrorMessage);
|
outputOptical.ErrorMessage);
|
||||||
@@ -222,7 +209,7 @@ public partial class Dump
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_resume.NextBlock > 0) _dumpLog.WriteLine(Localization.Core.Resuming_from_block_0, _resume.NextBlock);
|
if(_resume.NextBlock > 0) AaruLogging.WriteLine(Localization.Core.Resuming_from_block_0, _resume.NextBlock);
|
||||||
|
|
||||||
if(_createGraph)
|
if(_createGraph)
|
||||||
{
|
{
|
||||||
@@ -254,7 +241,6 @@ public partial class Dump
|
|||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -322,7 +308,7 @@ public partial class Dump
|
|||||||
mhddLog.Write(i, cmdDuration < 500 ? 65535 : cmdDuration, _skip);
|
mhddLog.Write(i, cmdDuration < 500 ? 65535 : cmdDuration, _skip);
|
||||||
|
|
||||||
ibgLog.Write(i, 0);
|
ibgLog.Write(i, 0);
|
||||||
_dumpLog.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
AaruLogging.Information(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
||||||
i += _skip - blocksToRead;
|
i += _skip - blocksToRead;
|
||||||
newTrim = true;
|
newTrim = true;
|
||||||
}
|
}
|
||||||
@@ -367,25 +353,13 @@ public partial class Dump
|
|||||||
.Per(imageWriteDuration.Seconds())
|
.Per(imageWriteDuration.Seconds())
|
||||||
.Humanize()));
|
.Humanize()));
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Dump_finished_in_0,
|
|
||||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_dump_speed_0,
|
|
||||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
|
||||||
.Per(totalDuration.Milliseconds())
|
|
||||||
.Humanize()));
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_write_speed_0,
|
|
||||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
|
||||||
.Per(imageWriteDuration.Seconds())
|
|
||||||
.Humanize()));
|
|
||||||
|
|
||||||
#region Trimming
|
#region Trimming
|
||||||
|
|
||||||
if(_resume.BadBlocks.Count > 0 && !_aborted && _trim && newTrim)
|
if(_resume.BadBlocks.Count > 0 && !_aborted && _trim && newTrim)
|
||||||
{
|
{
|
||||||
_trimStopwatch.Restart();
|
_trimStopwatch.Restart();
|
||||||
_dumpLog.WriteLine(Localization.Core.Trimming_skipped_sectors);
|
AaruLogging.WriteLine(Localization.Core.Trimming_skipped_sectors);
|
||||||
|
|
||||||
ulong[] tmpArray = _resume.BadBlocks.ToArray();
|
ulong[] tmpArray = _resume.BadBlocks.ToArray();
|
||||||
InitProgress?.Invoke();
|
InitProgress?.Invoke();
|
||||||
@@ -395,7 +369,7 @@ public partial class Dump
|
|||||||
if(_aborted)
|
if(_aborted)
|
||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
AaruLogging.WriteLine(Localization.Core.Aborted);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -433,8 +407,8 @@ public partial class Dump
|
|||||||
EndProgress?.Invoke();
|
EndProgress?.Invoke();
|
||||||
_trimStopwatch.Stop();
|
_trimStopwatch.Stop();
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Trimming_finished_in_0,
|
AaruLogging.WriteLine(string.Format(Localization.Core.Trimming_finished_in_0,
|
||||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Trimming
|
#endregion Trimming
|
||||||
@@ -528,7 +502,7 @@ public partial class Dump
|
|||||||
|
|
||||||
md6 = Modes.EncodeMode6(md, _dev.ScsiType);
|
md6 = Modes.EncodeMode6(md, _dev.ScsiType);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Sending_MODE_SELECT_to_drive_return_damaged_blocks);
|
AaruLogging.WriteLine(Localization.Core.Sending_MODE_SELECT_to_drive_return_damaged_blocks);
|
||||||
sense = _dev.ModeSelect(md6, out senseBuf, true, false, _dev.Timeout, out _);
|
sense = _dev.ModeSelect(md6, out senseBuf, true, false, _dev.Timeout, out _);
|
||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
@@ -537,9 +511,6 @@ public partial class Dump
|
|||||||
.Drive_did_not_accept_MODE_SELECT_command_for_persistent_error_reading);
|
.Drive_did_not_accept_MODE_SELECT_command_for_persistent_error_reading);
|
||||||
|
|
||||||
AaruLogging.Debug(Localization.Core.Error_0, Sense.PrettifySense(senseBuf));
|
AaruLogging.Debug(Localization.Core.Error_0, Sense.PrettifySense(senseBuf));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Drive_did_not_accept_MODE_SELECT_command_for_persistent_error_reading);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
runningPersistent = true;
|
runningPersistent = true;
|
||||||
@@ -554,7 +525,7 @@ public partial class Dump
|
|||||||
if(_aborted)
|
if(_aborted)
|
||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
AaruLogging.WriteLine(Localization.Core.Aborted);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -611,8 +582,6 @@ public partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Correctly_retried_block_0_in_pass_1,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Correctly_retried_block_0_in_pass_1,
|
||||||
badSector,
|
badSector,
|
||||||
pass));
|
pass));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Correctly_retried_block_0_in_pass_1, badSector, pass);
|
|
||||||
}
|
}
|
||||||
else if(runningPersistent) outputOptical.WriteSector(readBuffer, badSector);
|
else if(runningPersistent) outputOptical.WriteSector(readBuffer, badSector);
|
||||||
}
|
}
|
||||||
@@ -638,7 +607,7 @@ public partial class Dump
|
|||||||
|
|
||||||
md6 = Modes.EncodeMode6(md, _dev.ScsiType);
|
md6 = Modes.EncodeMode6(md, _dev.ScsiType);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Sending_MODE_SELECT_to_drive_return_device_to_previous_status);
|
AaruLogging.WriteLine(Localization.Core.Sending_MODE_SELECT_to_drive_return_device_to_previous_status);
|
||||||
_dev.ModeSelect(md6, out _, true, false, _dev.Timeout, out _);
|
_dev.ModeSelect(md6, out _, true, false, _dev.Timeout, out _);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -650,7 +619,8 @@ public partial class Dump
|
|||||||
|
|
||||||
_resume.BadBlocks.Sort();
|
_resume.BadBlocks.Sort();
|
||||||
|
|
||||||
foreach(ulong bad in _resume.BadBlocks) _dumpLog.WriteLine(Localization.Core.Sector_0_could_not_be_read, bad);
|
foreach(ulong bad in _resume.BadBlocks)
|
||||||
|
AaruLogging.Information(Localization.Core.Sector_0_could_not_be_read, bad);
|
||||||
|
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
|
|
||||||
@@ -672,19 +642,17 @@ public partial class Dump
|
|||||||
|
|
||||||
if(_preSidecar != null) outputOptical.SetMetadata(_preSidecar);
|
if(_preSidecar != null) outputOptical.SetMetadata(_preSidecar);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Closing_output_file);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
||||||
_imageCloseStopwatch.Restart();
|
_imageCloseStopwatch.Restart();
|
||||||
outputOptical.Close();
|
outputOptical.Close();
|
||||||
_imageCloseStopwatch.Stop();
|
_imageCloseStopwatch.Stop();
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Closed_in_0,
|
AaruLogging.WriteLine(Localization.Core.Closed_in_0,
|
||||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
||||||
|
|
||||||
if(_aborted)
|
if(_aborted)
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ public partial class Dump
|
|||||||
/// <summary>Dumps a SCSI Block Commands device or a Reduced Block Commands devices</summary>
|
/// <summary>Dumps a SCSI Block Commands device or a Reduced Block Commands devices</summary>
|
||||||
void Scsi()
|
void Scsi()
|
||||||
{
|
{
|
||||||
var resets = 0;
|
int resets = 0;
|
||||||
|
|
||||||
if(_dev.IsRemovable)
|
if(_dev.IsRemovable)
|
||||||
{
|
{
|
||||||
@@ -65,10 +65,6 @@ public partial class Dump
|
|||||||
decSense.Value.ASC,
|
decSense.Value.ASC,
|
||||||
decSense.Value.ASCQ));
|
decSense.Value.ASCQ));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_not_ready_Sense,
|
|
||||||
decSense.Value.SenseKey,
|
|
||||||
decSense.Value.ASC,
|
|
||||||
decSense.Value.ASCQ);
|
|
||||||
|
|
||||||
// Just retry, for 5 times
|
// Just retry, for 5 times
|
||||||
if(decSense.Value.ASC == 0x29)
|
if(decSense.Value.ASC == 0x29)
|
||||||
@@ -82,7 +78,7 @@ public partial class Dump
|
|||||||
{
|
{
|
||||||
case 0x3A:
|
case 0x3A:
|
||||||
{
|
{
|
||||||
var leftRetries = 5;
|
int leftRetries = 5;
|
||||||
|
|
||||||
while(leftRetries > 0)
|
while(leftRetries > 0)
|
||||||
{
|
{
|
||||||
@@ -100,11 +96,6 @@ public partial class Dump
|
|||||||
decSense.Value.SenseKey,
|
decSense.Value.SenseKey,
|
||||||
decSense.Value.ASC,
|
decSense.Value.ASC,
|
||||||
decSense.Value.ASCQ));
|
decSense.Value.ASCQ));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_not_ready_Sense,
|
|
||||||
decSense.Value.SenseKey,
|
|
||||||
decSense.Value.ASC,
|
|
||||||
decSense.Value.ASCQ);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
leftRetries--;
|
leftRetries--;
|
||||||
@@ -121,7 +112,7 @@ public partial class Dump
|
|||||||
}
|
}
|
||||||
case 0x04 when decSense.Value.ASCQ == 0x01:
|
case 0x04 when decSense.Value.ASCQ == 0x01:
|
||||||
{
|
{
|
||||||
var leftRetries = 50;
|
int leftRetries = 50;
|
||||||
|
|
||||||
while(leftRetries > 0)
|
while(leftRetries > 0)
|
||||||
{
|
{
|
||||||
@@ -139,11 +130,6 @@ public partial class Dump
|
|||||||
decSense.Value.SenseKey,
|
decSense.Value.SenseKey,
|
||||||
decSense.Value.ASC,
|
decSense.Value.ASC,
|
||||||
decSense.Value.ASCQ));
|
decSense.Value.ASCQ));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_not_ready_Sense,
|
|
||||||
decSense.Value.SenseKey,
|
|
||||||
decSense.Value.ASC,
|
|
||||||
decSense.Value.ASCQ);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
leftRetries--;
|
leftRetries--;
|
||||||
@@ -176,7 +162,7 @@ public partial class Dump
|
|||||||
// These should be trapped by the OS but seems in some cases they're not
|
// These should be trapped by the OS but seems in some cases they're not
|
||||||
case 0x28:
|
case 0x28:
|
||||||
{
|
{
|
||||||
var leftRetries = 10;
|
int leftRetries = 10;
|
||||||
|
|
||||||
while(leftRetries > 0)
|
while(leftRetries > 0)
|
||||||
{
|
{
|
||||||
@@ -194,11 +180,6 @@ public partial class Dump
|
|||||||
decSense.Value.SenseKey,
|
decSense.Value.SenseKey,
|
||||||
decSense.Value.ASC,
|
decSense.Value.ASC,
|
||||||
decSense.Value.ASCQ));
|
decSense.Value.ASCQ));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_not_ready_Sense,
|
|
||||||
decSense.Value.SenseKey,
|
|
||||||
decSense.Value.ASC,
|
|
||||||
decSense.Value.ASCQ);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
leftRetries--;
|
leftRetries--;
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ using Aaru.Decoders.SCSI;
|
|||||||
using Aaru.Decoders.SCSI.SSC;
|
using Aaru.Decoders.SCSI.SSC;
|
||||||
using Aaru.Devices;
|
using Aaru.Devices;
|
||||||
using Aaru.Helpers;
|
using Aaru.Helpers;
|
||||||
|
using Aaru.Logging;
|
||||||
using Humanizer;
|
using Humanizer;
|
||||||
using Humanizer.Bytes;
|
using Humanizer.Bytes;
|
||||||
using Humanizer.Localisation;
|
using Humanizer.Localisation;
|
||||||
@@ -80,10 +81,10 @@ partial class Dump
|
|||||||
|
|
||||||
if(decSense.HasValue && decSense?.SenseKey != SenseKeys.NoSense)
|
if(decSense.HasValue && decSense?.SenseKey != SenseKeys.NoSense)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_not_ready_Sense,
|
AaruLogging.WriteLine(Localization.Core.Device_not_ready_Sense,
|
||||||
decSense?.SenseKey,
|
decSense?.SenseKey,
|
||||||
decSense?.ASC,
|
decSense?.ASC,
|
||||||
decSense?.ASCQ);
|
decSense?.ASCQ);
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Drive_has_status_error_please_correct_Sense_follows +
|
StoppingErrorMessage?.Invoke(Localization.Core.Drive_has_status_error_please_correct_Sense_follows +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
@@ -98,7 +99,6 @@ partial class Dump
|
|||||||
decSense?.ASCQ != 0x04 &&
|
decSense?.ASCQ != 0x04 &&
|
||||||
decSense?.SenseKey != SenseKeys.IllegalRequest)
|
decSense?.SenseKey != SenseKeys.IllegalRequest)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Rewinding_please_wait);
|
|
||||||
PulseProgress?.Invoke(Localization.Core.Rewinding_please_wait);
|
PulseProgress?.Invoke(Localization.Core.Rewinding_please_wait);
|
||||||
|
|
||||||
// Rewind, let timeout apply
|
// Rewind, let timeout apply
|
||||||
@@ -124,12 +124,12 @@ partial class Dump
|
|||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
decSense?.Description);
|
decSense?.Description);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Drive_could_not_rewind_please_correct_Sense_follows);
|
AaruLogging.WriteLine(Localization.Core.Drive_could_not_rewind_please_correct_Sense_follows);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_not_ready_Sense,
|
AaruLogging.WriteLine(Localization.Core.Device_not_ready_Sense,
|
||||||
decSense?.SenseKey,
|
decSense?.SenseKey,
|
||||||
decSense?.ASC,
|
decSense?.ASC,
|
||||||
decSense?.ASCQ);
|
decSense?.ASCQ);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -152,12 +152,12 @@ partial class Dump
|
|||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
decSense?.Description);
|
decSense?.Description);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Could_not_get_position_Sense_follows);
|
AaruLogging.WriteLine(Localization.Core.Could_not_get_position_Sense_follows);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_not_ready_Sense,
|
AaruLogging.WriteLine(Localization.Core.Device_not_ready_Sense,
|
||||||
decSense?.SenseKey,
|
decSense?.SenseKey,
|
||||||
decSense?.ASC,
|
decSense?.ASC,
|
||||||
decSense?.ASCQ);
|
decSense?.ASCQ);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -168,7 +168,6 @@ partial class Dump
|
|||||||
if(cmdBuf[1] != 0)
|
if(cmdBuf[1] != 0)
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(Localization.Core.Drive_not_in_partition_0_Rewinding_please_wait);
|
UpdateStatus?.Invoke(Localization.Core.Drive_not_in_partition_0_Rewinding_please_wait);
|
||||||
_dumpLog.WriteLine(Localization.Core.Drive_not_in_partition_0_Rewinding_please_wait);
|
|
||||||
|
|
||||||
// Rewind, let timeout apply
|
// Rewind, let timeout apply
|
||||||
sense = _dev.Locate(out senseBuf, false, 0, 0, _dev.Timeout, out duration);
|
sense = _dev.Locate(out senseBuf, false, 0, 0, _dev.Timeout, out duration);
|
||||||
@@ -179,12 +178,12 @@ partial class Dump
|
|||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
decSense?.Description);
|
decSense?.Description);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Drive_could_not_rewind_please_correct_Sense_follows);
|
AaruLogging.WriteLine(Localization.Core.Drive_could_not_rewind_please_correct_Sense_follows);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_not_ready_Sense,
|
AaruLogging.WriteLine(Localization.Core.Device_not_ready_Sense,
|
||||||
decSense?.SenseKey,
|
decSense?.SenseKey,
|
||||||
decSense?.ASC,
|
decSense?.ASC,
|
||||||
decSense?.ASCQ);
|
decSense?.ASCQ);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -207,12 +206,12 @@ partial class Dump
|
|||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
decSense?.Description);
|
decSense?.Description);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Drive_could_not_rewind_please_correct_Sense_follows);
|
AaruLogging.WriteLine(Localization.Core.Drive_could_not_rewind_please_correct_Sense_follows);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_not_ready_Sense,
|
AaruLogging.WriteLine(Localization.Core.Device_not_ready_Sense,
|
||||||
decSense?.SenseKey,
|
decSense?.SenseKey,
|
||||||
decSense?.ASC,
|
decSense?.ASC,
|
||||||
decSense?.ASCQ);
|
decSense?.ASCQ);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -227,12 +226,12 @@ partial class Dump
|
|||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
decSense?.Description);
|
decSense?.Description);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Drive_could_not_rewind_please_correct_Sense_follows);
|
AaruLogging.WriteLine(Localization.Core.Drive_could_not_rewind_please_correct_Sense_follows);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_not_ready_Sense,
|
AaruLogging.WriteLine(Localization.Core.Device_not_ready_Sense,
|
||||||
decSense?.SenseKey,
|
decSense?.SenseKey,
|
||||||
decSense?.ASC,
|
decSense?.ASC,
|
||||||
decSense?.ASCQ);
|
decSense?.ASCQ);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -243,7 +242,6 @@ partial class Dump
|
|||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Drive_could_not_rewind_to_partition_0_but_no_error_occurred);
|
.Drive_could_not_rewind_to_partition_0_but_no_error_occurred);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Drive_could_not_rewind_to_partition_0_but_no_error_occurred);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -285,9 +283,8 @@ partial class Dump
|
|||||||
Modes.DecodedMode? decMode = null;
|
Modes.DecodedMode? decMode = null;
|
||||||
|
|
||||||
if(!sense && !_dev.Error)
|
if(!sense && !_dev.Error)
|
||||||
{
|
if(Modes.DecodeMode10(cmdBuf, _dev.ScsiType).HasValue)
|
||||||
if(Modes.DecodeMode10(cmdBuf, _dev.ScsiType).HasValue) decMode = Modes.DecodeMode10(cmdBuf, _dev.ScsiType);
|
decMode = Modes.DecodeMode10(cmdBuf, _dev.ScsiType);
|
||||||
}
|
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Requesting_MODE_SENSE_6);
|
UpdateStatus?.Invoke(Localization.Core.Requesting_MODE_SENSE_6);
|
||||||
|
|
||||||
@@ -315,9 +312,8 @@ partial class Dump
|
|||||||
if(sense || _dev.Error) sense = _dev.ModeSense(out cmdBuf, out senseBuf, 5, out duration);
|
if(sense || _dev.Error) sense = _dev.ModeSense(out cmdBuf, out senseBuf, 5, out duration);
|
||||||
|
|
||||||
if(!sense && !_dev.Error)
|
if(!sense && !_dev.Error)
|
||||||
{
|
if(Modes.DecodeMode6(cmdBuf, _dev.ScsiType).HasValue)
|
||||||
if(Modes.DecodeMode6(cmdBuf, _dev.ScsiType).HasValue) decMode = Modes.DecodeMode6(cmdBuf, _dev.ScsiType);
|
decMode = Modes.DecodeMode6(cmdBuf, _dev.ScsiType);
|
||||||
}
|
|
||||||
|
|
||||||
// TODO: Check partitions page
|
// TODO: Check partitions page
|
||||||
if(decMode.HasValue)
|
if(decMode.HasValue)
|
||||||
@@ -360,17 +356,13 @@ partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.SCSI_density_type_0, scsiDensityCodeTape));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.SCSI_density_type_0, scsiDensityCodeTape));
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Media_identified_as_0, dskType));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Media_identified_as_0, dskType));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.SCSI_device_type_0, _dev.ScsiType);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.SCSI_medium_type_0, scsiMediumTypeTape);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.SCSI_density_type_0, scsiDensityCodeTape);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Media_identified_as_0, dskType);
|
|
||||||
|
|
||||||
var endOfMedia = false;
|
bool endOfMedia = false;
|
||||||
ulong currentBlock = 0;
|
ulong currentBlock = 0;
|
||||||
uint currentFile = 0;
|
uint currentFile = 0;
|
||||||
byte currentPartition = 0;
|
byte currentPartition = 0;
|
||||||
byte totalPartitions = 1; // TODO: Handle partitions.
|
byte totalPartitions = 1; // TODO: Handle partitions.
|
||||||
var fixedLen = false;
|
bool fixedLen = false;
|
||||||
uint transferLen = blockSize;
|
uint transferLen = blockSize;
|
||||||
|
|
||||||
firstRead:
|
firstRead:
|
||||||
@@ -413,12 +405,12 @@ partial class Dump
|
|||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
decSense.Value.Description);
|
decSense.Value.Description);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Drive_could_not_return_back_Sense_follows);
|
AaruLogging.WriteLine(Localization.Core.Drive_could_not_return_back_Sense_follows);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_not_ready_Sense,
|
AaruLogging.WriteLine(Localization.Core.Device_not_ready_Sense,
|
||||||
decSense.Value.SenseKey,
|
decSense.Value.SenseKey,
|
||||||
decSense.Value.ASC,
|
decSense.Value.ASC,
|
||||||
decSense.Value.ASCQ);
|
decSense.Value.ASCQ);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -444,12 +436,12 @@ partial class Dump
|
|||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
decSense.Value.Description);
|
decSense.Value.Description);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Drive_could_not_read_Sense_follows);
|
AaruLogging.WriteLine(Localization.Core.Drive_could_not_read_Sense_follows);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_not_ready_Sense,
|
AaruLogging.WriteLine(Localization.Core.Device_not_ready_Sense,
|
||||||
decSense.Value.SenseKey,
|
decSense.Value.SenseKey,
|
||||||
decSense.Value.ASC,
|
decSense.Value.ASC,
|
||||||
decSense.Value.ASCQ);
|
decSense.Value.ASCQ);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -484,10 +476,6 @@ partial class Dump
|
|||||||
blockSize,
|
blockSize,
|
||||||
currentBlock));
|
currentBlock));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Blocksize_changed_to_0_bytes_at_block_1,
|
|
||||||
blockSize,
|
|
||||||
currentBlock);
|
|
||||||
|
|
||||||
sense = _dev.Space(out senseBuf,
|
sense = _dev.Space(out senseBuf,
|
||||||
SscSpaceCodes.LogicalBlock,
|
SscSpaceCodes.LogicalBlock,
|
||||||
-1,
|
-1,
|
||||||
@@ -505,12 +493,13 @@ partial class Dump
|
|||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
decSense.Value.Description);
|
decSense.Value.Description);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Drive_could_not_go_back_one_block_Sense_follows);
|
AaruLogging.WriteLine(Localization.Core
|
||||||
|
.Drive_could_not_go_back_one_block_Sense_follows);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_not_ready_Sense,
|
AaruLogging.WriteLine(Localization.Core.Device_not_ready_Sense,
|
||||||
decSense.Value.SenseKey,
|
decSense.Value.SenseKey,
|
||||||
decSense.Value.ASC,
|
decSense.Value.ASC,
|
||||||
decSense.Value.ASCQ);
|
decSense.Value.ASCQ);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -522,12 +511,12 @@ partial class Dump
|
|||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
decSense.Value.Description);
|
decSense.Value.Description);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Drive_could_not_read_Sense_follows);
|
AaruLogging.WriteLine(Localization.Core.Drive_could_not_read_Sense_follows);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_not_ready_Sense,
|
AaruLogging.WriteLine(Localization.Core.Device_not_ready_Sense,
|
||||||
decSense.Value.SenseKey,
|
decSense.Value.SenseKey,
|
||||||
decSense.Value.ASC,
|
decSense.Value.ASC,
|
||||||
decSense.Value.ASCQ);
|
decSense.Value.ASCQ);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -536,12 +525,12 @@ partial class Dump
|
|||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
decSense.Value.Description);
|
decSense.Value.Description);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Drive_could_not_read_Sense_follows);
|
AaruLogging.WriteLine(Localization.Core.Drive_could_not_read_Sense_follows);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_not_ready_Sense,
|
AaruLogging.WriteLine(Localization.Core.Device_not_ready_Sense,
|
||||||
decSense.Value.SenseKey,
|
decSense.Value.SenseKey,
|
||||||
decSense.Value.ASC,
|
decSense.Value.ASC,
|
||||||
decSense.Value.ASCQ);
|
decSense.Value.ASCQ);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -549,7 +538,6 @@ partial class Dump
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_read_device_dont_know_why_exiting);
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_read_device_dont_know_why_exiting);
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_read_device_dont_know_why_exiting);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -573,12 +561,12 @@ partial class Dump
|
|||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
decSense.Value.Description);
|
decSense.Value.Description);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Drive_could_not_return_back_Sense_follows);
|
AaruLogging.WriteLine(Localization.Core.Drive_could_not_return_back_Sense_follows);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_not_ready_Sense,
|
AaruLogging.WriteLine(Localization.Core.Device_not_ready_Sense,
|
||||||
decSense.Value.SenseKey,
|
decSense.Value.SenseKey,
|
||||||
decSense.Value.ASC,
|
decSense.Value.ASC,
|
||||||
decSense.Value.ASCQ);
|
decSense.Value.ASCQ);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -609,11 +597,10 @@ partial class Dump
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var canLocateLong = false;
|
bool canLocateLong = false;
|
||||||
var canLocate = false;
|
bool canLocate = false;
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Positioning_tape_to_block_1);
|
UpdateStatus?.Invoke(Localization.Core.Positioning_tape_to_block_1);
|
||||||
_dumpLog.WriteLine(Localization.Core.Positioning_tape_to_block_1);
|
|
||||||
|
|
||||||
sense = _dev.Locate16(out senseBuf, 1, _dev.Timeout, out _);
|
sense = _dev.Locate16(out senseBuf, 1, _dev.Timeout, out _);
|
||||||
|
|
||||||
@@ -629,7 +616,6 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
canLocateLong = true;
|
canLocateLong = true;
|
||||||
UpdateStatus?.Invoke(Localization.Core.LOCATE_LONG_works);
|
UpdateStatus?.Invoke(Localization.Core.LOCATE_LONG_works);
|
||||||
_dumpLog.WriteLine(Localization.Core.LOCATE_LONG_works);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -648,7 +634,6 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
canLocate = true;
|
canLocate = true;
|
||||||
UpdateStatus?.Invoke(Localization.Core.LOCATE_works);
|
UpdateStatus?.Invoke(Localization.Core.LOCATE_works);
|
||||||
_dumpLog.WriteLine(Localization.Core.LOCATE_works);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -656,7 +641,6 @@ partial class Dump
|
|||||||
if(_resume.NextBlock > 0)
|
if(_resume.NextBlock > 0)
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Positioning_tape_to_block_0, _resume.NextBlock));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Positioning_tape_to_block_0, _resume.NextBlock));
|
||||||
_dumpLog.WriteLine(Localization.Core.Positioning_tape_to_block_0, _resume.NextBlock);
|
|
||||||
|
|
||||||
if(canLocateLong)
|
if(canLocateLong)
|
||||||
{
|
{
|
||||||
@@ -670,18 +654,12 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
if(!_force)
|
if(!_force)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Could_not_check_current_position_unable_to_resume_If_you_want_to_continue_use_force);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Could_not_check_current_position_unable_to_resume_If_you_want_to_continue_use_force);
|
.Could_not_check_current_position_unable_to_resume_If_you_want_to_continue_use_force);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Could_not_check_current_position_unable_to_resume_Dumping_from_the_start);
|
|
||||||
|
|
||||||
ErrorMessage?.Invoke(Localization.Core
|
ErrorMessage?.Invoke(Localization.Core
|
||||||
.Could_not_check_current_position_unable_to_resume_Dumping_from_the_start);
|
.Could_not_check_current_position_unable_to_resume_Dumping_from_the_start);
|
||||||
|
|
||||||
@@ -695,18 +673,12 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
if(!_force)
|
if(!_force)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Current_position_is_not_as_expected_unable_to_resume_If_you_want_to_continue_use_force);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Current_position_is_not_as_expected_unable_to_resume_If_you_want_to_continue_use_force);
|
.Current_position_is_not_as_expected_unable_to_resume_If_you_want_to_continue_use_force);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Current_position_is_not_as_expected_unable_to_resume_Dumping_from_the_start);
|
|
||||||
|
|
||||||
ErrorMessage?.Invoke(Localization.Core
|
ErrorMessage?.Invoke(Localization.Core
|
||||||
.Current_position_is_not_as_expected_unable_to_resume_Dumping_from_the_start);
|
.Current_position_is_not_as_expected_unable_to_resume_Dumping_from_the_start);
|
||||||
|
|
||||||
@@ -718,18 +690,12 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
if(!_force)
|
if(!_force)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Cannot_reposition_tape_unable_to_resume_If_you_want_to_continue_use_force);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Cannot_reposition_tape_unable_to_resume_If_you_want_to_continue_use_force);
|
.Cannot_reposition_tape_unable_to_resume_If_you_want_to_continue_use_force);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Cannot_reposition_tape_unable_to_resume_Dumping_from_the_start);
|
|
||||||
|
|
||||||
ErrorMessage?.Invoke(Localization.Core
|
ErrorMessage?.Invoke(Localization.Core
|
||||||
.Cannot_reposition_tape_unable_to_resume_Dumping_from_the_start);
|
.Cannot_reposition_tape_unable_to_resume_Dumping_from_the_start);
|
||||||
|
|
||||||
@@ -748,18 +714,12 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
if(!_force)
|
if(!_force)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Could_not_check_current_position_unable_to_resume_If_you_want_to_continue_use_force);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Could_not_check_current_position_unable_to_resume_If_you_want_to_continue_use_force);
|
.Could_not_check_current_position_unable_to_resume_If_you_want_to_continue_use_force);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Could_not_check_current_position_unable_to_resume_Dumping_from_the_start);
|
|
||||||
|
|
||||||
ErrorMessage?.Invoke(Localization.Core
|
ErrorMessage?.Invoke(Localization.Core
|
||||||
.Could_not_check_current_position_unable_to_resume_Dumping_from_the_start);
|
.Could_not_check_current_position_unable_to_resume_Dumping_from_the_start);
|
||||||
|
|
||||||
@@ -773,18 +733,12 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
if(!_force)
|
if(!_force)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Current_position_is_not_as_expected_unable_to_resume_If_you_want_to_continue_use_force);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Current_position_is_not_as_expected_unable_to_resume_If_you_want_to_continue_use_force);
|
.Current_position_is_not_as_expected_unable_to_resume_If_you_want_to_continue_use_force);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Current_position_is_not_as_expected_unable_to_resume_Dumping_from_the_start);
|
|
||||||
|
|
||||||
ErrorMessage?.Invoke(Localization.Core
|
ErrorMessage?.Invoke(Localization.Core
|
||||||
.Current_position_is_not_as_expected_unable_to_resume_Dumping_from_the_start);
|
.Current_position_is_not_as_expected_unable_to_resume_Dumping_from_the_start);
|
||||||
|
|
||||||
@@ -796,18 +750,12 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
if(!_force)
|
if(!_force)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Cannot_reposition_tape_unable_to_resume_If_you_want_to_continue_use_force);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Cannot_reposition_tape_unable_to_resume_If_you_want_to_continue_use_force);
|
.Cannot_reposition_tape_unable_to_resume_If_you_want_to_continue_use_force);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Cannot_reposition_tape_unable_to_resume_Dumping_from_the_start);
|
|
||||||
|
|
||||||
ErrorMessage?.Invoke(Localization.Core
|
ErrorMessage?.Invoke(Localization.Core
|
||||||
.Cannot_reposition_tape_unable_to_resume_Dumping_from_the_start);
|
.Cannot_reposition_tape_unable_to_resume_Dumping_from_the_start);
|
||||||
|
|
||||||
@@ -818,16 +766,12 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
if(!_force)
|
if(!_force)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Cannot_reposition_tape_unable_to_resume_If_you_want_to_continue_use_force);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Cannot_reposition_tape_unable_to_resume_If_you_want_to_continue_use_force);
|
.Cannot_reposition_tape_unable_to_resume_If_you_want_to_continue_use_force);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_reposition_tape_unable_to_resume_Dumping_from_the_start);
|
|
||||||
ErrorMessage?.Invoke(Localization.Core.Cannot_reposition_tape_unable_to_resume_Dumping_from_the_start);
|
ErrorMessage?.Invoke(Localization.Core.Cannot_reposition_tape_unable_to_resume_Dumping_from_the_start);
|
||||||
canLocate = false;
|
canLocate = false;
|
||||||
}
|
}
|
||||||
@@ -855,12 +799,12 @@ partial class Dump
|
|||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
decSense.Value.Description);
|
decSense.Value.Description);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Drive_could_not_rewind_please_correct_Sense_follows);
|
AaruLogging.WriteLine(Localization.Core.Drive_could_not_rewind_please_correct_Sense_follows);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_not_ready_Sense,
|
AaruLogging.WriteLine(Localization.Core.Device_not_ready_Sense,
|
||||||
decSense.Value.SenseKey,
|
decSense.Value.SenseKey,
|
||||||
decSense.Value.ASC,
|
decSense.Value.ASC,
|
||||||
decSense.Value.ASCQ);
|
decSense.Value.ASCQ);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -871,9 +815,6 @@ partial class Dump
|
|||||||
// Cannot set image to tape mode
|
// Cannot set image to tape mode
|
||||||
if(!ret)
|
if(!ret)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Error_setting_output_image_in_tape_mode_not_continuing);
|
|
||||||
_dumpLog.WriteLine(outputTape.ErrorMessage);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Error_setting_output_image_in_tape_mode_not_continuing +
|
StoppingErrorMessage?.Invoke(Localization.Core.Error_setting_output_image_in_tape_mode_not_continuing +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
outputTape.ErrorMessage);
|
outputTape.ErrorMessage);
|
||||||
@@ -886,9 +827,6 @@ partial class Dump
|
|||||||
// Cannot create image
|
// Cannot create image
|
||||||
if(!ret)
|
if(!ret)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Error_creating_output_image_not_continuing);
|
|
||||||
_dumpLog.WriteLine(outputTape.ErrorMessage);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
|
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
outputTape.ErrorMessage);
|
outputTape.ErrorMessage);
|
||||||
@@ -942,7 +880,6 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -950,7 +887,6 @@ partial class Dump
|
|||||||
if(endOfMedia)
|
if(endOfMedia)
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Finished_partition_0, currentPartition));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Finished_partition_0, currentPartition));
|
||||||
_dumpLog.WriteLine(Localization.Core.Finished_partition_0, currentPartition);
|
|
||||||
|
|
||||||
currentTapeFile.LastBlock = currentBlock - 1;
|
currentTapeFile.LastBlock = currentBlock - 1;
|
||||||
|
|
||||||
@@ -1040,10 +976,6 @@ partial class Dump
|
|||||||
blockSize,
|
blockSize,
|
||||||
currentBlock));
|
currentBlock));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Blocksize_changed_to_0_bytes_at_block_1,
|
|
||||||
blockSize,
|
|
||||||
currentBlock);
|
|
||||||
|
|
||||||
sense = _dev.Space(out senseBuf, SscSpaceCodes.LogicalBlock, -1, _dev.Timeout, out duration);
|
sense = _dev.Space(out senseBuf, SscSpaceCodes.LogicalBlock, -1, _dev.Timeout, out duration);
|
||||||
|
|
||||||
totalDuration += duration;
|
totalDuration += duration;
|
||||||
@@ -1057,12 +989,12 @@ partial class Dump
|
|||||||
decSense.Value.Description);
|
decSense.Value.Description);
|
||||||
|
|
||||||
outputTape.Close();
|
outputTape.Close();
|
||||||
_dumpLog.WriteLine(Localization.Core.Drive_could_not_go_back_one_block_Sense_follows);
|
AaruLogging.WriteLine(Localization.Core.Drive_could_not_go_back_one_block_Sense_follows);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_not_ready_Sense,
|
AaruLogging.WriteLine(Localization.Core.Device_not_ready_Sense,
|
||||||
decSense.Value.SenseKey,
|
decSense.Value.SenseKey,
|
||||||
decSense.Value.ASC,
|
decSense.Value.ASC,
|
||||||
decSense.Value.ASCQ);
|
decSense.Value.ASCQ);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1075,7 +1007,6 @@ partial class Dump
|
|||||||
case SenseKeys.BlankCheck when currentBlock == 0:
|
case SenseKeys.BlankCheck when currentBlock == 0:
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_dump_a_blank_tape);
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_dump_a_blank_tape);
|
||||||
outputTape.Close();
|
outputTape.Close();
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_dump_a_blank_tape);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -1085,13 +1016,11 @@ partial class Dump
|
|||||||
// TODO: Detect end of partition
|
// TODO: Detect end of partition
|
||||||
endOfMedia = true;
|
endOfMedia = true;
|
||||||
UpdateStatus?.Invoke(Localization.Core.Found_end_of_tape_partition);
|
UpdateStatus?.Invoke(Localization.Core.Found_end_of_tape_partition);
|
||||||
_dumpLog.WriteLine(Localization.Core.Found_end_of_tape_partition);
|
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
case SenseKeys.BlankCheck:
|
case SenseKeys.BlankCheck:
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Blank_block_found_end_of_tape);
|
StoppingErrorMessage?.Invoke(Localization.Core.Blank_block_found_end_of_tape);
|
||||||
endOfMedia = true;
|
endOfMedia = true;
|
||||||
_dumpLog.WriteLine(Localization.Core.Blank_block_found_end_of_tape);
|
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1102,7 +1031,6 @@ partial class Dump
|
|||||||
// TODO: Detect end of partition
|
// TODO: Detect end of partition
|
||||||
endOfMedia = true;
|
endOfMedia = true;
|
||||||
UpdateStatus?.Invoke(Localization.Core.Found_end_of_tape_partition);
|
UpdateStatus?.Invoke(Localization.Core.Found_end_of_tape_partition);
|
||||||
_dumpLog.WriteLine(Localization.Core.Found_end_of_tape_partition);
|
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
case SenseKeys.NoSense or SenseKeys.RecoveredError when decSense.Value.ASCQ == 0x01 || filemark:
|
case SenseKeys.NoSense or SenseKeys.RecoveredError when decSense.Value.ASCQ == 0x01 || filemark:
|
||||||
@@ -1122,7 +1050,6 @@ partial class Dump
|
|||||||
currentFile,
|
currentFile,
|
||||||
currentBlock));
|
currentBlock));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Changed_to_file_0_at_block_1, currentFile, currentBlock);
|
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -1133,10 +1060,11 @@ partial class Dump
|
|||||||
.Drive_could_not_read_block_0_Sense_cannot_be_decoded_look_at_log_for_dump,
|
.Drive_could_not_read_block_0_Sense_cannot_be_decoded_look_at_log_for_dump,
|
||||||
currentBlock));
|
currentBlock));
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Drive_could_not_read_block_0_Sense_bytes_follow,
|
AaruLogging.Information(string.Format(Localization.Core
|
||||||
currentBlock));
|
.Drive_could_not_read_block_0_Sense_bytes_follow,
|
||||||
|
currentBlock));
|
||||||
|
|
||||||
_dumpLog.WriteLine(PrintHex.ByteArrayToHexArrayString(senseBuf, 32));
|
AaruLogging.Information(PrintHex.ByteArrayToHexArrayString(senseBuf, 32));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1146,13 +1074,13 @@ partial class Dump
|
|||||||
decSense.Value.SenseKey,
|
decSense.Value.SenseKey,
|
||||||
decSense.Value.Description));
|
decSense.Value.Description));
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Drive_could_not_read_block_0_Sense_follows,
|
AaruLogging.WriteLine(string.Format(Localization.Core.Drive_could_not_read_block_0_Sense_follows,
|
||||||
currentBlock));
|
currentBlock));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_not_ready_Sense,
|
AaruLogging.WriteLine(Localization.Core.Device_not_ready_Sense,
|
||||||
decSense.Value.SenseKey,
|
decSense.Value.SenseKey,
|
||||||
decSense.Value.ASC,
|
decSense.Value.ASC,
|
||||||
decSense.Value.ASCQ);
|
decSense.Value.ASCQ);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO: Reset device after X errors
|
// TODO: Reset device after X errors
|
||||||
@@ -1230,25 +1158,13 @@ partial class Dump
|
|||||||
.Per(imageWriteDuration.Seconds())
|
.Per(imageWriteDuration.Seconds())
|
||||||
.Humanize()));
|
.Humanize()));
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Dump_finished_in_0,
|
|
||||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_dump_speed_0,
|
|
||||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
|
||||||
.Per(totalDuration.Milliseconds())
|
|
||||||
.Humanize()));
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_write_speed_0,
|
|
||||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
|
||||||
.Per(imageWriteDuration.Seconds())
|
|
||||||
.Humanize()));
|
|
||||||
|
|
||||||
#region Error handling
|
#region Error handling
|
||||||
|
|
||||||
if(_resume.BadBlocks.Count > 0 && !_aborted && _retryPasses > 0 && (canLocate || canLocateLong))
|
if(_resume.BadBlocks.Count > 0 && !_aborted && _retryPasses > 0 && (canLocate || canLocateLong))
|
||||||
{
|
{
|
||||||
var pass = 1;
|
int pass = 1;
|
||||||
var forward = false;
|
bool forward = false;
|
||||||
const bool runningPersistent = false;
|
const bool runningPersistent = false;
|
||||||
|
|
||||||
Modes.ModePage? currentModePage;
|
Modes.ModePage? currentModePage;
|
||||||
@@ -1268,7 +1184,6 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1297,7 +1212,6 @@ partial class Dump
|
|||||||
}
|
}
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Positioning_tape_to_block_0, badBlock));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Positioning_tape_to_block_0, badBlock));
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Positioning_tape_to_block_0, badBlock));
|
|
||||||
|
|
||||||
if(canLocateLong)
|
if(canLocateLong)
|
||||||
{
|
{
|
||||||
@@ -1309,7 +1223,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Could_not_check_current_position_continuing);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_check_current_position_continuing);
|
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_check_current_position_continuing);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
@@ -1319,8 +1232,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(position != _resume.NextBlock)
|
if(position != _resume.NextBlock)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Current_position_is_not_as_expected_continuing);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Current_position_is_not_as_expected_continuing);
|
.Current_position_is_not_as_expected_continuing);
|
||||||
|
|
||||||
@@ -1329,8 +1240,6 @@ partial class Dump
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Cannot_position_tape_to_block_0, badBlock));
|
|
||||||
|
|
||||||
ErrorMessage?.Invoke(string.Format(Localization.Core.Cannot_position_tape_to_block_0,
|
ErrorMessage?.Invoke(string.Format(Localization.Core.Cannot_position_tape_to_block_0,
|
||||||
badBlock));
|
badBlock));
|
||||||
|
|
||||||
@@ -1347,7 +1256,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Could_not_check_current_position_continuing);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_check_current_position_continuing);
|
StoppingErrorMessage?.Invoke(Localization.Core.Could_not_check_current_position_continuing);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
@@ -1357,8 +1265,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(position != _resume.NextBlock)
|
if(position != _resume.NextBlock)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Current_position_is_not_as_expected_continuing);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Current_position_is_not_as_expected_continuing);
|
.Current_position_is_not_as_expected_continuing);
|
||||||
|
|
||||||
@@ -1367,8 +1273,6 @@ partial class Dump
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Cannot_position_tape_to_block_0, badBlock));
|
|
||||||
|
|
||||||
ErrorMessage?.Invoke(string.Format(Localization.Core.Cannot_position_tape_to_block_0,
|
ErrorMessage?.Invoke(string.Format(Localization.Core.Cannot_position_tape_to_block_0,
|
||||||
badBlock));
|
badBlock));
|
||||||
|
|
||||||
@@ -1396,8 +1300,6 @@ partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Correctly_retried_block_0_in_pass_1,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Correctly_retried_block_0_in_pass_1,
|
||||||
badBlock,
|
badBlock,
|
||||||
pass));
|
pass));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Correctly_retried_block_0_in_pass_1, badBlock, pass);
|
|
||||||
}
|
}
|
||||||
else if(runningPersistent) outputTape.WriteSector(cmdBuf, badBlock);
|
else if(runningPersistent) outputTape.WriteSector(cmdBuf, badBlock);
|
||||||
}
|
}
|
||||||
@@ -1425,7 +1327,8 @@ partial class Dump
|
|||||||
|
|
||||||
_resume.BadBlocks.Sort();
|
_resume.BadBlocks.Sort();
|
||||||
|
|
||||||
foreach(ulong bad in _resume.BadBlocks) _dumpLog.WriteLine(Localization.Core.Block_0_could_not_be_read, bad);
|
foreach(ulong bad in _resume.BadBlocks)
|
||||||
|
AaruLogging.Information(Localization.Core.Block_0_could_not_be_read, bad);
|
||||||
|
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
|
|
||||||
@@ -1447,7 +1350,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(_preSidecar != null) outputTape.SetMetadata(_preSidecar);
|
if(_preSidecar != null) outputTape.SetMetadata(_preSidecar);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Closing_output_file);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
||||||
_imageCloseStopwatch.Restart();
|
_imageCloseStopwatch.Restart();
|
||||||
outputTape.Close();
|
outputTape.Close();
|
||||||
@@ -1456,21 +1358,10 @@ partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Closed_in_0,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Closed_in_0,
|
||||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Closed_in_0,
|
|
||||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
|
||||||
|
|
||||||
if(_aborted)
|
if(_aborted)
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(_aborted)
|
|
||||||
{
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1480,7 +1371,6 @@ partial class Dump
|
|||||||
if(_metadata)
|
if(_metadata)
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(Localization.Core.Creating_sidecar);
|
UpdateStatus?.Invoke(Localization.Core.Creating_sidecar);
|
||||||
_dumpLog.WriteLine(Localization.Core.Creating_sidecar);
|
|
||||||
IFilter filter = PluginRegister.Singleton.GetFilter(_outputPath);
|
IFilter filter = PluginRegister.Singleton.GetFilter(_outputPath);
|
||||||
var inputPlugin = ImageFormat.Detect(filter) as IMediaImage;
|
var inputPlugin = ImageFormat.Detect(filter) as IMediaImage;
|
||||||
ErrorNumber opened = inputPlugin.Open(filter);
|
ErrorNumber opened = inputPlugin.Open(filter);
|
||||||
@@ -1516,14 +1406,6 @@ partial class Dump
|
|||||||
.Per(totalChkDuration.Milliseconds())
|
.Per(totalChkDuration.Milliseconds())
|
||||||
.Humanize()));
|
.Humanize()));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Sidecar_created_in_0,
|
|
||||||
_sidecarStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Average_checksum_speed_0,
|
|
||||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
|
||||||
.Per(totalChkDuration.Milliseconds())
|
|
||||||
.Humanize());
|
|
||||||
|
|
||||||
if(_preSidecar != null)
|
if(_preSidecar != null)
|
||||||
{
|
{
|
||||||
_preSidecar.BlockMedias = sidecar.BlockMedias;
|
_preSidecar.BlockMedias = sidecar.BlockMedias;
|
||||||
@@ -1552,10 +1434,6 @@ partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Found_filesystem_0_at_sector_1,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Found_filesystem_0_at_sector_1,
|
||||||
filesystem.type,
|
filesystem.type,
|
||||||
filesystem.start));
|
filesystem.start));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Found_filesystem_0_at_sector_1,
|
|
||||||
filesystem.type,
|
|
||||||
filesystem.start);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ using Aaru.CommonTypes.Extents;
|
|||||||
using Aaru.CommonTypes.Interfaces;
|
using Aaru.CommonTypes.Interfaces;
|
||||||
using Aaru.Core.Logging;
|
using Aaru.Core.Logging;
|
||||||
using Aaru.Decryption.DVD;
|
using Aaru.Decryption.DVD;
|
||||||
|
using Aaru.Logging;
|
||||||
using Humanizer;
|
using Humanizer;
|
||||||
using Humanizer.Bytes;
|
using Humanizer.Bytes;
|
||||||
|
|
||||||
@@ -89,7 +90,6 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -118,7 +118,7 @@ partial class Dump
|
|||||||
_writeStopwatch.Restart();
|
_writeStopwatch.Restart();
|
||||||
|
|
||||||
byte[] tmpBuf;
|
byte[] tmpBuf;
|
||||||
var cmi = new byte[blocksToRead];
|
byte[] cmi = new byte[blocksToRead];
|
||||||
|
|
||||||
for(uint j = 0; j < blocksToRead; j++)
|
for(uint j = 0; j < blocksToRead; j++)
|
||||||
{
|
{
|
||||||
@@ -183,7 +183,7 @@ partial class Dump
|
|||||||
mhddLog.Write(i, cmdDuration < 500 ? 65535 : cmdDuration, _skip);
|
mhddLog.Write(i, cmdDuration < 500 ? 65535 : cmdDuration, _skip);
|
||||||
|
|
||||||
ibgLog.Write(i, 0);
|
ibgLog.Write(i, 0);
|
||||||
_dumpLog.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
AaruLogging.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
||||||
i += _skip - blocksToRead;
|
i += _skip - blocksToRead;
|
||||||
newTrim = true;
|
newTrim = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ using Aaru.Core.Logging;
|
|||||||
using Aaru.Decoders.DVD;
|
using Aaru.Decoders.DVD;
|
||||||
using Aaru.Decryption;
|
using Aaru.Decryption;
|
||||||
using Aaru.Decryption.DVD;
|
using Aaru.Decryption.DVD;
|
||||||
|
using Aaru.Logging;
|
||||||
using Humanizer;
|
using Humanizer;
|
||||||
using Humanizer.Bytes;
|
using Humanizer.Bytes;
|
||||||
using DVDDecryption = Aaru.Decryption.DVD.Dump;
|
using DVDDecryption = Aaru.Decryption.DVD.Dump;
|
||||||
@@ -84,7 +85,6 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -203,8 +203,6 @@ partial class Dump
|
|||||||
_resume.NextBlock++;
|
_resume.NextBlock++;
|
||||||
_aborted = true;
|
_aborted = true;
|
||||||
|
|
||||||
_dumpLog?.WriteLine(Localization.Core
|
|
||||||
.INSITE_floptical_drives_get_crazy_on_the_SCSI_bus_when_an_error_is_found);
|
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core
|
UpdateStatus?.Invoke(Localization.Core
|
||||||
.INSITE_floptical_drives_get_crazy_on_the_SCSI_bus_when_an_error_is_found);
|
.INSITE_floptical_drives_get_crazy_on_the_SCSI_bus_when_an_error_is_found);
|
||||||
@@ -227,7 +225,7 @@ partial class Dump
|
|||||||
mhddLog.Write(i, cmdDuration < 500 ? 65535 : cmdDuration, _skip);
|
mhddLog.Write(i, cmdDuration < 500 ? 65535 : cmdDuration, _skip);
|
||||||
|
|
||||||
ibgLog.Write(i, 0);
|
ibgLog.Write(i, 0);
|
||||||
_dumpLog.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
AaruLogging.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
||||||
i += _skip - blocksToRead;
|
i += _skip - blocksToRead;
|
||||||
newTrim = true;
|
newTrim = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ partial class Dump
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Initializing_reader);
|
AaruLogging.WriteLine(Localization.Core.Initializing_reader);
|
||||||
var scsiReader = new Reader(_dev, _dev.Timeout, null, _errorLog, _dumpRaw);
|
var scsiReader = new Reader(_dev, _dev.Timeout, null, _errorLog, _dumpRaw);
|
||||||
ulong blocks = scsiReader.GetDeviceBlocks();
|
ulong blocks = scsiReader.GetDeviceBlocks();
|
||||||
uint blockSize = scsiReader.LogicalBlockSize;
|
uint blockSize = scsiReader.LogicalBlockSize;
|
||||||
@@ -121,7 +121,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(!sense)
|
if(!sense)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Requesting_MODE_SENSE_10);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Requesting_MODE_SENSE_10);
|
UpdateStatus?.Invoke(Localization.Core.Requesting_MODE_SENSE_10);
|
||||||
|
|
||||||
sense = _dev.ModeSense10(out cmdBuf,
|
sense = _dev.ModeSense10(out cmdBuf,
|
||||||
@@ -156,7 +155,6 @@ partial class Dump
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Requesting_MODE_SENSE_6);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Requesting_MODE_SENSE_6);
|
UpdateStatus?.Invoke(Localization.Core.Requesting_MODE_SENSE_6);
|
||||||
|
|
||||||
sense = _dev.ModeSense6(out cmdBuf,
|
sense = _dev.ModeSense6(out cmdBuf,
|
||||||
@@ -229,9 +227,6 @@ partial class Dump
|
|||||||
// SonicStage changes the device mode, so it is no longer a mass storage device, and can only read
|
// SonicStage changes the device mode, so it is no longer a mass storage device, and can only read
|
||||||
// tracks written by that same application ID (changes between computers).
|
// tracks written by that same application ID (changes between computers).
|
||||||
case MediaType.MD:
|
case MediaType.MD:
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.MiniDisc_albums_NetMD_discs_or_user_written_audio_MiniDisc_cannot_be_dumped);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.MiniDisc_albums_NetMD_discs_or_user_written_audio_MiniDisc_cannot_be_dumped);
|
.MiniDisc_albums_NetMD_discs_or_user_written_audio_MiniDisc_cannot_be_dumped);
|
||||||
|
|
||||||
@@ -244,7 +239,7 @@ partial class Dump
|
|||||||
|
|
||||||
if(scsiReader.FindReadCommand())
|
if(scsiReader.FindReadCommand())
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.ERROR_Cannot_find_correct_read_command_0, scsiReader.ErrorMessage);
|
AaruLogging.WriteLine(Localization.Core.ERROR_Cannot_find_correct_read_command_0, scsiReader.ErrorMessage);
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Unable_to_read_medium);
|
StoppingErrorMessage?.Invoke(Localization.Core.Unable_to_read_medium);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -263,7 +258,7 @@ partial class Dump
|
|||||||
// Check how many blocks to read, if error show and return
|
// Check how many blocks to read, if error show and return
|
||||||
if(scsiReader.GetBlocksToRead(_maximumReadable))
|
if(scsiReader.GetBlocksToRead(_maximumReadable))
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.ERROR_Cannot_get_blocks_to_read_0, scsiReader.ErrorMessage);
|
AaruLogging.WriteLine(Localization.Core.ERROR_Cannot_get_blocks_to_read_0, scsiReader.ErrorMessage);
|
||||||
StoppingErrorMessage?.Invoke(scsiReader.ErrorMessage);
|
StoppingErrorMessage?.Invoke(scsiReader.ErrorMessage);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -275,7 +270,7 @@ partial class Dump
|
|||||||
|
|
||||||
if(blocks == 0)
|
if(blocks == 0)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.ERROR_Unable_to_read_medium_or_empty_medium_present);
|
AaruLogging.WriteLine(Localization.Core.ERROR_Unable_to_read_medium_or_empty_medium_present);
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Unable_to_read_medium_or_empty_medium_present);
|
StoppingErrorMessage?.Invoke(Localization.Core.Unable_to_read_medium_or_empty_medium_present);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -297,16 +292,6 @@ partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.SCSI_floppy_mode_page_present_0, containsFloppyPage));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.SCSI_floppy_mode_page_present_0, containsFloppyPage));
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Media_identified_as_0, dskType));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Media_identified_as_0, dskType));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_reports_0_blocks_1_bytes, blocks, blocks * blockSize);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_can_read_0_blocks_at_a_time, blocksToRead);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_reports_0_bytes_per_logical_block, blockSize);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_reports_0_bytes_per_physical_block, scsiReader.LongBlockSize);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.SCSI_device_type_0, _dev.ScsiType);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.SCSI_medium_type_0, scsiMediumType);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.SCSI_density_type_0, scsiDensityCode);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.SCSI_floppy_mode_page_present_0, containsFloppyPage);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Media_identified_as_0, dskType);
|
|
||||||
|
|
||||||
uint longBlockSize = scsiReader.LongBlockSize;
|
uint longBlockSize = scsiReader.LongBlockSize;
|
||||||
|
|
||||||
if(_dumpRaw)
|
if(_dumpRaw)
|
||||||
@@ -356,20 +341,15 @@ partial class Dump
|
|||||||
foreach(MediaTagType tag in mediaTags.Keys.Where(tag => !outputFormat.SupportedMediaTags.Contains(tag)))
|
foreach(MediaTagType tag in mediaTags.Keys.Where(tag => !outputFormat.SupportedMediaTags.Contains(tag)))
|
||||||
{
|
{
|
||||||
ret = false;
|
ret = false;
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Output_format_does_not_support_0, tag));
|
|
||||||
ErrorMessage?.Invoke(string.Format(Localization.Core.Output_format_does_not_support_0, tag));
|
ErrorMessage?.Invoke(string.Format(Localization.Core.Output_format_does_not_support_0, tag));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!ret)
|
if(!ret)
|
||||||
{
|
{
|
||||||
if(_force)
|
if(_force)
|
||||||
{
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Several_media_tags_not_supported_continuing);
|
|
||||||
ErrorMessage?.Invoke(Localization.Core.Several_media_tags_not_supported_continuing);
|
ErrorMessage?.Invoke(Localization.Core.Several_media_tags_not_supported_continuing);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Several_media_tags_not_supported_not_continuing);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Several_media_tags_not_supported_not_continuing);
|
StoppingErrorMessage?.Invoke(Localization.Core.Several_media_tags_not_supported_not_continuing);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -377,7 +357,6 @@ partial class Dump
|
|||||||
}
|
}
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Reading_0_sectors_at_a_time, blocksToRead));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Reading_0_sectors_at_a_time, blocksToRead));
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_0_sectors_at_a_time, blocksToRead);
|
|
||||||
|
|
||||||
var mhddLog = new MhddLog(_outputPrefix + ".mhddlog.bin",
|
var mhddLog = new MhddLog(_outputPrefix + ".mhddlog.bin",
|
||||||
_dev,
|
_dev,
|
||||||
@@ -397,9 +376,6 @@ partial class Dump
|
|||||||
// Cannot create image
|
// Cannot create image
|
||||||
if(!ret)
|
if(!ret)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Error_creating_output_image_not_continuing);
|
|
||||||
_dumpLog.WriteLine(outputFormat.ErrorMessage);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
|
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
outputFormat.ErrorMessage);
|
outputFormat.ErrorMessage);
|
||||||
@@ -444,17 +420,11 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
if(_force)
|
if(_force)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Image_does_not_support_multiple_sessions_in_non_Compact_Disc_dumps_continuing);
|
|
||||||
|
|
||||||
ErrorMessage?.Invoke(Localization.Core
|
ErrorMessage?.Invoke(Localization.Core
|
||||||
.Image_does_not_support_multiple_sessions_in_non_Compact_Disc_dumps_continuing);
|
.Image_does_not_support_multiple_sessions_in_non_Compact_Disc_dumps_continuing);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Image_does_not_support_multiple_sessions_in_non_Compact_Disc_dumps_not_continuing);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Image_does_not_support_multiple_sessions_in_non_Compact_Disc_dumps_not_continuing);
|
.Image_does_not_support_multiple_sessions_in_non_Compact_Disc_dumps_not_continuing);
|
||||||
|
|
||||||
@@ -468,17 +438,11 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
if(_force)
|
if(_force)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Image_does_not_support_multiple_tracks_in_non_Compact_Disc_dumps_continuing);
|
|
||||||
|
|
||||||
ErrorMessage?.Invoke(Localization.Core
|
ErrorMessage?.Invoke(Localization.Core
|
||||||
.Image_does_not_support_multiple_tracks_in_non_Compact_Disc_dumps_continuing);
|
.Image_does_not_support_multiple_tracks_in_non_Compact_Disc_dumps_continuing);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Image_does_not_support_multiple_tracks_in_non_Compact_Disc_dumps_not_continuing);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Image_does_not_support_multiple_tracks_in_non_Compact_Disc_dumps_not_continuing);
|
.Image_does_not_support_multiple_tracks_in_non_Compact_Disc_dumps_not_continuing);
|
||||||
|
|
||||||
@@ -487,7 +451,6 @@ partial class Dump
|
|||||||
}
|
}
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Building_track_map);
|
UpdateStatus?.Invoke(Localization.Core.Building_track_map);
|
||||||
_dumpLog.WriteLine(Localization.Core.Building_track_map);
|
|
||||||
|
|
||||||
List<Track> tracks = [];
|
List<Track> tracks = [];
|
||||||
|
|
||||||
@@ -557,9 +520,6 @@ partial class Dump
|
|||||||
// Cannot create image
|
// Cannot create image
|
||||||
if(!ret)
|
if(!ret)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Error_creating_output_image_not_continuing);
|
|
||||||
_dumpLog.WriteLine(outputFormat.ErrorMessage);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
|
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
outputFormat.ErrorMessage);
|
outputFormat.ErrorMessage);
|
||||||
@@ -586,11 +546,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(!ret)
|
if(!ret)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Error_sending_tracks_to_output_image_not_continuing);
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(opticalPlugin.ErrorMessage);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.Error_sending_tracks_to_output_image_not_continuing +
|
.Error_sending_tracks_to_output_image_not_continuing +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
@@ -619,8 +574,6 @@ partial class Dump
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.The_specified_image_format_cannot_represent_optical_discs);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core
|
StoppingErrorMessage?.Invoke(Localization.Core
|
||||||
.The_specified_image_format_cannot_represent_optical_discs);
|
.The_specified_image_format_cannot_represent_optical_discs);
|
||||||
|
|
||||||
@@ -641,12 +594,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(!rigidPage.HasValue || setGeometry) continue;
|
if(!rigidPage.HasValue || setGeometry) continue;
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Setting_geometry_to_0_cylinders_1_heads_2_sectors_per_track,
|
|
||||||
rigidPage.Value.Cylinders,
|
|
||||||
rigidPage.Value.Heads,
|
|
||||||
(uint)(blocks / (rigidPage.Value.Cylinders * rigidPage.Value.Heads)));
|
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core
|
UpdateStatus?.Invoke(string.Format(Localization.Core
|
||||||
.Setting_geometry_to_0_cylinders_1_heads_2_sectors_per_track,
|
.Setting_geometry_to_0_cylinders_1_heads_2_sectors_per_track,
|
||||||
rigidPage.Value.Cylinders,
|
rigidPage.Value.Cylinders,
|
||||||
@@ -669,12 +616,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(!flexiblePage.HasValue) continue;
|
if(!flexiblePage.HasValue) continue;
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Setting_geometry_to_0_cylinders_1_heads_2_sectors_per_track,
|
|
||||||
flexiblePage.Value.Cylinders,
|
|
||||||
flexiblePage.Value.Heads,
|
|
||||||
flexiblePage.Value.SectorsPerTrack);
|
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core
|
UpdateStatus?.Invoke(string.Format(Localization.Core
|
||||||
.Setting_geometry_to_0_cylinders_1_heads_2_sectors_per_track,
|
.Setting_geometry_to_0_cylinders_1_heads_2_sectors_per_track,
|
||||||
flexiblePage.Value.Cylinders,
|
flexiblePage.Value.Cylinders,
|
||||||
@@ -700,9 +641,6 @@ partial class Dump
|
|||||||
// Cannot create image
|
// Cannot create image
|
||||||
if(!ret)
|
if(!ret)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Error_creating_output_image_not_continuing);
|
|
||||||
_dumpLog.WriteLine(outputFormat.ErrorMessage);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
|
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
outputFormat.ErrorMessage);
|
outputFormat.ErrorMessage);
|
||||||
@@ -712,8 +650,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(writeSingleOpticalTrack)
|
if(writeSingleOpticalTrack)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Creating_single_track_as_could_not_retrieve_track_list_from_drive);
|
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core
|
UpdateStatus?.Invoke(Localization.Core
|
||||||
.Creating_single_track_as_could_not_retrieve_track_list_from_drive);
|
.Creating_single_track_as_could_not_retrieve_track_list_from_drive);
|
||||||
|
|
||||||
@@ -781,24 +717,15 @@ partial class Dump
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(_resume.NextBlock > 0)
|
if(_resume.NextBlock > 0)
|
||||||
{
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Resuming_from_block_0, _resume.NextBlock));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Resuming_from_block_0, _resume.NextBlock));
|
||||||
_dumpLog.WriteLine(Localization.Core.Resuming_from_block_0, _resume.NextBlock);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set speed
|
// Set speed
|
||||||
if(_speedMultiplier >= 0)
|
if(_speedMultiplier >= 0)
|
||||||
{
|
{
|
||||||
if(_speed == 0)
|
if(_speed == 0)
|
||||||
{
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Setting_speed_to_MAX);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Setting_speed_to_MAX);
|
UpdateStatus?.Invoke(Localization.Core.Setting_speed_to_MAX);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Setting_speed_to_0_x, _speed));
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Setting_speed_to_0_x, _speed));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Setting_speed_to_0_x, _speed));
|
||||||
}
|
|
||||||
|
|
||||||
_speed *= _speedMultiplier;
|
_speed *= _speedMultiplier;
|
||||||
|
|
||||||
@@ -906,18 +833,6 @@ partial class Dump
|
|||||||
.Per(imageWriteDuration.Seconds())
|
.Per(imageWriteDuration.Seconds())
|
||||||
.Humanize()));
|
.Humanize()));
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Dump_finished_in_0,
|
|
||||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_dump_speed_0,
|
|
||||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
|
||||||
.Per(totalDuration.Milliseconds())
|
|
||||||
.Humanize()));
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_write_speed_0,
|
|
||||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
|
||||||
.Per(imageWriteDuration.Seconds())
|
|
||||||
.Humanize()));
|
|
||||||
|
|
||||||
#region Trimming
|
#region Trimming
|
||||||
|
|
||||||
@@ -927,7 +842,6 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
_trimStopwatch.Restart();
|
_trimStopwatch.Restart();
|
||||||
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
|
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
|
||||||
_dumpLog.WriteLine(Localization.Core.Trimming_skipped_sectors);
|
|
||||||
|
|
||||||
InitProgress?.Invoke();
|
InitProgress?.Invoke();
|
||||||
|
|
||||||
@@ -939,9 +853,6 @@ partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Trimming_finished_in_0,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Trimming_finished_in_0,
|
||||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Trimming_finished_in_0,
|
|
||||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
|
||||||
|
|
||||||
_trimStopwatch.Stop();
|
_trimStopwatch.Stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -984,10 +895,6 @@ partial class Dump
|
|||||||
// Cannot write tag to image
|
// Cannot write tag to image
|
||||||
StoppingErrorMessage?.Invoke(string.Format(Localization.Core.Cannot_write_tag_0, tag.Key));
|
StoppingErrorMessage?.Invoke(string.Format(Localization.Core.Cannot_write_tag_0, tag.Key));
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Cannot_write_tag_0, tag.Key) +
|
|
||||||
Environment.NewLine +
|
|
||||||
outputFormat.ErrorMessage);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -998,13 +905,10 @@ partial class Dump
|
|||||||
if(_dev.IsUsb && _dev.UsbDescriptors != null)
|
if(_dev.IsUsb && _dev.UsbDescriptors != null)
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_USB_descriptors);
|
UpdateStatus?.Invoke(Localization.Core.Reading_USB_descriptors);
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_USB_descriptors);
|
|
||||||
ret = outputFormat.WriteMediaTag(_dev.UsbDescriptors, MediaTagType.USB_Descriptors);
|
ret = outputFormat.WriteMediaTag(_dev.UsbDescriptors, MediaTagType.USB_Descriptors);
|
||||||
|
|
||||||
if(!ret && !_force)
|
if(!ret && !_force)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_write_USB_descriptors);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_USB_descriptors +
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_USB_descriptors +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
outputFormat.ErrorMessage);
|
outputFormat.ErrorMessage);
|
||||||
@@ -1018,7 +922,6 @@ partial class Dump
|
|||||||
if(_dev.Type == DeviceType.ATAPI)
|
if(_dev.Type == DeviceType.ATAPI)
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(Localization.Core.Requesting_ATAPI_IDENTIFY_PACKET_DEVICE);
|
UpdateStatus?.Invoke(Localization.Core.Requesting_ATAPI_IDENTIFY_PACKET_DEVICE);
|
||||||
_dumpLog.WriteLine(Localization.Core.Requesting_ATAPI_IDENTIFY_PACKET_DEVICE);
|
|
||||||
sense = _dev.AtapiIdentify(out cmdBuf, out _);
|
sense = _dev.AtapiIdentify(out cmdBuf, out _);
|
||||||
|
|
||||||
if(!sense)
|
if(!sense)
|
||||||
@@ -1029,8 +932,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(!ret && !_force)
|
if(!ret && !_force)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_write_ATAPI_IDENTIFY_PACKET_DEVICE);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_ATAPI_IDENTIFY_PACKET_DEVICE +
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_ATAPI_IDENTIFY_PACKET_DEVICE +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
outputFormat.ErrorMessage);
|
outputFormat.ErrorMessage);
|
||||||
@@ -1045,22 +946,16 @@ partial class Dump
|
|||||||
if(!sense)
|
if(!sense)
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(Localization.Core.Requesting_SCSI_INQUIRY);
|
UpdateStatus?.Invoke(Localization.Core.Requesting_SCSI_INQUIRY);
|
||||||
_dumpLog.WriteLine(Localization.Core.Requesting_SCSI_INQUIRY);
|
|
||||||
ret = outputFormat.WriteMediaTag(cmdBuf, MediaTagType.SCSI_INQUIRY);
|
ret = outputFormat.WriteMediaTag(cmdBuf, MediaTagType.SCSI_INQUIRY);
|
||||||
|
|
||||||
if(!ret && !_force)
|
if(!ret && !_force)
|
||||||
{
|
{
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_SCSI_INQUIRY);
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_SCSI_INQUIRY);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_write_SCSI_INQUIRY +
|
|
||||||
Environment.NewLine +
|
|
||||||
outputFormat.ErrorMessage);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Requesting_MODE_SENSE_10);
|
UpdateStatus?.Invoke(Localization.Core.Requesting_MODE_SENSE_10);
|
||||||
_dumpLog.WriteLine(Localization.Core.Requesting_MODE_SENSE_10);
|
|
||||||
|
|
||||||
sense = _dev.ModeSense10(out cmdBuf,
|
sense = _dev.ModeSense10(out cmdBuf,
|
||||||
out _,
|
out _,
|
||||||
@@ -1093,8 +988,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(!ret && !_force)
|
if(!ret && !_force)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_write_SCSI_MODE_SENSE_10);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_SCSI_MODE_SENSE_10 +
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_SCSI_MODE_SENSE_10 +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
outputFormat.ErrorMessage);
|
outputFormat.ErrorMessage);
|
||||||
@@ -1105,7 +998,6 @@ partial class Dump
|
|||||||
}
|
}
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Requesting_MODE_SENSE_6);
|
UpdateStatus?.Invoke(Localization.Core.Requesting_MODE_SENSE_6);
|
||||||
_dumpLog.WriteLine(Localization.Core.Requesting_MODE_SENSE_6);
|
|
||||||
|
|
||||||
sense = _dev.ModeSense6(out cmdBuf,
|
sense = _dev.ModeSense6(out cmdBuf,
|
||||||
out _,
|
out _,
|
||||||
@@ -1138,8 +1030,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(!ret && !_force)
|
if(!ret && !_force)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_write_SCSI_MODE_SENSE_6);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_SCSI_MODE_SENSE_6 +
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_SCSI_MODE_SENSE_6 +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
outputFormat.ErrorMessage);
|
outputFormat.ErrorMessage);
|
||||||
@@ -1154,7 +1044,8 @@ partial class Dump
|
|||||||
|
|
||||||
_resume.BadBlocks.Sort();
|
_resume.BadBlocks.Sort();
|
||||||
|
|
||||||
foreach(ulong bad in _resume.BadBlocks) _dumpLog.WriteLine(Localization.Core.Sector_0_could_not_be_read, bad);
|
foreach(ulong bad in _resume.BadBlocks)
|
||||||
|
AaruLogging.WriteLine(Localization.Core.Sector_0_could_not_be_read, bad);
|
||||||
|
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
|
|
||||||
@@ -1177,7 +1068,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(_preSidecar != null) outputFormat.SetMetadata(_preSidecar);
|
if(_preSidecar != null) outputFormat.SetMetadata(_preSidecar);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Closing_output_file);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
||||||
_imageCloseStopwatch.Restart();
|
_imageCloseStopwatch.Restart();
|
||||||
outputFormat.Close();
|
outputFormat.Close();
|
||||||
@@ -1186,13 +1076,9 @@ partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Closed_in_0,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Closed_in_0,
|
||||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Closed_in_0,
|
|
||||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
|
||||||
|
|
||||||
if(_aborted)
|
if(_aborted)
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1207,7 +1093,6 @@ partial class Dump
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(Localization.Core.Creating_sidecar);
|
UpdateStatus?.Invoke(Localization.Core.Creating_sidecar);
|
||||||
_dumpLog.WriteLine(Localization.Core.Creating_sidecar);
|
|
||||||
IFilter filter = PluginRegister.Singleton.GetFilter(_outputPath);
|
IFilter filter = PluginRegister.Singleton.GetFilter(_outputPath);
|
||||||
var inputPlugin = ImageFormat.Detect(filter) as IMediaImage;
|
var inputPlugin = ImageFormat.Detect(filter) as IMediaImage;
|
||||||
ErrorNumber opened = inputPlugin.Open(filter);
|
ErrorNumber opened = inputPlugin.Open(filter);
|
||||||
@@ -1244,14 +1129,6 @@ partial class Dump
|
|||||||
.Per(totalChkDuration.Milliseconds())
|
.Per(totalChkDuration.Milliseconds())
|
||||||
.Humanize()));
|
.Humanize()));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Sidecar_created_in_0,
|
|
||||||
_sidecarStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Average_checksum_speed_0,
|
|
||||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
|
||||||
.Per(totalChkDuration.Milliseconds())
|
|
||||||
.Humanize());
|
|
||||||
|
|
||||||
if(_preSidecar != null)
|
if(_preSidecar != null)
|
||||||
{
|
{
|
||||||
_preSidecar.BlockMedias = sidecar.BlockMedias;
|
_preSidecar.BlockMedias = sidecar.BlockMedias;
|
||||||
@@ -1354,7 +1231,6 @@ partial class Dump
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Requesting_MODE_SENSE_10);
|
UpdateStatus?.Invoke(Localization.Core.Requesting_MODE_SENSE_10);
|
||||||
_dumpLog.WriteLine(Localization.Core.Requesting_MODE_SENSE_10);
|
|
||||||
|
|
||||||
sense = _dev.ModeSense10(out cmdBuf,
|
sense = _dev.ModeSense10(out cmdBuf,
|
||||||
out _,
|
out _,
|
||||||
@@ -1396,7 +1272,6 @@ partial class Dump
|
|||||||
}
|
}
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Requesting_MODE_SENSE_6);
|
UpdateStatus?.Invoke(Localization.Core.Requesting_MODE_SENSE_6);
|
||||||
_dumpLog.WriteLine(Localization.Core.Requesting_MODE_SENSE_6);
|
|
||||||
|
|
||||||
sense = _dev.ModeSense6(out cmdBuf,
|
sense = _dev.ModeSense6(out cmdBuf,
|
||||||
out _,
|
out _,
|
||||||
@@ -1461,10 +1336,6 @@ partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Found_filesystem_0_at_sector_1,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Found_filesystem_0_at_sector_1,
|
||||||
filesystem.type,
|
filesystem.type,
|
||||||
filesystem.start));
|
filesystem.start));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Found_filesystem_0_at_sector_1,
|
|
||||||
filesystem.type,
|
|
||||||
filesystem.start);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -223,7 +223,6 @@ partial class Dump
|
|||||||
}
|
}
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Sending_MODE_SELECT_to_drive_return_damaged_blocks);
|
UpdateStatus?.Invoke(Localization.Core.Sending_MODE_SELECT_to_drive_return_damaged_blocks);
|
||||||
_dumpLog.WriteLine(Localization.Core.Sending_MODE_SELECT_to_drive_return_damaged_blocks);
|
|
||||||
sense = _dev.ModeSelect(md6, out byte[] senseBuf, true, false, _dev.Timeout, out _);
|
sense = _dev.ModeSelect(md6, out byte[] senseBuf, true, false, _dev.Timeout, out _);
|
||||||
|
|
||||||
if(sense) sense = _dev.ModeSelect10(md10, out senseBuf, true, false, _dev.Timeout, out _);
|
if(sense) sense = _dev.ModeSelect10(md10, out senseBuf, true, false, _dev.Timeout, out _);
|
||||||
@@ -234,9 +233,6 @@ partial class Dump
|
|||||||
.Drive_did_not_accept_MODE_SELECT_command_for_persistent_error_reading);
|
.Drive_did_not_accept_MODE_SELECT_command_for_persistent_error_reading);
|
||||||
|
|
||||||
AaruLogging.Debug(Localization.Core.Error_0, Sense.PrettifySense(senseBuf));
|
AaruLogging.Debug(Localization.Core.Error_0, Sense.PrettifySense(senseBuf));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Drive_did_not_accept_MODE_SELECT_command_for_persistent_error_reading);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
runningPersistent = true;
|
runningPersistent = true;
|
||||||
@@ -252,7 +248,6 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -303,7 +298,6 @@ partial class Dump
|
|||||||
newBlank = true;
|
newBlank = true;
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Found_blank_block_0_in_pass_1, badSector, pass));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Found_blank_block_0_in_pass_1, badSector, pass));
|
||||||
_dumpLog.WriteLine(Localization.Core.Found_blank_block_0_in_pass_1, badSector, pass);
|
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -363,8 +357,6 @@ partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Correctly_retried_block_0_in_pass_1,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Correctly_retried_block_0_in_pass_1,
|
||||||
badSector,
|
badSector,
|
||||||
pass));
|
pass));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Correctly_retried_block_0_in_pass_1, badSector, pass);
|
|
||||||
}
|
}
|
||||||
else if(runningPersistent) outputFormat.WriteSector(buffer, badSector);
|
else if(runningPersistent) outputFormat.WriteSector(buffer, badSector);
|
||||||
}
|
}
|
||||||
@@ -392,7 +384,6 @@ partial class Dump
|
|||||||
md10 = Modes.EncodeMode10(md, _dev.ScsiType);
|
md10 = Modes.EncodeMode10(md, _dev.ScsiType);
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Sending_MODE_SELECT_to_drive_return_device_to_previous_status);
|
UpdateStatus?.Invoke(Localization.Core.Sending_MODE_SELECT_to_drive_return_device_to_previous_status);
|
||||||
_dumpLog.WriteLine(Localization.Core.Sending_MODE_SELECT_to_drive_return_device_to_previous_status);
|
|
||||||
sense = _dev.ModeSelect(md6, out _, true, false, _dev.Timeout, out _);
|
sense = _dev.ModeSelect(md6, out _, true, false, _dev.Timeout, out _);
|
||||||
|
|
||||||
if(sense) _dev.ModeSelect10(md10, out _, true, false, _dev.Timeout, out _);
|
if(sense) _dev.ModeSelect10(md10, out _, true, false, _dev.Timeout, out _);
|
||||||
@@ -422,7 +413,6 @@ partial class Dump
|
|||||||
if(_aborted)
|
if(_aborted)
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -465,8 +455,6 @@ partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Correctly_retried_title_key_0_in_pass_1,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Correctly_retried_title_key_0_in_pass_1,
|
||||||
missingKey,
|
missingKey,
|
||||||
pass));
|
pass));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Correctly_retried_title_key_0_in_pass_1, missingKey, pass);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -482,8 +470,6 @@ partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Correctly_retried_title_key_0_in_pass_1,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Correctly_retried_title_key_0_in_pass_1,
|
||||||
missingKey,
|
missingKey,
|
||||||
pass));
|
pass));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Correctly_retried_title_key_0_in_pass_1, missingKey, pass);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -101,7 +101,6 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
_resume.BlankExtents = null;
|
_resume.BlankExtents = null;
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -182,15 +181,13 @@ partial class Dump
|
|||||||
writtenExtents.Add(0, blocks - 1);
|
writtenExtents.Add(0, blocks - 1);
|
||||||
|
|
||||||
foreach(Tuple<ulong, ulong> blank in blankExtents.ToArray())
|
foreach(Tuple<ulong, ulong> blank in blankExtents.ToArray())
|
||||||
{
|
for(ulong b = blank.Item1; b <= blank.Item2; b++)
|
||||||
for(ulong b = blank.Item1; b <= blank.Item2; b++) writtenExtents.Remove(b);
|
writtenExtents.Remove(b);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(writtenExtents.Count == 0)
|
if(writtenExtents.Count == 0)
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(Localization.Core.Cannot_dump_empty_media);
|
UpdateStatus?.Invoke(Localization.Core.Cannot_dump_empty_media);
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_dump_empty_media);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -215,7 +212,6 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -262,7 +258,7 @@ partial class Dump
|
|||||||
mhddLog.Write(i, cmdDuration < 500 ? 65535 : cmdDuration, _skip);
|
mhddLog.Write(i, cmdDuration < 500 ? 65535 : cmdDuration, _skip);
|
||||||
|
|
||||||
ibgLog.Write(i, 0);
|
ibgLog.Write(i, 0);
|
||||||
_dumpLog.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
AaruLogging.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
||||||
i += _skip - blocksToRead;
|
i += _skip - blocksToRead;
|
||||||
newTrim = true;
|
newTrim = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,14 +44,15 @@ partial class Dump
|
|||||||
/// <param name="extents">Correctly dump extents</param>
|
/// <param name="extents">Correctly dump extents</param>
|
||||||
/// <param name="currentTry">Resume information</param>
|
/// <param name="currentTry">Resume information</param>
|
||||||
/// <param name="blankExtents">Blank extents</param>
|
/// <param name="blankExtents">Blank extents</param>
|
||||||
void TrimSbcData(Reader scsiReader, ExtentsULong extents, DumpHardware currentTry, ExtentsULong blankExtents, byte[] discKey)
|
void TrimSbcData(Reader scsiReader, ExtentsULong extents, DumpHardware currentTry, ExtentsULong blankExtents,
|
||||||
|
byte[] discKey)
|
||||||
{
|
{
|
||||||
ulong[] tmpArray = _resume.BadBlocks.ToArray();
|
ulong[] tmpArray = _resume.BadBlocks.ToArray();
|
||||||
bool sense;
|
bool sense;
|
||||||
bool recoveredError;
|
bool recoveredError;
|
||||||
bool blankCheck;
|
bool blankCheck;
|
||||||
byte[] buffer;
|
byte[] buffer;
|
||||||
var newBlank = false;
|
bool newBlank = false;
|
||||||
|
|
||||||
if(_outputPlugin is not IWritableImage outputFormat)
|
if(_outputPlugin is not IWritableImage outputFormat)
|
||||||
{
|
{
|
||||||
@@ -66,7 +67,6 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -82,7 +82,6 @@ partial class Dump
|
|||||||
_resume.BadBlocks.Remove(badSector);
|
_resume.BadBlocks.Remove(badSector);
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Found_blank_block_0, badSector));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Found_blank_block_0, badSector));
|
||||||
_dumpLog.WriteLine(Localization.Core.Found_blank_block_0, badSector);
|
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ using Aaru.Core.Graphics;
|
|||||||
using Aaru.Core.Logging;
|
using Aaru.Core.Logging;
|
||||||
using Aaru.Decoders.MMC;
|
using Aaru.Decoders.MMC;
|
||||||
using Aaru.Decoders.SecureDigital;
|
using Aaru.Decoders.SecureDigital;
|
||||||
|
using Aaru.Logging;
|
||||||
using Humanizer;
|
using Humanizer;
|
||||||
using Humanizer.Bytes;
|
using Humanizer.Bytes;
|
||||||
using Humanizer.Localisation;
|
using Humanizer.Localisation;
|
||||||
@@ -86,9 +87,9 @@ public partial class Dump
|
|||||||
byte[] ecsd = null;
|
byte[] ecsd = null;
|
||||||
byte[] scr = null;
|
byte[] scr = null;
|
||||||
uint physicalBlockSize = 0;
|
uint physicalBlockSize = 0;
|
||||||
var byteAddressed = true;
|
bool byteAddressed = true;
|
||||||
uint[] response;
|
uint[] response;
|
||||||
var supportsCmd23 = false;
|
bool supportsCmd23 = false;
|
||||||
var outputFormat = _outputPlugin as IWritableImage;
|
var outputFormat = _outputPlugin as IWritableImage;
|
||||||
|
|
||||||
Dictionary<MediaTagType, byte[]> mediaTags = new();
|
Dictionary<MediaTagType, byte[]> mediaTags = new();
|
||||||
@@ -98,7 +99,6 @@ public partial class Dump
|
|||||||
case DeviceType.MMC:
|
case DeviceType.MMC:
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_CSD);
|
UpdateStatus?.Invoke(Localization.Core.Reading_CSD);
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_CSD);
|
|
||||||
sense = _dev.ReadCsd(out csd, out response, timeout, out duration);
|
sense = _dev.ReadCsd(out csd, out response, timeout, out duration);
|
||||||
|
|
||||||
if(!sense)
|
if(!sense)
|
||||||
@@ -115,7 +115,6 @@ public partial class Dump
|
|||||||
if(csdDecoded.Size == 0xFFF)
|
if(csdDecoded.Size == 0xFFF)
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_Extended_CSD);
|
UpdateStatus?.Invoke(Localization.Core.Reading_Extended_CSD);
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_Extended_CSD);
|
|
||||||
sense = _dev.ReadExtendedCsd(out ecsd, out response, timeout, out duration);
|
sense = _dev.ReadExtendedCsd(out ecsd, out response, timeout, out duration);
|
||||||
|
|
||||||
if(!sense)
|
if(!sense)
|
||||||
@@ -153,7 +152,6 @@ public partial class Dump
|
|||||||
}
|
}
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_OCR);
|
UpdateStatus?.Invoke(Localization.Core.Reading_OCR);
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_OCR);
|
|
||||||
sense = _dev.ReadOcr(out ocr, out response, timeout, out duration);
|
sense = _dev.ReadOcr(out ocr, out response, timeout, out duration);
|
||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
@@ -170,7 +168,6 @@ public partial class Dump
|
|||||||
case DeviceType.SecureDigital:
|
case DeviceType.SecureDigital:
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_CSD);
|
UpdateStatus?.Invoke(Localization.Core.Reading_CSD);
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_CSD);
|
|
||||||
sense = _dev.ReadCsd(out csd, out response, timeout, out duration);
|
sense = _dev.ReadCsd(out csd, out response, timeout, out duration);
|
||||||
|
|
||||||
if(!sense)
|
if(!sense)
|
||||||
@@ -203,7 +200,6 @@ public partial class Dump
|
|||||||
}
|
}
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_OCR);
|
UpdateStatus?.Invoke(Localization.Core.Reading_OCR);
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_OCR);
|
|
||||||
sense = _dev.ReadSdocr(out ocr, out response, timeout, out duration);
|
sense = _dev.ReadSdocr(out ocr, out response, timeout, out duration);
|
||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
@@ -215,7 +211,6 @@ public partial class Dump
|
|||||||
mediaTags.Add(MediaTagType.SD_OCR, null);
|
mediaTags.Add(MediaTagType.SD_OCR, null);
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_SCR);
|
UpdateStatus?.Invoke(Localization.Core.Reading_SCR);
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_SCR);
|
|
||||||
sense = _dev.ReadScr(out scr, out response, timeout, out duration);
|
sense = _dev.ReadScr(out scr, out response, timeout, out duration);
|
||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
@@ -237,7 +232,6 @@ public partial class Dump
|
|||||||
}
|
}
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_CID);
|
UpdateStatus?.Invoke(Localization.Core.Reading_CID);
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_CID);
|
|
||||||
sense = _dev.ReadCid(out byte[] cid, out response, timeout, out duration);
|
sense = _dev.ReadCid(out byte[] cid, out response, timeout, out duration);
|
||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
@@ -255,14 +249,12 @@ public partial class Dump
|
|||||||
|
|
||||||
if(blocks == 0)
|
if(blocks == 0)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Unable_to_get_device_size);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Unable_to_get_device_size);
|
StoppingErrorMessage?.Invoke(Localization.Core.Unable_to_get_device_size);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Device_reports_0_blocks, blocks));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Device_reports_0_blocks, blocks));
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_reports_0_blocks, blocks);
|
|
||||||
|
|
||||||
byte[] cmdBuf;
|
byte[] cmdBuf;
|
||||||
bool error;
|
bool error;
|
||||||
@@ -306,8 +298,6 @@ public partial class Dump
|
|||||||
|
|
||||||
if(error)
|
if(error)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.ERROR_Cannot_get_blocks_to_read_device_error_0, _dev.LastError);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(string.Format(Localization.Core
|
StoppingErrorMessage?.Invoke(string.Format(Localization.Core
|
||||||
.Device_error_0_trying_to_guess_ideal_transfer_length,
|
.Device_error_0_trying_to_guess_ideal_transfer_length,
|
||||||
_dev.LastError));
|
_dev.LastError));
|
||||||
@@ -333,7 +323,6 @@ public partial class Dump
|
|||||||
if(error)
|
if(error)
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(Localization.Core.DumBuffered_OS_reads_are_not_working_trying_direct_commands);
|
UpdateStatus?.Invoke(Localization.Core.DumBuffered_OS_reads_are_not_working_trying_direct_commands);
|
||||||
_dumpLog.WriteLine(Localization.Core.DumBuffered_OS_reads_are_not_working_trying_direct_commands);
|
|
||||||
blocksToRead = 1;
|
blocksToRead = 1;
|
||||||
_useBufferedReads = false;
|
_useBufferedReads = false;
|
||||||
}
|
}
|
||||||
@@ -362,8 +351,6 @@ public partial class Dump
|
|||||||
|
|
||||||
if(error)
|
if(error)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.ERROR_Cannot_get_blocks_to_read_device_error_0, _dev.LastError);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(string.Format(Localization.Core
|
StoppingErrorMessage?.Invoke(string.Format(Localization.Core
|
||||||
.Device_error_0_trying_to_guess_ideal_transfer_length,
|
.Device_error_0_trying_to_guess_ideal_transfer_length,
|
||||||
_dev.LastError));
|
_dev.LastError));
|
||||||
@@ -378,8 +365,6 @@ public partial class Dump
|
|||||||
|
|
||||||
if(error)
|
if(error)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.ERROR_Could_not_read_from_device_device_error_0, _dev.LastError);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(string.Format(Localization.Core.Device_error_0_trying_to_read_from_device,
|
StoppingErrorMessage?.Invoke(string.Format(Localization.Core.Device_error_0_trying_to_read_from_device,
|
||||||
_dev.LastError));
|
_dev.LastError));
|
||||||
|
|
||||||
@@ -388,25 +373,17 @@ public partial class Dump
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(supportsCmd23 || blocksToRead == 1)
|
if(supportsCmd23 || blocksToRead == 1)
|
||||||
{
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Device_can_read_0_blocks_at_a_time, blocksToRead));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Device_can_read_0_blocks_at_a_time, blocksToRead));
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_can_read_0_blocks_at_a_time, blocksToRead);
|
|
||||||
}
|
|
||||||
else if(_useBufferedReads)
|
else if(_useBufferedReads)
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core
|
UpdateStatus?.Invoke(string.Format(Localization.Core
|
||||||
.Device_can_read_0_blocks_at_a_time_using_OS_buffered_reads,
|
.Device_can_read_0_blocks_at_a_time_using_OS_buffered_reads,
|
||||||
blocksToRead));
|
blocksToRead));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_can_read_0_blocks_at_a_time_using_OS_buffered_reads,
|
|
||||||
blocksToRead);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Device_can_read_0_blocks_using_sequential_commands,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Device_can_read_0_blocks_using_sequential_commands,
|
||||||
blocksToRead));
|
blocksToRead));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_can_read_0_blocks_using_sequential_commands, blocksToRead);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_skip < blocksToRead) _skip = blocksToRead;
|
if(_skip < blocksToRead) _skip = blocksToRead;
|
||||||
@@ -435,25 +412,20 @@ public partial class Dump
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var ret = true;
|
bool ret = true;
|
||||||
|
|
||||||
foreach(MediaTagType tag in mediaTags.Keys.Where(tag => !outputFormat.SupportedMediaTags.Contains(tag)))
|
foreach(MediaTagType tag in mediaTags.Keys.Where(tag => !outputFormat.SupportedMediaTags.Contains(tag)))
|
||||||
{
|
{
|
||||||
ret = false;
|
ret = false;
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Output_format_does_not_support_0, tag));
|
|
||||||
ErrorMessage?.Invoke(string.Format(Localization.Core.Output_format_does_not_support_0, tag));
|
ErrorMessage?.Invoke(string.Format(Localization.Core.Output_format_does_not_support_0, tag));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!ret)
|
if(!ret)
|
||||||
{
|
{
|
||||||
if(_force)
|
if(_force)
|
||||||
{
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Several_media_tags_not_supported_continuing);
|
|
||||||
ErrorMessage?.Invoke(Localization.Core.Several_media_tags_not_supported_continuing);
|
ErrorMessage?.Invoke(Localization.Core.Several_media_tags_not_supported_continuing);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Several_media_tags_not_supported_not_continuing);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Several_media_tags_not_supported_not_continuing);
|
StoppingErrorMessage?.Invoke(Localization.Core.Several_media_tags_not_supported_not_continuing);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -479,9 +451,6 @@ public partial class Dump
|
|||||||
// Cannot create image
|
// Cannot create image
|
||||||
if(!ret)
|
if(!ret)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Error_creating_output_image_not_continuing);
|
|
||||||
_dumpLog.WriteLine(outputFormat.ErrorMessage);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
|
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
outputFormat.ErrorMessage);
|
outputFormat.ErrorMessage);
|
||||||
@@ -522,8 +491,6 @@ public partial class Dump
|
|||||||
// Cannot write CID to image
|
// Cannot write CID to image
|
||||||
if(!ret && !_force)
|
if(!ret && !_force)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_write_CID_to_output_image);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_CID_to_output_image +
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_CID_to_output_image +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
outputFormat.ErrorMessage);
|
outputFormat.ErrorMessage);
|
||||||
@@ -542,8 +509,6 @@ public partial class Dump
|
|||||||
// Cannot write CSD to image
|
// Cannot write CSD to image
|
||||||
if(!ret && !_force)
|
if(!ret && !_force)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_write_CSD_to_output_image);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_CSD_to_output_image +
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_CSD_to_output_image +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
outputFormat.ErrorMessage);
|
outputFormat.ErrorMessage);
|
||||||
@@ -559,8 +524,6 @@ public partial class Dump
|
|||||||
// Cannot write Extended CSD to image
|
// Cannot write Extended CSD to image
|
||||||
if(!ret && !_force)
|
if(!ret && !_force)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_write_Extended_CSD_to_output_image);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_Extended_CSD_to_output_image +
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_Extended_CSD_to_output_image +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
outputFormat.ErrorMessage);
|
outputFormat.ErrorMessage);
|
||||||
@@ -579,8 +542,6 @@ public partial class Dump
|
|||||||
// Cannot write OCR to image
|
// Cannot write OCR to image
|
||||||
if(!ret && !_force)
|
if(!ret && !_force)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_write_OCR_to_output_image);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_OCR_to_output_image +
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_OCR_to_output_image +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
outputFormat.ErrorMessage);
|
outputFormat.ErrorMessage);
|
||||||
@@ -596,8 +557,6 @@ public partial class Dump
|
|||||||
// Cannot write SCR to image
|
// Cannot write SCR to image
|
||||||
if(!ret && !_force)
|
if(!ret && !_force)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_write_SCR_to_output_image);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_SCR_to_output_image +
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_write_SCR_to_output_image +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
outputFormat.ErrorMessage);
|
outputFormat.ErrorMessage);
|
||||||
@@ -607,10 +566,7 @@ public partial class Dump
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(_resume.NextBlock > 0)
|
if(_resume.NextBlock > 0)
|
||||||
{
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Resuming_from_block_0, _resume.NextBlock));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Resuming_from_block_0, _resume.NextBlock));
|
||||||
_dumpLog.WriteLine(Localization.Core.Resuming_from_block_0, _resume.NextBlock);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(_createGraph)
|
if(_createGraph)
|
||||||
{
|
{
|
||||||
@@ -636,7 +592,7 @@ public partial class Dump
|
|||||||
_dumpStopwatch.Restart();
|
_dumpStopwatch.Restart();
|
||||||
_speedStopwatch.Reset();
|
_speedStopwatch.Reset();
|
||||||
double imageWriteDuration = 0;
|
double imageWriteDuration = 0;
|
||||||
var newTrim = false;
|
bool newTrim = false;
|
||||||
ulong sectorSpeedStart = 0;
|
ulong sectorSpeedStart = 0;
|
||||||
|
|
||||||
InitProgress?.Invoke();
|
InitProgress?.Invoke();
|
||||||
@@ -647,7 +603,6 @@ public partial class Dump
|
|||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -728,7 +683,7 @@ public partial class Dump
|
|||||||
_writeStopwatch.Restart();
|
_writeStopwatch.Restart();
|
||||||
outputFormat.WriteSectors(new byte[blockSize * _skip], i, _skip);
|
outputFormat.WriteSectors(new byte[blockSize * _skip], i, _skip);
|
||||||
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
|
||||||
_dumpLog.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
AaruLogging.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
||||||
i += _skip - blocksToRead;
|
i += _skip - blocksToRead;
|
||||||
newTrim = true;
|
newTrim = true;
|
||||||
}
|
}
|
||||||
@@ -774,18 +729,6 @@ public partial class Dump
|
|||||||
.Per(imageWriteDuration.Seconds())
|
.Per(imageWriteDuration.Seconds())
|
||||||
.Humanize()));
|
.Humanize()));
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Dump_finished_in_0,
|
|
||||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_dump_speed_0,
|
|
||||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
|
||||||
.Per(totalDuration.Milliseconds())
|
|
||||||
.Humanize()));
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_dump_speed_0,
|
|
||||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
|
||||||
.Per(imageWriteDuration.Seconds())
|
|
||||||
.Humanize()));
|
|
||||||
|
|
||||||
#region Trimming
|
#region Trimming
|
||||||
|
|
||||||
@@ -793,7 +736,6 @@ public partial class Dump
|
|||||||
{
|
{
|
||||||
_trimStopwatch.Restart();
|
_trimStopwatch.Restart();
|
||||||
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
|
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
|
||||||
_dumpLog.WriteLine(Localization.Core.Trimming_skipped_sectors);
|
|
||||||
|
|
||||||
ulong[] tmpArray = _resume.BadBlocks.ToArray();
|
ulong[] tmpArray = _resume.BadBlocks.ToArray();
|
||||||
InitProgress?.Invoke();
|
InitProgress?.Invoke();
|
||||||
@@ -804,7 +746,6 @@ public partial class Dump
|
|||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -839,9 +780,6 @@ public partial class Dump
|
|||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Trimming_finished_in_0,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Trimming_finished_in_0,
|
||||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Trimming_finished_in_0,
|
|
||||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Trimming
|
#endregion Trimming
|
||||||
@@ -850,8 +788,8 @@ public partial class Dump
|
|||||||
|
|
||||||
if(_resume.BadBlocks.Count > 0 && !_aborted && _retryPasses > 0)
|
if(_resume.BadBlocks.Count > 0 && !_aborted && _retryPasses > 0)
|
||||||
{
|
{
|
||||||
var pass = 1;
|
int pass = 1;
|
||||||
var forward = true;
|
bool forward = true;
|
||||||
|
|
||||||
InitProgress?.Invoke();
|
InitProgress?.Invoke();
|
||||||
repeatRetryLba:
|
repeatRetryLba:
|
||||||
@@ -863,7 +801,6 @@ public partial class Dump
|
|||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -901,8 +838,6 @@ public partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Correctly_retried_block_0_in_pass_1,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Correctly_retried_block_0_in_pass_1,
|
||||||
badSector,
|
badSector,
|
||||||
pass));
|
pass));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Correctly_retried_block_0_in_pass_1, badSector, pass);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(pass < _retryPasses && !_aborted && _resume.BadBlocks.Count > 0)
|
if(pass < _retryPasses && !_aborted && _resume.BadBlocks.Count > 0)
|
||||||
@@ -941,7 +876,6 @@ public partial class Dump
|
|||||||
|
|
||||||
if(_preSidecar != null) outputFormat.SetMetadata(_preSidecar);
|
if(_preSidecar != null) outputFormat.SetMetadata(_preSidecar);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Closing_output_file);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
||||||
_imageCloseStopwatch.Restart();
|
_imageCloseStopwatch.Restart();
|
||||||
outputFormat.Close();
|
outputFormat.Close();
|
||||||
@@ -950,13 +884,10 @@ public partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Closed_in_0,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Closed_in_0,
|
||||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Closed_in_0,
|
|
||||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
|
||||||
|
|
||||||
if(_aborted)
|
if(_aborted)
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -966,7 +897,6 @@ public partial class Dump
|
|||||||
if(_metadata)
|
if(_metadata)
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(Localization.Core.Creating_sidecar);
|
UpdateStatus?.Invoke(Localization.Core.Creating_sidecar);
|
||||||
_dumpLog.WriteLine(Localization.Core.Creating_sidecar);
|
|
||||||
IFilter filter = PluginRegister.Singleton.GetFilter(_outputPath);
|
IFilter filter = PluginRegister.Singleton.GetFilter(_outputPath);
|
||||||
var inputPlugin = ImageFormat.Detect(filter) as IMediaImage;
|
var inputPlugin = ImageFormat.Detect(filter) as IMediaImage;
|
||||||
ErrorNumber opened = inputPlugin.Open(filter);
|
ErrorNumber opened = inputPlugin.Open(filter);
|
||||||
@@ -1004,14 +934,6 @@ public partial class Dump
|
|||||||
.Per(totalChkDuration.Milliseconds())
|
.Per(totalChkDuration.Milliseconds())
|
||||||
.Humanize()));
|
.Humanize()));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Sidecar_created_in_0,
|
|
||||||
_sidecarStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Average_checksum_speed_0,
|
|
||||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
|
||||||
.Per(totalChkDuration.Milliseconds())
|
|
||||||
.Humanize());
|
|
||||||
|
|
||||||
(string type, string subType) xmlType = (null, null);
|
(string type, string subType) xmlType = (null, null);
|
||||||
|
|
||||||
switch(_dev.Type)
|
switch(_dev.Type)
|
||||||
|
|||||||
@@ -91,9 +91,8 @@ partial class Dump
|
|||||||
if(!isAdmin)
|
if(!isAdmin)
|
||||||
{
|
{
|
||||||
AaruLogging.Error(Localization.Core
|
AaruLogging.Error(Localization.Core
|
||||||
.Because_of_commands_sent_dumping_XGD_must_be_administrative_Cannot_continue);
|
.Because_of_commands_sent_dumping_XGD_must_be_administrative_Cannot_continue);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_dump_XGD_without_administrative_privileges);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -108,7 +107,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_get_disc_capacity);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_get_disc_capacity);
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_get_disc_capacity);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -127,31 +125,26 @@ partial class Dump
|
|||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_get_PFI);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_get_PFI);
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_get_PFI);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_Xbox_Security_Sector);
|
UpdateStatus?.Invoke(Localization.Core.Reading_Xbox_Security_Sector);
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_Xbox_Security_Sector);
|
|
||||||
sense = _dev.KreonExtractSs(out byte[] ssBuf, out senseBuf, _dev.Timeout, out _);
|
sense = _dev.KreonExtractSs(out byte[] ssBuf, out senseBuf, _dev.Timeout, out _);
|
||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_get_Xbox_Security_Sector_not_continuing);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_get_Xbox_Security_Sector_not_continuing);
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_get_Xbox_Security_Sector_not_continuing);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Decoding_Xbox_Security_Sector);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Decoding_Xbox_Security_Sector);
|
UpdateStatus?.Invoke(Localization.Core.Decoding_Xbox_Security_Sector);
|
||||||
SS.SecuritySector? xboxSs = SS.Decode(ssBuf);
|
SS.SecuritySector? xboxSs = SS.Decode(ssBuf);
|
||||||
|
|
||||||
if(!xboxSs.HasValue)
|
if(!xboxSs.HasValue)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_decode_Xbox_Security_Sector_not_continuing);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_decode_Xbox_Security_Sector_not_continuing);
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_decode_Xbox_Security_Sector_not_continuing);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -164,26 +157,22 @@ partial class Dump
|
|||||||
// Get video partition size
|
// Get video partition size
|
||||||
AaruLogging.Debug(MODULE_NAME, Localization.Core.Getting_video_partition_size);
|
AaruLogging.Debug(MODULE_NAME, Localization.Core.Getting_video_partition_size);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Locking_drive);
|
UpdateStatus?.Invoke(Localization.Core.Locking_drive);
|
||||||
_dumpLog.WriteLine(Localization.Core.Locking_drive);
|
|
||||||
sense = _dev.KreonLock(out senseBuf, _dev.Timeout, out _);
|
sense = _dev.KreonLock(out senseBuf, _dev.Timeout, out _);
|
||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
_errorLog?.WriteLine("Kreon lock", _dev.Error, _dev.LastError, senseBuf);
|
_errorLog?.WriteLine("Kreon lock", _dev.Error, _dev.LastError, senseBuf);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_lock_drive_not_continuing);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_lock_drive_not_continuing);
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_lock_drive_not_continuing);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Getting_video_partition_size);
|
UpdateStatus?.Invoke(Localization.Core.Getting_video_partition_size);
|
||||||
_dumpLog.WriteLine(Localization.Core.Getting_video_partition_size);
|
|
||||||
sense = _dev.ReadCapacity(out byte[] readBuffer, out senseBuf, _dev.Timeout, out _);
|
sense = _dev.ReadCapacity(out byte[] readBuffer, out senseBuf, _dev.Timeout, out _);
|
||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_get_disc_capacity);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_get_disc_capacity);
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_get_disc_capacity);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -193,7 +182,6 @@ partial class Dump
|
|||||||
(ulong)((readBuffer[0] << 24) + (readBuffer[1] << 16) + (readBuffer[2] << 8) + readBuffer[3]) & 0xFFFFFFFF;
|
(ulong)((readBuffer[0] << 24) + (readBuffer[1] << 16) + (readBuffer[2] << 8) + readBuffer[3]) & 0xFFFFFFFF;
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_Physical_Format_Information);
|
UpdateStatus?.Invoke(Localization.Core.Reading_Physical_Format_Information);
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_Physical_Format_Information);
|
|
||||||
|
|
||||||
sense = _dev.ReadDiscStructure(out readBuffer,
|
sense = _dev.ReadDiscStructure(out readBuffer,
|
||||||
out senseBuf,
|
out senseBuf,
|
||||||
@@ -207,7 +195,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_get_PFI);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_get_PFI);
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_get_PFI);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -225,7 +212,6 @@ partial class Dump
|
|||||||
|
|
||||||
ulong l1Video = totalSize - l0Video + 1;
|
ulong l1Video = totalSize - l0Video + 1;
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_Disc_Manufacturing_Information);
|
UpdateStatus?.Invoke(Localization.Core.Reading_Disc_Manufacturing_Information);
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_Disc_Manufacturing_Information);
|
|
||||||
|
|
||||||
sense = _dev.ReadDiscStructure(out readBuffer,
|
sense = _dev.ReadDiscStructure(out readBuffer,
|
||||||
out senseBuf,
|
out senseBuf,
|
||||||
@@ -239,7 +225,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_get_DMI);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_get_DMI);
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_get_DMI);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -253,7 +238,6 @@ partial class Dump
|
|||||||
if(totalSize > 300000)
|
if(totalSize > 300000)
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(Localization.Core.Video_partition_is_too_big_did_lock_work_Trying_cold_values);
|
UpdateStatus?.Invoke(Localization.Core.Video_partition_is_too_big_did_lock_work_Trying_cold_values);
|
||||||
_dumpLog.WriteLine(Localization.Core.Video_partition_is_too_big_did_lock_work_Trying_cold_values);
|
|
||||||
|
|
||||||
totalSize = (ulong)((coldReadCapacity[0] << 24) +
|
totalSize = (ulong)((coldReadCapacity[0] << 24) +
|
||||||
(coldReadCapacity[1] << 16) +
|
(coldReadCapacity[1] << 16) +
|
||||||
@@ -276,8 +260,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(totalSize > 300000)
|
if(totalSize > 300000)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_get_video_partition_size_not_continuing);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_get_video_partition_size_not_continuing);
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_get_video_partition_size_not_continuing);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -287,25 +269,21 @@ partial class Dump
|
|||||||
// Get game partition size
|
// Get game partition size
|
||||||
AaruLogging.Debug(MODULE_NAME, Localization.Core.Getting_game_partition_size);
|
AaruLogging.Debug(MODULE_NAME, Localization.Core.Getting_game_partition_size);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Unlocking_drive_Xtreme_);
|
UpdateStatus?.Invoke(Localization.Core.Unlocking_drive_Xtreme_);
|
||||||
_dumpLog.WriteLine(Localization.Core.Unlocking_drive_Xtreme_);
|
|
||||||
sense = _dev.KreonUnlockXtreme(out senseBuf, _dev.Timeout, out _);
|
sense = _dev.KreonUnlockXtreme(out senseBuf, _dev.Timeout, out _);
|
||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
_errorLog?.WriteLine("Kreon Xtreme unlock", _dev.Error, _dev.LastError, senseBuf);
|
_errorLog?.WriteLine("Kreon Xtreme unlock", _dev.Error, _dev.LastError, senseBuf);
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_unlock_drive_not_continuing);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_unlock_drive_not_continuing);
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_unlock_drive_not_continuing);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Getting_game_partition_size);
|
UpdateStatus?.Invoke(Localization.Core.Getting_game_partition_size);
|
||||||
_dumpLog.WriteLine(Localization.Core.Getting_game_partition_size);
|
|
||||||
sense = _dev.ReadCapacity(out readBuffer, out senseBuf, _dev.Timeout, out _);
|
sense = _dev.ReadCapacity(out readBuffer, out senseBuf, _dev.Timeout, out _);
|
||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_get_disc_capacity);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_get_disc_capacity);
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_get_disc_capacity);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -321,25 +299,21 @@ partial class Dump
|
|||||||
// Get middle zone size
|
// Get middle zone size
|
||||||
AaruLogging.Debug(MODULE_NAME, Localization.Core.Getting_middle_zone_size);
|
AaruLogging.Debug(MODULE_NAME, Localization.Core.Getting_middle_zone_size);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Unlocking_drive_Wxripper);
|
UpdateStatus?.Invoke(Localization.Core.Unlocking_drive_Wxripper);
|
||||||
_dumpLog.WriteLine(Localization.Core.Unlocking_drive_Wxripper);
|
|
||||||
sense = _dev.KreonUnlockWxripper(out senseBuf, _dev.Timeout, out _);
|
sense = _dev.KreonUnlockWxripper(out senseBuf, _dev.Timeout, out _);
|
||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
_errorLog?.WriteLine("Kreon Wxripper unlock", _dev.Error, _dev.LastError, senseBuf);
|
_errorLog?.WriteLine("Kreon Wxripper unlock", _dev.Error, _dev.LastError, senseBuf);
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_unlock_drive_not_continuing);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_unlock_drive_not_continuing);
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_unlock_drive_not_continuing);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Getting_disc_size);
|
UpdateStatus?.Invoke(Localization.Core.Getting_disc_size);
|
||||||
_dumpLog.WriteLine(Localization.Core.Getting_disc_size);
|
|
||||||
sense = _dev.ReadCapacity(out readBuffer, out senseBuf, _dev.Timeout, out _);
|
sense = _dev.ReadCapacity(out readBuffer, out senseBuf, _dev.Timeout, out _);
|
||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_get_disc_capacity);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_get_disc_capacity);
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_get_disc_capacity);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -349,7 +323,6 @@ partial class Dump
|
|||||||
0xFFFFFFFF;
|
0xFFFFFFFF;
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_Physical_Format_Information);
|
UpdateStatus?.Invoke(Localization.Core.Reading_Physical_Format_Information);
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_Physical_Format_Information);
|
|
||||||
|
|
||||||
sense = _dev.ReadDiscStructure(out readBuffer,
|
sense = _dev.ReadDiscStructure(out readBuffer,
|
||||||
out senseBuf,
|
out senseBuf,
|
||||||
@@ -363,7 +336,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_get_PFI);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_get_PFI);
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_get_PFI);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -376,7 +348,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(wxRipperPfiNullable == null)
|
if(wxRipperPfiNullable == null)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_decode_PFI);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_decode_PFI);
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_decode_PFI);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -391,11 +362,6 @@ partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.WxRipper_PFI_Layer_0_End_PSN_0_sectors,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.WxRipper_PFI_Layer_0_End_PSN_0_sectors,
|
||||||
wxRipperPfi.Layer0EndPSN));
|
wxRipperPfi.Layer0EndPSN));
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.WxRipper_PFI_Data_Area_Start_PSN_0_sectors,
|
|
||||||
wxRipperPfi.DataAreaStartPSN));
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.WxRipper_PFI_Layer_0_End_PSN_0_sectors,
|
|
||||||
wxRipperPfi.Layer0EndPSN));
|
|
||||||
|
|
||||||
ulong middleZone = totalSize - (wxRipperPfi.Layer0EndPSN - wxRipperPfi.DataAreaStartPSN + 1) - gameSize + 1;
|
ulong middleZone = totalSize - (wxRipperPfi.Layer0EndPSN - wxRipperPfi.DataAreaStartPSN + 1) - gameSize + 1;
|
||||||
|
|
||||||
@@ -404,7 +370,6 @@ partial class Dump
|
|||||||
mediaTags.Add(MediaTagType.Xbox_PFI, tmpBuf);
|
mediaTags.Add(MediaTagType.Xbox_PFI, tmpBuf);
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_Disc_Manufacturing_Information);
|
UpdateStatus?.Invoke(Localization.Core.Reading_Disc_Manufacturing_Information);
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_Disc_Manufacturing_Information);
|
|
||||||
|
|
||||||
sense = _dev.ReadDiscStructure(out readBuffer,
|
sense = _dev.ReadDiscStructure(out readBuffer,
|
||||||
out senseBuf,
|
out senseBuf,
|
||||||
@@ -418,7 +383,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_get_DMI);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_get_DMI);
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_get_DMI);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -439,13 +403,6 @@ partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Real_layer_break_0, layerBreak));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Real_layer_break_0, layerBreak));
|
||||||
UpdateStatus?.Invoke("");
|
UpdateStatus?.Invoke("");
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Video_layer_0_size_0_sectors, l0Video);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Video_layer_1_size_0_sectors, l1Video);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Middle_zone_size_0_sectors, middleZone);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Game_data_size_0_sectors, gameSize);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Total_size_0_sectors, totalSize);
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Real_layer_break_0, layerBreak);
|
|
||||||
|
|
||||||
bool read12 = !_dev.Read12(out readBuffer,
|
bool read12 = !_dev.Read12(out readBuffer,
|
||||||
out senseBuf,
|
out senseBuf,
|
||||||
0,
|
0,
|
||||||
@@ -463,28 +420,20 @@ partial class Dump
|
|||||||
|
|
||||||
if(!read12)
|
if(!read12)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_read_medium_aborting_scan);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_read_medium_aborting_scan);
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_read_medium_aborting_scan);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Using_SCSI_READ_12_command);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Using_SCSI_READ_12_command);
|
UpdateStatus?.Invoke(Localization.Core.Using_SCSI_READ_12_command);
|
||||||
|
|
||||||
// Set speed
|
// Set speed
|
||||||
if(_speedMultiplier >= 0)
|
if(_speedMultiplier >= 0)
|
||||||
{
|
{
|
||||||
if(_speed == 0)
|
if(_speed == 0)
|
||||||
{
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Setting_speed_to_MAX);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Setting_speed_to_MAX);
|
UpdateStatus?.Invoke(Localization.Core.Setting_speed_to_MAX);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Setting_speed_to_0_x, _speed));
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Setting_speed_to_0_x, _speed));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Setting_speed_to_0_x, _speed));
|
||||||
}
|
|
||||||
|
|
||||||
_speed *= _speedMultiplier;
|
_speed *= _speedMultiplier;
|
||||||
|
|
||||||
@@ -517,8 +466,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(_dev.Error)
|
if(_dev.Error)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Device_error_0_trying_to_guess_ideal_transfer_length, _dev.LastError);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(string.Format(Localization.Core
|
StoppingErrorMessage?.Invoke(string.Format(Localization.Core
|
||||||
.Device_error_0_trying_to_guess_ideal_transfer_length,
|
.Device_error_0_trying_to_guess_ideal_transfer_length,
|
||||||
_dev.LastError));
|
_dev.LastError));
|
||||||
@@ -533,27 +480,21 @@ partial class Dump
|
|||||||
foreach(MediaTagType tag in mediaTags.Keys.Where(tag => !outputFormat.SupportedMediaTags.Contains(tag)))
|
foreach(MediaTagType tag in mediaTags.Keys.Where(tag => !outputFormat.SupportedMediaTags.Contains(tag)))
|
||||||
{
|
{
|
||||||
ret = false;
|
ret = false;
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Output_format_does_not_support_0, tag));
|
|
||||||
ErrorMessage?.Invoke(string.Format(Localization.Core.Output_format_does_not_support_0, tag));
|
ErrorMessage?.Invoke(string.Format(Localization.Core.Output_format_does_not_support_0, tag));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!ret)
|
if(!ret)
|
||||||
{
|
{
|
||||||
if(_force)
|
if(_force)
|
||||||
{
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Several_media_tags_not_supported_continuing);
|
|
||||||
ErrorMessage?.Invoke(Localization.Core.Several_media_tags_not_supported_continuing);
|
ErrorMessage?.Invoke(Localization.Core.Several_media_tags_not_supported_continuing);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Several_media_tags_not_supported_not_continuing);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Several_media_tags_not_supported_not_continuing);
|
StoppingErrorMessage?.Invoke(Localization.Core.Several_media_tags_not_supported_not_continuing);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_0_sectors_at_a_time, blocksToRead);
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Reading_0_sectors_at_a_time, blocksToRead));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Reading_0_sectors_at_a_time, blocksToRead));
|
||||||
|
|
||||||
var mhddLog = new MhddLog(_outputPrefix + ".mhddlog.bin",
|
var mhddLog = new MhddLog(_outputPrefix + ".mhddlog.bin",
|
||||||
@@ -570,9 +511,6 @@ partial class Dump
|
|||||||
// Cannot create image
|
// Cannot create image
|
||||||
if(!ret)
|
if(!ret)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Error_creating_output_image_not_continuing);
|
|
||||||
_dumpLog.WriteLine(outputFormat.ErrorMessage);
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
|
StoppingErrorMessage?.Invoke(Localization.Core.Error_creating_output_image_not_continuing +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
outputFormat.ErrorMessage);
|
outputFormat.ErrorMessage);
|
||||||
@@ -639,14 +577,10 @@ partial class Dump
|
|||||||
ulong currentSector = _resume.NextBlock;
|
ulong currentSector = _resume.NextBlock;
|
||||||
|
|
||||||
if(_resume.NextBlock > 0)
|
if(_resume.NextBlock > 0)
|
||||||
{
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Resuming_from_block_0, _resume.NextBlock));
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Resuming_from_block_0, _resume.NextBlock));
|
||||||
_dumpLog.WriteLine(Localization.Core.Resuming_from_block_0, _resume.NextBlock);
|
|
||||||
}
|
|
||||||
|
|
||||||
bool newTrim = false;
|
bool newTrim = false;
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_game_partition);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_game_partition);
|
UpdateStatus?.Invoke(Localization.Core.Reading_game_partition);
|
||||||
_speedStopwatch.Reset();
|
_speedStopwatch.Reset();
|
||||||
ulong sectorSpeedStart = 0;
|
ulong sectorSpeedStart = 0;
|
||||||
@@ -659,7 +593,6 @@ partial class Dump
|
|||||||
_resume.NextBlock = currentSector;
|
_resume.NextBlock = currentSector;
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -707,7 +640,6 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -772,21 +704,19 @@ partial class Dump
|
|||||||
|
|
||||||
for(ulong b = i; b < i + _skip; b++) _resume.BadBlocks.Add(b);
|
for(ulong b = i; b < i + _skip; b++) _resume.BadBlocks.Add(b);
|
||||||
|
|
||||||
AaruLogging.Debug(MODULE_NAME,
|
AaruLogging.Debug(MODULE_NAME, Localization.Core.READ_error_0, Sense.PrettifySense(senseBuf));
|
||||||
Localization.Core.READ_error_0,
|
|
||||||
Sense.PrettifySense(senseBuf));
|
|
||||||
|
|
||||||
mhddLog.Write(i, cmdDuration < 500 ? 65535 : cmdDuration, _skip);
|
mhddLog.Write(i, cmdDuration < 500 ? 65535 : cmdDuration, _skip);
|
||||||
|
|
||||||
ibgLog.Write(i, 0);
|
ibgLog.Write(i, 0);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
AaruLogging.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, i);
|
||||||
i += _skip - blocksToRead;
|
i += _skip - blocksToRead;
|
||||||
|
|
||||||
string[] senseLines = Sense.PrettifySense(senseBuf)
|
string[] senseLines = Sense.PrettifySense(senseBuf)
|
||||||
.Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries);
|
.Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
|
||||||
foreach(string senseLine in senseLines) _dumpLog.WriteLine(senseLine);
|
foreach(string senseLine in senseLines) AaruLogging.WriteLine(senseLine);
|
||||||
|
|
||||||
newTrim = true;
|
newTrim = true;
|
||||||
}
|
}
|
||||||
@@ -816,7 +746,6 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -847,7 +776,6 @@ partial class Dump
|
|||||||
|
|
||||||
// Middle Zone D
|
// Middle Zone D
|
||||||
UpdateStatus?.Invoke(Localization.Core.Writing_Middle_Zone_D_empty);
|
UpdateStatus?.Invoke(Localization.Core.Writing_Middle_Zone_D_empty);
|
||||||
_dumpLog.WriteLine(Localization.Core.Writing_Middle_Zone_D_empty);
|
|
||||||
InitProgress?.Invoke();
|
InitProgress?.Invoke();
|
||||||
|
|
||||||
for(ulong middle = currentSector - blocks - 1; middle < middleZone - 1; middle += blocksToRead)
|
for(ulong middle = currentSector - blocks - 1; middle < middleZone - 1; middle += blocksToRead)
|
||||||
@@ -856,7 +784,6 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -889,12 +816,10 @@ partial class Dump
|
|||||||
blocksToRead = saveBlocksToRead;
|
blocksToRead = saveBlocksToRead;
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Locking_drive);
|
UpdateStatus?.Invoke(Localization.Core.Locking_drive);
|
||||||
_dumpLog.WriteLine(Localization.Core.Locking_drive);
|
|
||||||
sense = _dev.KreonLock(out senseBuf, _dev.Timeout, out _);
|
sense = _dev.KreonLock(out senseBuf, _dev.Timeout, out _);
|
||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_lock_drive_not_continuing);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_lock_drive_not_continuing);
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_lock_drive_not_continuing);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -910,7 +835,6 @@ partial class Dump
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Video Layer 1
|
// Video Layer 1
|
||||||
_dumpLog.WriteLine(Localization.Core.Reading_Video_Layer_1);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Reading_Video_Layer_1);
|
UpdateStatus?.Invoke(Localization.Core.Reading_Video_Layer_1);
|
||||||
InitProgress?.Invoke();
|
InitProgress?.Invoke();
|
||||||
|
|
||||||
@@ -920,7 +844,6 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -988,13 +911,13 @@ partial class Dump
|
|||||||
mhddLog.Write(l1, cmdDuration < 500 ? 65535 : cmdDuration, _skip);
|
mhddLog.Write(l1, cmdDuration < 500 ? 65535 : cmdDuration, _skip);
|
||||||
|
|
||||||
ibgLog.Write(l1, 0);
|
ibgLog.Write(l1, 0);
|
||||||
_dumpLog.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, l1);
|
AaruLogging.WriteLine(Localization.Core.Skipping_0_blocks_from_errored_block_1, _skip, l1);
|
||||||
l1 += _skip - blocksToRead;
|
l1 += _skip - blocksToRead;
|
||||||
|
|
||||||
string[] senseLines = Sense.PrettifySense(senseBuf)
|
string[] senseLines = Sense.PrettifySense(senseBuf)
|
||||||
.Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries);
|
.Split([Environment.NewLine], StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
|
||||||
foreach(string senseLine in senseLines) _dumpLog.WriteLine(senseLine);
|
foreach(string senseLine in senseLines) AaruLogging.WriteLine(senseLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
_writeStopwatch.Stop();
|
_writeStopwatch.Stop();
|
||||||
@@ -1015,13 +938,11 @@ partial class Dump
|
|||||||
EndProgress?.Invoke();
|
EndProgress?.Invoke();
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Unlocking_drive_Wxripper);
|
UpdateStatus?.Invoke(Localization.Core.Unlocking_drive_Wxripper);
|
||||||
_dumpLog.WriteLine(Localization.Core.Unlocking_drive_Wxripper);
|
|
||||||
sense = _dev.KreonUnlockWxripper(out senseBuf, _dev.Timeout, out _);
|
sense = _dev.KreonUnlockWxripper(out senseBuf, _dev.Timeout, out _);
|
||||||
|
|
||||||
if(sense)
|
if(sense)
|
||||||
{
|
{
|
||||||
_errorLog?.WriteLine("Kreon Wxripper unlock", _dev.Error, _dev.LastError, senseBuf);
|
_errorLog?.WriteLine("Kreon Wxripper unlock", _dev.Error, _dev.LastError, senseBuf);
|
||||||
_dumpLog.WriteLine(Localization.Core.Cannot_unlock_drive_not_continuing);
|
|
||||||
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_unlock_drive_not_continuing);
|
StoppingErrorMessage?.Invoke(Localization.Core.Cannot_unlock_drive_not_continuing);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@@ -1061,26 +982,12 @@ partial class Dump
|
|||||||
.Per(imageWriteDuration.Seconds())
|
.Per(imageWriteDuration.Seconds())
|
||||||
.Humanize()));
|
.Humanize()));
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Dump_finished_in_0,
|
|
||||||
_dumpStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_dump_speed_0,
|
|
||||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
|
||||||
.Per(totalDuration.Milliseconds())
|
|
||||||
.Humanize()));
|
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Average_write_speed_0,
|
|
||||||
ByteSize.FromBytes(blockSize * (blocks + 1))
|
|
||||||
.Per(imageWriteDuration.Seconds())
|
|
||||||
.Humanize()));
|
|
||||||
|
|
||||||
#region Trimming
|
#region Trimming
|
||||||
|
|
||||||
if(_resume.BadBlocks.Count > 0 && !_aborted && _trim && newTrim)
|
if(_resume.BadBlocks.Count > 0 && !_aborted && _trim && newTrim)
|
||||||
{
|
{
|
||||||
_trimStopwatch.Restart();
|
_trimStopwatch.Restart();
|
||||||
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
|
UpdateStatus?.Invoke(Localization.Core.Trimming_skipped_sectors);
|
||||||
_dumpLog.WriteLine(Localization.Core.Trimming_skipped_sectors);
|
|
||||||
|
|
||||||
ulong[] tmpArray = _resume.BadBlocks.ToArray();
|
ulong[] tmpArray = _resume.BadBlocks.ToArray();
|
||||||
InitProgress?.Invoke();
|
InitProgress?.Invoke();
|
||||||
@@ -1090,7 +997,7 @@ partial class Dump
|
|||||||
if(_aborted)
|
if(_aborted)
|
||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1132,9 +1039,6 @@ partial class Dump
|
|||||||
|
|
||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Trimming_finished_in_0,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Trimming_finished_in_0,
|
||||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||||
|
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Trimming_finished_in_0,
|
|
||||||
_trimStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion Trimming
|
#endregion Trimming
|
||||||
@@ -1146,9 +1050,8 @@ partial class Dump
|
|||||||
List<ulong> tmpList = [];
|
List<ulong> tmpList = [];
|
||||||
|
|
||||||
foreach(ulong ur in _resume.BadBlocks)
|
foreach(ulong ur in _resume.BadBlocks)
|
||||||
{
|
for(ulong i = ur; i < ur + blocksToRead; i++)
|
||||||
for(ulong i = ur; i < ur + blocksToRead; i++) tmpList.Add(i);
|
tmpList.Add(i);
|
||||||
}
|
|
||||||
|
|
||||||
tmpList.Sort();
|
tmpList.Sort();
|
||||||
|
|
||||||
@@ -1251,7 +1154,6 @@ partial class Dump
|
|||||||
md10 = Modes.EncodeMode10(md, _dev.ScsiType);
|
md10 = Modes.EncodeMode10(md, _dev.ScsiType);
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Sending_MODE_SELECT_to_drive_return_damaged_blocks);
|
UpdateStatus?.Invoke(Localization.Core.Sending_MODE_SELECT_to_drive_return_damaged_blocks);
|
||||||
_dumpLog.WriteLine(Localization.Core.Sending_MODE_SELECT_to_drive_return_damaged_blocks);
|
|
||||||
sense = _dev.ModeSelect(md6, out senseBuf, true, false, _dev.Timeout, out _);
|
sense = _dev.ModeSelect(md6, out senseBuf, true, false, _dev.Timeout, out _);
|
||||||
|
|
||||||
if(sense) sense = _dev.ModeSelect10(md10, out senseBuf, true, false, _dev.Timeout, out _);
|
if(sense) sense = _dev.ModeSelect10(md10, out senseBuf, true, false, _dev.Timeout, out _);
|
||||||
@@ -1262,9 +1164,6 @@ partial class Dump
|
|||||||
.Drive_did_not_accept_MODE_SELECT_command_for_persistent_error_reading);
|
.Drive_did_not_accept_MODE_SELECT_command_for_persistent_error_reading);
|
||||||
|
|
||||||
AaruLogging.Debug(Localization.Core.Error_0, Sense.PrettifySense(senseBuf));
|
AaruLogging.Debug(Localization.Core.Error_0, Sense.PrettifySense(senseBuf));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core
|
|
||||||
.Drive_did_not_accept_MODE_SELECT_command_for_persistent_error_reading);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
runningPersistent = true;
|
runningPersistent = true;
|
||||||
@@ -1280,7 +1179,6 @@ partial class Dump
|
|||||||
{
|
{
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1337,8 +1235,6 @@ partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Correctly_retried_block_0_in_pass_1,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Correctly_retried_block_0_in_pass_1,
|
||||||
badSector,
|
badSector,
|
||||||
pass));
|
pass));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Correctly_retried_block_0_in_pass_1, badSector, pass);
|
|
||||||
}
|
}
|
||||||
else if(runningPersistent) outputFormat.WriteSector(readBuffer, badSector);
|
else if(runningPersistent) outputFormat.WriteSector(readBuffer, badSector);
|
||||||
}
|
}
|
||||||
@@ -1366,7 +1262,6 @@ partial class Dump
|
|||||||
md10 = Modes.EncodeMode10(md, _dev.ScsiType);
|
md10 = Modes.EncodeMode10(md, _dev.ScsiType);
|
||||||
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Sending_MODE_SELECT_to_drive_return_device_to_previous_status);
|
UpdateStatus?.Invoke(Localization.Core.Sending_MODE_SELECT_to_drive_return_device_to_previous_status);
|
||||||
_dumpLog.WriteLine(Localization.Core.Sending_MODE_SELECT_to_drive_return_device_to_previous_status);
|
|
||||||
sense = _dev.ModeSelect(md6, out senseBuf, true, false, _dev.Timeout, out _);
|
sense = _dev.ModeSelect(md6, out senseBuf, true, false, _dev.Timeout, out _);
|
||||||
|
|
||||||
if(sense) _dev.ModeSelect10(md10, out senseBuf, true, false, _dev.Timeout, out _);
|
if(sense) _dev.ModeSelect10(md10, out senseBuf, true, false, _dev.Timeout, out _);
|
||||||
@@ -1394,8 +1289,6 @@ partial class Dump
|
|||||||
if(ret || _force) continue;
|
if(ret || _force) continue;
|
||||||
|
|
||||||
// Cannot write tag to image
|
// Cannot write tag to image
|
||||||
_dumpLog.WriteLine(string.Format(Localization.Core.Cannot_write_tag_0, tag.Key));
|
|
||||||
|
|
||||||
StoppingErrorMessage?.Invoke(string.Format(Localization.Core.Cannot_write_tag_0, tag.Key) +
|
StoppingErrorMessage?.Invoke(string.Format(Localization.Core.Cannot_write_tag_0, tag.Key) +
|
||||||
Environment.NewLine +
|
Environment.NewLine +
|
||||||
outputFormat.ErrorMessage);
|
outputFormat.ErrorMessage);
|
||||||
@@ -1405,7 +1298,8 @@ partial class Dump
|
|||||||
|
|
||||||
_resume.BadBlocks.Sort();
|
_resume.BadBlocks.Sort();
|
||||||
|
|
||||||
foreach(ulong bad in _resume.BadBlocks) _dumpLog.WriteLine(Localization.Core.Sector_0_could_not_be_read, bad);
|
foreach(ulong bad in _resume.BadBlocks)
|
||||||
|
AaruLogging.WriteLine(Localization.Core.Sector_0_could_not_be_read, bad);
|
||||||
|
|
||||||
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
currentTry.Extents = ExtentsConverter.ToMetadata(extents);
|
||||||
|
|
||||||
@@ -1426,7 +1320,6 @@ partial class Dump
|
|||||||
|
|
||||||
if(_preSidecar != null) outputFormat.SetMetadata(_preSidecar);
|
if(_preSidecar != null) outputFormat.SetMetadata(_preSidecar);
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Closing_output_file);
|
|
||||||
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
UpdateStatus?.Invoke(Localization.Core.Closing_output_file);
|
||||||
_imageCloseStopwatch.Restart();
|
_imageCloseStopwatch.Restart();
|
||||||
outputFormat.Close();
|
outputFormat.Close();
|
||||||
@@ -1435,13 +1328,10 @@ partial class Dump
|
|||||||
UpdateStatus?.Invoke(string.Format(Localization.Core.Closed_in_0,
|
UpdateStatus?.Invoke(string.Format(Localization.Core.Closed_in_0,
|
||||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second)));
|
||||||
|
|
||||||
_dumpLog.WriteLine(Localization.Core.Closed_in_0,
|
|
||||||
_imageCloseStopwatch.Elapsed.Humanize(minUnit: TimeUnit.Second));
|
|
||||||
|
|
||||||
if(_aborted)
|
if(_aborted)
|
||||||
{
|
{
|
||||||
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
UpdateStatus?.Invoke(Localization.Core.Aborted);
|
||||||
_dumpLog.WriteLine(Localization.Core.Aborted);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,27 +36,21 @@ using System.Reflection;
|
|||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
using Aaru.CommonTypes.Interop;
|
using Aaru.CommonTypes.Interop;
|
||||||
using Aaru.Devices;
|
using Aaru.Devices;
|
||||||
|
using Aaru.Logging;
|
||||||
using PlatformID = Aaru.CommonTypes.Interop.PlatformID;
|
using PlatformID = Aaru.CommonTypes.Interop.PlatformID;
|
||||||
using Version = Aaru.CommonTypes.Interop.Version;
|
using Version = Aaru.CommonTypes.Interop.Version;
|
||||||
|
|
||||||
namespace Aaru.Core.Logging;
|
namespace Aaru.Core.Logging;
|
||||||
|
|
||||||
/// <summary>Creates a dump log</summary>
|
/// <summary>Creates a dump log</summary>
|
||||||
public sealed class DumpLog
|
public static class DumpLog
|
||||||
{
|
{
|
||||||
readonly StreamWriter _logSw;
|
|
||||||
|
|
||||||
/// <summary>Initializes the dump log</summary>
|
/// <summary>Initializes the dump log</summary>
|
||||||
/// <param name="outputFile">Output log file</param>
|
|
||||||
/// <param name="dev">Device</param>
|
/// <param name="dev">Device</param>
|
||||||
/// <param name="private">Disable saving paths or serial numbers in log</param>
|
/// <param name="private">Disable saving paths or serial numbers in log</param>
|
||||||
public DumpLog(string outputFile, Device dev, bool @private)
|
public static void StartLog(Device dev, bool @private)
|
||||||
{
|
{
|
||||||
if(string.IsNullOrEmpty(outputFile)) return;
|
AaruLogging.Information(Localization.Core.Start_logging_at_0, DateTime.Now);
|
||||||
|
|
||||||
_logSw = new StreamWriter(outputFile, true);
|
|
||||||
|
|
||||||
_logSw.WriteLine(Localization.Core.Start_logging_at_0, DateTime.Now);
|
|
||||||
|
|
||||||
PlatformID platId = DetectOS.GetRealPlatformID();
|
PlatformID platId = DetectOS.GetRealPlatformID();
|
||||||
string platVer = DetectOS.GetVersion();
|
string platVer = DetectOS.GetVersion();
|
||||||
@@ -65,37 +59,35 @@ public sealed class DumpLog
|
|||||||
Attribute.GetCustomAttribute(typeof(DumpLog).Assembly, typeof(AssemblyInformationalVersionAttribute)) as
|
Attribute.GetCustomAttribute(typeof(DumpLog).Assembly, typeof(AssemblyInformationalVersionAttribute)) as
|
||||||
AssemblyInformationalVersionAttribute;
|
AssemblyInformationalVersionAttribute;
|
||||||
|
|
||||||
_logSw.WriteLine(Localization.Core.System_information);
|
AaruLogging.Information(Localization.Core.System_information);
|
||||||
|
|
||||||
_logSw.WriteLine("{0} {1} ({2}-bit)",
|
AaruLogging.Information("{0} {1} ({2}-bit)",
|
||||||
DetectOS.GetPlatformName(platId, platVer),
|
DetectOS.GetPlatformName(platId, platVer),
|
||||||
platVer,
|
platVer,
|
||||||
Environment.Is64BitOperatingSystem ? 64 : 32);
|
Environment.Is64BitOperatingSystem ? 64 : 32);
|
||||||
|
|
||||||
if(DetectOS.IsMono)
|
if(DetectOS.IsMono)
|
||||||
_logSw.WriteLine("Mono {0}", Version.GetMonoVersion());
|
AaruLogging.Information("Mono {0}", Version.GetMonoVersion());
|
||||||
else if(DetectOS.IsNetCore)
|
else if(DetectOS.IsNetCore)
|
||||||
_logSw.WriteLine(".NET Core {0}", Version.GetNetCoreVersion());
|
AaruLogging.Information(".NET Core {0}", Version.GetNetCoreVersion());
|
||||||
else
|
else
|
||||||
_logSw.WriteLine(RuntimeInformation.FrameworkDescription);
|
AaruLogging.Information(RuntimeInformation.FrameworkDescription);
|
||||||
|
|
||||||
_logSw.WriteLine();
|
AaruLogging.Information(Localization.Core.Program_information);
|
||||||
|
AaruLogging.Information("Aaru {0}", assemblyVersion?.InformationalVersion);
|
||||||
|
AaruLogging.Information(Localization.Core.Running_in_0_bit, Environment.Is64BitProcess ? 64 : 32);
|
||||||
|
|
||||||
_logSw.WriteLine(Localization.Core.Program_information);
|
AaruLogging.Information(DetectOS.IsAdmin
|
||||||
_logSw.WriteLine("Aaru {0}", assemblyVersion?.InformationalVersion);
|
? Localization.Core.Running_as_superuser_Yes
|
||||||
_logSw.WriteLine(Localization.Core.Running_in_0_bit, Environment.Is64BitProcess ? 64 : 32);
|
: Localization.Core.Running_as_superuser_No);
|
||||||
|
|
||||||
_logSw.WriteLine(DetectOS.IsAdmin
|
|
||||||
? Localization.Core.Running_as_superuser_Yes
|
|
||||||
: Localization.Core.Running_as_superuser_No);
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
_logSw.WriteLine(Localization.Core.DEBUG_version);
|
AaruLogging.Information(Localization.Core.DEBUG_version);
|
||||||
#endif
|
#endif
|
||||||
if(@private)
|
if(@private)
|
||||||
{
|
{
|
||||||
string[] args = Environment.GetCommandLineArgs();
|
string[] args = Environment.GetCommandLineArgs();
|
||||||
|
|
||||||
for(var i = 0; i < args.Length; i++)
|
for(int i = 0; i < args.Length; i++)
|
||||||
{
|
{
|
||||||
if(args[i].StartsWith("/dev", StringComparison.OrdinalIgnoreCase) ||
|
if(args[i].StartsWith("/dev", StringComparison.OrdinalIgnoreCase) ||
|
||||||
args[i].StartsWith("aaru://", StringComparison.OrdinalIgnoreCase))
|
args[i].StartsWith("aaru://", StringComparison.OrdinalIgnoreCase))
|
||||||
@@ -111,94 +103,71 @@ public sealed class DumpLog
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_logSw.WriteLine(Localization.Core.Command_line_0, string.Join(" ", args));
|
AaruLogging.Information(Localization.Core.Command_line_0, string.Join(" ", args));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
_logSw.WriteLine(Localization.Core.Command_line_0, Environment.CommandLine);
|
AaruLogging.Information(Localization.Core.Command_line_0, Environment.CommandLine);
|
||||||
|
|
||||||
_logSw.WriteLine();
|
|
||||||
|
|
||||||
if(dev is Aaru.Devices.Remote.Device remoteDev)
|
if(dev is Aaru.Devices.Remote.Device remoteDev)
|
||||||
{
|
{
|
||||||
_logSw.WriteLine(Localization.Core.Remote_information);
|
AaruLogging.Information(Localization.Core.Remote_information);
|
||||||
_logSw.WriteLine(Localization.Core.Server_0, remoteDev.RemoteApplication);
|
AaruLogging.Information(Localization.Core.Server_0, remoteDev.RemoteApplication);
|
||||||
_logSw.WriteLine(Localization.Core.Version_0, remoteDev.RemoteVersion);
|
AaruLogging.Information(Localization.Core.Version_0, remoteDev.RemoteVersion);
|
||||||
|
|
||||||
_logSw.WriteLine(Localization.Core.Operating_system_0_1,
|
AaruLogging.Information(Localization.Core.Operating_system_0_1,
|
||||||
remoteDev.RemoteOperatingSystem,
|
remoteDev.RemoteOperatingSystem,
|
||||||
remoteDev.RemoteOperatingSystemVersion);
|
remoteDev.RemoteOperatingSystemVersion);
|
||||||
|
|
||||||
_logSw.WriteLine(Localization.Core.Architecture_0, remoteDev.RemoteArchitecture);
|
AaruLogging.Information(Localization.Core.Architecture_0, remoteDev.RemoteArchitecture);
|
||||||
_logSw.WriteLine(Localization.Core.Protocol_version_0, remoteDev.RemoteProtocolVersion);
|
AaruLogging.Information(Localization.Core.Protocol_version_0, remoteDev.RemoteProtocolVersion);
|
||||||
|
|
||||||
_logSw.WriteLine(DetectOS.IsAdmin
|
AaruLogging.Information(DetectOS.IsAdmin
|
||||||
? Localization.Core.Running_as_superuser_Yes
|
? Localization.Core.Running_as_superuser_Yes
|
||||||
: Localization.Core.Running_as_superuser_No);
|
: Localization.Core.Running_as_superuser_No);
|
||||||
|
|
||||||
_logSw.WriteLine(Localization.Core.Log_section_separator);
|
AaruLogging.Information(Localization.Core.Log_section_separator);
|
||||||
}
|
}
|
||||||
|
|
||||||
_logSw.WriteLine(Localization.Core.Device_information);
|
AaruLogging.Information(Localization.Core.Device_information);
|
||||||
_logSw.WriteLine(Localization.Core.Manufacturer_0, dev.Manufacturer);
|
AaruLogging.Information(Localization.Core.Manufacturer_0, dev.Manufacturer);
|
||||||
_logSw.WriteLine(Localization.Core.Model_0, dev.Model);
|
AaruLogging.Information(Localization.Core.Model_0, dev.Model);
|
||||||
_logSw.WriteLine(Localization.Core.Firmware_revision_0, dev.FirmwareRevision);
|
AaruLogging.Information(Localization.Core.Firmware_revision_0, dev.FirmwareRevision);
|
||||||
|
|
||||||
if(!@private) _logSw.WriteLine(Localization.Core.Serial_number_0, dev.Serial);
|
if(!@private) AaruLogging.Information(Localization.Core.Serial_number_0, dev.Serial);
|
||||||
|
|
||||||
_logSw.WriteLine(Localization.Core.Removable_device_0, dev.IsRemovable);
|
AaruLogging.Information(Localization.Core.Removable_device_0, dev.IsRemovable);
|
||||||
_logSw.WriteLine(Localization.Core.Device_type_0, dev.Type);
|
AaruLogging.Information(Localization.Core.Device_type_0, dev.Type);
|
||||||
_logSw.WriteLine(Localization.Core.CompactFlash_device_0, dev.IsCompactFlash);
|
AaruLogging.Information(Localization.Core.CompactFlash_device_0, dev.IsCompactFlash);
|
||||||
_logSw.WriteLine(Localization.Core.PCMCIA_device_0, dev.IsPcmcia);
|
AaruLogging.Information(Localization.Core.PCMCIA_device_0, dev.IsPcmcia);
|
||||||
_logSw.WriteLine(Localization.Core.USB_device_0, dev.IsUsb);
|
AaruLogging.Information(Localization.Core.USB_device_0, dev.IsUsb);
|
||||||
|
|
||||||
if(dev.IsUsb)
|
if(dev.IsUsb)
|
||||||
{
|
{
|
||||||
_logSw.WriteLine(Localization.Core.USB_manufacturer_0, dev.UsbManufacturerString);
|
AaruLogging.Information(Localization.Core.USB_manufacturer_0, dev.UsbManufacturerString);
|
||||||
_logSw.WriteLine(Localization.Core.USB_product_0, dev.UsbProductString);
|
AaruLogging.Information(Localization.Core.USB_product_0, dev.UsbProductString);
|
||||||
|
|
||||||
if(!@private) _logSw.WriteLine(Localization.Core.USB_serial_0, dev.UsbSerialString);
|
if(!@private) AaruLogging.Information(Localization.Core.USB_serial_0, dev.UsbSerialString);
|
||||||
|
|
||||||
_logSw.WriteLine(Localization.Core.USB_vendor_ID_0, dev.UsbVendorId);
|
AaruLogging.Information(Localization.Core.USB_vendor_ID_0, dev.UsbVendorId);
|
||||||
_logSw.WriteLine(Localization.Core.USB_product_ID_0, dev.UsbProductId);
|
AaruLogging.Information(Localization.Core.USB_product_ID_0, dev.UsbProductId);
|
||||||
}
|
}
|
||||||
|
|
||||||
_logSw.WriteLine(Localization.Core.FireWire_device_0, dev.IsFireWire);
|
AaruLogging.Information(Localization.Core.FireWire_device_0, dev.IsFireWire);
|
||||||
|
|
||||||
if(dev.IsFireWire)
|
if(dev.IsFireWire)
|
||||||
{
|
{
|
||||||
_logSw.WriteLine(Localization.Core.FireWire_vendor_0, dev.FireWireVendorName);
|
AaruLogging.Information(Localization.Core.FireWire_vendor_0, dev.FireWireVendorName);
|
||||||
_logSw.WriteLine(Localization.Core.FireWire_model_0, dev.FireWireModelName);
|
AaruLogging.Information(Localization.Core.FireWire_model_0, dev.FireWireModelName);
|
||||||
|
|
||||||
if(!@private) _logSw.WriteLine(Localization.Core.FireWire_GUID_0, dev.FireWireGuid);
|
if(!@private) AaruLogging.Information(Localization.Core.FireWire_GUID_0, dev.FireWireGuid);
|
||||||
|
|
||||||
_logSw.WriteLine(Localization.Core.FireWire_vendor_ID_0, dev.FireWireVendor);
|
AaruLogging.Information(Localization.Core.FireWire_vendor_ID_0, dev.FireWireVendor);
|
||||||
_logSw.WriteLine(Localization.Core.FireWire_product_ID_0, dev.FireWireModel);
|
AaruLogging.Information(Localization.Core.FireWire_product_ID_0, dev.FireWireModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
_logSw.WriteLine(Localization.Core.Log_section_separator);
|
AaruLogging.Information(Localization.Core.Log_section_separator);
|
||||||
|
|
||||||
_logSw.WriteLine();
|
AaruLogging.Information(Localization.Core.Dumping_progress_log);
|
||||||
_logSw.WriteLine(Localization.Core.Dumping_progress_log);
|
|
||||||
_logSw.Flush();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Adds a new line to the dump log</summary>
|
|
||||||
/// <param name="format">Format string</param>
|
|
||||||
/// <param name="args">Arguments</param>
|
|
||||||
public void WriteLine(string format, params object[] args)
|
|
||||||
{
|
|
||||||
if(_logSw == null) return;
|
|
||||||
|
|
||||||
var text = string.Format(format, args);
|
|
||||||
_logSw.WriteLine("{0:s} {1}", DateTime.Now, text);
|
|
||||||
_logSw.Flush();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>Finishes and closes the dump log</summary>
|
|
||||||
public void Close()
|
|
||||||
{
|
|
||||||
_logSw?.WriteLine(Localization.Core.Log_section_separator);
|
|
||||||
_logSw?.WriteLine(Localization.Core.End_logging_on_0, DateTime.Now);
|
|
||||||
_logSw?.Close();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -38,6 +38,7 @@ using Aaru.Core.Logging;
|
|||||||
using Aaru.Decoders.CD;
|
using Aaru.Decoders.CD;
|
||||||
using Aaru.Devices;
|
using Aaru.Devices;
|
||||||
using Aaru.Helpers;
|
using Aaru.Helpers;
|
||||||
|
using Aaru.Logging;
|
||||||
|
|
||||||
namespace Aaru.Core.Media;
|
namespace Aaru.Core.Media;
|
||||||
|
|
||||||
@@ -60,7 +61,6 @@ public static class CompactDisc
|
|||||||
/// <param name="outputPlugin">Output image</param>
|
/// <param name="outputPlugin">Output image</param>
|
||||||
/// <param name="fixSubchannel">If we want to fix subchannel contents</param>
|
/// <param name="fixSubchannel">If we want to fix subchannel contents</param>
|
||||||
/// <param name="fixSubchannelCrc">If we want to fix Q subchannel CRC if the contents look sane</param>
|
/// <param name="fixSubchannelCrc">If we want to fix Q subchannel CRC if the contents look sane</param>
|
||||||
/// <param name="dumpLog">Dumping log</param>
|
|
||||||
/// <param name="updateStatus">Status update callback</param>
|
/// <param name="updateStatus">Status update callback</param>
|
||||||
/// <param name="smallestPregapLbaPerTrack">List of smallest known pregap per track</param>
|
/// <param name="smallestPregapLbaPerTrack">List of smallest known pregap per track</param>
|
||||||
/// <param name="dumping">Set if we are dumping, otherwise converting</param>
|
/// <param name="dumping">Set if we are dumping, otherwise converting</param>
|
||||||
@@ -74,7 +74,7 @@ public static class CompactDisc
|
|||||||
Dictionary<byte, string> isrcs, byte currentTrack, ref string mcn,
|
Dictionary<byte, string> isrcs, byte currentTrack, ref string mcn,
|
||||||
Track[] tracks, HashSet<int> subchannelExtents,
|
Track[] tracks, HashSet<int> subchannelExtents,
|
||||||
bool fixSubchannelPosition, IWritableOpticalImage outputPlugin,
|
bool fixSubchannelPosition, IWritableOpticalImage outputPlugin,
|
||||||
bool fixSubchannel, bool fixSubchannelCrc, DumpLog dumpLog,
|
bool fixSubchannel, bool fixSubchannelCrc,
|
||||||
UpdateStatusHandler updateStatus,
|
UpdateStatusHandler updateStatus,
|
||||||
Dictionary<byte, int> smallestPregapLbaPerTrack, bool dumping,
|
Dictionary<byte, int> smallestPregapLbaPerTrack, bool dumping,
|
||||||
out List<ulong> newPregapSectors)
|
out List<ulong> newPregapSectors)
|
||||||
@@ -95,7 +95,6 @@ public static class CompactDisc
|
|||||||
currentTrack,
|
currentTrack,
|
||||||
ref mcn,
|
ref mcn,
|
||||||
tracks,
|
tracks,
|
||||||
dumpLog,
|
|
||||||
updateStatus,
|
updateStatus,
|
||||||
smallestPregapLbaPerTrack,
|
smallestPregapLbaPerTrack,
|
||||||
dumping,
|
dumping,
|
||||||
@@ -107,15 +106,15 @@ public static class CompactDisc
|
|||||||
int prePos = int.MinValue;
|
int prePos = int.MinValue;
|
||||||
|
|
||||||
// Check subchannel
|
// Check subchannel
|
||||||
for(var subPos = 0; subPos < deSub.Length; subPos += 96)
|
for(int subPos = 0; subPos < deSub.Length; subPos += 96)
|
||||||
{
|
{
|
||||||
// Expected LBA
|
// Expected LBA
|
||||||
long lba = (long)sectorAddress + subPos / 96;
|
long lba = (long)sectorAddress + subPos / 96;
|
||||||
|
|
||||||
// We fixed the subchannel
|
// We fixed the subchannel
|
||||||
var @fixed = false;
|
bool @fixed = false;
|
||||||
|
|
||||||
var q = new byte[12];
|
byte[] q = new byte[12];
|
||||||
Array.Copy(deSub, subPos + 12, q, 0, 12);
|
Array.Copy(deSub, subPos + 12, q, 0, 12);
|
||||||
|
|
||||||
// Check Q CRC
|
// Check Q CRC
|
||||||
@@ -123,17 +122,18 @@ public static class CompactDisc
|
|||||||
bool crcOk = crc[0] == q[10] && crc[1] == q[11];
|
bool crcOk = crc[0] == q[10] && crc[1] == q[11];
|
||||||
|
|
||||||
// Start considering P to be OK
|
// Start considering P to be OK
|
||||||
var pOk = true;
|
bool pOk = true;
|
||||||
var pWeight = 0;
|
int pWeight = 0;
|
||||||
|
|
||||||
// Check P and weight
|
// Check P and weight
|
||||||
for(int p = subPos; p < subPos + 12; p++)
|
for(int p = subPos; p < subPos + 12; p++)
|
||||||
{
|
{
|
||||||
if(deSub[p] != 0 && deSub[p] != 255) pOk = false;
|
if(deSub[p] != 0 && deSub[p] != 255) pOk = false;
|
||||||
|
|
||||||
for(var w = 0; w < 8; w++)
|
for(int w = 0; w < 8; w++)
|
||||||
if((deSub[p] >> w & 1) > 0)
|
{
|
||||||
pWeight++;
|
if((deSub[p] >> w & 1) > 0) pWeight++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// This seems to be a somewhat common pattern
|
// This seems to be a somewhat common pattern
|
||||||
@@ -156,13 +156,13 @@ public static class CompactDisc
|
|||||||
deSub.Skip(subPos + 84).Take(12).All(w => w == 0xFF);
|
deSub.Skip(subPos + 84).Take(12).All(w => w == 0xFF);
|
||||||
|
|
||||||
bool rwOk = rOk && sOk && tOk && uOk && vOk && wOk;
|
bool rwOk = rOk && sOk && tOk && uOk && vOk && wOk;
|
||||||
var rwPacket = false;
|
bool rwPacket = false;
|
||||||
var cdtextPacket = false;
|
bool cdtextPacket = false;
|
||||||
|
|
||||||
// Check RW contents
|
// Check RW contents
|
||||||
if(!rwOk)
|
if(!rwOk)
|
||||||
{
|
{
|
||||||
var sectorSub = new byte[96];
|
byte[] sectorSub = new byte[96];
|
||||||
Array.Copy(sub, subPos, sectorSub, 0, 96);
|
Array.Copy(sub, subPos, sectorSub, 0, 96);
|
||||||
|
|
||||||
DetectRwPackets(sectorSub, out _, out rwPacket, out cdtextPacket);
|
DetectRwPackets(sectorSub, out _, out rwPacket, out cdtextPacket);
|
||||||
@@ -177,11 +177,13 @@ public static class CompactDisc
|
|||||||
if(!pOk && fixSubchannel)
|
if(!pOk && fixSubchannel)
|
||||||
{
|
{
|
||||||
if(pWeight >= 48)
|
if(pWeight >= 48)
|
||||||
for(int p = subPos; p < subPos + 12; p++)
|
{
|
||||||
deSub[p] = 255;
|
for(int p = subPos; p < subPos + 12; p++) deSub[p] = 255;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
for(int p = subPos; p < subPos + 12; p++)
|
{
|
||||||
deSub[p] = 0;
|
for(int p = subPos; p < subPos + 12; p++) deSub[p] = 0;
|
||||||
|
}
|
||||||
|
|
||||||
pOk = true;
|
pOk = true;
|
||||||
@fixed = true;
|
@fixed = true;
|
||||||
@@ -253,20 +255,20 @@ public static class CompactDisc
|
|||||||
|
|
||||||
if(!pOk || !crcOk || !rwOk) continue;
|
if(!pOk || !crcOk || !rwOk) continue;
|
||||||
|
|
||||||
var aframe = (byte)(q[9] / 16 * 10 + (q[9] & 0x0F));
|
byte aframe = (byte)(q[9] / 16 * 10 + (q[9] & 0x0F));
|
||||||
|
|
||||||
if((q[0] & 0x3) == 1)
|
if((q[0] & 0x3) == 1)
|
||||||
{
|
{
|
||||||
var amin = (byte)(q[7] / 16 * 10 + (q[7] & 0x0F));
|
byte amin = (byte)(q[7] / 16 * 10 + (q[7] & 0x0F));
|
||||||
var asec = (byte)(q[8] / 16 * 10 + (q[8] & 0x0F));
|
byte asec = (byte)(q[8] / 16 * 10 + (q[8] & 0x0F));
|
||||||
aPos = amin * 60 * 75 + asec * 75 + aframe - 150;
|
aPos = amin * 60 * 75 + asec * 75 + aframe - 150;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ulong expectedSectorAddress = sectorAddress + (ulong)(subPos / 96) + 150;
|
ulong expectedSectorAddress = sectorAddress + (ulong)(subPos / 96) + 150;
|
||||||
var smin = (byte)(expectedSectorAddress / 60 / 75);
|
byte smin = (byte)(expectedSectorAddress / 60 / 75);
|
||||||
expectedSectorAddress -= (ulong)(smin * 60 * 75);
|
expectedSectorAddress -= (ulong)(smin * 60 * 75);
|
||||||
var ssec = (byte)(expectedSectorAddress / 75);
|
byte ssec = (byte)(expectedSectorAddress / 75);
|
||||||
|
|
||||||
aPos = smin * 60 * 75 + ssec * 75 + aframe - 150;
|
aPos = smin * 60 * 75 + ssec * 75 + aframe - 150;
|
||||||
|
|
||||||
@@ -279,7 +281,7 @@ public static class CompactDisc
|
|||||||
|
|
||||||
prePos = aPos;
|
prePos = aPos;
|
||||||
|
|
||||||
var posSub = new byte[96];
|
byte[] posSub = new byte[96];
|
||||||
Array.Copy(deSub, subPos, posSub, 0, 96);
|
Array.Copy(deSub, subPos, posSub, 0, 96);
|
||||||
posSub = Subchannel.Interleave(posSub);
|
posSub = Subchannel.Interleave(posSub);
|
||||||
outputPlugin.WriteSectorTag(posSub, (ulong)aPos, SectorTagType.CdSectorSubchannel);
|
outputPlugin.WriteSectorTag(posSub, (ulong)aPos, SectorTagType.CdSectorSubchannel);
|
||||||
@@ -309,18 +311,17 @@ public static class CompactDisc
|
|||||||
/// <param name="sectorAddress">Sector address the subchannel was read from</param>
|
/// <param name="sectorAddress">Sector address the subchannel was read from</param>
|
||||||
/// <returns><c>true</c> if indexes have changed, <c>false</c> otherwise</returns>
|
/// <returns><c>true</c> if indexes have changed, <c>false</c> otherwise</returns>
|
||||||
static bool CheckIndexesFromSubchannel(byte[] deSub, Dictionary<byte, string> isrcs, byte currentTrackNumber,
|
static bool CheckIndexesFromSubchannel(byte[] deSub, Dictionary<byte, string> isrcs, byte currentTrackNumber,
|
||||||
ref string mcn, Track[] tracks, DumpLog dumpLog,
|
ref string mcn, Track[] tracks, UpdateStatusHandler updateStatus,
|
||||||
UpdateStatusHandler updateStatus,
|
|
||||||
Dictionary<byte, int> smallestPregapLbaPerTrack, bool dumping,
|
Dictionary<byte, int> smallestPregapLbaPerTrack, bool dumping,
|
||||||
out List<ulong> newPregapSectors, ulong sectorAddress)
|
out List<ulong> newPregapSectors, ulong sectorAddress)
|
||||||
{
|
{
|
||||||
var status = false;
|
bool status = false;
|
||||||
newPregapSectors = [];
|
newPregapSectors = [];
|
||||||
|
|
||||||
// Check subchannel
|
// Check subchannel
|
||||||
for(var subPos = 0; subPos < deSub.Length; subPos += 96)
|
for(int subPos = 0; subPos < deSub.Length; subPos += 96)
|
||||||
{
|
{
|
||||||
var q = new byte[12];
|
byte[] q = new byte[12];
|
||||||
Array.Copy(deSub, subPos + 12, q, 0, 12);
|
Array.Copy(deSub, subPos + 12, q, 0, 12);
|
||||||
|
|
||||||
CRC16CcittContext.Data(q, 10, out byte[] crc);
|
CRC16CcittContext.Data(q, 10, out byte[] crc);
|
||||||
@@ -339,10 +340,6 @@ public static class CompactDisc
|
|||||||
|
|
||||||
if(!isrcs.ContainsKey(currentTrackNumber))
|
if(!isrcs.ContainsKey(currentTrackNumber))
|
||||||
{
|
{
|
||||||
dumpLog?.WriteLine(string.Format(Localization.Core.Found_new_ISRC_0_for_track_1,
|
|
||||||
isrc,
|
|
||||||
currentTrackNumber));
|
|
||||||
|
|
||||||
updateStatus?.Invoke(string.Format(Localization.Core.Found_new_ISRC_0_for_track_1,
|
updateStatus?.Invoke(string.Format(Localization.Core.Found_new_ISRC_0_for_track_1,
|
||||||
isrc,
|
isrc,
|
||||||
currentTrackNumber));
|
currentTrackNumber));
|
||||||
@@ -356,11 +353,6 @@ public static class CompactDisc
|
|||||||
|
|
||||||
if(currentTrack?.Sequence == currentTrackNumber)
|
if(currentTrack?.Sequence == currentTrackNumber)
|
||||||
{
|
{
|
||||||
dumpLog?.WriteLine(string.Format(Localization.Core.ISRC_for_track_0_changed_from_1_to_2,
|
|
||||||
currentTrackNumber,
|
|
||||||
isrcs[currentTrackNumber],
|
|
||||||
isrc));
|
|
||||||
|
|
||||||
updateStatus?.Invoke(string.Format(Localization.Core.ISRC_for_track_0_changed_from_1_to_2,
|
updateStatus?.Invoke(string.Format(Localization.Core.ISRC_for_track_0_changed_from_1_to_2,
|
||||||
currentTrackNumber,
|
currentTrackNumber,
|
||||||
isrcs[currentTrackNumber],
|
isrcs[currentTrackNumber],
|
||||||
@@ -383,15 +375,9 @@ public static class CompactDisc
|
|||||||
if(!crcOk) continue;
|
if(!crcOk) continue;
|
||||||
|
|
||||||
if(mcn is null)
|
if(mcn is null)
|
||||||
{
|
|
||||||
dumpLog?.WriteLine(string.Format(Localization.Core.Found_new_MCN_0, newMcn));
|
|
||||||
updateStatus?.Invoke(string.Format(Localization.Core.Found_new_MCN_0, newMcn));
|
updateStatus?.Invoke(string.Format(Localization.Core.Found_new_MCN_0, newMcn));
|
||||||
}
|
|
||||||
else if(mcn != newMcn)
|
else if(mcn != newMcn)
|
||||||
{
|
|
||||||
dumpLog?.WriteLine(string.Format(Localization.Core.MCN_changed_from_0_to_1, mcn, newMcn));
|
|
||||||
updateStatus?.Invoke(string.Format(Localization.Core.MCN_changed_from_0_to_1, mcn, newMcn));
|
updateStatus?.Invoke(string.Format(Localization.Core.MCN_changed_from_0_to_1, mcn, newMcn));
|
||||||
}
|
|
||||||
|
|
||||||
mcn = newMcn;
|
mcn = newMcn;
|
||||||
|
|
||||||
@@ -403,19 +389,19 @@ public static class CompactDisc
|
|||||||
continue;
|
continue;
|
||||||
case 1:
|
case 1:
|
||||||
{
|
{
|
||||||
var trackNo = (byte)(q[1] / 16 * 10 + (q[1] & 0x0F));
|
byte trackNo = (byte)(q[1] / 16 * 10 + (q[1] & 0x0F));
|
||||||
|
|
||||||
for(var i = 0; i < tracks.Length; i++)
|
for(int i = 0; i < tracks.Length; i++)
|
||||||
{
|
{
|
||||||
if(tracks[i].Sequence != trackNo) continue;
|
if(tracks[i].Sequence != trackNo) continue;
|
||||||
|
|
||||||
// Pregap
|
// Pregap
|
||||||
if(q[2] == 0 && trackNo > 1)
|
if(q[2] == 0 && trackNo > 1)
|
||||||
{
|
{
|
||||||
var pmin = (byte)(q[3] / 16 * 10 + (q[3] & 0x0F));
|
byte pmin = (byte)(q[3] / 16 * 10 + (q[3] & 0x0F));
|
||||||
var psec = (byte)(q[4] / 16 * 10 + (q[4] & 0x0F));
|
byte psec = (byte)(q[4] / 16 * 10 + (q[4] & 0x0F));
|
||||||
var pframe = (byte)(q[5] / 16 * 10 + (q[5] & 0x0F));
|
byte pframe = (byte)(q[5] / 16 * 10 + (q[5] & 0x0F));
|
||||||
int qPos = pmin * 60 * 75 + psec * 75 + pframe;
|
int qPos = pmin * 60 * 75 + psec * 75 + pframe;
|
||||||
|
|
||||||
// When we are dumping we calculate the pregap in reverse from index 1 back.
|
// When we are dumping we calculate the pregap in reverse from index 1 back.
|
||||||
// When we are not, we go from index 0.
|
// When we are not, we go from index 0.
|
||||||
@@ -436,16 +422,12 @@ public static class CompactDisc
|
|||||||
if(i > 0 && tracks[i - 1].EndSector >= tracks[i].StartSector)
|
if(i > 0 && tracks[i - 1].EndSector >= tracks[i].StartSector)
|
||||||
tracks[i - 1].EndSector = tracks[i].StartSector - 1;
|
tracks[i - 1].EndSector = tracks[i].StartSector - 1;
|
||||||
|
|
||||||
dumpLog?.WriteLine(string.Format(Localization.Core.Pregap_for_track_0_set_to_1_sectors,
|
|
||||||
trackNo,
|
|
||||||
tracks[i].Pregap));
|
|
||||||
|
|
||||||
updateStatus?.Invoke(string.Format(Localization.Core
|
updateStatus?.Invoke(string.Format(Localization.Core
|
||||||
.Pregap_for_track_0_set_to_1_sectors,
|
.Pregap_for_track_0_set_to_1_sectors,
|
||||||
trackNo,
|
trackNo,
|
||||||
tracks[i].Pregap));
|
tracks[i].Pregap));
|
||||||
|
|
||||||
for(var p = 0; p < dif; p++) newPregapSectors.Add(tracks[i].StartSector + (ulong)p);
|
for(int p = 0; p < dif; p++) newPregapSectors.Add(tracks[i].StartSector + (ulong)p);
|
||||||
|
|
||||||
status = true;
|
status = true;
|
||||||
}
|
}
|
||||||
@@ -460,15 +442,11 @@ public static class CompactDisc
|
|||||||
if(i > 0 && tracks[i - 1].EndSector >= tracks[i].StartSector)
|
if(i > 0 && tracks[i - 1].EndSector >= tracks[i].StartSector)
|
||||||
tracks[i - 1].EndSector = tracks[i].StartSector - 1;
|
tracks[i - 1].EndSector = tracks[i].StartSector - 1;
|
||||||
|
|
||||||
dumpLog?.WriteLine(string.Format(Localization.Core.Pregap_for_track_0_set_to_1_sectors,
|
|
||||||
trackNo,
|
|
||||||
tracks[i].Pregap));
|
|
||||||
|
|
||||||
updateStatus?.Invoke(string.Format(Localization.Core.Pregap_for_track_0_set_to_1_sectors,
|
updateStatus?.Invoke(string.Format(Localization.Core.Pregap_for_track_0_set_to_1_sectors,
|
||||||
trackNo,
|
trackNo,
|
||||||
tracks[i].Pregap));
|
tracks[i].Pregap));
|
||||||
|
|
||||||
for(var p = 0; p < (int)(tracks[i].Pregap - oldPregap); p++)
|
for(int p = 0; p < (int)(tracks[i].Pregap - oldPregap); p++)
|
||||||
newPregapSectors.Add(tracks[i].StartSector + (ulong)p);
|
newPregapSectors.Add(tracks[i].StartSector + (ulong)p);
|
||||||
|
|
||||||
status = true;
|
status = true;
|
||||||
@@ -478,21 +456,16 @@ public static class CompactDisc
|
|||||||
|
|
||||||
if(q[2] == 0) continue;
|
if(q[2] == 0) continue;
|
||||||
|
|
||||||
var amin = (byte)(q[7] / 16 * 10 + (q[7] & 0x0F));
|
byte amin = (byte)(q[7] / 16 * 10 + (q[7] & 0x0F));
|
||||||
var asec = (byte)(q[8] / 16 * 10 + (q[8] & 0x0F));
|
byte asec = (byte)(q[8] / 16 * 10 + (q[8] & 0x0F));
|
||||||
var aframe = (byte)(q[9] / 16 * 10 + (q[9] & 0x0F));
|
byte aframe = (byte)(q[9] / 16 * 10 + (q[9] & 0x0F));
|
||||||
int aPos = amin * 60 * 75 + asec * 75 + aframe - 150;
|
int aPos = amin * 60 * 75 + asec * 75 + aframe - 150;
|
||||||
|
|
||||||
// Do not set INDEX 1 to a value higher than what the TOC already said.
|
// Do not set INDEX 1 to a value higher than what the TOC already said.
|
||||||
if(q[2] == 1 && aPos > (int)tracks[i].StartSector) continue;
|
if(q[2] == 1 && aPos > (int)tracks[i].StartSector) continue;
|
||||||
|
|
||||||
if(tracks[i].Indexes.ContainsKey(q[2]) && aPos >= tracks[i].Indexes[q[2]]) continue;
|
if(tracks[i].Indexes.ContainsKey(q[2]) && aPos >= tracks[i].Indexes[q[2]]) continue;
|
||||||
|
|
||||||
dumpLog?.WriteLine(string.Format(Localization.Core.Setting_index_0_for_track_1_to_LBA_2,
|
|
||||||
q[2],
|
|
||||||
trackNo,
|
|
||||||
aPos));
|
|
||||||
|
|
||||||
updateStatus?.Invoke(string.Format(Localization.Core.Setting_index_0_for_track_1_to_LBA_2,
|
updateStatus?.Invoke(string.Format(Localization.Core.Setting_index_0_for_track_1_to_LBA_2,
|
||||||
q[2],
|
q[2],
|
||||||
trackNo,
|
trackNo,
|
||||||
@@ -522,18 +495,18 @@ public static class CompactDisc
|
|||||||
rwPacket = false;
|
rwPacket = false;
|
||||||
cdtextPacket = false;
|
cdtextPacket = false;
|
||||||
|
|
||||||
var cdTextPack1 = new byte[18];
|
byte[] cdTextPack1 = new byte[18];
|
||||||
var cdTextPack2 = new byte[18];
|
byte[] cdTextPack2 = new byte[18];
|
||||||
var cdTextPack3 = new byte[18];
|
byte[] cdTextPack3 = new byte[18];
|
||||||
var cdTextPack4 = new byte[18];
|
byte[] cdTextPack4 = new byte[18];
|
||||||
var cdSubRwPack1 = new byte[24];
|
byte[] cdSubRwPack1 = new byte[24];
|
||||||
var cdSubRwPack2 = new byte[24];
|
byte[] cdSubRwPack2 = new byte[24];
|
||||||
var cdSubRwPack3 = new byte[24];
|
byte[] cdSubRwPack3 = new byte[24];
|
||||||
var cdSubRwPack4 = new byte[24];
|
byte[] cdSubRwPack4 = new byte[24];
|
||||||
|
|
||||||
var i = 0;
|
int i = 0;
|
||||||
|
|
||||||
for(var j = 0; j < 18; j++)
|
for(int j = 0; j < 18; j++)
|
||||||
{
|
{
|
||||||
cdTextPack1[j] = (byte)(cdTextPack1[j] | (subchannel[i++] & 0x3F) << 2);
|
cdTextPack1[j] = (byte)(cdTextPack1[j] | (subchannel[i++] & 0x3F) << 2);
|
||||||
|
|
||||||
@@ -548,7 +521,7 @@ public static class CompactDisc
|
|||||||
if(j < 18) cdTextPack1[j] = (byte)(cdTextPack1[j] | subchannel[i++] & 0x3F);
|
if(j < 18) cdTextPack1[j] = (byte)(cdTextPack1[j] | subchannel[i++] & 0x3F);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(var j = 0; j < 18; j++)
|
for(int j = 0; j < 18; j++)
|
||||||
{
|
{
|
||||||
cdTextPack2[j] = (byte)(cdTextPack2[j] | (subchannel[i++] & 0x3F) << 2);
|
cdTextPack2[j] = (byte)(cdTextPack2[j] | (subchannel[i++] & 0x3F) << 2);
|
||||||
|
|
||||||
@@ -563,7 +536,7 @@ public static class CompactDisc
|
|||||||
if(j < 18) cdTextPack2[j] = (byte)(cdTextPack2[j] | subchannel[i++] & 0x3F);
|
if(j < 18) cdTextPack2[j] = (byte)(cdTextPack2[j] | subchannel[i++] & 0x3F);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(var j = 0; j < 18; j++)
|
for(int j = 0; j < 18; j++)
|
||||||
{
|
{
|
||||||
cdTextPack3[j] = (byte)(cdTextPack3[j] | (subchannel[i++] & 0x3F) << 2);
|
cdTextPack3[j] = (byte)(cdTextPack3[j] | (subchannel[i++] & 0x3F) << 2);
|
||||||
|
|
||||||
@@ -578,7 +551,7 @@ public static class CompactDisc
|
|||||||
if(j < 18) cdTextPack3[j] = (byte)(cdTextPack3[j] | subchannel[i++] & 0x3F);
|
if(j < 18) cdTextPack3[j] = (byte)(cdTextPack3[j] | subchannel[i++] & 0x3F);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(var j = 0; j < 18; j++)
|
for(int j = 0; j < 18; j++)
|
||||||
{
|
{
|
||||||
cdTextPack4[j] = (byte)(cdTextPack4[j] | (subchannel[i++] & 0x3F) << 2);
|
cdTextPack4[j] = (byte)(cdTextPack4[j] | (subchannel[i++] & 0x3F) << 2);
|
||||||
|
|
||||||
@@ -595,13 +568,13 @@ public static class CompactDisc
|
|||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
|
|
||||||
for(var j = 0; j < 24; j++) cdSubRwPack1[j] = (byte)(subchannel[i++] & 0x3F);
|
for(int j = 0; j < 24; j++) cdSubRwPack1[j] = (byte)(subchannel[i++] & 0x3F);
|
||||||
|
|
||||||
for(var j = 0; j < 24; j++) cdSubRwPack2[j] = (byte)(subchannel[i++] & 0x3F);
|
for(int j = 0; j < 24; j++) cdSubRwPack2[j] = (byte)(subchannel[i++] & 0x3F);
|
||||||
|
|
||||||
for(var j = 0; j < 24; j++) cdSubRwPack3[j] = (byte)(subchannel[i++] & 0x3F);
|
for(int j = 0; j < 24; j++) cdSubRwPack3[j] = (byte)(subchannel[i++] & 0x3F);
|
||||||
|
|
||||||
for(var j = 0; j < 24; j++) cdSubRwPack4[j] = (byte)(subchannel[i++] & 0x3F);
|
for(int j = 0; j < 24; j++) cdSubRwPack4[j] = (byte)(subchannel[i++] & 0x3F);
|
||||||
|
|
||||||
switch(cdSubRwPack1[0])
|
switch(cdSubRwPack1[0])
|
||||||
{
|
{
|
||||||
@@ -697,14 +670,14 @@ public static class CompactDisc
|
|||||||
/// <returns><c>true</c> if subchannel contains a TEXT packet, <c>false</c> otherwise</returns>
|
/// <returns><c>true</c> if subchannel contains a TEXT packet, <c>false</c> otherwise</returns>
|
||||||
static bool CheckCdTextPackets(byte[] subchannel)
|
static bool CheckCdTextPackets(byte[] subchannel)
|
||||||
{
|
{
|
||||||
var cdTextPack1 = new byte[18];
|
byte[] cdTextPack1 = new byte[18];
|
||||||
var cdTextPack2 = new byte[18];
|
byte[] cdTextPack2 = new byte[18];
|
||||||
var cdTextPack3 = new byte[18];
|
byte[] cdTextPack3 = new byte[18];
|
||||||
var cdTextPack4 = new byte[18];
|
byte[] cdTextPack4 = new byte[18];
|
||||||
|
|
||||||
var i = 0;
|
int i = 0;
|
||||||
|
|
||||||
for(var j = 0; j < 18; j++)
|
for(int j = 0; j < 18; j++)
|
||||||
{
|
{
|
||||||
cdTextPack1[j] = (byte)(cdTextPack1[j] | (subchannel[i++] & 0x3F) << 2);
|
cdTextPack1[j] = (byte)(cdTextPack1[j] | (subchannel[i++] & 0x3F) << 2);
|
||||||
|
|
||||||
@@ -719,7 +692,7 @@ public static class CompactDisc
|
|||||||
if(j < 18) cdTextPack1[j] = (byte)(cdTextPack1[j] | subchannel[i++] & 0x3F);
|
if(j < 18) cdTextPack1[j] = (byte)(cdTextPack1[j] | subchannel[i++] & 0x3F);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(var j = 0; j < 18; j++)
|
for(int j = 0; j < 18; j++)
|
||||||
{
|
{
|
||||||
cdTextPack2[j] = (byte)(cdTextPack2[j] | (subchannel[i++] & 0x3F) << 2);
|
cdTextPack2[j] = (byte)(cdTextPack2[j] | (subchannel[i++] & 0x3F) << 2);
|
||||||
|
|
||||||
@@ -734,7 +707,7 @@ public static class CompactDisc
|
|||||||
if(j < 18) cdTextPack2[j] = (byte)(cdTextPack2[j] | subchannel[i++] & 0x3F);
|
if(j < 18) cdTextPack2[j] = (byte)(cdTextPack2[j] | subchannel[i++] & 0x3F);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(var j = 0; j < 18; j++)
|
for(int j = 0; j < 18; j++)
|
||||||
{
|
{
|
||||||
cdTextPack3[j] = (byte)(cdTextPack3[j] | (subchannel[i++] & 0x3F) << 2);
|
cdTextPack3[j] = (byte)(cdTextPack3[j] | (subchannel[i++] & 0x3F) << 2);
|
||||||
|
|
||||||
@@ -749,7 +722,7 @@ public static class CompactDisc
|
|||||||
if(j < 18) cdTextPack3[j] = (byte)(cdTextPack3[j] | subchannel[i++] & 0x3F);
|
if(j < 18) cdTextPack3[j] = (byte)(cdTextPack3[j] | subchannel[i++] & 0x3F);
|
||||||
}
|
}
|
||||||
|
|
||||||
for(var j = 0; j < 18; j++)
|
for(int j = 0; j < 18; j++)
|
||||||
{
|
{
|
||||||
cdTextPack4[j] = (byte)(cdTextPack4[j] | (subchannel[i++] & 0x3F) << 2);
|
cdTextPack4[j] = (byte)(cdTextPack4[j] | (subchannel[i++] & 0x3F) << 2);
|
||||||
|
|
||||||
@@ -764,12 +737,12 @@ public static class CompactDisc
|
|||||||
if(j < 18) cdTextPack4[j] = (byte)(cdTextPack4[j] | subchannel[i++] & 0x3F);
|
if(j < 18) cdTextPack4[j] = (byte)(cdTextPack4[j] | subchannel[i++] & 0x3F);
|
||||||
}
|
}
|
||||||
|
|
||||||
var status = true;
|
bool status = true;
|
||||||
|
|
||||||
if((cdTextPack1[0] & 0x80) == 0x80)
|
if((cdTextPack1[0] & 0x80) == 0x80)
|
||||||
{
|
{
|
||||||
var cdTextPack1Crc = BigEndianBitConverter.ToUInt16(cdTextPack1, 16);
|
ushort cdTextPack1Crc = BigEndianBitConverter.ToUInt16(cdTextPack1, 16);
|
||||||
var cdTextPack1ForCrc = new byte[16];
|
byte[] cdTextPack1ForCrc = new byte[16];
|
||||||
Array.Copy(cdTextPack1, 0, cdTextPack1ForCrc, 0, 16);
|
Array.Copy(cdTextPack1, 0, cdTextPack1ForCrc, 0, 16);
|
||||||
ushort calculatedCdtp1Crc = CRC16CcittContext.Calculate(cdTextPack1ForCrc);
|
ushort calculatedCdtp1Crc = CRC16CcittContext.Calculate(cdTextPack1ForCrc);
|
||||||
|
|
||||||
@@ -778,8 +751,8 @@ public static class CompactDisc
|
|||||||
|
|
||||||
if((cdTextPack2[0] & 0x80) == 0x80)
|
if((cdTextPack2[0] & 0x80) == 0x80)
|
||||||
{
|
{
|
||||||
var cdTextPack2Crc = BigEndianBitConverter.ToUInt16(cdTextPack2, 16);
|
ushort cdTextPack2Crc = BigEndianBitConverter.ToUInt16(cdTextPack2, 16);
|
||||||
var cdTextPack2ForCrc = new byte[16];
|
byte[] cdTextPack2ForCrc = new byte[16];
|
||||||
Array.Copy(cdTextPack2, 0, cdTextPack2ForCrc, 0, 16);
|
Array.Copy(cdTextPack2, 0, cdTextPack2ForCrc, 0, 16);
|
||||||
ushort calculatedCdtp2Crc = CRC16CcittContext.Calculate(cdTextPack2ForCrc);
|
ushort calculatedCdtp2Crc = CRC16CcittContext.Calculate(cdTextPack2ForCrc);
|
||||||
|
|
||||||
@@ -788,8 +761,8 @@ public static class CompactDisc
|
|||||||
|
|
||||||
if((cdTextPack3[0] & 0x80) == 0x80)
|
if((cdTextPack3[0] & 0x80) == 0x80)
|
||||||
{
|
{
|
||||||
var cdTextPack3Crc = BigEndianBitConverter.ToUInt16(cdTextPack3, 16);
|
ushort cdTextPack3Crc = BigEndianBitConverter.ToUInt16(cdTextPack3, 16);
|
||||||
var cdTextPack3ForCrc = new byte[16];
|
byte[] cdTextPack3ForCrc = new byte[16];
|
||||||
Array.Copy(cdTextPack3, 0, cdTextPack3ForCrc, 0, 16);
|
Array.Copy(cdTextPack3, 0, cdTextPack3ForCrc, 0, 16);
|
||||||
ushort calculatedCdtp3Crc = CRC16CcittContext.Calculate(cdTextPack3ForCrc);
|
ushort calculatedCdtp3Crc = CRC16CcittContext.Calculate(cdTextPack3ForCrc);
|
||||||
|
|
||||||
@@ -798,8 +771,8 @@ public static class CompactDisc
|
|||||||
|
|
||||||
if((cdTextPack4[0] & 0x80) != 0x80) return status;
|
if((cdTextPack4[0] & 0x80) != 0x80) return status;
|
||||||
|
|
||||||
var cdTextPack4Crc = BigEndianBitConverter.ToUInt16(cdTextPack4, 16);
|
ushort cdTextPack4Crc = BigEndianBitConverter.ToUInt16(cdTextPack4, 16);
|
||||||
var cdTextPack4ForCrc = new byte[16];
|
byte[] cdTextPack4ForCrc = new byte[16];
|
||||||
Array.Copy(cdTextPack4, 0, cdTextPack4ForCrc, 0, 16);
|
Array.Copy(cdTextPack4, 0, cdTextPack4ForCrc, 0, 16);
|
||||||
ushort calculatedCdtp4Crc = CRC16CcittContext.Calculate(cdTextPack4ForCrc);
|
ushort calculatedCdtp4Crc = CRC16CcittContext.Calculate(cdTextPack4ForCrc);
|
||||||
|
|
||||||
@@ -843,8 +816,8 @@ public static class CompactDisc
|
|||||||
fixedMcn = false;
|
fixedMcn = false;
|
||||||
fixedIsrc = false;
|
fixedIsrc = false;
|
||||||
|
|
||||||
var preQ = new byte[12];
|
byte[] preQ = new byte[12];
|
||||||
var nextQ = new byte[12];
|
byte[] nextQ = new byte[12];
|
||||||
Array.Copy(deSub, subPos + 12 - 96, preQ, 0, 12);
|
Array.Copy(deSub, subPos + 12 - 96, preQ, 0, 12);
|
||||||
Array.Copy(deSub, subPos + 12 + 96, nextQ, 0, 12);
|
Array.Copy(deSub, subPos + 12 + 96, nextQ, 0, 12);
|
||||||
|
|
||||||
@@ -998,15 +971,15 @@ public static class CompactDisc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var amin = (byte)(q[7] / 16 * 10 + (q[7] & 0x0F));
|
byte amin = (byte)(q[7] / 16 * 10 + (q[7] & 0x0F));
|
||||||
var asec = (byte)(q[8] / 16 * 10 + (q[8] & 0x0F));
|
byte asec = (byte)(q[8] / 16 * 10 + (q[8] & 0x0F));
|
||||||
aframe = (byte)(q[9] / 16 * 10 + (q[9] & 0x0F));
|
aframe = (byte)(q[9] / 16 * 10 + (q[9] & 0x0F));
|
||||||
int aPos = amin * 60 * 75 + asec * 75 + aframe - 150;
|
int aPos = amin * 60 * 75 + asec * 75 + aframe - 150;
|
||||||
|
|
||||||
var pmin = (byte)(q[3] / 16 * 10 + (q[3] & 0x0F));
|
byte pmin = (byte)(q[3] / 16 * 10 + (q[3] & 0x0F));
|
||||||
var psec = (byte)(q[4] / 16 * 10 + (q[4] & 0x0F));
|
byte psec = (byte)(q[4] / 16 * 10 + (q[4] & 0x0F));
|
||||||
var pframe = (byte)(q[5] / 16 * 10 + (q[5] & 0x0F));
|
byte pframe = (byte)(q[5] / 16 * 10 + (q[5] & 0x0F));
|
||||||
int pPos = pmin * 60 * 75 + psec * 75 + pframe;
|
int pPos = pmin * 60 * 75 + psec * 75 + pframe;
|
||||||
|
|
||||||
// TODO: pregap
|
// TODO: pregap
|
||||||
// Not pregap
|
// Not pregap
|
||||||
@@ -1509,16 +1482,14 @@ public static class CompactDisc
|
|||||||
/// <param name="trackFlags">Flags of tracks</param>
|
/// <param name="trackFlags">Flags of tracks</param>
|
||||||
/// <param name="blocks">Disc size</param>
|
/// <param name="blocks">Disc size</param>
|
||||||
/// <param name="subLog">Subchannel log</param>
|
/// <param name="subLog">Subchannel log</param>
|
||||||
/// <param name="dumpLog">Dump log</param>
|
|
||||||
/// <param name="initProgress">Progress initialization callback</param>
|
/// <param name="initProgress">Progress initialization callback</param>
|
||||||
/// <param name="updateProgress">Progress update callback</param>
|
/// <param name="updateProgress">Progress update callback</param>
|
||||||
/// <param name="endProgress">Progress finalization callback</param>
|
/// <param name="endProgress">Progress finalization callback</param>
|
||||||
/// <param name="outputPlugin">Output image</param>
|
/// <param name="outputPlugin">Output image</param>
|
||||||
public static void GenerateSubchannels(HashSet<int> subchannelExtents, Track[] tracks,
|
public static void GenerateSubchannels(HashSet<int> subchannelExtents, Track[] tracks,
|
||||||
Dictionary<byte, byte> trackFlags, ulong blocks, SubchannelLog subLog,
|
Dictionary<byte, byte> trackFlags, ulong blocks, SubchannelLog subLog,
|
||||||
DumpLog dumpLog, InitProgressHandler initProgress,
|
InitProgressHandler initProgress, UpdateProgressHandler updateProgress,
|
||||||
UpdateProgressHandler updateProgress, EndProgressHandler endProgress,
|
EndProgressHandler endProgress, IWritableImage outputPlugin)
|
||||||
IWritableImage outputPlugin)
|
|
||||||
{
|
{
|
||||||
initProgress?.Invoke();
|
initProgress?.Invoke();
|
||||||
|
|
||||||
@@ -1561,7 +1532,7 @@ public static class CompactDisc
|
|||||||
sector,
|
sector,
|
||||||
(long)blocks);
|
(long)blocks);
|
||||||
|
|
||||||
dumpLog?.WriteLine($"Generating subchannel for sector {sector}.");
|
AaruLogging.WriteLine($"Generating subchannel for sector {sector}.");
|
||||||
|
|
||||||
byte[] sub = Subchannel.Generate(sector, track?.Sequence ?? 0, (int)pregap, (int)trackStart, flags, index);
|
byte[] sub = Subchannel.Generate(sector, track?.Sequence ?? 0, (int)pregap, (int)trackStart, flags, index);
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ using System.Linq;
|
|||||||
using Aaru.CommonTypes;
|
using Aaru.CommonTypes;
|
||||||
using Aaru.CommonTypes.Enums;
|
using Aaru.CommonTypes.Enums;
|
||||||
using Aaru.CommonTypes.Structs;
|
using Aaru.CommonTypes.Structs;
|
||||||
using Aaru.Core.Logging;
|
|
||||||
using Aaru.Core.Media.Detection;
|
using Aaru.Core.Media.Detection;
|
||||||
using Aaru.Database.Models;
|
using Aaru.Database.Models;
|
||||||
using Aaru.Decoders.CD;
|
using Aaru.Decoders.CD;
|
||||||
@@ -62,8 +61,8 @@ public static class CompactDisc
|
|||||||
/// <param name="supportsPlextorReadCdDa">Set to <c>true</c> if drive supports PLEXTOR READ CD-DA vendor command</param>
|
/// <param name="supportsPlextorReadCdDa">Set to <c>true</c> if drive supports PLEXTOR READ CD-DA vendor command</param>
|
||||||
/// <returns><c>true</c> if offset could be found, <c>false</c> otherwise</returns>
|
/// <returns><c>true</c> if offset could be found, <c>false</c> otherwise</returns>
|
||||||
[SuppressMessage("ReSharper", "TooWideLocalVariableScope")]
|
[SuppressMessage("ReSharper", "TooWideLocalVariableScope")]
|
||||||
public static void GetOffset(CdOffset cdOffset, Device dbDev, bool debug, Aaru.Devices.Device dev,
|
public static void GetOffset(CdOffset cdOffset, Device dbDev, bool debug, Aaru.Devices.Device dev,
|
||||||
MediaType dskType, DumpLog dumpLog, Track[] tracks, UpdateStatusHandler updateStatus,
|
MediaType dskType, Track[] tracks, UpdateStatusHandler updateStatus,
|
||||||
out int? driveOffset, out int? combinedOffset, out bool supportsPlextorReadCdDa)
|
out int? driveOffset, out int? combinedOffset, out bool supportsPlextorReadCdDa)
|
||||||
{
|
{
|
||||||
byte[] cmdBuf;
|
byte[] cmdBuf;
|
||||||
@@ -77,7 +76,7 @@ public static class CompactDisc
|
|||||||
int diff;
|
int diff;
|
||||||
Track dataTrack = default;
|
Track dataTrack = default;
|
||||||
Track audioTrack = default;
|
Track audioTrack = default;
|
||||||
var offsetFound = false;
|
bool offsetFound = false;
|
||||||
const uint sectorSize = 2352;
|
const uint sectorSize = 2352;
|
||||||
driveOffset = cdOffset?.Offset * 4;
|
driveOffset = cdOffset?.Offset * 4;
|
||||||
combinedOffset = null;
|
combinedOffset = null;
|
||||||
@@ -97,7 +96,7 @@ public static class CompactDisc
|
|||||||
tmpBuf = new byte[sectorSync.Length];
|
tmpBuf = new byte[sectorSync.Length];
|
||||||
|
|
||||||
// Ensure to be out of the pregap, or multi-session discs give funny values
|
// Ensure to be out of the pregap, or multi-session discs give funny values
|
||||||
var wantedLba = (uint)(dataTrack.StartSector + 151);
|
uint wantedLba = (uint)(dataTrack.StartSector + 151);
|
||||||
|
|
||||||
// Plextor READ CDDA
|
// Plextor READ CDDA
|
||||||
if(dbDev?.ATAPI?.RemovableMedias?.Any(d => d.SupportsPlextorReadCDDA == true) == true ||
|
if(dbDev?.ATAPI?.RemovableMedias?.Any(d => d.SupportsPlextorReadCDDA == true) == true ||
|
||||||
@@ -117,7 +116,7 @@ public static class CompactDisc
|
|||||||
{
|
{
|
||||||
supportsPlextorReadCdDa = true;
|
supportsPlextorReadCdDa = true;
|
||||||
|
|
||||||
for(var i = 0; i < cmdBuf.Length - sectorSync.Length; i++)
|
for(int i = 0; i < cmdBuf.Length - sectorSync.Length; i++)
|
||||||
{
|
{
|
||||||
Array.Copy(cmdBuf, i, tmpBuf, 0, sectorSync.Length);
|
Array.Copy(cmdBuf, i, tmpBuf, 0, sectorSync.Length);
|
||||||
|
|
||||||
@@ -174,7 +173,7 @@ public static class CompactDisc
|
|||||||
if(!sense && !dev.Error)
|
if(!sense && !dev.Error)
|
||||||
{
|
{
|
||||||
// Clear cache
|
// Clear cache
|
||||||
for(var i = 0; i < 63; i++)
|
for(int i = 0; i < 63; i++)
|
||||||
{
|
{
|
||||||
sense = dev.ReadCd(out _,
|
sense = dev.ReadCd(out _,
|
||||||
out _,
|
out _,
|
||||||
@@ -213,7 +212,7 @@ public static class CompactDisc
|
|||||||
dev.Timeout,
|
dev.Timeout,
|
||||||
out _);
|
out _);
|
||||||
|
|
||||||
for(var i = 0; i < cmdBuf.Length - sectorSync.Length; i++)
|
for(int i = 0; i < cmdBuf.Length - sectorSync.Length; i++)
|
||||||
{
|
{
|
||||||
Array.Copy(cmdBuf, i, tmpBuf, 0, sectorSync.Length);
|
Array.Copy(cmdBuf, i, tmpBuf, 0, sectorSync.Length);
|
||||||
|
|
||||||
@@ -249,7 +248,7 @@ public static class CompactDisc
|
|||||||
|
|
||||||
// Try to get another the offset some other way, we need an audio track just after a data track, same session
|
// Try to get another the offset some other way, we need an audio track just after a data track, same session
|
||||||
|
|
||||||
for(var i = 1; i < tracks.Length; i++)
|
for(int i = 1; i < tracks.Length; i++)
|
||||||
{
|
{
|
||||||
if(tracks[i - 1].Type == TrackType.Audio || tracks[i].Type != TrackType.Audio) continue;
|
if(tracks[i - 1].Type == TrackType.Audio || tracks[i].Type != TrackType.Audio) continue;
|
||||||
|
|
||||||
@@ -308,7 +307,7 @@ public static class CompactDisc
|
|||||||
|
|
||||||
tmpBuf = new byte[sectorSync.Length];
|
tmpBuf = new byte[sectorSync.Length];
|
||||||
|
|
||||||
for(var i = 0; i < cmdBuf.Length - sectorSync.Length; i++)
|
for(int i = 0; i < cmdBuf.Length - sectorSync.Length; i++)
|
||||||
{
|
{
|
||||||
Array.Copy(cmdBuf, i, tmpBuf, 0, sectorSync.Length);
|
Array.Copy(cmdBuf, i, tmpBuf, 0, sectorSync.Length);
|
||||||
|
|
||||||
@@ -341,12 +340,12 @@ public static class CompactDisc
|
|||||||
|
|
||||||
if(sense || dev.Error) return;
|
if(sense || dev.Error) return;
|
||||||
|
|
||||||
for(var i = 0; i < dataBuf.Length; i++) dataBuf[i] ^= Sector.ScrambleTable[i];
|
for(int i = 0; i < dataBuf.Length; i++) dataBuf[i] ^= Sector.ScrambleTable[i];
|
||||||
|
|
||||||
for(var i = 0; i < 2352; i++)
|
for(int i = 0; i < 2352; i++)
|
||||||
{
|
{
|
||||||
var dataSide = new byte[2352 - i];
|
byte[] dataSide = new byte[2352 - i];
|
||||||
var audioSide = new byte[2352 - i];
|
byte[] audioSide = new byte[2352 - i];
|
||||||
|
|
||||||
Array.Copy(dataBuf, i, dataSide, 0, dataSide.Length);
|
Array.Copy(dataBuf, i, dataSide, 0, dataSide.Length);
|
||||||
Array.Copy(cmdBuf, 0, audioSide, 0, audioSide.Length);
|
Array.Copy(cmdBuf, 0, audioSide, 0, audioSide.Length);
|
||||||
@@ -360,7 +359,7 @@ public static class CompactDisc
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var videoNowColorFrame = new byte[9 * sectorSize];
|
byte[] videoNowColorFrame = new byte[9 * sectorSize];
|
||||||
|
|
||||||
sense = dev.ReadCd(out cmdBuf,
|
sense = dev.ReadCd(out cmdBuf,
|
||||||
out _,
|
out _,
|
||||||
@@ -402,18 +401,13 @@ public static class CompactDisc
|
|||||||
}
|
}
|
||||||
|
|
||||||
if(videoNowColorFrame is null)
|
if(videoNowColorFrame is null)
|
||||||
{
|
updateStatus?.Invoke(Localization.Core.Could_not_find_VideoNow_Color_frame_offset);
|
||||||
dumpLog?.WriteLine(Localization.Core.Could_not_find_VideoNow_Color_frame_offset);
|
|
||||||
updateStatus?.Invoke("Could not find VideoNow Color frame offset, dump may not be correct.");
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
combinedOffset = MMC.GetVideoNowColorOffset(videoNowColorFrame);
|
combinedOffset = MMC.GetVideoNowColorOffset(videoNowColorFrame);
|
||||||
|
|
||||||
dumpLog?.WriteLine(string.Format(Localization.Core.VideoNow_Color_frame_is_offset_0_bytes,
|
updateStatus?.Invoke(string.Format(Localization.Core.VideoNow_Color_frame_is_offset_0_bytes,
|
||||||
combinedOffset));
|
combinedOffset));
|
||||||
|
|
||||||
updateStatus?.Invoke($"VideoNow Color frame is offset {combinedOffset} bytes.");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -979,7 +979,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
warning = true;
|
warning = true;
|
||||||
|
|
||||||
AaruLogging.Error(UI.Error_0_setting_geometry_image_may_be_incorrect_continuing,
|
AaruLogging.Error(UI.Error_0_setting_geometry_image_may_be_incorrect_continuing,
|
||||||
outputFormat.ErrorMessage);
|
outputFormat.ErrorMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
await Dispatcher.UIThread.InvokeAsync(() =>
|
await Dispatcher.UIThread.InvokeAsync(() =>
|
||||||
@@ -1106,8 +1106,8 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
warning = true;
|
warning = true;
|
||||||
|
|
||||||
AaruLogging.Error(UI.Error_0_writing_sector_1_continuing,
|
AaruLogging.Error(UI.Error_0_writing_sector_1_continuing,
|
||||||
outputFormat.ErrorMessage,
|
outputFormat.ErrorMessage,
|
||||||
doneSectors);
|
doneSectors);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1123,8 +1123,8 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
.ShowWindowDialogAsync(_view));
|
.ShowWindowDialogAsync(_view));
|
||||||
|
|
||||||
AaruLogging.Error(UI.Error_0_writing_sector_1_not_continuing,
|
AaruLogging.Error(UI.Error_0_writing_sector_1_not_continuing,
|
||||||
outputFormat.ErrorMessage,
|
outputFormat.ErrorMessage,
|
||||||
doneSectors);
|
doneSectors);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1266,7 +1266,6 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
null,
|
null,
|
||||||
null,
|
|
||||||
smallestPregapLbaPerTrack,
|
smallestPregapLbaPerTrack,
|
||||||
false,
|
false,
|
||||||
out _);
|
out _);
|
||||||
@@ -1300,9 +1299,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
icon: Icon.Error)
|
icon: Icon.Error)
|
||||||
.ShowWindowDialogAsync(_view));
|
.ShowWindowDialogAsync(_view));
|
||||||
|
|
||||||
AaruLogging.Error(UI.Error_0_reading_sector_1_not_continuing,
|
AaruLogging.Error(UI.Error_0_reading_sector_1_not_continuing, errno, doneSectors);
|
||||||
errno,
|
|
||||||
doneSectors);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1335,7 +1332,6 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
null,
|
null,
|
||||||
null,
|
|
||||||
smallestPregapLbaPerTrack,
|
smallestPregapLbaPerTrack,
|
||||||
false,
|
false,
|
||||||
out _);
|
out _);
|
||||||
@@ -1369,9 +1365,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
icon: Icon.Error)
|
icon: Icon.Error)
|
||||||
.ShowWindowDialogAsync(_view));
|
.ShowWindowDialogAsync(_view));
|
||||||
|
|
||||||
AaruLogging.Error(UI.Error_0_reading_sector_1_not_continuing,
|
AaruLogging.Error(UI.Error_0_reading_sector_1_not_continuing, errno, doneSectors);
|
||||||
errno,
|
|
||||||
doneSectors);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1385,8 +1379,8 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
warning = true;
|
warning = true;
|
||||||
|
|
||||||
AaruLogging.Error(UI.Error_0_writing_sector_1_continuing,
|
AaruLogging.Error(UI.Error_0_writing_sector_1_continuing,
|
||||||
outputFormat.ErrorMessage,
|
outputFormat.ErrorMessage,
|
||||||
doneSectors);
|
doneSectors);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1402,8 +1396,8 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
.ShowWindowDialogAsync(_view));
|
.ShowWindowDialogAsync(_view));
|
||||||
|
|
||||||
AaruLogging.Error(UI.Error_0_writing_sector_1_not_continuing,
|
AaruLogging.Error(UI.Error_0_writing_sector_1_not_continuing,
|
||||||
outputFormat.ErrorMessage,
|
outputFormat.ErrorMessage,
|
||||||
doneSectors);
|
doneSectors);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1573,8 +1567,8 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
warning = true;
|
warning = true;
|
||||||
|
|
||||||
AaruLogging.Error(UI.Error_0_writing_sector_1_continuing,
|
AaruLogging.Error(UI.Error_0_writing_sector_1_continuing,
|
||||||
outputFormat.ErrorMessage,
|
outputFormat.ErrorMessage,
|
||||||
doneSectors);
|
doneSectors);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1683,8 +1677,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
{
|
{
|
||||||
warning = true;
|
warning = true;
|
||||||
|
|
||||||
AaruLogging.Error(UI.Error_0_writing_tag_continuing,
|
AaruLogging.Error(UI.Error_0_writing_tag_continuing, outputFormat.ErrorMessage);
|
||||||
outputFormat.ErrorMessage);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1755,9 +1748,7 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
{
|
{
|
||||||
warning = true;
|
warning = true;
|
||||||
|
|
||||||
AaruLogging.Error(UI.Error_0_reading_tag_for_sector_1_continuing,
|
AaruLogging.Error(UI.Error_0_reading_tag_for_sector_1_continuing, errno, doneSectors);
|
||||||
errno,
|
|
||||||
doneSectors);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -1782,8 +1773,8 @@ public sealed class ImageConvertViewModel : ViewModelBase
|
|||||||
warning = true;
|
warning = true;
|
||||||
|
|
||||||
AaruLogging.Error(UI.Error_0_writing_tag_for_sector_1_continuing,
|
AaruLogging.Error(UI.Error_0_writing_tag_for_sector_1_continuing,
|
||||||
outputFormat.ErrorMessage,
|
outputFormat.ErrorMessage,
|
||||||
doneSectors);
|
doneSectors);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -54,6 +54,7 @@ using Aaru.Core.Media.Info;
|
|||||||
using Aaru.Devices;
|
using Aaru.Devices;
|
||||||
using Aaru.Gui.Models;
|
using Aaru.Gui.Models;
|
||||||
using Aaru.Localization;
|
using Aaru.Localization;
|
||||||
|
using Aaru.Logging;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using Avalonia.Platform.Storage;
|
using Avalonia.Platform.Storage;
|
||||||
using Avalonia.Threading;
|
using Avalonia.Threading;
|
||||||
@@ -499,7 +500,7 @@ public sealed class MediaDumpViewModel : ViewModelBase
|
|||||||
{
|
{
|
||||||
this.RaiseAndSetIfChanged(ref _existingMetadata, value);
|
this.RaiseAndSetIfChanged(ref _existingMetadata, value);
|
||||||
|
|
||||||
if(value == false)
|
if(!value)
|
||||||
{
|
{
|
||||||
_sidecar = null;
|
_sidecar = null;
|
||||||
|
|
||||||
@@ -857,9 +858,9 @@ public sealed class MediaDumpViewModel : ViewModelBase
|
|||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
var dumpLog = new DumpLog(_outputPrefix + ".log", _dev, false);
|
DumpLog.StartLog(_dev, false);
|
||||||
|
|
||||||
dumpLog.WriteLine(UI.Output_image_format_0, SelectedPlugin.Name);
|
AaruLogging.WriteLine(UI.Output_image_format_0, SelectedPlugin.Name);
|
||||||
|
|
||||||
var errorLog = new ErrorLog(_outputPrefix + ".error.log");
|
var errorLog = new ErrorLog(_outputPrefix + ".error.log");
|
||||||
|
|
||||||
@@ -873,15 +874,14 @@ public sealed class MediaDumpViewModel : ViewModelBase
|
|||||||
Persistent,
|
Persistent,
|
||||||
StopOnError,
|
StopOnError,
|
||||||
_resume,
|
_resume,
|
||||||
dumpLog,
|
|
||||||
encoding,
|
encoding,
|
||||||
_outputPrefix,
|
_outputPrefix,
|
||||||
Destination,
|
Destination,
|
||||||
parsedOptions,
|
parsedOptions,
|
||||||
_sidecar,
|
_sidecar,
|
||||||
(uint)Skipped,
|
(uint)Skipped,
|
||||||
ExistingMetadata == false,
|
!ExistingMetadata,
|
||||||
Trim == false,
|
!Trim,
|
||||||
Track1Pregap,
|
Track1Pregap,
|
||||||
true,
|
true,
|
||||||
false,
|
false,
|
||||||
|
|||||||
@@ -429,8 +429,8 @@
|
|||||||
<value>[red]{0} sectors took more than 500 ms.[/]</value>
|
<value>[red]{0} sectors took more than 500 ms.[/]</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="_0_sectors_could_not_be_read" xml:space="preserve">
|
<data name="_0_sectors_could_not_be_read" xml:space="preserve">
|
||||||
<value>[maroon]{0} sectors could not be read.[/]</value>
|
<value>[maroon]{0} sectors could not be read.[/]</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="Testing_0_seeks_longest_seek_took_1_ms_fastest_one_took_2_ms_3_ms_average" xml:space="preserve">
|
<data name="Testing_0_seeks_longest_seek_took_1_ms_fastest_one_took_2_ms_3_ms_average" xml:space="preserve">
|
||||||
<value>[slateblue1]Testing [teal]{0}[/] seeks, longest seek took [aqua]{1:F3}[/] ms, fastest one took [aqua]{2:F3}[/] ms. ([aqua]{3:F3}[/] ms average)[/]</value>
|
<value>[slateblue1]Testing [teal]{0}[/] seeks, longest seek took [aqua]{1:F3}[/] ms, fastest one took [aqua]{2:F3}[/] ms. ([aqua]{3:F3}[/] ms average)[/]</value>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -335,7 +335,6 @@ public abstract class OpticalImageConvertIssueTest
|
|||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
null,
|
null,
|
||||||
null,
|
|
||||||
smallestPregapLbaPerTrack,
|
smallestPregapLbaPerTrack,
|
||||||
false,
|
false,
|
||||||
out _);
|
out _);
|
||||||
@@ -376,7 +375,6 @@ public abstract class OpticalImageConvertIssueTest
|
|||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
null,
|
null,
|
||||||
null,
|
|
||||||
smallestPregapLbaPerTrack,
|
smallestPregapLbaPerTrack,
|
||||||
false,
|
false,
|
||||||
out _);
|
out _);
|
||||||
|
|||||||
@@ -434,7 +434,6 @@ public abstract class WritableOpticalMediaImageTest : BaseWritableMediaImageTest
|
|||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
null,
|
null,
|
||||||
null,
|
|
||||||
smallestPregapLbaPerTrack,
|
smallestPregapLbaPerTrack,
|
||||||
false,
|
false,
|
||||||
out _);
|
out _);
|
||||||
@@ -475,7 +474,6 @@ public abstract class WritableOpticalMediaImageTest : BaseWritableMediaImageTest
|
|||||||
true,
|
true,
|
||||||
true,
|
true,
|
||||||
null,
|
null,
|
||||||
null,
|
|
||||||
smallestPregapLbaPerTrack,
|
smallestPregapLbaPerTrack,
|
||||||
false,
|
false,
|
||||||
out _);
|
out _);
|
||||||
@@ -568,7 +566,6 @@ public abstract class WritableOpticalMediaImageTest : BaseWritableMediaImageTest
|
|||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
null,
|
|
||||||
outputFormat);
|
outputFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -87,33 +87,25 @@ sealed class ConvertImageCommand : Command<ConvertImageCommand.Settings>
|
|||||||
AaruLogging.Debug(MODULE_NAME, "--creator={0}", Markup.Escape(settings.Creator ?? ""));
|
AaruLogging.Debug(MODULE_NAME, "--creator={0}", Markup.Escape(settings.Creator ?? ""));
|
||||||
AaruLogging.Debug(MODULE_NAME, "--debug={0}", settings.Debug);
|
AaruLogging.Debug(MODULE_NAME, "--debug={0}", settings.Debug);
|
||||||
|
|
||||||
AaruLogging.Debug(MODULE_NAME,
|
AaruLogging.Debug(MODULE_NAME, "--drive-manufacturer={0}", Markup.Escape(settings.DriveManufacturer ?? ""));
|
||||||
"--drive-manufacturer={0}",
|
|
||||||
Markup.Escape(settings.DriveManufacturer ?? ""));
|
|
||||||
|
|
||||||
AaruLogging.Debug(MODULE_NAME, "--drive-model={0}", Markup.Escape(settings.DriveModel ?? ""));
|
AaruLogging.Debug(MODULE_NAME, "--drive-model={0}", Markup.Escape(settings.DriveModel ?? ""));
|
||||||
|
|
||||||
AaruLogging.Debug(MODULE_NAME,
|
AaruLogging.Debug(MODULE_NAME, "--drive-revision={0}", Markup.Escape(settings.DriveFirmwareRevision ?? ""));
|
||||||
"--drive-revision={0}",
|
|
||||||
Markup.Escape(settings.DriveFirmwareRevision ?? ""));
|
|
||||||
|
|
||||||
AaruLogging.Debug(MODULE_NAME, "--drive-serial={0}", Markup.Escape(settings.DriveSerialNumber ?? ""));
|
AaruLogging.Debug(MODULE_NAME, "--drive-serial={0}", Markup.Escape(settings.DriveSerialNumber ?? ""));
|
||||||
AaruLogging.Debug(MODULE_NAME, "--force={0}", settings.Force);
|
AaruLogging.Debug(MODULE_NAME, "--force={0}", settings.Force);
|
||||||
AaruLogging.Debug(MODULE_NAME, "--format={0}", Markup.Escape(settings.Format ?? ""));
|
AaruLogging.Debug(MODULE_NAME, "--format={0}", Markup.Escape(settings.Format ?? ""));
|
||||||
AaruLogging.Debug(MODULE_NAME, "--geometry={0}", Markup.Escape(settings.Geometry ?? ""));
|
AaruLogging.Debug(MODULE_NAME, "--geometry={0}", Markup.Escape(settings.Geometry ?? ""));
|
||||||
AaruLogging.Debug(MODULE_NAME, "--input={0}", Markup.Escape(settings.InputPath ?? ""));
|
AaruLogging.Debug(MODULE_NAME, "--input={0}", Markup.Escape(settings.InputPath ?? ""));
|
||||||
AaruLogging.Debug(MODULE_NAME, "--media-barcode={0}", Markup.Escape(settings.MediaBarcode ?? ""));
|
AaruLogging.Debug(MODULE_NAME, "--media-barcode={0}", Markup.Escape(settings.MediaBarcode ?? ""));
|
||||||
AaruLogging.Debug(MODULE_NAME, "--media-lastsequence={0}", settings.LastMediaSequence);
|
AaruLogging.Debug(MODULE_NAME, "--media-lastsequence={0}", settings.LastMediaSequence);
|
||||||
|
|
||||||
AaruLogging.Debug(MODULE_NAME,
|
AaruLogging.Debug(MODULE_NAME, "--media-manufacturer={0}", Markup.Escape(settings.MediaManufacturer ?? ""));
|
||||||
"--media-manufacturer={0}",
|
|
||||||
Markup.Escape(settings.MediaManufacturer ?? ""));
|
|
||||||
|
|
||||||
AaruLogging.Debug(MODULE_NAME, "--media-model={0}", Markup.Escape(settings.MediaModel ?? ""));
|
AaruLogging.Debug(MODULE_NAME, "--media-model={0}", Markup.Escape(settings.MediaModel ?? ""));
|
||||||
|
|
||||||
AaruLogging.Debug(MODULE_NAME,
|
AaruLogging.Debug(MODULE_NAME, "--media-partnumber={0}", Markup.Escape(settings.MediaPartNumber ?? ""));
|
||||||
"--media-partnumber={0}",
|
|
||||||
Markup.Escape(settings.MediaPartNumber ?? ""));
|
|
||||||
|
|
||||||
AaruLogging.Debug(MODULE_NAME, "--media-sequence={0}", settings.MediaSequence);
|
AaruLogging.Debug(MODULE_NAME, "--media-sequence={0}", settings.MediaSequence);
|
||||||
AaruLogging.Debug(MODULE_NAME, "--media-serial={0}", Markup.Escape(settings.MediaSerialNumber ?? ""));
|
AaruLogging.Debug(MODULE_NAME, "--media-serial={0}", Markup.Escape(settings.MediaSerialNumber ?? ""));
|
||||||
@@ -489,7 +481,7 @@ sealed class ConvertImageCommand : Command<ConvertImageCommand.Settings>
|
|||||||
AaruLogging.Error(UI.Converting_image_will_lose_sector_tag_0, sectorTag);
|
AaruLogging.Error(UI.Converting_image_will_lose_sector_tag_0, sectorTag);
|
||||||
|
|
||||||
AaruLogging.Error(UI
|
AaruLogging.Error(UI
|
||||||
.If_you_dont_care_use_force_option_This_will_skip_all_sector_tags_converting_only_user_data);
|
.If_you_dont_care_use_force_option_This_will_skip_all_sector_tags_converting_only_user_data);
|
||||||
|
|
||||||
return (int)ErrorNumber.DataWillBeLost;
|
return (int)ErrorNumber.DataWillBeLost;
|
||||||
}
|
}
|
||||||
@@ -643,7 +635,7 @@ sealed class ConvertImageCommand : Command<ConvertImageCommand.Settings>
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
AaruLogging.Error(UI.Error_0_writing_media_tag_not_continuing,
|
AaruLogging.Error(UI.Error_0_writing_media_tag_not_continuing,
|
||||||
outputFormat.ErrorMessage);
|
outputFormat.ErrorMessage);
|
||||||
|
|
||||||
errorNumber = ErrorNumber.WriteError;
|
errorNumber = ErrorNumber.WriteError;
|
||||||
}
|
}
|
||||||
@@ -736,14 +728,14 @@ sealed class ConvertImageCommand : Command<ConvertImageCommand.Settings>
|
|||||||
if(settings.Force)
|
if(settings.Force)
|
||||||
{
|
{
|
||||||
AaruLogging.Error(UI.Error_0_reading_sector_1_continuing,
|
AaruLogging.Error(UI.Error_0_reading_sector_1_continuing,
|
||||||
errno,
|
errno,
|
||||||
doneSectors + track.StartSector);
|
doneSectors + track.StartSector);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AaruLogging.Error(UI.Error_0_reading_sector_1_not_continuing,
|
AaruLogging.Error(UI.Error_0_reading_sector_1_not_continuing,
|
||||||
errno,
|
errno,
|
||||||
doneSectors + track.StartSector);
|
doneSectors + track.StartSector);
|
||||||
|
|
||||||
errno = ErrorNumber.WriteError;
|
errno = ErrorNumber.WriteError;
|
||||||
|
|
||||||
@@ -755,9 +747,8 @@ sealed class ConvertImageCommand : Command<ConvertImageCommand.Settings>
|
|||||||
{
|
{
|
||||||
if(!settings.Force)
|
if(!settings.Force)
|
||||||
{
|
{
|
||||||
AaruLogging
|
AaruLogging.Error(UI
|
||||||
.Error(UI
|
.Input_image_is_not_returning_raw_sectors_use_force_if_you_want_to_continue);
|
||||||
.Input_image_is_not_returning_raw_sectors_use_force_if_you_want_to_continue);
|
|
||||||
|
|
||||||
errno = ErrorNumber.InOutError;
|
errno = ErrorNumber.InOutError;
|
||||||
|
|
||||||
@@ -924,14 +915,14 @@ sealed class ConvertImageCommand : Command<ConvertImageCommand.Settings>
|
|||||||
if(settings.Force)
|
if(settings.Force)
|
||||||
{
|
{
|
||||||
AaruLogging.Error(UI.Error_0_reading_sector_1_continuing,
|
AaruLogging.Error(UI.Error_0_reading_sector_1_continuing,
|
||||||
errno,
|
errno,
|
||||||
doneSectors + track.StartSector);
|
doneSectors + track.StartSector);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AaruLogging.Error(UI.Error_0_reading_sector_1_not_continuing,
|
AaruLogging.Error(UI.Error_0_reading_sector_1_not_continuing,
|
||||||
errno,
|
errno,
|
||||||
doneSectors + track.StartSector);
|
doneSectors + track.StartSector);
|
||||||
|
|
||||||
errno = ErrorNumber.WriteError;
|
errno = ErrorNumber.WriteError;
|
||||||
|
|
||||||
@@ -945,14 +936,14 @@ sealed class ConvertImageCommand : Command<ConvertImageCommand.Settings>
|
|||||||
if(settings.Force)
|
if(settings.Force)
|
||||||
{
|
{
|
||||||
AaruLogging.Error(UI.Error_0_writing_sector_1_continuing,
|
AaruLogging.Error(UI.Error_0_writing_sector_1_continuing,
|
||||||
outputOptical.ErrorMessage,
|
outputOptical.ErrorMessage,
|
||||||
doneSectors + track.StartSector);
|
doneSectors + track.StartSector);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AaruLogging.Error(UI.Error_0_writing_sector_1_not_continuing,
|
AaruLogging.Error(UI.Error_0_writing_sector_1_not_continuing,
|
||||||
outputOptical.ErrorMessage,
|
outputOptical.ErrorMessage,
|
||||||
doneSectors + track.StartSector);
|
doneSectors + track.StartSector);
|
||||||
|
|
||||||
errno = ErrorNumber.WriteError;
|
errno = ErrorNumber.WriteError;
|
||||||
|
|
||||||
@@ -1101,13 +1092,13 @@ sealed class ConvertImageCommand : Command<ConvertImageCommand.Settings>
|
|||||||
if(settings.Force)
|
if(settings.Force)
|
||||||
{
|
{
|
||||||
AaruLogging.Error(UI.Error_0_writing_tag_continuing,
|
AaruLogging.Error(UI.Error_0_writing_tag_continuing,
|
||||||
outputOptical.ErrorMessage);
|
outputOptical.ErrorMessage);
|
||||||
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
AaruLogging.Error(UI.Error_0_writing_tag_not_continuing,
|
AaruLogging.Error(UI.Error_0_writing_tag_not_continuing,
|
||||||
outputOptical.ErrorMessage);
|
outputOptical.ErrorMessage);
|
||||||
|
|
||||||
errno = ErrorNumber.WriteError;
|
errno = ErrorNumber.WriteError;
|
||||||
|
|
||||||
@@ -1120,12 +1111,12 @@ sealed class ConvertImageCommand : Command<ConvertImageCommand.Settings>
|
|||||||
if(settings.Force)
|
if(settings.Force)
|
||||||
{
|
{
|
||||||
AaruLogging.Error(UI.Error_0_writing_tag_continuing,
|
AaruLogging.Error(UI.Error_0_writing_tag_continuing,
|
||||||
outputOptical.ErrorMessage);
|
outputOptical.ErrorMessage);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AaruLogging.Error(UI.Error_0_writing_tag_not_continuing,
|
AaruLogging.Error(UI.Error_0_writing_tag_not_continuing,
|
||||||
outputOptical.ErrorMessage);
|
outputOptical.ErrorMessage);
|
||||||
|
|
||||||
errno = ErrorNumber.WriteError;
|
errno = ErrorNumber.WriteError;
|
||||||
|
|
||||||
@@ -1182,7 +1173,6 @@ sealed class ConvertImageCommand : Command<ConvertImageCommand.Settings>
|
|||||||
fixSubchannel,
|
fixSubchannel,
|
||||||
fixSubchannelCrc,
|
fixSubchannelCrc,
|
||||||
null,
|
null,
|
||||||
null,
|
|
||||||
smallestPregapLbaPerTrack,
|
smallestPregapLbaPerTrack,
|
||||||
false,
|
false,
|
||||||
out _);
|
out _);
|
||||||
@@ -1204,18 +1194,16 @@ sealed class ConvertImageCommand : Command<ConvertImageCommand.Settings>
|
|||||||
|
|
||||||
if(settings.Force)
|
if(settings.Force)
|
||||||
{
|
{
|
||||||
AaruLogging
|
AaruLogging.Error(UI.Error_0_reading_tag_for_sector_1_continuing,
|
||||||
.Error(UI.Error_0_reading_tag_for_sector_1_continuing,
|
errno,
|
||||||
errno,
|
doneSectors + track.StartSector);
|
||||||
doneSectors + track.StartSector);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AaruLogging
|
AaruLogging
|
||||||
.Error(UI
|
.Error(UI.Error_0_reading_tag_for_sector_1_not_continuing,
|
||||||
.Error_0_reading_tag_for_sector_1_not_continuing,
|
errno,
|
||||||
errno,
|
doneSectors + track.StartSector);
|
||||||
doneSectors + track.StartSector);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1249,7 +1237,6 @@ sealed class ConvertImageCommand : Command<ConvertImageCommand.Settings>
|
|||||||
fixSubchannel,
|
fixSubchannel,
|
||||||
fixSubchannelCrc,
|
fixSubchannelCrc,
|
||||||
null,
|
null,
|
||||||
null,
|
|
||||||
smallestPregapLbaPerTrack,
|
smallestPregapLbaPerTrack,
|
||||||
false,
|
false,
|
||||||
out _);
|
out _);
|
||||||
@@ -1272,18 +1259,16 @@ sealed class ConvertImageCommand : Command<ConvertImageCommand.Settings>
|
|||||||
|
|
||||||
if(settings.Force)
|
if(settings.Force)
|
||||||
{
|
{
|
||||||
AaruLogging
|
AaruLogging.Error(UI.Error_0_reading_tag_for_sector_1_continuing,
|
||||||
.Error(UI.Error_0_reading_tag_for_sector_1_continuing,
|
errno,
|
||||||
errno,
|
doneSectors + track.StartSector);
|
||||||
doneSectors + track.StartSector);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AaruLogging
|
AaruLogging
|
||||||
.Error(UI
|
.Error(UI.Error_0_reading_tag_for_sector_1_not_continuing,
|
||||||
.Error_0_reading_tag_for_sector_1_not_continuing,
|
errno,
|
||||||
errno,
|
doneSectors + track.StartSector);
|
||||||
doneSectors + track.StartSector);
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1294,17 +1279,15 @@ sealed class ConvertImageCommand : Command<ConvertImageCommand.Settings>
|
|||||||
{
|
{
|
||||||
if(settings.Force)
|
if(settings.Force)
|
||||||
{
|
{
|
||||||
AaruLogging
|
AaruLogging.Error(UI.Error_0_writing_tag_for_sector_1_continuing,
|
||||||
.Error(UI.Error_0_writing_tag_for_sector_1_continuing,
|
outputOptical.ErrorMessage,
|
||||||
outputOptical.ErrorMessage,
|
doneSectors + track.StartSector);
|
||||||
doneSectors + track.StartSector);
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AaruLogging
|
AaruLogging.Error(UI.Error_0_writing_tag_for_sector_1_not_continuing,
|
||||||
.Error(UI.Error_0_writing_tag_for_sector_1_not_continuing,
|
outputOptical.ErrorMessage,
|
||||||
outputOptical.ErrorMessage,
|
doneSectors + track.StartSector);
|
||||||
doneSectors + track.StartSector);
|
|
||||||
|
|
||||||
errno = ErrorNumber.WriteError;
|
errno = ErrorNumber.WriteError;
|
||||||
|
|
||||||
@@ -1390,7 +1373,6 @@ sealed class ConvertImageCommand : Command<ConvertImageCommand.Settings>
|
|||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
null,
|
null,
|
||||||
null,
|
|
||||||
outputOptical);
|
outputOptical);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1414,7 +1396,7 @@ sealed class ConvertImageCommand : Command<ConvertImageCommand.Settings>
|
|||||||
if(!outputMedia.SetGeometry(chs.cylinders, chs.heads, chs.sectors))
|
if(!outputMedia.SetGeometry(chs.cylinders, chs.heads, chs.sectors))
|
||||||
{
|
{
|
||||||
AaruLogging.Error(UI.Error_0_setting_geometry_image_may_be_incorrect_continuing,
|
AaruLogging.Error(UI.Error_0_setting_geometry_image_may_be_incorrect_continuing,
|
||||||
outputMedia.ErrorMessage);
|
outputMedia.ErrorMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1466,14 +1448,14 @@ sealed class ConvertImageCommand : Command<ConvertImageCommand.Settings>
|
|||||||
if(settings.Force)
|
if(settings.Force)
|
||||||
{
|
{
|
||||||
AaruLogging.Error(UI.Error_0_reading_sector_1_continuing,
|
AaruLogging.Error(UI.Error_0_reading_sector_1_continuing,
|
||||||
errno,
|
errno,
|
||||||
doneSectors);
|
doneSectors);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AaruLogging.Error(UI.Error_0_reading_sector_1_not_continuing,
|
AaruLogging.Error(UI.Error_0_reading_sector_1_not_continuing,
|
||||||
errno,
|
errno,
|
||||||
doneSectors);
|
doneSectors);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1498,14 +1480,14 @@ sealed class ConvertImageCommand : Command<ConvertImageCommand.Settings>
|
|||||||
if(settings.Force)
|
if(settings.Force)
|
||||||
{
|
{
|
||||||
AaruLogging.Error(UI.Error_0_reading_sector_1_continuing,
|
AaruLogging.Error(UI.Error_0_reading_sector_1_continuing,
|
||||||
errno,
|
errno,
|
||||||
doneSectors);
|
doneSectors);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AaruLogging.Error(UI.Error_0_reading_sector_1_not_continuing,
|
AaruLogging.Error(UI.Error_0_reading_sector_1_not_continuing,
|
||||||
errno,
|
errno,
|
||||||
doneSectors);
|
doneSectors);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1517,14 +1499,14 @@ sealed class ConvertImageCommand : Command<ConvertImageCommand.Settings>
|
|||||||
if(settings.Force)
|
if(settings.Force)
|
||||||
{
|
{
|
||||||
AaruLogging.Error(UI.Error_0_writing_sector_1_continuing,
|
AaruLogging.Error(UI.Error_0_writing_sector_1_continuing,
|
||||||
outputMedia.ErrorMessage,
|
outputMedia.ErrorMessage,
|
||||||
doneSectors);
|
doneSectors);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AaruLogging.Error(UI.Error_0_writing_sector_1_not_continuing,
|
AaruLogging.Error(UI.Error_0_writing_sector_1_not_continuing,
|
||||||
outputMedia.ErrorMessage,
|
outputMedia.ErrorMessage,
|
||||||
doneSectors);
|
doneSectors);
|
||||||
|
|
||||||
errno = ErrorNumber.WriteError;
|
errno = ErrorNumber.WriteError;
|
||||||
|
|
||||||
@@ -1597,14 +1579,14 @@ sealed class ConvertImageCommand : Command<ConvertImageCommand.Settings>
|
|||||||
if(settings.Force)
|
if(settings.Force)
|
||||||
{
|
{
|
||||||
AaruLogging.Error(UI.Error_0_reading_sector_1_continuing,
|
AaruLogging.Error(UI.Error_0_reading_sector_1_continuing,
|
||||||
errno,
|
errno,
|
||||||
doneSectors);
|
doneSectors);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AaruLogging.Error(UI.Error_0_reading_sector_1_not_continuing,
|
AaruLogging.Error(UI.Error_0_reading_sector_1_not_continuing,
|
||||||
errno,
|
errno,
|
||||||
doneSectors);
|
doneSectors);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1615,14 +1597,14 @@ sealed class ConvertImageCommand : Command<ConvertImageCommand.Settings>
|
|||||||
if(settings.Force)
|
if(settings.Force)
|
||||||
{
|
{
|
||||||
AaruLogging.Error(UI.Error_0_writing_sector_1_continuing,
|
AaruLogging.Error(UI.Error_0_writing_sector_1_continuing,
|
||||||
outputMedia.ErrorMessage,
|
outputMedia.ErrorMessage,
|
||||||
doneSectors);
|
doneSectors);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AaruLogging.Error(UI.Error_0_writing_sector_1_not_continuing,
|
AaruLogging.Error(UI.Error_0_writing_sector_1_not_continuing,
|
||||||
outputMedia.ErrorMessage,
|
outputMedia.ErrorMessage,
|
||||||
doneSectors);
|
doneSectors);
|
||||||
|
|
||||||
errno = ErrorNumber.WriteError;
|
errno = ErrorNumber.WriteError;
|
||||||
|
|
||||||
@@ -1756,8 +1738,7 @@ sealed class ConvertImageCommand : Command<ConvertImageCommand.Settings>
|
|||||||
|
|
||||||
if(!closed)
|
if(!closed)
|
||||||
{
|
{
|
||||||
AaruLogging.Error(UI.Error_0_closing_output_image_Contents_are_not_correct,
|
AaruLogging.Error(UI.Error_0_closing_output_image_Contents_are_not_correct, outputFormat.ErrorMessage);
|
||||||
outputFormat.ErrorMessage);
|
|
||||||
|
|
||||||
return (int)ErrorNumber.WriteError;
|
return (int)ErrorNumber.WriteError;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -474,18 +474,12 @@ sealed class DumpMediaCommand : Command<DumpMediaCommand.Settings>
|
|||||||
|
|
||||||
IBaseWritableImage outputFormat = candidates[0];
|
IBaseWritableImage outputFormat = candidates[0];
|
||||||
|
|
||||||
var dumpLog = new DumpLog(outputPrefix + ".log", dev, settings.Private);
|
DumpLog.StartLog(dev, settings.Private);
|
||||||
|
|
||||||
if(settings.Verbose)
|
if(settings.Verbose)
|
||||||
{
|
|
||||||
dumpLog.WriteLine(UI.Output_image_format_0_1, outputFormat.Name, outputFormat.Id);
|
|
||||||
AaruLogging.Verbose(UI.Output_image_format_0_1, outputFormat.Name, outputFormat.Id);
|
AaruLogging.Verbose(UI.Output_image_format_0_1, outputFormat.Name, outputFormat.Id);
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
|
||||||
dumpLog.WriteLine(UI.Output_image_format_0, outputFormat.Name);
|
|
||||||
AaruLogging.WriteLine(UI.Output_image_format_0, outputFormat.Name);
|
AaruLogging.WriteLine(UI.Output_image_format_0, outputFormat.Name);
|
||||||
}
|
|
||||||
|
|
||||||
var errorLog = new ErrorLog(outputPrefix + ".error.log");
|
var errorLog = new ErrorLog(outputPrefix + ".error.log");
|
||||||
|
|
||||||
@@ -499,7 +493,6 @@ sealed class DumpMediaCommand : Command<DumpMediaCommand.Settings>
|
|||||||
settings.Persistent,
|
settings.Persistent,
|
||||||
settings.StopOnError,
|
settings.StopOnError,
|
||||||
resumeClass,
|
resumeClass,
|
||||||
dumpLog,
|
|
||||||
encodingClass,
|
encodingClass,
|
||||||
outputPrefix,
|
outputPrefix,
|
||||||
outputPrefix + extension,
|
outputPrefix + extension,
|
||||||
@@ -535,19 +528,16 @@ sealed class DumpMediaCommand : Command<DumpMediaCommand.Settings>
|
|||||||
.Columns(new TaskDescriptionColumn(), new ProgressBarColumn(), new PercentageColumn())
|
.Columns(new TaskDescriptionColumn(), new ProgressBarColumn(), new PercentageColumn())
|
||||||
.Start(ctx =>
|
.Start(ctx =>
|
||||||
{
|
{
|
||||||
dumper.UpdateStatus += text => { AaruLogging.WriteLine(Markup.Escape(text)); };
|
dumper.UpdateStatus += text => { AaruLogging.WriteLine(text); };
|
||||||
|
|
||||||
dumper.ErrorMessage += text => { AaruLogging.Error($"[red]{Markup.Escape(text)}[/]"); };
|
dumper.ErrorMessage += text => { AaruLogging.Error(text); };
|
||||||
|
|
||||||
dumper.StoppingErrorMessage += text =>
|
dumper.StoppingErrorMessage += text => { AaruLogging.Error(text); };
|
||||||
{
|
|
||||||
AaruLogging.Error($"[red]{Markup.Escape(text)}[/]");
|
|
||||||
};
|
|
||||||
|
|
||||||
dumper.UpdateProgress += (text, current, maximum) =>
|
dumper.UpdateProgress += (text, current, maximum) =>
|
||||||
{
|
{
|
||||||
_progressTask1 ??= ctx.AddTask("Progress");
|
_progressTask1 ??= ctx.AddTask("Progress");
|
||||||
_progressTask1.Description = Markup.Escape(text);
|
_progressTask1.Description = text;
|
||||||
_progressTask1.Value = current;
|
_progressTask1.Value = current;
|
||||||
_progressTask1.MaxValue = maximum;
|
_progressTask1.MaxValue = maximum;
|
||||||
};
|
};
|
||||||
@@ -555,10 +545,10 @@ sealed class DumpMediaCommand : Command<DumpMediaCommand.Settings>
|
|||||||
dumper.PulseProgress += text =>
|
dumper.PulseProgress += text =>
|
||||||
{
|
{
|
||||||
if(_progressTask1 is null)
|
if(_progressTask1 is null)
|
||||||
ctx.AddTask(Markup.Escape(text)).IsIndeterminate();
|
ctx.AddTask(text).IsIndeterminate();
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_progressTask1.Description = Markup.Escape(text);
|
_progressTask1.Description = text;
|
||||||
_progressTask1.IsIndeterminate = true;
|
_progressTask1.IsIndeterminate = true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -582,7 +572,7 @@ sealed class DumpMediaCommand : Command<DumpMediaCommand.Settings>
|
|||||||
dumper.UpdateProgress2 += (text, current, maximum) =>
|
dumper.UpdateProgress2 += (text, current, maximum) =>
|
||||||
{
|
{
|
||||||
_progressTask2 ??= ctx.AddTask("Progress");
|
_progressTask2 ??= ctx.AddTask("Progress");
|
||||||
_progressTask2.Description = Markup.Escape(text);
|
_progressTask2.Description = text;
|
||||||
_progressTask2.Value = current;
|
_progressTask2.Value = current;
|
||||||
_progressTask2.MaxValue = maximum;
|
_progressTask2.MaxValue = maximum;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -798,15 +798,14 @@ sealed class MediaInfoCommand : Command<MediaInfoCommand.Settings>
|
|||||||
|
|
||||||
if(scsiInfo.Toc != null || scsiInfo.RawToc != null)
|
if(scsiInfo.Toc != null || scsiInfo.RawToc != null)
|
||||||
{
|
{
|
||||||
Track[] tracks =
|
Track[] tracks = Dump.GetCdTracks(dev, false, out long lastSector, null, null, null, out _, null, null);
|
||||||
Dump.GetCdTracks(dev, null, false, out long lastSector, null, null, null, out _, null, null);
|
|
||||||
|
|
||||||
if(tracks != null)
|
if(tracks != null)
|
||||||
{
|
{
|
||||||
uint firstLba = (uint)tracks.Min(t => t.StartSector);
|
uint firstLba = (uint)tracks.Min(t => t.StartSector);
|
||||||
|
|
||||||
bool supportsPqSubchannel = Dump.SupportsPqSubchannel(dev, null, null, firstLba);
|
bool supportsPqSubchannel = Dump.SupportsPqSubchannel(dev, null, firstLba);
|
||||||
bool supportsRwSubchannel = Dump.SupportsRwSubchannel(dev, null, null, firstLba);
|
bool supportsRwSubchannel = Dump.SupportsRwSubchannel(dev, null, firstLba);
|
||||||
|
|
||||||
// Open main database
|
// Open main database
|
||||||
var ctx = AaruContext.Create(Aaru.Settings.Settings.MainDbPath);
|
var ctx = AaruContext.Create(Aaru.Settings.Settings.MainDbPath);
|
||||||
@@ -818,7 +817,6 @@ sealed class MediaInfoCommand : Command<MediaInfoCommand.Settings>
|
|||||||
d.Revision == dev.FirmwareRevision);
|
d.Revision == dev.FirmwareRevision);
|
||||||
|
|
||||||
Dump.SolveTrackPregaps(dev,
|
Dump.SolveTrackPregaps(dev,
|
||||||
null,
|
|
||||||
null,
|
null,
|
||||||
tracks,
|
tracks,
|
||||||
supportsPqSubchannel,
|
supportsPqSubchannel,
|
||||||
@@ -867,7 +865,6 @@ sealed class MediaInfoCommand : Command<MediaInfoCommand.Settings>
|
|||||||
debug,
|
debug,
|
||||||
dev,
|
dev,
|
||||||
scsiInfo.MediaType,
|
scsiInfo.MediaType,
|
||||||
null,
|
|
||||||
tracks,
|
tracks,
|
||||||
null,
|
null,
|
||||||
out int? driveOffset,
|
out int? driveOffset,
|
||||||
|
|||||||
Reference in New Issue
Block a user