Add support for negative sectors to read and write sector calls in images.

This commit is contained in:
2025-10-23 03:07:43 +01:00
parent 0c19fe1b11
commit 69738f5f1a
289 changed files with 2676 additions and 1352 deletions

View File

@@ -54,45 +54,53 @@ public interface IMediaImage : IBaseImage
/// <summary>Reads a sector's user data.</summary>
/// <returns>The sector's user data.</returns>
/// <param name="sectorAddress">Sector address (LBA).</param>
/// <param name="negative"></param>
/// <param name="buffer"></param>
/// <param name="sectorStatus"></param>
ErrorNumber ReadSector(ulong sectorAddress, out byte[] buffer, out SectorStatus sectorStatus);
ErrorNumber ReadSector(ulong sectorAddress, bool negative, out byte[] buffer, out SectorStatus sectorStatus);
/// <summary>Reads a complete sector (user data + all tags).</summary>
/// <returns>The complete sector. Format depends on disk type.</returns>
/// <param name="sectorAddress">Sector address (LBA).</param>
/// <param name="negative"></param>
/// <param name="buffer"></param>
/// <param name="sectorStatus"></param>
ErrorNumber ReadSectorLong(ulong sectorAddress, out byte[] buffer, out SectorStatus sectorStatus);
ErrorNumber ReadSectorLong(ulong sectorAddress, bool negative, out byte[] buffer, out SectorStatus sectorStatus);
/// <summary>Reads user data from several sectors.</summary>
/// <returns>The sectors user data.</returns>
/// <param name="sectorAddress">Starting sector address (LBA).</param>
/// <param name="negative"></param>
/// <param name="length">How many sectors to read.</param>
/// <param name="buffer"></param>
/// <param name="sectorStatus"></param>
ErrorNumber ReadSectors(ulong sectorAddress, uint length, out byte[] buffer, out SectorStatus[] sectorStatus);
ErrorNumber ReadSectors(ulong sectorAddress, bool negative, uint length, out byte[] buffer,
out SectorStatus[] sectorStatus);
/// <summary>Reads several complete sector (user data + all tags).</summary>
/// <returns>The complete sectors. Format depends on disk type.</returns>
/// <param name="sectorAddress">Starting sector address (LBA).</param>
/// <param name="negative"></param>
/// <param name="length">How many sectors to read.</param>
/// <param name="buffer"></param>
/// <param name="sectorStatus"></param>
ErrorNumber ReadSectorsLong(ulong sectorAddress, uint length, out byte[] buffer, out SectorStatus[] sectorStatus);
ErrorNumber ReadSectorsLong(ulong sectorAddress, bool negative, uint length, out byte[] buffer,
out SectorStatus[] sectorStatus);
/// <summary>Reads tag from several sectors.</summary>
/// <returns>The sectors tag.</returns>
/// <param name="sectorAddress">Starting sector address (LBA).</param>
/// <param name="negative"></param>
/// <param name="length">How many sectors to read.</param>
/// <param name="tag">Tag type.</param>
/// <param name="buffer"></param>
ErrorNumber ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag, out byte[] buffer);
ErrorNumber ReadSectorsTag(ulong sectorAddress, bool negative, uint length, SectorTagType tag, out byte[] buffer);
/// <summary>Reads a sector's tag.</summary>
/// <returns>The sector's tag.</returns>
/// <param name="sectorAddress">Sector address (LBA).</param>
/// <param name="negative"></param>
/// <param name="tag">Tag type.</param>
/// <param name="buffer"></param>
ErrorNumber ReadSectorTag(ulong sectorAddress, SectorTagType tag, out byte[] buffer);
ErrorNumber ReadSectorTag(ulong sectorAddress, bool negative, SectorTagType tag, out byte[] buffer);
}

View File

@@ -65,45 +65,51 @@ public interface IWritableImage : IMediaImage, IBaseWritableImage
/// <summary>Writes a sector to the image</summary>
/// <param name="data">Sector data</param>
/// <param name="sectorAddress">Sector address</param>
/// <param name="negative"></param>
/// <param name="sectorStatus"></param>
/// <returns><c>true</c> if operating completed successfully, <c>false</c> otherwise</returns>
bool WriteSector(byte[] data, ulong sectorAddress, SectorStatus sectorStatus);
bool WriteSector(byte[] data, ulong sectorAddress, bool negative, SectorStatus sectorStatus);
/// <summary>Writes a sector to the image with main channel tags attached</summary>
/// <param name="data">Sector data with its main channel tags attached</param>
/// <param name="sectorAddress">Sector address</param>
/// <param name="negative"></param>
/// <param name="sectorStatus"></param>
/// <returns><c>true</c> if operating completed successfully, <c>false</c> otherwise</returns>
bool WriteSectorLong(byte[] data, ulong sectorAddress, SectorStatus sectorStatus);
bool WriteSectorLong(byte[] data, ulong sectorAddress, bool negative, SectorStatus sectorStatus);
/// <summary>Writes several sectors to the image</summary>
/// <param name="data">Sectors data</param>
/// <param name="sectorAddress">Sector starting address</param>
/// <param name="negative"></param>
/// <param name="length">How many sectors to write</param>
/// <param name="sectorStatus"></param>
/// <returns><c>true</c> if operating completed successfully, <c>false</c> otherwise</returns>
bool WriteSectors(byte[] data, ulong sectorAddress, uint length, SectorStatus[] sectorStatus);
bool WriteSectors(byte[] data, ulong sectorAddress, bool negative, uint length, SectorStatus[] sectorStatus);
/// <summary>Writes several sectors to the image</summary>
/// <param name="data">Sector data with their main channel tags attached</param>
/// <param name="sectorAddress">Sector starting address</param>
/// <param name="negative"></param>
/// <param name="length">How many sectors to write</param>
/// <param name="sectorStatus"></param>
/// <returns><c>true</c> if operating completed successfully, <c>false</c> otherwise</returns>
bool WriteSectorsLong(byte[] data, ulong sectorAddress, uint length, SectorStatus[] sectorStatus);
bool WriteSectorsLong(byte[] data, ulong sectorAddress, bool negative, uint length, SectorStatus[] sectorStatus);
/// <summary>Writes parallel or subchannel sector tag for several sector</summary>
/// <param name="data">Tag data to write</param>
/// <param name="sectorAddress">Starting sector address</param>
/// <param name="negative"></param>
/// <param name="length">How many sectors to write</param>
/// <param name="tag">Tag type</param>
/// <returns><c>true</c> if operating completed successfully, <c>false</c> otherwise</returns>
bool WriteSectorsTag(byte[] data, ulong sectorAddress, uint length, SectorTagType tag);
bool WriteSectorsTag(byte[] data, ulong sectorAddress, bool negative, uint length, SectorTagType tag);
/// <summary>Writes parallel or subchannel sector tag for one sector</summary>
/// <param name="data">Tag data to write</param>
/// <param name="sectorAddress">Sector address</param>
/// <param name="negative"></param>
/// <param name="tag">Tag type</param>
/// <returns><c>true</c> if operating completed successfully, <c>false</c> otherwise</returns>
bool WriteSectorTag(byte[] data, ulong sectorAddress, SectorTagType tag);
bool WriteSectorTag(byte[] data, ulong sectorAddress, bool negative, SectorTagType tag);
}

View File

@@ -339,6 +339,7 @@ public partial class Dump
outputFormat.WriteSectors(cmdBuf,
i,
false,
blocksToRead,
Enumerable.Repeat(SectorStatus.Dumped, (int)blocksToRead)
.ToArray());
@@ -359,6 +360,7 @@ public partial class Dump
outputFormat.WriteSectors(new byte[blockSize * _skip],
i,
false,
_skip,
Enumerable.Repeat(SectorStatus.NotDumped, (int)blocksToRead)
.ToArray());
@@ -448,7 +450,7 @@ public partial class Dump
_resume.BadBlocks.Remove(badSector);
extents.Add(badSector);
outputFormat.WriteSector(cmdBuf, badSector, SectorStatus.Dumped);
outputFormat.WriteSector(cmdBuf, badSector, false, SectorStatus.Dumped);
_mediaGraph?.PaintSectorGood(badSector);
}
@@ -516,7 +518,7 @@ public partial class Dump
{
_resume.BadBlocks.Remove(badSector);
extents.Add(badSector);
outputFormat.WriteSector(cmdBuf, badSector, SectorStatus.Dumped);
outputFormat.WriteSector(cmdBuf, badSector, false, SectorStatus.Dumped);
_mediaGraph?.PaintSectorGood(badSector);
UpdateStatus?.Invoke(string.Format(Localization.Core
@@ -524,7 +526,8 @@ public partial class Dump
badSector,
pass));
}
else if(_persistent) outputFormat.WriteSector(cmdBuf, badSector, SectorStatus.Errored);
else if(_persistent)
outputFormat.WriteSector(cmdBuf, badSector, false, SectorStatus.Errored);
}
if(pass < _retryPasses && !_aborted && _resume.BadBlocks.Count > 0)
@@ -627,6 +630,7 @@ public partial class Dump
outputFormat.WriteSector(cmdBuf,
(ulong)((cy * heads + hd) * sectors + (sc - 1)),
false,
SectorStatus.Dumped);
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
@@ -642,6 +646,7 @@ public partial class Dump
outputFormat.WriteSector(new byte[blockSize],
(ulong)((cy * heads + hd) * sectors + (sc - 1)),
false,
SectorStatus.Errored);
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;

View File

@@ -300,6 +300,7 @@ partial class Dump
outputOptical.WriteSectorsLong(data,
i + r,
false,
1,
Enumerable.Repeat(SectorStatus.Dumped, 1).ToArray());
@@ -333,7 +334,7 @@ partial class Dump
}
}
else
outputOptical.WriteSectorsLong(cmdBuf, i + r, 1, [SectorStatus.Dumped]);
outputOptical.WriteSectorsLong(cmdBuf, i + r, false, 1, [SectorStatus.Dumped]);
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
@@ -410,6 +411,7 @@ partial class Dump
outputOptical.WriteSectorsLong(data,
i,
false,
blocksToRead,
Enumerable.Repeat(SectorStatus.Dumped, (int)blocksToRead).ToArray());
@@ -466,16 +468,20 @@ partial class Dump
outputOptical.WriteSectorsLong(data,
i,
false,
blocksToRead,
Enumerable.Repeat(SectorStatus.Dumped, (int)blocksToRead)
.ToArray());
}
else
{
outputOptical.WriteSectorsLong(cmdBuf,
i,
false,
blocksToRead,
Enumerable.Repeat(SectorStatus.Dumped, (int)blocksToRead)
.ToArray());
}
}
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;

View File

@@ -776,11 +776,14 @@ partial class Dump
Array.Copy(cmdBuf, sectorSize, sub, 0, subSize);
if(supportsLongSectors)
{
outputFormat.WriteSectorsLong(data,
i + r,
false,
1,
Enumerable.Repeat(SectorStatus.Dumped, (int)blocksToRead)
.ToArray());
}
else
{
var cooked = new MemoryStream();
@@ -795,6 +798,7 @@ partial class Dump
outputFormat.WriteSectors(cooked.ToArray(),
i,
false,
blocksToRead,
Enumerable.Repeat(SectorStatus.Dumped, (int)blocksToRead)
.ToArray());
@@ -844,7 +848,7 @@ partial class Dump
else
{
if(supportsLongSectors)
outputFormat.WriteSectorsLong(cmdBuf, i + r, 1, [SectorStatus.Dumped]);
outputFormat.WriteSectorsLong(cmdBuf, i + r, false, 1, [SectorStatus.Dumped]);
else
{
var cooked = new MemoryStream();
@@ -859,6 +863,7 @@ partial class Dump
outputFormat.WriteSectors(cooked.ToArray(),
i,
false,
blocksToRead,
Enumerable.Repeat(SectorStatus.Dumped, (int)blocksToRead)
.ToArray());
@@ -878,12 +883,17 @@ partial class Dump
if(supportedSubchannel != MmcSubchannel.None)
{
outputFormat.WriteSectorsLong(new byte[sectorSize], i + r, 1, [SectorStatus.Errored]);
outputFormat.WriteSectorsLong(new byte[sectorSize],
i + r,
false,
1,
[SectorStatus.Errored]);
if(desiredSubchannel != MmcSubchannel.None)
{
outputFormat.WriteSectorsTag(new byte[subSize],
i + r,
false,
1,
SectorTagType.CdSectorSubchannel);
}
@@ -891,16 +901,23 @@ partial class Dump
else
{
if(supportsLongSectors)
outputFormat.WriteSectorsLong(new byte[blockSize], i + r, 1, [SectorStatus.Errored]);
outputFormat.WriteSectorsLong(new byte[blockSize],
i + r,
false,
1,
[SectorStatus.Errored]);
else
{
if(cmdBuf.Length % sectorSize == 0)
outputFormat.WriteSectors(new byte[2048], i + r, 1, [SectorStatus.Errored]);
outputFormat.WriteSectors(new byte[2048], i + r, false, 1, [SectorStatus.Errored]);
else
{
outputFormat.WriteSectorsLong(new byte[blockSize],
i + r,
false,
1,
[SectorStatus.Errored]);
}
}
}
@@ -977,11 +994,14 @@ partial class Dump
}
if(supportsLongSectors)
{
outputFormat.WriteSectorsLong(data,
i,
false,
blocksToRead,
Enumerable.Repeat(SectorStatus.Dumped, (int)blocksToRead)
.ToArray());
}
else
{
var cooked = new MemoryStream();
@@ -996,6 +1016,7 @@ partial class Dump
outputFormat.WriteSectors(cooked.ToArray(),
i,
false,
blocksToRead,
Enumerable.Repeat(SectorStatus.Dumped, (int)blocksToRead).ToArray());
}
@@ -1043,11 +1064,14 @@ partial class Dump
else
{
if(supportsLongSectors)
{
outputFormat.WriteSectorsLong(cmdBuf,
i,
false,
blocksToRead,
Enumerable.Repeat(SectorStatus.Dumped, (int)blocksToRead)
.ToArray());
}
else
{
var cooked = new MemoryStream();
@@ -1062,6 +1086,7 @@ partial class Dump
outputFormat.WriteSectors(cooked.ToArray(),
i,
false,
blocksToRead,
Enumerable.Repeat(SectorStatus.Dumped, (int)blocksToRead).ToArray());
}
@@ -1097,6 +1122,7 @@ partial class Dump
{
outputFormat.WriteSectorsLong(new byte[sectorSize * _skip],
i,
false,
_skip,
Enumerable.Repeat(SectorStatus.NotDumped, (int)_skip).ToArray());
@@ -1104,6 +1130,7 @@ partial class Dump
{
outputFormat.WriteSectorsTag(new byte[subSize * _skip],
i,
false,
_skip,
SectorTagType.CdSectorSubchannel);
}
@@ -1111,23 +1138,32 @@ partial class Dump
else
{
if(supportsLongSectors)
{
outputFormat.WriteSectorsLong(new byte[blockSize * _skip],
i,
false,
_skip,
Enumerable.Repeat(SectorStatus.NotDumped, (int)_skip).ToArray());
}
else
{
if(cmdBuf.Length % sectorSize == 0)
{
outputFormat.WriteSectors(new byte[2048 * _skip],
i,
false,
_skip,
Enumerable.Repeat(SectorStatus.NotDumped, (int)_skip).ToArray());
}
else
{
outputFormat.WriteSectorsLong(new byte[blockSize * _skip],
i,
false,
_skip,
Enumerable.Repeat(SectorStatus.NotDumped, (int)_skip)
.ToArray());
}
}
}

View File

@@ -87,21 +87,21 @@ sealed partial class Dump
MhddLog mhddLog; // MHDD log
double minSpeed = double.MaxValue; // Minimum speed
bool newTrim; // Is trim a new one?
int offsetBytes = 0; // Read offset
bool read6 = false; // Device supports READ(6)
bool read10 = false; // Device supports READ(10)
bool read12 = false; // Device supports READ(12)
bool read16 = false; // Device supports READ(16)
bool readcd = true; // Device supports READ CD
var offsetBytes = 0; // Read offset
var read6 = false; // Device supports READ(6)
var read10 = false; // Device supports READ(10)
var read12 = false; // Device supports READ(12)
var read16 = false; // Device supports READ(16)
var readcd = true; // Device supports READ CD
bool ret; // Image writing return status
const uint sectorSize = 2352; // Full sector size
int sectorsForOffset = 0; // Sectors needed to fix offset
bool sense = true; // Sense indicator
var sectorsForOffset = 0; // Sectors needed to fix offset
var sense = true; // Sense indicator
int sessions; // Number of sessions in disc
SubchannelLog subLog = null; // Subchannel log
uint subSize = 0; // Subchannel size in bytes
TrackSubchannelType subType; // Track subchannel type
bool supportsLongSectors = true; // Supports reading EDC and ECC
var supportsLongSectors = true; // Supports reading EDC and ECC
bool supportsPqSubchannel; // Supports reading PQ subchannel
bool supportsRwSubchannel; // Supports reading RW subchannel
byte[] tmpBuf; // Temporary buffer
@@ -113,11 +113,11 @@ sealed partial class Dump
bool hiddenTrack; // Disc has a hidden track before track 1
MmcSubchannel supportedSubchannel; // Drive's maximum supported subchannel
MmcSubchannel desiredSubchannel; // User requested subchannel
bool bcdSubchannel = false; // Subchannel positioning is in BCD
var bcdSubchannel = false; // Subchannel positioning is in BCD
Dictionary<byte, string> isrcs = new();
string mcn = null;
HashSet<int> subchannelExtents = [];
bool cdiReadyReadAsAudio = false;
var cdiReadyReadAsAudio = false;
uint firstLba;
var outputOptical = _outputPlugin as IWritableOpticalImage;
@@ -541,7 +541,7 @@ sealed partial class Dump
ErrorMessage?.Invoke(Localization.Core.Output_format_does_not_support_pregaps_continuing);
}
for(int t = 1; t < tracks.Length; t++) tracks[t - 1].EndSector = tracks[t].StartSector - 1;
for(var t = 1; t < tracks.Length; t++) tracks[t - 1].EndSector = tracks[t].StartSector - 1;
tracks[^1].EndSector = (ulong)lastSector;
blocks = (ulong)(lastSector + 1);
@@ -626,7 +626,7 @@ sealed partial class Dump
Tuple<ulong, ulong>[] dataExtentsArray = dataExtents.ToArray();
for(int i = 0; i < dataExtentsArray.Length - 1; i++)
for(var i = 0; i < dataExtentsArray.Length - 1; i++)
leadOutExtents.Add(dataExtentsArray[i].Item2 + 1, dataExtentsArray[i + 1].Item1 - 1);
}
@@ -715,7 +715,7 @@ sealed partial class Dump
continue;
}
int bufOffset = 0;
var bufOffset = 0;
while(cmdBuf[0 + bufOffset] != 0x00 ||
cmdBuf[1 + bufOffset] != 0xFF ||
@@ -928,7 +928,7 @@ sealed partial class Dump
_dev.LastError));
}
bool cdiWithHiddenTrack1 = false;
var cdiWithHiddenTrack1 = false;
if(dskType is MediaType.CDIREADY && tracks.Min(t => t.Sequence) == 1)
{
@@ -978,7 +978,10 @@ sealed partial class Dump
{
foreach(Track imgTrack in outputOptical.Tracks)
{
errno = outputOptical.ReadSectorTag(imgTrack.Sequence, SectorTagType.CdTrackIsrc, out byte[] isrcBytes);
errno = outputOptical.ReadSectorTag(imgTrack.Sequence,
false,
SectorTagType.CdTrackIsrc,
out byte[] isrcBytes);
if(errno == ErrorNumber.NoError) isrcs[(byte)imgTrack.Sequence] = Encoding.ASCII.GetString(isrcBytes);
@@ -1041,7 +1044,7 @@ sealed partial class Dump
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, false, SectorTagType.CdTrackFlags);
}
// Set MCN
@@ -1079,8 +1082,9 @@ sealed partial class Dump
foreach(int sub in _resume.BadSubchannels) subchannelExtents.Add(sub);
if(_resume.NextBlock < blocks)
for(ulong i = _resume.NextBlock; i < blocks; i++)
subchannelExtents.Add((int)i);
{
for(ulong i = _resume.NextBlock; i < blocks; i++) subchannelExtents.Add((int)i);
}
}
if(_resume.NextBlock > 0)
@@ -1495,8 +1499,9 @@ sealed partial class Dump
supportsLongSectors);
foreach(Tuple<ulong, ulong> leadoutExtent in leadOutExtents.ToArray())
for(ulong e = leadoutExtent.Item1; e <= leadoutExtent.Item2; e++)
subchannelExtents.Remove((int)e);
{
for(ulong e = leadoutExtent.Item1; e <= leadoutExtent.Item2; e++) subchannelExtents.Remove((int)e);
}
if(subchannelExtents.Count > 0 && _retryPasses > 0 && _retrySubchannel)
{
@@ -1583,7 +1588,10 @@ sealed partial class Dump
foreach(KeyValuePair<byte, string> isrc in isrcs)
{
// TODO: Track tags
if(!outputOptical.WriteSectorTag(Encoding.ASCII.GetBytes(isrc.Value), isrc.Key, SectorTagType.CdTrackIsrc))
if(!outputOptical.WriteSectorTag(Encoding.ASCII.GetBytes(isrc.Value),
isrc.Key,
false,
SectorTagType.CdTrackIsrc))
continue;
UpdateStatus?.Invoke(string.Format(Localization.Core.Setting_ISRC_for_track_0_to_1, isrc.Key, isrc.Value));

View File

@@ -466,9 +466,8 @@ partial class Dump
// MEDIUM ERROR, retry with ignore error below
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
@@ -510,9 +509,9 @@ partial class Dump
Array.Copy(cmdBuf, sectorSize, sub, 0, subSize);
if(supportsLongSectors)
outputOptical.WriteSectorLong(data, badSector, SectorStatus.Dumped);
outputOptical.WriteSectorLong(data, badSector, false, SectorStatus.Dumped);
else
outputOptical.WriteSector(Sector.GetUserData(data), badSector, SectorStatus.Dumped);
outputOptical.WriteSector(Sector.GetUserData(data), badSector, false, SectorStatus.Dumped);
bool indexesChanged = Media.CompactDisc.WriteSubchannelToImage(supportedSubchannel,
desiredSubchannel,
@@ -543,9 +542,9 @@ partial class Dump
else
{
if(supportsLongSectors)
outputOptical.WriteSectorLong(cmdBuf, badSector, SectorStatus.Dumped);
outputOptical.WriteSectorLong(cmdBuf, badSector, false, SectorStatus.Dumped);
else
outputOptical.WriteSector(Sector.GetUserData(cmdBuf), badSector, SectorStatus.Dumped);
outputOptical.WriteSector(Sector.GetUserData(cmdBuf), badSector, false, SectorStatus.Dumped);
}
}
@@ -663,9 +662,9 @@ partial class Dump
Array.Copy(cmdBuf, sectorSize, sub, 0, subSize);
if(supportsLongSectors)
outputOptical.WriteSectorLong(data, badSector, SectorStatus.Errored);
outputOptical.WriteSectorLong(data, badSector, false, SectorStatus.Errored);
else
outputOptical.WriteSector(Sector.GetUserData(data), badSector, SectorStatus.Errored);
outputOptical.WriteSector(Sector.GetUserData(data), badSector, false, SectorStatus.Errored);
bool indexesChanged = Media.CompactDisc.WriteSubchannelToImage(supportedSubchannel,
desiredSubchannel,
@@ -696,9 +695,12 @@ partial class Dump
else
{
if(supportsLongSectors)
outputOptical.WriteSectorLong(cmdBuf, badSector, SectorStatus.Errored);
outputOptical.WriteSectorLong(cmdBuf, badSector, false, SectorStatus.Errored);
else
outputOptical.WriteSector(Sector.GetUserData(cmdBuf), badSector, SectorStatus.Errored);
outputOptical.WriteSector(Sector.GetUserData(cmdBuf),
badSector,
false,
SectorStatus.Errored);
}
}

View File

@@ -217,6 +217,7 @@ partial class Dump
outputOptical.WriteSectorsLong(data,
i,
false,
_maximumReadable,
Enumerable.Repeat(SectorStatus.Dumped, (int)_maximumReadable)
.ToArray());
@@ -251,11 +252,14 @@ partial class Dump
}
}
else
{
outputOptical.WriteSectors(cmdBuf,
i,
false,
_maximumReadable,
Enumerable.Repeat(SectorStatus.Dumped, (int)_maximumReadable)
.ToArray());
}
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
}
@@ -271,15 +275,16 @@ partial class Dump
if(supportedSubchannel != MmcSubchannel.None)
{
outputOptical.WriteSectorsLong(new byte[sectorSize * _skip], i, 1, new SectorStatus[1]);
outputOptical.WriteSectorsLong(new byte[sectorSize * _skip], i, false, 1, new SectorStatus[1]);
outputOptical.WriteSectorsTag(new byte[subSize * _skip],
i,
false,
1,
SectorTagType.CdSectorSubchannel);
}
else
outputOptical.WriteSectors(new byte[blockSize * _skip], i, 1, new SectorStatus[1]);
outputOptical.WriteSectors(new byte[blockSize * _skip], i, false, 1, new SectorStatus[1]);
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
@@ -464,6 +469,7 @@ partial class Dump
outputOptical.WriteSectorsLong(data,
i,
false,
_maximumReadable,
Enumerable.Repeat(SectorStatus.Dumped, (int)_maximumReadable)
.ToArray());
@@ -498,11 +504,14 @@ partial class Dump
}
}
else
{
outputOptical.WriteSectors(cmdBuf,
i,
false,
_maximumReadable,
Enumerable.Repeat(SectorStatus.Dumped, (int)_maximumReadable)
.ToArray());
}
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
}
@@ -518,18 +527,19 @@ partial class Dump
if(supportedSubchannel != MmcSubchannel.None)
{
outputOptical.WriteSectorsLong(new byte[sectorSize * _skip], i, 1, new SectorStatus[1]);
outputOptical.WriteSectorsLong(new byte[sectorSize * _skip], i, false, 1, new SectorStatus[1]);
if(desiredSubchannel != MmcSubchannel.None)
{
outputOptical.WriteSectorsTag(new byte[subSize * _skip],
i,
false,
1,
SectorTagType.CdSectorSubchannel);
}
}
else
outputOptical.WriteSectors(new byte[blockSize * _skip], i, 1, new SectorStatus[1]);
outputOptical.WriteSectors(new byte[blockSize * _skip], i, false, 1, new SectorStatus[1]);
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;

View File

@@ -102,9 +102,9 @@ partial class Dump
}
if(supportsLongSectors)
outputOptical.WriteSectorLong(sector, s, SectorStatus.Dumped);
outputOptical.WriteSectorLong(sector, s, false, SectorStatus.Dumped);
else
outputOptical.WriteSector(Sector.GetUserData(sector), s, SectorStatus.Dumped);
outputOptical.WriteSector(Sector.GetUserData(sector), s, false, SectorStatus.Dumped);
_resume.BadBlocks.Remove(s);
extents.Add(s);
@@ -145,7 +145,7 @@ partial class Dump
byte[] sub = Subchannel.Generate((int)s, track?.Sequence ?? 0, (int)pregap, (int)trackStart, flags, index);
outputOptical.WriteSectorsTag(sub, s, 1, SectorTagType.CdSectorSubchannel);
outputOptical.WriteSectorsTag(sub, s, false, 1, SectorTagType.CdSectorSubchannel);
subLog?.WriteEntry(sub, true, (long)s, 1, true, false);
subchannelExtents.Remove((int)s);

View File

@@ -424,9 +424,9 @@ partial class Dump
Array.Copy(cmdBuf, sectorSize, sub, 0, subSize);
if(supportsLongSectors)
outputOptical.WriteSectorLong(data, badSector, SectorStatus.Dumped);
outputOptical.WriteSectorLong(data, badSector, false, SectorStatus.Dumped);
else
outputOptical.WriteSector(Sector.GetUserData(data), badSector, SectorStatus.Dumped);
outputOptical.WriteSector(Sector.GetUserData(data), badSector, false, SectorStatus.Dumped);
ulong trkStartBefore = track.StartSector;
@@ -468,9 +468,9 @@ partial class Dump
}
if(supportsLongSectors)
outputOptical.WriteSectorLong(cmdBuf, badSector, SectorStatus.Dumped);
outputOptical.WriteSectorLong(cmdBuf, badSector, false, SectorStatus.Dumped);
else
outputOptical.WriteSector(Sector.GetUserData(cmdBuf), badSector, SectorStatus.Dumped);
outputOptical.WriteSector(Sector.GetUserData(cmdBuf), badSector, false, SectorStatus.Dumped);
}
_trimStopwatch.Stop();

View File

@@ -377,6 +377,7 @@ partial class Dump
outputFormat.WriteSectors(readBuffer,
i,
false,
blocksToRead,
Enumerable.Repeat(SectorStatus.Dumped, (int)blocksToRead).ToArray());
@@ -396,6 +397,7 @@ partial class Dump
outputFormat.WriteSectors(new byte[blockSize * _skip],
i,
false,
_skip,
Enumerable.Repeat(SectorStatus.NotDumped, (int)_skip).ToArray());
@@ -480,7 +482,7 @@ partial class Dump
_resume.BadBlocks.Remove(badSector);
extents.Add(badSector);
outputFormat.WriteSector(readBuffer, badSector, SectorStatus.Dumped);
outputFormat.WriteSector(readBuffer, badSector, false, SectorStatus.Dumped);
_mediaGraph?.PaintSectorGood(badSector);
}
@@ -647,14 +649,14 @@ partial class Dump
{
_resume.BadBlocks.Remove(badSector);
extents.Add(badSector);
outputFormat.WriteSector(readBuffer, badSector, SectorStatus.Dumped);
outputFormat.WriteSector(readBuffer, badSector, false, SectorStatus.Dumped);
_mediaGraph?.PaintSectorGood(badSector);
UpdateStatus?.Invoke(string.Format(Localization.Core.Correctly_retried_block_0_in_pass_1,
badSector,
pass));
}
else if(runningPersistent) outputFormat.WriteSector(readBuffer, badSector, SectorStatus.Errored);
else if(runningPersistent) outputFormat.WriteSector(readBuffer, badSector, false, SectorStatus.Errored);
}
if(pass < _retryPasses && !_aborted && _resume.BadBlocks.Count > 0)

View File

@@ -249,6 +249,7 @@ public partial class Dump
outputFormat.WriteSectors(readBuffer,
i,
false,
blocksToRead,
Enumerable.Repeat(SectorStatus.Dumped, (int)blocksToRead).ToArray());
@@ -270,6 +271,7 @@ public partial class Dump
outputFormat.WriteSectors(new byte[blockSize * _skip],
i,
false,
_skip,
Enumerable.Repeat(SectorStatus.NotDumped, (int)_skip).ToArray());
@@ -373,7 +375,7 @@ public partial class Dump
_resume.BadBlocks.Remove(badSector);
extents.Add(badSector);
outputFormat.WriteSector(readBuffer, badSector, SectorStatus.Dumped);
outputFormat.WriteSector(readBuffer, badSector, false, SectorStatus.Dumped);
_mediaGraph?.PaintSectorGood(badSector);
}
@@ -572,14 +574,14 @@ public partial class Dump
{
_resume.BadBlocks.Remove(badSector);
extents.Add(badSector);
outputFormat.WriteSector(readBuffer, badSector, SectorStatus.Dumped);
outputFormat.WriteSector(readBuffer, badSector, false, SectorStatus.Dumped);
_mediaGraph?.PaintSectorGood(badSector);
UpdateStatus?.Invoke(string.Format(Localization.Core.Correctly_retried_block_0_in_pass_1,
badSector,
pass));
}
else if(runningPersistent) outputFormat.WriteSector(readBuffer, badSector, SectorStatus.Errored);
else if(runningPersistent) outputFormat.WriteSector(readBuffer, badSector, false, SectorStatus.Errored);
}
if(pass < _retryPasses && !_aborted && _resume.BadBlocks.Count > 0)

View File

@@ -288,6 +288,7 @@ public partial class Dump
outputOptical.WriteSectors(readBuffer,
i,
false,
blocksToRead,
Enumerable.Repeat(SectorStatus.Dumped, (int)blocksToRead).ToArray());
@@ -307,6 +308,7 @@ public partial class Dump
// Write empty data
outputOptical.WriteSectors(new byte[blockSize * _skip],
i,
false,
_skip,
Enumerable.Repeat(SectorStatus.NotDumped, (int)_skip).ToArray());
@@ -409,7 +411,7 @@ public partial class Dump
_resume.BadBlocks.Remove(badSector);
extents.Add(badSector);
outputOptical.WriteSector(readBuffer, badSector, SectorStatus.Dumped);
outputOptical.WriteSector(readBuffer, badSector, false, SectorStatus.Dumped);
_mediaGraph?.PaintSectorGood(badSector);
}
@@ -585,14 +587,15 @@ public partial class Dump
{
_resume.BadBlocks.Remove(badSector);
extents.Add(badSector);
outputOptical.WriteSector(readBuffer, badSector, SectorStatus.Dumped);
outputOptical.WriteSector(readBuffer, badSector, false, SectorStatus.Dumped);
_mediaGraph?.PaintSectorGood(badSector);
UpdateStatus?.Invoke(string.Format(Localization.Core.Correctly_retried_block_0_in_pass_1,
badSector,
pass));
}
else if(runningPersistent) outputOptical.WriteSector(readBuffer, badSector, SectorStatus.Errored);
else if(runningPersistent)
outputOptical.WriteSector(readBuffer, badSector, false, SectorStatus.Errored);
}
if(pass < _retryPasses && !_aborted && _resume.BadBlocks.Count > 0)

View File

@@ -285,8 +285,9 @@ partial class Dump
Modes.DecodedMode? decMode = null;
if(!sense && !_dev.Error)
if(Modes.DecodeMode10(cmdBuf, _dev.ScsiType).HasValue)
decMode = Modes.DecodeMode10(cmdBuf, _dev.ScsiType);
{
if(Modes.DecodeMode10(cmdBuf, _dev.ScsiType).HasValue) decMode = Modes.DecodeMode10(cmdBuf, _dev.ScsiType);
}
UpdateStatus?.Invoke(Localization.Core.Requesting_MODE_SENSE_6);
@@ -314,8 +315,9 @@ partial class Dump
if(sense || _dev.Error) sense = _dev.ModeSense(out cmdBuf, out senseBuf, 5, out duration);
if(!sense && !_dev.Error)
if(Modes.DecodeMode6(cmdBuf, _dev.ScsiType).HasValue)
decMode = Modes.DecodeMode6(cmdBuf, _dev.ScsiType);
{
if(Modes.DecodeMode6(cmdBuf, _dev.ScsiType).HasValue) decMode = Modes.DecodeMode6(cmdBuf, _dev.ScsiType);
}
// TODO: Check partitions page
if(decMode.HasValue)
@@ -1090,7 +1092,7 @@ partial class Dump
// Write empty data
_writeStopwatch.Restart();
outputTape.WriteSector(new byte[blockSize], currentBlock, SectorStatus.NotDumped);
outputTape.WriteSector(new byte[blockSize], currentBlock, false, SectorStatus.NotDumped);
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
mhddLog.Write(currentBlock, duration < 500 ? 65535 : duration);
@@ -1102,7 +1104,7 @@ partial class Dump
mhddLog.Write(currentBlock, duration);
ibgLog.Write(currentBlock, currentSpeed * 1024);
_writeStopwatch.Restart();
outputTape.WriteSector(cmdBuf, currentBlock, SectorStatus.Dumped);
outputTape.WriteSector(cmdBuf, currentBlock, false, SectorStatus.Dumped);
imageWriteDuration += _writeStopwatch.Elapsed.TotalSeconds;
extents.Add(currentBlock, 1, true);
}
@@ -1297,13 +1299,13 @@ partial class Dump
{
_resume.BadBlocks.Remove(badBlock);
extents.Add(badBlock);
outputTape.WriteSector(cmdBuf, badBlock, SectorStatus.Dumped);
outputTape.WriteSector(cmdBuf, badBlock, false, SectorStatus.Dumped);
UpdateStatus?.Invoke(string.Format(Localization.Core.Correctly_retried_block_0_in_pass_1,
badBlock,
pass));
}
else if(runningPersistent) outputTape.WriteSector(cmdBuf, badBlock, SectorStatus.Errored);
else if(runningPersistent) outputTape.WriteSector(cmdBuf, badBlock, false, SectorStatus.Errored);
}
if(pass < _retryPasses && !_aborted && _resume.BadBlocks.Count > 0)

View File

@@ -126,7 +126,7 @@ partial class Dump
if(key.All(static k => k == 0))
{
outputFormat.WriteSectorTag([0, 0, 0, 0, 0], i + j, SectorTagType.DvdTitleKeyDecrypted);
outputFormat.WriteSectorTag([0, 0, 0, 0, 0], i + j, false, SectorTagType.DvdTitleKeyDecrypted);
_resume.MissingTitleKeys?.Remove(i + j);
@@ -134,7 +134,7 @@ partial class Dump
}
CSS.DecryptTitleKey(discKey, key, out tmpBuf);
outputFormat.WriteSectorTag(tmpBuf, i + j, SectorTagType.DvdTitleKeyDecrypted);
outputFormat.WriteSectorTag(tmpBuf, i + j, false, SectorTagType.DvdTitleKeyDecrypted);
_resume.MissingTitleKeys?.Remove(i + j);
if(_storeEncrypted) continue;
@@ -147,6 +147,7 @@ partial class Dump
{
ErrorNumber errno =
outputFormat.ReadSectorsTag(i,
false,
blocksToRead,
SectorTagType.DvdTitleKeyDecrypted,
out byte[] titleKey);
@@ -162,6 +163,7 @@ partial class Dump
outputFormat.WriteSectorsLong(buffer,
i,
false,
blocksToRead,
Enumerable.Repeat(SectorStatus.Dumped, (int)blocksToRead).ToArray());
@@ -181,6 +183,7 @@ partial class Dump
outputFormat.WriteSectorsLong(new byte[blockSize * _skip],
i,
false,
_skip,
Enumerable.Repeat(SectorStatus.NotDumped, (int)_skip).ToArray());

View File

@@ -134,7 +134,7 @@ partial class Dump
CSS_CPRM.TitleKey? titleKey = CSS.DecodeTitleKey(tmpBuf, dvdDecrypt.BusKey);
if(titleKey.HasValue)
outputFormat.WriteSectorTag([titleKey.Value.CMI], i + j, SectorTagType.DvdSectorCmi);
outputFormat.WriteSectorTag([titleKey.Value.CMI], i + j, false, SectorTagType.DvdSectorCmi);
else
continue;
@@ -142,20 +142,23 @@ partial class Dump
// not encrypted even if the CMI says it is.
if(titleKey.Value.Key.All(static k => k == 0))
{
outputFormat.WriteSectorTag([0, 0, 0, 0, 0], i + j, SectorTagType.DvdSectorTitleKey);
outputFormat.WriteSectorTag([0, 0, 0, 0, 0], i + j, false, SectorTagType.DvdSectorTitleKey);
outputFormat.WriteSectorTag([0, 0, 0, 0, 0], i + j, SectorTagType.DvdTitleKeyDecrypted);
outputFormat.WriteSectorTag([0, 0, 0, 0, 0],
i + j,
false,
SectorTagType.DvdTitleKeyDecrypted);
_resume.MissingTitleKeys.Remove(i + j);
continue;
}
outputFormat.WriteSectorTag(titleKey.Value.Key, i + j, SectorTagType.DvdSectorTitleKey);
outputFormat.WriteSectorTag(titleKey.Value.Key, i + j, false, SectorTagType.DvdSectorTitleKey);
_resume.MissingTitleKeys.Remove(i + j);
CSS.DecryptTitleKey(discKey, titleKey.Value.Key, out tmpBuf);
outputFormat.WriteSectorTag(tmpBuf, i + j, SectorTagType.DvdTitleKeyDecrypted);
outputFormat.WriteSectorTag(tmpBuf, i + j, false, SectorTagType.DvdTitleKeyDecrypted);
}
if(!_storeEncrypted)
@@ -163,13 +166,18 @@ partial class Dump
// Todo: Flag in the outputFormat that a sector has been decrypted
{
ErrorNumber errno =
outputFormat.ReadSectorsTag(i, blocksToRead, SectorTagType.DvdSectorCmi, out byte[] cmi);
outputFormat.ReadSectorsTag(i,
false,
blocksToRead,
SectorTagType.DvdSectorCmi,
out byte[] cmi);
if(errno != ErrorNumber.NoError)
ErrorMessage?.Invoke(string.Format(Localization.Core.Error_retrieving_CMI_for_sector_0, i));
else
{
errno = outputFormat.ReadSectorsTag(i,
false,
blocksToRead,
SectorTagType.DvdTitleKeyDecrypted,
out byte[] titleKey);
@@ -192,6 +200,7 @@ partial class Dump
outputFormat.WriteSectors(buffer,
i,
false,
blocksToRead,
Enumerable.Repeat(SectorStatus.Dumped, (int)blocksToRead).ToArray());
@@ -225,6 +234,7 @@ partial class Dump
outputFormat.WriteSectors(new byte[blockSize * _skip],
i,
false,
_skip,
Enumerable.Repeat(SectorStatus.NotDumped, (int)_skip).ToArray());

View File

@@ -316,14 +316,17 @@ partial class Dump
if(key.All(static k => k == 0))
{
outputFormat.WriteSectorTag([0, 0, 0, 0, 0], badSector, SectorTagType.DvdTitleKeyDecrypted);
outputFormat.WriteSectorTag([0, 0, 0, 0, 0],
badSector,
false,
SectorTagType.DvdTitleKeyDecrypted);
_resume.MissingTitleKeys?.Remove(badSector);
}
else
{
CSS.DecryptTitleKey(discKey, key, out byte[] tmpBuf);
outputFormat.WriteSectorTag(tmpBuf, badSector, SectorTagType.DvdTitleKeyDecrypted);
outputFormat.WriteSectorTag(tmpBuf, badSector, false, SectorTagType.DvdTitleKeyDecrypted);
_resume.MissingTitleKeys?.Remove(badSector);
cmi[0] = buffer[6];
@@ -333,6 +336,7 @@ partial class Dump
{
ErrorNumber errno =
outputFormat.ReadSectorsTag(badSector,
false,
1,
SectorTagType.DvdTitleKeyDecrypted,
out byte[] titleKey);
@@ -348,10 +352,10 @@ partial class Dump
}
_resume.BadBlocks.Remove(badSector);
outputFormat.WriteSectorLong(buffer, badSector, SectorStatus.Dumped);
outputFormat.WriteSectorLong(buffer, badSector, false, SectorStatus.Dumped);
}
else
outputFormat.WriteSector(buffer, badSector, SectorStatus.Dumped);
outputFormat.WriteSector(buffer, badSector, false, SectorStatus.Dumped);
_mediaGraph?.PaintSectorGood(badSector);
@@ -359,7 +363,7 @@ partial class Dump
badSector,
pass));
}
else if(runningPersistent) outputFormat.WriteSector(buffer, badSector, SectorStatus.Errored);
else if(runningPersistent) outputFormat.WriteSector(buffer, badSector, false, SectorStatus.Errored);
}
if(pass < _retryPasses && !_aborted && _resume.BadBlocks.Count > 0)
@@ -441,15 +445,15 @@ partial class Dump
if(!titleKey.HasValue) continue;
outputFormat.WriteSectorTag([titleKey.Value.CMI], missingKey, SectorTagType.DvdSectorCmi);
outputFormat.WriteSectorTag([titleKey.Value.CMI], missingKey, false, SectorTagType.DvdSectorCmi);
// If the CMI bit is 1, the sector is using copy protection, else it is not
// If the decoded title key is zeroed, there should be no copy protection
if((titleKey.Value.CMI & 0x80) >> 7 == 0 || titleKey.Value.Key.All(k => k == 0))
{
outputFormat.WriteSectorTag([0, 0, 0, 0, 0], missingKey, SectorTagType.DvdSectorTitleKey);
outputFormat.WriteSectorTag([0, 0, 0, 0, 0], missingKey, false, SectorTagType.DvdSectorTitleKey);
outputFormat.WriteSectorTag([0, 0, 0, 0, 0], missingKey, SectorTagType.DvdTitleKeyDecrypted);
outputFormat.WriteSectorTag([0, 0, 0, 0, 0], missingKey, false, SectorTagType.DvdTitleKeyDecrypted);
_resume.MissingTitleKeys.Remove(missingKey);
@@ -459,13 +463,13 @@ partial class Dump
}
else
{
outputFormat.WriteSectorTag(titleKey.Value.Key, missingKey, SectorTagType.DvdSectorTitleKey);
outputFormat.WriteSectorTag(titleKey.Value.Key, missingKey, false, SectorTagType.DvdSectorTitleKey);
_resume.MissingTitleKeys.Remove(missingKey);
if(discKey != null)
{
CSS.DecryptTitleKey(discKey, titleKey.Value.Key, out buffer);
outputFormat.WriteSectorTag(buffer, missingKey, SectorTagType.DvdTitleKeyDecrypted);
outputFormat.WriteSectorTag(buffer, missingKey, false, SectorTagType.DvdTitleKeyDecrypted);
}
UpdateStatus?.Invoke(string.Format(Localization.Core.Correctly_retried_title_key_0_in_pass_1,

View File

@@ -180,8 +180,9 @@ partial class Dump
writtenExtents.Add(0, blocks - 1);
foreach(Tuple<ulong, ulong> blank in blankExtents.ToArray())
for(ulong b = blank.Item1; b <= blank.Item2; b++)
writtenExtents.Remove(b);
{
for(ulong b = blank.Item1; b <= blank.Item2; b++) writtenExtents.Remove(b);
}
}
if(writtenExtents.Count == 0)
@@ -239,6 +240,7 @@ partial class Dump
outputFormat.WriteSectors(buffer,
i,
false,
blocksToRead,
Enumerable.Repeat(SectorStatus.Dumped, (int)blocksToRead).ToArray());
@@ -257,6 +259,7 @@ partial class Dump
outputFormat.WriteSectors(new byte[blockSize * _skip],
i,
false,
_skip,
Enumerable.Repeat(SectorStatus.NotDumped, (int)_skip).ToArray());

View File

@@ -107,14 +107,14 @@ partial class Dump
if(key.All(static k => k == 0))
{
outputFormat.WriteSectorTag([0, 0, 0, 0, 0], badSector, SectorTagType.DvdTitleKeyDecrypted);
outputFormat.WriteSectorTag([0, 0, 0, 0, 0], badSector, false, SectorTagType.DvdTitleKeyDecrypted);
_resume.MissingTitleKeys?.Remove(badSector);
}
else
{
CSS.DecryptTitleKey(discKey, key, out byte[] tmpBuf);
outputFormat.WriteSectorTag(tmpBuf, badSector, SectorTagType.DvdTitleKeyDecrypted);
outputFormat.WriteSectorTag(tmpBuf, badSector, false, SectorTagType.DvdTitleKeyDecrypted);
_resume.MissingTitleKeys?.Remove(badSector);
cmi[0] = buffer[6];
@@ -124,6 +124,7 @@ partial class Dump
{
ErrorNumber errno =
outputFormat.ReadSectorsTag(badSector,
false,
1,
SectorTagType.DvdTitleKeyDecrypted,
out byte[] titleKey);
@@ -138,10 +139,10 @@ partial class Dump
}
_resume.BadBlocks.Remove(badSector);
outputFormat.WriteSectorLong(buffer, badSector, SectorStatus.Dumped);
outputFormat.WriteSectorLong(buffer, badSector, false, SectorStatus.Dumped);
}
else
outputFormat.WriteSector(buffer, badSector, SectorStatus.Dumped);
outputFormat.WriteSector(buffer, badSector, false, SectorStatus.Dumped);
_mediaGraph?.PaintSectorGood(badSector);
}

View File

@@ -667,6 +667,7 @@ public partial class Dump
outputFormat.WriteSectors(cmdBuf,
i,
false,
blocksToRead,
Enumerable.Repeat(SectorStatus.Dumped, blocksToRead).ToArray());
@@ -689,6 +690,7 @@ public partial class Dump
outputFormat.WriteSectors(new byte[blockSize * _skip],
i,
false,
_skip,
Enumerable.Repeat(SectorStatus.NotDumped, (int)_skip).ToArray());
@@ -781,7 +783,7 @@ public partial class Dump
_resume.BadBlocks.Remove(badSector);
extents.Add(badSector);
outputFormat.WriteSector(cmdBuf, badSector, SectorStatus.Dumped);
outputFormat.WriteSector(cmdBuf, badSector, false, SectorStatus.Dumped);
_mediaGraph?.PaintSectorGood(badSector);
}
@@ -842,7 +844,7 @@ public partial class Dump
_resume.BadBlocks.Remove(badSector);
extents.Add(badSector);
outputFormat.WriteSector(cmdBuf, badSector, SectorStatus.Dumped);
outputFormat.WriteSector(cmdBuf, badSector, false, SectorStatus.Dumped);
_mediaGraph?.PaintSectorGood(badSector);
UpdateStatus?.Invoke(string.Format(Localization.Core.Correctly_retried_block_0_in_pass_1,

View File

@@ -686,6 +686,7 @@ partial class Dump
outputFormat.WriteSectors(readBuffer,
i,
false,
blocksToRead,
Enumerable.Repeat(SectorStatus.Dumped, (int)blocksToRead).ToArray());
@@ -707,6 +708,7 @@ partial class Dump
outputFormat.WriteSectors(new byte[blockSize * _skip],
i,
false,
_skip,
Enumerable.Repeat(SectorStatus.NotDumped, (int)_skip).ToArray());
@@ -770,6 +772,7 @@ partial class Dump
outputFormat.WriteSectors(new byte[blockSize * blocksToRead],
i,
false,
blocksToRead,
Enumerable.Repeat(SectorStatus.Dumped, (int)blocksToRead).ToArray());
@@ -820,6 +823,7 @@ partial class Dump
outputFormat.WriteSectors(new byte[blockSize * blocksToRead],
middle + currentSector,
false,
blocksToRead,
Enumerable.Repeat(SectorStatus.NotDumped, (int)blocksToRead).ToArray());
@@ -910,6 +914,7 @@ partial class Dump
outputFormat.WriteSectors(readBuffer,
currentSector,
false,
blocksToRead,
Enumerable.Repeat(SectorStatus.Dumped, (int)blocksToRead).ToArray());
@@ -929,6 +934,7 @@ partial class Dump
outputFormat.WriteSectors(new byte[blockSize * _skip],
currentSector,
false,
_skip,
Enumerable.Repeat(SectorStatus.NotDumped, (int)_skip).ToArray());
@@ -1060,7 +1066,7 @@ partial class Dump
_resume.BadBlocks.Remove(badSector);
extents.Add(badSector);
outputFormat.WriteSector(readBuffer, badSector, SectorStatus.Dumped);
outputFormat.WriteSector(readBuffer, badSector, false, SectorStatus.Dumped);
_mediaGraph?.PaintSectorGood(badSector);
}
@@ -1080,9 +1086,8 @@ partial class Dump
List<ulong> tmpList = [];
foreach(ulong ur in _resume.BadBlocks)
{
for(ulong i = ur; i < ur + blocksToRead; i++) tmpList.Add(i);
}
for(ulong i = ur; i < ur + blocksToRead; i++)
tmpList.Add(i);
tmpList.Sort();
@@ -1261,14 +1266,14 @@ partial class Dump
{
_resume.BadBlocks.Remove(badSector);
extents.Add(badSector);
outputFormat.WriteSector(readBuffer, badSector, SectorStatus.Dumped);
outputFormat.WriteSector(readBuffer, badSector, false, SectorStatus.Dumped);
_mediaGraph?.PaintSectorGood(badSector);
UpdateStatus?.Invoke(string.Format(Localization.Core.Correctly_retried_block_0_in_pass_1,
badSector,
pass));
}
else if(runningPersistent) outputFormat.WriteSector(readBuffer, badSector, SectorStatus.Errored);
else if(runningPersistent) outputFormat.WriteSector(readBuffer, badSector, false, SectorStatus.Errored);
}
if(pass < _retryPasses && !_aborted && _resume.BadBlocks.Count > 0)

View File

@@ -174,9 +174,7 @@ public sealed class Entropy
AaruLogging.Exception(ex, Localization.Core.Could_not_get_tracks_because_0, ex.Message);
}
else
{
AaruLogging.Error(Localization.Core.Unable_to_get_separate_tracks_not_calculating_their_entropy);
}
}
return entropyResults.ToArray();
@@ -208,7 +206,7 @@ public sealed class Entropy
(long)(i + 1),
(long)entropy.Sectors);
ErrorNumber errno = mediaImage.ReadSector(i, out byte[] sector, out _);
ErrorNumber errno = mediaImage.ReadSector(i, false, out byte[] sector, out _);
if(errno != ErrorNumber.NoError)
{

View File

@@ -84,7 +84,7 @@ public static class CompactDisc
// If not desired to fix, or to save, the subchannel, just save as is (or none)
if(!fixSubchannelPosition && desiredSubchannel != MmcSubchannel.None)
outputPlugin.WriteSectorsTag(sub, sectorAddress, length, SectorTagType.CdSectorSubchannel);
outputPlugin.WriteSectorsTag(sub, sectorAddress, false, length, SectorTagType.CdSectorSubchannel);
subLog?.WriteEntry(sub, supportedSubchannel == MmcSubchannel.Raw, (long)sectorAddress, length, false, false);
@@ -106,15 +106,15 @@ public static class CompactDisc
int prePos = int.MinValue;
// Check subchannel
for(int subPos = 0; subPos < deSub.Length; subPos += 96)
for(var subPos = 0; subPos < deSub.Length; subPos += 96)
{
// Expected LBA
long lba = (long)sectorAddress + subPos / 96;
// We fixed the subchannel
bool @fixed = false;
var @fixed = false;
byte[] q = new byte[12];
var q = new byte[12];
Array.Copy(deSub, subPos + 12, q, 0, 12);
// Check Q CRC
@@ -122,18 +122,17 @@ public static class CompactDisc
bool crcOk = crc[0] == q[10] && crc[1] == q[11];
// Start considering P to be OK
bool pOk = true;
int pWeight = 0;
var pOk = true;
var pWeight = 0;
// Check P and weight
for(int p = subPos; p < subPos + 12; p++)
{
if(deSub[p] != 0 && deSub[p] != 255) pOk = false;
for(int w = 0; w < 8; w++)
{
if((deSub[p] >> w & 1) > 0) pWeight++;
}
for(var w = 0; w < 8; w++)
if((deSub[p] >> w & 1) > 0)
pWeight++;
}
// This seems to be a somewhat common pattern
@@ -156,13 +155,13 @@ public static class CompactDisc
deSub.Skip(subPos + 84).Take(12).All(w => w == 0xFF);
bool rwOk = rOk && sOk && tOk && uOk && vOk && wOk;
bool rwPacket = false;
bool cdtextPacket = false;
var rwPacket = false;
var cdtextPacket = false;
// Check RW contents
if(!rwOk)
{
byte[] sectorSub = new byte[96];
var sectorSub = new byte[96];
Array.Copy(sub, subPos, sectorSub, 0, 96);
DetectRwPackets(sectorSub, out _, out rwPacket, out cdtextPacket);
@@ -177,13 +176,11 @@ public static class CompactDisc
if(!pOk && fixSubchannel)
{
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
{
for(int p = subPos; p < subPos + 12; p++) deSub[p] = 0;
}
for(int p = subPos; p < subPos + 12; p++)
deSub[p] = 0;
pOk = true;
@fixed = true;
@@ -255,20 +252,20 @@ public static class CompactDisc
if(!pOk || !crcOk || !rwOk) continue;
byte aframe = (byte)(q[9] / 16 * 10 + (q[9] & 0x0F));
var aframe = (byte)(q[9] / 16 * 10 + (q[9] & 0x0F));
if((q[0] & 0x3) == 1)
{
byte amin = (byte)(q[7] / 16 * 10 + (q[7] & 0x0F));
byte asec = (byte)(q[8] / 16 * 10 + (q[8] & 0x0F));
var amin = (byte)(q[7] / 16 * 10 + (q[7] & 0x0F));
var asec = (byte)(q[8] / 16 * 10 + (q[8] & 0x0F));
aPos = amin * 60 * 75 + asec * 75 + aframe - 150;
}
else
{
ulong expectedSectorAddress = sectorAddress + (ulong)(subPos / 96) + 150;
byte smin = (byte)(expectedSectorAddress / 60 / 75);
var smin = (byte)(expectedSectorAddress / 60 / 75);
expectedSectorAddress -= (ulong)(smin * 60 * 75);
byte ssec = (byte)(expectedSectorAddress / 75);
var ssec = (byte)(expectedSectorAddress / 75);
aPos = smin * 60 * 75 + ssec * 75 + aframe - 150;
@@ -281,10 +278,10 @@ public static class CompactDisc
prePos = aPos;
byte[] posSub = new byte[96];
var posSub = new byte[96];
Array.Copy(deSub, subPos, posSub, 0, 96);
posSub = Subchannel.Interleave(posSub);
outputPlugin.WriteSectorTag(posSub, (ulong)aPos, SectorTagType.CdSectorSubchannel);
outputPlugin.WriteSectorTag(posSub, (ulong)aPos, false, SectorTagType.CdSectorSubchannel);
subchannelExtents.Remove(aPos);
@@ -315,13 +312,13 @@ public static class CompactDisc
Dictionary<byte, int> smallestPregapLbaPerTrack, bool dumping,
out List<ulong> newPregapSectors, ulong sectorAddress)
{
bool status = false;
var status = false;
newPregapSectors = [];
// Check subchannel
for(int subPos = 0; subPos < deSub.Length; subPos += 96)
for(var subPos = 0; subPos < deSub.Length; subPos += 96)
{
byte[] q = new byte[12];
var q = new byte[12];
Array.Copy(deSub, subPos + 12, q, 0, 12);
CRC16CcittContext.Data(q, 10, out byte[] crc);
@@ -389,19 +386,19 @@ public static class CompactDisc
continue;
case 1:
{
byte trackNo = (byte)(q[1] / 16 * 10 + (q[1] & 0x0F));
var trackNo = (byte)(q[1] / 16 * 10 + (q[1] & 0x0F));
for(int i = 0; i < tracks.Length; i++)
for(var i = 0; i < tracks.Length; i++)
{
if(tracks[i].Sequence != trackNo) continue;
// Pregap
if(q[2] == 0 && trackNo > 1)
{
byte pmin = (byte)(q[3] / 16 * 10 + (q[3] & 0x0F));
byte psec = (byte)(q[4] / 16 * 10 + (q[4] & 0x0F));
byte pframe = (byte)(q[5] / 16 * 10 + (q[5] & 0x0F));
int qPos = pmin * 60 * 75 + psec * 75 + pframe;
var pmin = (byte)(q[3] / 16 * 10 + (q[3] & 0x0F));
var psec = (byte)(q[4] / 16 * 10 + (q[4] & 0x0F));
var pframe = (byte)(q[5] / 16 * 10 + (q[5] & 0x0F));
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 not, we go from index 0.
@@ -427,7 +424,7 @@ public static class CompactDisc
trackNo,
tracks[i].Pregap));
for(int p = 0; p < dif; p++) newPregapSectors.Add(tracks[i].StartSector + (ulong)p);
for(var p = 0; p < dif; p++) newPregapSectors.Add(tracks[i].StartSector + (ulong)p);
status = true;
}
@@ -446,7 +443,7 @@ public static class CompactDisc
trackNo,
tracks[i].Pregap));
for(int p = 0; p < (int)(tracks[i].Pregap - oldPregap); p++)
for(var p = 0; p < (int)(tracks[i].Pregap - oldPregap); p++)
newPregapSectors.Add(tracks[i].StartSector + (ulong)p);
status = true;
@@ -456,10 +453,10 @@ public static class CompactDisc
if(q[2] == 0) continue;
byte amin = (byte)(q[7] / 16 * 10 + (q[7] & 0x0F));
byte asec = (byte)(q[8] / 16 * 10 + (q[8] & 0x0F));
byte aframe = (byte)(q[9] / 16 * 10 + (q[9] & 0x0F));
int aPos = amin * 60 * 75 + asec * 75 + aframe - 150;
var amin = (byte)(q[7] / 16 * 10 + (q[7] & 0x0F));
var asec = (byte)(q[8] / 16 * 10 + (q[8] & 0x0F));
var aframe = (byte)(q[9] / 16 * 10 + (q[9] & 0x0F));
int aPos = amin * 60 * 75 + asec * 75 + aframe - 150;
// 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;
@@ -495,18 +492,18 @@ public static class CompactDisc
rwPacket = false;
cdtextPacket = false;
byte[] cdTextPack1 = new byte[18];
byte[] cdTextPack2 = new byte[18];
byte[] cdTextPack3 = new byte[18];
byte[] cdTextPack4 = new byte[18];
byte[] cdSubRwPack1 = new byte[24];
byte[] cdSubRwPack2 = new byte[24];
byte[] cdSubRwPack3 = new byte[24];
byte[] cdSubRwPack4 = new byte[24];
var cdTextPack1 = new byte[18];
var cdTextPack2 = new byte[18];
var cdTextPack3 = new byte[18];
var cdTextPack4 = new byte[18];
var cdSubRwPack1 = new byte[24];
var cdSubRwPack2 = new byte[24];
var cdSubRwPack3 = new byte[24];
var cdSubRwPack4 = new byte[24];
int i = 0;
var i = 0;
for(int j = 0; j < 18; j++)
for(var j = 0; j < 18; j++)
{
cdTextPack1[j] = (byte)(cdTextPack1[j] | (subchannel[i++] & 0x3F) << 2);
@@ -521,7 +518,7 @@ public static class CompactDisc
if(j < 18) cdTextPack1[j] = (byte)(cdTextPack1[j] | subchannel[i++] & 0x3F);
}
for(int j = 0; j < 18; j++)
for(var j = 0; j < 18; j++)
{
cdTextPack2[j] = (byte)(cdTextPack2[j] | (subchannel[i++] & 0x3F) << 2);
@@ -536,7 +533,7 @@ public static class CompactDisc
if(j < 18) cdTextPack2[j] = (byte)(cdTextPack2[j] | subchannel[i++] & 0x3F);
}
for(int j = 0; j < 18; j++)
for(var j = 0; j < 18; j++)
{
cdTextPack3[j] = (byte)(cdTextPack3[j] | (subchannel[i++] & 0x3F) << 2);
@@ -551,7 +548,7 @@ public static class CompactDisc
if(j < 18) cdTextPack3[j] = (byte)(cdTextPack3[j] | subchannel[i++] & 0x3F);
}
for(int j = 0; j < 18; j++)
for(var j = 0; j < 18; j++)
{
cdTextPack4[j] = (byte)(cdTextPack4[j] | (subchannel[i++] & 0x3F) << 2);
@@ -568,13 +565,13 @@ public static class CompactDisc
i = 0;
for(int j = 0; j < 24; j++) cdSubRwPack1[j] = (byte)(subchannel[i++] & 0x3F);
for(var j = 0; j < 24; j++) cdSubRwPack1[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++) cdSubRwPack2[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++) cdSubRwPack3[j] = (byte)(subchannel[i++] & 0x3F);
for(int j = 0; j < 24; j++) cdSubRwPack4[j] = (byte)(subchannel[i++] & 0x3F);
for(var j = 0; j < 24; j++) cdSubRwPack4[j] = (byte)(subchannel[i++] & 0x3F);
switch(cdSubRwPack1[0])
{
@@ -670,14 +667,14 @@ public static class CompactDisc
/// <returns><c>true</c> if subchannel contains a TEXT packet, <c>false</c> otherwise</returns>
static bool CheckCdTextPackets(byte[] subchannel)
{
byte[] cdTextPack1 = new byte[18];
byte[] cdTextPack2 = new byte[18];
byte[] cdTextPack3 = new byte[18];
byte[] cdTextPack4 = new byte[18];
var cdTextPack1 = new byte[18];
var cdTextPack2 = new byte[18];
var cdTextPack3 = new byte[18];
var cdTextPack4 = new byte[18];
int i = 0;
var i = 0;
for(int j = 0; j < 18; j++)
for(var j = 0; j < 18; j++)
{
cdTextPack1[j] = (byte)(cdTextPack1[j] | (subchannel[i++] & 0x3F) << 2);
@@ -692,7 +689,7 @@ public static class CompactDisc
if(j < 18) cdTextPack1[j] = (byte)(cdTextPack1[j] | subchannel[i++] & 0x3F);
}
for(int j = 0; j < 18; j++)
for(var j = 0; j < 18; j++)
{
cdTextPack2[j] = (byte)(cdTextPack2[j] | (subchannel[i++] & 0x3F) << 2);
@@ -707,7 +704,7 @@ public static class CompactDisc
if(j < 18) cdTextPack2[j] = (byte)(cdTextPack2[j] | subchannel[i++] & 0x3F);
}
for(int j = 0; j < 18; j++)
for(var j = 0; j < 18; j++)
{
cdTextPack3[j] = (byte)(cdTextPack3[j] | (subchannel[i++] & 0x3F) << 2);
@@ -722,7 +719,7 @@ public static class CompactDisc
if(j < 18) cdTextPack3[j] = (byte)(cdTextPack3[j] | subchannel[i++] & 0x3F);
}
for(int j = 0; j < 18; j++)
for(var j = 0; j < 18; j++)
{
cdTextPack4[j] = (byte)(cdTextPack4[j] | (subchannel[i++] & 0x3F) << 2);
@@ -737,12 +734,12 @@ public static class CompactDisc
if(j < 18) cdTextPack4[j] = (byte)(cdTextPack4[j] | subchannel[i++] & 0x3F);
}
bool status = true;
var status = true;
if((cdTextPack1[0] & 0x80) == 0x80)
{
ushort cdTextPack1Crc = BigEndianBitConverter.ToUInt16(cdTextPack1, 16);
byte[] cdTextPack1ForCrc = new byte[16];
var cdTextPack1Crc = BigEndianBitConverter.ToUInt16(cdTextPack1, 16);
var cdTextPack1ForCrc = new byte[16];
Array.Copy(cdTextPack1, 0, cdTextPack1ForCrc, 0, 16);
ushort calculatedCdtp1Crc = CRC16CcittContext.Calculate(cdTextPack1ForCrc);
@@ -751,8 +748,8 @@ public static class CompactDisc
if((cdTextPack2[0] & 0x80) == 0x80)
{
ushort cdTextPack2Crc = BigEndianBitConverter.ToUInt16(cdTextPack2, 16);
byte[] cdTextPack2ForCrc = new byte[16];
var cdTextPack2Crc = BigEndianBitConverter.ToUInt16(cdTextPack2, 16);
var cdTextPack2ForCrc = new byte[16];
Array.Copy(cdTextPack2, 0, cdTextPack2ForCrc, 0, 16);
ushort calculatedCdtp2Crc = CRC16CcittContext.Calculate(cdTextPack2ForCrc);
@@ -761,8 +758,8 @@ public static class CompactDisc
if((cdTextPack3[0] & 0x80) == 0x80)
{
ushort cdTextPack3Crc = BigEndianBitConverter.ToUInt16(cdTextPack3, 16);
byte[] cdTextPack3ForCrc = new byte[16];
var cdTextPack3Crc = BigEndianBitConverter.ToUInt16(cdTextPack3, 16);
var cdTextPack3ForCrc = new byte[16];
Array.Copy(cdTextPack3, 0, cdTextPack3ForCrc, 0, 16);
ushort calculatedCdtp3Crc = CRC16CcittContext.Calculate(cdTextPack3ForCrc);
@@ -771,8 +768,8 @@ public static class CompactDisc
if((cdTextPack4[0] & 0x80) != 0x80) return status;
ushort cdTextPack4Crc = BigEndianBitConverter.ToUInt16(cdTextPack4, 16);
byte[] cdTextPack4ForCrc = new byte[16];
var cdTextPack4Crc = BigEndianBitConverter.ToUInt16(cdTextPack4, 16);
var cdTextPack4ForCrc = new byte[16];
Array.Copy(cdTextPack4, 0, cdTextPack4ForCrc, 0, 16);
ushort calculatedCdtp4Crc = CRC16CcittContext.Calculate(cdTextPack4ForCrc);
@@ -816,8 +813,8 @@ public static class CompactDisc
fixedMcn = false;
fixedIsrc = false;
byte[] preQ = new byte[12];
byte[] nextQ = new byte[12];
var preQ = new byte[12];
var nextQ = new byte[12];
Array.Copy(deSub, subPos + 12 - 96, preQ, 0, 12);
Array.Copy(deSub, subPos + 12 + 96, nextQ, 0, 12);
@@ -971,15 +968,15 @@ public static class CompactDisc
}
}
byte amin = (byte)(q[7] / 16 * 10 + (q[7] & 0x0F));
byte asec = (byte)(q[8] / 16 * 10 + (q[8] & 0x0F));
var amin = (byte)(q[7] / 16 * 10 + (q[7] & 0x0F));
var asec = (byte)(q[8] / 16 * 10 + (q[8] & 0x0F));
aframe = (byte)(q[9] / 16 * 10 + (q[9] & 0x0F));
int aPos = amin * 60 * 75 + asec * 75 + aframe - 150;
byte pmin = (byte)(q[3] / 16 * 10 + (q[3] & 0x0F));
byte psec = (byte)(q[4] / 16 * 10 + (q[4] & 0x0F));
byte pframe = (byte)(q[5] / 16 * 10 + (q[5] & 0x0F));
int pPos = pmin * 60 * 75 + psec * 75 + pframe;
var pmin = (byte)(q[3] / 16 * 10 + (q[3] & 0x0F));
var psec = (byte)(q[4] / 16 * 10 + (q[4] & 0x0F));
var pframe = (byte)(q[5] / 16 * 10 + (q[5] & 0x0F));
int pPos = pmin * 60 * 75 + psec * 75 + pframe;
// TODO: pregap
// Not pregap
@@ -1536,7 +1533,7 @@ public static class CompactDisc
byte[] sub = Subchannel.Generate(sector, track?.Sequence ?? 0, (int)pregap, (int)trackStart, flags, index);
outputPlugin.WriteSectorsTag(sub, (ulong)sector, 1, SectorTagType.CdSectorSubchannel);
outputPlugin.WriteSectorsTag(sub, (ulong)sector, false, 1, SectorTagType.CdSectorSubchannel);
subLog?.WriteEntry(sub, true, sector, 1, true, false);
}

View File

@@ -401,7 +401,7 @@ public sealed partial class Sidecar
if(sectors - doneSectors >= sectorsToRead)
{
errno = image.ReadSectors(doneSectors, sectorsToRead, out sector, out _);
errno = image.ReadSectors(doneSectors, false, sectorsToRead, out sector, out _);
if(errno != ErrorNumber.NoError)
{
@@ -416,7 +416,7 @@ public sealed partial class Sidecar
}
else
{
errno = image.ReadSectors(doneSectors, (uint)(sectors - doneSectors), out sector, out _);
errno = image.ReadSectors(doneSectors, false, (uint)(sectors - doneSectors), out sector, out _);
if(errno != ErrorNumber.NoError)
{
@@ -501,6 +501,7 @@ public sealed partial class Sidecar
if(sectors - doneSectors >= sectorsToRead)
{
errno = image.ReadSectors(tapePartition.FirstBlock + doneSectors,
false,
sectorsToRead,
out sector,
out _);
@@ -522,6 +523,7 @@ public sealed partial class Sidecar
else
{
errno = image.ReadSectors(tapePartition.FirstBlock + doneSectors,
false,
(uint)(sectors - doneSectors),
out sector,
out _);
@@ -605,6 +607,7 @@ public sealed partial class Sidecar
if(sectors - doneSectors >= sectorsToRead)
{
errno = image.ReadSectors(tapeFile.FirstBlock + doneSectors,
false,
sectorsToRead,
out sector,
out _);
@@ -629,6 +632,7 @@ public sealed partial class Sidecar
else
{
errno = image.ReadSectors(tapeFile.FirstBlock + doneSectors,
false,
(uint)(sectors - doneSectors),
out sector,
out _);

View File

@@ -663,11 +663,11 @@ public sealed partial class Sidecar
xmlTrk.FileSystemInformation.Add(metadataPartition);
}
errno = image.ReadSectorTag(trk.Sequence, SectorTagType.CdTrackIsrc, out byte[] isrcData);
errno = image.ReadSectorTag(trk.Sequence, false, SectorTagType.CdTrackIsrc, out byte[] isrcData);
if(errno == ErrorNumber.NoError) xmlTrk.ISRC = Encoding.UTF8.GetString(isrcData);
errno = image.ReadSectorTag(trk.Sequence, SectorTagType.CdTrackFlags, out byte[] flagsData);
errno = image.ReadSectorTag(trk.Sequence, false, SectorTagType.CdTrackFlags, out byte[] flagsData);
if(errno == ErrorNumber.NoError)
{

View File

@@ -964,7 +964,7 @@ public class CSS
for(ulong i = 0; i < sectorsToSearch; i++)
{
input.ReadSector(startSector + i, out byte[] sector, out _);
input.ReadSector(startSector + i, false, out byte[] sector, out _);
if(!IsEncrypted(null, null, sector)) continue;

View File

@@ -60,7 +60,7 @@ public sealed partial class AODOS
// Does AO-DOS support any other kind of disk?
if(imagePlugin.Info.Sectors != 800 && imagePlugin.Info.Sectors != 1600) return false;
ErrorNumber errno = imagePlugin.ReadSector(0, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(0, false, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -75,7 +75,7 @@ public sealed partial class AODOS
{
information = "";
encoding = Encoding.GetEncoding("koi8-r");
ErrorNumber errno = imagePlugin.ReadSector(0, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(0, false, out byte[] sector, out _);
metadata = new FileSystem();
if(errno != ErrorNumber.NoError) return;

View File

@@ -50,7 +50,7 @@ public sealed partial class APFS
{
if(partition.Start >= partition.End) return false;
ErrorNumber errno = imagePlugin.ReadSector(partition.Start, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(partition.Start, false, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -80,7 +80,7 @@ public sealed partial class APFS
if(partition.Start >= partition.End) return;
ErrorNumber errno = imagePlugin.ReadSector(partition.Start, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(partition.Start, false, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -60,14 +60,14 @@ public sealed partial class AcornADFS
// ADFS-S, ADFS-M, ADFS-L, ADFS-D without partitions
if(partition.Start == 0)
{
errno = imagePlugin.ReadSector(0, out sector, out _);
errno = imagePlugin.ReadSector(0, false, out sector, out _);
if(errno != ErrorNumber.NoError) return false;
byte oldChk0 = AcornMapChecksum(sector, 255);
OldMapSector0 oldMap0 = Marshal.ByteArrayToStructureLittleEndian<OldMapSector0>(sector);
errno = imagePlugin.ReadSector(1, out sector, out _);
errno = imagePlugin.ReadSector(1, false, out sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -80,7 +80,7 @@ public sealed partial class AcornADFS
// According to documentation map1 MUST start on sector 1. On ADFS-D it starts at 0x100, not on sector 1 (0x400)
if(oldMap0.checksum == oldChk0 && oldMap1.checksum != oldChk1 && sector.Length >= 512)
{
errno = imagePlugin.ReadSector(0, out sector, out _);
errno = imagePlugin.ReadSector(0, false, out sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -103,7 +103,7 @@ public sealed partial class AcornADFS
if(OLD_DIRECTORY_SIZE % imagePlugin.Info.SectorSize > 0) sectorsToRead++;
errno = imagePlugin.ReadSectors(sbSector, sectorsToRead, out sector, out _);
errno = imagePlugin.ReadSectors(sbSector, false, sectorsToRead, out sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -136,7 +136,7 @@ public sealed partial class AcornADFS
if(NEW_DIRECTORY_SIZE % imagePlugin.Info.SectorSize > 0) sectorsToRead++;
errno = imagePlugin.ReadSectors(sbSector, sectorsToRead, out sector, out _);
errno = imagePlugin.ReadSectors(sbSector, false, sectorsToRead, out sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -168,7 +168,7 @@ public sealed partial class AcornADFS
// Partitioning or not, new formats follow:
DiscRecord drSb;
errno = imagePlugin.ReadSector(partition.Start, out sector, out _);
errno = imagePlugin.ReadSector(partition.Start, false, out sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -183,7 +183,7 @@ public sealed partial class AcornADFS
if(sbSector + partition.Start + sectorsToRead >= partition.End) return false;
errno = imagePlugin.ReadSectors(sbSector + partition.Start, sectorsToRead, out byte[] bootSector, out _);
errno = imagePlugin.ReadSectors(sbSector + partition.Start, false, sectorsToRead, out byte[] bootSector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -254,14 +254,14 @@ public sealed partial class AcornADFS
// ADFS-S, ADFS-M, ADFS-L, ADFS-D without partitions
if(partition.Start == 0)
{
errno = imagePlugin.ReadSector(0, out sector, out _);
errno = imagePlugin.ReadSector(0, false, out sector, out _);
if(errno != ErrorNumber.NoError) return;
byte oldChk0 = AcornMapChecksum(sector, 255);
OldMapSector0 oldMap0 = Marshal.ByteArrayToStructureLittleEndian<OldMapSector0>(sector);
errno = imagePlugin.ReadSector(1, out sector, out _);
errno = imagePlugin.ReadSector(1, false, out sector, out _);
if(errno != ErrorNumber.NoError) return;
@@ -271,7 +271,7 @@ public sealed partial class AcornADFS
// According to documentation map1 MUST start on sector 1. On ADFS-D it starts at 0x100, not on sector 1 (0x400)
if(oldMap0.checksum == oldChk0 && oldMap1.checksum != oldChk1 && sector.Length >= 512)
{
errno = imagePlugin.ReadSector(0, out sector, out _);
errno = imagePlugin.ReadSector(0, false, out sector, out _);
if(errno != ErrorNumber.NoError) return;
@@ -310,7 +310,7 @@ public sealed partial class AcornADFS
if(OLD_DIRECTORY_SIZE % imagePlugin.Info.SectorSize > 0) sectorsToRead++;
errno = imagePlugin.ReadSectors(sbSector, sectorsToRead, out sector, out _);
errno = imagePlugin.ReadSectors(sbSector, false, sectorsToRead, out sector, out _);
if(errno != ErrorNumber.NoError) return;
@@ -334,7 +334,7 @@ public sealed partial class AcornADFS
if(NEW_DIRECTORY_SIZE % imagePlugin.Info.SectorSize > 0) sectorsToRead++;
errno = imagePlugin.ReadSectors(sbSector, sectorsToRead, out sector, out _);
errno = imagePlugin.ReadSectors(sbSector, false, sectorsToRead, out sector, out _);
if(errno != ErrorNumber.NoError) return;
@@ -354,7 +354,7 @@ public sealed partial class AcornADFS
namebytes = oldRoot.tail.name;
else
{
errno = imagePlugin.ReadSectors(sbSector, sectorsToRead, out sector, out _);
errno = imagePlugin.ReadSectors(sbSector, false, sectorsToRead, out sector, out _);
if(errno != ErrorNumber.NoError) return;
@@ -402,7 +402,7 @@ public sealed partial class AcornADFS
// Partitioning or not, new formats follow:
DiscRecord drSb;
errno = imagePlugin.ReadSector(partition.Start, out sector, out _);
errno = imagePlugin.ReadSector(partition.Start, false, out sector, out _);
if(errno != ErrorNumber.NoError) return;
@@ -415,7 +415,7 @@ public sealed partial class AcornADFS
if(BOOT_BLOCK_SIZE % imagePlugin.Info.SectorSize > 0) sectorsToRead++;
errno = imagePlugin.ReadSectors(sbSector + partition.Start, sectorsToRead, out byte[] bootSector, out _);
errno = imagePlugin.ReadSectors(sbSector + partition.Start, false, sectorsToRead, out byte[] bootSector, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -56,7 +56,7 @@ public sealed partial class AmigaDOSPlugin
// However while you can set a block size different from the sector size on formatting, the bootblock block
// size for floppies is the sector size, and for RDB is usually is the hard disk sector size,
// so this is not entirely wrong...
ErrorNumber errno = imagePlugin.ReadSectors(0 + partition.Start, 2, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSectors(0 + partition.Start, false, 2, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -69,7 +69,7 @@ public sealed partial class AmigaDOSPlugin
(bblk.diskType & FFS_MASK) != FFS_MASK &&
(bblk.diskType & MUFS_MASK) != MUFS_MASK)
{
errno = imagePlugin.ReadSectors(1 + partition.Start, 2, out sector, out _);
errno = imagePlugin.ReadSectors(1 + partition.Start, false, 2, out sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -110,7 +110,7 @@ public sealed partial class AmigaDOSPlugin
{
AaruLogging.Debug(MODULE_NAME, Localization.Searching_for_Rootblock_in_sector_0, rootPtr);
errno = imagePlugin.ReadSector(rootPtr, out sector, out _);
errno = imagePlugin.ReadSector(rootPtr, false, out sector, out _);
if(errno != ErrorNumber.NoError) continue;
@@ -133,7 +133,7 @@ public sealed partial class AmigaDOSPlugin
if(rootPtr + sectorsPerBlock >= partition.End) continue;
errno = imagePlugin.ReadSectors(rootPtr, sectorsPerBlock, out sector, out _);
errno = imagePlugin.ReadSectors(rootPtr, false, sectorsPerBlock, out sector, out _);
if(errno != ErrorNumber.NoError) continue;
@@ -162,7 +162,7 @@ public sealed partial class AmigaDOSPlugin
var sbInformation = new StringBuilder();
metadata = new FileSystem();
information = null;
ErrorNumber errno = imagePlugin.ReadSectors(0 + partition.Start, 2, out byte[] bootBlockSectors, out _);
ErrorNumber errno = imagePlugin.ReadSectors(0 + partition.Start, false, 2, out byte[] bootBlockSectors, out _);
if(errno != ErrorNumber.NoError) return;
@@ -200,7 +200,7 @@ public sealed partial class AmigaDOSPlugin
{
AaruLogging.Debug(MODULE_NAME, Localization.Searching_for_Rootblock_in_sector_0, rootPtr);
errno = imagePlugin.ReadSector(rootPtr, out rootBlockSector, out _);
errno = imagePlugin.ReadSector(rootPtr, false, out rootBlockSector, out _);
if(errno != ErrorNumber.NoError) continue;
@@ -223,7 +223,7 @@ public sealed partial class AmigaDOSPlugin
if(rootPtr + sectorsPerBlock >= partition.End) continue;
errno = imagePlugin.ReadSectors(rootPtr, sectorsPerBlock, out rootBlockSector, out _);
errno = imagePlugin.ReadSectors(rootPtr, false, sectorsPerBlock, out rootBlockSector, out _);
if(errno != ErrorNumber.NoError) continue;
@@ -240,7 +240,7 @@ public sealed partial class AmigaDOSPlugin
if(rootBlk.sec_type != SUBTYPE_ROOT || rootBlk.checksum != rsum) continue;
errno = imagePlugin.ReadSectors(rootPtr, sectorsPerBlock, out rootBlockSector, out _);
errno = imagePlugin.ReadSectors(rootPtr, false, sectorsPerBlock, out rootBlockSector, out _);
if(errno != ErrorNumber.NoError) continue;

View File

@@ -56,7 +56,7 @@ public sealed partial class AppleDOS
while(lba != 0)
{
_usedSectors++;
ErrorNumber errno = _device.ReadSector(lba, out byte[] catSectorB, out _);
ErrorNumber errno = _device.ReadSector(lba, false, out byte[] catSectorB, out _);
if(errno != ErrorNumber.NoError) return errno;

View File

@@ -64,7 +64,7 @@ public sealed partial class AppleDOS
while(lba != 0)
{
_usedSectors++;
ErrorNumber errno = _device.ReadSector(lba, out byte[] tsSectorB, out _);
ErrorNumber errno = _device.ReadSector(lba, false, out byte[] tsSectorB, out _);
if(errno != ErrorNumber.NoError) return errno;
@@ -90,7 +90,7 @@ public sealed partial class AppleDOS
if(blockLba == 0) break;
errno = _device.ReadSector(blockLba, out byte[] fileBlock, out _);
errno = _device.ReadSector(blockLba, false, out byte[] fileBlock, out _);
if(errno != ErrorNumber.NoError) return errno;
@@ -128,7 +128,8 @@ public sealed partial class AppleDOS
if(!_track2UsedByFiles) tracksOnBoot++;
ErrorNumber errno = _device.ReadSectors(0, (uint)(tracksOnBoot * _sectorsPerTrack), out _bootBlocks, out _);
ErrorNumber errno =
_device.ReadSectors(0, false, (uint)(tracksOnBoot * _sectorsPerTrack), out _bootBlocks, out _);
if(errno != ErrorNumber.NoError) return errno;

View File

@@ -48,7 +48,7 @@ public sealed partial class AppleDOS
int spt = imagePlugin.Info.Sectors == 455 ? 13 : 16;
ErrorNumber errno = imagePlugin.ReadSector((ulong)(17 * spt), out byte[] vtocB, out _);
ErrorNumber errno = imagePlugin.ReadSector((ulong)(17 * spt), false, out byte[] vtocB, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -70,7 +70,7 @@ public sealed partial class AppleDOS
int spt = imagePlugin.Info.Sectors == 455 ? 13 : 16;
ErrorNumber errno = imagePlugin.ReadSector((ulong)(17 * spt), out byte[] vtocB, out _);
ErrorNumber errno = imagePlugin.ReadSector((ulong)(17 * spt), false, out byte[] vtocB, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -75,7 +75,7 @@ public sealed partial class AppleDOS
_sectorsPerTrack = _device.Info.Sectors == 455 ? 13 : 16;
// Read the VTOC
ErrorNumber error = _device.ReadSector((ulong)(17 * _sectorsPerTrack), out _vtocBlocks, out _);
ErrorNumber error = _device.ReadSector((ulong)(17 * _sectorsPerTrack), false, out _vtocBlocks, out _);
if(error != ErrorNumber.NoError) return error;

View File

@@ -54,7 +54,7 @@ public sealed partial class AppleHFS
if(imagePlugin.Info.SectorSize is 2352 or 2448 or 2048)
{
errno = imagePlugin.ReadSectors(partition.Start, 2, out mdbSector, out _);
errno = imagePlugin.ReadSectors(partition.Start, false, 2, out mdbSector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -74,7 +74,7 @@ public sealed partial class AppleHFS
}
else
{
errno = imagePlugin.ReadSector(2 + partition.Start, out mdbSector, out _);
errno = imagePlugin.ReadSector(2 + partition.Start, false, out mdbSector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -111,7 +111,7 @@ public sealed partial class AppleHFS
if(imagePlugin.Info.SectorSize is 2352 or 2448 or 2048)
{
errno = imagePlugin.ReadSectors(partition.Start, 2, out byte[] tmpSector, out _);
errno = imagePlugin.ReadSectors(partition.Start, false, 2, out byte[] tmpSector, out _);
if(errno != ErrorNumber.NoError) return;
@@ -139,7 +139,7 @@ public sealed partial class AppleHFS
}
else
{
errno = imagePlugin.ReadSector(2 + partition.Start, out mdbSector, out _);
errno = imagePlugin.ReadSector(2 + partition.Start, false, out mdbSector, out _);
if(errno != ErrorNumber.NoError) return;
@@ -147,7 +147,7 @@ public sealed partial class AppleHFS
if(drSigWord == AppleCommon.HFS_MAGIC)
{
errno = imagePlugin.ReadSector(partition.Start, out bbSector, out _);
errno = imagePlugin.ReadSector(partition.Start, false, out bbSector, out _);
if(errno != ErrorNumber.NoError) return;
}

View File

@@ -54,7 +54,7 @@ public sealed partial class AppleHFSPlus
if(0x800 % imagePlugin.Info.SectorSize > 0) sectorsToRead++;
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, sectorsToRead, out byte[] vhSector, out _);
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, false, sectorsToRead, out byte[] vhSector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -84,6 +84,7 @@ public sealed partial class AppleHFSPlus
hfspOffset = 0;
errno = imagePlugin.ReadSectors(partition.Start + hfspOffset,
false,
sectorsToRead,
out vhSector,
out _); // Read volume header
@@ -111,7 +112,7 @@ public sealed partial class AppleHFSPlus
if(0x800 % imagePlugin.Info.SectorSize > 0) sectorsToRead++;
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, sectorsToRead, out byte[] vhSector, out _);
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, false, sectorsToRead, out byte[] vhSector, out _);
if(errno != ErrorNumber.NoError) return;
@@ -146,6 +147,7 @@ public sealed partial class AppleHFSPlus
}
errno = imagePlugin.ReadSectors(partition.Start + hfspOffset,
false,
sectorsToRead,
out vhSector,
out _); // Read volume header

View File

@@ -93,12 +93,14 @@ public sealed partial class AppleMFS
? _device.ReadSectorsTag((ulong)((nextBlock - 2) * _sectorsPerBlock) +
_volMdb.drAlBlSt +
_partitionStart,
false,
(uint)_sectorsPerBlock,
SectorTagType.AppleSonyTag,
out byte[] sectors)
: _device.ReadSectors((ulong)((nextBlock - 2) * _sectorsPerBlock) +
_volMdb.drAlBlSt +
_partitionStart,
false,
(uint)_sectorsPerBlock,
out sectors,
out _);

View File

@@ -48,7 +48,7 @@ public sealed partial class AppleMFS
{
if(2 + partition.Start >= partition.End) return false;
ErrorNumber errno = imagePlugin.ReadSector(2 + partition.Start, out byte[] mdbSector, out _);
ErrorNumber errno = imagePlugin.ReadSector(2 + partition.Start, false, out byte[] mdbSector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -69,11 +69,11 @@ public sealed partial class AppleMFS
var mdb = new MasterDirectoryBlock();
ErrorNumber errno = imagePlugin.ReadSector(2 + partition.Start, out byte[] mdbSector, out _);
ErrorNumber errno = imagePlugin.ReadSector(2 + partition.Start, false, out byte[] mdbSector, out _);
if(errno != ErrorNumber.NoError) return;
errno = imagePlugin.ReadSector(0 + partition.Start, out byte[] bbSector, out _);
errno = imagePlugin.ReadSector(0 + partition.Start, false, out byte[] bbSector, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -59,11 +59,11 @@ public sealed partial class AppleMFS
_volMdb = new MasterDirectoryBlock();
ErrorNumber errno = _device.ReadSector(2 + _partitionStart, out _mdbBlocks, out _);
ErrorNumber errno = _device.ReadSector(2 + _partitionStart, false, out _mdbBlocks, out _);
if(errno != ErrorNumber.NoError) return errno;
errno = _device.ReadSector(0 + _partitionStart, out _bootBlocks, out _);
errno = _device.ReadSector(0 + _partitionStart, false, out _bootBlocks, out _);
if(errno != ErrorNumber.NoError) return errno;
@@ -88,7 +88,11 @@ public sealed partial class AppleMFS
Array.Copy(_mdbBlocks, 0x024, variableSize, 0, _volMdb.drVNSiz + 1);
_volMdb.drVN = StringHandlers.PascalToString(variableSize, _encoding);
errno = _device.ReadSectors(_volMdb.drDirSt + _partitionStart, _volMdb.drBlLen, out _directoryBlocks, out _);
errno = _device.ReadSectors(_volMdb.drDirSt + _partitionStart,
false,
_volMdb.drBlLen,
out _directoryBlocks,
out _);
if(errno != ErrorNumber.NoError) return errno;
@@ -98,7 +102,7 @@ public sealed partial class AppleMFS
int sectorsInWholeMdb = bytesInWholeMdb / (int)_device.Info.SectorSize +
bytesInWholeMdb % (int)_device.Info.SectorSize;
errno = _device.ReadSectors(_partitionStart + 2, (uint)sectorsInWholeMdb, out byte[] wholeMdb, out _);
errno = _device.ReadSectors(_partitionStart + 2, false, (uint)sectorsInWholeMdb, out byte[] wholeMdb, out _);
if(errno != ErrorNumber.NoError) return errno;
@@ -143,15 +147,17 @@ public sealed partial class AppleMFS
if(_device.Info.ReadableSectorTags.Contains(SectorTagType.AppleSonyTag))
{
_device.ReadSectorTag(2 + _partitionStart, SectorTagType.AppleSonyTag, out _mdbTags);
_device.ReadSectorTag(0 + _partitionStart, SectorTagType.AppleSonyTag, out _bootTags);
_device.ReadSectorTag(2 + _partitionStart, false, SectorTagType.AppleSonyTag, out _mdbTags);
_device.ReadSectorTag(0 + _partitionStart, false, SectorTagType.AppleSonyTag, out _bootTags);
_device.ReadSectorsTag(_volMdb.drDirSt + _partitionStart,
false,
_volMdb.drBlLen,
SectorTagType.AppleSonyTag,
out _directoryTags);
_device.ReadSectorsTag(_partitionStart + 2,
false,
(uint)sectorsInWholeMdb,
SectorTagType.AppleSonyTag,
out _bitmapTags);

View File

@@ -55,7 +55,7 @@ public sealed partial class AtheOS
if(sector + partition.Start >= partition.End) return false;
ErrorNumber errno = imagePlugin.ReadSectors(sector + partition.Start, run, out byte[] tmp, out _);
ErrorNumber errno = imagePlugin.ReadSectors(sector + partition.Start, false, run, out byte[] tmp, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -86,7 +86,7 @@ public sealed partial class AtheOS
if(imagePlugin.Info.SectorSize < AFS_SUPERBLOCK_SIZE) run = AFS_SUPERBLOCK_SIZE / imagePlugin.Info.SectorSize;
ErrorNumber errno = imagePlugin.ReadSectors(sector + partition.Start, run, out byte[] tmp, out _);
ErrorNumber errno = imagePlugin.ReadSectors(sector + partition.Start, false, run, out byte[] tmp, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -50,7 +50,7 @@ public sealed partial class BeFS
{
if(2 + partition.Start >= partition.End) return false;
ErrorNumber errno = imagePlugin.ReadSector(0 + partition.Start, out byte[] sbSector, out _);
ErrorNumber errno = imagePlugin.ReadSector(0 + partition.Start, false, out byte[] sbSector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -67,7 +67,7 @@ public sealed partial class BeFS
if(magic == BEFS_MAGIC1 || magicBe == BEFS_MAGIC1) return true;
errno = imagePlugin.ReadSector(1 + partition.Start, out sbSector, out _);
errno = imagePlugin.ReadSector(1 + partition.Start, false, out sbSector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -89,7 +89,7 @@ public sealed partial class BeFS
var besb = new SuperBlock();
ErrorNumber errno = imagePlugin.ReadSector(0 + partition.Start, out byte[] sbSector, out _);
ErrorNumber errno = imagePlugin.ReadSector(0 + partition.Start, false, out byte[] sbSector, out _);
if(errno != ErrorNumber.NoError) return;
@@ -101,7 +101,7 @@ public sealed partial class BeFS
littleEndian = besb.magic1 == BEFS_CIGAM1;
else
{
errno = imagePlugin.ReadSector(1 + partition.Start, out sbSector, out _);
errno = imagePlugin.ReadSector(1 + partition.Start, false, out sbSector, out _);
if(errno != ErrorNumber.NoError) return;
@@ -111,7 +111,7 @@ public sealed partial class BeFS
littleEndian = besb.magic1 == BEFS_CIGAM1;
else if(sbSector.Length >= 0x400)
{
errno = imagePlugin.ReadSector(0 + partition.Start, out byte[] temp, out _);
errno = imagePlugin.ReadSector(0 + partition.Start, false, out byte[] temp, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -59,7 +59,7 @@ public sealed partial class BTRFS
if(sbSectorOff + partition.Start >= partition.End) return false;
ErrorNumber errno =
imagePlugin.ReadSectors(sbSectorOff + partition.Start, sbSectorSize, out byte[] sector, out _);
imagePlugin.ReadSectors(sbSectorOff + partition.Start, false, sbSectorSize, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -96,7 +96,7 @@ public sealed partial class BTRFS
uint sbSectorSize = 0x1000 / imagePlugin.Info.SectorSize;
ErrorNumber errno =
imagePlugin.ReadSectors(sbSectorOff + partition.Start, sbSectorSize, out byte[] sector, out _);
imagePlugin.ReadSectors(sbSectorOff + partition.Start, false, sbSectorSize, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -61,7 +61,7 @@ public sealed partial class CBM
if(imagePlugin.Info.Sectors == 3200)
{
ErrorNumber errno = imagePlugin.ReadSector(1560, out sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(1560, false, out sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -71,7 +71,7 @@ public sealed partial class CBM
}
else
{
ErrorNumber errno = imagePlugin.ReadSector(357, out sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(357, false, out sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -105,7 +105,7 @@ public sealed partial class CBM
if(imagePlugin.Info.Sectors == 3200)
{
ErrorNumber errno = imagePlugin.ReadSector(1560, out sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(1560, false, out sector, out _);
if(errno != ErrorNumber.NoError) return;
@@ -147,7 +147,7 @@ public sealed partial class CBM
}
else
{
ErrorNumber errno = imagePlugin.ReadSector(357, out sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(357, false, out sector, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -84,7 +84,7 @@ public sealed partial class CBM
// Commodore 1581
if(imagePlugin.Info.Sectors == 3200)
{
ErrorNumber errno = imagePlugin.ReadSector(1560, out _diskHeader, out _);
ErrorNumber errno = imagePlugin.ReadSector(1560, false, out _diskHeader, out _);
if(errno != ErrorNumber.NoError) return errno;
@@ -96,7 +96,7 @@ public sealed partial class CBM
_bam = new byte[512];
// Got to first BAM sector
errno = imagePlugin.ReadSector(1561, out sector, out _);
errno = imagePlugin.ReadSector(1561, false, out sector, out _);
if(errno != ErrorNumber.NoError) return errno;
@@ -105,7 +105,7 @@ public sealed partial class CBM
if(_bam[0] > 0)
{
// Got to next (and last) BAM sector
errno = imagePlugin.ReadSector((ulong)((_bam[0] - 1) * 40), out sector, out _);
errno = imagePlugin.ReadSector((ulong)((_bam[0] - 1) * 40), false, out sector, out _);
if(errno != ErrorNumber.NoError) return errno;
@@ -122,7 +122,7 @@ public sealed partial class CBM
}
else
{
ErrorNumber errno = imagePlugin.ReadSector(357, out _bam, out _);
ErrorNumber errno = imagePlugin.ReadSector(357, false, out _bam, out _);
if(errno != ErrorNumber.NoError) return errno;
@@ -147,7 +147,7 @@ public sealed partial class CBM
do
{
ErrorNumber errno = imagePlugin.ReadSector(nextLba, out sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(nextLba, false, out sector, out _);
if(errno != ErrorNumber.NoError) return errno;
@@ -241,9 +241,8 @@ public sealed partial class CBM
_statfs.FreeFiles--;
for(var i = 0; i < dirEntry.name.Length; i++)
{
if(dirEntry.name[i] == 0xA0) dirEntry.name[i] = 0;
}
if(dirEntry.name[i] == 0xA0)
dirEntry.name[i] = 0;
string name = StringHandlers.CToString(dirEntry.name, encoding);
@@ -263,7 +262,7 @@ public sealed partial class CBM
{
if(dirEntry.firstFileBlockTrack == 0) break;
ErrorNumber errno = imagePlugin.ReadSector(nextLba, out sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(nextLba, false, out sector, out _);
if(errno != ErrorNumber.NoError) break;

View File

@@ -181,7 +181,7 @@ public sealed partial class CPM
if(!_cpmFound)
{
// Read CHS = {0,0,1}
errno = imagePlugin.ReadSector(0 + partition.Start, out sector, out _);
errno = imagePlugin.ReadSector(0 + partition.Start, false, out sector, out _);
if(errno == ErrorNumber.NoError)
{
@@ -246,6 +246,7 @@ public sealed partial class CPM
var directoryLength = (uint)(((ulong)_dpb.drm + 1) * 32 / sectorSize);
imagePlugin.ReadSectors(firstDirectorySector + partition.Start,
false,
directoryLength,
out directory,
out _);
@@ -311,7 +312,7 @@ public sealed partial class CPM
if(!_cpmFound)
{
// Read CHS = {0,0,4}
errno = imagePlugin.ReadSector(3 + partition.Start, out sector, out _);
errno = imagePlugin.ReadSector(3 + partition.Start, false, out sector, out _);
if(errno == ErrorNumber.NoError)
{
@@ -366,6 +367,7 @@ public sealed partial class CPM
var directoryLength = (uint)(((ulong)_dpb.drm + 1) * 32 / sectorSize);
imagePlugin.ReadSectors(firstDirectorySector + partition.Start,
false,
directoryLength,
out directory,
out _);
@@ -419,7 +421,7 @@ public sealed partial class CPM
if(!_cpmFound)
{
// Read CHS = {0,0,1}
errno = imagePlugin.ReadSector(0 + partition.Start, out sector, out _);
errno = imagePlugin.ReadSector(0 + partition.Start, false, out sector, out _);
if(errno == ErrorNumber.NoError)
{
@@ -874,6 +876,7 @@ public sealed partial class CPM
var directoryLength = (uint)(((ulong)_dpb.drm + 1) * 32 / imagePlugin.Info.SectorSize);
imagePlugin.ReadSectors(firstDirectorySector86 + partition.Start,
false,
directoryLength,
out directory,
out _);
@@ -1010,6 +1013,7 @@ public sealed partial class CPM
(int)partition.Start +
p / _sectorMask.Length * _sectorMask.Length +
_sectorMask[p % _sectorMask.Length]),
false,
out byte[] dirSector,
out _);
@@ -1029,8 +1033,9 @@ public sealed partial class CPM
// Complement of the directory bytes if needed
if(def.complement)
for(var b = 0; b < directory.Length; b++)
directory[b] = (byte)(~directory[b] & 0xFF);
{
for(var b = 0; b < directory.Length; b++) directory[b] = (byte)(~directory[b] & 0xFF);
}
// Check the directory
if(CheckDir(directory))

View File

@@ -162,15 +162,15 @@ public sealed partial class CPM
_device.ReadSector((ulong)((int)partition.Start +
p / _sectorMask.Length * _sectorMask.Length +
_sectorMask[p % _sectorMask.Length]),
false,
out byte[] readSector,
out _);
if(errno != ErrorNumber.NoError) return errno;
if(_workingDefinition.complement)
{
for(var b = 0; b < readSector.Length; b++) readSector[b] = (byte)(~readSector[b] & 0xFF);
}
for(var b = 0; b < readSector.Length; b++)
readSector[b] = (byte)(~readSector[b] & 0xFF);
deinterleavedSectors.Add((ulong)p, readSector);
}

View File

@@ -51,7 +51,7 @@ public sealed partial class Cram
{
if(partition.Start >= partition.End) return false;
ErrorNumber errno = imagePlugin.ReadSector(partition.Start, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(partition.Start, false, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -66,7 +66,7 @@ public sealed partial class Cram
{
encoding ??= Encoding.GetEncoding("iso-8859-15");
information = "";
ErrorNumber errno = imagePlugin.ReadSector(partition.Start, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(partition.Start, false, out byte[] sector, out _);
metadata = new FileSystem();
if(errno != ErrorNumber.NoError) return;

View File

@@ -53,7 +53,7 @@ public sealed partial class ECMA67
if(partition.End < 8) return false;
ErrorNumber errno = imagePlugin.ReadSector(6, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(6, false, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -70,7 +70,7 @@ public sealed partial class ECMA67
{
information = "";
metadata = new FileSystem();
ErrorNumber errno = imagePlugin.ReadSector(6, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(6, false, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -55,7 +55,7 @@ public sealed partial class EFS
if((Marshal.SizeOf<Superblock>() + 0x200) % imagePlugin.Info.SectorSize != 0) sbSize++;
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, sbSize, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, false, sbSize, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -82,7 +82,7 @@ public sealed partial class EFS
if(Marshal.SizeOf<Superblock>() % imagePlugin.Info.SectorSize != 0) sbSize++;
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start + 1, sbSize, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start + 1, false, sbSize, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -122,7 +122,7 @@ public sealed partial class EFS
if((Marshal.SizeOf<Superblock>() + 0x400) % imagePlugin.Info.SectorSize != 0) sbSize++;
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, sbSize, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, false, sbSize, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return;
@@ -147,7 +147,7 @@ public sealed partial class EFS
if(Marshal.SizeOf<Superblock>() % imagePlugin.Info.SectorSize != 0) sbSize++;
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start + 1, sbSize, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start + 1, false, sbSize, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -58,7 +58,7 @@ public sealed partial class F2FS
if(partition.Start + sbAddr + sbSize >= partition.End) return false;
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start + sbAddr, sbSize, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start + sbAddr, false, sbSize, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -86,7 +86,7 @@ public sealed partial class F2FS
if(Marshal.SizeOf<Superblock>() % imagePlugin.Info.SectorSize != 0) sbSize++;
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start + sbAddr, sbSize, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start + sbAddr, false, sbSize, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -374,10 +374,10 @@ public sealed partial class FAT
byte z80Di = bpbSector[0];
// First FAT1 sector resides at LBA 0x14
imagePlugin.ReadSector(0x14, out byte[] fat1Sector0, out _);
imagePlugin.ReadSector(0x14, false, out byte[] fat1Sector0, out _);
// First FAT2 sector resides at LBA 0x1A
imagePlugin.ReadSector(0x1A, out byte[] fat2Sector0, out _);
imagePlugin.ReadSector(0x1A, false, out byte[] fat2Sector0, out _);
bool equalFatIds = fat1Sector0[0] == fat2Sector0[0] && fat1Sector0[1] == fat2Sector0[1];
// Volume is software interleaved 2:1
@@ -388,7 +388,7 @@ public sealed partial class FAT
0x17, 0x19, 0x1B, 0x1D, 0x1E, 0x20
})
{
imagePlugin.ReadSector(rootSector, out byte[] tmp, out _);
imagePlugin.ReadSector(rootSector, false, out byte[] tmp, out _);
rootMs.Write(tmp, 0, tmp.Length);
}
@@ -449,7 +449,7 @@ public sealed partial class FAT
!useExtendedBpb &&
!useApricotBpb)
{
imagePlugin.ReadSector(1 + partition.Start, out byte[] fatSector, out _);
imagePlugin.ReadSector(1 + partition.Start, false, out byte[] fatSector, out _);
switch(fatSector[0])
{
@@ -807,6 +807,7 @@ public sealed partial class FAT
if(apricotBpb.bootLocation > 0 && apricotBpb.bootLocation + apricotBpb.bootSize < imagePlugin.Info.Sectors)
{
imagePlugin.ReadSectors(apricotBpb.bootLocation,
false,
(uint)(apricotBpb.sectorSize * apricotBpb.bootSize) / imagePlugin.Info.SectorSize,
out fakeBpb.boot_code,
out _);

View File

@@ -144,6 +144,7 @@ public sealed partial class FAT
for(var i = 0; i < clusters.Length; i++)
{
ErrorNumber errno = _image.ReadSectors(_firstClusterSector + clusters[i] * _sectorsPerCluster,
false,
_sectorsPerCluster,
out byte[] buffer,
out _);

View File

@@ -55,7 +55,7 @@ public sealed partial class FAT
var nextEntry = (int)(nextCluster % _fatEntriesPerSector);
ulong currentSector = nextSector;
ErrorNumber errno = _image.ReadSector(currentSector, out byte[] fatData, out _);
ErrorNumber errno = _image.ReadSector(currentSector, false, out byte[] fatData, out _);
if(errno != ErrorNumber.NoError) return null;
@@ -67,7 +67,7 @@ public sealed partial class FAT
if(currentSector != nextSector)
{
errno = _image.ReadSector(nextSector, out fatData, out _);
errno = _image.ReadSector(nextSector, false, out fatData, out _);
if(errno != ErrorNumber.NoError) return null;
@@ -244,6 +244,7 @@ public sealed partial class FAT
ErrorNumber errno =
_image.ReadSectors(_firstClusterSector + mynode.Clusters[i + firstCluster] * _sectorsPerCluster,
false,
_sectorsPerCluster,
out byte[] buf,
out _);

View File

@@ -74,11 +74,12 @@ public sealed partial class FAT
uint sectorsPerBpb = imagePlugin.Info.SectorSize < 512 ? 512 / imagePlugin.Info.SectorSize : 1;
ErrorNumber errno = imagePlugin.ReadSectors(0 + partition.Start, sectorsPerBpb, out byte[] bpbSector, out _);
ErrorNumber errno =
imagePlugin.ReadSectors(0 + partition.Start, false, sectorsPerBpb, out byte[] bpbSector, out _);
if(errno != ErrorNumber.NoError) return false;
errno = imagePlugin.ReadSector(sectorsPerBpb + partition.Start, out byte[] fatSector, out _);
errno = imagePlugin.ReadSector(sectorsPerBpb + partition.Start, false, out byte[] fatSector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -238,6 +239,7 @@ public sealed partial class FAT
if(16 + partition.Start <= partition.End)
{
errno = imagePlugin.ReadSector(16 + partition.Start,
false,
out byte[] hpfsSbSector,
out _); // Seek to superblock, on logical sector 16
@@ -318,12 +320,12 @@ public sealed partial class FAT
byte z80Di = bpbSector[0];
// First FAT1 sector resides at LBA 0x14
errno = imagePlugin.ReadSector(0x14, out byte[] fat1Sector0, out _);
errno = imagePlugin.ReadSector(0x14, false, out byte[] fat1Sector0, out _);
if(errno != ErrorNumber.NoError) return false;
// First FAT2 sector resides at LBA 0x1A
errno = imagePlugin.ReadSector(0x1A, out byte[] fat2Sector0, out _);
errno = imagePlugin.ReadSector(0x1A, false, out byte[] fat2Sector0, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -337,7 +339,7 @@ public sealed partial class FAT
0x17, 0x19, 0x1B, 0x1D, 0x1E, 0x20
})
{
errno = imagePlugin.ReadSector(rootSector, out byte[] tmp, out _);
errno = imagePlugin.ReadSector(rootSector, false, out byte[] tmp, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -429,7 +431,7 @@ public sealed partial class FAT
AaruLogging.Debug(MODULE_NAME, Localization.Second_fat_starts_at_0, fat2SectorNo);
errno = imagePlugin.ReadSector(fat2SectorNo, out byte[] fat2Sector, out _);
errno = imagePlugin.ReadSector(fat2SectorNo, false, out byte[] fat2Sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -454,7 +456,8 @@ public sealed partial class FAT
uint sectorsPerBpb = imagePlugin.Info.SectorSize < 512 ? 512 / imagePlugin.Info.SectorSize : 1;
ErrorNumber errno = imagePlugin.ReadSectors(0 + partition.Start, sectorsPerBpb, out byte[] bpbSector, out _);
ErrorNumber errno =
imagePlugin.ReadSectors(0 + partition.Start, false, sectorsPerBpb, out byte[] bpbSector, out _);
if(errno != ErrorNumber.NoError) return;
@@ -643,6 +646,7 @@ public sealed partial class FAT
if(fat32Bpb.fsinfo_sector + partition.Start <= partition.End)
{
errno = imagePlugin.ReadSector(fat32Bpb.fsinfo_sector + partition.Start,
false,
out byte[] fsinfoSector,
out _);
@@ -781,7 +785,7 @@ public sealed partial class FAT
sectorsPerRealSector = fakeBpb.bps / imagePlugin.Info.SectorSize;
_fatFirstSector = partition.Start + _reservedSectors * sectorsPerRealSector;
errno = imagePlugin.ReadSectors(_fatFirstSector, fakeBpb.spfat, out byte[] fatBytes, out _);
errno = imagePlugin.ReadSectors(_fatFirstSector, false, fakeBpb.spfat, out byte[] fatBytes, out _);
if(errno != ErrorNumber.NoError) return;
@@ -1033,6 +1037,7 @@ public sealed partial class FAT
imagePlugin.Info.MetadataMediaType != MetadataMediaType.OpticalDisc)
{
errno = imagePlugin.ReadSectors(rootDirectorySector + partition.Start,
false,
sectorsForRootDirectory,
out byte[] rootDirectory,
out _);
@@ -1048,7 +1053,7 @@ public sealed partial class FAT
0x17, 0x19, 0x1B, 0x1D, 0x1E, 0x20
})
{
errno = imagePlugin.ReadSector(rootSector, out byte[] tmp, out _);
errno = imagePlugin.ReadSector(rootSector, false, out byte[] tmp, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -96,7 +96,8 @@ public sealed partial class FAT
uint sectorsPerBpb = imagePlugin.Info.SectorSize < 512 ? 512 / imagePlugin.Info.SectorSize : 1;
ErrorNumber errno = imagePlugin.ReadSectors(0 + partition.Start, sectorsPerBpb, out byte[] bpbSector, out _);
ErrorNumber errno =
imagePlugin.ReadSectors(0 + partition.Start, false, sectorsPerBpb, out byte[] bpbSector, out _);
if(errno != ErrorNumber.NoError) return errno;
@@ -193,8 +194,9 @@ public sealed partial class FAT
};
if((fat32Bpb.flags & 0xF8) == 0x00)
if((fat32Bpb.flags & 0x01) == 0x01)
Metadata.Dirty = true;
{
if((fat32Bpb.flags & 0x01) == 0x01) Metadata.Dirty = true;
}
if((fat32Bpb.mirror_flags & 0x80) == 0x80) _useFirstFat = (fat32Bpb.mirror_flags & 0xF) != 1;
@@ -224,6 +226,7 @@ public sealed partial class FAT
if(fat32Bpb.fsinfo_sector + partition.Start <= partition.End)
{
errno = imagePlugin.ReadSector(fat32Bpb.fsinfo_sector + partition.Start,
false,
out byte[] fsinfoSector,
out _);
@@ -325,7 +328,7 @@ public sealed partial class FAT
sectorsPerRealSector = fakeBpb.bps / imagePlugin.Info.SectorSize;
_fatFirstSector = partition.Start + _reservedSectors * sectorsPerRealSector;
errno = imagePlugin.ReadSectors(_fatFirstSector, fakeBpb.spfat, out byte[] fatBytes, out _);
errno = imagePlugin.ReadSectors(_fatFirstSector, false, fakeBpb.spfat, out byte[] fatBytes, out _);
if(errno != ErrorNumber.NoError) return errno;
@@ -458,8 +461,9 @@ public sealed partial class FAT
if(fakeBpb.signature is 0x28 or 0x29 || andosOemCorrect)
{
if((fakeBpb.flags & 0xF8) == 0x00)
if((fakeBpb.flags & 0x01) == 0x01)
Metadata.Dirty = true;
{
if((fakeBpb.flags & 0x01) == 0x01) Metadata.Dirty = true;
}
if(fakeBpb.signature == 0x29 || andosOemCorrect)
{
@@ -512,7 +516,7 @@ public sealed partial class FAT
if(!_fat32)
{
_firstClusterSector = firstRootSector + sectorsForRootDirectory - _sectorsPerCluster * 2;
errno = imagePlugin.ReadSectors(firstRootSector, sectorsForRootDirectory, out rootDirectory, out _);
errno = imagePlugin.ReadSectors(firstRootSector, false, sectorsForRootDirectory, out rootDirectory, out _);
if(errno != ErrorNumber.NoError) return errno;
@@ -525,7 +529,7 @@ public sealed partial class FAT
0x17, 0x19, 0x1B, 0x1D, 0x1E, 0x20
})
{
errno = imagePlugin.ReadSector(rootSector, out byte[] tmp, out _);
errno = imagePlugin.ReadSector(rootSector, false, out byte[] tmp, out _);
if(errno != ErrorNumber.NoError) return errno;
@@ -545,6 +549,7 @@ public sealed partial class FAT
foreach(uint cluster in rootDirectoryClusters)
{
errno = imagePlugin.ReadSectors(_firstClusterSector + cluster * _sectorsPerCluster,
false,
_sectorsPerCluster,
out byte[] buffer,
out _);
@@ -771,7 +776,7 @@ public sealed partial class FAT
{
AaruLogging.Debug(MODULE_NAME, Localization.Reading_FAT12);
errno = imagePlugin.ReadSectors(_fatFirstSector, _sectorsPerFat, out byte[] fatBytes, out _);
errno = imagePlugin.ReadSectors(_fatFirstSector, false, _sectorsPerFat, out byte[] fatBytes, out _);
if(errno != ErrorNumber.NoError) return errno;
@@ -786,7 +791,11 @@ public sealed partial class FAT
firstFatEntries[pos++] = (ushort)(((fatBytes[i + 1] & 0xF0) >> 4) + (fatBytes[i + 2] << 4));
}
errno = imagePlugin.ReadSectors(_fatFirstSector + _sectorsPerFat, _sectorsPerFat, out fatBytes, out _);
errno = imagePlugin.ReadSectors(_fatFirstSector + _sectorsPerFat,
false,
_sectorsPerFat,
out fatBytes,
out _);
if(errno != ErrorNumber.NoError) return errno;
@@ -820,14 +829,18 @@ public sealed partial class FAT
{
AaruLogging.Debug(MODULE_NAME, Localization.Reading_FAT16);
errno = imagePlugin.ReadSectors(_fatFirstSector, _sectorsPerFat, out byte[] fatBytes, out _);
errno = imagePlugin.ReadSectors(_fatFirstSector, false, _sectorsPerFat, out byte[] fatBytes, out _);
if(errno != ErrorNumber.NoError) return errno;
AaruLogging.Debug(MODULE_NAME, Localization.Casting_FAT);
firstFatEntries = MemoryMarshal.Cast<byte, ushort>(fatBytes).ToArray();
errno = imagePlugin.ReadSectors(_fatFirstSector + _sectorsPerFat, _sectorsPerFat, out fatBytes, out _);
errno = imagePlugin.ReadSectors(_fatFirstSector + _sectorsPerFat,
false,
_sectorsPerFat,
out fatBytes,
out _);
if(errno != ErrorNumber.NoError) return errno;

View File

@@ -48,6 +48,7 @@ public sealed partial class FAT
foreach(uint cluster in rootDirectoryClusters)
{
ErrorNumber errno = _image.ReadSectors(_firstClusterSector + cluster * _sectorsPerCluster,
false,
_sectorsPerCluster,
out byte[] buffer,
out _);
@@ -147,6 +148,7 @@ public sealed partial class FAT
foreach(uint cluster in GetClusters(_eaDirEntry.start_cluster))
{
ErrorNumber errno = _image.ReadSectors(_firstClusterSector + cluster * _sectorsPerCluster,
false,
_sectorsPerCluster,
out byte[] buffer,
out _);

View File

@@ -112,6 +112,7 @@ public sealed partial class XboxFatPlugin
{
ErrorNumber errno =
_imagePlugin.ReadSectors(_firstClusterSector + (clusters[i] - 1) * _sectorsPerCluster,
false,
_sectorsPerCluster,
out byte[] buffer,
out _);

View File

@@ -198,6 +198,7 @@ public sealed partial class XboxFatPlugin
ErrorNumber errno =
_imagePlugin.ReadSectors(_firstClusterSector +
(mynode.Clusters[i + firstCluster] - 1) * _sectorsPerCluster,
false,
_sectorsPerCluster,
out byte[] buf,
out _);

View File

@@ -44,7 +44,7 @@ public sealed partial class XboxFatPlugin
{
if(imagePlugin.Info.SectorSize < 512) return false;
ErrorNumber errno = imagePlugin.ReadSector(partition.Start, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(partition.Start, false, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -64,7 +64,7 @@ public sealed partial class XboxFatPlugin
var bigEndian = true;
ErrorNumber errno = imagePlugin.ReadSector(partition.Start, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(partition.Start, false, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -61,7 +61,7 @@ public sealed partial class XboxFatPlugin
AaruLogging.Debug(MODULE_NAME, Localization.Reading_superblock);
ErrorNumber errno = imagePlugin.ReadSector(partition.Start, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(partition.Start, false, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return errno;
@@ -146,7 +146,7 @@ public sealed partial class XboxFatPlugin
AaruLogging.Debug(MODULE_NAME, Localization.FAT_is_0_sectors, fatSize);
errno = imagePlugin.ReadSectors(_fatStartSector, fatSize, out buffer, out _);
errno = imagePlugin.ReadSectors(_fatStartSector, false, fatSize, out buffer, out _);
if(errno != ErrorNumber.NoError) return errno;
@@ -154,9 +154,8 @@ public sealed partial class XboxFatPlugin
_fat32 = MemoryMarshal.Cast<byte, uint>(buffer).ToArray();
if(!_littleEndian)
{
for(var i = 0; i < _fat32.Length; i++) _fat32[i] = Swapping.Swap(_fat32[i]);
}
for(var i = 0; i < _fat32.Length; i++)
_fat32[i] = Swapping.Swap(_fat32[i]);
AaruLogging.Debug(MODULE_NAME, "fat32[0] == FATX32_ID = {0}", _fat32[0] == FATX32_ID);
@@ -178,7 +177,7 @@ public sealed partial class XboxFatPlugin
AaruLogging.Debug(MODULE_NAME, Localization.FAT_is_0_sectors, fatSize);
errno = imagePlugin.ReadSectors(_fatStartSector, fatSize, out buffer, out _);
errno = imagePlugin.ReadSectors(_fatStartSector, false, fatSize, out buffer, out _);
if(errno != ErrorNumber.NoError) return errno;
@@ -186,9 +185,8 @@ public sealed partial class XboxFatPlugin
_fat16 = MemoryMarshal.Cast<byte, ushort>(buffer).ToArray();
if(!_littleEndian)
{
for(var i = 0; i < _fat16.Length; i++) _fat16[i] = Swapping.Swap(_fat16[i]);
}
for(var i = 0; i < _fat16.Length; i++)
_fat16[i] = Swapping.Swap(_fat16[i]);
AaruLogging.Debug(MODULE_NAME, "fat16[0] == FATX16_ID = {0}", _fat16[0] == FATX16_ID);
@@ -215,6 +213,7 @@ public sealed partial class XboxFatPlugin
for(var i = 0; i < rootDirectoryClusters.Length; i++)
{
errno = imagePlugin.ReadSectors(_firstClusterSector + (rootDirectoryClusters[i] - 1) * _sectorsPerCluster,
false,
_sectorsPerCluster,
out buffer,
out _);

View File

@@ -72,7 +72,11 @@ public sealed partial class FFSPlugin
foreach(ulong loc in locations.Where(loc => partition.End > partition.Start + loc + sbSizeInSectors))
{
ErrorNumber errno =
imagePlugin.ReadSectors(partition.Start + loc, sbSizeInSectors, out byte[] ufsSbSectors, out _);
imagePlugin.ReadSectors(partition.Start + loc,
false,
sbSizeInSectors,
out byte[] ufsSbSectors,
out _);
if(errno != ErrorNumber.NoError) continue;
@@ -135,7 +139,11 @@ public sealed partial class FFSPlugin
foreach(ulong loc in locations.Where(loc => partition.End > partition.Start + loc + sb_size_in_sectors))
{
errno = imagePlugin.ReadSectors(partition.Start + loc, sb_size_in_sectors, out ufs_sb_sectors, out _);
errno = imagePlugin.ReadSectors(partition.Start + loc,
false,
sb_size_in_sectors,
out ufs_sb_sectors,
out _);
if(errno != ErrorNumber.NoError) continue;
@@ -214,7 +222,7 @@ public sealed partial class FFSPlugin
}
// Fun with seeking follows on superblock reading!
errno = imagePlugin.ReadSectors(sb_offset, sb_size_in_sectors, out ufs_sb_sectors, out _);
errno = imagePlugin.ReadSectors(sb_offset, false, sb_size_in_sectors, out ufs_sb_sectors, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -49,7 +49,7 @@ public sealed partial class Fossil
if(partition.Start + hdrSector > imagePlugin.Info.Sectors) return false;
ErrorNumber errno = imagePlugin.ReadSector(partition.Start + hdrSector, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(partition.Start + hdrSector, false, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -73,7 +73,7 @@ public sealed partial class Fossil
ulong hdrSector = HEADER_POS / imagePlugin.Info.SectorSize;
ErrorNumber errno = imagePlugin.ReadSector(partition.Start + hdrSector, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(partition.Start + hdrSector, false, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return;
@@ -102,7 +102,7 @@ public sealed partial class Fossil
if(sbLocation <= partition.End)
{
imagePlugin.ReadSector(sbLocation, out sector, out _);
imagePlugin.ReadSector(sbLocation, false, out sector, out _);
SuperBlock fsb = Marshal.ByteArrayToStructureBigEndian<SuperBlock>(sector);
AaruLogging.Debug(MODULE_NAME, Localization.magic_0_expected_1, fsb.magic, FOSSIL_SB_MAGIC);

View File

@@ -53,7 +53,7 @@ public sealed partial class HAMMER
if(run + partition.Start >= partition.End) return false;
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, run, out byte[] sbSector, out _);
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, false, run, out byte[] sbSector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -76,7 +76,7 @@ public sealed partial class HAMMER
if(HAMMER_VOLHDR_SIZE % imagePlugin.Info.SectorSize > 0) run++;
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, run, out byte[] sbSector, out _);
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, false, run, out byte[] sbSector, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -55,6 +55,7 @@ public sealed partial class HPFS
ErrorNumber errno =
imagePlugin.ReadSector(16 + partition.Start,
false,
out byte[] hpfsSbSector,
out _); // Seek to superblock, on logical sector 16
@@ -78,18 +79,21 @@ public sealed partial class HPFS
ErrorNumber errno =
imagePlugin.ReadSector(0 + partition.Start,
false,
out byte[] hpfsBpbSector,
out _); // Seek to BIOS parameter block, on logical sector 0
if(errno != ErrorNumber.NoError) return;
errno = imagePlugin.ReadSector(16 + partition.Start,
false,
out byte[] hpfsSbSector,
out _); // Seek to superblock, on logical sector 16
if(errno != ErrorNumber.NoError) return;
errno = imagePlugin.ReadSector(17 + partition.Start,
false,
out byte[] hpfsSpSector,
out _); // Seek to spareblock, on logical sector 17

View File

@@ -53,6 +53,7 @@ public sealed partial class HPOFS
ErrorNumber errno =
imagePlugin.ReadSector(0 + partition.Start,
false,
out byte[] hpofsBpbSector,
out _); // Seek to BIOS parameter block, on logical sector 0
@@ -77,18 +78,21 @@ public sealed partial class HPOFS
ErrorNumber errno =
imagePlugin.ReadSector(0 + partition.Start,
false,
out byte[] hpofsBpbSector,
out _); // Seek to BIOS parameter block, on logical sector 0
if(errno != ErrorNumber.NoError) return;
errno = imagePlugin.ReadSector(13 + partition.Start,
false,
out byte[] medInfoSector,
out _); // Seek to media information block, on logical sector 13
if(errno != ErrorNumber.NoError) return;
errno = imagePlugin.ReadSector(14 + partition.Start,
false,
out byte[] volInfoSector,
out _); // Seek to volume information block, on logical sector 14

View File

@@ -201,6 +201,7 @@ public sealed partial class ISO9660
while(leftExtentSize > 0)
{
ErrorNumber errno = _image.ReadSectorTag((extents[i].extent + currentExtentSector) * _blockSize / 2048,
false,
SectorTagType.CdSectorSubHeader,
out byte[] fullSector);
@@ -324,6 +325,7 @@ public sealed partial class ISO9660
if((read + offsetInSector) % 2352 > 0) sizeInSectors++;
ErrorNumber errno = _image.ReadSectorsLong((ulong)(mynode.Dentry.Extents[0].extent + firstSector),
false,
(uint)sizeInSectors,
out byte[] buf,
out _);

View File

@@ -55,7 +55,7 @@ public sealed partial class ISO9660
if(partition.End <= 16 + partition.Start) return false;
// Read to Volume Descriptor
ErrorNumber errno = imagePlugin.ReadSector(16 + partition.Start, out byte[] vdSector, out _);
ErrorNumber errno = imagePlugin.ReadSector(16 + partition.Start, false, out byte[] vdSector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -109,7 +109,7 @@ public sealed partial class ISO9660
ulong counter = 0;
ErrorNumber errno = imagePlugin.ReadSector(16 + partition.Start, out byte[] vdSector, out _);
ErrorNumber errno = imagePlugin.ReadSector(16 + partition.Start, false, out byte[] vdSector, out _);
if(errno != ErrorNumber.NoError) return;
@@ -130,7 +130,7 @@ public sealed partial class ISO9660
// Seek to Volume Descriptor
AaruLogging.Debug(MODULE_NAME, Localization.Reading_sector_0, 16 + counter + partition.Start);
errno = imagePlugin.ReadSector(16 + counter + partition.Start, out byte[] vdSectorTmp, out _);
errno = imagePlugin.ReadSector(16 + counter + partition.Start, false, out byte[] vdSectorTmp, out _);
if(errno != ErrorNumber.NoError) return;
@@ -290,7 +290,7 @@ public sealed partial class ISO9660
if(rootLocation + rootSize < imagePlugin.Info.Sectors)
{
errno = imagePlugin.ReadSectors(rootLocation, rootSize, out rootDir, out _);
errno = imagePlugin.ReadSectors(rootLocation, false, rootSize, out rootDir, out _);
if(errno != ErrorNumber.NoError) return;
}
@@ -454,7 +454,7 @@ public sealed partial class ISO9660
0)
caLen++;
errno = imagePlugin.ReadSectors(ca.block_be, caLen, out byte[] caSectors, out _);
errno = imagePlugin.ReadSectors(ca.block_be, false, caLen, out byte[] caSectors, out _);
if(errno != ErrorNumber.NoError) return;
@@ -531,7 +531,7 @@ public sealed partial class ISO9660
}
}
errno = imagePlugin.ReadSector(0 + partition.Start, out byte[] ipbinSector, out _);
errno = imagePlugin.ReadSector(0 + partition.Start, false, out byte[] ipbinSector, out _);
if(errno != ErrorNumber.NoError) return;
@@ -680,7 +680,7 @@ public sealed partial class ISO9660
if(torito != null)
{
errno = imagePlugin.ReadSector(torito.Value.catalog_sector + partition.Start, out vdSector, out _);
errno = imagePlugin.ReadSector(torito.Value.catalog_sector + partition.Start, false, out vdSector, out _);
if(errno != ErrorNumber.NoError) return;
@@ -713,6 +713,7 @@ public sealed partial class ISO9660
if(initialEntry.load_rba + partition.Start + initialEntry.sector_count - 1 <= partition.End)
{
imagePlugin.ReadSectors(initialEntry.load_rba + partition.Start,
false,
initialEntry.sector_count,
out bootImage,
out _);
@@ -827,6 +828,7 @@ public sealed partial class ISO9660
if(sectionEntry.load_rba + partition.Start + sectionEntry.sector_count - 1 <= partition.End)
{
imagePlugin.ReadSectors(sectionEntry.load_rba + partition.Start,
false,
sectionEntry.sector_count,
out bootImage,
out _);

View File

@@ -58,9 +58,9 @@ public sealed partial class ISO9660
if(sectorCount == 1)
{
errno = _image.ReadSectorLong(realSector, out data, out _);
errno = _image.ReadSectorLong(realSector, false, out data, out _);
if(errno != ErrorNumber.NoError) errno = _image.ReadSector(realSector, out data, out _);
if(errno != ErrorNumber.NoError) errno = _image.ReadSector(realSector, false, out data, out _);
if(errno != ErrorNumber.NoError) return errno;
@@ -155,9 +155,9 @@ public sealed partial class ISO9660
{
ulong dstSector = realSector + 1;
errno = _image.ReadSectorLong(dstSector, out data, out _);
errno = _image.ReadSectorLong(dstSector, false, out data, out _);
if(errno != ErrorNumber.NoError) errno = _image.ReadSector(dstSector, out data, out _);
if(errno != ErrorNumber.NoError) errno = _image.ReadSector(dstSector, false, out data, out _);
if(errno != ErrorNumber.NoError) return errno;

View File

@@ -113,7 +113,7 @@ public sealed partial class ISO9660
ulong counter = 0;
ErrorNumber errno = imagePlugin.ReadSector(16 + partition.Start, out byte[] vdSector, out _);
ErrorNumber errno = imagePlugin.ReadSector(16 + partition.Start, false, out byte[] vdSector, out _);
if(errno != ErrorNumber.NoError) return errno;
@@ -137,7 +137,7 @@ public sealed partial class ISO9660
// Seek to Volume Descriptor
AaruLogging.Debug(MODULE_NAME, Localization.Reading_sector_0, 16 + counter + partition.Start);
errno = imagePlugin.ReadSector(16 + counter + partition.Start, out byte[] vdSectorTmp, out _);
errno = imagePlugin.ReadSector(16 + counter + partition.Start, false, out byte[] vdSectorTmp, out _);
if(errno != ErrorNumber.NoError) return errno;

View File

@@ -75,6 +75,7 @@ public sealed partial class ISO9660
return ErrorNumber.NoError;
ErrorNumber errno = _image.ReadSectorTag(entry.Extents[0].extent * _blockSize / 2048,
false,
SectorTagType.CdSectorSubHeader,
out _);

View File

@@ -50,7 +50,7 @@ public sealed partial class JFS
if(partition.Start + bootSectors >= partition.End) return false;
ErrorNumber errno = imagePlugin.ReadSector(partition.Start + bootSectors, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(partition.Start + bootSectors, false, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -65,12 +65,12 @@ public sealed partial class JFS
public void GetInformation(IMediaImage imagePlugin, Partition partition, Encoding encoding, out string information,
out FileSystem metadata)
{
encoding ??= Encoding.GetEncoding("iso-8859-15");
information = "";
metadata = new FileSystem();
var sb = new StringBuilder();
encoding ??= Encoding.GetEncoding("iso-8859-15");
information = "";
metadata = new FileSystem();
var sb = new StringBuilder();
uint bootSectors = JFS_BOOT_BLOCKS_SIZE / imagePlugin.Info.SectorSize;
ErrorNumber errno = imagePlugin.ReadSector(partition.Start + bootSectors, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(partition.Start + bootSectors, false, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -48,7 +48,7 @@ public sealed partial class LIF
{
if(imagePlugin.Info.SectorSize < 256) return false;
ErrorNumber errno = imagePlugin.ReadSector(partition.Start, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(partition.Start, false, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -68,7 +68,7 @@ public sealed partial class LIF
if(imagePlugin.Info.SectorSize < 256) return;
ErrorNumber errno = imagePlugin.ReadSector(partition.Start, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(partition.Start, false, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -127,7 +127,7 @@ public sealed partial class LisaFS
// If root catalog is not pointed in MDDF (unchecked) maybe it's always following S-Records File?
for(ulong i = 0; i < _device.Info.Sectors; i++)
{
errno = _device.ReadSectorTag(i, SectorTagType.AppleSonyTag, out byte[] tag);
errno = _device.ReadSectorTag(i, false, SectorTagType.AppleSonyTag, out byte[] tag);
if(errno != ErrorNumber.NoError) continue;
@@ -135,7 +135,7 @@ public sealed partial class LisaFS
if(catTag.FileId != FILEID_CATALOG || catTag.RelPage != 0) continue;
errno = _device.ReadSectors(i, 4, out firstCatalogBlock, out _);
errno = _device.ReadSectors(i, false, 4, out firstCatalogBlock, out _);
if(errno != ErrorNumber.NoError) return errno;
@@ -151,6 +151,7 @@ public sealed partial class LisaFS
while(prevCatalogPointer != 0xFFFFFFFF)
{
errno = _device.ReadSectorTag(prevCatalogPointer + _mddf.mddf_block + _volumePrefix,
false,
SectorTagType.AppleSonyTag,
out byte[] tag);
@@ -161,6 +162,7 @@ public sealed partial class LisaFS
if(prevTag.FileId != FILEID_CATALOG) return ErrorNumber.InvalidArgument;
errno = _device.ReadSectors(prevCatalogPointer + _mddf.mddf_block + _volumePrefix,
false,
4,
out firstCatalogBlock,
out _);
@@ -178,6 +180,7 @@ public sealed partial class LisaFS
while(nextCatalogPointer != 0xFFFFFFFF)
{
errno = _device.ReadSectorTag(nextCatalogPointer + _mddf.mddf_block + _volumePrefix,
false,
SectorTagType.AppleSonyTag,
out byte[] tag);
@@ -188,6 +191,7 @@ public sealed partial class LisaFS
if(nextTag.FileId != FILEID_CATALOG) return ErrorNumber.InvalidArgument;
errno = _device.ReadSectors(nextCatalogPointer + _mddf.mddf_block + _volumePrefix,
false,
4,
out byte[] nextCatalogBlock,
out _);

View File

@@ -75,7 +75,7 @@ public sealed partial class LisaFS
for(ulong i = 0; i < _device.Info.Sectors; i++)
{
errno = _device.ReadSectorTag(i, SectorTagType.AppleSonyTag, out tag);
errno = _device.ReadSectorTag(i, false, SectorTagType.AppleSonyTag, out tag);
if(errno != ErrorNumber.NoError) continue;
@@ -93,7 +93,7 @@ public sealed partial class LisaFS
}
// Checks that the sector tag indicates its the Extents File we are searching for
errno = _device.ReadSectorTag(ptr, SectorTagType.AppleSonyTag, out tag);
errno = _device.ReadSectorTag(ptr, false, SectorTagType.AppleSonyTag, out tag);
if(errno != ErrorNumber.NoError) return errno;
@@ -102,8 +102,8 @@ public sealed partial class LisaFS
if(extTag.FileId != (short)(-1 * fileId)) return ErrorNumber.NoSuchFile;
errno = _mddf.fsversion == LISA_V1
? _device.ReadSectors(ptr, 2, out byte[] sector, out _)
: _device.ReadSector(ptr, out sector, out _);
? _device.ReadSectors(ptr, false, 2, out byte[] sector, out _)
: _device.ReadSector(ptr, false, out sector, out _);
if(errno != ErrorNumber.NoError) return errno;
@@ -307,6 +307,7 @@ public sealed partial class LisaFS
// Searches the S-Records place using MDDF pointers
ErrorNumber errno = _device.ReadSectors(_mddf.srec_ptr + _mddf.mddf_block + _volumePrefix,
false,
_mddf.srec_len,
out byte[] sectors,
out _);

View File

@@ -105,8 +105,9 @@ public sealed partial class LisaFS
if(!_mounted || !_debug) return ErrorNumber.AccessDenied;
if(fileId is > 4 or <= 0)
if(fileId != FILEID_BOOT_SIGNED && fileId != FILEID_LOADER_SIGNED)
return ErrorNumber.InvalidArgument;
{
if(fileId != FILEID_BOOT_SIGNED && fileId != FILEID_LOADER_SIGNED) return ErrorNumber.InvalidArgument;
}
if(_systemFileCache.TryGetValue(fileId, out buf) && !tags) return ErrorNumber.NoError;
@@ -117,6 +118,7 @@ public sealed partial class LisaFS
if(!tags)
{
errno = _device.ReadSectors(_mddf.mddf_block + _volumePrefix + _mddf.srec_ptr,
false,
_mddf.srec_len,
out buf,
out _);
@@ -129,6 +131,7 @@ public sealed partial class LisaFS
}
errno = _device.ReadSectorsTag(_mddf.mddf_block + _volumePrefix + _mddf.srec_ptr,
false,
_mddf.srec_len,
SectorTagType.AppleSonyTag,
out buf);
@@ -141,7 +144,7 @@ public sealed partial class LisaFS
// Should be enough to check 100 sectors?
for(ulong i = 0; i < 100; i++)
{
errno = _device.ReadSectorTag(i, SectorTagType.AppleSonyTag, out byte[] tag);
errno = _device.ReadSectorTag(i, false, SectorTagType.AppleSonyTag, out byte[] tag);
if(errno != ErrorNumber.NoError) continue;
@@ -157,7 +160,7 @@ public sealed partial class LisaFS
// Should be enough to check 100 sectors?
for(ulong i = 0; i < 100; i++)
{
errno = _device.ReadSectorTag(i, SectorTagType.AppleSonyTag, out byte[] tag);
errno = _device.ReadSectorTag(i, false, SectorTagType.AppleSonyTag, out byte[] tag);
if(errno != ErrorNumber.NoError) continue;
@@ -166,8 +169,8 @@ public sealed partial class LisaFS
if(sysTag.FileId != fileId) continue;
errno = !tags
? _device.ReadSector(i, out byte[] sector, out _)
: _device.ReadSectorTag(i, SectorTagType.AppleSonyTag, out sector);
? _device.ReadSector(i, false, out byte[] sector, out _)
: _device.ReadSectorTag(i, false, SectorTagType.AppleSonyTag, out sector);
if(errno != ErrorNumber.NoError) continue;
@@ -306,12 +309,14 @@ public sealed partial class LisaFS
? _device.ReadSectors((ulong)file.extents[i].start +
_mddf.mddf_block +
_volumePrefix,
false,
(uint)file.extents[i].length,
out byte[] sector,
out _)
: _device.ReadSectorsTag((ulong)file.extents[i].start +
_mddf.mddf_block +
_volumePrefix,
false,
(uint)file.extents[i].length,
SectorTagType.AppleSonyTag,
out sector);
@@ -325,8 +330,9 @@ public sealed partial class LisaFS
if(!tags)
{
if(_fileSizeCache.TryGetValue(fileId, out int realSize))
if(realSize > temp.Length)
AaruLogging.Error(Localization.File_0_gets_truncated, fileId);
{
if(realSize > temp.Length) AaruLogging.Error(Localization.File_0_gets_truncated, fileId);
}
buf = temp;

View File

@@ -57,7 +57,7 @@ public sealed partial class LisaFS
// LisaOS searches sectors until tag tells MDDF resides there, so we'll search 100 sectors
for(var i = 0; i < 100; i++)
{
ErrorNumber errno = imagePlugin.ReadSectorTag((ulong)i, SectorTagType.AppleSonyTag, out byte[] tag);
ErrorNumber errno = imagePlugin.ReadSectorTag((ulong)i, false, SectorTagType.AppleSonyTag, out byte[] tag);
if(errno != ErrorNumber.NoError) continue;
@@ -69,7 +69,7 @@ public sealed partial class LisaFS
if(searchTag.FileId != FILEID_MDDF) continue;
errno = imagePlugin.ReadSector((ulong)i, out byte[] sector, out _);
errno = imagePlugin.ReadSector((ulong)i, false, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) continue;
@@ -134,7 +134,7 @@ public sealed partial class LisaFS
// LisaOS searches sectors until tag tells MDDF resides there, so we'll search 100 sectors
for(var i = 0; i < 100; i++)
{
ErrorNumber errno = imagePlugin.ReadSectorTag((ulong)i, SectorTagType.AppleSonyTag, out byte[] tag);
ErrorNumber errno = imagePlugin.ReadSectorTag((ulong)i, false, SectorTagType.AppleSonyTag, out byte[] tag);
if(errno != ErrorNumber.NoError) continue;
@@ -146,7 +146,7 @@ public sealed partial class LisaFS
if(searchTag.FileId != FILEID_MDDF) continue;
errno = imagePlugin.ReadSector((ulong)i, out byte[] sector, out _);
errno = imagePlugin.ReadSector((ulong)i, false, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) continue;

View File

@@ -78,7 +78,7 @@ public sealed partial class LisaFS
// LisaOS searches sectors until tag tells MDDF resides there, so we'll search 100 sectors
for(ulong i = 0; i < 100; i++)
{
ErrorNumber errno = _device.ReadSectorTag(i, SectorTagType.AppleSonyTag, out byte[] tag);
ErrorNumber errno = _device.ReadSectorTag(i, false, SectorTagType.AppleSonyTag, out byte[] tag);
if(errno != ErrorNumber.NoError) continue;
@@ -92,7 +92,7 @@ public sealed partial class LisaFS
if(searchTag.FileId != FILEID_MDDF) continue;
_devTagSize = tag.Length;
errno = _device.ReadSector(i, out byte[] sector, out _);
errno = _device.ReadSector(i, false, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return errno;

View File

@@ -72,7 +72,8 @@ public sealed partial class Locus
if(partition.Start + location + sbSize >= imagePlugin.Info.Sectors) break;
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start + location, sbSize, out byte[] sector, out _);
ErrorNumber errno =
imagePlugin.ReadSectors(partition.Start + location, false, sbSize, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -107,7 +108,7 @@ public sealed partial class Locus
if(Marshal.SizeOf<Superblock>() % imagePlugin.Info.SectorSize != 0) sbSize++;
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start + location, sbSize, out sector, out _);
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start + location, false, sbSize, out sector, out _);
if(errno != ErrorNumber.NoError) continue;

View File

@@ -54,7 +54,7 @@ public sealed partial class MicroDOS
if(imagePlugin.Info.SectorSize < 512) return false;
ErrorNumber errno = imagePlugin.ReadSector(0 + partition.Start, out byte[] bk0, out _);
ErrorNumber errno = imagePlugin.ReadSector(0 + partition.Start, false, out byte[] bk0, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -72,7 +72,7 @@ public sealed partial class MicroDOS
var sb = new StringBuilder();
ErrorNumber errno = imagePlugin.ReadSector(0 + partition.Start, out byte[] bk0, out _);
ErrorNumber errno = imagePlugin.ReadSector(0 + partition.Start, false, out byte[] bk0, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -57,7 +57,7 @@ public sealed partial class MinixFS
if(sector + partition.Start >= partition.End) return false;
ErrorNumber errno = imagePlugin.ReadSector(sector + partition.Start, out byte[] minixSbSector, out _);
ErrorNumber errno = imagePlugin.ReadSector(sector + partition.Start, false, out byte[] minixSbSector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -107,7 +107,7 @@ public sealed partial class MinixFS
var minix3 = false;
int filenamesize;
string minixVersion;
ErrorNumber errno = imagePlugin.ReadSector(sector + partition.Start, out byte[] minixSbSector, out _);
ErrorNumber errno = imagePlugin.ReadSector(sector + partition.Start, false, out byte[] minixSbSector, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -58,7 +58,7 @@ public sealed partial class NILFS2
if(partition.Start + sbAddr + sbSize >= partition.End) return false;
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start + sbAddr, sbSize, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start + sbAddr, false, sbSize, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -87,7 +87,7 @@ public sealed partial class NILFS2
if(Marshal.SizeOf<Superblock>() % imagePlugin.Info.SectorSize != 0) sbSize++;
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start + sbAddr, sbSize, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start + sbAddr, false, sbSize, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -51,7 +51,7 @@ public sealed partial class NTFS
var eigthBytes = new byte[8];
ErrorNumber errno = imagePlugin.ReadSector(0 + partition.Start, out byte[] ntfsBpb, out _);
ErrorNumber errno = imagePlugin.ReadSector(0 + partition.Start, false, out byte[] ntfsBpb, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -80,7 +80,7 @@ public sealed partial class NTFS
var sb = new StringBuilder();
ErrorNumber errno = imagePlugin.ReadSector(0 + partition.Start, out byte[] ntfsBpb, out _);
ErrorNumber errno = imagePlugin.ReadSector(0 + partition.Start, false, out byte[] ntfsBpb, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -50,7 +50,8 @@ public sealed partial class NintendoPlugin
if(imagePlugin.Info.Sectors * imagePlugin.Info.SectorSize < 0x50000) return false;
ErrorNumber errno = imagePlugin.ReadSectors(0, 0x50000 / imagePlugin.Info.SectorSize, out byte[] header, out _);
ErrorNumber errno =
imagePlugin.ReadSectors(0, false, 0x50000 / imagePlugin.Info.SectorSize, out byte[] header, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -71,7 +72,8 @@ public sealed partial class NintendoPlugin
var fields = new NintendoFields();
ErrorNumber errno = imagePlugin.ReadSectors(0, 0x50000 / imagePlugin.Info.SectorSize, out byte[] header, out _);
ErrorNumber errno =
imagePlugin.ReadSectors(0, false, 0x50000 / imagePlugin.Info.SectorSize, out byte[] header, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -64,7 +64,7 @@ public sealed partial class ODS
if(imagePlugin.Info.SectorSize < 512) return false;
var magicB = new byte[12];
ErrorNumber errno = imagePlugin.ReadSector(1 + partition.Start, out byte[] hbSector, out _);
ErrorNumber errno = imagePlugin.ReadSector(1 + partition.Start, false, out byte[] hbSector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -80,7 +80,7 @@ public sealed partial class ODS
if(hbSector.Length < 0x400) return false;
errno = imagePlugin.ReadSector(partition.Start, out hbSector, out _);
errno = imagePlugin.ReadSector(partition.Start, false, out hbSector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -102,7 +102,7 @@ public sealed partial class ODS
var sb = new StringBuilder();
ErrorNumber errno = imagePlugin.ReadSector(1 + partition.Start, out byte[] hbSector, out _);
ErrorNumber errno = imagePlugin.ReadSector(1 + partition.Start, false, out byte[] hbSector, out _);
if(errno != ErrorNumber.NoError) return;
@@ -115,7 +115,7 @@ public sealed partial class ODS
{
if(hbSector.Length < 0x400) return;
errno = imagePlugin.ReadSector(partition.Start, out byte[] tmp, out _);
errno = imagePlugin.ReadSector(partition.Start, false, out byte[] tmp, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -49,6 +49,7 @@ public sealed partial class OperaFS
do
{
ErrorNumber errno = _image.ReadSectors((ulong)(nextBlock * _volumeBlockSizeRatio),
false,
_volumeBlockSizeRatio,
out byte[] data,
out _);

View File

@@ -163,6 +163,7 @@ public sealed partial class OperaFS
fileBlockSizeRatio = mynode.Dentry.Entry.block_size / _image.Info.SectorSize;
ErrorNumber errno = _image.ReadSectors((ulong)(mynode.Dentry.Pointers[0] + firstBlock * fileBlockSizeRatio),
false,
(uint)(sizeInBlocks * fileBlockSizeRatio),
out byte[] buf,
out _);

View File

@@ -45,7 +45,7 @@ public sealed partial class OperaFS
{
if(2 + partition.Start >= partition.End) return false;
ErrorNumber errno = imagePlugin.ReadSector(0 + partition.Start, out byte[] sbSector, out _);
ErrorNumber errno = imagePlugin.ReadSector(0 + partition.Start, false, out byte[] sbSector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -70,7 +70,7 @@ public sealed partial class OperaFS
metadata = new FileSystem();
var superBlockmetadata = new StringBuilder();
ErrorNumber errno = imagePlugin.ReadSector(0 + partition.Start, out byte[] sbSector, out _);
ErrorNumber errno = imagePlugin.ReadSector(0 + partition.Start, false, out byte[] sbSector, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -53,7 +53,7 @@ public sealed partial class OperaFS
if(options.TryGetValue("debug", out string debugString)) bool.TryParse(debugString, out _debug);
ErrorNumber errno = imagePlugin.ReadSector(0 + partition.Start, out byte[] sbSector, out _);
ErrorNumber errno = imagePlugin.ReadSector(0 + partition.Start, false, out byte[] sbSector, out _);
if(errno != ErrorNumber.NoError) return errno;

View File

@@ -51,7 +51,7 @@ public sealed partial class PCEnginePlugin
if(2 + partition.Start >= partition.End) return false;
var systemDescriptor = new byte[23];
ErrorNumber errno = imagePlugin.ReadSector(1 + partition.Start, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(1 + partition.Start, false, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return false;

View File

@@ -54,7 +54,7 @@ public sealed partial class PCFX
if(2 + partition.Start >= partition.End || imagePlugin.Info.MetadataMediaType != MetadataMediaType.OpticalDisc)
return false;
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, 2, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, false, 2, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -72,7 +72,7 @@ public sealed partial class PCFX
information = "";
metadata = new FileSystem();
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, 2, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, false, 2, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -48,7 +48,7 @@ public sealed partial class PFS
{
if(partition.Length < 3) return false;
ErrorNumber errno = imagePlugin.ReadSector(2 + partition.Start, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(2 + partition.Start, false, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -64,7 +64,7 @@ public sealed partial class PFS
information = "";
encoding ??= Encoding.GetEncoding("iso-8859-1");
metadata = new FileSystem();
ErrorNumber errno = imagePlugin.ReadSector(2 + partition.Start, out byte[] rootBlockSector, out _);
ErrorNumber errno = imagePlugin.ReadSector(2 + partition.Start, false, out byte[] rootBlockSector, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -60,6 +60,7 @@ public sealed partial class ProDOSPlugin
// Blocks 0 and 1 are boot code
ErrorNumber errno = imagePlugin.ReadSectors(2 * multiplier + partition.Start,
false,
multiplier,
out byte[] rootDirectoryKeyBlock,
out _);
@@ -70,7 +71,7 @@ public sealed partial class ProDOSPlugin
if(imagePlugin.Info.SectorSize is 2352 or 2448 or 2048)
{
errno = imagePlugin.ReadSectors(partition.Start, 2, out byte[] tmp, out _);
errno = imagePlugin.ReadSectors(partition.Start, false, 2, out byte[] tmp, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -141,6 +142,7 @@ public sealed partial class ProDOSPlugin
// Blocks 0 and 1 are boot code
ErrorNumber errno = imagePlugin.ReadSectors(2 * multiplier + partition.Start,
false,
multiplier,
out byte[] rootDirectoryKeyBlockBytes,
out _);
@@ -151,7 +153,7 @@ public sealed partial class ProDOSPlugin
if(imagePlugin.Info.SectorSize is 2352 or 2448 or 2048)
{
errno = imagePlugin.ReadSectors(partition.Start, 2, out byte[] tmp, out _);
errno = imagePlugin.ReadSectors(partition.Start, false, 2, out byte[] tmp, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -49,7 +49,7 @@ public sealed partial class QNX4
{
if(partition.Start + 1 >= imagePlugin.Info.Sectors) return false;
ErrorNumber errno = imagePlugin.ReadSector(partition.Start + 1, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(partition.Start + 1, false, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -88,7 +88,7 @@ public sealed partial class QNX4
{
information = "";
metadata = new FileSystem();
ErrorNumber errno = imagePlugin.ReadSector(partition.Start + 1, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(partition.Start + 1, false, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -49,11 +49,11 @@ public sealed partial class QNX6
if(partition.Start + bootSectors + sectors >= partition.End) return false;
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, sectors, out byte[] audiSector, out _);
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, false, sectors, out byte[] audiSector, out _);
if(errno != ErrorNumber.NoError) return false;
errno = imagePlugin.ReadSectors(partition.Start + bootSectors, sectors, out byte[] sector, out _);
errno = imagePlugin.ReadSectors(partition.Start + bootSectors, false, sectors, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -76,11 +76,11 @@ public sealed partial class QNX6
uint sectors = QNX6_SUPER_BLOCK_SIZE / imagePlugin.Info.SectorSize;
uint bootSectors = QNX6_BOOT_BLOCKS_SIZE / imagePlugin.Info.SectorSize;
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, sectors, out byte[] audiSector, out _);
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, false, sectors, out byte[] audiSector, out _);
if(errno != ErrorNumber.NoError) return;
errno = imagePlugin.ReadSectors(partition.Start + bootSectors, sectors, out byte[] sector, out _);
errno = imagePlugin.ReadSectors(partition.Start + bootSectors, false, sectors, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -63,7 +63,8 @@ public sealed partial class RBF
if(partition.Start + location + sbSize >= imagePlugin.Info.Sectors) break;
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start + location, sbSize, out byte[] sector, out _);
ErrorNumber errno =
imagePlugin.ReadSectors(partition.Start + location, false, sbSize, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -109,7 +110,8 @@ public sealed partial class RBF
if(Marshal.SizeOf<IdSector>() % imagePlugin.Info.SectorSize != 0) sbSize++;
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start + location, sbSize, out byte[] sector, out _);
ErrorNumber errno =
imagePlugin.ReadSectors(partition.Start + location, false, sbSize, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -55,7 +55,7 @@ public sealed partial class RT11
if(1 + partition.Start >= partition.End) return false;
var magicB = new byte[12];
ErrorNumber errno = imagePlugin.ReadSector(1 + partition.Start, out byte[] hbSector, out _);
ErrorNumber errno = imagePlugin.ReadSector(1 + partition.Start, false, out byte[] hbSector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -77,7 +77,7 @@ public sealed partial class RT11
var sb = new StringBuilder();
ErrorNumber errno = imagePlugin.ReadSector(1 + partition.Start, out byte[] hbSector, out _);
ErrorNumber errno = imagePlugin.ReadSector(1 + partition.Start, false, out byte[] hbSector, out _);
if(errno != ErrorNumber.NoError) return;
@@ -108,7 +108,7 @@ public sealed partial class RT11
sb.AppendFormat(Localization.Volume_label_0, encoding.GetString(homeblock.volname).TrimEnd()).AppendLine();
sb.AppendFormat(Localization.Checksum_0_calculated_1, homeblock.checksum, check).AppendLine();
imagePlugin.ReadSector(0, out byte[] bootBlock, out _);
imagePlugin.ReadSector(0, false, out byte[] bootBlock, out _);
metadata = new FileSystem
{

View File

@@ -53,7 +53,7 @@ public sealed partial class ReFS
if(partition.Start + sbSize >= partition.End) return false;
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, sbSize, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, false, sbSize, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -79,7 +79,7 @@ public sealed partial class ReFS
if(partition.Start + sbSize >= partition.End) return;
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, sbSize, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start, false, sbSize, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -57,7 +57,7 @@ public sealed partial class Reiser
if(partition.Start + sbAddr + sbSize >= partition.End) return false;
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start + sbAddr, sbSize, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start + sbAddr, false, sbSize, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -88,7 +88,7 @@ public sealed partial class Reiser
if(Marshal.SizeOf<Superblock>() % imagePlugin.Info.SectorSize != 0) sbSize++;
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start + sbAddr, sbSize, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start + sbAddr, false, sbSize, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -57,7 +57,7 @@ public sealed partial class Reiser4
if(partition.Start + sbAddr + sbSize >= partition.End) return false;
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start + sbAddr, sbSize, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start + sbAddr, false, sbSize, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -86,7 +86,7 @@ public sealed partial class Reiser4
if(Marshal.SizeOf<Superblock>() % imagePlugin.Info.SectorSize != 0) sbSize++;
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start + sbAddr, sbSize, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSectors(partition.Start + sbAddr, false, sbSize, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return;

View File

@@ -46,7 +46,7 @@ public sealed partial class SFS
{
if(partition.Start >= partition.End) return false;
ErrorNumber errno = imagePlugin.ReadSector(partition.Start, out byte[] sector, out _);
ErrorNumber errno = imagePlugin.ReadSector(partition.Start, false, out byte[] sector, out _);
if(errno != ErrorNumber.NoError) return false;
@@ -61,7 +61,7 @@ public sealed partial class SFS
{
information = "";
metadata = new FileSystem();
ErrorNumber errno = imagePlugin.ReadSector(partition.Start, out byte[] rootBlockSector, out _);
ErrorNumber errno = imagePlugin.ReadSector(partition.Start, false, out byte[] rootBlockSector, out _);
if(errno != ErrorNumber.NoError) return;

Some files were not shown because too many files have changed in this diff Show More