2014-06-07 23:32:59 +01:00
|
|
|
|
/***************************************************************************
|
2014-06-15 23:39:34 +01:00
|
|
|
|
The Disc Image Chef
|
2014-06-07 23:32:59 +01:00
|
|
|
|
----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
Filename : ZZZRawImage.cs
|
|
|
|
|
|
Version : 1.0
|
|
|
|
|
|
Author(s) : Natalia Portillo
|
|
|
|
|
|
|
|
|
|
|
|
Component : Disc image plugins
|
|
|
|
|
|
|
|
|
|
|
|
Revision : $Revision$
|
|
|
|
|
|
Last change by : $Author$
|
|
|
|
|
|
Date : $Date$
|
|
|
|
|
|
|
|
|
|
|
|
--[ Description ] ----------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
Manages raw image, that is, user data sector by sector copy.
|
|
|
|
|
|
|
|
|
|
|
|
--[ License ] --------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
|
|
it under the terms of the GNU General Public License as
|
|
|
|
|
|
published by the Free Software Foundation, either version 3 of the
|
|
|
|
|
|
License, or (at your option) any later version.
|
|
|
|
|
|
|
|
|
|
|
|
This program 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 General Public License for more details.
|
|
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
|
|
|
----------------------------------------------------------------------------
|
|
|
|
|
|
Copyright (C) 2011-2014 Claunia.com
|
|
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
//$Id$
|
|
|
|
|
|
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.IO;
|
|
|
|
|
|
using System.Collections.Generic;
|
2015-11-23 21:44:58 +00:00
|
|
|
|
using DiscImageChef.CommonTypes;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
|
2014-06-15 23:39:34 +01:00
|
|
|
|
namespace DiscImageChef.ImagePlugins
|
2014-06-07 23:32:59 +01:00
|
|
|
|
{
|
|
|
|
|
|
// Checked using several images and strings inside Apple's DiskImages.framework
|
|
|
|
|
|
class ZZZRawImage : ImagePlugin
|
|
|
|
|
|
{
|
|
|
|
|
|
#region Internal variables
|
2014-08-25 05:00:25 +01:00
|
|
|
|
|
2014-06-07 23:32:59 +01:00
|
|
|
|
string rawImagePath;
|
|
|
|
|
|
bool differentTrackZeroSize;
|
2014-08-25 05:00:25 +01:00
|
|
|
|
|
2014-06-07 23:32:59 +01:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
2015-10-05 19:45:07 +01:00
|
|
|
|
public ZZZRawImage()
|
2014-06-07 23:32:59 +01:00
|
|
|
|
{
|
|
|
|
|
|
Name = "Raw Disk Image";
|
|
|
|
|
|
// Non-random UUID to recognize this specific plugin
|
|
|
|
|
|
PluginUUID = new Guid("12345678-AAAA-BBBB-CCCC-123456789000");
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo = new ImageInfo();
|
|
|
|
|
|
ImageInfo.readableSectorTags = new List<SectorTagType>();
|
2016-01-16 03:54:55 +00:00
|
|
|
|
ImageInfo.readableMediaTags = new List<MediaTagType>();
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.imageHasPartitions = false;
|
|
|
|
|
|
ImageInfo.imageHasSessions = false;
|
|
|
|
|
|
ImageInfo.imageVersion = null;
|
|
|
|
|
|
ImageInfo.imageApplication = null;
|
|
|
|
|
|
ImageInfo.imageApplicationVersion = null;
|
|
|
|
|
|
ImageInfo.imageCreator = null;
|
|
|
|
|
|
ImageInfo.imageComments = null;
|
2016-01-16 03:54:55 +00:00
|
|
|
|
ImageInfo.mediaManufacturer = null;
|
|
|
|
|
|
ImageInfo.mediaModel = null;
|
|
|
|
|
|
ImageInfo.mediaSerialNumber = null;
|
|
|
|
|
|
ImageInfo.mediaBarcode = null;
|
|
|
|
|
|
ImageInfo.mediaPartNumber = null;
|
|
|
|
|
|
ImageInfo.mediaSequence = 0;
|
|
|
|
|
|
ImageInfo.lastMediaSequence = 0;
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.driveManufacturer = null;
|
|
|
|
|
|
ImageInfo.driveModel = null;
|
|
|
|
|
|
ImageInfo.driveSerialNumber = null;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override bool IdentifyImage(string imagePath)
|
|
|
|
|
|
{
|
|
|
|
|
|
FileInfo fi = new FileInfo(imagePath);
|
|
|
|
|
|
|
|
|
|
|
|
// Check if file is not multiple of 512
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if((fi.Length % 512) != 0)
|
2014-06-07 23:32:59 +01:00
|
|
|
|
{
|
|
|
|
|
|
// Check known disk sizes with sectors smaller than 512
|
2016-04-19 02:11:47 +01:00
|
|
|
|
switch(fi.Length)
|
2014-06-07 23:32:59 +01:00
|
|
|
|
{
|
|
|
|
|
|
case 81664:
|
|
|
|
|
|
case 116480:
|
|
|
|
|
|
case 242944:
|
|
|
|
|
|
case 256256:
|
|
|
|
|
|
case 287488:
|
|
|
|
|
|
case 306432:
|
|
|
|
|
|
case 495872:
|
|
|
|
|
|
case 988416:
|
|
|
|
|
|
case 995072:
|
|
|
|
|
|
case 1021696:
|
|
|
|
|
|
case 1146624:
|
|
|
|
|
|
case 1177344:
|
|
|
|
|
|
case 1222400:
|
|
|
|
|
|
case 1304320:
|
|
|
|
|
|
case 1255168:
|
|
|
|
|
|
return true;
|
|
|
|
|
|
default:
|
|
|
|
|
|
return false;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override bool OpenImage(string imagePath)
|
|
|
|
|
|
{
|
|
|
|
|
|
FileStream stream = new FileStream(imagePath, FileMode.Open, FileAccess.Read);
|
|
|
|
|
|
stream.Seek(0, SeekOrigin.Begin);
|
2014-07-03 18:31:27 +01:00
|
|
|
|
stream.Close();
|
2014-06-07 23:32:59 +01:00
|
|
|
|
|
|
|
|
|
|
FileInfo fi = new FileInfo(imagePath);
|
|
|
|
|
|
string extension = Path.GetExtension(imagePath).ToLower();
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(extension == ".iso" && (fi.Length % 2048) == 0)
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.sectorSize = 2048;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
else
|
|
|
|
|
|
{
|
2016-04-19 02:11:47 +01:00
|
|
|
|
switch(fi.Length)
|
2014-06-07 23:32:59 +01:00
|
|
|
|
{
|
|
|
|
|
|
case 242944:
|
|
|
|
|
|
case 256256:
|
|
|
|
|
|
case 495872:
|
|
|
|
|
|
case 92160:
|
|
|
|
|
|
case 133120:
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.sectorSize = 128;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
break;
|
|
|
|
|
|
case 116480:
|
|
|
|
|
|
case 287488: // T0S0 = 128bps
|
|
|
|
|
|
case 988416: // T0S0 = 128bps
|
|
|
|
|
|
case 995072: // T0S0 = 128bps, T0S1 = 256bps
|
|
|
|
|
|
case 1021696: // T0S0 = 128bps, T0S1 = 256bps
|
|
|
|
|
|
case 232960:
|
|
|
|
|
|
case 143360:
|
|
|
|
|
|
case 286720:
|
|
|
|
|
|
case 512512:
|
|
|
|
|
|
case 102400:
|
|
|
|
|
|
case 204800:
|
|
|
|
|
|
case 163840:
|
|
|
|
|
|
case 327680:
|
|
|
|
|
|
case 655360:
|
|
|
|
|
|
case 80384: // T0S0 = 128bps
|
|
|
|
|
|
case 325632: // T0S0 = 128bps, T0S1 = 256bps
|
|
|
|
|
|
case 653312: // T0S0 = 128bps, T0S1 = 256bps
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.sectorSize = 256;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
break;
|
|
|
|
|
|
case 81664:
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.sectorSize = 319;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
break;
|
|
|
|
|
|
case 306432: // T0S0 = 128bps
|
|
|
|
|
|
case 1146624: // T0S0 = 128bps, T0S1 = 256bps
|
|
|
|
|
|
case 1177344: // T0S0 = 128bps, T0S1 = 256bps
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.sectorSize = 512;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
break;
|
|
|
|
|
|
case 1222400: // T0S0 = 128bps, T0S1 = 256bps
|
|
|
|
|
|
case 1304320: // T0S0 = 128bps, T0S1 = 256bps
|
|
|
|
|
|
case 1255168: // T0S0 = 128bps, T0S1 = 256bps
|
|
|
|
|
|
case 1261568:
|
|
|
|
|
|
case 1310720:
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.sectorSize = 1024;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
break;
|
|
|
|
|
|
default:
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.sectorSize = 512;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.imageSize = (ulong)fi.Length;
|
|
|
|
|
|
ImageInfo.imageCreationTime = fi.CreationTimeUtc;
|
|
|
|
|
|
ImageInfo.imageLastModificationTime = fi.LastWriteTimeUtc;
|
|
|
|
|
|
ImageInfo.imageName = Path.GetFileNameWithoutExtension(imagePath);
|
2014-06-07 23:32:59 +01:00
|
|
|
|
differentTrackZeroSize = false;
|
|
|
|
|
|
rawImagePath = imagePath;
|
|
|
|
|
|
|
2016-04-19 02:11:47 +01:00
|
|
|
|
switch(fi.Length)
|
2014-06-07 23:32:59 +01:00
|
|
|
|
{
|
|
|
|
|
|
case 242944:
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.sectors = 1898;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
break;
|
|
|
|
|
|
case 256256:
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.sectors = 2002;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
break;
|
|
|
|
|
|
case 495872:
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.sectors = 3874;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
break;
|
|
|
|
|
|
case 116480:
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.sectors = 455;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
break;
|
|
|
|
|
|
case 287488: // T0S0 = 128bps
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.sectors = 1136;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
differentTrackZeroSize = true;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 988416: // T0S0 = 128bps
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.sectors = 3874;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
differentTrackZeroSize = true;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 995072: // T0S0 = 128bps, T0S1 = 256bps
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.sectors = 3900;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
differentTrackZeroSize = true;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 1021696: // T0S0 = 128bps, T0S1 = 256bps
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.sectors = 4004;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
differentTrackZeroSize = true;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 81664:
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.sectors = 256;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
break;
|
|
|
|
|
|
case 306432: // T0S0 = 128bps
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.sectors = 618;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
differentTrackZeroSize = true;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 1146624: // T0S0 = 128bps, T0S1 = 256bps
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.sectors = 2272;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
differentTrackZeroSize = true;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 1177344: // T0S0 = 128bps, T0S1 = 256bps
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.sectors = 2332;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
differentTrackZeroSize = true;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 1222400: // T0S0 = 128bps, T0S1 = 256bps
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.sectors = 1236;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
differentTrackZeroSize = true;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 1304320: // T0S0 = 128bps, T0S1 = 256bps
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.sectors = 1316;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
differentTrackZeroSize = true;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 1255168: // T0S0 = 128bps, T0S1 = 256bps
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.sectors = 1268;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
differentTrackZeroSize = true;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 80384: // T0S0 = 128bps
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.sectors = 322;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
differentTrackZeroSize = true;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 325632: // T0S0 = 128bps, T0S1 = 256bps
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.sectors = 1280;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
differentTrackZeroSize = true;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 653312: // T0S0 = 128bps, T0S1 = 256bps
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.sectors = 2560;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
differentTrackZeroSize = true;
|
|
|
|
|
|
break;
|
|
|
|
|
|
case 1880064: // IBM XDF, 3,5", real number of sectors
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.sectors = 670;
|
|
|
|
|
|
ImageInfo.sectorSize = 8192; // Biggest sector size
|
2014-06-07 23:32:59 +01:00
|
|
|
|
differentTrackZeroSize = true;
|
|
|
|
|
|
break;
|
|
|
|
|
|
default:
|
2014-08-28 19:29:18 +01:00
|
|
|
|
ImageInfo.sectors = ImageInfo.imageSize / ImageInfo.sectorSize;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2016-01-16 03:54:55 +00:00
|
|
|
|
ImageInfo.mediaType = CalculateDiskType();
|
2014-08-24 17:46:29 +01:00
|
|
|
|
|
2016-04-19 02:11:47 +01:00
|
|
|
|
switch(ImageInfo.mediaType)
|
2015-12-05 17:21:47 +00:00
|
|
|
|
{
|
2016-01-16 03:54:55 +00:00
|
|
|
|
case MediaType.CD:
|
|
|
|
|
|
case MediaType.DVDPR:
|
|
|
|
|
|
case MediaType.DVDR:
|
|
|
|
|
|
case MediaType.DVDRDL:
|
|
|
|
|
|
case MediaType.DVDPRDL:
|
|
|
|
|
|
case MediaType.BDR:
|
|
|
|
|
|
case MediaType.BDRXL:
|
2015-12-05 17:21:47 +00:00
|
|
|
|
ImageInfo.xmlMediaType = XmlMediaType.OpticalDisc;
|
|
|
|
|
|
break;
|
|
|
|
|
|
default:
|
|
|
|
|
|
ImageInfo.xmlMediaType = XmlMediaType.BlockMedia;
|
|
|
|
|
|
break;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2014-06-07 23:32:59 +01:00
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override bool ImageHasPartitions()
|
|
|
|
|
|
{
|
2014-08-28 19:29:18 +01:00
|
|
|
|
return ImageInfo.imageHasPartitions;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override UInt64 GetImageSize()
|
|
|
|
|
|
{
|
2014-08-28 19:29:18 +01:00
|
|
|
|
return ImageInfo.imageSize;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override UInt64 GetSectors()
|
|
|
|
|
|
{
|
2014-08-28 19:29:18 +01:00
|
|
|
|
return ImageInfo.sectors;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override UInt32 GetSectorSize()
|
|
|
|
|
|
{
|
2014-08-28 19:29:18 +01:00
|
|
|
|
return ImageInfo.sectorSize;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override byte[] ReadSector(UInt64 sectorAddress)
|
|
|
|
|
|
{
|
|
|
|
|
|
return ReadSectors(sectorAddress, 1);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override byte[] ReadSectors(UInt64 sectorAddress, UInt32 length)
|
|
|
|
|
|
{
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(differentTrackZeroSize)
|
2014-06-07 23:32:59 +01:00
|
|
|
|
{
|
|
|
|
|
|
throw new NotImplementedException("Not yet implemented");
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(sectorAddress > ImageInfo.sectors - 1)
|
2014-06-07 23:32:59 +01:00
|
|
|
|
throw new ArgumentOutOfRangeException("sectorAddress", "Sector address not found");
|
|
|
|
|
|
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(sectorAddress + length > ImageInfo.sectors)
|
2014-06-07 23:32:59 +01:00
|
|
|
|
throw new ArgumentOutOfRangeException("length", "Requested more sectors than available");
|
|
|
|
|
|
|
2014-08-28 19:29:18 +01:00
|
|
|
|
byte[] buffer = new byte[length * ImageInfo.sectorSize];
|
2014-06-07 23:32:59 +01:00
|
|
|
|
|
|
|
|
|
|
FileStream stream = new FileStream(rawImagePath, FileMode.Open, FileAccess.Read);
|
|
|
|
|
|
|
2014-08-28 19:29:18 +01:00
|
|
|
|
stream.Seek((long)(sectorAddress * ImageInfo.sectorSize), SeekOrigin.Begin);
|
2014-06-07 23:32:59 +01:00
|
|
|
|
|
2014-08-28 19:29:18 +01:00
|
|
|
|
stream.Read(buffer, 0, (int)(length * ImageInfo.sectorSize));
|
2014-06-07 23:32:59 +01:00
|
|
|
|
|
2014-07-03 18:31:27 +01:00
|
|
|
|
stream.Close();
|
|
|
|
|
|
|
2014-06-07 23:32:59 +01:00
|
|
|
|
return buffer;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2016-04-19 02:11:47 +01:00
|
|
|
|
public override string GetImageFormat()
|
|
|
|
|
|
{
|
2014-06-07 23:32:59 +01:00
|
|
|
|
return "Raw disk image (sector by sector copy)";
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override DateTime GetImageCreationTime()
|
|
|
|
|
|
{
|
2014-08-28 19:29:18 +01:00
|
|
|
|
return ImageInfo.imageCreationTime;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override DateTime GetImageLastModificationTime()
|
|
|
|
|
|
{
|
2014-08-28 19:29:18 +01:00
|
|
|
|
return ImageInfo.imageLastModificationTime;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2016-04-19 02:11:47 +01:00
|
|
|
|
public override string GetImageName()
|
2014-06-07 23:32:59 +01:00
|
|
|
|
{
|
2014-08-28 19:29:18 +01:00
|
|
|
|
return ImageInfo.imageName;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2016-01-16 03:54:55 +00:00
|
|
|
|
public override MediaType GetMediaType()
|
2014-06-07 23:32:59 +01:00
|
|
|
|
{
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return ImageInfo.mediaType;
|
2014-08-24 17:46:29 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2014-08-25 05:00:25 +01:00
|
|
|
|
public override bool? VerifySector(UInt64 sectorAddress)
|
|
|
|
|
|
{
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override bool? VerifySector(UInt64 sectorAddress, UInt32 track)
|
|
|
|
|
|
{
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override bool? VerifySectors(UInt64 sectorAddress, UInt32 length, out List<UInt64> FailingLBAs, out List<UInt64> UnknownLBAs)
|
|
|
|
|
|
{
|
|
|
|
|
|
FailingLBAs = new List<UInt64>();
|
|
|
|
|
|
UnknownLBAs = new List<UInt64>();
|
|
|
|
|
|
|
2016-04-19 02:11:47 +01:00
|
|
|
|
for(UInt64 i = sectorAddress; i < sectorAddress + length; i++)
|
2014-08-25 05:00:25 +01:00
|
|
|
|
UnknownLBAs.Add(i);
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override bool? VerifySectors(UInt64 sectorAddress, UInt32 length, UInt32 track, out List<UInt64> FailingLBAs, out List<UInt64> UnknownLBAs)
|
|
|
|
|
|
{
|
|
|
|
|
|
FailingLBAs = new List<UInt64>();
|
|
|
|
|
|
UnknownLBAs = new List<UInt64>();
|
|
|
|
|
|
|
2016-04-19 02:11:47 +01:00
|
|
|
|
for(UInt64 i = sectorAddress; i < sectorAddress + length; i++)
|
2014-08-25 05:00:25 +01:00
|
|
|
|
UnknownLBAs.Add(i);
|
|
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2016-01-16 03:54:55 +00:00
|
|
|
|
public override bool? VerifyMediaImage()
|
2014-08-25 05:00:25 +01:00
|
|
|
|
{
|
|
|
|
|
|
return null;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2015-12-06 05:09:31 +00:00
|
|
|
|
public override List<Track> GetTracks()
|
|
|
|
|
|
{
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(ImageInfo.xmlMediaType == XmlMediaType.OpticalDisc)
|
2015-12-06 05:09:31 +00:00
|
|
|
|
{
|
|
|
|
|
|
Track trk = new Track();
|
|
|
|
|
|
trk.TrackBytesPerSector = (int)ImageInfo.sectorSize;
|
|
|
|
|
|
trk.TrackEndSector = ImageInfo.sectors - 1;
|
|
|
|
|
|
trk.TrackFile = rawImagePath;
|
|
|
|
|
|
trk.TrackFileOffset = 0;
|
|
|
|
|
|
trk.TrackFileType = "BINARY";
|
|
|
|
|
|
trk.TrackRawBytesPerSector = (int)ImageInfo.sectorSize;
|
|
|
|
|
|
trk.TrackSequence = 1;
|
|
|
|
|
|
trk.TrackStartSector = 0;
|
|
|
|
|
|
trk.TrackSubchannelType = TrackSubchannelType.None;
|
|
|
|
|
|
trk.TrackType = TrackType.Data;
|
|
|
|
|
|
trk.TrackSession = 1;
|
|
|
|
|
|
List<Track> lst = new List<Track>();
|
|
|
|
|
|
lst.Add(trk);
|
|
|
|
|
|
return lst;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override List<Track> GetSessionTracks(Session session)
|
|
|
|
|
|
{
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(ImageInfo.xmlMediaType == XmlMediaType.OpticalDisc)
|
2015-12-06 05:09:31 +00:00
|
|
|
|
{
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(session.SessionSequence != 1)
|
2015-12-06 05:09:31 +00:00
|
|
|
|
throw new ArgumentOutOfRangeException("session", "Only a single session is supported");
|
|
|
|
|
|
|
|
|
|
|
|
Track trk = new Track();
|
|
|
|
|
|
trk.TrackBytesPerSector = (int)ImageInfo.sectorSize;
|
|
|
|
|
|
trk.TrackEndSector = ImageInfo.sectors - 1;
|
|
|
|
|
|
trk.TrackFile = rawImagePath;
|
|
|
|
|
|
trk.TrackFileOffset = 0;
|
|
|
|
|
|
trk.TrackFileType = "BINARY";
|
|
|
|
|
|
trk.TrackRawBytesPerSector = (int)ImageInfo.sectorSize;
|
|
|
|
|
|
trk.TrackSequence = 1;
|
|
|
|
|
|
trk.TrackStartSector = 0;
|
|
|
|
|
|
trk.TrackSubchannelType = TrackSubchannelType.None;
|
|
|
|
|
|
trk.TrackType = TrackType.Data;
|
|
|
|
|
|
trk.TrackSession = 1;
|
|
|
|
|
|
List<Track> lst = new List<Track>();
|
|
|
|
|
|
lst.Add(trk);
|
|
|
|
|
|
return lst;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override List<Track> GetSessionTracks(UInt16 session)
|
|
|
|
|
|
{
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(ImageInfo.xmlMediaType == XmlMediaType.OpticalDisc)
|
2015-12-06 05:09:31 +00:00
|
|
|
|
{
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(session != 1)
|
2015-12-06 05:09:31 +00:00
|
|
|
|
throw new ArgumentOutOfRangeException("session", "Only a single session is supported");
|
|
|
|
|
|
|
|
|
|
|
|
Track trk = new Track();
|
|
|
|
|
|
trk.TrackBytesPerSector = (int)ImageInfo.sectorSize;
|
|
|
|
|
|
trk.TrackEndSector = ImageInfo.sectors - 1;
|
|
|
|
|
|
trk.TrackFile = rawImagePath;
|
|
|
|
|
|
trk.TrackFileOffset = 0;
|
|
|
|
|
|
trk.TrackFileType = "BINARY";
|
|
|
|
|
|
trk.TrackRawBytesPerSector = (int)ImageInfo.sectorSize;
|
|
|
|
|
|
trk.TrackSequence = 1;
|
|
|
|
|
|
trk.TrackStartSector = 0;
|
|
|
|
|
|
trk.TrackSubchannelType = TrackSubchannelType.None;
|
|
|
|
|
|
trk.TrackType = TrackType.Data;
|
|
|
|
|
|
trk.TrackSession = 1;
|
|
|
|
|
|
List<Track> lst = new List<Track>();
|
|
|
|
|
|
lst.Add(trk);
|
|
|
|
|
|
return lst;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override List<Session> GetSessions()
|
|
|
|
|
|
{
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(ImageInfo.xmlMediaType == XmlMediaType.OpticalDisc)
|
2015-12-06 05:09:31 +00:00
|
|
|
|
{
|
|
|
|
|
|
Session sess = new Session();
|
|
|
|
|
|
sess.EndSector = ImageInfo.sectors - 1;
|
|
|
|
|
|
sess.EndTrack = 1;
|
|
|
|
|
|
sess.SessionSequence = 1;
|
|
|
|
|
|
sess.StartSector = 0;
|
|
|
|
|
|
sess.StartTrack = 1;
|
|
|
|
|
|
List<Session> lst = new List<Session>();
|
|
|
|
|
|
lst.Add(sess);
|
|
|
|
|
|
return lst;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override byte[] ReadSector(UInt64 sectorAddress, UInt32 track)
|
|
|
|
|
|
{
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(ImageInfo.xmlMediaType == XmlMediaType.OpticalDisc)
|
2015-12-06 05:09:31 +00:00
|
|
|
|
{
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(track != 1)
|
2015-12-06 05:09:31 +00:00
|
|
|
|
throw new ArgumentOutOfRangeException("track", "Only a single session is supported");
|
|
|
|
|
|
|
|
|
|
|
|
return ReadSector(sectorAddress);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override byte[] ReadSectors(UInt64 sectorAddress, UInt32 length, UInt32 track)
|
|
|
|
|
|
{
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(ImageInfo.xmlMediaType == XmlMediaType.OpticalDisc)
|
2015-12-06 05:09:31 +00:00
|
|
|
|
{
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(track != 1)
|
2015-12-06 05:09:31 +00:00
|
|
|
|
throw new ArgumentOutOfRangeException("track", "Only a single session is supported");
|
|
|
|
|
|
|
|
|
|
|
|
return ReadSectors(sectorAddress, length);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override byte[] ReadSectorLong(UInt64 sectorAddress, UInt32 track)
|
|
|
|
|
|
{
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(ImageInfo.xmlMediaType == XmlMediaType.OpticalDisc)
|
2015-12-06 05:09:31 +00:00
|
|
|
|
{
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(track != 1)
|
2015-12-06 05:09:31 +00:00
|
|
|
|
throw new ArgumentOutOfRangeException("track", "Only a single session is supported");
|
|
|
|
|
|
|
|
|
|
|
|
return ReadSector(sectorAddress);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override byte[] ReadSectorsLong(UInt64 sectorAddress, UInt32 length, UInt32 track)
|
|
|
|
|
|
{
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(ImageInfo.xmlMediaType == XmlMediaType.OpticalDisc)
|
2015-12-06 05:09:31 +00:00
|
|
|
|
{
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(track != 1)
|
2015-12-06 05:09:31 +00:00
|
|
|
|
throw new ArgumentOutOfRangeException("track", "Only a single session is supported");
|
|
|
|
|
|
|
|
|
|
|
|
return ReadSectors(sectorAddress, length);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2014-08-24 17:46:29 +01:00
|
|
|
|
#region Private methods
|
2014-08-25 05:00:25 +01:00
|
|
|
|
|
2016-01-16 03:54:55 +00:00
|
|
|
|
MediaType CalculateDiskType()
|
2014-08-24 17:46:29 +01:00
|
|
|
|
{
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(ImageInfo.sectorSize == 2048)
|
2014-06-07 23:32:59 +01:00
|
|
|
|
{
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(ImageInfo.sectors <= 360000)
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.CD;
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(ImageInfo.sectors <= 2295104)
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.DVDPR;
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(ImageInfo.sectors <= 2298496)
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.DVDR;
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(ImageInfo.sectors <= 4171712)
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.DVDRDL;
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(ImageInfo.sectors <= 4173824)
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.DVDPRDL;
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(ImageInfo.sectors <= 24438784)
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.BDR;
|
2016-04-19 02:11:47 +01:00
|
|
|
|
if(ImageInfo.sectors <= 62500864)
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.BDRXL;
|
|
|
|
|
|
return MediaType.Unknown;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2016-04-19 02:11:47 +01:00
|
|
|
|
switch(ImageInfo.imageSize)
|
2014-06-07 23:32:59 +01:00
|
|
|
|
{
|
|
|
|
|
|
case 80384:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.ECMA_66;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 81664:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.IBM23FD;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 92160:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.ATARI_525_SD;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 102400:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.ACORN_525_SS_SD_40;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 116480:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.Apple32SS;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 133120:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.ATARI_525_ED;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 143360:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.Apple33SS;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 163840:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.DOS_525_SS_DD_8;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 184320:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.DOS_525_SS_DD_9;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 204800:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.ACORN_525_SS_SD_80;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 232960:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.Apple32DS;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 242944:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.IBM33FD_128;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 256256:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.ECMA_54;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 286720:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.Apple33DS;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 287488:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.IBM33FD_256;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 306432:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.IBM33FD_512;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 325632:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.ECMA_70;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 327680:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.DOS_525_DS_DD_8;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 368640:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.DOS_525_DS_DD_9;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 409600:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.AppleSonySS;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 495872:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.IBM43FD_128;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 512512:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.ECMA_59;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 653312:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.ECMA_78;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 655360:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.ACORN_525_DS_DD;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 737280:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.DOS_35_DS_DD_9;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 819200:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.AppleSonyDS;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 839680:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.FDFORMAT_35_DD;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 901120:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.CBM_AMIGA_35_DD;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 988416:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.IBM43FD_256;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 995072:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.IBM53FD_256;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 1021696:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.ECMA_99_26;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 1146624:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.IBM53FD_512;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 1177344:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.ECMA_99_15;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 1222400:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.IBM53FD_1024;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 1228800:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.DOS_525_HD;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 1255168:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.ECMA_69_8;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 1261568:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.NEC_8_DD;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 1304320:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.ECMA_99_8;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 1310720:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.NEC_525_HD;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 1427456:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.FDFORMAT_525_HD;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 1474560:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.DOS_35_HD;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 1720320:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.DMF;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 1763328:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.FDFORMAT_35_HD;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 1802240:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.CBM_AMIGA_35_HD;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 1880064:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.XDF_35;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 1884160:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.XDF_35;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 2949120:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.DOS_35_ED;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 128000000:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.ECMA_154;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 229632000:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.ECMA_201;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 481520640:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.ECMA_183_512;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 533403648:
|
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs:
* DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
* DiscImageChef.Metadata/DeviceReport.cs:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DeviceReport.cs:
* DiscImageChef.Metadata/DiscImageChef.Metadata.csproj:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DumpMedia.cs:
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Core/Checksum.cs:
* DiscImageChef/Commands/CreateSidecar.cs:
Moved checksum generation to a separate class.
* CICMMetadata:
Added support for ADIP.
* DiscImageChef.CommonTypes/MediaType.cs:
Added parameters of UDO media.
Moved DataPlay outside of Iomega, as it's not from that
manufacturer.
Added missing Exatape media and corrected 160m XL one.
Added SyJet media.
Added all ECMA defined magneto-optical (sectors calculated
from specifications, unchecked).
Added PD media.
Added Imation 320Gb RDX.
Added generic USB flash drives.
* DiscImageChef.Decoders/SCSI/Enums.cs:
Make enumerations public.
* DiscImageChef.Decoders/SCSI/Inquiry.cs:
* DiscImageChef.Devices/Device/Constructor.cs:
Trim space padded strings on SCSI INQUIRY.
* DiscImageChef.Devices/Device/ScsiCommands/MMC.cs:
Added PREVENT ALLOW MEDIUM REMOVAL.
Added START STOP UNIT.
* DiscImageChef.Devices/Device/ScsiCommands/NEC.cs:
Rename NEC methods.
* DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs:
Corrected Pioneer transfer length calculation.
* DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs:
Renamed Plextor methods.
* DiscImageChef.Devices/Device/ScsiCommands/SPC.cs:
Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with
MMC same name but different command.
* DiscImageChef.Devices/DiscImageChef.Devices.csproj:
Set platform target to x86 (does it really matter?).
* DiscImageChef.Devices/Linux/Command.cs:
Reduced allocation for readlink() to current kernel
MAX_PATH.
* DiscImageChef.Devices/Linux/Enums.cs:
Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves
commands not working on 32-bit environments.
* DiscImageChef.DiscImages/ZZZRawImage.cs:
Changed ECMA-184 and ECMA-183 enums.
* DiscImageChef.Metadata/Dimensions.cs:
Added all ECMA defined magneto-opticals.
Added PD media.
Added 320Gb RDX.
Corrected Exatape 160m XL.
Added Exatape 22m and 28m.
* DiscImageChef.Metadata/MediaType.cs:
Added 356mm magneto-optical media.
Changed ECMA-184 and ECMA-183 enums.
Added USB generic flash drive.
* DiscImageChef/Commands/DeviceInfo.cs:
Corrected SCSI INQUIRY naming.
Corrected SCSI MODE SENSE (6) parameters.
Reduced SCSI MODE SENSE timeout, some devices just get stuck
with unsupported MODE SENSE commanda and must be left to
timeout.
Changed FUJITSU vendor string comparison.
* DiscImageChef/Commands/MediaInfo.cs:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
Changed some error WriteLine() to debug ones. Too much
verbosity.
Added DVD media type decoding from PFI.
Found a drive that dumps ADIP, enabling it again (not
decoded).
* DiscImageChef/Commands/MediaScan.cs:
Added option to generate ImgBurn compatible log to
media-scan command.
* DiscImageChef/DiscImageChef.csproj:
Moved checksum generation to a separate class.
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Main.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Options.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
Added option to generate ImgBurn compatible log to media-scan
command.
2016-01-31 08:05:56 +00:00
|
|
|
|
return MediaType.ECMA_183;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 596787200:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.ECMA_184_512;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
case 654540800:
|
* DiscImageChef.CommonTypes/MediaTypeFromSCSI.cs:
* DiscImageChef.CommonTypes/DiscImageChef.CommonTypes.csproj:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
* DiscImageChef.Metadata/DeviceReport.cs:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DeviceReport.cs:
* DiscImageChef.Metadata/DiscImageChef.Metadata.csproj:
Added command to guess drive and media parameters and output
an XML report of them.
* DiscImageChef/Commands/DumpMedia.cs:
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Core/Checksum.cs:
* DiscImageChef/Commands/CreateSidecar.cs:
Moved checksum generation to a separate class.
* CICMMetadata:
Added support for ADIP.
* DiscImageChef.CommonTypes/MediaType.cs:
Added parameters of UDO media.
Moved DataPlay outside of Iomega, as it's not from that
manufacturer.
Added missing Exatape media and corrected 160m XL one.
Added SyJet media.
Added all ECMA defined magneto-optical (sectors calculated
from specifications, unchecked).
Added PD media.
Added Imation 320Gb RDX.
Added generic USB flash drives.
* DiscImageChef.Decoders/SCSI/Enums.cs:
Make enumerations public.
* DiscImageChef.Decoders/SCSI/Inquiry.cs:
* DiscImageChef.Devices/Device/Constructor.cs:
Trim space padded strings on SCSI INQUIRY.
* DiscImageChef.Devices/Device/ScsiCommands/MMC.cs:
Added PREVENT ALLOW MEDIUM REMOVAL.
Added START STOP UNIT.
* DiscImageChef.Devices/Device/ScsiCommands/NEC.cs:
Rename NEC methods.
* DiscImageChef.Devices/Device/ScsiCommands/Pioneer.cs:
Corrected Pioneer transfer length calculation.
* DiscImageChef.Devices/Device/ScsiCommands/Plextor.cs:
Renamed Plextor methods.
* DiscImageChef.Devices/Device/ScsiCommands/SPC.cs:
Renamed SSC PREVENT ALLOW MEDIUM REMOVAL to uncollide with
MMC same name but different command.
* DiscImageChef.Devices/DiscImageChef.Devices.csproj:
Set platform target to x86 (does it really matter?).
* DiscImageChef.Devices/Linux/Command.cs:
Reduced allocation for readlink() to current kernel
MAX_PATH.
* DiscImageChef.Devices/Linux/Enums.cs:
Modified Linux ioctl to 32-bit. Works on 64-bit also. Solves
commands not working on 32-bit environments.
* DiscImageChef.DiscImages/ZZZRawImage.cs:
Changed ECMA-184 and ECMA-183 enums.
* DiscImageChef.Metadata/Dimensions.cs:
Added all ECMA defined magneto-opticals.
Added PD media.
Added 320Gb RDX.
Corrected Exatape 160m XL.
Added Exatape 22m and 28m.
* DiscImageChef.Metadata/MediaType.cs:
Added 356mm magneto-optical media.
Changed ECMA-184 and ECMA-183 enums.
Added USB generic flash drive.
* DiscImageChef/Commands/DeviceInfo.cs:
Corrected SCSI INQUIRY naming.
Corrected SCSI MODE SENSE (6) parameters.
Reduced SCSI MODE SENSE timeout, some devices just get stuck
with unsupported MODE SENSE commanda and must be left to
timeout.
Changed FUJITSU vendor string comparison.
* DiscImageChef/Commands/MediaInfo.cs:
Added method to calculate MediaType from SCSI parameters
(mode, density, medium type, device type, etc).
Changed some error WriteLine() to debug ones. Too much
verbosity.
Added DVD media type decoding from PFI.
Found a drive that dumps ADIP, enabling it again (not
decoded).
* DiscImageChef/Commands/MediaScan.cs:
Added option to generate ImgBurn compatible log to
media-scan command.
* DiscImageChef/DiscImageChef.csproj:
Moved checksum generation to a separate class.
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Main.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
* DiscImageChef/Options.cs:
Added command to guess drive and media parameters and output
an XML report of them.
Added preliminary command to dump media. Only SCSI for now.
CDs and tapes are not supported. Errors are blalanty
ignored. Options are incomplete. Not yet usable.
Added option to generate ImgBurn compatible log to media-scan
command.
2016-01-31 08:05:56 +00:00
|
|
|
|
return MediaType.ECMA_184;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
default:
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return MediaType.GENERIC_HDD;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2014-08-25 05:00:25 +01:00
|
|
|
|
|
2014-08-24 17:46:29 +01:00
|
|
|
|
#endregion
|
2014-06-07 23:32:59 +01:00
|
|
|
|
|
|
|
|
|
|
#region Unsupported features
|
|
|
|
|
|
|
|
|
|
|
|
public override byte[] ReadSectorTag(UInt64 sectorAddress, SectorTagType tag)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override byte[] ReadSectorsTag(UInt64 sectorAddress, UInt32 length, SectorTagType tag)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override byte[] ReadSectorLong(UInt64 sectorAddress)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override byte[] ReadSectorsLong(UInt64 sectorAddress, UInt32 length)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
2016-04-19 02:11:47 +01:00
|
|
|
|
public override string GetImageVersion()
|
2014-06-07 23:32:59 +01:00
|
|
|
|
{
|
2014-08-28 19:29:18 +01:00
|
|
|
|
return ImageInfo.imageVersion;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2016-04-19 02:11:47 +01:00
|
|
|
|
public override string GetImageApplication()
|
2014-06-07 23:32:59 +01:00
|
|
|
|
{
|
2014-08-28 19:29:18 +01:00
|
|
|
|
return ImageInfo.imageApplication;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2016-04-19 02:11:47 +01:00
|
|
|
|
public override string GetImageApplicationVersion()
|
2014-06-07 23:32:59 +01:00
|
|
|
|
{
|
2014-08-28 19:29:18 +01:00
|
|
|
|
return ImageInfo.imageApplicationVersion;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2016-01-16 03:54:55 +00:00
|
|
|
|
public override byte[] ReadDiskTag(MediaTagType tag)
|
2014-06-07 23:32:59 +01:00
|
|
|
|
{
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string GetImageCreator()
|
|
|
|
|
|
{
|
2014-08-28 19:29:18 +01:00
|
|
|
|
return ImageInfo.imageCreator;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2016-04-19 02:11:47 +01:00
|
|
|
|
public override string GetImageComments()
|
2014-06-07 23:32:59 +01:00
|
|
|
|
{
|
2014-08-28 19:29:18 +01:00
|
|
|
|
return ImageInfo.imageComments;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2016-04-19 02:11:47 +01:00
|
|
|
|
public override string GetMediaManufacturer()
|
2014-06-07 23:32:59 +01:00
|
|
|
|
{
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return ImageInfo.mediaManufacturer;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2016-04-19 02:11:47 +01:00
|
|
|
|
public override string GetMediaModel()
|
2014-06-07 23:32:59 +01:00
|
|
|
|
{
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return ImageInfo.mediaModel;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2016-04-19 02:11:47 +01:00
|
|
|
|
public override string GetMediaSerialNumber()
|
2014-06-07 23:32:59 +01:00
|
|
|
|
{
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return ImageInfo.mediaSerialNumber;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2016-04-19 02:11:47 +01:00
|
|
|
|
public override string GetMediaBarcode()
|
2014-06-07 23:32:59 +01:00
|
|
|
|
{
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return ImageInfo.mediaBarcode;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2016-04-19 02:11:47 +01:00
|
|
|
|
public override string GetMediaPartNumber()
|
2014-06-07 23:32:59 +01:00
|
|
|
|
{
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return ImageInfo.mediaPartNumber;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2016-04-19 02:11:47 +01:00
|
|
|
|
public override int GetMediaSequence()
|
2014-06-07 23:32:59 +01:00
|
|
|
|
{
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return ImageInfo.mediaSequence;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2016-04-19 02:11:47 +01:00
|
|
|
|
public override int GetLastDiskSequence()
|
2014-06-07 23:32:59 +01:00
|
|
|
|
{
|
2016-01-16 03:54:55 +00:00
|
|
|
|
return ImageInfo.lastMediaSequence;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string GetDriveManufacturer()
|
|
|
|
|
|
{
|
2014-08-28 19:29:18 +01:00
|
|
|
|
return ImageInfo.driveManufacturer;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string GetDriveModel()
|
|
|
|
|
|
{
|
2014-08-28 19:29:18 +01:00
|
|
|
|
return ImageInfo.driveModel;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override string GetDriveSerialNumber()
|
|
|
|
|
|
{
|
2014-08-28 19:29:18 +01:00
|
|
|
|
return ImageInfo.driveSerialNumber;
|
2014-06-07 23:32:59 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2015-10-05 19:45:07 +01:00
|
|
|
|
public override List<CommonTypes.Partition> GetPartitions()
|
2014-06-07 23:32:59 +01:00
|
|
|
|
{
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override byte[] ReadSectorTag(UInt64 sectorAddress, UInt32 track, SectorTagType tag)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public override byte[] ReadSectorsTag(UInt64 sectorAddress, UInt32 length, UInt32 track, SectorTagType tag)
|
|
|
|
|
|
{
|
|
|
|
|
|
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endregion Unsupported features
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|