mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Refactor: Simplify field names.
This commit is contained in:
@@ -72,10 +72,10 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if(partition.PartitionStartSector >= partition.PartitionEndSector)
|
||||
if(partition.Start >= partition.End)
|
||||
return false;
|
||||
|
||||
byte[] sector = imagePlugin.ReadSector(partition.PartitionStartSector);
|
||||
byte[] sector = imagePlugin.ReadSector(partition.Start);
|
||||
ApfsContainerSuperBlock nxSb;
|
||||
|
||||
try
|
||||
@@ -101,10 +101,10 @@ namespace DiscImageChef.Filesystems
|
||||
xmlFSType = new Schemas.FileSystemType();
|
||||
information = "";
|
||||
|
||||
if(partition.PartitionStartSector >= partition.PartitionEndSector)
|
||||
if(partition.Start >= partition.End)
|
||||
return;
|
||||
|
||||
byte[] sector = imagePlugin.ReadSector(partition.PartitionStartSector);
|
||||
byte[] sector = imagePlugin.ReadSector(partition.Start);
|
||||
ApfsContainerSuperBlock nxSb;
|
||||
|
||||
try
|
||||
|
||||
@@ -272,7 +272,7 @@ namespace DiscImageChef.Filesystems
|
||||
// TODO: BBC Master hard disks are untested...
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if(partition.PartitionStartSector >= partition.PartitionEndSector)
|
||||
if(partition.Start >= partition.End)
|
||||
return false;
|
||||
|
||||
ulong sbSector;
|
||||
@@ -285,7 +285,7 @@ namespace DiscImageChef.Filesystems
|
||||
GCHandle ptr;
|
||||
|
||||
// ADFS-S, ADFS-M, ADFS-L, ADFS-D without partitions
|
||||
if(partition.PartitionStartSector == 0)
|
||||
if(partition.Start == 0)
|
||||
{
|
||||
OldMapSector0 oldMap0;
|
||||
OldMapSector1 oldMap1;
|
||||
@@ -381,7 +381,7 @@ namespace DiscImageChef.Filesystems
|
||||
// Partitioning or not, new formats follow:
|
||||
DiscRecord drSb;
|
||||
|
||||
sector = imagePlugin.ReadSector(partition.PartitionStartSector);
|
||||
sector = imagePlugin.ReadSector(partition.Start);
|
||||
byte newChk = NewMapChecksum(sector);
|
||||
DicConsole.DebugWriteLine("ADFS Plugin", "newChk = {0}", newChk);
|
||||
DicConsole.DebugWriteLine("ADFS Plugin", "map.zoneChecksum = {0}", sector[0]);
|
||||
@@ -391,7 +391,7 @@ namespace DiscImageChef.Filesystems
|
||||
if(bootBlockSize % imagePlugin.ImageInfo.sectorSize > 0)
|
||||
sectorsToRead++;
|
||||
|
||||
byte[] bootSector = imagePlugin.ReadSectors(sbSector + partition.PartitionStartSector, sectorsToRead);
|
||||
byte[] bootSector = imagePlugin.ReadSectors(sbSector + partition.Start, sectorsToRead);
|
||||
int bootChk = 0;
|
||||
for(int i = 0; i < 0x1FF; i++)
|
||||
bootChk = ((bootChk & 0xFF) + (bootChk >> 8) + bootSector[i]);
|
||||
@@ -460,7 +460,7 @@ namespace DiscImageChef.Filesystems
|
||||
string discname;
|
||||
|
||||
// ADFS-S, ADFS-M, ADFS-L, ADFS-D without partitions
|
||||
if(partition.PartitionStartSector == 0)
|
||||
if(partition.Start == 0)
|
||||
{
|
||||
OldMapSector0 oldMap0;
|
||||
OldMapSector1 oldMap1;
|
||||
@@ -595,7 +595,7 @@ namespace DiscImageChef.Filesystems
|
||||
// Partitioning or not, new formats follow:
|
||||
DiscRecord drSb;
|
||||
|
||||
sector = imagePlugin.ReadSector(partition.PartitionStartSector);
|
||||
sector = imagePlugin.ReadSector(partition.Start);
|
||||
byte newChk = NewMapChecksum(sector);
|
||||
DicConsole.DebugWriteLine("ADFS Plugin", "newChk = {0}", newChk);
|
||||
DicConsole.DebugWriteLine("ADFS Plugin", "map.zoneChecksum = {0}", sector[0]);
|
||||
@@ -605,7 +605,7 @@ namespace DiscImageChef.Filesystems
|
||||
if(bootBlockSize % imagePlugin.ImageInfo.sectorSize > 0)
|
||||
sectorsToRead++;
|
||||
|
||||
byte[] bootSector = imagePlugin.ReadSectors(sbSector + partition.PartitionStartSector, sectorsToRead);
|
||||
byte[] bootSector = imagePlugin.ReadSectors(sbSector + partition.Start, sectorsToRead);
|
||||
int bootChk = 0;
|
||||
for(int i = 0; i < 0x1FF; i++)
|
||||
bootChk = ((bootChk & 0xFF) + (bootChk >> 8) + bootSector[i]);
|
||||
|
||||
@@ -206,7 +206,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if(partition.PartitionStartSector >= partition.PartitionEndSector)
|
||||
if(partition.Start >= partition.End)
|
||||
return false;
|
||||
|
||||
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
|
||||
@@ -217,14 +217,14 @@ namespace DiscImageChef.Filesystems
|
||||
// However while you can set a block size different from the sector size on formatting, the bootblock block
|
||||
// size for floppies is the sector size, and for RDB is usually is the hard disk sector size,
|
||||
// so this is not entirely wrong...
|
||||
byte[] sector = imagePlugin.ReadSectors(0 + partition.PartitionStartSector, 2);
|
||||
byte[] sector = imagePlugin.ReadSectors(0 + partition.Start, 2);
|
||||
BootBlock bblk = BigEndianMarshal.ByteArrayToStructureBigEndian<BootBlock>(sector);
|
||||
|
||||
// AROS boot floppies...
|
||||
if(sector.Length >= 512 && sector[510] == 0x55 && sector[511] == 0xAA &&
|
||||
(bblk.diskType & FFS_Mask) != FFS_Mask && (bblk.diskType & MuFS_Mask) != MuFS_Mask)
|
||||
{
|
||||
sector = imagePlugin.ReadSectors(1 + partition.PartitionStartSector, 2);
|
||||
sector = imagePlugin.ReadSectors(1 + partition.Start, 2);
|
||||
bblk = BigEndianMarshal.ByteArrayToStructureBigEndian<BootBlock>(sector);
|
||||
}
|
||||
|
||||
@@ -245,19 +245,19 @@ namespace DiscImageChef.Filesystems
|
||||
// If bootblock is correct, let's take its rootblock pointer
|
||||
if(bsum == bblk.checksum)
|
||||
{
|
||||
b_root_ptr = bblk.root_ptr + partition.PartitionStartSector;
|
||||
b_root_ptr = bblk.root_ptr + partition.Start;
|
||||
DicConsole.DebugWriteLine("AmigaDOS plugin", "Bootblock points to {0} as Rootblock", b_root_ptr);
|
||||
}
|
||||
|
||||
ulong[] root_ptrs = { b_root_ptr + partition.PartitionStartSector, ((partition.PartitionEndSector - partition.PartitionStartSector) + 1) / 2 + partition.PartitionStartSector - 2,
|
||||
((partition.PartitionEndSector - partition.PartitionStartSector) + 1) / 2 + partition.PartitionStartSector - 1, ((partition.PartitionEndSector - partition.PartitionStartSector) + 1) / 2 + partition.PartitionStartSector};
|
||||
ulong[] root_ptrs = { b_root_ptr + partition.Start, ((partition.End - partition.Start) + 1) / 2 + partition.Start - 2,
|
||||
((partition.End - partition.Start) + 1) / 2 + partition.Start - 1, ((partition.End - partition.Start) + 1) / 2 + partition.Start};
|
||||
|
||||
RootBlock rblk = new RootBlock();
|
||||
|
||||
// So to handle even number of sectors
|
||||
foreach(ulong root_ptr in root_ptrs)
|
||||
{
|
||||
if(root_ptr >= partition.PartitionEndSector || root_ptr < partition.PartitionStartSector)
|
||||
if(root_ptr >= partition.End || root_ptr < partition.Start)
|
||||
continue;
|
||||
|
||||
DicConsole.DebugWriteLine("AmigaDOS plugin", "Searching for Rootblock in sector {0}", root_ptr);
|
||||
@@ -282,7 +282,7 @@ namespace DiscImageChef.Filesystems
|
||||
if(blockSize % sector.Length > 0)
|
||||
sectorsPerBlock++;
|
||||
|
||||
if(root_ptr + sectorsPerBlock >= partition.PartitionEndSector)
|
||||
if(root_ptr + sectorsPerBlock >= partition.End)
|
||||
continue;
|
||||
|
||||
sector = imagePlugin.ReadSectors(root_ptr, sectorsPerBlock);
|
||||
@@ -312,7 +312,7 @@ namespace DiscImageChef.Filesystems
|
||||
information = null;
|
||||
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
|
||||
|
||||
byte[] BootBlockSectors = imagePlugin.ReadSectors(0 + partition.PartitionStartSector, 2);
|
||||
byte[] BootBlockSectors = imagePlugin.ReadSectors(0 + partition.Start, 2);
|
||||
|
||||
BootBlock bootBlk = BigEndianMarshal.ByteArrayToStructureBigEndian<BootBlock>(BootBlockSectors);
|
||||
bootBlk.bootCode = new byte[BootBlockSectors.Length - 12];
|
||||
@@ -325,12 +325,12 @@ namespace DiscImageChef.Filesystems
|
||||
// If bootblock is correct, let's take its rootblock pointer
|
||||
if(bsum == bootBlk.checksum)
|
||||
{
|
||||
b_root_ptr = bootBlk.root_ptr + partition.PartitionStartSector;
|
||||
b_root_ptr = bootBlk.root_ptr + partition.Start;
|
||||
DicConsole.DebugWriteLine("AmigaDOS plugin", "Bootblock points to {0} as Rootblock", b_root_ptr);
|
||||
}
|
||||
|
||||
ulong[] root_ptrs = { b_root_ptr + partition.PartitionStartSector, ((partition.PartitionEndSector - partition.PartitionStartSector) + 1) / 2 + partition.PartitionStartSector - 2,
|
||||
((partition.PartitionEndSector - partition.PartitionStartSector) + 1) / 2 + partition.PartitionStartSector - 1, ((partition.PartitionEndSector - partition.PartitionStartSector) + 1) / 2 + partition.PartitionStartSector};
|
||||
ulong[] root_ptrs = { b_root_ptr + partition.Start, ((partition.End - partition.Start) + 1) / 2 + partition.Start - 2,
|
||||
((partition.End - partition.Start) + 1) / 2 + partition.Start - 1, ((partition.End - partition.Start) + 1) / 2 + partition.Start};
|
||||
|
||||
RootBlock rootBlk = new RootBlock();
|
||||
byte[] RootBlockSector = null;
|
||||
@@ -341,7 +341,7 @@ namespace DiscImageChef.Filesystems
|
||||
// So to handle even number of sectors
|
||||
foreach(ulong root_ptr in root_ptrs)
|
||||
{
|
||||
if(root_ptr >= partition.PartitionEndSector || root_ptr < partition.PartitionStartSector)
|
||||
if(root_ptr >= partition.End || root_ptr < partition.Start)
|
||||
continue;
|
||||
|
||||
DicConsole.DebugWriteLine("AmigaDOS plugin", "Searching for Rootblock in sector {0}", root_ptr);
|
||||
@@ -366,7 +366,7 @@ namespace DiscImageChef.Filesystems
|
||||
if(blockSize % RootBlockSector.Length > 0)
|
||||
sectorsPerBlock++;
|
||||
|
||||
if(root_ptr + sectorsPerBlock >= partition.PartitionEndSector)
|
||||
if(root_ptr + sectorsPerBlock >= partition.End)
|
||||
continue;
|
||||
|
||||
RootBlockSector = imagePlugin.ReadSectors(root_ptr, sectorsPerBlock);
|
||||
@@ -458,7 +458,7 @@ namespace DiscImageChef.Filesystems
|
||||
if((bootBlk.diskType & 0xFF) == 4 || (bootBlk.diskType & 0xFF) == 5)
|
||||
sbInformation.AppendFormat("Directory cache starts at block {0}", rootBlk.extension).AppendLine();
|
||||
|
||||
long blocks = (long)((((partition.PartitionEndSector - partition.PartitionStartSector) + 1) * imagePlugin.ImageInfo.sectorSize) / blockSize);
|
||||
long blocks = (long)((((partition.End - partition.Start) + 1) * imagePlugin.ImageInfo.sectorSize) / blockSize);
|
||||
|
||||
sbInformation.AppendFormat("Volume block size is {0} bytes", blockSize).AppendLine();
|
||||
sbInformation.AppendFormat("Volume has {0} blocks", blocks).AppendLine();
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace DiscImageChef.Filesystems.AppleDOS
|
||||
public AppleDOS(ImagePlugin imagePlugin, Partition partition, Encoding encoding)
|
||||
{
|
||||
device = imagePlugin;
|
||||
start = partition.PartitionStartSector;
|
||||
start = partition.Start;
|
||||
Name = "Apple DOS File System";
|
||||
PluginUUID = new Guid("8658A1E9-B2E7-4BCC-9638-157A31B0A700\n");
|
||||
if(encoding == null) // TODO: Until Apple ][ encoding is implemented
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace DiscImageChef.Filesystems.AppleDOS
|
||||
if(imagePlugin.ImageInfo.sectors != 455 && imagePlugin.ImageInfo.sectors != 560)
|
||||
return false;
|
||||
|
||||
if(partition.PartitionStartSector > 0 || imagePlugin.ImageInfo.sectorSize != 256)
|
||||
if(partition.Start > 0 || imagePlugin.ImageInfo.sectorSize != 256)
|
||||
return false;
|
||||
|
||||
int spt = 0;
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if((2 + partition.PartitionStartSector) >= partition.PartitionEndSector)
|
||||
if((2 + partition.Start) >= partition.End)
|
||||
return false;
|
||||
|
||||
byte[] mdb_sector;
|
||||
@@ -81,7 +81,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
if(imagePlugin.GetSectorSize() == 2352 || imagePlugin.GetSectorSize() == 2448 || imagePlugin.GetSectorSize() == 2048)
|
||||
{
|
||||
mdb_sector = imagePlugin.ReadSector(2 + partition.PartitionStartSector);
|
||||
mdb_sector = imagePlugin.ReadSector(2 + partition.Start);
|
||||
drSigWord = BigEndianBitConverter.ToUInt16(mdb_sector, 0);
|
||||
|
||||
if(drSigWord == HFS_MAGIC)
|
||||
@@ -90,7 +90,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
return drSigWord != HFSP_MAGIC;
|
||||
}
|
||||
mdb_sector = Read2048SectorAs512(imagePlugin, 2 + partition.PartitionStartSector * 4);
|
||||
mdb_sector = Read2048SectorAs512(imagePlugin, 2 + partition.Start * 4);
|
||||
drSigWord = BigEndianBitConverter.ToUInt16(mdb_sector, 0);
|
||||
|
||||
if(drSigWord == HFS_MAGIC)
|
||||
@@ -104,7 +104,7 @@ namespace DiscImageChef.Filesystems
|
||||
}
|
||||
else
|
||||
{
|
||||
mdb_sector = imagePlugin.ReadSector(2 + partition.PartitionStartSector);
|
||||
mdb_sector = imagePlugin.ReadSector(2 + partition.Start);
|
||||
drSigWord = BigEndianBitConverter.ToUInt16(mdb_sector, 0);
|
||||
|
||||
if(drSigWord == HFS_MAGIC)
|
||||
@@ -136,21 +136,21 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
if(imagePlugin.GetSectorSize() == 2352 || imagePlugin.GetSectorSize() == 2448 || imagePlugin.GetSectorSize() == 2048)
|
||||
{
|
||||
mdb_sector = imagePlugin.ReadSector(2 + partition.PartitionStartSector);
|
||||
mdb_sector = imagePlugin.ReadSector(2 + partition.Start);
|
||||
drSigWord = BigEndianBitConverter.ToUInt16(mdb_sector, 0);
|
||||
|
||||
if(drSigWord == HFS_MAGIC)
|
||||
{
|
||||
bb_sector = imagePlugin.ReadSector(partition.PartitionStartSector);
|
||||
bb_sector = imagePlugin.ReadSector(partition.Start);
|
||||
}
|
||||
else
|
||||
{
|
||||
mdb_sector = Read2048SectorAs512(imagePlugin, 2 + partition.PartitionStartSector * 4);
|
||||
mdb_sector = Read2048SectorAs512(imagePlugin, 2 + partition.Start * 4);
|
||||
drSigWord = BigEndianBitConverter.ToUInt16(mdb_sector, 0);
|
||||
|
||||
if(drSigWord == HFS_MAGIC)
|
||||
{
|
||||
bb_sector = Read2048SectorAs512(imagePlugin, partition.PartitionStartSector * 4);
|
||||
bb_sector = Read2048SectorAs512(imagePlugin, partition.Start * 4);
|
||||
APMFromHDDOnCD = true;
|
||||
}
|
||||
else
|
||||
@@ -159,11 +159,11 @@ namespace DiscImageChef.Filesystems
|
||||
}
|
||||
else
|
||||
{
|
||||
mdb_sector = imagePlugin.ReadSector(2 + partition.PartitionStartSector);
|
||||
mdb_sector = imagePlugin.ReadSector(2 + partition.Start);
|
||||
drSigWord = BigEndianBitConverter.ToUInt16(mdb_sector, 0);
|
||||
|
||||
if(drSigWord == HFS_MAGIC)
|
||||
bb_sector = imagePlugin.ReadSector(partition.PartitionStartSector);
|
||||
bb_sector = imagePlugin.ReadSector(partition.Start);
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if((2 + partition.PartitionStartSector) >= partition.PartitionEndSector)
|
||||
if((2 + partition.Start) >= partition.End)
|
||||
return false;
|
||||
|
||||
ushort drSigWord;
|
||||
@@ -82,7 +82,7 @@ namespace DiscImageChef.Filesystems
|
||||
byte[] vh_sector;
|
||||
ulong hfsp_offset;
|
||||
|
||||
vh_sector = imagePlugin.ReadSector(2 + partition.PartitionStartSector); // Read volume header, of HFS Wrapper MDB
|
||||
vh_sector = imagePlugin.ReadSector(2 + partition.Start); // Read volume header, of HFS Wrapper MDB
|
||||
|
||||
drSigWord = BigEndianBitConverter.ToUInt16(vh_sector, 0); // Check for HFS Wrapper MDB
|
||||
|
||||
@@ -110,7 +110,7 @@ namespace DiscImageChef.Filesystems
|
||||
hfsp_offset = 0;
|
||||
}
|
||||
|
||||
vh_sector = imagePlugin.ReadSector(2 + partition.PartitionStartSector + hfsp_offset); // Read volume header
|
||||
vh_sector = imagePlugin.ReadSector(2 + partition.Start + hfsp_offset); // Read volume header
|
||||
|
||||
drSigWord = BigEndianBitConverter.ToUInt16(vh_sector, 0);
|
||||
if(drSigWord == HFSP_MAGIC || drSigWord == HFSX_MAGIC)
|
||||
@@ -132,7 +132,7 @@ namespace DiscImageChef.Filesystems
|
||||
bool wrapped;
|
||||
byte[] vh_sector;
|
||||
|
||||
vh_sector = imagePlugin.ReadSector(2 + partition.PartitionStartSector); // Read volume header, of HFS Wrapper MDB
|
||||
vh_sector = imagePlugin.ReadSector(2 + partition.Start); // Read volume header, of HFS Wrapper MDB
|
||||
|
||||
drSigWord = BigEndianBitConverter.ToUInt16(vh_sector, 0); // Check for HFS Wrapper MDB
|
||||
|
||||
@@ -163,7 +163,7 @@ namespace DiscImageChef.Filesystems
|
||||
wrapped = false;
|
||||
}
|
||||
|
||||
vh_sector = imagePlugin.ReadSector(2 + partition.PartitionStartSector + hfsp_offset); // Read volume header
|
||||
vh_sector = imagePlugin.ReadSector(2 + partition.Start + hfsp_offset); // Read volume header
|
||||
|
||||
HPVH.signature = BigEndianBitConverter.ToUInt16(vh_sector, 0x000);
|
||||
if(HPVH.signature == HFSP_MAGIC || HPVH.signature == HFSX_MAGIC)
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace DiscImageChef.Filesystems.AppleMFS
|
||||
Name = "Apple Macintosh File System";
|
||||
PluginUUID = new Guid("36405F8D-0D26-4066-6538-5DBF5D065C3A");
|
||||
device = imagePlugin;
|
||||
partitionStart = partition.PartitionStartSector;
|
||||
partitionStart = partition.Start;
|
||||
if(encoding == null)
|
||||
CurrentEncoding = Encoding.GetEncoding("macintosh");
|
||||
}
|
||||
|
||||
@@ -43,10 +43,10 @@ namespace DiscImageChef.Filesystems.AppleMFS
|
||||
{
|
||||
ushort drSigWord;
|
||||
|
||||
if((2 + partition.PartitionStartSector) >= partition.PartitionEndSector)
|
||||
if((2 + partition.Start) >= partition.End)
|
||||
return false;
|
||||
|
||||
byte[] mdb_sector = imagePlugin.ReadSector(2 + partition.PartitionStartSector);
|
||||
byte[] mdb_sector = imagePlugin.ReadSector(2 + partition.Start);
|
||||
|
||||
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
|
||||
|
||||
@@ -67,8 +67,8 @@ namespace DiscImageChef.Filesystems.AppleMFS
|
||||
byte[] pString = new byte[16];
|
||||
byte[] variable_size;
|
||||
|
||||
byte[] mdb_sector = imagePlugin.ReadSector(2 + partition.PartitionStartSector);
|
||||
byte[] bb_sector = imagePlugin.ReadSector(0 + partition.PartitionStartSector);
|
||||
byte[] mdb_sector = imagePlugin.ReadSector(2 + partition.Start);
|
||||
byte[] bb_sector = imagePlugin.ReadSector(0 + partition.Start);
|
||||
|
||||
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
|
||||
|
||||
|
||||
@@ -69,13 +69,13 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if((2 + partition.PartitionStartSector) >= partition.PartitionEndSector)
|
||||
if((2 + partition.Start) >= partition.End)
|
||||
return false;
|
||||
|
||||
uint magic;
|
||||
uint magic_be;
|
||||
|
||||
byte[] sb_sector = imagePlugin.ReadSector(0 + partition.PartitionStartSector);
|
||||
byte[] sb_sector = imagePlugin.ReadSector(0 + partition.Start);
|
||||
|
||||
magic = BitConverter.ToUInt32(sb_sector, 0x20);
|
||||
magic_be = BigEndianBitConverter.ToUInt32(sb_sector, 0x20);
|
||||
@@ -92,7 +92,7 @@ namespace DiscImageChef.Filesystems
|
||||
if(magic == BEFS_MAGIC1 || magic_be == BEFS_MAGIC1)
|
||||
return true;
|
||||
|
||||
sb_sector = imagePlugin.ReadSector(1 + partition.PartitionStartSector);
|
||||
sb_sector = imagePlugin.ReadSector(1 + partition.Start);
|
||||
|
||||
magic = BitConverter.ToUInt32(sb_sector, 0x20);
|
||||
magic_be = BigEndianBitConverter.ToUInt32(sb_sector, 0x20);
|
||||
@@ -111,7 +111,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
BeSuperBlock besb = new BeSuperBlock();
|
||||
|
||||
byte[] sb_sector = imagePlugin.ReadSector(0 + partition.PartitionStartSector);
|
||||
byte[] sb_sector = imagePlugin.ReadSector(0 + partition.Start);
|
||||
|
||||
BigEndianBitConverter.IsLittleEndian = true; // Default for little-endian
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace DiscImageChef.Filesystems
|
||||
}
|
||||
else
|
||||
{
|
||||
sb_sector = imagePlugin.ReadSector(1 + partition.PartitionStartSector);
|
||||
sb_sector = imagePlugin.ReadSector(1 + partition.Start);
|
||||
besb.magic1 = BigEndianBitConverter.ToUInt32(sb_sector, 0x20);
|
||||
|
||||
if(besb.magic1 == BEFS_MAGIC1 || besb.magic1 == BEFS_CIGAM1) // There is a boot sector
|
||||
@@ -131,7 +131,7 @@ namespace DiscImageChef.Filesystems
|
||||
}
|
||||
else if(sb_sector.Length >= 0x400)
|
||||
{
|
||||
byte[] temp = imagePlugin.ReadSector(0 + partition.PartitionStartSector);
|
||||
byte[] temp = imagePlugin.ReadSector(0 + partition.Start);
|
||||
besb.magic1 = BigEndianBitConverter.ToUInt32(temp, 0x220);
|
||||
|
||||
if(besb.magic1 == BEFS_MAGIC1 || besb.magic1 == BEFS_CIGAM1) // There is a boot sector
|
||||
|
||||
@@ -124,16 +124,16 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if(partition.PartitionStartSector >= partition.PartitionEndSector)
|
||||
if(partition.Start >= partition.End)
|
||||
return false;
|
||||
|
||||
ulong sbSectorOff = 0x10000 / imagePlugin.GetSectorSize();
|
||||
uint sbSectorSize = 0x1000 / imagePlugin.GetSectorSize();
|
||||
|
||||
if((sbSectorOff + sbSectorSize) >= partition.PartitionEndSector)
|
||||
if((sbSectorOff + sbSectorSize) >= partition.End)
|
||||
return false;
|
||||
|
||||
byte[] sector = imagePlugin.ReadSectors(sbSectorOff + partition.PartitionStartSector, sbSectorSize);
|
||||
byte[] sector = imagePlugin.ReadSectors(sbSectorOff + partition.Start, sbSectorSize);
|
||||
SuperBlock btrfsSb;
|
||||
|
||||
try
|
||||
@@ -150,7 +150,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
DicConsole.DebugWriteLine("BTRFS Plugin", "sbSectorOff = {0}", sbSectorOff);
|
||||
DicConsole.DebugWriteLine("BTRFS Plugin", "sbSectorSize = {0}", sbSectorSize);
|
||||
DicConsole.DebugWriteLine("BTRFS Plugin", "partition.PartitionStartSector = {0}", partition.PartitionStartSector);
|
||||
DicConsole.DebugWriteLine("BTRFS Plugin", "partition.PartitionStartSector = {0}", partition.Start);
|
||||
DicConsole.DebugWriteLine("BTRFS Plugin", "btrfsSb.magic = 0x{0:X16}", btrfsSb.magic);
|
||||
|
||||
return btrfsSb.magic == btrfsMagic;
|
||||
@@ -165,7 +165,7 @@ namespace DiscImageChef.Filesystems
|
||||
ulong sbSectorOff = 0x10000 / imagePlugin.GetSectorSize();
|
||||
uint sbSectorSize = 0x1000 / imagePlugin.GetSectorSize();
|
||||
|
||||
byte[] sector = imagePlugin.ReadSectors(sbSectorOff + partition.PartitionStartSector, sbSectorSize);
|
||||
byte[] sector = imagePlugin.ReadSectors(sbSectorOff + partition.Start, sbSectorSize);
|
||||
SuperBlock btrfsSb;
|
||||
|
||||
GCHandle handle = GCHandle.Alloc(sector, GCHandleType.Pinned);
|
||||
|
||||
@@ -182,7 +182,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if(partition.PartitionStartSector > 0)
|
||||
if(partition.Start > 0)
|
||||
return false;
|
||||
|
||||
if(imagePlugin.ImageInfo.sectorSize != 256)
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace DiscImageChef.Filesystems.CPM
|
||||
if(!cpmFound)
|
||||
{
|
||||
// Read CHS = {0,0,1}
|
||||
sector = imagePlugin.ReadSector(0 + partition.PartitionStartSector);
|
||||
sector = imagePlugin.ReadSector(0 + partition.Start);
|
||||
int amsSbOffset = 0;
|
||||
|
||||
uint sig1, sig2, sig3;
|
||||
@@ -123,7 +123,7 @@ namespace DiscImageChef.Filesystems.CPM
|
||||
dpb.phm += (byte)Math.Pow(2, i);
|
||||
dpb.spt = (ushort)(amsSb.spt * (sectorSize / 128));
|
||||
uint directoryLength = (uint)((((ulong)dpb.drm + 1) * 32) / sectorSize);
|
||||
directory = imagePlugin.ReadSector(firstDirectorySector + partition.PartitionStartSector, directoryLength);
|
||||
directory = imagePlugin.ReadSector(firstDirectorySector + partition.Start, directoryLength);
|
||||
|
||||
// Build a CP/M disk definition
|
||||
workingDefinition = new CpmDefinition();
|
||||
@@ -180,7 +180,7 @@ namespace DiscImageChef.Filesystems.CPM
|
||||
if(!cpmFound)
|
||||
{
|
||||
// Read CHS = {0,0,4}
|
||||
sector = imagePlugin.ReadSector(3 + partition.PartitionStartSector);
|
||||
sector = imagePlugin.ReadSector(3 + partition.Start);
|
||||
ushort sum = 0;
|
||||
|
||||
// Sum of all 16-bit words that make this sector must be 0
|
||||
@@ -205,8 +205,8 @@ namespace DiscImageChef.Filesystems.CPM
|
||||
|
||||
// If volume size corresponds with working partition (this variant will be inside MBR partitioning)
|
||||
if(sectorSize == imagePlugin.GetSectorSize() &&
|
||||
startingSector == partition.PartitionStartSector &&
|
||||
sectorsInPartition + partition.PartitionStartSector <= partition.PartitionEndSector)
|
||||
startingSector == partition.Start &&
|
||||
sectorsInPartition + partition.Start <= partition.End)
|
||||
{
|
||||
cpmFound = true;
|
||||
firstDirectorySector = (ulong)((hddSb.off * hddSb.sectorsPerTrack));
|
||||
@@ -226,7 +226,7 @@ namespace DiscImageChef.Filesystems.CPM
|
||||
dpb.psh = 0; // Needed?
|
||||
dpb.spt = hddSb.spt;
|
||||
uint directoryLength = (uint)((((ulong)dpb.drm + 1) * 32) / sectorSize);
|
||||
directory = imagePlugin.ReadSector(firstDirectorySector + partition.PartitionStartSector, directoryLength);
|
||||
directory = imagePlugin.ReadSector(firstDirectorySector + partition.Start, directoryLength);
|
||||
DicConsole.DebugWriteLine("CP/M Plugin", "Found CP/M-86 hard disk superblock.");
|
||||
|
||||
// Build a CP/M disk definition
|
||||
@@ -268,7 +268,7 @@ namespace DiscImageChef.Filesystems.CPM
|
||||
if(!cpmFound)
|
||||
{
|
||||
// Read CHS = {0,0,1}
|
||||
sector = imagePlugin.ReadSector(0 + partition.PartitionStartSector);
|
||||
sector = imagePlugin.ReadSector(0 + partition.Start);
|
||||
byte formatByte;
|
||||
|
||||
// Check for alternate location of format ID
|
||||
@@ -650,7 +650,7 @@ namespace DiscImageChef.Filesystems.CPM
|
||||
if(cpmFound)
|
||||
{
|
||||
uint directoryLength = (uint)((((ulong)dpb.drm + 1) * 32) / imagePlugin.GetSectorSize());
|
||||
directory = imagePlugin.ReadSector(firstDirectorySector86 + partition.PartitionStartSector, directoryLength);
|
||||
directory = imagePlugin.ReadSector(firstDirectorySector86 + partition.Start, directoryLength);
|
||||
DicConsole.DebugWriteLine("CP/M Plugin", "Found CP/M-86 floppy identifier.");
|
||||
}
|
||||
}
|
||||
@@ -741,7 +741,7 @@ namespace DiscImageChef.Filesystems.CPM
|
||||
MemoryStream ms = new MemoryStream();
|
||||
for(int p = 0; p < dirLen; p++)
|
||||
{
|
||||
byte[] dirSector = imagePlugin.ReadSector((ulong)((int)offset + (int)partition.PartitionStartSector + (p / sectorMask.Length) * sectorMask.Length + sectorMask[p % sectorMask.Length]));
|
||||
byte[] dirSector = imagePlugin.ReadSector((ulong)((int)offset + (int)partition.Start + (p / sectorMask.Length) * sectorMask.Length + sectorMask[p % sectorMask.Length]));
|
||||
ms.Write(dirSector, 0, dirSector.Length);
|
||||
}
|
||||
directory = ms.ToArray();
|
||||
@@ -923,7 +923,7 @@ namespace DiscImageChef.Filesystems.CPM
|
||||
if(dpb.dsm > 0)
|
||||
xmlFSType.Clusters = ((dpb.dsm + 1) * 128) / (128 << dpb.bsh);
|
||||
else
|
||||
xmlFSType.Clusters = (long)(partition.PartitionEndSector - partition.PartitionStartSector);
|
||||
xmlFSType.Clusters = (long)(partition.End - partition.Start);
|
||||
if(labelCreationDate != null)
|
||||
{
|
||||
xmlFSType.CreationDate = DateHandlers.CPMToDateTime(labelCreationDate);
|
||||
|
||||
@@ -111,9 +111,9 @@ namespace DiscImageChef.Filesystems.CPM
|
||||
{
|
||||
DicConsole.DebugWriteLine("CP/M Plugin", "Deinterleaving whole volume.");
|
||||
|
||||
for(int p = 0; p <= (int)(partition.PartitionEndSector - partition.PartitionStartSector); p++)
|
||||
for(int p = 0; p <= (int)(partition.End - partition.Start); p++)
|
||||
{
|
||||
byte[] readSector = device.ReadSector((ulong)((int)partition.PartitionStartSector + (p / sectorMask.Length) * sectorMask.Length + sectorMask[p % sectorMask.Length]));
|
||||
byte[] readSector = device.ReadSector((ulong)((int)partition.Start + (p / sectorMask.Length) * sectorMask.Length + sectorMask[p % sectorMask.Length]));
|
||||
if(workingDefinition.complement)
|
||||
{
|
||||
for(int b = 0; b < readSector.Length; b++)
|
||||
|
||||
@@ -89,10 +89,10 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if(partition.PartitionStartSector >= partition.PartitionEndSector)
|
||||
if(partition.Start >= partition.End)
|
||||
return false;
|
||||
|
||||
byte[] sector = imagePlugin.ReadSector(partition.PartitionStartSector);
|
||||
byte[] sector = imagePlugin.ReadSector(partition.Start);
|
||||
|
||||
uint magic = BitConverter.ToUInt32(sector, 0x00);
|
||||
|
||||
@@ -101,7 +101,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, Partition partition, out string information)
|
||||
{
|
||||
byte[] sector = imagePlugin.ReadSector(partition.PartitionStartSector);
|
||||
byte[] sector = imagePlugin.ReadSector(partition.Start);
|
||||
uint magic = BitConverter.ToUInt32(sector, 0x00);
|
||||
|
||||
CramSuperBlock crSb = new CramSuperBlock();
|
||||
|
||||
@@ -88,10 +88,10 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if(partition.PartitionStartSector > 0)
|
||||
if(partition.Start > 0)
|
||||
return false;
|
||||
|
||||
if(partition.PartitionEndSector < 8)
|
||||
if(partition.End < 8)
|
||||
return false;
|
||||
|
||||
byte[] sector = imagePlugin.ReadSector(6);
|
||||
@@ -128,7 +128,7 @@ namespace DiscImageChef.Filesystems
|
||||
xmlFSType = new Schemas.FileSystemType();
|
||||
xmlFSType.Type = "ECMA-67";
|
||||
xmlFSType.ClusterSize = 256;
|
||||
xmlFSType.Clusters = (long)(partition.PartitionEndSector - partition.PartitionStartSector + 1);
|
||||
xmlFSType.Clusters = (long)(partition.End - partition.Start + 1);
|
||||
xmlFSType.VolumeName = Encoding.ASCII.GetString(vol.volumeIdentifier);
|
||||
|
||||
information = sbInformation.ToString();
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace DiscImageChef.Filesystems
|
||||
if(Marshal.SizeOf(f2fsSb) % imagePlugin.GetSectorSize() != 0)
|
||||
sbSize++;
|
||||
|
||||
byte[] sector = imagePlugin.ReadSectors(partition.PartitionStartSector + sbAddr, sbSize);
|
||||
byte[] sector = imagePlugin.ReadSectors(partition.Start + sbAddr, sbSize);
|
||||
if(sector.Length < Marshal.SizeOf(f2fsSb))
|
||||
return false;
|
||||
|
||||
@@ -167,7 +167,7 @@ namespace DiscImageChef.Filesystems
|
||||
if(Marshal.SizeOf(f2fsSb) % imagePlugin.GetSectorSize() != 0)
|
||||
sbSize++;
|
||||
|
||||
byte[] sector = imagePlugin.ReadSectors(partition.PartitionStartSector + sbAddr, sbSize);
|
||||
byte[] sector = imagePlugin.ReadSectors(partition.Start + sbAddr, sbSize);
|
||||
if(sector.Length < Marshal.SizeOf(f2fsSb))
|
||||
return;
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if((2 + partition.PartitionStartSector) >= partition.PartitionEndSector)
|
||||
if((2 + partition.Start) >= partition.End)
|
||||
return false;
|
||||
|
||||
ushort bps;
|
||||
@@ -81,8 +81,8 @@ namespace DiscImageChef.Filesystems
|
||||
byte[] atari_oem = new byte[6];
|
||||
ushort bootable = 0;
|
||||
|
||||
byte[] bpb_sector = imagePlugin.ReadSector(0 + partition.PartitionStartSector);
|
||||
byte[] fat_sector = imagePlugin.ReadSector(1 + partition.PartitionStartSector);
|
||||
byte[] bpb_sector = imagePlugin.ReadSector(0 + partition.Start);
|
||||
byte[] fat_sector = imagePlugin.ReadSector(1 + partition.Start);
|
||||
|
||||
Array.Copy(bpb_sector, 0x02, atari_oem, 0, 6);
|
||||
Array.Copy(bpb_sector, 0x03, dos_oem, 0, 8);
|
||||
@@ -145,7 +145,7 @@ namespace DiscImageChef.Filesystems
|
||||
// HPFS
|
||||
uint hpfs_magic1, hpfs_magic2;
|
||||
|
||||
byte[] hpfs_sb_sector = imagePlugin.ReadSector(16 + partition.PartitionStartSector); // Seek to superblock, on logical sector 16
|
||||
byte[] hpfs_sb_sector = imagePlugin.ReadSector(16 + partition.Start); // Seek to superblock, on logical sector 16
|
||||
hpfs_magic1 = BitConverter.ToUInt32(hpfs_sb_sector, 0x000);
|
||||
hpfs_magic2 = BitConverter.ToUInt32(hpfs_sb_sector, 0x004);
|
||||
|
||||
@@ -157,20 +157,20 @@ namespace DiscImageChef.Filesystems
|
||||
return true;
|
||||
// short FAT32
|
||||
if(bits_in_bps == 1 && correct_spc && fats_no <= 2 && sectors == 0 && fat_sectors == 0 && fat32_signature == 0x28)
|
||||
return big_sectors == 0 ? huge_sectors <= (partition.PartitionEndSector - partition.PartitionStartSector) + 1 : big_sectors <= (partition.PartitionEndSector - partition.PartitionStartSector) + 1;
|
||||
return big_sectors == 0 ? huge_sectors <= (partition.End - partition.Start) + 1 : big_sectors <= (partition.End - partition.Start) + 1;
|
||||
// MSX-DOS FAT12
|
||||
if(bits_in_bps == 1 && correct_spc && fats_no <= 2 && root_entries > 0 && sectors <= (partition.PartitionEndSector - partition.PartitionStartSector) + 1 && fat_sectors > 0 && msx_string == "VOL_ID")
|
||||
if(bits_in_bps == 1 && correct_spc && fats_no <= 2 && root_entries > 0 && sectors <= (partition.End - partition.Start) + 1 && fat_sectors > 0 && msx_string == "VOL_ID")
|
||||
return true;
|
||||
// EBPB
|
||||
if(bits_in_bps == 1 && correct_spc && fats_no <= 2 && root_entries > 0 && fat_sectors > 0 && (bpb_signature == 0x28 || bpb_signature == 0x29))
|
||||
return sectors == 0 ? big_sectors <= (partition.PartitionEndSector - partition.PartitionStartSector) + 1 : sectors <= (partition.PartitionEndSector - partition.PartitionStartSector) + 1;
|
||||
return sectors == 0 ? big_sectors <= (partition.End - partition.Start) + 1 : sectors <= (partition.End - partition.Start) + 1;
|
||||
|
||||
// BPB
|
||||
if(bits_in_bps == 1 && correct_spc && reserved_secs < (partition.PartitionEndSector - partition.PartitionStartSector) && fats_no <= 2 && root_entries > 0 && fat_sectors > 0)
|
||||
return sectors == 0 ? big_sectors <= (partition.PartitionEndSector - partition.PartitionStartSector) + 1 : sectors <= (partition.PartitionEndSector - partition.PartitionStartSector) + 1;
|
||||
if(bits_in_bps == 1 && correct_spc && reserved_secs < (partition.End - partition.Start) && fats_no <= 2 && root_entries > 0 && fat_sectors > 0)
|
||||
return sectors == 0 ? big_sectors <= (partition.End - partition.Start) + 1 : sectors <= (partition.End - partition.Start) + 1;
|
||||
|
||||
// All FAT12 without BPB can only be used on floppies, without partitions.
|
||||
if(partition.PartitionStartSector != 0)
|
||||
if(partition.Start != 0)
|
||||
return false;
|
||||
|
||||
byte fat2 = fat_sector[1];
|
||||
@@ -218,7 +218,7 @@ namespace DiscImageChef.Filesystems
|
||||
break;
|
||||
}
|
||||
|
||||
if(fat2_sector_no > partition.PartitionEndSector)
|
||||
if(fat2_sector_no > partition.End)
|
||||
return false;
|
||||
|
||||
DicConsole.DebugWriteLine("FAT plugin", "2nd fat starts at = {0}", fat2_sector_no);
|
||||
@@ -263,7 +263,7 @@ namespace DiscImageChef.Filesystems
|
||||
FAT32ParameterBlockShort shortFat32BPB = new FAT32ParameterBlockShort();
|
||||
FAT32ParameterBlock Fat32BPB = new FAT32ParameterBlock();
|
||||
|
||||
byte[] bpb_sector = imagePlugin.ReadSector(partition.PartitionStartSector);
|
||||
byte[] bpb_sector = imagePlugin.ReadSector(partition.Start);
|
||||
|
||||
if(imagePlugin.ImageInfo.sectorSize >= 512)
|
||||
{
|
||||
@@ -313,9 +313,9 @@ namespace DiscImageChef.Filesystems
|
||||
else if(bits_in_bps_fat32_short == 1 && correct_spc_fat32_short && shortFat32BPB.fats_no <= 2 && shortFat32BPB.sectors == 0 && shortFat32BPB.spfat == 0 && shortFat32BPB.signature == 0x28)
|
||||
{
|
||||
DicConsole.DebugWriteLine("FAT plugin", "Using short FAT32 BPB");
|
||||
useShortFAT32 = shortFat32BPB.big_sectors == 0 ? shortFat32BPB.huge_sectors <= (partition.PartitionEndSector - partition.PartitionStartSector) + 1 : shortFat32BPB.big_sectors <= (partition.PartitionEndSector - partition.PartitionStartSector) + 1;
|
||||
useShortFAT32 = shortFat32BPB.big_sectors == 0 ? shortFat32BPB.huge_sectors <= (partition.End - partition.Start) + 1 : shortFat32BPB.big_sectors <= (partition.End - partition.Start) + 1;
|
||||
}
|
||||
else if(bits_in_bps_msx == 1 && correct_spc_msx && msxBPB.fats_no <= 2 && msxBPB.root_ent > 0 && msxBPB.sectors <= (partition.PartitionEndSector - partition.PartitionStartSector) + 1 && msxBPB.spfat > 0 && Encoding.ASCII.GetString(msxBPB.vol_id) == "VOL_ID")
|
||||
else if(bits_in_bps_msx == 1 && correct_spc_msx && msxBPB.fats_no <= 2 && msxBPB.root_ent > 0 && msxBPB.sectors <= (partition.End - partition.Start) + 1 && msxBPB.spfat > 0 && Encoding.ASCII.GetString(msxBPB.vol_id) == "VOL_ID")
|
||||
{
|
||||
DicConsole.DebugWriteLine("FAT plugin", "Using MSX BPB");
|
||||
useMSXBPB = true;
|
||||
@@ -324,7 +324,7 @@ namespace DiscImageChef.Filesystems
|
||||
{
|
||||
if(EBPB.sectors == 0)
|
||||
{
|
||||
if(EBPB.big_sectors <= (partition.PartitionEndSector - partition.PartitionStartSector) + 1)
|
||||
if(EBPB.big_sectors <= (partition.End - partition.Start) + 1)
|
||||
{
|
||||
if(EBPB.signature == 0x29)
|
||||
{
|
||||
@@ -338,7 +338,7 @@ namespace DiscImageChef.Filesystems
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(EBPB.sectors <= (partition.PartitionEndSector - partition.PartitionStartSector) + 1)
|
||||
else if(EBPB.sectors <= (partition.End - partition.Start) + 1)
|
||||
{
|
||||
if(EBPB.signature == 0x29)
|
||||
{
|
||||
@@ -352,14 +352,14 @@ namespace DiscImageChef.Filesystems
|
||||
}
|
||||
}
|
||||
}
|
||||
else if(bits_in_bps_dos33 == 1 && correct_spc_dos33 && dos33BPB.rsectors < (partition.PartitionEndSector - partition.PartitionStartSector) && dos33BPB.fats_no <= 2 && dos33BPB.root_ent > 0 && dos33BPB.spfat > 0)
|
||||
else if(bits_in_bps_dos33 == 1 && correct_spc_dos33 && dos33BPB.rsectors < (partition.End - partition.Start) && dos33BPB.fats_no <= 2 && dos33BPB.root_ent > 0 && dos33BPB.spfat > 0)
|
||||
{
|
||||
if(dos33BPB.sectors == 0 && dos33BPB.hsectors <= partition.PartitionStartSector && dos33BPB.big_sectors > 0 && dos33BPB.big_sectors <= (partition.PartitionEndSector - partition.PartitionStartSector) + 1)
|
||||
if(dos33BPB.sectors == 0 && dos33BPB.hsectors <= partition.Start && dos33BPB.big_sectors > 0 && dos33BPB.big_sectors <= (partition.End - partition.Start) + 1)
|
||||
{
|
||||
DicConsole.DebugWriteLine("FAT plugin", "Using DOS 3.3 BPB");
|
||||
useDOS33BPB = true;
|
||||
}
|
||||
else if(dos33BPB.big_sectors == 0 && dos33BPB.hsectors <= partition.PartitionStartSector && dos33BPB.sectors > 0 && dos33BPB.sectors <= (partition.PartitionEndSector - partition.PartitionStartSector) + 1)
|
||||
else if(dos33BPB.big_sectors == 0 && dos33BPB.hsectors <= partition.Start && dos33BPB.sectors > 0 && dos33BPB.sectors <= (partition.End - partition.Start) + 1)
|
||||
{
|
||||
if(atariBPB.jump[0] == 0x60 || (atariBPB.jump[0] == 0xE9 && atariBPB.jump[1] == 0x00) && Encoding.ASCII.GetString(dos33BPB.oem_name) != "NEXT ")
|
||||
{
|
||||
@@ -374,7 +374,7 @@ namespace DiscImageChef.Filesystems
|
||||
}
|
||||
else
|
||||
{
|
||||
if(dos32BPB.hsectors <= partition.PartitionStartSector && dos32BPB.hsectors + dos32BPB.sectors == dos32BPB.total_sectors)
|
||||
if(dos32BPB.hsectors <= partition.Start && dos32BPB.hsectors + dos32BPB.sectors == dos32BPB.total_sectors)
|
||||
{
|
||||
DicConsole.DebugWriteLine("FAT plugin", "Using DOS 3.2 BPB");
|
||||
useDOS32BPB = true;
|
||||
@@ -429,7 +429,7 @@ namespace DiscImageChef.Filesystems
|
||||
if(!useAtariBPB && !useMSXBPB && !useDOS2BPB && !useDOS3BPB && !useDOS32BPB && !useDOS33BPB && !useShortEBPB && !useEBPB && !useShortFAT32 && !useLongFAT32)
|
||||
{
|
||||
isFAT12 = true;
|
||||
fat_sector = imagePlugin.ReadSector(1 + partition.PartitionStartSector);
|
||||
fat_sector = imagePlugin.ReadSector(1 + partition.Start);
|
||||
switch(fat_sector[0])
|
||||
{
|
||||
case 0xE5:
|
||||
@@ -671,9 +671,9 @@ namespace DiscImageChef.Filesystems
|
||||
root_directory_sector = (ulong)((Fat32BPB.root_cluster - 2) * Fat32BPB.spc + Fat32BPB.big_spfat * Fat32BPB.fats_no + Fat32BPB.rsectors) * sectors_per_real_sector;
|
||||
sectors_for_root_directory = 1;
|
||||
|
||||
if(Fat32BPB.fsinfo_sector + partition.PartitionStartSector <= partition.PartitionEndSector)
|
||||
if(Fat32BPB.fsinfo_sector + partition.Start <= partition.End)
|
||||
{
|
||||
byte[] fsinfo_sector = imagePlugin.ReadSector(Fat32BPB.fsinfo_sector + partition.PartitionStartSector);
|
||||
byte[] fsinfo_sector = imagePlugin.ReadSector(Fat32BPB.fsinfo_sector + partition.Start);
|
||||
IntPtr fsinfo_ptr = Marshal.AllocHGlobal(512);
|
||||
Marshal.Copy(fsinfo_sector, 0, fsinfo_ptr, 512);
|
||||
FSInfoSector fs_info = (FSInfoSector)Marshal.PtrToStructure(fsinfo_ptr, typeof(FSInfoSector));
|
||||
@@ -874,7 +874,7 @@ namespace DiscImageChef.Filesystems
|
||||
if(!isFAT12 && !isFAT16)
|
||||
{
|
||||
sectors_per_real_sector = fakeBPB.bps / imagePlugin.ImageInfo.sectorSize;
|
||||
fat_sector = imagePlugin.ReadSector((fakeBPB.rsectors + partition.PartitionStartSector) * sectors_per_real_sector);
|
||||
fat_sector = imagePlugin.ReadSector((fakeBPB.rsectors + partition.Start) * sectors_per_real_sector);
|
||||
|
||||
ulong clusters;
|
||||
if(fakeBPB.sectors == 0)
|
||||
@@ -971,7 +971,7 @@ namespace DiscImageChef.Filesystems
|
||||
sb.AppendFormat("{0} heads.", fakeBPB.heads).AppendLine();
|
||||
|
||||
}
|
||||
if(fakeBPB.hsectors <= partition.PartitionStartSector)
|
||||
if(fakeBPB.hsectors <= partition.Start)
|
||||
sb.AppendFormat("{0} hidden sectors before BPB.", fakeBPB.hsectors).AppendLine();
|
||||
|
||||
if(fakeBPB.signature == 0x28 || fakeBPB.signature == 0x29)
|
||||
@@ -1017,9 +1017,9 @@ namespace DiscImageChef.Filesystems
|
||||
if(extraInfo != null)
|
||||
sb.Append(extraInfo);
|
||||
|
||||
if(root_directory_sector + partition.PartitionStartSector < partition.PartitionEndSector)
|
||||
if(root_directory_sector + partition.Start < partition.End)
|
||||
{
|
||||
byte[] root_directory = imagePlugin.ReadSectors(root_directory_sector + partition.PartitionStartSector, sectors_for_root_directory);
|
||||
byte[] root_directory = imagePlugin.ReadSectors(root_directory_sector + partition.Start, sectors_for_root_directory);
|
||||
for(int i = 0; i < root_directory.Length; i += 32)
|
||||
{
|
||||
// Not a correct entry
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace DiscImageChef.Filesystems
|
||||
return false;
|
||||
|
||||
FATX_Superblock fatxSb = new FATX_Superblock();
|
||||
byte[] sector = imagePlugin.ReadSector(partition.PartitionStartSector);
|
||||
byte[] sector = imagePlugin.ReadSector(partition.Start);
|
||||
|
||||
fatxSb = BigEndianMarshal.ByteArrayToStructureBigEndian<FATX_Superblock>(sector);
|
||||
|
||||
@@ -87,7 +87,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
FATX_Superblock fatxSb = new FATX_Superblock();
|
||||
|
||||
byte[] sector = imagePlugin.ReadSector(partition.PartitionStartSector);
|
||||
byte[] sector = imagePlugin.ReadSector(partition.Start);
|
||||
|
||||
fatxSb = BigEndianMarshal.ByteArrayToStructureBigEndian<FATX_Superblock>(sector);
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace DiscImageChef.Filesystems
|
||||
xmlFSType = new Schemas.FileSystemType();
|
||||
xmlFSType.Type = "FATX filesystem";
|
||||
xmlFSType.ClusterSize = (int)(fatxSb.sectorsPerCluster * imagePlugin.ImageInfo.sectorSize);
|
||||
xmlFSType.Clusters = (long)((partition.PartitionEndSector - partition.PartitionStartSector + 1) * imagePlugin.ImageInfo.sectorSize / (ulong)xmlFSType.ClusterSize);
|
||||
xmlFSType.Clusters = (long)((partition.End - partition.Start + 1) * imagePlugin.ImageInfo.sectorSize / (ulong)xmlFSType.ClusterSize);
|
||||
}
|
||||
|
||||
public override Errno Mount()
|
||||
|
||||
@@ -61,7 +61,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if((2 + partition.PartitionStartSector) >= partition.PartitionEndSector)
|
||||
if((2 + partition.Start) >= partition.End)
|
||||
return false;
|
||||
|
||||
uint magic;
|
||||
@@ -73,45 +73,45 @@ namespace DiscImageChef.Filesystems
|
||||
else
|
||||
sb_size_in_sectors = block_size / imagePlugin.GetSectorSize();
|
||||
|
||||
if(partition.PartitionEndSector > (partition.PartitionStartSector + sb_start_floppy * sb_size_in_sectors + sb_size_in_sectors))
|
||||
if(partition.End > (partition.Start + sb_start_floppy * sb_size_in_sectors + sb_size_in_sectors))
|
||||
{
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partition.PartitionStartSector + sb_start_floppy * sb_size_in_sectors, sb_size_in_sectors);
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partition.Start + 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(partition.PartitionEndSector > (partition.PartitionStartSector + sb_start_ufs1 * sb_size_in_sectors + sb_size_in_sectors))
|
||||
if(partition.End > (partition.Start + sb_start_ufs1 * sb_size_in_sectors + sb_size_in_sectors))
|
||||
{
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partition.PartitionStartSector + sb_start_ufs1 * sb_size_in_sectors, sb_size_in_sectors);
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partition.Start + 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(partition.PartitionEndSector > (partition.PartitionStartSector + sb_start_ufs2 * sb_size_in_sectors + sb_size_in_sectors))
|
||||
if(partition.End > (partition.Start + sb_start_ufs2 * sb_size_in_sectors + sb_size_in_sectors))
|
||||
{
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partition.PartitionStartSector + sb_start_ufs2 * sb_size_in_sectors, sb_size_in_sectors);
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partition.Start + 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(partition.PartitionEndSector > (partition.PartitionStartSector + sb_start_piggy * sb_size_in_sectors + sb_size_in_sectors))
|
||||
if(partition.End > (partition.Start + sb_start_piggy * sb_size_in_sectors + sb_size_in_sectors))
|
||||
{
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partition.PartitionStartSector + sb_start_piggy * sb_size_in_sectors, sb_size_in_sectors);
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partition.Start + 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)
|
||||
return true;
|
||||
}
|
||||
|
||||
if(partition.PartitionEndSector > (partition.PartitionStartSector + sb_start_atari / imagePlugin.GetSectorSize() + sb_size_in_sectors))
|
||||
if(partition.End > (partition.Start + sb_start_atari / imagePlugin.GetSectorSize() + sb_size_in_sectors))
|
||||
{
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partition.PartitionStartSector + (sb_start_atari / imagePlugin.GetSectorSize()), sb_size_in_sectors);
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partition.Start + (sb_start_atari / imagePlugin.GetSectorSize()), 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)
|
||||
@@ -129,7 +129,7 @@ namespace DiscImageChef.Filesystems
|
||||
uint magic = 0;
|
||||
uint sb_size_in_sectors;
|
||||
byte[] ufs_sb_sectors;
|
||||
ulong sb_offset = partition.PartitionStartSector;
|
||||
ulong sb_offset = partition.Start;
|
||||
bool fs_type_42bsd = false;
|
||||
bool fs_type_43bsd = false;
|
||||
bool fs_type_44bsd = false;
|
||||
@@ -143,57 +143,57 @@ namespace DiscImageChef.Filesystems
|
||||
else
|
||||
sb_size_in_sectors = block_size / imagePlugin.GetSectorSize();
|
||||
|
||||
if(partition.PartitionEndSector > (partition.PartitionStartSector + sb_start_floppy * sb_size_in_sectors + sb_size_in_sectors) && magic == 0)
|
||||
if(partition.End > (partition.Start + sb_start_floppy * sb_size_in_sectors + sb_size_in_sectors) && magic == 0)
|
||||
{
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partition.PartitionStartSector + sb_start_floppy * sb_size_in_sectors, sb_size_in_sectors);
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partition.Start + 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 = partition.PartitionStartSector + sb_start_floppy * sb_size_in_sectors;
|
||||
sb_offset = partition.Start + sb_start_floppy * sb_size_in_sectors;
|
||||
else
|
||||
magic = 0;
|
||||
}
|
||||
|
||||
if(partition.PartitionEndSector > (partition.PartitionStartSector + sb_start_ufs1 * sb_size_in_sectors + sb_size_in_sectors) && magic == 0)
|
||||
if(partition.End > (partition.Start + sb_start_ufs1 * sb_size_in_sectors + sb_size_in_sectors) && magic == 0)
|
||||
{
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partition.PartitionStartSector + sb_start_ufs1 * sb_size_in_sectors, sb_size_in_sectors);
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partition.Start + 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 = partition.PartitionStartSector + sb_start_ufs1 * sb_size_in_sectors;
|
||||
sb_offset = partition.Start + sb_start_ufs1 * sb_size_in_sectors;
|
||||
else
|
||||
magic = 0;
|
||||
}
|
||||
|
||||
if(partition.PartitionEndSector > (partition.PartitionStartSector + sb_start_ufs2 * sb_size_in_sectors + sb_size_in_sectors) && magic == 0)
|
||||
if(partition.End > (partition.Start + sb_start_ufs2 * sb_size_in_sectors + sb_size_in_sectors) && magic == 0)
|
||||
{
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partition.PartitionStartSector + sb_start_ufs2 * sb_size_in_sectors, sb_size_in_sectors);
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partition.Start + 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 = partition.PartitionStartSector + sb_start_ufs2 * sb_size_in_sectors;
|
||||
sb_offset = partition.Start + sb_start_ufs2 * sb_size_in_sectors;
|
||||
else
|
||||
magic = 0;
|
||||
}
|
||||
|
||||
if(partition.PartitionEndSector > (partition.PartitionStartSector + sb_start_piggy * sb_size_in_sectors + sb_size_in_sectors) && magic == 0)
|
||||
if(partition.End > (partition.Start + sb_start_piggy * sb_size_in_sectors + sb_size_in_sectors) && magic == 0)
|
||||
{
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partition.PartitionStartSector + sb_start_piggy * sb_size_in_sectors, sb_size_in_sectors);
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partition.Start + 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 = partition.PartitionStartSector + sb_start_piggy * sb_size_in_sectors;
|
||||
sb_offset = partition.Start + sb_start_piggy * sb_size_in_sectors;
|
||||
else
|
||||
magic = 0;
|
||||
}
|
||||
|
||||
if(partition.PartitionEndSector > (partition.PartitionStartSector + sb_start_atari / imagePlugin.GetSectorSize() + sb_size_in_sectors) && magic == 0)
|
||||
if(partition.End > (partition.Start + sb_start_atari / imagePlugin.GetSectorSize() + sb_size_in_sectors) && magic == 0)
|
||||
{
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partition.PartitionStartSector + sb_start_atari / imagePlugin.GetSectorSize(), sb_size_in_sectors);
|
||||
ufs_sb_sectors = imagePlugin.ReadSectors(partition.Start + sb_start_atari / imagePlugin.GetSectorSize(), 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 = partition.PartitionStartSector + sb_start_atari / imagePlugin.GetSectorSize();
|
||||
sb_offset = partition.Start + sb_start_atari / imagePlugin.GetSectorSize();
|
||||
else
|
||||
magic = 0;
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if((2 + partition.PartitionStartSector) >= partition.PartitionEndSector)
|
||||
if((2 + partition.Start) >= partition.End)
|
||||
return false;
|
||||
|
||||
if(imagePlugin.ImageInfo.sectors <= 16)
|
||||
@@ -67,7 +67,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
uint magic1, magic2;
|
||||
|
||||
byte[] hpfs_sb_sector = imagePlugin.ReadSector(16 + partition.PartitionStartSector); // Seek to superblock, on logical sector 16
|
||||
byte[] hpfs_sb_sector = imagePlugin.ReadSector(16 + partition.Start); // Seek to superblock, on logical sector 16
|
||||
magic1 = BitConverter.ToUInt32(hpfs_sb_sector, 0x000);
|
||||
magic2 = BitConverter.ToUInt32(hpfs_sb_sector, 0x004);
|
||||
|
||||
@@ -89,9 +89,9 @@ namespace DiscImageChef.Filesystems
|
||||
byte[] oem_name = new byte[8];
|
||||
byte[] volume_name = new byte[11];
|
||||
|
||||
byte[] hpfs_bpb_sector = imagePlugin.ReadSector(0 + partition.PartitionStartSector); // Seek to BIOS parameter block, on logical sector 0
|
||||
byte[] hpfs_sb_sector = imagePlugin.ReadSector(16 + partition.PartitionStartSector); // Seek to superblock, on logical sector 16
|
||||
byte[] hpfs_sp_sector = imagePlugin.ReadSector(17 + partition.PartitionStartSector); // Seek to spareblock, on logical sector 17
|
||||
byte[] hpfs_bpb_sector = imagePlugin.ReadSector(0 + partition.Start); // Seek to BIOS parameter block, on logical sector 0
|
||||
byte[] hpfs_sb_sector = imagePlugin.ReadSector(16 + partition.Start); // Seek to superblock, on logical sector 16
|
||||
byte[] hpfs_sp_sector = imagePlugin.ReadSector(17 + partition.Start); // Seek to spareblock, on logical sector 17
|
||||
|
||||
IntPtr bpbPtr = Marshal.AllocHGlobal(512);
|
||||
Marshal.Copy(hpfs_bpb_sector, 0, bpbPtr, 512);
|
||||
|
||||
@@ -92,11 +92,11 @@ namespace DiscImageChef.Filesystems
|
||||
return false;
|
||||
|
||||
// ISO9660 Primary Volume Descriptor starts at sector 16, so that's minimal size.
|
||||
if(partition.PartitionEndSector <= (16 + partition.PartitionStartSector))
|
||||
if(partition.End <= (16 + partition.Start))
|
||||
return false;
|
||||
|
||||
// Read to Volume Descriptor
|
||||
byte[] vd_sector = imagePlugin.ReadSector(16 + partition.PartitionStartSector);
|
||||
byte[] vd_sector = imagePlugin.ReadSector(16 + partition.Start);
|
||||
|
||||
int xa_off = 0;
|
||||
if(vd_sector.Length == 2336)
|
||||
@@ -159,7 +159,7 @@ namespace DiscImageChef.Filesystems
|
||||
return;
|
||||
|
||||
// ISO9660 Primary Volume Descriptor starts at sector 16, so that's minimal size.
|
||||
if(partition.PartitionEndSector < 16)
|
||||
if(partition.End < 16)
|
||||
return;
|
||||
|
||||
ulong counter = 0;
|
||||
@@ -168,8 +168,8 @@ namespace DiscImageChef.Filesystems
|
||||
{
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "Processing VD loop no. {0}", counter);
|
||||
// Seek to Volume Descriptor
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "Reading sector {0}", 16 + counter + partition.PartitionStartSector);
|
||||
byte[] vd_sector_tmp = imagePlugin.ReadSector(16 + counter + partition.PartitionStartSector);
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "Reading sector {0}", 16 + counter + partition.Start);
|
||||
byte[] vd_sector_tmp = imagePlugin.ReadSector(16 + counter + partition.Start);
|
||||
byte[] vd_sector;
|
||||
if(vd_sector_tmp.Length == 2336)
|
||||
{
|
||||
@@ -286,16 +286,16 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
|
||||
ulong i = (ulong)BitConverter.ToInt32(VDPathTableStart, 0);
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "VDPathTableStart = {0} + {1} = {2}", i, partition.PartitionStartSector, i + partition.PartitionStartSector);
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "VDPathTableStart = {0} + {1} = {2}", i, partition.Start, i + partition.Start);
|
||||
|
||||
// TODO: Check this
|
||||
if((i + partition.PartitionStartSector) < partition.PartitionEndSector)
|
||||
if((i + partition.Start) < partition.End)
|
||||
{
|
||||
|
||||
byte[] path_table = imagePlugin.ReadSector(i + partition.PartitionStartSector);
|
||||
byte[] path_table = imagePlugin.ReadSector(i + partition.Start);
|
||||
Array.Copy(path_table, 2, RootDirectoryLocation, 0, 4);
|
||||
// Check for Rock Ridge
|
||||
byte[] root_dir = imagePlugin.ReadSector((ulong)BitConverter.ToInt32(RootDirectoryLocation, 0) + partition.PartitionStartSector);
|
||||
byte[] root_dir = imagePlugin.ReadSector((ulong)BitConverter.ToInt32(RootDirectoryLocation, 0) + partition.Start);
|
||||
|
||||
byte[] SUSPMagic = new byte[2];
|
||||
byte[] RRMagic = new byte[2];
|
||||
@@ -316,7 +316,7 @@ namespace DiscImageChef.Filesystems
|
||||
StringBuilder IPBinInformation = new StringBuilder();
|
||||
|
||||
byte[] SegaHardwareID = new byte[16];
|
||||
byte[] ipbin_sector = imagePlugin.ReadSector(0 + partition.PartitionStartSector);
|
||||
byte[] ipbin_sector = imagePlugin.ReadSector(0 + partition.Start);
|
||||
Array.Copy(ipbin_sector, 0x000, SegaHardwareID, 0, 16);
|
||||
|
||||
DicConsole.DebugWriteLine("ISO9660 plugin", "SegaHardwareID = \"{0}\"", CurrentEncoding.GetString(SegaHardwareID));
|
||||
@@ -984,7 +984,7 @@ namespace DiscImageChef.Filesystems
|
||||
}
|
||||
|
||||
xmlFSType.Bootable |= Bootable || SegaCD || Saturn || Dreamcast;
|
||||
xmlFSType.Clusters = (long)(partition.PartitionEndSector - partition.PartitionStartSector + 1);
|
||||
xmlFSType.Clusters = (long)(partition.End - partition.Start + 1);
|
||||
xmlFSType.ClusterSize = 2048;
|
||||
|
||||
information = ISOMetadata.ToString();
|
||||
|
||||
@@ -152,7 +152,7 @@ namespace DiscImageChef.Filesystems
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
uint bootSectors = JFS_BootBlocksSize / imagePlugin.GetSectorSize();
|
||||
byte[] sector = imagePlugin.ReadSector(partition.PartitionStartSector + bootSectors);
|
||||
byte[] sector = imagePlugin.ReadSector(partition.Start + bootSectors);
|
||||
if(sector.Length < 512)
|
||||
return false;
|
||||
|
||||
@@ -170,7 +170,7 @@ namespace DiscImageChef.Filesystems
|
||||
information = "";
|
||||
StringBuilder sb = new StringBuilder();
|
||||
uint bootSectors = JFS_BootBlocksSize / imagePlugin.GetSectorSize();
|
||||
byte[] sector = imagePlugin.ReadSector(partition.PartitionStartSector + bootSectors);
|
||||
byte[] sector = imagePlugin.ReadSector(partition.Start + bootSectors);
|
||||
if(sector.Length < 512)
|
||||
return;
|
||||
|
||||
|
||||
@@ -79,11 +79,11 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if((2 + partition.PartitionStartSector) >= partition.PartitionEndSector)
|
||||
if((2 + partition.Start) >= partition.End)
|
||||
return false;
|
||||
|
||||
ushort magic;
|
||||
byte[] minix_sb_sector = imagePlugin.ReadSector(2 + partition.PartitionStartSector);
|
||||
byte[] minix_sb_sector = imagePlugin.ReadSector(2 + partition.Start);
|
||||
|
||||
magic = BitConverter.ToUInt16(minix_sb_sector, 0x010); // Here should reside magic number on Minix V1 & V2
|
||||
|
||||
@@ -107,7 +107,7 @@ namespace DiscImageChef.Filesystems
|
||||
int filenamesize;
|
||||
string minixVersion;
|
||||
ushort magic;
|
||||
byte[] minix_sb_sector = imagePlugin.ReadSector(2 + partition.PartitionStartSector);
|
||||
byte[] minix_sb_sector = imagePlugin.ReadSector(2 + partition.Start);
|
||||
|
||||
magic = BigEndianBitConverter.ToUInt16(minix_sb_sector, 0x018);
|
||||
|
||||
@@ -213,7 +213,7 @@ namespace DiscImageChef.Filesystems
|
||||
sb.AppendFormat("On-disk filesystem version: {0}", mnx_sb.s_disk_version).AppendLine();
|
||||
|
||||
xmlFSType.ClusterSize = mnx_sb.s_blocksize;
|
||||
xmlFSType.Clusters = (long)((partition.PartitionEndSector - partition.PartitionStartSector + 1) * imagePlugin.GetSectorSize() / mnx_sb.s_blocksize);
|
||||
xmlFSType.Clusters = (long)((partition.End - partition.Start + 1) * imagePlugin.GetSectorSize() / mnx_sb.s_blocksize);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -244,7 +244,7 @@ namespace DiscImageChef.Filesystems
|
||||
sb.AppendFormat("{0} bytes maximum per file", mnx_sb.s_max_size).AppendLine();
|
||||
sb.AppendFormat("Filesystem state: {0:X4}", mnx_sb.s_state).AppendLine();
|
||||
xmlFSType.ClusterSize = 1024;
|
||||
xmlFSType.Clusters = (long)((partition.PartitionEndSector - partition.PartitionStartSector + 1) * imagePlugin.GetSectorSize() / 1024);
|
||||
xmlFSType.Clusters = (long)((partition.End - partition.Start + 1) * imagePlugin.GetSectorSize() / 1024);
|
||||
}
|
||||
information = sb.ToString();
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ namespace DiscImageChef.Filesystems
|
||||
if(Marshal.SizeOf(nilfsSb) % imagePlugin.GetSectorSize() != 0)
|
||||
sbSize++;
|
||||
|
||||
byte[] sector = imagePlugin.ReadSectors(partition.PartitionStartSector + sbAddr, sbSize);
|
||||
byte[] sector = imagePlugin.ReadSectors(partition.Start + sbAddr, sbSize);
|
||||
if(sector.Length < Marshal.SizeOf(nilfsSb))
|
||||
return false;
|
||||
|
||||
@@ -155,7 +155,7 @@ namespace DiscImageChef.Filesystems
|
||||
if(Marshal.SizeOf(nilfsSb) % imagePlugin.GetSectorSize() != 0)
|
||||
sbSize++;
|
||||
|
||||
byte[] sector = imagePlugin.ReadSectors(partition.PartitionStartSector + sbAddr, sbSize);
|
||||
byte[] sector = imagePlugin.ReadSectors(partition.Start + sbAddr, sbSize);
|
||||
if(sector.Length < Marshal.SizeOf(nilfsSb))
|
||||
return;
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if((2 + partition.PartitionStartSector) >= partition.PartitionEndSector)
|
||||
if((2 + partition.Start) >= partition.End)
|
||||
return false;
|
||||
|
||||
byte[] eigth_bytes = new byte[8];
|
||||
@@ -66,7 +66,7 @@ namespace DiscImageChef.Filesystems
|
||||
ushort spfat, signature;
|
||||
string oem_name;
|
||||
|
||||
byte[] ntfs_bpb = imagePlugin.ReadSector(0 + partition.PartitionStartSector);
|
||||
byte[] ntfs_bpb = imagePlugin.ReadSector(0 + partition.Start);
|
||||
|
||||
Array.Copy(ntfs_bpb, 0x003, eigth_bytes, 0, 8);
|
||||
oem_name = StringHandlers.CToString(eigth_bytes);
|
||||
@@ -95,7 +95,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
byte[] ntfs_bpb = imagePlugin.ReadSector(0 + partition.PartitionStartSector);
|
||||
byte[] ntfs_bpb = imagePlugin.ReadSector(0 + partition.Start);
|
||||
|
||||
NTFS_BootBlock ntfs_bb = new NTFS_BootBlock();
|
||||
IntPtr bpbPtr = Marshal.AllocHGlobal(512);
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if(partition.PartitionStartSector != 0)
|
||||
if(partition.Start != 0)
|
||||
return false;
|
||||
|
||||
if((imagePlugin.GetSectors() * imagePlugin.GetSectorSize()) < 0x50000)
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if((2 + partition.PartitionStartSector) >= partition.PartitionEndSector)
|
||||
if((2 + partition.Start) >= partition.End)
|
||||
return false;
|
||||
|
||||
if(imagePlugin.GetSectorSize() < 512)
|
||||
@@ -73,7 +73,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
byte[] magic_b = new byte[12];
|
||||
string magic;
|
||||
byte[] hb_sector = imagePlugin.ReadSector(1 + partition.PartitionStartSector);
|
||||
byte[] hb_sector = imagePlugin.ReadSector(1 + partition.Start);
|
||||
|
||||
Array.Copy(hb_sector, 0x1F0, magic_b, 0, 12);
|
||||
magic = Encoding.ASCII.GetString(magic_b);
|
||||
@@ -91,7 +91,7 @@ namespace DiscImageChef.Filesystems
|
||||
homeblock.min_class = new byte[20];
|
||||
homeblock.max_class = new byte[20];
|
||||
|
||||
byte[] hb_sector = imagePlugin.ReadSector(1 + partition.PartitionStartSector);
|
||||
byte[] hb_sector = imagePlugin.ReadSector(1 + partition.Start);
|
||||
|
||||
homeblock.homelbn = BitConverter.ToUInt32(hb_sector, 0x000);
|
||||
homeblock.alhomelbn = BitConverter.ToUInt32(hb_sector, 0x004);
|
||||
|
||||
@@ -56,10 +56,10 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if((2 + partition.PartitionStartSector) >= partition.PartitionEndSector)
|
||||
if((2 + partition.Start) >= partition.End)
|
||||
return false;
|
||||
|
||||
byte[] sb_sector = imagePlugin.ReadSector(0 + partition.PartitionStartSector);
|
||||
byte[] sb_sector = imagePlugin.ReadSector(0 + partition.Start);
|
||||
|
||||
byte record_type;
|
||||
byte[] sync_bytes = new byte[5];
|
||||
@@ -80,7 +80,7 @@ namespace DiscImageChef.Filesystems
|
||||
information = "";
|
||||
StringBuilder SuperBlockMetadata = new StringBuilder();
|
||||
|
||||
byte[] sb_sector = imagePlugin.ReadSector(0 + partition.PartitionStartSector);
|
||||
byte[] sb_sector = imagePlugin.ReadSector(0 + partition.Start);
|
||||
|
||||
OperaSuperBlock sb = new OperaSuperBlock();
|
||||
byte[] cString = new byte[32];
|
||||
|
||||
@@ -56,11 +56,11 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if((2 + partition.PartitionStartSector) >= partition.PartitionEndSector)
|
||||
if((2 + partition.Start) >= partition.End)
|
||||
return false;
|
||||
|
||||
byte[] system_descriptor = new byte[23];
|
||||
byte[] sector = imagePlugin.ReadSector(1 + partition.PartitionStartSector);
|
||||
byte[] sector = imagePlugin.ReadSector(1 + partition.Start);
|
||||
|
||||
Array.Copy(sector, 0x20, system_descriptor, 0, 23);
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace DiscImageChef.Filesystems
|
||||
information = "";
|
||||
xmlFSType = new Schemas.FileSystemType();
|
||||
xmlFSType.Type = "PC Engine filesystem";
|
||||
xmlFSType.Clusters = (long)((partition.PartitionEndSector - partition.PartitionStartSector + 1) / imagePlugin.GetSectorSize() * 2048);
|
||||
xmlFSType.Clusters = (long)((partition.End - partition.Start + 1) / imagePlugin.GetSectorSize() * 2048);
|
||||
xmlFSType.ClusterSize = 2048;
|
||||
}
|
||||
|
||||
|
||||
@@ -180,12 +180,12 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if(partition.PartitionStartSector >= partition.PartitionEndSector)
|
||||
if(partition.Start >= partition.End)
|
||||
return false;
|
||||
|
||||
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
|
||||
|
||||
byte[] sector = imagePlugin.ReadSector(2 + partition.PartitionStartSector);
|
||||
byte[] sector = imagePlugin.ReadSector(2 + partition.Start);
|
||||
|
||||
uint magic = BigEndianBitConverter.ToUInt32(sector, 0x00);
|
||||
|
||||
@@ -194,7 +194,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, Partition partition, out string information)
|
||||
{
|
||||
byte[] RootBlockSector = imagePlugin.ReadSector(2 + partition.PartitionStartSector);
|
||||
byte[] RootBlockSector = imagePlugin.ReadSector(2 + partition.Start);
|
||||
RootBlock rootBlock = new RootBlock();
|
||||
rootBlock = BigEndianMarshal.ByteArrayToStructureBigEndian<RootBlock>(RootBlockSector);
|
||||
|
||||
|
||||
@@ -96,11 +96,11 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if(partition.PartitionEndSector < 3)
|
||||
if(partition.End < 3)
|
||||
return false;
|
||||
|
||||
// Blocks 0 and 1 are boot code
|
||||
byte[] rootDirectoryKeyBlock = imagePlugin.ReadSector(2 + partition.PartitionStartSector);
|
||||
byte[] rootDirectoryKeyBlock = imagePlugin.ReadSector(2 + partition.Start);
|
||||
|
||||
ushort prePointer = BitConverter.ToUInt16(rootDirectoryKeyBlock, 0);
|
||||
DicConsole.DebugWriteLine("ProDOS plugin", "prePointer = {0}", prePointer);
|
||||
@@ -124,12 +124,12 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
ushort bit_map_pointer = BitConverter.ToUInt16(rootDirectoryKeyBlock, 0x27);
|
||||
DicConsole.DebugWriteLine("ProDOS plugin", "bit_map_pointer = {0}", bit_map_pointer);
|
||||
if(bit_map_pointer > partition.PartitionEndSector)
|
||||
if(bit_map_pointer > partition.End)
|
||||
return false;
|
||||
|
||||
ushort total_blocks = BitConverter.ToUInt16(rootDirectoryKeyBlock, 0x29);
|
||||
DicConsole.DebugWriteLine("ProDOS plugin", "{0} <= ({1} - {2} + 1)? {3}", total_blocks, partition.PartitionEndSector, partition.PartitionStartSector, total_blocks <= (partition.PartitionEndSector - partition.PartitionStartSector + 1));
|
||||
return total_blocks <= (partition.PartitionEndSector - partition.PartitionStartSector + 1);
|
||||
DicConsole.DebugWriteLine("ProDOS plugin", "{0} <= ({1} - {2} + 1)? {3}", total_blocks, partition.End, partition.Start, total_blocks <= (partition.End - partition.Start + 1));
|
||||
return total_blocks <= (partition.End - partition.Start + 1);
|
||||
}
|
||||
|
||||
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, Partition partition, out string information)
|
||||
@@ -137,7 +137,7 @@ namespace DiscImageChef.Filesystems
|
||||
StringBuilder sbInformation = new StringBuilder();
|
||||
|
||||
// Blocks 0 and 1 are boot code
|
||||
byte[] rootDirectoryKeyBlockBytes = imagePlugin.ReadSector(2 + partition.PartitionStartSector);
|
||||
byte[] rootDirectoryKeyBlockBytes = imagePlugin.ReadSector(2 + partition.Start);
|
||||
|
||||
ProDOSRootDirectoryKeyBlock rootDirectoryKeyBlock = new ProDOSRootDirectoryKeyBlock();
|
||||
rootDirectoryKeyBlock.header = new ProDOSRootDirectoryHeader();
|
||||
@@ -235,7 +235,7 @@ namespace DiscImageChef.Filesystems
|
||||
xmlFSType.Files = rootDirectoryKeyBlock.header.file_count;
|
||||
xmlFSType.FilesSpecified = true;
|
||||
xmlFSType.Clusters = rootDirectoryKeyBlock.header.total_blocks;
|
||||
xmlFSType.ClusterSize = (int)(((partition.PartitionEndSector - partition.PartitionStartSector) + 1) * imagePlugin.ImageInfo.sectorSize / (ulong)xmlFSType.Clusters);
|
||||
xmlFSType.ClusterSize = (int)(((partition.End - partition.Start) + 1) * imagePlugin.ImageInfo.sectorSize / (ulong)xmlFSType.Clusters);
|
||||
xmlFSType.Type = "ProDOS";
|
||||
|
||||
return;
|
||||
|
||||
@@ -125,7 +125,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
byte[] sector = imagePlugin.ReadSector(partition.PartitionStartSector + 1);
|
||||
byte[] sector = imagePlugin.ReadSector(partition.Start + 1);
|
||||
if(sector.Length < 512)
|
||||
return false;
|
||||
|
||||
@@ -147,10 +147,10 @@ namespace DiscImageChef.Filesystems
|
||||
return false;
|
||||
|
||||
// Check extents are not past device
|
||||
if(qnxSb.rootDir.di_first_xtnt.block + partition.PartitionStartSector >= partition.PartitionEndSector ||
|
||||
qnxSb.inode.di_first_xtnt.block + partition.PartitionStartSector >= partition.PartitionEndSector ||
|
||||
qnxSb.boot.di_first_xtnt.block + partition.PartitionStartSector >= partition.PartitionEndSector ||
|
||||
qnxSb.altBoot.di_first_xtnt.block + partition.PartitionStartSector >= partition.PartitionEndSector)
|
||||
if(qnxSb.rootDir.di_first_xtnt.block + partition.Start >= partition.End ||
|
||||
qnxSb.inode.di_first_xtnt.block + partition.Start >= partition.End ||
|
||||
qnxSb.boot.di_first_xtnt.block + partition.Start >= partition.End ||
|
||||
qnxSb.altBoot.di_first_xtnt.block + partition.Start >= partition.End)
|
||||
return false;
|
||||
|
||||
// Check inodes are in use
|
||||
@@ -166,7 +166,7 @@ namespace DiscImageChef.Filesystems
|
||||
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, Partition partition, out string information)
|
||||
{
|
||||
information = "";
|
||||
byte[] sector = imagePlugin.ReadSector(partition.PartitionStartSector + 1);
|
||||
byte[] sector = imagePlugin.ReadSector(partition.Start + 1);
|
||||
if(sector.Length < 512)
|
||||
return;
|
||||
|
||||
@@ -255,7 +255,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
xmlFSType = new Schemas.FileSystemType();
|
||||
xmlFSType.Type = "QNX4 filesystem";
|
||||
xmlFSType.Clusters = (long)((partition.PartitionEndSector - partition.PartitionStartSector + 1) / imagePlugin.GetSectorSize() * 512);
|
||||
xmlFSType.Clusters = (long)((partition.End - partition.Start + 1) / imagePlugin.GetSectorSize() * 512);
|
||||
xmlFSType.ClusterSize = 512;
|
||||
xmlFSType.Bootable |= (qnxSb.boot.di_size != 0 || qnxSb.altBoot.di_size != 0);
|
||||
xmlFSType.CreationDate = DateHandlers.UNIXUnsignedToDateTime(qnxSb.rootDir.di_ftime);
|
||||
|
||||
@@ -123,8 +123,8 @@ namespace DiscImageChef.Filesystems
|
||||
uint sectors = QNX6_SuperBlockSize / imagePlugin.GetSectorSize();
|
||||
uint bootSectors = QNX6_BootBlocksSize / imagePlugin.GetSectorSize();
|
||||
|
||||
byte[] audiSector = imagePlugin.ReadSectors(partition.PartitionStartSector, sectors);
|
||||
byte[] sector = imagePlugin.ReadSectors(partition.PartitionStartSector + bootSectors, sectors);
|
||||
byte[] audiSector = imagePlugin.ReadSectors(partition.Start, sectors);
|
||||
byte[] sector = imagePlugin.ReadSectors(partition.Start + bootSectors, sectors);
|
||||
if(sector.Length < QNX6_SuperBlockSize)
|
||||
return false;
|
||||
|
||||
@@ -150,8 +150,8 @@ namespace DiscImageChef.Filesystems
|
||||
uint sectors = QNX6_SuperBlockSize / imagePlugin.GetSectorSize();
|
||||
uint bootSectors = QNX6_BootBlocksSize / imagePlugin.GetSectorSize();
|
||||
|
||||
byte[] audiSector = imagePlugin.ReadSectors(partition.PartitionStartSector, sectors);
|
||||
byte[] sector = imagePlugin.ReadSectors(partition.PartitionStartSector + bootSectors, sectors);
|
||||
byte[] audiSector = imagePlugin.ReadSectors(partition.Start, sectors);
|
||||
byte[] sector = imagePlugin.ReadSectors(partition.Start + bootSectors, sectors);
|
||||
if(sector.Length < QNX6_SuperBlockSize)
|
||||
return;
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace DiscImageChef.Filesystems
|
||||
if(Marshal.SizeOf(reiserSb) % imagePlugin.GetSectorSize() != 0)
|
||||
sbSize++;
|
||||
|
||||
byte[] sector = imagePlugin.ReadSectors(partition.PartitionStartSector + sbAddr, sbSize);
|
||||
byte[] sector = imagePlugin.ReadSectors(partition.Start + sbAddr, sbSize);
|
||||
if(sector.Length < Marshal.SizeOf(reiserSb))
|
||||
return false;
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace DiscImageChef.Filesystems
|
||||
if(Marshal.SizeOf(reiserSb) % imagePlugin.GetSectorSize() != 0)
|
||||
sbSize++;
|
||||
|
||||
byte[] sector = imagePlugin.ReadSectors(partition.PartitionStartSector + sbAddr, sbSize);
|
||||
byte[] sector = imagePlugin.ReadSectors(partition.Start + sbAddr, sbSize);
|
||||
if(sector.Length < Marshal.SizeOf(reiserSb))
|
||||
return;
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ namespace DiscImageChef.Filesystems
|
||||
if(Marshal.SizeOf(reiserSb) % imagePlugin.GetSectorSize() != 0)
|
||||
sbSize++;
|
||||
|
||||
byte[] sector = imagePlugin.ReadSectors(partition.PartitionStartSector + sbAddr, sbSize);
|
||||
byte[] sector = imagePlugin.ReadSectors(partition.Start + sbAddr, sbSize);
|
||||
if(sector.Length < Marshal.SizeOf(reiserSb))
|
||||
return false;
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace DiscImageChef.Filesystems
|
||||
if(Marshal.SizeOf(reiserSb) % imagePlugin.GetSectorSize() != 0)
|
||||
sbSize++;
|
||||
|
||||
byte[] sector = imagePlugin.ReadSectors(partition.PartitionStartSector + sbAddr, sbSize);
|
||||
byte[] sector = imagePlugin.ReadSectors(partition.Start + sbAddr, sbSize);
|
||||
if(sector.Length < Marshal.SizeOf(reiserSb))
|
||||
return;
|
||||
|
||||
@@ -139,7 +139,7 @@ namespace DiscImageChef.Filesystems
|
||||
xmlFSType = new Schemas.FileSystemType();
|
||||
xmlFSType.Type = "Reiser 4 filesystem";
|
||||
xmlFSType.ClusterSize = reiserSb.blocksize;
|
||||
xmlFSType.Clusters = (long)(((partition.PartitionEndSector - partition.PartitionStartSector) * imagePlugin.GetSectorSize()) / reiserSb.blocksize);
|
||||
xmlFSType.Clusters = (long)(((partition.End - partition.Start) * imagePlugin.GetSectorSize()) / reiserSb.blocksize);
|
||||
xmlFSType.VolumeName = StringHandlers.CToString(reiserSb.label, CurrentEncoding);
|
||||
xmlFSType.VolumeSerial = reiserSb.uuid.ToString();
|
||||
}
|
||||
|
||||
@@ -100,12 +100,12 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if(partition.PartitionStartSector >= partition.PartitionEndSector)
|
||||
if(partition.Start >= partition.End)
|
||||
return false;
|
||||
|
||||
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
|
||||
|
||||
byte[] sector = imagePlugin.ReadSector(partition.PartitionStartSector);
|
||||
byte[] sector = imagePlugin.ReadSector(partition.Start);
|
||||
|
||||
uint magic = BigEndianBitConverter.ToUInt32(sector, 0x00);
|
||||
|
||||
@@ -114,7 +114,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, Partition partition, out string information)
|
||||
{
|
||||
byte[] RootBlockSector = imagePlugin.ReadSector(partition.PartitionStartSector);
|
||||
byte[] RootBlockSector = imagePlugin.ReadSector(partition.Start);
|
||||
RootBlock rootBlock = new RootBlock();
|
||||
rootBlock = BigEndianMarshal.ByteArrayToStructureBigEndian<RootBlock>(RootBlockSector);
|
||||
|
||||
|
||||
@@ -58,13 +58,13 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if((2 + partition.PartitionStartSector) >= partition.PartitionEndSector)
|
||||
if((2 + partition.Start) >= partition.End)
|
||||
return false;
|
||||
|
||||
byte signature; /// <summary>0x29
|
||||
string fs_type; // "SOL_FS "
|
||||
|
||||
byte[] bpb = imagePlugin.ReadSector(0 + partition.PartitionStartSector);
|
||||
byte[] bpb = imagePlugin.ReadSector(0 + partition.Start);
|
||||
|
||||
byte[] fs_type_b = new byte[8];
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace DiscImageChef.Filesystems
|
||||
information = "";
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
byte[] bpb_sector = imagePlugin.ReadSector(0 + partition.PartitionStartSector);
|
||||
byte[] bpb_sector = imagePlugin.ReadSector(0 + partition.Start);
|
||||
byte[] bpb_strings;
|
||||
|
||||
SolarOSParameterBlock BPB = new SolarOSParameterBlock();
|
||||
|
||||
@@ -96,10 +96,10 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if(partition.PartitionStartSector >= partition.PartitionEndSector)
|
||||
if(partition.Start >= partition.End)
|
||||
return false;
|
||||
|
||||
byte[] sector = imagePlugin.ReadSector(partition.PartitionStartSector);
|
||||
byte[] sector = imagePlugin.ReadSector(partition.Start);
|
||||
|
||||
uint magic = BitConverter.ToUInt32(sector, 0x00);
|
||||
|
||||
@@ -108,7 +108,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, Partition partition, out string information)
|
||||
{
|
||||
byte[] sector = imagePlugin.ReadSector(partition.PartitionStartSector);
|
||||
byte[] sector = imagePlugin.ReadSector(partition.Start);
|
||||
uint magic = BitConverter.ToUInt32(sector, 0x00);
|
||||
|
||||
SquashSuperBlock sqSb = new SquashSuperBlock();
|
||||
@@ -167,7 +167,7 @@ namespace DiscImageChef.Filesystems
|
||||
xmlFSType.Type = "Squash file system";
|
||||
xmlFSType.CreationDate = DateHandlers.UNIXUnsignedToDateTime(sqSb.mkfs_time);
|
||||
xmlFSType.CreationDateSpecified = true;
|
||||
xmlFSType.Clusters = (long)(((partition.PartitionEndSector - partition.PartitionStartSector + 1) * imagePlugin.ImageInfo.sectorSize) / sqSb.block_size);
|
||||
xmlFSType.Clusters = (long)(((partition.End - partition.Start + 1) * imagePlugin.ImageInfo.sectorSize) / sqSb.block_size);
|
||||
xmlFSType.ClusterSize = (int)sqSb.block_size;
|
||||
xmlFSType.Files = sqSb.inodes;
|
||||
xmlFSType.FilesSpecified = true;
|
||||
|
||||
@@ -72,7 +72,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if((2 + partition.PartitionStartSector) >= partition.PartitionEndSector)
|
||||
if((2 + partition.Start) >= partition.End)
|
||||
return false;
|
||||
|
||||
uint magic;
|
||||
@@ -107,7 +107,7 @@ namespace DiscImageChef.Filesystems
|
||||
else
|
||||
sb_size_in_sectors = 1; // If not a single sector can store it
|
||||
|
||||
if(partition.PartitionEndSector <= (partition.PartitionStartSector + 4 * (ulong)sb_size_in_sectors + sb_size_in_sectors)) // Device must be bigger than SB location + SB size + offset
|
||||
if(partition.End <= (partition.Start + 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
|
||||
@@ -116,7 +116,7 @@ namespace DiscImageChef.Filesystems
|
||||
if(i + sb_size_in_sectors >= (int)imagePlugin.ImageInfo.sectors)
|
||||
break;
|
||||
|
||||
byte[] sb_sector = imagePlugin.ReadSectors((ulong)i + partition.PartitionStartSector, sb_size_in_sectors);
|
||||
byte[] sb_sector = imagePlugin.ReadSectors((ulong)i + partition.Start, sb_size_in_sectors);
|
||||
|
||||
magic = BitConverter.ToUInt32(sb_sector, 0x3F8); // XENIX magic location
|
||||
|
||||
@@ -161,7 +161,7 @@ namespace DiscImageChef.Filesystems
|
||||
{
|
||||
if(s_fsize < V7_MAXSIZE && s_nfree < V7_NICFREE && s_ninode < V7_NICINOD)
|
||||
{
|
||||
if((s_fsize * 1024) == ((partition.PartitionEndSector - partition.PartitionStartSector) * imagePlugin.GetSectorSize()) || (s_fsize * 512) == ((partition.PartitionEndSector - partition.PartitionStartSector) * imagePlugin.GetSectorSize()))
|
||||
if((s_fsize * 1024) == ((partition.End - partition.Start) * imagePlugin.GetSectorSize()) || (s_fsize * 512) == ((partition.End - partition.Start) * imagePlugin.GetSectorSize()))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -199,7 +199,7 @@ namespace DiscImageChef.Filesystems
|
||||
// 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 + partition.PartitionStartSector, sb_size_in_sectors);
|
||||
sb_sector = imagePlugin.ReadSectors((ulong)start + partition.Start, sb_size_in_sectors);
|
||||
magic = BigEndianBitConverter.ToUInt32(sb_sector, 0x3F8); // XENIX magic location
|
||||
|
||||
if(magic == XENIX_MAGIC)
|
||||
@@ -277,7 +277,7 @@ namespace DiscImageChef.Filesystems
|
||||
{
|
||||
if(s_fsize < V7_MAXSIZE && s_nfree < V7_NICFREE && s_ninode < V7_NICINOD)
|
||||
{
|
||||
if((s_fsize * 1024) == ((partition.PartitionEndSector - partition.PartitionStartSector) * imagePlugin.GetSectorSize()) || (s_fsize * 512) == ((partition.PartitionEndSector - partition.PartitionStartSector) * imagePlugin.GetSectorSize()))
|
||||
if((s_fsize * 1024) == ((partition.End - partition.Start) * imagePlugin.GetSectorSize()) || (s_fsize * 512) == ((partition.End - partition.Start) * imagePlugin.GetSectorSize()))
|
||||
{
|
||||
sys7th = true;
|
||||
BigEndianBitConverter.IsLittleEndian = true;
|
||||
@@ -296,7 +296,7 @@ namespace DiscImageChef.Filesystems
|
||||
{
|
||||
byte[] xenix_strings = new byte[6];
|
||||
XenixSuperBlock xnx_sb = new XenixSuperBlock();
|
||||
sb_sector = imagePlugin.ReadSectors((ulong)start + partition.PartitionStartSector, sb_size_in_sectors);
|
||||
sb_sector = imagePlugin.ReadSectors((ulong)start + partition.Start, sb_size_in_sectors);
|
||||
|
||||
if(xenix3)
|
||||
{
|
||||
@@ -418,7 +418,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
if(sysv)
|
||||
{
|
||||
sb_sector = imagePlugin.ReadSectors((ulong)start + partition.PartitionStartSector, sb_size_in_sectors);
|
||||
sb_sector = imagePlugin.ReadSectors((ulong)start + partition.Start, sb_size_in_sectors);
|
||||
ushort pad0, pad1, pad2;
|
||||
byte[] sysv_strings = new byte[6];
|
||||
|
||||
@@ -557,7 +557,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
if(coherent)
|
||||
{
|
||||
sb_sector = imagePlugin.ReadSectors((ulong)start + partition.PartitionStartSector, sb_size_in_sectors);
|
||||
sb_sector = imagePlugin.ReadSectors((ulong)start + partition.Start, sb_size_in_sectors);
|
||||
CoherentSuperBlock coh_sb = new CoherentSuperBlock();
|
||||
byte[] coh_strings = new byte[6];
|
||||
|
||||
@@ -612,7 +612,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
if(sys7th)
|
||||
{
|
||||
sb_sector = imagePlugin.ReadSectors((ulong)start + partition.PartitionStartSector, sb_size_in_sectors);
|
||||
sb_sector = imagePlugin.ReadSectors((ulong)start + partition.Start, sb_size_in_sectors);
|
||||
UNIX7thEditionSuperBlock v7_sb = new UNIX7thEditionSuperBlock();
|
||||
byte[] sys7_strings = new byte[6];
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
|
||||
return false;
|
||||
|
||||
// Blocks 0 and 1 are boot code
|
||||
byte[] volBlock = imagePlugin.ReadSector(2 + partition.PartitionStartSector);
|
||||
byte[] volBlock = imagePlugin.ReadSector(2 + partition.Start);
|
||||
|
||||
PascalVolumeEntry volEntry = new PascalVolumeEntry();
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
|
||||
return;
|
||||
|
||||
// Blocks 0 and 1 are boot code
|
||||
byte[] volBlock = imagePlugin.ReadSector(2 + partition.PartitionStartSector);
|
||||
byte[] volBlock = imagePlugin.ReadSector(2 + partition.Start);
|
||||
|
||||
PascalVolumeEntry volEntry = new PascalVolumeEntry();
|
||||
|
||||
@@ -148,7 +148,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
|
||||
information = sbInformation.ToString();
|
||||
|
||||
xmlFSType = new Schemas.FileSystemType();
|
||||
xmlFSType.Bootable = !ArrayHelpers.ArrayIsNullOrEmpty(imagePlugin.ReadSectors(partition.PartitionStartSector, 2));
|
||||
xmlFSType.Bootable = !ArrayHelpers.ArrayIsNullOrEmpty(imagePlugin.ReadSectors(partition.Start, 2));
|
||||
xmlFSType.Clusters = volEntry.blocks;
|
||||
xmlFSType.ClusterSize = (int)imagePlugin.GetSectorSize();
|
||||
xmlFSType.Files = volEntry.files;
|
||||
|
||||
@@ -234,7 +234,7 @@ namespace DiscImageChef.Filesystems
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
// UDF needs at least that
|
||||
if(partition.PartitionEndSector - partition.PartitionStartSector < 256)
|
||||
if(partition.End - partition.Start < 256)
|
||||
return false;
|
||||
|
||||
// UDF needs at least that
|
||||
@@ -244,12 +244,12 @@ namespace DiscImageChef.Filesystems
|
||||
byte[] sector;
|
||||
AnchorVolumeDescriptorPointer anchor = new AnchorVolumeDescriptorPointer();
|
||||
// All positions where anchor may reside
|
||||
ulong[] positions = { 256, 512, partition.PartitionEndSector - 256, partition.PartitionEndSector };
|
||||
ulong[] positions = { 256, 512, partition.End - 256, partition.End };
|
||||
bool anchorFound = false;
|
||||
|
||||
foreach(ulong position in positions)
|
||||
{
|
||||
if(position + partition.PartitionStartSector >= partition.PartitionEndSector)
|
||||
if(position + partition.Start >= partition.End)
|
||||
continue;
|
||||
|
||||
sector = imagePlugin.ReadSector(position);
|
||||
@@ -274,7 +274,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
if(anchor.tag.tagIdentifier == TagIdentifier.AnchorVolumeDescriptorPointer &&
|
||||
anchor.tag.tagLocation == position &&
|
||||
(anchor.mainVolumeDescriptorSequenceExtent.location + partition.PartitionStartSector) < partition.PartitionEndSector)
|
||||
(anchor.mainVolumeDescriptorSequenceExtent.location + partition.Start) < partition.End)
|
||||
{
|
||||
anchorFound = true;
|
||||
break;
|
||||
@@ -288,11 +288,11 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
while(count < 256)
|
||||
{
|
||||
sector = imagePlugin.ReadSector(partition.PartitionStartSector + anchor.mainVolumeDescriptorSequenceExtent.location + count);
|
||||
sector = imagePlugin.ReadSector(partition.Start + anchor.mainVolumeDescriptorSequenceExtent.location + count);
|
||||
TagIdentifier tagId = (TagIdentifier)BitConverter.ToUInt16(sector, 0);
|
||||
uint location = BitConverter.ToUInt32(sector, 0x0C);
|
||||
|
||||
if(location == partition.PartitionStartSector + anchor.mainVolumeDescriptorSequenceExtent.location + count)
|
||||
if(location == partition.Start + anchor.mainVolumeDescriptorSequenceExtent.location + count)
|
||||
{
|
||||
if(tagId == TagIdentifier.TerminatingDescriptor)
|
||||
break;
|
||||
@@ -327,7 +327,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
AnchorVolumeDescriptorPointer anchor = new AnchorVolumeDescriptorPointer();
|
||||
// All positions where anchor may reside
|
||||
ulong[] positions = { 256, 512, partition.PartitionEndSector - 256, partition.PartitionEndSector };
|
||||
ulong[] positions = { 256, 512, partition.End - 256, partition.End };
|
||||
|
||||
foreach(ulong position in positions)
|
||||
{
|
||||
@@ -340,7 +340,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
if(anchor.tag.tagIdentifier == TagIdentifier.AnchorVolumeDescriptorPointer &&
|
||||
anchor.tag.tagLocation == position &&
|
||||
(anchor.mainVolumeDescriptorSequenceExtent.location + partition.PartitionStartSector) < partition.PartitionEndSector)
|
||||
(anchor.mainVolumeDescriptorSequenceExtent.location + partition.Start) < partition.End)
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -353,11 +353,11 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
while(count < 256)
|
||||
{
|
||||
sector = imagePlugin.ReadSector(partition.PartitionStartSector + anchor.mainVolumeDescriptorSequenceExtent.location + count);
|
||||
sector = imagePlugin.ReadSector(partition.Start + anchor.mainVolumeDescriptorSequenceExtent.location + count);
|
||||
TagIdentifier tagId = (TagIdentifier)BitConverter.ToUInt16(sector, 0);
|
||||
uint location = BitConverter.ToUInt32(sector, 0x0C);
|
||||
|
||||
if(location == partition.PartitionStartSector + anchor.mainVolumeDescriptorSequenceExtent.location + count)
|
||||
if(location == partition.Start + anchor.mainVolumeDescriptorSequenceExtent.location + count)
|
||||
{
|
||||
if(tagId == TagIdentifier.TerminatingDescriptor)
|
||||
break;
|
||||
@@ -421,7 +421,7 @@ namespace DiscImageChef.Filesystems
|
||||
Convert.ToInt32(string.Format("{0}", lvidiu.maximumWriteUDF & 0xFF), 10));
|
||||
xmlFSType.ApplicationIdentifier = CurrentEncoding.GetString(pvd.implementationIdentifier.identifier).TrimEnd(new char[] { '\u0000' });
|
||||
xmlFSType.ClusterSize = (int)lvd.logicalBlockSize;
|
||||
xmlFSType.Clusters = (long)(((partition.PartitionEndSector - partition.PartitionStartSector + 1) * imagePlugin.ImageInfo.sectorSize) / (ulong)xmlFSType.ClusterSize);
|
||||
xmlFSType.Clusters = (long)(((partition.End - partition.Start + 1) * imagePlugin.ImageInfo.sectorSize) / (ulong)xmlFSType.ClusterSize);
|
||||
xmlFSType.ModificationDate = ECMAToDateTime(lvid.recordingDateTime);
|
||||
xmlFSType.ModificationDateSpecified = true;
|
||||
xmlFSType.Files = lvidiu.files;
|
||||
|
||||
@@ -60,12 +60,12 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if((2 + partition.PartitionStartSector) >= partition.PartitionEndSector)
|
||||
if((2 + partition.Start) >= partition.End)
|
||||
return false;
|
||||
|
||||
uint magic;
|
||||
|
||||
magic = BitConverter.ToUInt32(imagePlugin.ReadSector(0 + partition.PartitionStartSector), 0);
|
||||
magic = BitConverter.ToUInt32(imagePlugin.ReadSector(0 + partition.Start), 0);
|
||||
|
||||
return magic == BFS_MAGIC;
|
||||
}
|
||||
@@ -75,7 +75,7 @@ namespace DiscImageChef.Filesystems
|
||||
information = "";
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
byte[] bfs_sb_sector = imagePlugin.ReadSector(0 + partition.PartitionStartSector);
|
||||
byte[] bfs_sb_sector = imagePlugin.ReadSector(0 + partition.Start);
|
||||
byte[] sb_strings = new byte[6];
|
||||
|
||||
BFSSuperBlock bfs_sb = new BFSSuperBlock();
|
||||
@@ -111,7 +111,7 @@ namespace DiscImageChef.Filesystems
|
||||
xmlFSType.Type = "BFS";
|
||||
xmlFSType.VolumeName = bfs_sb.s_volume;
|
||||
xmlFSType.ClusterSize = (int)imagePlugin.GetSectorSize();
|
||||
xmlFSType.Clusters = (long)(partition.PartitionEndSector - partition.PartitionStartSector + 1);
|
||||
xmlFSType.Clusters = (long)(partition.End - partition.Start + 1);
|
||||
|
||||
information = sb.ToString();
|
||||
}
|
||||
|
||||
@@ -92,15 +92,15 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if(partition.PartitionStartSector >= partition.PartitionEndSector)
|
||||
if(partition.Start >= partition.End)
|
||||
return false;
|
||||
|
||||
ulong vmfsSuperOff = VMfs_Base / imagePlugin.ImageInfo.sectorSize;
|
||||
|
||||
if(partition.PartitionStartSector + vmfsSuperOff > partition.PartitionEndSector)
|
||||
if(partition.Start + vmfsSuperOff > partition.End)
|
||||
return false;
|
||||
|
||||
byte[] sector = imagePlugin.ReadSector(partition.PartitionStartSector + vmfsSuperOff);
|
||||
byte[] sector = imagePlugin.ReadSector(partition.Start + vmfsSuperOff);
|
||||
|
||||
uint magic = BitConverter.ToUInt32(sector, 0x00);
|
||||
|
||||
@@ -110,7 +110,7 @@ namespace DiscImageChef.Filesystems
|
||||
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, Partition partition, out string information)
|
||||
{
|
||||
ulong vmfsSuperOff = VMfs_Base / imagePlugin.ImageInfo.sectorSize;
|
||||
byte[] sector = imagePlugin.ReadSector(partition.PartitionStartSector + vmfsSuperOff);
|
||||
byte[] sector = imagePlugin.ReadSector(partition.Start + vmfsSuperOff);
|
||||
|
||||
VolumeInfo volInfo = new VolumeInfo();
|
||||
IntPtr volInfoPtr = Marshal.AllocHGlobal(Marshal.SizeOf(volInfo));
|
||||
|
||||
@@ -210,11 +210,11 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if(partition.PartitionStartSector >= partition.PartitionEndSector)
|
||||
if(partition.Start >= partition.End)
|
||||
return false;
|
||||
|
||||
ulong vmfsSuperOff = VxFS_Base / imagePlugin.ImageInfo.sectorSize;
|
||||
byte[] sector = imagePlugin.ReadSector(partition.PartitionStartSector + vmfsSuperOff);
|
||||
byte[] sector = imagePlugin.ReadSector(partition.Start + vmfsSuperOff);
|
||||
|
||||
uint magic = BitConverter.ToUInt32(sector, 0x00);
|
||||
|
||||
@@ -224,7 +224,7 @@ namespace DiscImageChef.Filesystems
|
||||
public override void GetInformation(ImagePlugins.ImagePlugin imagePlugin, Partition partition, out string information)
|
||||
{
|
||||
ulong vmfsSuperOff = VxFS_Base / imagePlugin.ImageInfo.sectorSize;
|
||||
byte[] sector = imagePlugin.ReadSector(partition.PartitionStartSector + vmfsSuperOff);
|
||||
byte[] sector = imagePlugin.ReadSector(partition.Start + vmfsSuperOff);
|
||||
|
||||
VxSuperBlock vxSb = new VxSuperBlock();
|
||||
IntPtr vxSbPtr = Marshal.AllocHGlobal(Marshal.SizeOf(vxSb));
|
||||
|
||||
@@ -130,7 +130,7 @@ namespace DiscImageChef.Filesystems
|
||||
if(Marshal.SizeOf(xfsSb) % imagePlugin.GetSectorSize() != 0)
|
||||
sbSize++;
|
||||
|
||||
byte[] sector = imagePlugin.ReadSectors(partition.PartitionStartSector, sbSize);
|
||||
byte[] sector = imagePlugin.ReadSectors(partition.Start, sbSize);
|
||||
if(sector.Length < Marshal.SizeOf(xfsSb))
|
||||
return false;
|
||||
|
||||
@@ -151,7 +151,7 @@ namespace DiscImageChef.Filesystems
|
||||
if(Marshal.SizeOf(xfsSb) % imagePlugin.GetSectorSize() != 0)
|
||||
sbSize++;
|
||||
|
||||
byte[] sector = imagePlugin.ReadSectors(partition.PartitionStartSector, sbSize);
|
||||
byte[] sector = imagePlugin.ReadSectors(partition.Start, sbSize);
|
||||
if(sector.Length < Marshal.SizeOf(xfsSb))
|
||||
return;
|
||||
|
||||
|
||||
@@ -249,17 +249,17 @@ namespace DiscImageChef.Filesystems
|
||||
byte[] sector;
|
||||
ulong magic;
|
||||
|
||||
if(partition.PartitionStartSector + 31 < partition.PartitionEndSector)
|
||||
if(partition.Start + 31 < partition.End)
|
||||
{
|
||||
sector = imagePlugin.ReadSector(partition.PartitionStartSector + 31);
|
||||
sector = imagePlugin.ReadSector(partition.Start + 31);
|
||||
magic = BitConverter.ToUInt64(sector, 0x1D8);
|
||||
if(magic == ZEC_Magic || magic == ZEC_Cigam)
|
||||
return true;
|
||||
}
|
||||
|
||||
if(partition.PartitionStartSector + 16 < partition.PartitionEndSector)
|
||||
if(partition.Start + 16 < partition.End)
|
||||
{
|
||||
sector = imagePlugin.ReadSector(partition.PartitionStartSector + 16);
|
||||
sector = imagePlugin.ReadSector(partition.Start + 16);
|
||||
magic = BitConverter.ToUInt64(sector, 0x1D8);
|
||||
if(magic == ZEC_Magic || magic == ZEC_Cigam)
|
||||
return true;
|
||||
@@ -281,17 +281,17 @@ namespace DiscImageChef.Filesystems
|
||||
uint nvlistLen = 114688 / imagePlugin.ImageInfo.sectorSize;
|
||||
byte[] nvlist;
|
||||
|
||||
if(partition.PartitionStartSector + 31 < partition.PartitionEndSector)
|
||||
if(partition.Start + 31 < partition.End)
|
||||
{
|
||||
sector = imagePlugin.ReadSector(partition.PartitionStartSector + 31);
|
||||
sector = imagePlugin.ReadSector(partition.Start + 31);
|
||||
magic = BitConverter.ToUInt64(sector, 0x1D8);
|
||||
if(magic == ZEC_Magic || magic == ZEC_Cigam)
|
||||
nvlistOff = 32;
|
||||
}
|
||||
|
||||
if(partition.PartitionStartSector + 16 < partition.PartitionEndSector)
|
||||
if(partition.Start + 16 < partition.End)
|
||||
{
|
||||
sector = imagePlugin.ReadSector(partition.PartitionStartSector + 16);
|
||||
sector = imagePlugin.ReadSector(partition.Start + 16);
|
||||
magic = BitConverter.ToUInt64(sector, 0x1D8);
|
||||
if(magic == ZEC_Magic || magic == ZEC_Cigam)
|
||||
nvlistOff = 17;
|
||||
@@ -300,7 +300,7 @@ namespace DiscImageChef.Filesystems
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.AppendLine("ZFS filesystem");
|
||||
|
||||
nvlist = imagePlugin.ReadSectors(partition.PartitionStartSector + nvlistOff, nvlistLen);
|
||||
nvlist = imagePlugin.ReadSectors(partition.Start + nvlistOff, nvlistLen);
|
||||
Dictionary<string, NVS_Item> decodedNvList;
|
||||
|
||||
if(!DecodeNvList(nvlist, out decodedNvList))
|
||||
|
||||
@@ -60,10 +60,10 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if((12 + partition.PartitionStartSector) >= partition.PartitionEndSector)
|
||||
if((12 + partition.Start) >= partition.End)
|
||||
return false;
|
||||
|
||||
byte[] vbrSector = imagePlugin.ReadSector(0 + partition.PartitionStartSector);
|
||||
byte[] vbrSector = imagePlugin.ReadSector(0 + partition.Start);
|
||||
if(vbrSector.Length < 512)
|
||||
return false;
|
||||
|
||||
@@ -83,21 +83,21 @@ namespace DiscImageChef.Filesystems
|
||||
StringBuilder sb = new StringBuilder();
|
||||
xmlFSType = new Schemas.FileSystemType();
|
||||
|
||||
byte[] vbrSector = imagePlugin.ReadSector(0 + partition.PartitionStartSector);
|
||||
byte[] vbrSector = imagePlugin.ReadSector(0 + partition.Start);
|
||||
VolumeBootRecord vbr = new VolumeBootRecord();
|
||||
IntPtr vbrPtr = Marshal.AllocHGlobal(512);
|
||||
Marshal.Copy(vbrSector, 0, vbrPtr, 512);
|
||||
vbr = (VolumeBootRecord)Marshal.PtrToStructure(vbrPtr, typeof(VolumeBootRecord));
|
||||
Marshal.FreeHGlobal(vbrPtr);
|
||||
|
||||
byte[] parametersSector = imagePlugin.ReadSector(9 + partition.PartitionStartSector);
|
||||
byte[] parametersSector = imagePlugin.ReadSector(9 + partition.Start);
|
||||
OemParameterTable parametersTable = new OemParameterTable();
|
||||
IntPtr parametersPtr = Marshal.AllocHGlobal(512);
|
||||
Marshal.Copy(parametersSector, 0, parametersPtr, 512);
|
||||
parametersTable = (OemParameterTable)Marshal.PtrToStructure(parametersPtr, typeof(OemParameterTable));
|
||||
Marshal.FreeHGlobal(parametersPtr);
|
||||
|
||||
byte[] chkSector = imagePlugin.ReadSector(11 + partition.PartitionStartSector);
|
||||
byte[] chkSector = imagePlugin.ReadSector(11 + partition.Start);
|
||||
ChecksumSector chksector = new ChecksumSector();
|
||||
IntPtr chkPtr = Marshal.AllocHGlobal(512);
|
||||
Marshal.Copy(chkSector, 0, chkPtr, 512);
|
||||
|
||||
@@ -58,10 +58,10 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if((2 + partition.PartitionStartSector) >= partition.PartitionEndSector)
|
||||
if((2 + partition.Start) >= partition.End)
|
||||
return false;
|
||||
|
||||
byte[] sb_sector = imagePlugin.ReadSector(2 + partition.PartitionStartSector);
|
||||
byte[] sb_sector = imagePlugin.ReadSector(2 + partition.Start);
|
||||
|
||||
ushort magic = BitConverter.ToUInt16(sb_sector, 0x038);
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace DiscImageChef.Filesystems
|
||||
return;
|
||||
}
|
||||
|
||||
byte[] sb_sector = imagePlugin.ReadSectors(2 + partition.PartitionStartSector, sb_size_in_sectors);
|
||||
byte[] sb_sector = imagePlugin.ReadSectors(2 + partition.Start, sb_size_in_sectors);
|
||||
IntPtr sbPtr = Marshal.AllocHGlobal(512);
|
||||
Marshal.Copy(sb_sector, 0, sbPtr, 512);
|
||||
supblk = (ext2FSSuperBlock)Marshal.PtrToStructure(sbPtr, typeof(ext2FSSuperBlock));
|
||||
|
||||
@@ -57,10 +57,10 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
public override bool Identify(ImagePlugins.ImagePlugin imagePlugin, Partition partition)
|
||||
{
|
||||
if((2 + partition.PartitionStartSector) >= partition.PartitionEndSector)
|
||||
if((2 + partition.Start) >= partition.End)
|
||||
return false;
|
||||
|
||||
byte[] sb_sector = imagePlugin.ReadSector(2 + partition.PartitionStartSector); // Superblock resides at 0x400
|
||||
byte[] sb_sector = imagePlugin.ReadSector(2 + partition.Start); // Superblock resides at 0x400
|
||||
|
||||
ushort magic = BitConverter.ToUInt16(sb_sector, 0x038); // Here should reside magic number
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace DiscImageChef.Filesystems
|
||||
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
byte[] sb_sector = imagePlugin.ReadSector(2 + partition.PartitionStartSector); // Superblock resides at 0x400
|
||||
byte[] sb_sector = imagePlugin.ReadSector(2 + partition.Start); // Superblock resides at 0x400
|
||||
extFSSuperBlock ext_sb = new extFSSuperBlock();
|
||||
|
||||
ext_sb.inodes = BitConverter.ToUInt32(sb_sector, 0x000);
|
||||
@@ -101,7 +101,7 @@ namespace DiscImageChef.Filesystems
|
||||
xmlFSType.FreeClusters = ext_sb.freecountblk;
|
||||
xmlFSType.FreeClustersSpecified = true;
|
||||
xmlFSType.ClusterSize = 1024;
|
||||
xmlFSType.Clusters = (long)((partition.PartitionEndSector - partition.PartitionStartSector + 1) * imagePlugin.GetSectorSize() / 1024);
|
||||
xmlFSType.Clusters = (long)((partition.End - partition.Start + 1) * imagePlugin.GetSectorSize() / 1024);
|
||||
|
||||
information = sb.ToString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user