2017-05-19 20:28:49 +01:00
|
|
|
// /***************************************************************************
|
2016-08-02 18:09:24 +01:00
|
|
|
// The Disc Image Chef
|
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
//
|
|
|
|
|
// Filename : BLU.cs
|
|
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
|
|
|
|
//
|
2017-12-19 03:50:57 +00:00
|
|
|
// Component : Disk image plugins.
|
2016-08-02 18:09:24 +01:00
|
|
|
//
|
|
|
|
|
// --[ Description ] ----------------------------------------------------------
|
|
|
|
|
//
|
2017-12-19 03:50:57 +00:00
|
|
|
// Manages Basic Lisa Utility disk images.
|
2016-08-02 18:09:24 +01:00
|
|
|
//
|
|
|
|
|
// --[ 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/>.
|
|
|
|
|
//
|
|
|
|
|
// ----------------------------------------------------------------------------
|
2017-12-19 03:50:57 +00:00
|
|
|
// Copyright © 2011-2018 Natalia Portillo
|
2016-08-02 18:09:24 +01:00
|
|
|
// ****************************************************************************/
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using DiscImageChef.CommonTypes;
|
2017-12-19 19:33:46 +00:00
|
|
|
using DiscImageChef.Console;
|
2016-09-05 17:37:31 +01:00
|
|
|
using DiscImageChef.Filters;
|
2016-08-02 18:09:24 +01:00
|
|
|
|
2017-12-20 17:15:26 +00:00
|
|
|
namespace DiscImageChef.DiscImages
|
2016-08-02 18:09:24 +01:00
|
|
|
{
|
2017-12-26 06:05:12 +00:00
|
|
|
public class Blu : IMediaImage
|
2016-08-02 18:09:24 +01:00
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
const string PROFILE_NAME = "PROFILE ";
|
|
|
|
|
const string PROFILE10_NAME = "PROFILE 10 ";
|
|
|
|
|
const string WIDGET_NAME = "WIDGET-10 ";
|
|
|
|
|
const string PRIAM_NAME = "PRIAMDTATOWER";
|
2017-12-26 06:05:12 +00:00
|
|
|
IFilter bluImageFilter;
|
2016-08-02 18:09:24 +01:00
|
|
|
int bptag;
|
|
|
|
|
|
2017-12-24 00:12:31 +00:00
|
|
|
BluHeader imageHeader;
|
2017-12-26 06:05:12 +00:00
|
|
|
ImageInfo imageInfo;
|
2017-12-24 00:12:31 +00:00
|
|
|
|
2017-12-20 17:15:26 +00:00
|
|
|
public Blu()
|
2016-08-02 18:09:24 +01:00
|
|
|
{
|
2017-12-26 06:05:12 +00:00
|
|
|
imageInfo = new ImageInfo
|
2017-12-22 06:55:04 +00:00
|
|
|
{
|
|
|
|
|
ReadableSectorTags = new List<SectorTagType>(),
|
|
|
|
|
ReadableMediaTags = new List<MediaTagType>(),
|
2017-12-26 02:51:10 +00:00
|
|
|
HasPartitions = false,
|
|
|
|
|
HasSessions = false,
|
|
|
|
|
Version = null,
|
|
|
|
|
Application = null,
|
|
|
|
|
ApplicationVersion = null,
|
|
|
|
|
Creator = null,
|
|
|
|
|
Comments = null,
|
2017-12-22 06:55:04 +00:00
|
|
|
MediaManufacturer = null,
|
|
|
|
|
MediaModel = null,
|
|
|
|
|
MediaSerialNumber = null,
|
|
|
|
|
MediaBarcode = null,
|
|
|
|
|
MediaPartNumber = null,
|
|
|
|
|
MediaSequence = 0,
|
|
|
|
|
LastMediaSequence = 0,
|
|
|
|
|
DriveManufacturer = null,
|
|
|
|
|
DriveModel = null,
|
|
|
|
|
DriveSerialNumber = null,
|
|
|
|
|
DriveFirmwareRevision = null
|
|
|
|
|
};
|
2016-08-02 18:09:24 +01:00
|
|
|
}
|
|
|
|
|
|
2017-12-26 07:28:40 +00:00
|
|
|
public ImageInfo Info => imageInfo;
|
2017-12-26 02:51:10 +00:00
|
|
|
|
2017-12-26 07:28:40 +00:00
|
|
|
public string Name => "Basic Lisa Utility";
|
|
|
|
|
public Guid Id => new Guid("A153E2F8-4235-432D-9A7F-20807B0BCD74");
|
2017-12-26 06:05:12 +00:00
|
|
|
|
2017-12-26 07:28:40 +00:00
|
|
|
public string ImageFormat => "Basic Lisa Utility";
|
2017-12-26 06:05:12 +00:00
|
|
|
|
2017-12-26 07:28:40 +00:00
|
|
|
public List<Partition> Partitions =>
|
2017-12-26 02:51:10 +00:00
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
2017-12-26 07:28:40 +00:00
|
|
|
public List<Track> Tracks =>
|
2017-12-26 02:51:10 +00:00
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
2017-12-26 07:28:40 +00:00
|
|
|
public List<Session> Sessions =>
|
2017-12-26 02:51:10 +00:00
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
2017-12-26 07:28:40 +00:00
|
|
|
public bool IdentifyImage(IFilter imageFilter)
|
2016-08-02 18:09:24 +01:00
|
|
|
{
|
2016-09-05 17:37:31 +01:00
|
|
|
Stream stream = imageFilter.GetDataForkStream();
|
2016-08-02 18:09:24 +01:00
|
|
|
stream.Seek(0, SeekOrigin.Begin);
|
|
|
|
|
|
2017-12-19 20:33:03 +00:00
|
|
|
if(stream.Length < 0x200) return false;
|
2016-08-02 18:09:24 +01:00
|
|
|
|
|
|
|
|
byte[] header = new byte[0x17];
|
|
|
|
|
stream.Read(header, 0, 0x17);
|
|
|
|
|
|
2017-12-22 06:55:04 +00:00
|
|
|
BluHeader tmpHdr = new BluHeader {DeviceName = new byte[0x0D]};
|
2016-08-02 18:09:24 +01:00
|
|
|
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
|
|
|
|
|
|
2017-12-20 17:15:26 +00:00
|
|
|
Array.Copy(header, 0, tmpHdr.DeviceName, 0, 0x0D);
|
|
|
|
|
tmpHdr.DeviceType = BigEndianBitConverter.ToUInt32(header, 0x0C) & 0x00FFFFFF;
|
|
|
|
|
tmpHdr.DeviceBlocks = BigEndianBitConverter.ToUInt32(header, 0x11) & 0x00FFFFFF;
|
|
|
|
|
tmpHdr.BytesPerBlock = BigEndianBitConverter.ToUInt16(header, 0x15);
|
2016-08-02 18:09:24 +01:00
|
|
|
|
2017-12-20 23:07:46 +00:00
|
|
|
for(int i = 0; i < 0xD; i++) if(tmpHdr.DeviceName[i] < 0x20) return false;
|
2016-08-02 18:09:24 +01:00
|
|
|
|
2017-12-24 00:12:31 +00:00
|
|
|
return (tmpHdr.BytesPerBlock & 0xFE00) == 0x200;
|
2016-08-02 18:09:24 +01:00
|
|
|
}
|
|
|
|
|
|
2017-12-26 07:28:40 +00:00
|
|
|
public bool OpenImage(IFilter imageFilter)
|
2016-08-02 18:09:24 +01:00
|
|
|
{
|
2016-09-05 17:37:31 +01:00
|
|
|
Stream stream = imageFilter.GetDataForkStream();
|
2016-08-02 18:09:24 +01:00
|
|
|
stream.Seek(0, SeekOrigin.Begin);
|
|
|
|
|
|
2017-12-22 06:55:04 +00:00
|
|
|
imageHeader = new BluHeader {DeviceName = new byte[0x0D]};
|
2016-08-02 18:09:24 +01:00
|
|
|
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
|
|
|
|
|
|
|
|
|
|
byte[] header = new byte[0x17];
|
|
|
|
|
stream.Read(header, 0, 0x17);
|
2017-12-20 17:15:26 +00:00
|
|
|
Array.Copy(header, 0, imageHeader.DeviceName, 0, 0x0D);
|
|
|
|
|
imageHeader.DeviceType = BigEndianBitConverter.ToUInt32(header, 0x0C) & 0x00FFFFFF;
|
|
|
|
|
imageHeader.DeviceBlocks = BigEndianBitConverter.ToUInt32(header, 0x11) & 0x00FFFFFF;
|
|
|
|
|
imageHeader.BytesPerBlock = BigEndianBitConverter.ToUInt16(header, 0x15);
|
2016-08-02 18:09:24 +01:00
|
|
|
|
2017-12-19 20:33:03 +00:00
|
|
|
DicConsole.DebugWriteLine("BLU plugin", "ImageHeader.deviceName = \"{0}\"",
|
2017-12-20 17:15:26 +00:00
|
|
|
StringHandlers.CToString(imageHeader.DeviceName));
|
|
|
|
|
DicConsole.DebugWriteLine("BLU plugin", "ImageHeader.deviceType = {0}", imageHeader.DeviceType);
|
|
|
|
|
DicConsole.DebugWriteLine("BLU plugin", "ImageHeader.deviceBlock = {0}", imageHeader.DeviceBlocks);
|
|
|
|
|
DicConsole.DebugWriteLine("BLU plugin", "ImageHeader.bytesPerBlock = {0}", imageHeader.BytesPerBlock);
|
2016-08-02 18:09:24 +01:00
|
|
|
|
2017-12-20 23:07:46 +00:00
|
|
|
for(int i = 0; i < 0xD; i++) if(imageHeader.DeviceName[i] < 0x20) return false;
|
2016-08-02 18:09:24 +01:00
|
|
|
|
2017-12-20 17:15:26 +00:00
|
|
|
if((imageHeader.BytesPerBlock & 0xFE00) != 0x200) return false;
|
2016-08-02 18:09:24 +01:00
|
|
|
|
|
|
|
|
stream.Seek(0, SeekOrigin.Begin);
|
2017-12-20 17:15:26 +00:00
|
|
|
header = new byte[imageHeader.BytesPerBlock];
|
|
|
|
|
stream.Read(header, 0, imageHeader.BytesPerBlock);
|
2016-08-02 18:09:24 +01:00
|
|
|
|
2017-12-26 06:05:12 +00:00
|
|
|
imageInfo.SectorSize = 0x200;
|
2016-08-02 18:09:24 +01:00
|
|
|
|
2017-12-26 06:05:12 +00:00
|
|
|
imageInfo.Sectors = imageHeader.DeviceBlocks;
|
|
|
|
|
imageInfo.ImageSize = imageHeader.DeviceBlocks * imageHeader.BytesPerBlock;
|
2017-12-20 17:15:26 +00:00
|
|
|
bptag = imageHeader.BytesPerBlock - 0x200;
|
2016-08-02 18:09:24 +01:00
|
|
|
byte[] hdrTag = new byte[bptag];
|
|
|
|
|
Array.Copy(header, 0x200, hdrTag, 0, bptag);
|
|
|
|
|
|
2017-12-20 17:15:26 +00:00
|
|
|
switch(StringHandlers.CToString(imageHeader.DeviceName))
|
2016-08-02 18:09:24 +01:00
|
|
|
{
|
2017-12-20 17:15:26 +00:00
|
|
|
case PROFILE_NAME:
|
2017-12-26 06:05:12 +00:00
|
|
|
imageInfo.MediaType = imageInfo.Sectors == 0x2600 ? MediaType.AppleProfile : MediaType.GENERIC_HDD;
|
|
|
|
|
imageInfo.Cylinders = 152;
|
|
|
|
|
imageInfo.Heads = 4;
|
|
|
|
|
imageInfo.SectorsPerTrack = 16;
|
2017-12-19 20:33:03 +00:00
|
|
|
break;
|
2017-12-20 17:15:26 +00:00
|
|
|
case PROFILE10_NAME:
|
2017-12-26 06:05:12 +00:00
|
|
|
imageInfo.MediaType = imageInfo.Sectors == 0x4C00 ? MediaType.AppleProfile : MediaType.GENERIC_HDD;
|
|
|
|
|
imageInfo.Cylinders = 304;
|
|
|
|
|
imageInfo.Heads = 4;
|
|
|
|
|
imageInfo.SectorsPerTrack = 16;
|
2017-12-19 20:33:03 +00:00
|
|
|
break;
|
2017-12-20 17:15:26 +00:00
|
|
|
case WIDGET_NAME:
|
2017-12-26 06:05:12 +00:00
|
|
|
imageInfo.MediaType = imageInfo.Sectors == 0x4C00 ? MediaType.AppleWidget : MediaType.GENERIC_HDD;
|
|
|
|
|
imageInfo.Cylinders = 304;
|
|
|
|
|
imageInfo.Heads = 4;
|
|
|
|
|
imageInfo.SectorsPerTrack = 16;
|
2017-12-19 20:33:03 +00:00
|
|
|
break;
|
2017-12-20 17:15:26 +00:00
|
|
|
case PRIAM_NAME:
|
2017-12-26 06:05:12 +00:00
|
|
|
imageInfo.MediaType =
|
|
|
|
|
imageInfo.Sectors == 0x022C7C ? MediaType.PriamDataTower : MediaType.GENERIC_HDD;
|
2017-12-19 20:33:03 +00:00
|
|
|
// This values are invented...
|
2017-12-26 06:05:12 +00:00
|
|
|
imageInfo.Cylinders = 419;
|
|
|
|
|
imageInfo.Heads = 4;
|
|
|
|
|
imageInfo.SectorsPerTrack = 85;
|
2017-12-19 20:33:03 +00:00
|
|
|
break;
|
2016-08-02 18:09:24 +01:00
|
|
|
default:
|
2017-12-26 06:05:12 +00:00
|
|
|
imageInfo.MediaType = MediaType.GENERIC_HDD;
|
|
|
|
|
imageInfo.Cylinders = (uint)(imageInfo.Sectors / 16 / 63);
|
|
|
|
|
imageInfo.Heads = 16;
|
|
|
|
|
imageInfo.SectorsPerTrack = 63;
|
2016-08-02 18:09:24 +01:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-26 06:05:12 +00:00
|
|
|
imageInfo.Application = StringHandlers.CToString(hdrTag);
|
2016-08-02 18:09:24 +01:00
|
|
|
|
2017-12-26 06:05:12 +00:00
|
|
|
imageInfo.CreationTime = imageFilter.GetCreationTime();
|
|
|
|
|
imageInfo.LastModificationTime = imageFilter.GetLastWriteTime();
|
|
|
|
|
imageInfo.MediaTitle = Path.GetFileNameWithoutExtension(imageFilter.GetFilename());
|
2016-08-02 18:09:24 +01:00
|
|
|
|
2016-09-05 17:37:31 +01:00
|
|
|
bluImageFilter = imageFilter;
|
2016-08-02 18:09:24 +01:00
|
|
|
|
2017-12-26 06:05:12 +00:00
|
|
|
imageInfo.XmlMediaType = XmlMediaType.BlockMedia;
|
2016-08-02 18:09:24 +01:00
|
|
|
|
2017-12-26 06:05:12 +00:00
|
|
|
if(bptag > 0) imageInfo.ReadableSectorTags.Add(SectorTagType.AppleSectorTag);
|
2016-08-02 18:09:24 +01:00
|
|
|
|
2017-12-26 06:05:12 +00:00
|
|
|
DicConsole.VerboseWriteLine("BLU image contains a disk of type {0}", imageInfo.MediaType);
|
2016-08-21 17:35:35 +01:00
|
|
|
|
2016-08-02 18:09:24 +01:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-26 07:28:40 +00:00
|
|
|
public byte[] ReadSector(ulong sectorAddress)
|
2016-08-02 18:09:24 +01:00
|
|
|
{
|
|
|
|
|
return ReadSectors(sectorAddress, 1);
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-26 07:28:40 +00:00
|
|
|
public byte[] ReadSectorTag(ulong sectorAddress, SectorTagType tag)
|
2016-08-02 18:09:24 +01:00
|
|
|
{
|
|
|
|
|
return ReadSectorsTag(sectorAddress, 1, tag);
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-26 07:28:40 +00:00
|
|
|
public byte[] ReadSectors(ulong sectorAddress, uint length)
|
2016-08-02 18:09:24 +01:00
|
|
|
{
|
2017-12-26 06:05:12 +00:00
|
|
|
if(sectorAddress > imageInfo.Sectors - 1)
|
2016-08-02 18:09:24 +01:00
|
|
|
throw new ArgumentOutOfRangeException(nameof(sectorAddress), "Sector address not found");
|
|
|
|
|
|
2017-12-26 06:05:12 +00:00
|
|
|
if(sectorAddress + length > imageInfo.Sectors)
|
2016-08-02 18:09:24 +01:00
|
|
|
throw new ArgumentOutOfRangeException(nameof(length), "Requested more sectors than available");
|
|
|
|
|
|
|
|
|
|
MemoryStream buffer = new MemoryStream();
|
|
|
|
|
int seek = 0;
|
|
|
|
|
int read = 0x200;
|
|
|
|
|
int skip = bptag;
|
|
|
|
|
|
2016-09-05 17:37:31 +01:00
|
|
|
Stream stream = bluImageFilter.GetDataForkStream();
|
2017-12-20 17:15:26 +00:00
|
|
|
stream.Seek((long)((sectorAddress + 1) * imageHeader.BytesPerBlock), SeekOrigin.Begin);
|
2016-08-02 18:09:24 +01:00
|
|
|
|
|
|
|
|
for(int i = 0; i < length; i++)
|
|
|
|
|
{
|
|
|
|
|
stream.Seek(seek, SeekOrigin.Current);
|
|
|
|
|
byte[] sector = new byte[read];
|
|
|
|
|
stream.Read(sector, 0, read);
|
|
|
|
|
buffer.Write(sector, 0, read);
|
|
|
|
|
stream.Seek(skip, SeekOrigin.Current);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return buffer.ToArray();
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-26 07:28:40 +00:00
|
|
|
public byte[] ReadSectorsTag(ulong sectorAddress, uint length, SectorTagType tag)
|
2016-08-02 18:09:24 +01:00
|
|
|
{
|
|
|
|
|
if(tag != SectorTagType.AppleSectorTag)
|
2017-12-21 17:58:51 +00:00
|
|
|
throw new FeatureUnsupportedImageException($"Tag {tag} not supported by image format");
|
2016-08-02 18:09:24 +01:00
|
|
|
|
2017-12-19 20:33:03 +00:00
|
|
|
if(bptag == 0) throw new FeatureNotPresentImageException("Disk image does not have tags");
|
2016-08-02 18:09:24 +01:00
|
|
|
|
2017-12-26 06:05:12 +00:00
|
|
|
if(sectorAddress > imageInfo.Sectors - 1)
|
2016-08-02 18:09:24 +01:00
|
|
|
throw new ArgumentOutOfRangeException(nameof(sectorAddress), "Sector address not found");
|
|
|
|
|
|
2017-12-26 06:05:12 +00:00
|
|
|
if(sectorAddress + length > imageInfo.Sectors)
|
2016-08-02 18:09:24 +01:00
|
|
|
throw new ArgumentOutOfRangeException(nameof(length), "Requested more sectors than available");
|
|
|
|
|
|
|
|
|
|
MemoryStream buffer = new MemoryStream();
|
|
|
|
|
int seek = 0x200;
|
|
|
|
|
int read = bptag;
|
|
|
|
|
int skip = 0;
|
|
|
|
|
|
2016-09-05 17:37:31 +01:00
|
|
|
Stream stream = bluImageFilter.GetDataForkStream();
|
2017-12-20 17:15:26 +00:00
|
|
|
stream.Seek((long)((sectorAddress + 1) * imageHeader.BytesPerBlock), SeekOrigin.Begin);
|
2016-08-02 18:09:24 +01:00
|
|
|
|
|
|
|
|
for(int i = 0; i < length; i++)
|
|
|
|
|
{
|
|
|
|
|
stream.Seek(seek, SeekOrigin.Current);
|
|
|
|
|
byte[] sector = new byte[read];
|
|
|
|
|
stream.Read(sector, 0, read);
|
|
|
|
|
buffer.Write(sector, 0, read);
|
|
|
|
|
stream.Seek(skip, SeekOrigin.Current);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return buffer.ToArray();
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-26 07:28:40 +00:00
|
|
|
public byte[] ReadSectorLong(ulong sectorAddress)
|
2016-08-02 18:09:24 +01:00
|
|
|
{
|
|
|
|
|
return ReadSectorsLong(sectorAddress, 1);
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-26 07:28:40 +00:00
|
|
|
public byte[] ReadSectorsLong(ulong sectorAddress, uint length)
|
2016-08-02 18:09:24 +01:00
|
|
|
{
|
2017-12-26 06:05:12 +00:00
|
|
|
if(sectorAddress > imageInfo.Sectors - 1)
|
2016-08-02 18:09:24 +01:00
|
|
|
throw new ArgumentOutOfRangeException(nameof(sectorAddress), "Sector address not found");
|
|
|
|
|
|
2017-12-26 06:05:12 +00:00
|
|
|
if(sectorAddress + length > imageInfo.Sectors)
|
2016-08-02 18:09:24 +01:00
|
|
|
throw new ArgumentOutOfRangeException(nameof(length), "Requested more sectors than available");
|
|
|
|
|
|
2017-12-20 17:15:26 +00:00
|
|
|
byte[] buffer = new byte[length * imageHeader.BytesPerBlock];
|
2016-09-05 17:37:31 +01:00
|
|
|
Stream stream = bluImageFilter.GetDataForkStream();
|
2017-12-20 17:15:26 +00:00
|
|
|
stream.Seek((long)((sectorAddress + 1) * imageHeader.BytesPerBlock), SeekOrigin.Begin);
|
2016-08-02 18:09:24 +01:00
|
|
|
stream.Read(buffer, 0, buffer.Length);
|
|
|
|
|
|
|
|
|
|
return buffer;
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-26 07:28:40 +00:00
|
|
|
public byte[] ReadDiskTag(MediaTagType tag)
|
2016-08-02 18:09:24 +01:00
|
|
|
{
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-26 07:28:40 +00:00
|
|
|
public List<Track> GetSessionTracks(Session session)
|
2016-08-02 18:09:24 +01:00
|
|
|
{
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-26 07:28:40 +00:00
|
|
|
public List<Track> GetSessionTracks(ushort session)
|
2016-08-02 18:09:24 +01:00
|
|
|
{
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-26 07:28:40 +00:00
|
|
|
public byte[] ReadSector(ulong sectorAddress, uint track)
|
2016-08-02 18:09:24 +01:00
|
|
|
{
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-26 07:28:40 +00:00
|
|
|
public byte[] ReadSectorTag(ulong sectorAddress, uint track, SectorTagType tag)
|
2016-08-02 18:09:24 +01:00
|
|
|
{
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-26 07:28:40 +00:00
|
|
|
public byte[] ReadSectors(ulong sectorAddress, uint length, uint track)
|
2016-08-02 18:09:24 +01:00
|
|
|
{
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-26 07:28:40 +00:00
|
|
|
public byte[] ReadSectorsTag(ulong sectorAddress, uint length, uint track, SectorTagType tag)
|
2016-08-02 18:09:24 +01:00
|
|
|
{
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-26 07:28:40 +00:00
|
|
|
public byte[] ReadSectorLong(ulong sectorAddress, uint track)
|
2016-08-02 18:09:24 +01:00
|
|
|
{
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-26 07:28:40 +00:00
|
|
|
public byte[] ReadSectorsLong(ulong sectorAddress, uint length, uint track)
|
2016-08-02 18:09:24 +01:00
|
|
|
{
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
}
|
2017-12-24 00:12:31 +00:00
|
|
|
|
|
|
|
|
struct BluHeader
|
|
|
|
|
{
|
|
|
|
|
public byte[] DeviceName;
|
|
|
|
|
public uint DeviceType;
|
|
|
|
|
public uint DeviceBlocks;
|
|
|
|
|
public ushort BytesPerBlock;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#region Verification, should add tag checksum checks
|
2017-12-26 07:28:40 +00:00
|
|
|
public bool? VerifySector(ulong sectorAddress)
|
2017-12-24 00:12:31 +00:00
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-26 07:28:40 +00:00
|
|
|
public bool? VerifySector(ulong sectorAddress, uint track)
|
2017-12-24 00:12:31 +00:00
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-26 07:28:40 +00:00
|
|
|
public bool? VerifySectors(ulong sectorAddress, uint length, out List<ulong> failingLbas,
|
2017-12-24 00:12:31 +00:00
|
|
|
out List<ulong> unknownLbas)
|
|
|
|
|
{
|
|
|
|
|
failingLbas = new List<ulong>();
|
|
|
|
|
unknownLbas = new List<ulong>();
|
|
|
|
|
|
|
|
|
|
for(ulong i = sectorAddress; i < sectorAddress + length; i++) unknownLbas.Add(i);
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-26 07:28:40 +00:00
|
|
|
public bool? VerifySectors(ulong sectorAddress, uint length, uint track, out List<ulong> failingLbas,
|
2017-12-24 00:12:31 +00:00
|
|
|
out List<ulong> unknownLbas)
|
|
|
|
|
{
|
|
|
|
|
failingLbas = new List<ulong>();
|
|
|
|
|
unknownLbas = new List<ulong>();
|
|
|
|
|
|
|
|
|
|
for(ulong i = sectorAddress; i < sectorAddress + length; i++) unknownLbas.Add(i);
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
2017-12-26 07:28:40 +00:00
|
|
|
public bool? VerifyMediaImage()
|
2017-12-24 00:12:31 +00:00
|
|
|
{
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
#endregion Verification, should add tag checksum checks
|
2016-08-02 18:09:24 +01:00
|
|
|
}
|
2017-12-19 20:33:03 +00:00
|
|
|
}
|