2018-08-29 13:09:04 +02:00
|
|
|
// /***************************************************************************
|
2020-02-27 12:31:25 +00:00
|
|
|
// Aaru Data Preservation Suite
|
2018-08-29 13:09:04 +02:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// Filename : Read.cs
|
|
|
|
|
// Author(s) : Michael Drüing <michael@drueing.de>
|
|
|
|
|
//
|
|
|
|
|
// Component : Disk image plugins.
|
|
|
|
|
//
|
|
|
|
|
// --[ Description ] ----------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// Reads d2f disk images.
|
|
|
|
|
//
|
|
|
|
|
// --[ License ] --------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// This library is free software; you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU Lesser General Public License as
|
|
|
|
|
// published by the Free Software Foundation; either version 2.1 of the
|
|
|
|
|
// License, or (at your option) any later version.
|
|
|
|
|
//
|
|
|
|
|
// This library is distributed in the hope that it will be useful, but
|
|
|
|
|
// WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
// Lesser General Public License for more details.
|
|
|
|
|
//
|
|
|
|
|
// You should have received a copy of the GNU Lesser General Public
|
|
|
|
|
// License along with this library; if not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
//
|
|
|
|
|
// ----------------------------------------------------------------------------
|
2022-12-03 16:07:10 +00:00
|
|
|
// Copyright © 2018-2023 Michael Drüing
|
|
|
|
|
// Copyright © 2011-2023 Natalia Portillo
|
2018-08-29 13:09:04 +02:00
|
|
|
// ****************************************************************************/
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using System.IO;
|
2018-12-31 13:17:27 +00:00
|
|
|
using System.Text;
|
2020-02-27 00:33:26 +00:00
|
|
|
using Aaru.Checksums;
|
|
|
|
|
using Aaru.CommonTypes;
|
|
|
|
|
using Aaru.CommonTypes.Enums;
|
|
|
|
|
using Aaru.CommonTypes.Interfaces;
|
|
|
|
|
using Aaru.Console;
|
|
|
|
|
using Aaru.Helpers;
|
2018-08-29 13:09:04 +02:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
namespace Aaru.DiscImages;
|
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
public sealed partial class WCDiskImage
|
2018-08-29 13:09:04 +02:00
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
/// <inheritdoc />
|
|
|
|
|
public ErrorNumber Open(IFilter imageFilter)
|
2018-08-29 13:09:04 +02:00
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
string comments = string.Empty;
|
|
|
|
|
Stream stream = imageFilter.GetDataForkStream();
|
|
|
|
|
stream.Seek(0, SeekOrigin.Begin);
|
2018-08-29 13:09:04 +02:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
byte[] header = new byte[32];
|
2022-11-14 09:43:16 +00:00
|
|
|
stream.EnsureRead(header, 0, 32);
|
2018-08-29 13:09:04 +02:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
FileHeader fheader = Marshal.ByteArrayToStructureLittleEndian<FileHeader>(header);
|
2020-01-04 18:18:20 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
AaruConsole.DebugWriteLine("d2f plugin",
|
2022-11-29 02:10:37 +00:00
|
|
|
Localization.Detected_WC_DISK_IMAGE_with_0_heads_1_tracks_and_2_sectors_per_track,
|
2022-03-06 13:29:38 +00:00
|
|
|
fheader.heads, fheader.cylinders, fheader.sectorsPerTrack);
|
2018-08-29 13:09:04 +02:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
_imageInfo.Cylinders = fheader.cylinders;
|
|
|
|
|
_imageInfo.SectorsPerTrack = fheader.sectorsPerTrack;
|
|
|
|
|
_imageInfo.SectorSize = 512; // only 512 bytes per sector supported
|
|
|
|
|
_imageInfo.Heads = fheader.heads;
|
|
|
|
|
_imageInfo.Sectors = _imageInfo.Heads * _imageInfo.Cylinders * _imageInfo.SectorsPerTrack;
|
|
|
|
|
_imageInfo.ImageSize = _imageInfo.Sectors * _imageInfo.SectorSize;
|
2018-08-29 13:09:04 +02:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
_imageInfo.XmlMediaType = XmlMediaType.BlockMedia;
|
2018-08-29 13:09:04 +02:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
_imageInfo.CreationTime = imageFilter.CreationTime;
|
|
|
|
|
_imageInfo.LastModificationTime = imageFilter.LastWriteTime;
|
|
|
|
|
_imageInfo.MediaTitle = Path.GetFileNameWithoutExtension(imageFilter.Filename);
|
2020-01-04 18:18:20 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
_imageInfo.MediaType = Geometry.GetMediaType(((ushort)_imageInfo.Cylinders, (byte)_imageInfo.Heads,
|
|
|
|
|
(ushort)_imageInfo.SectorsPerTrack, 512, MediaEncoding.MFM,
|
|
|
|
|
false));
|
2018-08-29 13:09:04 +02:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
/* buffer the entire disk in memory */
|
2022-11-15 15:58:43 +00:00
|
|
|
for(int cyl = 0; cyl < _imageInfo.Cylinders; cyl++)
|
2022-03-06 13:29:38 +00:00
|
|
|
{
|
2022-11-15 15:58:43 +00:00
|
|
|
for(int head = 0; head < _imageInfo.Heads; head++)
|
2018-08-29 13:09:04 +02:00
|
|
|
{
|
2022-03-07 07:36:44 +00:00
|
|
|
ErrorNumber errno = ReadTrack(stream, cyl, head);
|
2018-08-29 13:09:04 +02:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(errno != ErrorNumber.NoError)
|
|
|
|
|
return errno;
|
2018-08-29 13:09:04 +02:00
|
|
|
}
|
2022-03-06 13:29:38 +00:00
|
|
|
}
|
2018-12-31 13:17:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
/* if there are extra tracks, read them as well */
|
|
|
|
|
if(fheader.extraTracks[0] == 1)
|
|
|
|
|
{
|
2022-11-29 02:10:37 +00:00
|
|
|
AaruConsole.DebugWriteLine("d2f plugin", Localization.Extra_track_1_head_0_present_reading);
|
2022-03-06 13:29:38 +00:00
|
|
|
ReadTrack(stream, (int)_imageInfo.Cylinders, 0);
|
|
|
|
|
}
|
2018-12-31 13:17:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(fheader.extraTracks[1] == 1)
|
|
|
|
|
{
|
2022-11-29 02:10:37 +00:00
|
|
|
AaruConsole.DebugWriteLine("d2f plugin", Localization.Extra_track_1_head_1_present_reading);
|
2022-03-06 13:29:38 +00:00
|
|
|
ReadTrack(stream, (int)_imageInfo.Cylinders, 1);
|
|
|
|
|
}
|
2018-12-31 13:17:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(fheader.extraTracks[2] == 1)
|
|
|
|
|
{
|
2022-11-29 02:10:37 +00:00
|
|
|
AaruConsole.DebugWriteLine("d2f plugin", Localization.Extra_track_2_head_0_present_reading);
|
2022-03-06 13:29:38 +00:00
|
|
|
ReadTrack(stream, (int)_imageInfo.Cylinders + 1, 0);
|
|
|
|
|
}
|
2018-08-29 13:09:04 +02:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(fheader.extraTracks[3] == 1)
|
|
|
|
|
{
|
2022-11-29 02:10:37 +00:00
|
|
|
AaruConsole.DebugWriteLine("d2f plugin", Localization.Extra_track_2_head_1_present_reading);
|
2022-03-06 13:29:38 +00:00
|
|
|
ReadTrack(stream, (int)_imageInfo.Cylinders + 1, 1);
|
|
|
|
|
}
|
2020-01-04 18:18:20 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
/* adjust number of cylinders */
|
|
|
|
|
if(fheader.extraTracks[0] == 1 ||
|
|
|
|
|
fheader.extraTracks[1] == 1)
|
|
|
|
|
_imageInfo.Cylinders++;
|
2018-08-29 13:09:04 +02:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(fheader.extraTracks[2] == 1 ||
|
|
|
|
|
fheader.extraTracks[3] == 1)
|
|
|
|
|
_imageInfo.Cylinders++;
|
2020-01-04 18:18:20 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
/* read the comment and directory data if present */
|
|
|
|
|
if(fheader.extraFlags.HasFlag(ExtraFlag.Comment))
|
|
|
|
|
{
|
2022-11-29 02:10:37 +00:00
|
|
|
AaruConsole.DebugWriteLine("d2f plugin", Localization.Comment_present_reading);
|
2022-11-15 15:58:43 +00:00
|
|
|
byte[] sheaderBuffer = new byte[6];
|
2022-11-14 09:43:16 +00:00
|
|
|
stream.EnsureRead(sheaderBuffer, 0, 6);
|
2018-08-29 13:09:04 +02:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
SectorHeader sheader = Marshal.ByteArrayToStructureLittleEndian<SectorHeader>(sheaderBuffer);
|
2021-09-21 04:55:28 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(sheader.flag != SectorFlag.Comment)
|
|
|
|
|
{
|
2022-11-29 02:10:37 +00:00
|
|
|
AaruConsole.ErrorWriteLine(string.Format(Localization.Invalid_sector_type_0_encountered,
|
|
|
|
|
sheader.flag.ToString()));
|
2018-08-29 13:09:04 +02:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
return ErrorNumber.InvalidArgument;
|
2018-08-29 13:09:04 +02:00
|
|
|
}
|
|
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
byte[] comm = new byte[sheader.crc];
|
2022-11-14 09:43:16 +00:00
|
|
|
stream.EnsureRead(comm, 0, sheader.crc);
|
2022-03-06 13:29:38 +00:00
|
|
|
comments += Encoding.ASCII.GetString(comm) + Environment.NewLine;
|
|
|
|
|
}
|
2020-01-04 18:18:20 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(fheader.extraFlags.HasFlag(ExtraFlag.Directory))
|
|
|
|
|
{
|
2022-11-29 02:10:37 +00:00
|
|
|
AaruConsole.DebugWriteLine("d2f plugin", Localization.Directory_listing_present_reading);
|
2022-11-15 15:58:43 +00:00
|
|
|
byte[] sheaderBuffer = new byte[6];
|
2022-11-14 09:43:16 +00:00
|
|
|
stream.EnsureRead(sheaderBuffer, 0, 6);
|
2018-08-29 13:09:04 +02:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
SectorHeader sheader = Marshal.ByteArrayToStructureLittleEndian<SectorHeader>(sheaderBuffer);
|
2021-09-21 04:55:28 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(sheader.flag != SectorFlag.Directory)
|
|
|
|
|
{
|
2022-11-29 02:10:37 +00:00
|
|
|
AaruConsole.ErrorWriteLine(string.Format(Localization.Invalid_sector_type_0_encountered,
|
|
|
|
|
sheader.flag.ToString()));
|
2018-08-29 13:09:04 +02:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
return ErrorNumber.InvalidArgument;
|
2018-08-29 13:09:04 +02:00
|
|
|
}
|
2018-12-31 13:17:27 +00:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
byte[] dir = new byte[sheader.crc];
|
2022-11-14 09:43:16 +00:00
|
|
|
stream.EnsureRead(dir, 0, sheader.crc);
|
2022-03-06 13:29:38 +00:00
|
|
|
comments += Encoding.ASCII.GetString(dir);
|
2018-08-29 13:09:04 +02:00
|
|
|
}
|
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(comments.Length > 0)
|
|
|
|
|
_imageInfo.Comments = comments;
|
2018-08-29 13:09:04 +02:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
// save some variables for later use
|
|
|
|
|
_fileHeader = fheader;
|
|
|
|
|
_wcImageFilter = imageFilter;
|
|
|
|
|
|
|
|
|
|
return ErrorNumber.InvalidArgument;
|
|
|
|
|
}
|
2018-08-29 13:09:04 +02:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
/// <inheritdoc />
|
|
|
|
|
public ErrorNumber ReadSector(ulong sectorAddress, out byte[] buffer)
|
|
|
|
|
{
|
|
|
|
|
int sectorNumber = (int)(sectorAddress % _imageInfo.SectorsPerTrack) + 1;
|
2022-11-15 15:58:43 +00:00
|
|
|
int trackNumber = (int)(sectorAddress / _imageInfo.SectorsPerTrack);
|
2022-03-06 13:29:38 +00:00
|
|
|
int headNumber = _imageInfo.Heads > 1 ? trackNumber % 2 : 0;
|
|
|
|
|
int cylinderNumber = _imageInfo.Heads > 1 ? trackNumber / 2 : trackNumber;
|
2021-09-19 21:16:47 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(_badSectors[(cylinderNumber, headNumber, sectorNumber)])
|
|
|
|
|
{
|
2022-11-29 02:10:37 +00:00
|
|
|
AaruConsole.DebugWriteLine("d2f plugin", Localization.reading_bad_sector_0_1_2_3, sectorAddress,
|
2022-03-06 13:29:38 +00:00
|
|
|
cylinderNumber, headNumber, sectorNumber);
|
2018-08-29 13:09:04 +02:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
/* if we have sector data, return that */
|
|
|
|
|
if(_sectorCache.ContainsKey((cylinderNumber, headNumber, sectorNumber)))
|
|
|
|
|
{
|
|
|
|
|
buffer = _sectorCache[(cylinderNumber, headNumber, sectorNumber)];
|
2021-09-19 21:16:47 +01:00
|
|
|
|
|
|
|
|
return ErrorNumber.NoError;
|
2018-08-29 13:09:04 +02:00
|
|
|
}
|
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
/* otherwise, return an empty sector */
|
|
|
|
|
buffer = new byte[512];
|
2021-09-19 21:16:47 +01:00
|
|
|
|
|
|
|
|
return ErrorNumber.NoError;
|
2018-08-29 13:09:04 +02:00
|
|
|
}
|
|
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
buffer = _sectorCache[(cylinderNumber, headNumber, sectorNumber)];
|
2021-09-19 21:16:47 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
return ErrorNumber.NoError;
|
|
|
|
|
}
|
2018-08-29 13:09:04 +02:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
/// <inheritdoc />
|
|
|
|
|
public ErrorNumber ReadSectors(ulong sectorAddress, uint length, out byte[] buffer)
|
|
|
|
|
{
|
|
|
|
|
buffer = null;
|
2021-09-19 21:16:47 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(sectorAddress > _imageInfo.Sectors - 1)
|
|
|
|
|
return ErrorNumber.OutOfRange;
|
2021-09-19 21:16:47 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(sectorAddress + length > _imageInfo.Sectors)
|
|
|
|
|
return ErrorNumber.OutOfRange;
|
2021-09-19 21:16:47 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
var ms = new MemoryStream();
|
2021-09-19 21:16:47 +01:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
for(uint i = 0; i < length; i++)
|
|
|
|
|
{
|
|
|
|
|
ErrorNumber errno = ReadSector(sectorAddress + i, out byte[] sector);
|
2018-08-29 13:09:04 +02:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
if(errno != ErrorNumber.NoError)
|
|
|
|
|
return errno;
|
2018-08-29 13:09:04 +02:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
ms.Write(sector, 0, sector.Length);
|
2018-08-29 13:09:04 +02:00
|
|
|
}
|
2018-12-31 13:17:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
buffer = ms.ToArray();
|
|
|
|
|
|
|
|
|
|
return ErrorNumber.NoError;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>Read a whole track and cache it</summary>
|
|
|
|
|
/// <param name="stream">The stream to read from</param>
|
|
|
|
|
/// <param name="cyl">The cylinder number of the track being read.</param>
|
|
|
|
|
/// <param name="head">The head number of the track being read.</param>
|
|
|
|
|
ErrorNumber ReadTrack(Stream stream, int cyl, int head)
|
|
|
|
|
{
|
2022-11-15 15:58:43 +00:00
|
|
|
for(int sect = 1; sect < _imageInfo.SectorsPerTrack + 1; sect++)
|
2018-12-31 13:17:27 +00:00
|
|
|
{
|
2022-03-06 13:29:38 +00:00
|
|
|
/* read the sector header */
|
2022-11-15 15:58:43 +00:00
|
|
|
byte[] sheaderBuffer = new byte[6];
|
2022-11-14 09:43:16 +00:00
|
|
|
stream.EnsureRead(sheaderBuffer, 0, 6);
|
2018-12-31 13:17:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
SectorHeader sheader = Marshal.ByteArrayToStructureLittleEndian<SectorHeader>(sheaderBuffer);
|
|
|
|
|
|
|
|
|
|
/* validate the sector header */
|
|
|
|
|
if(sheader.cylinder != cyl ||
|
|
|
|
|
sheader.head != head ||
|
|
|
|
|
sheader.sector != sect)
|
2018-12-31 13:17:27 +00:00
|
|
|
{
|
2022-11-29 02:10:37 +00:00
|
|
|
AaruConsole.
|
|
|
|
|
ErrorWriteLine(string.Format(Localization.Unexpected_sector_encountered_Found_CHS_0_1_2_but_expected_3_4_5,
|
|
|
|
|
sheader.cylinder, sheader.head, sheader.sector, cyl, head, sect));
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
return ErrorNumber.InvalidArgument;
|
|
|
|
|
}
|
2020-01-04 18:18:20 +00:00
|
|
|
|
2022-11-15 15:58:43 +00:00
|
|
|
byte[] sectorData = new byte[512];
|
2018-12-31 13:17:27 +00:00
|
|
|
|
2022-03-06 13:29:38 +00:00
|
|
|
/* read the sector data */
|
|
|
|
|
switch(sheader.flag)
|
|
|
|
|
{
|
|
|
|
|
case SectorFlag.Normal: /* read a normal sector and store it in cache */
|
2022-11-14 09:43:16 +00:00
|
|
|
stream.EnsureRead(sectorData, 0, 512);
|
2022-03-06 13:29:38 +00:00
|
|
|
_sectorCache[(cyl, head, sect)] = sectorData;
|
2022-11-14 01:10:11 +00:00
|
|
|
CRC16IBMContext.Data(sectorData, 512, out byte[] crc);
|
2022-11-15 15:58:43 +00:00
|
|
|
short calculatedCRC = (short)((256 * crc[0]) | crc[1]);
|
2022-03-06 13:29:38 +00:00
|
|
|
/*
|
|
|
|
|
AaruConsole.DebugWriteLine("d2f plugin", "CHS {0},{1},{2}: Regular sector, stored CRC=0x{3:x4}, calculated CRC=0x{4:x4}",
|
|
|
|
|
cyl, head, sect, sheader.crc, 256 * crc[0] + crc[1]);
|
|
|
|
|
*/
|
|
|
|
|
_badSectors[(cyl, head, sect)] = sheader.crc != calculatedCRC;
|
|
|
|
|
|
|
|
|
|
if(calculatedCRC != sheader.crc)
|
|
|
|
|
AaruConsole.DebugWriteLine("d2f plugin",
|
2022-11-29 02:10:37 +00:00
|
|
|
Localization.
|
|
|
|
|
CHS_0_1_2_CRC_mismatch_stored_CRC_3_X4_calculated_CRC_4_X4, cyl,
|
|
|
|
|
head, sect, sheader.crc, calculatedCRC);
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case SectorFlag.BadSector:
|
|
|
|
|
/*
|
|
|
|
|
AaruConsole.DebugWriteLine("d2f plugin", "CHS {0},{1},{2}: Bad sector",
|
|
|
|
|
cyl, head, sect);
|
|
|
|
|
*/
|
|
|
|
|
_badSectors[(cyl, head, sect)] = true;
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case SectorFlag.RepeatByte:
|
|
|
|
|
/*
|
|
|
|
|
AaruConsole.DebugWriteLine("d2f plugin", "CHS {0},{1},{2}: RepeatByte sector, fill byte 0x{0:x2}",
|
|
|
|
|
cyl, head, sect, sheader.crc & 0xff);
|
|
|
|
|
*/
|
2022-11-15 15:58:43 +00:00
|
|
|
for(int i = 0; i < 512; i++)
|
2022-03-06 13:29:38 +00:00
|
|
|
sectorData[i] = (byte)(sheader.crc & 0xff);
|
|
|
|
|
|
|
|
|
|
_sectorCache[(cyl, head, sect)] = sectorData;
|
|
|
|
|
_badSectors[(cyl, head, sect)] = false;
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
default:
|
2022-11-29 02:10:37 +00:00
|
|
|
AaruConsole.ErrorWriteLine(string.Format(Localization.Invalid_sector_type_0_encountered,
|
|
|
|
|
sheader.flag.ToString()));
|
2021-09-21 04:55:28 +01:00
|
|
|
|
|
|
|
|
return ErrorNumber.InvalidArgument;
|
2018-12-31 13:17:27 +00:00
|
|
|
}
|
|
|
|
|
}
|
2022-03-06 13:29:38 +00:00
|
|
|
|
|
|
|
|
return ErrorNumber.NoError;
|
2018-08-29 13:09:04 +02:00
|
|
|
}
|
|
|
|
|
}
|