Give not only partition starting sector but also ending sector

to filesystems.
This commit is contained in:
2015-04-20 05:09:46 +01:00
parent 70a6eab8ac
commit 66980c0548
23 changed files with 185 additions and 157 deletions

View File

@@ -1,3 +1,30 @@
2015-04-20 Natalia Portillo <claunia@claunia.com>
* Plugins/BFS.cs:
* Plugins/ODS.cs:
* Plugins/FFS.cs:
* Plugins/FAT.cs:
* Plugins/NTFS.cs:
* Plugins/HPFS.cs:
* Plugins/SysV.cs:
* Plugins/Opera.cs:
* Plugins/extFS.cs:
* Plugins/LisaFS.cs:
* Plugins/ProDOS.cs:
* Plugins/ext2FS.cs:
* Plugins/Plugin.cs:
* Plugins/SolarFS.cs:
* Plugins/UNIXBFS.cs:
* Plugins/ISO9660.cs:
* Plugins/MinixFS.cs:
* Plugins/PCEngine.cs:
* Plugins/AppleMFS.cs:
* Plugins/AppleHFS.cs:
* Commands/Analyze.cs:
* Plugins/AppleHFSPlus.cs:
Give not only partition starting sector but also ending
sector to filesystems.
2015-04-20 Natalia Portillo <claunia@claunia.com>
* PartPlugins/RDB.cs:

View File

@@ -167,7 +167,7 @@ namespace DiscImageChef.Commands
{
Console.WriteLine("Identifying filesystem on partition");
IdentifyFilesystems(_imageFormat, out id_plugins, partitions[i].PartitionStartSector);
IdentifyFilesystems(_imageFormat, out id_plugins, partitions[i].PartitionStartSector, partitions[i].PartitionStartSector+partitions[i].PartitionSectors);
if (id_plugins.Count == 0)
Console.WriteLine("Filesystem not identified");
else if (id_plugins.Count > 1)
@@ -179,7 +179,7 @@ namespace DiscImageChef.Commands
if (plugins.PluginsList.TryGetValue(plugin_name, out _plugin))
{
Console.WriteLine(String.Format("As identified by {0}.", _plugin.Name));
_plugin.GetInformation(_imageFormat, partitions[i].PartitionStartSector, out information);
_plugin.GetInformation(_imageFormat, partitions[i].PartitionStartSector, partitions[i].PartitionStartSector+partitions[i].PartitionSectors, out information);
Console.Write(information);
}
}
@@ -188,7 +188,7 @@ namespace DiscImageChef.Commands
{
plugins.PluginsList.TryGetValue(id_plugins[0], out _plugin);
Console.WriteLine(String.Format("Identified by {0}.", _plugin.Name));
_plugin.GetInformation(_imageFormat, partitions[i].PartitionStartSector, out information);
_plugin.GetInformation(_imageFormat, partitions[i].PartitionStartSector, partitions[i].PartitionStartSector+partitions[i].PartitionSectors, out information);
Console.Write(information);
}
}
@@ -198,7 +198,7 @@ namespace DiscImageChef.Commands
if (checkraw)
{
IdentifyFilesystems(_imageFormat, out id_plugins, 0);
IdentifyFilesystems(_imageFormat, out id_plugins, 0, _imageFormat.GetSectors()-1);
if (id_plugins.Count == 0)
Console.WriteLine("Filesystem not identified");
else if (id_plugins.Count > 1)
@@ -210,7 +210,7 @@ namespace DiscImageChef.Commands
if (plugins.PluginsList.TryGetValue(plugin_name, out _plugin))
{
Console.WriteLine(String.Format("As identified by {0}.", _plugin.Name));
_plugin.GetInformation(_imageFormat, 0, out information);
_plugin.GetInformation(_imageFormat, 0, _imageFormat.GetSectors()-1, out information);
Console.Write(information);
}
}
@@ -219,7 +219,7 @@ namespace DiscImageChef.Commands
{
plugins.PluginsList.TryGetValue(id_plugins[0], out _plugin);
Console.WriteLine(String.Format("Identified by {0}.", _plugin.Name));
_plugin.GetInformation(_imageFormat, 0, out information);
_plugin.GetInformation(_imageFormat, 0, _imageFormat.GetSectors()-1, out information);
Console.Write(information);
}
}
@@ -232,7 +232,7 @@ namespace DiscImageChef.Commands
}
}
static void IdentifyFilesystems(ImagePlugin imagePlugin, out List<string> id_plugins, ulong partitionOffset)
static void IdentifyFilesystems(ImagePlugin imagePlugin, out List<string> id_plugins, ulong partitionStart, ulong partitionEnd)
{
id_plugins = new List<string>();
PluginBase plugins = new PluginBase();
@@ -240,7 +240,7 @@ namespace DiscImageChef.Commands
foreach (Plugin _plugin in plugins.PluginsList.Values)
{
if (_plugin.Identify(imagePlugin, partitionOffset))
if (_plugin.Identify(imagePlugin, partitionStart, partitionEnd))
id_plugins.Add(_plugin.Name.ToLower());
}
}

View File

@@ -58,9 +58,9 @@ namespace DiscImageChef.Plugins
PluginUUID = new Guid("36405F8D-0D26-6ECC-0BBB-1D5225FF404F");
}
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
if ((2 + partitionStart) >= imagePlugin.GetSectors())
return false;
byte[] mdb_sector;
@@ -68,7 +68,7 @@ namespace DiscImageChef.Plugins
if (imagePlugin.GetSectorSize() == 2352 || imagePlugin.GetSectorSize() == 2448 || imagePlugin.GetSectorSize() == 2048)
{
mdb_sector = imagePlugin.ReadSector(2 + partitionOffset);
mdb_sector = imagePlugin.ReadSector(2 + partitionStart);
drSigWord = BigEndianBitConverter.ToUInt16(mdb_sector, 0);
if (drSigWord == HFS_MAGIC)
@@ -77,7 +77,7 @@ namespace DiscImageChef.Plugins
return drSigWord != HFSP_MAGIC;
}
mdb_sector = Read2048SectorAs512(imagePlugin, 2 + partitionOffset);
mdb_sector = Read2048SectorAs512(imagePlugin, 2 + partitionStart);
drSigWord = BigEndianBitConverter.ToUInt16(mdb_sector, 0);
if (drSigWord == HFS_MAGIC)
@@ -92,7 +92,7 @@ namespace DiscImageChef.Plugins
}
else
{
mdb_sector = imagePlugin.ReadSector(2 + partitionOffset);
mdb_sector = imagePlugin.ReadSector(2 + partitionStart);
drSigWord = BigEndianBitConverter.ToUInt16(mdb_sector, 0);
if (drSigWord == HFS_MAGIC)
@@ -105,7 +105,7 @@ namespace DiscImageChef.Plugins
return false;
}
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset, out string information)
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information)
{
information = "";
@@ -124,21 +124,21 @@ namespace DiscImageChef.Plugins
if (imagePlugin.GetSectorSize() == 2352 || imagePlugin.GetSectorSize() == 2448 || imagePlugin.GetSectorSize() == 2048)
{
mdb_sector = imagePlugin.ReadSector(2 + partitionOffset);
mdb_sector = imagePlugin.ReadSector(2 + partitionStart);
drSigWord = BigEndianBitConverter.ToUInt16(mdb_sector, 0);
if (drSigWord == HFS_MAGIC)
{
bb_sector = imagePlugin.ReadSector(partitionOffset);
bb_sector = imagePlugin.ReadSector(partitionStart);
}
else
{
mdb_sector = Read2048SectorAs512(imagePlugin, 2 + partitionOffset);
mdb_sector = Read2048SectorAs512(imagePlugin, 2 + partitionStart);
drSigWord = BigEndianBitConverter.ToUInt16(mdb_sector, 0);
if (drSigWord == HFS_MAGIC)
{
bb_sector = Read2048SectorAs512(imagePlugin, partitionOffset);
bb_sector = Read2048SectorAs512(imagePlugin, partitionStart);
APMFromHDDOnCD = true;
}
else
@@ -147,11 +147,11 @@ namespace DiscImageChef.Plugins
}
else
{
mdb_sector = imagePlugin.ReadSector(2 + partitionOffset);
mdb_sector = imagePlugin.ReadSector(2 + partitionStart);
drSigWord = BigEndianBitConverter.ToUInt16(mdb_sector, 0);
if (drSigWord == HFS_MAGIC)
bb_sector = imagePlugin.ReadSector(partitionOffset);
bb_sector = imagePlugin.ReadSector(partitionStart);
else
return;
}

View File

@@ -57,9 +57,9 @@ namespace DiscImageChef.Plugins
PluginUUID = new Guid("36405F8D-0D26-6EBE-436F-62F0586B4F08");
}
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
if ((2 + partitionStart) >= imagePlugin.GetSectors())
return false;
UInt16 drSigWord;
@@ -70,7 +70,7 @@ namespace DiscImageChef.Plugins
byte[] vh_sector;
ulong hfsp_offset;
vh_sector = imagePlugin.ReadSector(2 + partitionOffset); // Read volume header, of HFS Wrapper MDB
vh_sector = imagePlugin.ReadSector(2 + partitionStart); // Read volume header, of HFS Wrapper MDB
drSigWord = BigEndianBitConverter.ToUInt16(vh_sector, 0); // Check for HFS Wrapper MDB
@@ -98,7 +98,7 @@ namespace DiscImageChef.Plugins
hfsp_offset = 0;
}
vh_sector = imagePlugin.ReadSector(2 + partitionOffset + hfsp_offset); // Read volume header
vh_sector = imagePlugin.ReadSector(2 + partitionStart + hfsp_offset); // Read volume header
drSigWord = BigEndianBitConverter.ToUInt16(vh_sector, 0);
if (drSigWord == HFSP_MAGIC || drSigWord == HFSX_MAGIC)
@@ -106,7 +106,7 @@ namespace DiscImageChef.Plugins
return false;
}
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset, out string information)
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information)
{
information = "";
@@ -120,7 +120,7 @@ namespace DiscImageChef.Plugins
bool wrapped;
byte[] vh_sector;
vh_sector = imagePlugin.ReadSector(2 + partitionOffset); // Read volume header, of HFS Wrapper MDB
vh_sector = imagePlugin.ReadSector(2 + partitionStart); // Read volume header, of HFS Wrapper MDB
drSigWord = BigEndianBitConverter.ToUInt16(vh_sector, 0); // Check for HFS Wrapper MDB
@@ -151,7 +151,7 @@ namespace DiscImageChef.Plugins
wrapped = false;
}
vh_sector = imagePlugin.ReadSector(2 + partitionOffset + hfsp_offset); // Read volume header
vh_sector = imagePlugin.ReadSector(2 + partitionStart + hfsp_offset); // Read volume header
HPVH.signature = BigEndianBitConverter.ToUInt16(vh_sector, 0x000);
if (HPVH.signature == HFSP_MAGIC || HPVH.signature == HFSX_MAGIC)

View File

@@ -55,21 +55,21 @@ namespace DiscImageChef.Plugins
PluginUUID = new Guid("36405F8D-0D26-4066-6538-5DBF5D065C3A");
}
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
{
UInt16 drSigWord;
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
if ((2 + partitionStart) >= imagePlugin.GetSectors())
return false;
byte[] mdb_sector = imagePlugin.ReadSector(2 + partitionOffset);
byte[] mdb_sector = imagePlugin.ReadSector(2 + partitionStart);
drSigWord = BigEndianBitConverter.ToUInt16(mdb_sector, 0x000);
return drSigWord == MFS_MAGIC;
}
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset, out string information)
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information)
{
information = "";
@@ -81,8 +81,8 @@ namespace DiscImageChef.Plugins
byte[] pString = new byte[16];
byte[] variable_size;
byte[] mdb_sector = imagePlugin.ReadSector(2 + partitionOffset);
byte[] bb_sector = imagePlugin.ReadSector(0 + partitionOffset);
byte[] mdb_sector = imagePlugin.ReadSector(2 + partitionStart);
byte[] bb_sector = imagePlugin.ReadSector(0 + partitionStart);
MDB.drSigWord = BigEndianBitConverter.ToUInt16(mdb_sector, 0x000);
if (MDB.drSigWord != MFS_MAGIC)

View File

@@ -63,22 +63,22 @@ namespace DiscImageChef.Plugins
PluginUUID = new Guid("dc8572b3-b6ad-46e4-8de9-cbe123ff6672");
}
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
if ((2 + partitionStart) >= imagePlugin.GetSectors())
return false;
UInt32 magic;
UInt32 magic_be;
byte[] sb_sector = imagePlugin.ReadSector(0 + partitionOffset);
byte[] sb_sector = imagePlugin.ReadSector(0 + partitionStart);
magic = BitConverter.ToUInt32(sb_sector, 0x20);
magic_be = BigEndianBitConverter.ToUInt32(sb_sector, 0x20);
if (magic == BEFS_MAGIC1 || magic_be == BEFS_MAGIC1)
return true;
sb_sector = imagePlugin.ReadSector(1 + partitionOffset);
sb_sector = imagePlugin.ReadSector(1 + partitionStart);
magic = BitConverter.ToUInt32(sb_sector, 0x20);
magic_be = BigEndianBitConverter.ToUInt32(sb_sector, 0x20);
@@ -88,7 +88,7 @@ namespace DiscImageChef.Plugins
return false;
}
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset, out string information)
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information)
{
information = "";
byte[] name_bytes = new byte[32];
@@ -97,7 +97,7 @@ namespace DiscImageChef.Plugins
BeSuperBlock besb = new BeSuperBlock();
byte[] sb_sector = imagePlugin.ReadSector(0 + partitionOffset);
byte[] sb_sector = imagePlugin.ReadSector(0 + partitionStart);
BigEndianBitConverter.IsLittleEndian = true; // Default for little-endian
@@ -108,7 +108,7 @@ namespace DiscImageChef.Plugins
}
else
{
sb_sector = imagePlugin.ReadSector(1 + partitionOffset);
sb_sector = imagePlugin.ReadSector(1 + partitionStart);
besb.magic1 = BigEndianBitConverter.ToUInt32(sb_sector, 0x20);
if (besb.magic1 == BEFS_MAGIC1 || besb.magic1 == BEFS_CIGAM1) // There is a boot sector

View File

@@ -52,9 +52,9 @@ namespace DiscImageChef.Plugins
PluginUUID = new Guid("33513B2C-0D26-0D2D-32C3-79D8611158E0");
}
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
if ((2 + partitionStart) >= imagePlugin.GetSectors())
return false;
byte media_descriptor; // Not present on DOS <= 3, present on TOS but != of first FAT entry
@@ -63,8 +63,8 @@ namespace DiscImageChef.Plugins
UInt32 first_fat_entry; // No matter FAT size we read 4 bytes for checking
UInt16 bps, rsectors;
byte[] bpb_sector = imagePlugin.ReadSector(0 + partitionOffset);
byte[] fat_sector = imagePlugin.ReadSector(1 + partitionOffset);
byte[] bpb_sector = imagePlugin.ReadSector(0 + partitionStart);
byte[] fat_sector = imagePlugin.ReadSector(1 + partitionStart);
bool bpb_found = true;
@@ -77,8 +77,8 @@ namespace DiscImageChef.Plugins
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() > ((ulong)rsectors + partitionOffset))
fat_sector = imagePlugin.ReadSector(rsectors + partitionOffset); // First FAT entry
if (imagePlugin.GetSectors() > ((ulong)rsectors + partitionStart))
fat_sector = imagePlugin.ReadSector(rsectors + partitionStart); // First FAT entry
else
bpb_found=false;
@@ -116,7 +116,7 @@ namespace DiscImageChef.Plugins
else
{
// This may create a lot of false positives, need to do extensive checkins...
fat_sector = imagePlugin.ReadSector(1 + partitionOffset);
fat_sector = imagePlugin.ReadSector(1 + partitionStart);
first_fat_entry = BitConverter.ToUInt32(fat_sector, 0);
byte fat_id = fat_sector[0];
@@ -172,7 +172,7 @@ namespace DiscImageChef.Plugins
return false;
}
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset, out string information)
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information)
{
information = "";
@@ -185,8 +185,8 @@ namespace DiscImageChef.Plugins
string fat32_signature;
UInt16 bps, rsectors;
byte[] bpb_sector = imagePlugin.ReadSector(0 + partitionOffset);
byte[] fat_sector = imagePlugin.ReadSector(1 + partitionOffset);
byte[] bpb_sector = imagePlugin.ReadSector(0 + partitionStart);
byte[] fat_sector = imagePlugin.ReadSector(1 + partitionStart);
bool bpb_found = true;
@@ -201,8 +201,8 @@ namespace DiscImageChef.Plugins
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() > ((ulong)rsectors + partitionOffset))
fat_sector = imagePlugin.ReadSector(rsectors + partitionOffset); // First FAT entry
if (imagePlugin.GetSectors() > ((ulong)rsectors + partitionStart))
fat_sector = imagePlugin.ReadSector(rsectors + partitionStart); // First FAT entry
else
bpb_found=false;

View File

@@ -51,9 +51,9 @@ namespace DiscImageChef.Plugins
PluginUUID = new Guid("CC90D342-05DB-48A8-988C-C1FE000034A3");
}
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
if ((2 + partitionStart) >= imagePlugin.GetSectors())
return false;
UInt32 magic;
@@ -65,36 +65,36 @@ namespace DiscImageChef.Plugins
else
sb_size_in_sectors = block_size / imagePlugin.GetSectorSize();
if (imagePlugin.GetSectors() > (partitionOffset + sb_start_floppy * sb_size_in_sectors + sb_size_in_sectors))
if (imagePlugin.GetSectors() > (partitionStart + sb_start_floppy * sb_size_in_sectors + sb_size_in_sectors))
{
ufs_sb_sectors = imagePlugin.ReadSectors(partitionOffset + 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);
if (magic == UFS_MAGIC || magic == UFS_MAGIC_BW || magic == UFS2_MAGIC || magic == UFS_CIGAM || magic == UFS_BAD_MAGIC)
return true;
}
if (imagePlugin.GetSectors() > (partitionOffset + sb_start_ufs1 * sb_size_in_sectors + sb_size_in_sectors))
if (imagePlugin.GetSectors() > (partitionStart + sb_start_ufs1 * sb_size_in_sectors + sb_size_in_sectors))
{
ufs_sb_sectors = imagePlugin.ReadSectors(partitionOffset + 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);
if (magic == UFS_MAGIC || magic == UFS_MAGIC_BW || magic == UFS2_MAGIC || magic == UFS_CIGAM || magic == UFS_BAD_MAGIC)
return true;
}
if (imagePlugin.GetSectors() > (partitionOffset + sb_start_ufs2 * sb_size_in_sectors + sb_size_in_sectors))
if (imagePlugin.GetSectors() > (partitionStart + sb_start_ufs2 * sb_size_in_sectors + sb_size_in_sectors))
{
ufs_sb_sectors = imagePlugin.ReadSectors(partitionOffset + 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);
if (magic == UFS_MAGIC || magic == UFS_MAGIC_BW || magic == UFS2_MAGIC || magic == UFS_CIGAM || magic == UFS_BAD_MAGIC)
return true;
}
if (imagePlugin.GetSectors() > (partitionOffset + sb_start_piggy * sb_size_in_sectors + sb_size_in_sectors))
if (imagePlugin.GetSectors() > (partitionStart + sb_start_piggy * sb_size_in_sectors + sb_size_in_sectors))
{
ufs_sb_sectors = imagePlugin.ReadSectors(partitionOffset + 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);
if (magic == UFS_MAGIC || magic == UFS_MAGIC_BW || magic == UFS2_MAGIC || magic == UFS_CIGAM || magic == UFS_BAD_MAGIC)
@@ -104,7 +104,7 @@ namespace DiscImageChef.Plugins
return false;
}
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset, out string information)
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information)
{
information = "";
StringBuilder sbInformation = new StringBuilder();
@@ -112,7 +112,7 @@ namespace DiscImageChef.Plugins
UInt32 magic = 0;
uint sb_size_in_sectors;
byte[] ufs_sb_sectors;
ulong sb_offset = partitionOffset;
ulong sb_offset = partitionStart;
bool fs_type_42bsd = false;
bool fs_type_43bsd = false;
bool fs_type_44bsd = false;
@@ -126,46 +126,46 @@ namespace DiscImageChef.Plugins
else
sb_size_in_sectors = block_size / imagePlugin.GetSectorSize();
if (imagePlugin.GetSectors() > (partitionOffset + sb_start_floppy * sb_size_in_sectors + sb_size_in_sectors) && magic == 0)
if (imagePlugin.GetSectors() > (partitionStart + sb_start_floppy * sb_size_in_sectors + sb_size_in_sectors) && magic == 0)
{
ufs_sb_sectors = imagePlugin.ReadSectors(partitionOffset + 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);
if (magic == UFS_MAGIC || magic == UFS_MAGIC_BW || magic == UFS2_MAGIC || magic == UFS_CIGAM || magic == UFS_BAD_MAGIC)
sb_offset = partitionOffset + sb_start_floppy * sb_size_in_sectors;
sb_offset = partitionStart + sb_start_floppy * sb_size_in_sectors;
else
magic = 0;
}
if (imagePlugin.GetSectors() > (partitionOffset + sb_start_ufs1 * sb_size_in_sectors + sb_size_in_sectors) && magic == 0)
if (imagePlugin.GetSectors() > (partitionStart + sb_start_ufs1 * sb_size_in_sectors + sb_size_in_sectors) && magic == 0)
{
ufs_sb_sectors = imagePlugin.ReadSectors(partitionOffset + 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);
if (magic == UFS_MAGIC || magic == UFS_MAGIC_BW || magic == UFS2_MAGIC || magic == UFS_CIGAM || magic == UFS_BAD_MAGIC)
sb_offset = partitionOffset + sb_start_ufs1 * sb_size_in_sectors;
sb_offset = partitionStart + sb_start_ufs1 * sb_size_in_sectors;
else
magic = 0;
}
if (imagePlugin.GetSectors() > (partitionOffset + sb_start_ufs2 * sb_size_in_sectors + sb_size_in_sectors) && magic == 0)
if (imagePlugin.GetSectors() > (partitionStart + sb_start_ufs2 * sb_size_in_sectors + sb_size_in_sectors) && magic == 0)
{
ufs_sb_sectors = imagePlugin.ReadSectors(partitionOffset + 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);
if (magic == UFS_MAGIC || magic == UFS_MAGIC_BW || magic == UFS2_MAGIC || magic == UFS_CIGAM || magic == UFS_BAD_MAGIC)
sb_offset = partitionOffset + sb_start_ufs2 * sb_size_in_sectors;
sb_offset = partitionStart + sb_start_ufs2 * sb_size_in_sectors;
else
magic = 0;
}
if (imagePlugin.GetSectors() > (partitionOffset + sb_start_piggy * sb_size_in_sectors + sb_size_in_sectors) && magic == 0)
if (imagePlugin.GetSectors() > (partitionStart + sb_start_piggy * sb_size_in_sectors + sb_size_in_sectors) && magic == 0)
{
ufs_sb_sectors = imagePlugin.ReadSectors(partitionOffset + 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);
if (magic == UFS_MAGIC || magic == UFS_MAGIC_BW || magic == UFS2_MAGIC || magic == UFS_CIGAM || magic == UFS_BAD_MAGIC)
sb_offset = partitionOffset + sb_start_piggy * sb_size_in_sectors;
sb_offset = partitionStart + sb_start_piggy * sb_size_in_sectors;
else
magic = 0;
}

View File

@@ -52,14 +52,14 @@ namespace DiscImageChef.Plugins
PluginUUID = new Guid("33513B2C-f590-4acb-8bf2-0b1d5e19dec5");
}
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
if ((2 + partitionStart) >= imagePlugin.GetSectors())
return false;
UInt32 magic1, magic2;
byte[] hpfs_sb_sector = imagePlugin.ReadSector(16 + partitionOffset); // Seek to superblock, on logical sector 16
byte[] hpfs_sb_sector = imagePlugin.ReadSector(16 + partitionStart); // Seek to superblock, on logical sector 16
magic1 = BitConverter.ToUInt32(hpfs_sb_sector, 0x000);
magic2 = BitConverter.ToUInt32(hpfs_sb_sector, 0x004);
@@ -68,7 +68,7 @@ namespace DiscImageChef.Plugins
return false;
}
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset, out string information)
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information)
{
information = "";
@@ -81,9 +81,9 @@ namespace DiscImageChef.Plugins
byte[] oem_name = new byte[8];
byte[] volume_name = new byte[11];
byte[] hpfs_bpb_sector = imagePlugin.ReadSector(0 + partitionOffset); // Seek to BIOS parameter block, on logical sector 0
byte[] hpfs_sb_sector = imagePlugin.ReadSector(16 + partitionOffset); // Seek to superblock, on logical sector 16
byte[] hpfs_sp_sector = imagePlugin.ReadSector(17 + partitionOffset); // Seek to spareblock, on logical sector 17
byte[] hpfs_bpb_sector = imagePlugin.ReadSector(0 + partitionStart); // Seek to BIOS parameter block, on logical sector 0
byte[] hpfs_sb_sector = imagePlugin.ReadSector(16 + partitionStart); // Seek to superblock, on logical sector 16
byte[] hpfs_sp_sector = imagePlugin.ReadSector(17 + partitionStart); // Seek to spareblock, on logical sector 17
hpfs_bpb.jmp1 = hpfs_bpb_sector[0x000];
hpfs_bpb.jmp2 = BitConverter.ToUInt16(hpfs_bpb_sector, 0x001);

View File

@@ -75,7 +75,7 @@ namespace DiscImageChef.Plugins
public DateTime EffectiveTime;
}
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
{
if (alreadyLaunched)
return false;
@@ -88,11 +88,11 @@ namespace DiscImageChef.Plugins
return false;
// ISO9660 Primary Volume Descriptor starts at sector 16, so that's minimal size.
if (imagePlugin.GetSectors() <= (16 + partitionOffset))
if (imagePlugin.GetSectors() <= (16 + partitionStart))
return false;
// Read to Volume Descriptor
byte[] vd_sector = imagePlugin.ReadSector(16 + partitionOffset);
byte[] vd_sector = imagePlugin.ReadSector(16 + partitionStart);
VDType = vd_sector[0];
byte[] VDMagic = new byte[5];
@@ -106,7 +106,7 @@ namespace DiscImageChef.Plugins
return Encoding.ASCII.GetString(VDMagic) == "CD001";
}
public override void GetInformation (ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset, out string information)
public override void GetInformation (ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information)
{
information = "";
StringBuilder ISOMetadata = new StringBuilder();
@@ -160,8 +160,8 @@ namespace DiscImageChef.Plugins
Console.WriteLine("DEBUG (ISO9660 Plugin): Processing VD loop no. {0}", counter);
// Seek to Volume Descriptor
if (MainClass.isDebug)
Console.WriteLine("DEBUG (ISO9660 Plugin): Reading sector {0}", 16 + counter + partitionOffset);
byte[] vd_sector = imagePlugin.ReadSector(16 + counter + partitionOffset);
Console.WriteLine("DEBUG (ISO9660 Plugin): Reading sector {0}", 16 + counter + partitionStart);
byte[] vd_sector = imagePlugin.ReadSector(16 + counter + partitionStart);
VDType = vd_sector[0];
if (MainClass.isDebug)
@@ -272,16 +272,16 @@ namespace DiscImageChef.Plugins
ulong i = (ulong)BitConverter.ToInt32(VDPathTableStart, 0);
if (MainClass.isDebug)
Console.WriteLine("DEBUG (ISO9660 Plugin): VDPathTableStart = {0} + {1} = {2}", i, partitionOffset, i + partitionOffset);
Console.WriteLine("DEBUG (ISO9660 Plugin): VDPathTableStart = {0} + {1} = {2}", i, partitionStart, i + partitionStart);
// TODO: Check this
if ((i + partitionOffset) < imagePlugin.GetSectors())
if ((i + partitionStart) < imagePlugin.GetSectors())
{
byte[] path_table = imagePlugin.ReadSector(i + partitionOffset);
byte[] path_table = imagePlugin.ReadSector(i + partitionStart);
Array.Copy(path_table, 2, RootDirectoryLocation, 0, 4);
// Check for Rock Ridge
byte[] root_dir = imagePlugin.ReadSector((ulong)BitConverter.ToInt32(RootDirectoryLocation, 0) + partitionOffset);
byte[] root_dir = imagePlugin.ReadSector((ulong)BitConverter.ToInt32(RootDirectoryLocation, 0) + partitionStart);
byte[] SUSPMagic = new byte[2];
byte[] RRMagic = new byte[2];
@@ -302,7 +302,7 @@ namespace DiscImageChef.Plugins
StringBuilder IPBinInformation = new StringBuilder();
byte[] SegaHardwareID = new byte[16];
byte[] ipbin_sector = imagePlugin.ReadSector(0 + partitionOffset);
byte[] ipbin_sector = imagePlugin.ReadSector(0 + partitionStart);
Array.Copy(ipbin_sector, 0x000, SegaHardwareID, 0, 16);
if (MainClass.isDebug)

View File

@@ -69,7 +69,7 @@ namespace DiscImageChef.Plugins
PluginUUID = new Guid("7E6034D1-D823-4248-A54D-239742B28391");
}
public override bool Identify(ImagePlugin imagePlugin, ulong partitionOffset)
public override bool Identify(ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
{
try
{
@@ -155,7 +155,7 @@ namespace DiscImageChef.Plugins
}
}
public override void GetInformation(ImagePlugin imagePlugin, ulong partitionOffset, out string information)
public override void GetInformation(ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information)
{
information = "";
StringBuilder sb = new StringBuilder();

View File

@@ -73,13 +73,13 @@ namespace DiscImageChef.Plugins
PluginUUID = new Guid("FE248C3B-B727-4AE5-A39F-79EA9A07D4B3");
}
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
if ((2 + partitionStart) >= imagePlugin.GetSectors())
return false;
UInt16 magic;
byte[] minix_sb_sector = imagePlugin.ReadSector(2 + partitionOffset);
byte[] minix_sb_sector = imagePlugin.ReadSector(2 + partitionStart);
magic = BitConverter.ToUInt16(minix_sb_sector, 0x010); // Here should reside magic number on Minix V1 & V2
@@ -93,7 +93,7 @@ namespace DiscImageChef.Plugins
return false;
}
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset, out string information)
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information)
{
information = "";
@@ -103,7 +103,7 @@ namespace DiscImageChef.Plugins
int filenamesize;
string minixVersion;
UInt16 magic;
byte[] minix_sb_sector = imagePlugin.ReadSector(2 + partitionOffset);
byte[] minix_sb_sector = imagePlugin.ReadSector(2 + partitionStart);
magic = BigEndianBitConverter.ToUInt16(minix_sb_sector, 0x018);

View File

@@ -51,9 +51,9 @@ namespace DiscImageChef.Plugins
PluginUUID = new Guid("33513B2C-1e6d-4d21-a660-0bbc789c3871");
}
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
if ((2 + partitionStart) >= imagePlugin.GetSectors())
return false;
byte[] eigth_bytes = new byte[8];
@@ -61,7 +61,7 @@ namespace DiscImageChef.Plugins
UInt16 spfat, signature2;
string oem_name;
byte[] ntfs_bpb = imagePlugin.ReadSector(0 + partitionOffset);
byte[] ntfs_bpb = imagePlugin.ReadSector(0 + partitionStart);
Array.Copy(ntfs_bpb, 0x003, eigth_bytes, 0, 8);
oem_name = StringHandlers.CToString(eigth_bytes);
@@ -90,13 +90,13 @@ namespace DiscImageChef.Plugins
}
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset, out string information)
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information)
{
information = "";
StringBuilder sb = new StringBuilder();
byte[] ntfs_bpb = imagePlugin.ReadSector(0 + partitionOffset);
byte[] ntfs_bpb = imagePlugin.ReadSector(0 + partitionStart);
NTFS_BootBlock ntfs_bb = new NTFS_BootBlock();

View File

@@ -58,9 +58,9 @@ namespace DiscImageChef.Plugins
PluginUUID = new Guid("de20633c-8021-4384-aeb0-83b0df14491f");
}
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
if ((2 + partitionStart) >= imagePlugin.GetSectors())
return false;
if (imagePlugin.GetSectorSize() < 512)
@@ -68,7 +68,7 @@ namespace DiscImageChef.Plugins
byte[] magic_b = new byte[12];
string magic;
byte[] hb_sector = imagePlugin.ReadSector(1 + partitionOffset);
byte[] hb_sector = imagePlugin.ReadSector(1 + partitionStart);
Array.Copy(hb_sector, 0x1F0, magic_b, 0, 12);
magic = Encoding.ASCII.GetString(magic_b);
@@ -76,7 +76,7 @@ namespace DiscImageChef.Plugins
return magic == "DECFILE11A " || magic == "DECFILE11B ";
}
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset, out string information)
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information)
{
information = "";
@@ -86,7 +86,7 @@ namespace DiscImageChef.Plugins
homeblock.min_class = new byte[20];
homeblock.max_class = new byte[20];
byte[] hb_sector = imagePlugin.ReadSector(1 + partitionOffset);
byte[] hb_sector = imagePlugin.ReadSector(1 + partitionStart);
homeblock.homelbn = BitConverter.ToUInt32(hb_sector, 0x000);
homeblock.alhomelbn = BitConverter.ToUInt32(hb_sector, 0x004);

View File

@@ -51,12 +51,12 @@ namespace DiscImageChef.Plugins
PluginUUID = new Guid("0ec84ec7-eae6-4196-83fe-943b3fe46dbd");
}
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
if ((2 + partitionStart) >= imagePlugin.GetSectors())
return false;
byte[] sb_sector = imagePlugin.ReadSector(0 + partitionOffset);
byte[] sb_sector = imagePlugin.ReadSector(0 + partitionStart);
byte record_type;
byte[] sync_bytes = new byte[5];
@@ -72,12 +72,12 @@ namespace DiscImageChef.Plugins
}
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset, out string information)
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information)
{
information = "";
StringBuilder SuperBlockMetadata = new StringBuilder();
byte[] sb_sector = imagePlugin.ReadSector(0 + partitionOffset);
byte[] sb_sector = imagePlugin.ReadSector(0 + partitionStart);
OperaSuperBlock sb = new OperaSuperBlock();
byte[] cString = new byte[32];

View File

@@ -50,20 +50,20 @@ namespace DiscImageChef.Plugins
PluginUUID = new Guid("e5ee6d7c-90fa-49bd-ac89-14ef750b8af3");
}
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
if ((2 + partitionStart) >= imagePlugin.GetSectors())
return false;
byte[] system_descriptor = new byte[23];
byte[] sector = imagePlugin.ReadSector(1 + partitionOffset);
byte[] sector = imagePlugin.ReadSector(1 + partitionStart);
Array.Copy(sector, 0x20, system_descriptor, 0, 23);
return Encoding.ASCII.GetString(system_descriptor) == "PC Engine CD-ROM SYSTEM";
}
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset, out string information)
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information)
{
information = "";
}

View File

@@ -58,9 +58,10 @@ namespace DiscImageChef.Plugins
/// Identifies the filesystem in the specified LBA
/// </summary>
/// <param name="imagePlugin">Disk image.</param>
/// <param name="partitionOffset">Partition offset (LBA).</param>
/// <param name="partitionStart">Partition start sector (LBA).</param>
/// <param name="partitionEnd">Partition end sector (LBA).</param>
/// <returns><c>true</c>, if the filesystem is recognized, <c>false</c> otherwise.</returns>
public abstract bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset);
public abstract bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd);
/// <summary>
/// Gets information about the identified filesystem.
@@ -68,7 +69,7 @@ namespace DiscImageChef.Plugins
/// <param name="imagePlugin">Disk image.</param>
/// <param name="partitionOffset">Partition offset (LBA).</param>
/// <param name="information">Filesystem information.</param>
public abstract void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset, out string information);
public abstract void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information);
}
}

View File

@@ -89,13 +89,13 @@ namespace DiscImageChef.Plugins
PluginUUID = new Guid("43874265-7B8A-4739-BCF7-07F80D5932BF");
}
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
{
if (imagePlugin.GetSectors() < 3)
return false;
// Blocks 0 and 1 are boot code
byte[] rootDirectoryKeyBlock = imagePlugin.ReadSector(2 + partitionOffset);
byte[] rootDirectoryKeyBlock = imagePlugin.ReadSector(2 + partitionStart);
UInt16 prePointer = BitConverter.ToUInt16(rootDirectoryKeyBlock, 0);
if (prePointer != 0)
@@ -121,12 +121,12 @@ namespace DiscImageChef.Plugins
return total_blocks <= imagePlugin.GetSectors();
}
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset, out string information)
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information)
{
StringBuilder sbInformation = new StringBuilder();
// Blocks 0 and 1 are boot code
byte[] rootDirectoryKeyBlockBytes = imagePlugin.ReadSector(2 + partitionOffset);
byte[] rootDirectoryKeyBlockBytes = imagePlugin.ReadSector(2 + partitionStart);
ProDOSRootDirectoryKeyBlock rootDirectoryKeyBlock = new ProDOSRootDirectoryKeyBlock();
rootDirectoryKeyBlock.header = new ProDOSRootDirectoryHeader();

View File

@@ -51,15 +51,15 @@ namespace DiscImageChef.Plugins
PluginUUID = new Guid("EA3101C1-E777-4B4F-B5A3-8C57F50F6E65");
}
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
if ((2 + partitionStart) >= imagePlugin.GetSectors())
return false;
byte signature; // 0x29
string fs_type; // "SOL_FS "
byte[] bpb = imagePlugin.ReadSector(0 + partitionOffset);
byte[] bpb = imagePlugin.ReadSector(0 + partitionStart);
byte[] fs_type_b = new byte[8];
@@ -72,12 +72,12 @@ namespace DiscImageChef.Plugins
return false;
}
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset, out string information)
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information)
{
information = "";
StringBuilder sb = new StringBuilder();
byte[] bpb_sector = imagePlugin.ReadSector(0 + partitionOffset);
byte[] bpb_sector = imagePlugin.ReadSector(0 + partitionStart);
byte[] bpb_strings;
SolarOSParameterBlock BPB = new SolarOSParameterBlock();

View File

@@ -66,9 +66,9 @@ namespace DiscImageChef.Plugins
PluginUUID = new Guid("9B8D016A-8561-400E-A12A-A198283C211D");
}
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
if ((2 + partitionStart) >= imagePlugin.GetSectors())
return false;
UInt32 magic;
@@ -103,13 +103,13 @@ namespace DiscImageChef.Plugins
else
sb_size_in_sectors = 1; // If not a single sector can store it
if (imagePlugin.GetSectors() <= (partitionOffset + 4 * (ulong)sb_size_in_sectors + (ulong)sb_size_in_sectors)) // Device must be bigger than SB location + SB size + offset
if (imagePlugin.GetSectors() <= (partitionStart + 4 * (ulong)sb_size_in_sectors + (ulong)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
for (int i = 0; i <= 16; i++)
{
byte[] sb_sector = imagePlugin.ReadSectors((ulong)i + partitionOffset, sb_size_in_sectors);
byte[] sb_sector = imagePlugin.ReadSectors((ulong)i + partitionStart, sb_size_in_sectors);
magic = BitConverter.ToUInt32(sb_sector, 0x3F8); // XENIX magic location
@@ -159,7 +159,7 @@ namespace DiscImageChef.Plugins
return false;
}
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset, out string information)
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information)
{
information = "";
@@ -186,7 +186,7 @@ namespace DiscImageChef.Plugins
// Superblock can start on 0x000, 0x200, 0x600 and 0x800, not aligned, so we assume 16 (128 bytes/sector) sectors as a safe value
for (start = 0; start <= 16; start++)
{
sb_sector = imagePlugin.ReadSectors((ulong)start + partitionOffset, sb_size_in_sectors);
sb_sector = imagePlugin.ReadSectors((ulong)start + partitionStart, sb_size_in_sectors);
magic = BigEndianBitConverter.ToUInt32(sb_sector, 0x3F8); // XENIX magic location
if (magic == XENIX_MAGIC)
@@ -266,7 +266,7 @@ namespace DiscImageChef.Plugins
{
byte[] xenix_strings = new byte[6];
XenixSuperBlock xnx_sb = new XenixSuperBlock();
sb_sector = imagePlugin.ReadSectors((ulong)start + partitionOffset, sb_size_in_sectors);
sb_sector = imagePlugin.ReadSectors((ulong)start + partitionStart, sb_size_in_sectors);
xnx_sb.s_isize = BigEndianBitConverter.ToUInt16(sb_sector, 0x000);
xnx_sb.s_fsize = BigEndianBitConverter.ToUInt32(sb_sector, 0x002);
@@ -347,7 +347,7 @@ namespace DiscImageChef.Plugins
if (sysv)
{
sb_sector = imagePlugin.ReadSectors((ulong)start + partitionOffset, sb_size_in_sectors);
sb_sector = imagePlugin.ReadSectors((ulong)start + partitionStart, sb_size_in_sectors);
UInt16 pad0, pad1, pad2;
byte[] sysv_strings = new byte[6];
@@ -468,7 +468,7 @@ namespace DiscImageChef.Plugins
if (coherent)
{
sb_sector = imagePlugin.ReadSectors((ulong)start + partitionOffset, sb_size_in_sectors);
sb_sector = imagePlugin.ReadSectors((ulong)start + partitionStart, sb_size_in_sectors);
CoherentSuperBlock coh_sb = new CoherentSuperBlock();
byte[] coh_strings = new byte[6];
@@ -514,7 +514,7 @@ namespace DiscImageChef.Plugins
if (sys7th)
{
sb_sector = imagePlugin.ReadSectors((ulong)start + partitionOffset, sb_size_in_sectors);
sb_sector = imagePlugin.ReadSectors((ulong)start + partitionStart, sb_size_in_sectors);
UNIX7thEditionSuperBlock v7_sb = new UNIX7thEditionSuperBlock();
byte[] sys7_strings = new byte[6];

View File

@@ -53,24 +53,24 @@ namespace DiscImageChef.Plugins
PluginUUID = new Guid("1E6E0DA6-F7E4-494C-80C6-CB5929E96155");
}
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
if ((2 + partitionStart) >= imagePlugin.GetSectors())
return false;
UInt32 magic;
magic = BitConverter.ToUInt32(imagePlugin.ReadSector(0 + partitionOffset), 0);
magic = BitConverter.ToUInt32(imagePlugin.ReadSector(0 + partitionStart), 0);
return magic == BFS_MAGIC;
}
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset, out string information)
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information)
{
information = "";
StringBuilder sb = new StringBuilder();
byte[] bfs_sb_sector = imagePlugin.ReadSector(0 + partitionOffset);
byte[] bfs_sb_sector = imagePlugin.ReadSector(0 + partitionStart);
byte[] sb_strings = new byte[6];
BFSSuperBlock bfs_sb = new BFSSuperBlock();

View File

@@ -51,12 +51,12 @@ namespace DiscImageChef.Plugins
PluginUUID = new Guid("6AA91B88-150B-4A7B-AD56-F84FB2DF4184");
}
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
if ((2 + partitionStart) >= imagePlugin.GetSectors())
return false;
byte[] sb_sector = imagePlugin.ReadSector(2 + partitionOffset);
byte[] sb_sector = imagePlugin.ReadSector(2 + partitionStart);
UInt16 magic = BitConverter.ToUInt16(sb_sector, 0x038);
@@ -65,7 +65,7 @@ namespace DiscImageChef.Plugins
return false;
}
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset, out string information)
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information)
{
information = "";
@@ -93,7 +93,7 @@ namespace DiscImageChef.Plugins
return;
}
byte[] sb_sector = imagePlugin.ReadSectors(2 + partitionOffset, sb_size_in_sectors);
byte[] sb_sector = imagePlugin.ReadSectors(2 + partitionStart, sb_size_in_sectors);
supblk.inodes = BitConverter.ToUInt32(sb_sector, 0x000);
supblk.blocks = BitConverter.ToUInt32(sb_sector, 0x004);
supblk.reserved_blocks = BitConverter.ToUInt32(sb_sector, 0x008);

View File

@@ -51,25 +51,25 @@ namespace DiscImageChef.Plugins
PluginUUID = new Guid("076CB3A2-08C2-4D69-BC8A-FCAA2E502BE2");
}
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset)
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
{
if ((2 + partitionOffset) >= imagePlugin.GetSectors())
if ((2 + partitionStart) >= imagePlugin.GetSectors())
return false;
byte[] sb_sector = imagePlugin.ReadSector(2 + partitionOffset); // Superblock resides at 0x400
byte[] sb_sector = imagePlugin.ReadSector(2 + partitionStart); // Superblock resides at 0x400
UInt16 magic = BitConverter.ToUInt16(sb_sector, 0x038); // Here should reside magic number
return magic == extFSMagic;
}
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionOffset, out string information)
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd, out string information)
{
information = "";
StringBuilder sb = new StringBuilder();
byte[] sb_sector = imagePlugin.ReadSector(2 + partitionOffset); // Superblock resides at 0x400
byte[] sb_sector = imagePlugin.ReadSector(2 + partitionStart); // Superblock resides at 0x400
extFSSuperBlock ext_sb = new extFSSuperBlock();
ext_sb.inodes = BitConverter.ToUInt32(sb_sector, 0x000);