mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user