* DiscImageChef.Filesystems/BFS.cs:

Prevent index out of array on checking BeFS with
	  less-than-sector-size boot sector.

	* DiscImageChef/Commands/Checksum.cs:
	  Corrected checksum calculation for multiple tracks

	* DiscImageChef.DiscImages/CDRWin.cs:
	  Corrected typo in track calculation.
This commit is contained in:
2015-11-09 22:17:45 +00:00
parent bbc209c121
commit 26b0b6373b
6 changed files with 30 additions and 7 deletions

View File

@@ -1898,7 +1898,7 @@ namespace DiscImageChef.ImagePlugins
_track.TrackDescription = cdr_track.title;
if (!cdr_track.indexes.TryGetValue(0, out _track.TrackStartSector))
cdr_track.indexes.TryGetValue(1, out _track.TrackStartSector);
_track.TrackStartSector += previousStartSector;
_track.TrackStartSector = previousStartSector;
_track.TrackEndSector = _track.TrackStartSector + cdr_track.sectors - 1;
_track.TrackPregap = cdr_track.pregap;
_track.TrackSession = cdr_track.session;

View File

@@ -1,3 +1,8 @@
2015-11-09 Natalia Portillo <claunia@claunia.com>
* CDRWin.cs:
Corrected typo in track calculation.
2015-11-09 Natalia Portillo <claunia@claunia.com>
* CDRWin.cs:

View File

@@ -79,8 +79,11 @@ namespace DiscImageChef.Plugins
if (magic == BEFS_MAGIC1 || magic_be == BEFS_MAGIC1)
return true;
magic = BitConverter.ToUInt32(sb_sector, 0x220);
magic_be = BigEndianBitConverter.ToUInt32(sb_sector, 0x220);
if (sb_sector.Length >= 0x400)
{
magic = BitConverter.ToUInt32(sb_sector, 0x220);
magic_be = BigEndianBitConverter.ToUInt32(sb_sector, 0x220);
}
if (magic == BEFS_MAGIC1 || magic_be == BEFS_MAGIC1)
return true;
@@ -122,7 +125,7 @@ namespace DiscImageChef.Plugins
{
BigEndianBitConverter.IsLittleEndian &= besb.magic1 != BEFS_CIGAM1;
}
else
else if (sb_sector.Length >= 0x400)
{
byte[] temp = imagePlugin.ReadSector(0 + partitionStart);
besb.magic1 = BigEndianBitConverter.ToUInt32(temp, 0x220);
@@ -136,6 +139,8 @@ namespace DiscImageChef.Plugins
else
return;
}
else
return;
}
Array.Copy(sb_sector, 0x000, name_bytes, 0, 0x20);

View File

@@ -1,3 +1,9 @@
2015-11-09 Natalia Portillo <claunia@claunia.com>
* BFS.cs:
Prevent index out of array on checking BeFS with
less-than-sector-size boot sector.
2015-11-09 Natalia Portillo <claunia@claunia.com>
* BFS.cs:

View File

@@ -1,3 +1,8 @@
2015-11-09 Natalia Portillo <claunia@claunia.com>
* Commands/Checksum.cs:
Corrected checksum calculation for multiple tracks
2015-11-09 Natalia Portillo <claunia@claunia.com>
* Main.cs:

View File

@@ -81,6 +81,9 @@ namespace DiscImageChef.Commands
List<Track> inputTracks = inputFormat.GetTracks();
foreach (Track currentTrack in inputTracks)
{
DicConsole.DebugWriteLine("Checksum command", "Track {0} starts at sector {1} and ends at sector {2}", currentTrack.TrackSequence,
currentTrack.TrackStartSector, currentTrack.TrackEndSector);
Adler32Context adler32ctxTrack = new Adler32Context();
CRC16Context crc16ctxTrack = new CRC16Context();
CRC32Context crc32ctxTrack = new CRC32Context();
@@ -125,9 +128,9 @@ namespace DiscImageChef.Commands
ulong sectors = currentTrack.TrackEndSector - currentTrack.TrackStartSector + 1;
DicConsole.WriteLine("Track {0} has {1} sectors", currentTrack.TrackSequence, sectors);
for (ulong i = currentTrack.TrackStartSector; i <= currentTrack.TrackEndSector; i++)
for (ulong i = 0; i < sectors; i++)
{
DicConsole.Write("\rHashing sector {0} of track {1}", i + 1, currentTrack.TrackSequence);
DicConsole.Write("\rHashing sector {0} of track {1}", i, currentTrack.TrackSequence);
byte[] sector = inputFormat.ReadSector(i, currentTrack.TrackSequence);
if (options.DoAdler32)
adler32ctxTrack.Update(sector);
@@ -196,7 +199,6 @@ namespace DiscImageChef.Commands
}
}
if (options.WholeDisc)
{
Adler32Context adler32ctx = new Adler32Context();