Checks there is a minimum of sectors.

This commit is contained in:
2014-07-09 19:49:14 +01:00
parent 00b0e6f455
commit 679e8f8070
17 changed files with 51 additions and 0 deletions

View File

@@ -60,6 +60,9 @@ namespace DiscImageChef.Plugins
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
return false;
byte[] mdb_sector = imagePlugin.ReadSector(2 + partitionOffset);
UInt16 drSigWord = BigEndianBitConverter.ToUInt16(mdb_sector, 0);

View File

@@ -59,6 +59,9 @@ namespace DiscImageChef.Plugins
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
return false;
UInt16 drSigWord;
UInt16 xdrStABNt;
UInt16 drAlBlSt;

View File

@@ -59,6 +59,9 @@ namespace DiscImageChef.Plugins
{
UInt16 drSigWord;
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
return false;
byte[] mdb_sector = imagePlugin.ReadSector(2 + partitionOffset);
drSigWord = BigEndianBitConverter.ToUInt16(mdb_sector, 0x000);

View File

@@ -65,6 +65,9 @@ namespace DiscImageChef.Plugins
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
return false;
UInt32 magic;
UInt32 magic_be;

View File

@@ -54,6 +54,9 @@ namespace DiscImageChef.Plugins
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
return false;
byte media_descriptor; // Not present on DOS <= 3, present on TOS but != of first FAT entry
byte fats_no; // Must be 1 or 2. Dunno if it can be 0 in the wild, but it CANNOT BE bigger than 2
byte[] fat32_signature = new byte[8]; // "FAT32 "

View File

@@ -53,6 +53,9 @@ namespace DiscImageChef.Plugins
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
return false;
UInt32 magic;
uint sb_size_in_sectors;
byte[] ufs_sb_sectors;

View File

@@ -54,6 +54,9 @@ namespace DiscImageChef.Plugins
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
return false;
UInt32 magic1, magic2;
byte[] hpfs_sb_sector = imagePlugin.ReadSector(16 + partitionOffset); // Seek to superblock, on logical sector 16

View File

@@ -75,6 +75,9 @@ namespace DiscImageChef.Plugins
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
return false;
UInt16 magic;
byte[] minix_sb_sector = imagePlugin.ReadSector(2 + partitionOffset);

View File

@@ -53,6 +53,9 @@ namespace DiscImageChef.Plugins
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
return false;
byte[] eigth_bytes = new byte[8];
byte signature1, fats_no;
UInt16 spfat, signature2;

View File

@@ -60,6 +60,9 @@ namespace DiscImageChef.Plugins
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
return false;
if (imagePlugin.GetSectorSize() < 512)
return false;

View File

@@ -53,6 +53,9 @@ namespace DiscImageChef.Plugins
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
return false;
byte[] sb_sector = imagePlugin.ReadSector(0 + partitionOffset);
byte record_type;

View File

@@ -52,6 +52,9 @@ namespace DiscImageChef.Plugins
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
return false;
byte[] system_descriptor = new byte[23];
byte[] sector = imagePlugin.ReadSector(1 + partitionOffset);

View File

@@ -53,6 +53,9 @@ namespace DiscImageChef.Plugins
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
return false;
byte signature; // 0x29
string fs_type; // "SOL_FS "

View File

@@ -68,6 +68,9 @@ namespace DiscImageChef.Plugins
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
return false;
UInt32 magic;
string s_fname, s_fpack;
UInt16 s_nfree, s_ninode;

View File

@@ -55,6 +55,9 @@ namespace DiscImageChef.Plugins
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
return false;
UInt32 magic;
magic = BitConverter.ToUInt32(imagePlugin.ReadSector(0 + partitionOffset), 0);

View File

@@ -53,6 +53,9 @@ namespace DiscImageChef.Plugins
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
return false;
byte[] sb_sector = imagePlugin.ReadSector(2 + partitionOffset);
UInt16 magic = BitConverter.ToUInt16(sb_sector, 0x038);

View File

@@ -53,6 +53,9 @@ namespace DiscImageChef.Plugins
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
return false;
byte[] sb_sector = imagePlugin.ReadSector(2 + partitionOffset); // Superblock resides at 0x400
UInt16 magic = BitConverter.ToUInt16(sb_sector, 0x038); // Here should reside magic number