mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
* DiscImageChef.DiscImages/CDRDAO.cs:
Corrected typo on audio track matching. * DiscImageChef.DiscImages/CDRWin.cs: Corrected detection of images with CD-Text. Do not output partitions for index 0. * DiscImageChef.DiscImages/CopyQM.cs: Do not create debug image output. * DiscImageChef.DiscImages/Nero.cs: Added type for any dvd seen on old Nero version. Corrected handling of images where pregap is not indicated (nonetheless, Nero stores them). Corrected handling of track 1 (Lead-In is stored there). Corrected session count in discs with 1 session. Do not add partitions of index 0. Corrected partition start offset of disc start. Guess disc type for old Nero discs. Corrected output of Mode2 sectors stored in RAW mode. Do not throw exceptions on values that should be returned empty or null if not supported by image format. * DiscImageChef.Filesystems/FFS.cs: * DiscImageChef.Filesystems/BFS.cs: * DiscImageChef.Filesystems/ODS.cs: * DiscImageChef.Filesystems/FAT.cs: * DiscImageChef.Filesystems/APFS.cs: * DiscImageChef.Filesystems/NTFS.cs: * DiscImageChef.Filesystems/SysV.cs: * DiscImageChef.Filesystems/HPFS.cs: * DiscImageChef.Filesystems/Opera.cs: * DiscImageChef.Filesystems/Acorn.cs: * DiscImageChef.Filesystems/extFS.cs: * DiscImageChef.Filesystems/BTRFS.cs: * DiscImageChef.Filesystems/ext2FS.cs: * DiscImageChef.Filesystems/ProDOS.cs: * DiscImageChef.Filesystems/SolarFS.cs: * DiscImageChef.Filesystems/UNIXBFS.cs: * DiscImageChef.Filesystems/ISO9660.cs: * DiscImageChef.Filesystems/MinixFS.cs: * DiscImageChef.Filesystems/AmigaDOS.cs: * DiscImageChef.Filesystems/PCEngine.cs: * DiscImageChef.Filesystems/AppleHFS.cs: * DiscImageChef.Filesystems/AppleHFSPlus.cs: * DiscImageChef.Filesystems/AppleMFS/Info.cs: Do not try to read past partition end. * DiscImageChef/Commands/CreateSidecar.cs: Added points for skipping whole image checksum on debugging. Track starts at index 0.
This commit is contained in:
@@ -571,7 +571,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
ulong startSectors = 0;
|
||||
|
||||
if(MatchFile.Groups["start"].Value != "")
|
||||
if(MatchAudioFile.Groups["start"].Value != "")
|
||||
{
|
||||
string[] startString = MatchAudioFile.Groups["start"].Value.Split(new char[] { ':' });
|
||||
startSectors = ulong.Parse(startString[0]) * 60 * 75 + ulong.Parse(startString[1]) * 75 + ulong.Parse(startString[2]);
|
||||
@@ -579,7 +579,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
currenttrack.trackfile.offset += (startSectors * currenttrack.bps);
|
||||
|
||||
if(MatchFile.Groups["length"].Value != "")
|
||||
if(MatchAudioFile.Groups["length"].Value != "")
|
||||
{
|
||||
string[] lengthString = MatchAudioFile.Groups["length"].Value.Split(new char[] { ':' });
|
||||
currenttrack.sectors = ulong.Parse(lengthString[0]) * 60 * 75 + ulong.Parse(lengthString[1]) * 75 + ulong.Parse(lengthString[2]);
|
||||
|
||||
@@ -326,19 +326,22 @@ namespace DiscImageChef.ImagePlugins
|
||||
Regex Rr = new Regex(CommentRegEx);
|
||||
Regex Cr = new Regex(MCNRegEx);
|
||||
Regex Fr = new Regex(FileRegEx);
|
||||
Regex Tr = new Regex(CDTextRegEx);
|
||||
|
||||
Match Sm;
|
||||
Match Rm;
|
||||
Match Cm;
|
||||
Match Fm;
|
||||
Match Tm;
|
||||
|
||||
// First line must be SESSION, REM, CATALOG or FILE.
|
||||
// First line must be SESSION, REM, CATALOG, FILE or CDTEXTFILE.
|
||||
Sm = Sr.Match(_line);
|
||||
Rm = Rr.Match(_line);
|
||||
Cm = Cr.Match(_line);
|
||||
Fm = Fr.Match(_line);
|
||||
Tm = Tr.Match(_line);
|
||||
|
||||
if(!Sm.Success && !Rm.Success && !Cm.Success && !Fm.Success)
|
||||
if(!Sm.Success && !Rm.Success && !Cm.Success && !Fm.Success && !Tm.Success)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -1062,7 +1065,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
Partition partition = new Partition();
|
||||
|
||||
if(discimage.tracks[i].pregap > 0)
|
||||
/*if(discimage.tracks[i].pregap > 0)
|
||||
{
|
||||
partition.PartitionDescription = string.Format("Track {0} pregap.", discimage.tracks[i].sequence);
|
||||
partition.PartitionName = discimage.tracks[i].title;
|
||||
@@ -1093,14 +1096,14 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
partitions.Add(partition);
|
||||
partition = new Partition();
|
||||
}
|
||||
}*/
|
||||
|
||||
index_zero |= discimage.tracks[i].indexes.TryGetValue(0, out index_zero_offset);
|
||||
|
||||
if(!discimage.tracks[i].indexes.TryGetValue(1, out index_one_offset))
|
||||
throw new ImageNotSupportedException(string.Format("Track {0} lacks index 01", discimage.tracks[i].sequence));
|
||||
|
||||
if(index_zero && index_one_offset > index_zero_offset)
|
||||
/*if(index_zero && index_one_offset > index_zero_offset)
|
||||
{
|
||||
partition.PartitionDescription = string.Format("Track {0} index 00.", discimage.tracks[i].sequence);
|
||||
partition.PartitionName = discimage.tracks[i].title;
|
||||
@@ -1132,7 +1135,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
partitions.Add(partition);
|
||||
partition = new Partition();
|
||||
}
|
||||
}*/
|
||||
|
||||
// Index 01
|
||||
partition.PartitionDescription = string.Format("Track {0}.", discimage.tracks[i].sequence);
|
||||
|
||||
@@ -1,3 +1,25 @@
|
||||
2016-08-08 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* CDRDAO.cs: Corrected typo on audio track matching.
|
||||
|
||||
* CDRWin.cs: Corrected detection of images with CD-Text.
|
||||
Do not output partitions for index 0.
|
||||
|
||||
|
||||
* CopyQM.cs: Do not create debug image output.
|
||||
|
||||
* Nero.cs: Added type for any dvd seen on old Nero version.
|
||||
Corrected handling of images where pregap is not indicated
|
||||
(nonetheless, Nero stores them).
|
||||
Corrected handling of track 1 (Lead-In is stored there).
|
||||
Corrected session count in discs with 1 session.
|
||||
Do not add partitions of index 0.
|
||||
Corrected partition start offset of disc start.
|
||||
Guess disc type for old Nero discs.
|
||||
Corrected output of Mode2 sectors stored in RAW mode.
|
||||
Do not throw exceptions on values that should be returned
|
||||
empty or null if not supported by image format.
|
||||
|
||||
2016-08-07 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* DiscImageChef.DiscImages.csproj: Public beta release
|
||||
|
||||
@@ -300,9 +300,9 @@ namespace DiscImageChef.ImagePlugins
|
||||
decodedImage.Write(filling, 0, filling.Length);
|
||||
}
|
||||
|
||||
/*FileStream debugStream = new FileStream("debug.img", FileMode.CreateNew, FileAccess.ReadWrite);
|
||||
FileStream debugStream = new FileStream("debug.img", FileMode.CreateNew, FileAccess.ReadWrite);
|
||||
debugStream.Write(decodedImage.ToArray(), 0, (int)decodedImage.Length);
|
||||
debugStream.Close();*/
|
||||
debugStream.Close();
|
||||
|
||||
int sum = 0;
|
||||
for(int i = 0; i < hdr.Length - 1; i++)
|
||||
|
||||
@@ -824,6 +824,10 @@ namespace DiscImageChef.ImagePlugins
|
||||
/// Any HD DVD
|
||||
/// </summary>
|
||||
NERO_MTYP_HD_DVD_ANY = NERO_MTYP_HD_DVD | NERO_MTYP_HD_DVD_ROM,
|
||||
/// <summary>
|
||||
/// Any DVD, old
|
||||
/// </summary>
|
||||
NERO_MTYP_DVD_ANY_OLD = NERO_MTYP_DVD_M | NERO_MTYP_DVD_P | NERO_MTYP_DVD_RAM,
|
||||
}
|
||||
|
||||
#endregion
|
||||
@@ -1119,6 +1123,8 @@ namespace DiscImageChef.ImagePlugins
|
||||
ImageInfo.sectorSize = _entry.SectorSize;
|
||||
|
||||
TrackISRCs.Add(currenttrack, _entry.ISRC);
|
||||
if(currenttrack == 1)
|
||||
_entry.Index0 = _entry.Index1;
|
||||
|
||||
NeroTrack _neroTrack = new NeroTrack();
|
||||
_neroTrack.EndOfTrack = _entry.EndOfTrack;
|
||||
@@ -1203,6 +1209,9 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
TrackISRCs.Add(currenttrack, _entry.ISRC);
|
||||
|
||||
if(currenttrack == 1)
|
||||
_entry.Index0 = _entry.Index1;
|
||||
|
||||
NeroTrack _neroTrack = new NeroTrack();
|
||||
_neroTrack.EndOfTrack = _entry.EndOfTrack;
|
||||
_neroTrack.ISRC = _entry.ISRC;
|
||||
@@ -1507,6 +1516,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
uint currentsessioncurrenttrack = 1;
|
||||
Session currentsessionstruct = new Session();
|
||||
ulong PartitionSequence = 0;
|
||||
ulong partitionStartByte = 0;
|
||||
for(uint i = 1; i <= neroTracks.Count; i++)
|
||||
{
|
||||
NeroTrack _neroTrack;
|
||||
@@ -1517,19 +1527,21 @@ namespace DiscImageChef.ImagePlugins
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\tcurrentsessioncurrenttrack = {0}", currentsessioncurrenttrack);
|
||||
|
||||
Track _track = new Track();
|
||||
if(_neroTrack.Sequence == 1)
|
||||
_neroTrack.Index0 = _neroTrack.Index1;
|
||||
|
||||
_track.Indexes = new Dictionary<int, ulong>();
|
||||
if(_neroTrack.Index0 < _neroTrack.Index1)
|
||||
_track.Indexes.Add(0, _neroTrack.Index0 / _neroTrack.SectorSize);
|
||||
_track.Indexes.Add(1, _neroTrack.Index1 / _neroTrack.SectorSize);
|
||||
_track.TrackDescription = StringHandlers.CToString(_neroTrack.ISRC);
|
||||
_track.TrackEndSector = (_neroTrack.EndOfTrack / _neroTrack.SectorSize) - 1;
|
||||
_track.TrackEndSector = (_neroTrack.Length / _neroTrack.SectorSize) + _neroTrack.StartLBA - 1;
|
||||
_track.TrackPregap = (_neroTrack.Index1 - _neroTrack.Index0) / _neroTrack.SectorSize;
|
||||
_track.TrackSequence = _neroTrack.Sequence;
|
||||
_track.TrackSession = currentsession;
|
||||
_track.TrackStartSector = _neroTrack.StartLBA;
|
||||
_track.TrackType = NeroTrackModeToTrackType((DAOMode)_neroTrack.Mode);
|
||||
imageTracks.Add(_track);
|
||||
_track.TrackFile = _imagePath;
|
||||
_track.TrackFile = imagePath;
|
||||
_track.TrackFileOffset = _neroTrack.Offset;
|
||||
_track.TrackFileType = "BINARY";
|
||||
_track.TrackSubchannelType = TrackSubchannelType.None;
|
||||
@@ -1579,6 +1591,8 @@ namespace DiscImageChef.ImagePlugins
|
||||
_track.TrackSubchannelOffset = _neroTrack.Offset;
|
||||
}
|
||||
|
||||
imageTracks.Add(_track);
|
||||
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t\t _track.TrackDescription = {0}", _track.TrackDescription);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t\t _track.TrackEndSector = {0}", _track.TrackEndSector);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t\t _track.TrackPregap = {0}", _track.TrackPregap);
|
||||
@@ -1605,12 +1619,21 @@ namespace DiscImageChef.ImagePlugins
|
||||
imageSessions.Add(currentsessionstruct);
|
||||
}
|
||||
|
||||
if(i == neroTracks.Count)
|
||||
{
|
||||
neroSessions.TryGetValue(currentsession, out currentsessionmaxtrack);
|
||||
currentsessioncurrenttrack = 1;
|
||||
currentsessionstruct.EndTrack = _track.TrackSequence;
|
||||
currentsessionstruct.EndSector = _track.TrackEndSector;
|
||||
imageSessions.Add(currentsessionstruct);
|
||||
}
|
||||
|
||||
offsetmap.Add(_track.TrackSequence, _track.TrackStartSector);
|
||||
DicConsole.DebugWriteLine("Nero plugin", "\t\t Offset[{0}]: {1}", _track.TrackSequence, _track.TrackStartSector);
|
||||
|
||||
Partition partition;
|
||||
|
||||
if(_neroTrack.Index0 < _neroTrack.Index1)
|
||||
/*if(_neroTrack.Index0 < _neroTrack.Index1)
|
||||
{
|
||||
partition = new Partition();
|
||||
partition.PartitionDescription = string.Format("Track {0} Index 0", _track.TrackSequence);
|
||||
@@ -1623,7 +1646,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
partition.PartitionType = NeroTrackModeToTrackType((DAOMode)_neroTrack.Mode).ToString();
|
||||
ImagePartitions.Add(partition);
|
||||
PartitionSequence++;
|
||||
}
|
||||
}*/
|
||||
|
||||
partition = new Partition();
|
||||
partition.PartitionDescription = string.Format("Track {0} Index 1", _track.TrackSequence);
|
||||
@@ -1631,17 +1654,64 @@ namespace DiscImageChef.ImagePlugins
|
||||
partition.PartitionName = StringHandlers.CToString(_neroTrack.ISRC);
|
||||
partition.PartitionSectors = partition.PartitionLength / _neroTrack.SectorSize;
|
||||
partition.PartitionSequence = PartitionSequence;
|
||||
partition.PartitionStart = _neroTrack.Index1;
|
||||
partition.PartitionStart = partitionStartByte;
|
||||
partition.PartitionStartSector = _neroTrack.StartLBA + ((_neroTrack.Index1 - _neroTrack.Index0) / _neroTrack.SectorSize);
|
||||
partition.PartitionType = NeroTrackModeToTrackType((DAOMode)_neroTrack.Mode).ToString();
|
||||
ImagePartitions.Add(partition);
|
||||
PartitionSequence++;
|
||||
partitionStartByte += partition.PartitionLength;
|
||||
}
|
||||
}
|
||||
|
||||
_imagePath = imagePath;
|
||||
imageStream.Close();
|
||||
|
||||
if(ImageInfo.mediaType == MediaType.Unknown || ImageInfo.mediaType == MediaType.CD)
|
||||
{
|
||||
bool data = false;
|
||||
bool mode2 = false;
|
||||
bool firstaudio = false;
|
||||
bool firstdata = false;
|
||||
bool audio = false;
|
||||
|
||||
for(uint i = 0; i < neroTracks.Count; i++)
|
||||
{
|
||||
// First track is audio
|
||||
firstaudio |= i == 0 && ((DAOMode)neroTracks[i].Mode == DAOMode.Audio || (DAOMode)neroTracks[i].Mode == DAOMode.AudioSub);
|
||||
|
||||
// First track is data
|
||||
firstdata |= i == 0 && ((DAOMode)neroTracks[i].Mode != DAOMode.Audio && (DAOMode)neroTracks[i].Mode != DAOMode.AudioSub);
|
||||
|
||||
// Any non first track is data
|
||||
data |= i != 0 && ((DAOMode)neroTracks[i].Mode != DAOMode.Audio && (DAOMode)neroTracks[i].Mode != DAOMode.AudioSub);
|
||||
|
||||
// Any non first track is audio
|
||||
audio |= i != 0 && ((DAOMode)neroTracks[i].Mode == DAOMode.Audio || (DAOMode)neroTracks[i].Mode == DAOMode.AudioSub);
|
||||
|
||||
switch((DAOMode)neroTracks[i].Mode)
|
||||
{
|
||||
case DAOMode.DataM2F1:
|
||||
case DAOMode.DataM2F2:
|
||||
case DAOMode.DataM2Raw:
|
||||
case DAOMode.DataM2RawSub:
|
||||
mode2 = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!data && !firstdata)
|
||||
ImageInfo.mediaType = MediaType.CDDA;
|
||||
else if(firstaudio && data && imageSessions.Count > 1 && mode2)
|
||||
ImageInfo.mediaType = MediaType.CDPLUS;
|
||||
else if((firstdata && audio) || mode2)
|
||||
ImageInfo.mediaType = MediaType.CDROMXA;
|
||||
else if(!audio)
|
||||
ImageInfo.mediaType = MediaType.CDROM;
|
||||
else
|
||||
ImageInfo.mediaType = MediaType.CD;
|
||||
}
|
||||
|
||||
|
||||
ImageInfo.xmlMediaType = XmlMediaType.OpticalDisc;
|
||||
|
||||
return true;
|
||||
@@ -1754,7 +1824,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
throw new ArgumentOutOfRangeException(nameof(track), "Track not found");
|
||||
|
||||
if(length > _track.Sectors)
|
||||
throw new ArgumentOutOfRangeException(nameof(length), "Requested more sectors than present in track, won't cross tracks");
|
||||
throw new ArgumentOutOfRangeException(nameof(length), string.Format("Requested more sectors ({0}) than present in track ({1}), won't cross tracks", length, _track.Sectors));
|
||||
|
||||
uint sector_offset;
|
||||
uint sector_size;
|
||||
@@ -1793,9 +1863,9 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
case DAOMode.DataM2Raw:
|
||||
{
|
||||
sector_offset = 24;
|
||||
sector_size = 2324;
|
||||
sector_skip = 4;
|
||||
sector_offset = 16;
|
||||
sector_size = 2336;
|
||||
sector_skip = 0;
|
||||
break;
|
||||
}
|
||||
// TODO: Supposing Nero suffixes the subchannel to the channel
|
||||
@@ -1808,9 +1878,9 @@ namespace DiscImageChef.ImagePlugins
|
||||
}
|
||||
case DAOMode.DataM2RawSub:
|
||||
{
|
||||
sector_offset = 24;
|
||||
sector_size = 2324;
|
||||
sector_skip = 4 + 96;
|
||||
sector_offset = 16;
|
||||
sector_size = 2336;
|
||||
sector_skip = 96;
|
||||
break;
|
||||
}
|
||||
case DAOMode.AudioSub:
|
||||
@@ -1857,7 +1927,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
throw new ArgumentOutOfRangeException(nameof(track), "Track not found");
|
||||
|
||||
if(length > _track.Sectors)
|
||||
throw new ArgumentOutOfRangeException(nameof(length), "Requested more sectors than present in track, won't cross tracks");
|
||||
throw new ArgumentOutOfRangeException(nameof(length), string.Format("Requested more sectors ({0}) than present in track ({1}), won't cross tracks", length, _track.Sectors));
|
||||
|
||||
uint sector_offset;
|
||||
uint sector_size;
|
||||
@@ -2123,7 +2193,7 @@ namespace DiscImageChef.ImagePlugins
|
||||
throw new ArgumentOutOfRangeException(nameof(track), "Track not found");
|
||||
|
||||
if(length > _track.Sectors)
|
||||
throw new ArgumentOutOfRangeException(nameof(length), "Requested more sectors than present in track, won't cross tracks");
|
||||
throw new ArgumentOutOfRangeException(nameof(length), string.Format("Requested more sectors ({0}) than present in track ({1}), won't cross tracks", length, _track.Sectors));
|
||||
|
||||
uint sector_offset;
|
||||
uint sector_size;
|
||||
@@ -2368,6 +2438,9 @@ namespace DiscImageChef.ImagePlugins
|
||||
case NeroMediaTypes.NERO_MTYP_CDR:
|
||||
return MediaType.CDR;
|
||||
case NeroMediaTypes.NERO_MTYP_DVD_ROM:
|
||||
case NeroMediaTypes.NERO_MTYP_DVD_ANY:
|
||||
case NeroMediaTypes.NERO_MTYP_DVD_ANY_R9:
|
||||
case NeroMediaTypes.NERO_MTYP_DVD_ANY_OLD:
|
||||
return MediaType.DVDROM;
|
||||
case NeroMediaTypes.NERO_MTYP_CDROM:
|
||||
return MediaType.CDROM;
|
||||
@@ -2451,62 +2524,62 @@ namespace DiscImageChef.ImagePlugins
|
||||
|
||||
public override int GetMediaSequence()
|
||||
{
|
||||
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
||||
return ImageInfo.mediaSequence;
|
||||
}
|
||||
|
||||
public override int GetLastDiskSequence()
|
||||
{
|
||||
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
||||
return ImageInfo.lastMediaSequence;
|
||||
}
|
||||
|
||||
public override string GetDriveManufacturer()
|
||||
{
|
||||
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
||||
return ImageInfo.driveManufacturer;
|
||||
}
|
||||
|
||||
public override string GetDriveModel()
|
||||
{
|
||||
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
||||
return ImageInfo.driveModel;
|
||||
}
|
||||
|
||||
public override string GetDriveSerialNumber()
|
||||
{
|
||||
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
||||
return ImageInfo.driveSerialNumber;
|
||||
}
|
||||
|
||||
public override string GetMediaPartNumber()
|
||||
{
|
||||
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
||||
return ImageInfo.mediaPartNumber;
|
||||
}
|
||||
|
||||
public override string GetMediaManufacturer()
|
||||
{
|
||||
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
||||
return ImageInfo.mediaManufacturer;
|
||||
}
|
||||
|
||||
public override string GetMediaModel()
|
||||
{
|
||||
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
||||
return ImageInfo.mediaModel;
|
||||
}
|
||||
|
||||
public override string GetImageName()
|
||||
{
|
||||
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
||||
return ImageInfo.imageName;
|
||||
}
|
||||
|
||||
public override string GetImageCreator()
|
||||
{
|
||||
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
||||
return ImageInfo.imageCreator;
|
||||
}
|
||||
|
||||
public override string GetImageComments()
|
||||
{
|
||||
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
||||
return ImageInfo.imageComments;
|
||||
}
|
||||
|
||||
public override string GetMediaSerialNumber()
|
||||
{
|
||||
throw new FeatureUnsupportedImageException("Feature not supported by image format");
|
||||
return ImageInfo.mediaSerialNumber;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
|
||||
{
|
||||
if(partitionStart >= imagePlugin.GetSectors())
|
||||
if(partitionStart >= partitionEnd)
|
||||
return false;
|
||||
|
||||
byte[] sector = imagePlugin.ReadSector(partitionStart);
|
||||
@@ -97,7 +97,7 @@ namespace DiscImageChef.Filesystems
|
||||
xmlFSType = new Schemas.FileSystemType();
|
||||
information = "";
|
||||
|
||||
if(partitionStart >= imagePlugin.GetSectors())
|
||||
if(partitionStart >= partitionEnd)
|
||||
return;
|
||||
|
||||
byte[] sector = imagePlugin.ReadSector(partitionStart);
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
|
||||
{
|
||||
if(partitionStart >= imagePlugin.GetSectors())
|
||||
if(partitionStart >= partitionEnd)
|
||||
return false;
|
||||
|
||||
ulong sbSector;
|
||||
|
||||
@@ -184,7 +184,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
|
||||
{
|
||||
if(partitionStart >= imagePlugin.GetSectors())
|
||||
if(partitionStart >= partitionEnd)
|
||||
return false;
|
||||
|
||||
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
|
||||
@@ -204,7 +204,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
DicConsole.DebugWriteLine("AmigaDOS plugin", "Nonetheless, going to block {0} for Rootblock", root_ptr);
|
||||
|
||||
if(root_ptr >= imagePlugin.GetSectors())
|
||||
if(root_ptr >= partitionEnd)
|
||||
return false;
|
||||
|
||||
sector = imagePlugin.ReadSector(root_ptr);
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
|
||||
{
|
||||
if((2 + partitionStart) >= imagePlugin.GetSectors())
|
||||
if((2 + partitionStart) >= partitionEnd)
|
||||
return false;
|
||||
|
||||
byte[] mdb_sector;
|
||||
|
||||
@@ -66,7 +66,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
|
||||
{
|
||||
if((2 + partitionStart) >= imagePlugin.GetSectors())
|
||||
if((2 + partitionStart) >= partitionEnd)
|
||||
return false;
|
||||
|
||||
ushort drSigWord;
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace DiscImageChef.Filesystems.AppleMFS
|
||||
{
|
||||
ushort drSigWord;
|
||||
|
||||
if((2 + partitionStart) >= imagePlugin.GetSectors())
|
||||
if((2 + partitionStart) >= partitionEnd)
|
||||
return false;
|
||||
|
||||
byte[] mdb_sector = imagePlugin.ReadSector(2 + partitionStart);
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
|
||||
{
|
||||
if((2 + partitionStart) >= imagePlugin.GetSectors())
|
||||
if((2 + partitionStart) >= partitionEnd)
|
||||
return false;
|
||||
|
||||
uint magic;
|
||||
|
||||
@@ -120,13 +120,13 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
|
||||
{
|
||||
if(partitionStart >= imagePlugin.GetSectors())
|
||||
if(partitionStart >= partitionEnd)
|
||||
return false;
|
||||
|
||||
ulong sbSectorOff = 0x10000 / imagePlugin.GetSectorSize();
|
||||
uint sbSectorSize = 0x1000 / imagePlugin.GetSectorSize();
|
||||
|
||||
if((sbSectorOff + sbSectorSize) >= imagePlugin.GetSectors())
|
||||
if((sbSectorOff + sbSectorSize) >= partitionEnd)
|
||||
return false;
|
||||
|
||||
byte[] sector = imagePlugin.ReadSectors(sbSectorOff + partitionStart, sbSectorSize);
|
||||
|
||||
@@ -1,3 +1,29 @@
|
||||
2016-08-08 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* FFS.cs:
|
||||
* BFS.cs:
|
||||
* ODS.cs:
|
||||
* FAT.cs:
|
||||
* APFS.cs:
|
||||
* NTFS.cs:
|
||||
* SysV.cs:
|
||||
* HPFS.cs:
|
||||
* Opera.cs:
|
||||
* Acorn.cs:
|
||||
* extFS.cs:
|
||||
* BTRFS.cs:
|
||||
* ext2FS.cs:
|
||||
* ProDOS.cs:
|
||||
* SolarFS.cs:
|
||||
* UNIXBFS.cs:
|
||||
* ISO9660.cs:
|
||||
* MinixFS.cs:
|
||||
* AmigaDOS.cs:
|
||||
* PCEngine.cs:
|
||||
* AppleHFS.cs:
|
||||
* AppleHFSPlus.cs:
|
||||
* Info.cs: Do not try to read past partition end.
|
||||
|
||||
2016-08-07 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* DiscImageChef.Filesystems.csproj: Public beta release
|
||||
|
||||
@@ -55,7 +55,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
|
||||
{
|
||||
if((2 + partitionStart) >= imagePlugin.GetSectors())
|
||||
if((2 + partitionStart) >= partitionEnd)
|
||||
return false;
|
||||
|
||||
byte media_descriptor; // Not present on DOS <= 3, present on TOS but != of first FAT entry
|
||||
@@ -78,7 +78,7 @@ namespace DiscImageChef.Filesystems
|
||||
rsectors = BitConverter.ToUInt16(bpb_sector, 0x00E); // Sectors between BPB and FAT, including the BPB sector => [BPB,FAT)
|
||||
if(rsectors == 0)
|
||||
rsectors = 1;
|
||||
if(imagePlugin.GetSectors() > (rsectors + partitionStart))
|
||||
if(partitionEnd > (rsectors + partitionStart))
|
||||
fat_sector = imagePlugin.ReadSector(rsectors + partitionStart); // First FAT entry
|
||||
else
|
||||
bpb_found = false;
|
||||
@@ -200,7 +200,7 @@ namespace DiscImageChef.Filesystems
|
||||
rsectors = BitConverter.ToUInt16(bpb_sector, 0x00E); // Sectors between BPB and FAT, including the BPB sector => [BPB,FAT)
|
||||
if(rsectors == 0)
|
||||
rsectors = 1;
|
||||
if(imagePlugin.GetSectors() > (rsectors + partitionStart))
|
||||
if(partitionEnd > (rsectors + partitionStart))
|
||||
fat_sector = imagePlugin.ReadSector(rsectors + partitionStart); // First FAT entry
|
||||
else
|
||||
bpb_found = false;
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
|
||||
{
|
||||
if((2 + partitionStart) >= imagePlugin.GetSectors())
|
||||
if((2 + partitionStart) >= partitionEnd)
|
||||
return false;
|
||||
|
||||
uint magic;
|
||||
@@ -66,7 +66,7 @@ namespace DiscImageChef.Filesystems
|
||||
else
|
||||
sb_size_in_sectors = block_size / imagePlugin.GetSectorSize();
|
||||
|
||||
if(imagePlugin.GetSectors() > (partitionStart + sb_start_floppy * sb_size_in_sectors + sb_size_in_sectors))
|
||||
if(partitionEnd > (partitionStart + sb_start_floppy * sb_size_in_sectors + sb_size_in_sectors))
|
||||
{
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partitionStart + sb_start_floppy * sb_size_in_sectors, sb_size_in_sectors);
|
||||
magic = BigEndianBitConverter.ToUInt32(ufs_sb_sectors, 0x055C);
|
||||
@@ -75,7 +75,7 @@ namespace DiscImageChef.Filesystems
|
||||
return true;
|
||||
}
|
||||
|
||||
if(imagePlugin.GetSectors() > (partitionStart + sb_start_ufs1 * sb_size_in_sectors + sb_size_in_sectors))
|
||||
if(partitionEnd > (partitionStart + sb_start_ufs1 * sb_size_in_sectors + sb_size_in_sectors))
|
||||
{
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partitionStart + sb_start_ufs1 * sb_size_in_sectors, sb_size_in_sectors);
|
||||
magic = BigEndianBitConverter.ToUInt32(ufs_sb_sectors, 0x055C);
|
||||
@@ -84,7 +84,7 @@ namespace DiscImageChef.Filesystems
|
||||
return true;
|
||||
}
|
||||
|
||||
if(imagePlugin.GetSectors() > (partitionStart + sb_start_ufs2 * sb_size_in_sectors + sb_size_in_sectors))
|
||||
if(partitionEnd > (partitionStart + sb_start_ufs2 * sb_size_in_sectors + sb_size_in_sectors))
|
||||
{
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partitionStart + sb_start_ufs2 * sb_size_in_sectors, sb_size_in_sectors);
|
||||
magic = BigEndianBitConverter.ToUInt32(ufs_sb_sectors, 0x055C);
|
||||
@@ -93,7 +93,7 @@ namespace DiscImageChef.Filesystems
|
||||
return true;
|
||||
}
|
||||
|
||||
if(imagePlugin.GetSectors() > (partitionStart + sb_start_piggy * sb_size_in_sectors + sb_size_in_sectors))
|
||||
if(partitionEnd > (partitionStart + sb_start_piggy * sb_size_in_sectors + sb_size_in_sectors))
|
||||
{
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partitionStart + sb_start_piggy * sb_size_in_sectors, sb_size_in_sectors);
|
||||
magic = BigEndianBitConverter.ToUInt32(ufs_sb_sectors, 0x055C);
|
||||
@@ -102,7 +102,7 @@ namespace DiscImageChef.Filesystems
|
||||
return true;
|
||||
}
|
||||
|
||||
if(imagePlugin.GetSectors() > (partitionStart + sb_start_atari / imagePlugin.GetSectorSize() + sb_size_in_sectors))
|
||||
if(partitionEnd > (partitionStart + sb_start_atari / imagePlugin.GetSectorSize() + sb_size_in_sectors))
|
||||
{
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partitionStart + (sb_start_atari / imagePlugin.GetSectorSize()), sb_size_in_sectors);
|
||||
magic = BigEndianBitConverter.ToUInt32(ufs_sb_sectors, 0x055C);
|
||||
@@ -136,7 +136,7 @@ namespace DiscImageChef.Filesystems
|
||||
else
|
||||
sb_size_in_sectors = block_size / imagePlugin.GetSectorSize();
|
||||
|
||||
if(imagePlugin.GetSectors() > (partitionStart + sb_start_floppy * sb_size_in_sectors + sb_size_in_sectors) && magic == 0)
|
||||
if(partitionEnd > (partitionStart + sb_start_floppy * sb_size_in_sectors + sb_size_in_sectors) && magic == 0)
|
||||
{
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partitionStart + sb_start_floppy * sb_size_in_sectors, sb_size_in_sectors);
|
||||
magic = BigEndianBitConverter.ToUInt32(ufs_sb_sectors, 0x055C);
|
||||
@@ -147,7 +147,7 @@ namespace DiscImageChef.Filesystems
|
||||
magic = 0;
|
||||
}
|
||||
|
||||
if(imagePlugin.GetSectors() > (partitionStart + sb_start_ufs1 * sb_size_in_sectors + sb_size_in_sectors) && magic == 0)
|
||||
if(partitionEnd > (partitionStart + sb_start_ufs1 * sb_size_in_sectors + sb_size_in_sectors) && magic == 0)
|
||||
{
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partitionStart + sb_start_ufs1 * sb_size_in_sectors, sb_size_in_sectors);
|
||||
magic = BigEndianBitConverter.ToUInt32(ufs_sb_sectors, 0x055C);
|
||||
@@ -158,7 +158,7 @@ namespace DiscImageChef.Filesystems
|
||||
magic = 0;
|
||||
}
|
||||
|
||||
if(imagePlugin.GetSectors() > (partitionStart + sb_start_ufs2 * sb_size_in_sectors + sb_size_in_sectors) && magic == 0)
|
||||
if(partitionEnd > (partitionStart + sb_start_ufs2 * sb_size_in_sectors + sb_size_in_sectors) && magic == 0)
|
||||
{
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partitionStart + sb_start_ufs2 * sb_size_in_sectors, sb_size_in_sectors);
|
||||
magic = BigEndianBitConverter.ToUInt32(ufs_sb_sectors, 0x055C);
|
||||
@@ -169,7 +169,7 @@ namespace DiscImageChef.Filesystems
|
||||
magic = 0;
|
||||
}
|
||||
|
||||
if(imagePlugin.GetSectors() > (partitionStart + sb_start_piggy * sb_size_in_sectors + sb_size_in_sectors) && magic == 0)
|
||||
if(partitionEnd > (partitionStart + sb_start_piggy * sb_size_in_sectors + sb_size_in_sectors) && magic == 0)
|
||||
{
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partitionStart + sb_start_piggy * sb_size_in_sectors, sb_size_in_sectors);
|
||||
magic = BigEndianBitConverter.ToUInt32(ufs_sb_sectors, 0x055C);
|
||||
@@ -180,7 +180,7 @@ namespace DiscImageChef.Filesystems
|
||||
magic = 0;
|
||||
}
|
||||
|
||||
if(imagePlugin.GetSectors() > (partitionStart + sb_start_atari / imagePlugin.GetSectorSize() + sb_size_in_sectors) && magic == 0)
|
||||
if(partitionEnd > (partitionStart + sb_start_atari / imagePlugin.GetSectorSize() + sb_size_in_sectors) && magic == 0)
|
||||
{
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partitionStart + sb_start_atari / imagePlugin.GetSectorSize(), sb_size_in_sectors);
|
||||
magic = BigEndianBitConverter.ToUInt32(ufs_sb_sectors, 0x055C);
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
|
||||
{
|
||||
if((2 + partitionStart) >= imagePlugin.GetSectors())
|
||||
if((2 + partitionStart) >= partitionEnd)
|
||||
return false;
|
||||
|
||||
if(imagePlugin.ImageInfo.sectors <= 16)
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace DiscImageChef.Filesystems
|
||||
return false;
|
||||
|
||||
// ISO9660 Primary Volume Descriptor starts at sector 16, so that's minimal size.
|
||||
if(imagePlugin.GetSectors() <= (16 + partitionStart))
|
||||
if(partitionEnd <= (16 + partitionStart))
|
||||
return false;
|
||||
|
||||
// Read to Volume Descriptor
|
||||
@@ -157,7 +157,7 @@ namespace DiscImageChef.Filesystems
|
||||
return;
|
||||
|
||||
// ISO9660 Primary Volume Descriptor starts at sector 16, so that's minimal size.
|
||||
if(imagePlugin.GetSectors() < 16)
|
||||
if(partitionEnd < 16)
|
||||
return;
|
||||
|
||||
ulong counter = 0;
|
||||
@@ -287,7 +287,7 @@ namespace DiscImageChef.Filesystems
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "VDPathTableStart = {0} + {1} = {2}", i, partitionStart, i + partitionStart);
|
||||
|
||||
// TODO: Check this
|
||||
if((i + partitionStart) < imagePlugin.GetSectors())
|
||||
if((i + partitionStart) < partitionEnd)
|
||||
{
|
||||
|
||||
byte[] path_table = imagePlugin.ReadSector(i + partitionStart);
|
||||
|
||||
@@ -75,7 +75,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
|
||||
{
|
||||
if((2 + partitionStart) >= imagePlugin.GetSectors())
|
||||
if((2 + partitionStart) >= partitionEnd)
|
||||
return false;
|
||||
|
||||
ushort magic;
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
|
||||
{
|
||||
if((2 + partitionStart) >= imagePlugin.GetSectors())
|
||||
if((2 + partitionStart) >= partitionEnd)
|
||||
return false;
|
||||
|
||||
byte[] eigth_bytes = new byte[8];
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
|
||||
{
|
||||
if((2 + partitionStart) >= imagePlugin.GetSectors())
|
||||
if((2 + partitionStart) >= partitionEnd)
|
||||
return false;
|
||||
|
||||
if(imagePlugin.GetSectorSize() < 512)
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
|
||||
{
|
||||
if((2 + partitionStart) >= imagePlugin.GetSectors())
|
||||
if((2 + partitionStart) >= partitionEnd)
|
||||
return false;
|
||||
|
||||
byte[] sb_sector = imagePlugin.ReadSector(0 + partitionStart);
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
|
||||
{
|
||||
if((2 + partitionStart) >= imagePlugin.GetSectors())
|
||||
if((2 + partitionStart) >= partitionEnd)
|
||||
return false;
|
||||
|
||||
byte[] system_descriptor = new byte[23];
|
||||
|
||||
@@ -92,7 +92,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
|
||||
{
|
||||
if(imagePlugin.GetSectors() < 3)
|
||||
if(partitionEnd < 3)
|
||||
return false;
|
||||
|
||||
// Blocks 0 and 1 are boot code
|
||||
@@ -115,11 +115,11 @@ namespace DiscImageChef.Filesystems
|
||||
return false;
|
||||
|
||||
ushort bit_map_pointer = BitConverter.ToUInt16(rootDirectoryKeyBlock, 0x27);
|
||||
if(bit_map_pointer > imagePlugin.GetSectors())
|
||||
if(bit_map_pointer > partitionEnd)
|
||||
return false;
|
||||
|
||||
ushort total_blocks = BitConverter.ToUInt16(rootDirectoryKeyBlock, 0x29);
|
||||
return total_blocks <= imagePlugin.GetSectors();
|
||||
return total_blocks <= (partitionEnd - partitionStart);
|
||||
}
|
||||
|
||||
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information)
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
|
||||
{
|
||||
if((2 + partitionStart) >= imagePlugin.GetSectors())
|
||||
if((2 + partitionStart) >= partitionEnd)
|
||||
return false;
|
||||
|
||||
byte signature; /// <summary>0x29
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
|
||||
{
|
||||
if((2 + partitionStart) >= imagePlugin.GetSectors())
|
||||
if((2 + partitionStart) >= partitionEnd)
|
||||
return false;
|
||||
|
||||
uint magic;
|
||||
@@ -103,7 +103,7 @@ namespace DiscImageChef.Filesystems
|
||||
else
|
||||
sb_size_in_sectors = 1; // If not a single sector can store it
|
||||
|
||||
if(imagePlugin.GetSectors() <= (partitionStart + 4 * (ulong)sb_size_in_sectors + sb_size_in_sectors)) // Device must be bigger than SB location + SB size + offset
|
||||
if(partitionEnd <= (partitionStart + 4 * (ulong)sb_size_in_sectors + sb_size_in_sectors)) // Device must be bigger than SB location + SB size + offset
|
||||
return false;
|
||||
|
||||
// Superblock can start on 0x000, 0x200, 0x600 and 0x800, not aligned, so we assume 16 (128 bytes/sector) sectors as a safe value
|
||||
@@ -157,7 +157,7 @@ namespace DiscImageChef.Filesystems
|
||||
{
|
||||
if(s_fsize < V7_MAXSIZE && s_nfree < V7_NICFREE && s_ninode < V7_NICINOD)
|
||||
{
|
||||
if((s_fsize * 1024) == (imagePlugin.GetSectors() * imagePlugin.GetSectorSize()) || (s_fsize * 512) == (imagePlugin.GetSectors() * imagePlugin.GetSectorSize()))
|
||||
if((s_fsize * 1024) == ((partitionEnd - partitionStart) * imagePlugin.GetSectorSize()) || (s_fsize * 512) == ((partitionEnd - partitionStart) * imagePlugin.GetSectorSize()))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -273,7 +273,7 @@ namespace DiscImageChef.Filesystems
|
||||
{
|
||||
if(s_fsize < V7_MAXSIZE && s_nfree < V7_NICFREE && s_ninode < V7_NICINOD)
|
||||
{
|
||||
if((s_fsize * 1024) == (imagePlugin.GetSectors() * imagePlugin.GetSectorSize()) || (s_fsize * 512) == (imagePlugin.GetSectors() * imagePlugin.GetSectorSize()))
|
||||
if((s_fsize * 1024) == ((partitionEnd - partitionStart) * imagePlugin.GetSectorSize()) || (s_fsize * 512) == ((partitionEnd - partitionStart) * imagePlugin.GetSectorSize()))
|
||||
{
|
||||
sys7th = true;
|
||||
BigEndianBitConverter.IsLittleEndian = true;
|
||||
|
||||
@@ -56,7 +56,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
|
||||
{
|
||||
if((2 + partitionStart) >= imagePlugin.GetSectors())
|
||||
if((2 + partitionStart) >= partitionEnd)
|
||||
return false;
|
||||
|
||||
uint magic;
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
|
||||
{
|
||||
if((2 + partitionStart) >= imagePlugin.GetSectors())
|
||||
if((2 + partitionStart) >= partitionEnd)
|
||||
return false;
|
||||
|
||||
byte[] sb_sector = imagePlugin.ReadSector(2 + partitionStart);
|
||||
|
||||
@@ -53,7 +53,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
|
||||
{
|
||||
if((2 + partitionStart) >= imagePlugin.GetSectors())
|
||||
if((2 + partitionStart) >= partitionEnd)
|
||||
return false;
|
||||
|
||||
byte[] sb_sector = imagePlugin.ReadSector(2 + partitionStart); // Superblock resides at 0x400
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
2016-08-08 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* Commands/CreateSidecar.cs:
|
||||
Added points for skipping whole image checksum on debugging.
|
||||
Track starts at index 0.
|
||||
|
||||
2016-08-07 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* DiscImageChef.csproj:
|
||||
|
||||
@@ -99,6 +99,9 @@ namespace DiscImageChef.Commands
|
||||
|
||||
Core.Checksum imgChkWorker = new Core.Checksum();
|
||||
|
||||
// For fast debugging, skip checksum
|
||||
//goto skipImageChecksum;
|
||||
|
||||
byte[] data;
|
||||
long position = 0;
|
||||
while(position < (fi.Length - 1048576))
|
||||
@@ -120,6 +123,9 @@ namespace DiscImageChef.Commands
|
||||
|
||||
imgChkWorker.Update(data);
|
||||
|
||||
// For fast debugging, skip checksum
|
||||
//skipImageChecksum:
|
||||
|
||||
DicConsole.WriteLine();
|
||||
fs.Close();
|
||||
|
||||
@@ -366,6 +372,13 @@ namespace DiscImageChef.Commands
|
||||
xmlTrk.StartSector = (long)trk.TrackStartSector;
|
||||
xmlTrk.EndSector = (long)trk.TrackEndSector;
|
||||
|
||||
if(trk.Indexes.ContainsKey(0))
|
||||
{
|
||||
ulong idx0;
|
||||
if(trk.Indexes.TryGetValue(0, out idx0))
|
||||
xmlTrk.StartSector = (long)idx0;
|
||||
}
|
||||
|
||||
if(sidecar.OpticalDisc[0].DiscType == "CD" ||
|
||||
sidecar.OpticalDisc[0].DiscType == "GD")
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user