🎨🎨🎨 Removed methods in images that only returned what's already in the ImageInfo structure.

This commit is contained in:
2017-12-26 02:51:10 +00:00
parent 03a4e286cc
commit a002253fa4
135 changed files with 2111 additions and 8526 deletions

View File

@@ -258,7 +258,7 @@ namespace DiscImageChef.Filesystems
bytes *= 0x100000000;
bytes += drSb.disc_size;
return bytes <= imagePlugin.GetSectors() * imagePlugin.GetSectorSize();
return bytes <= imagePlugin.ImageInfo.Sectors * imagePlugin.ImageInfo.SectorSize;
}
// TODO: Find root directory on volumes with DiscRecord
@@ -476,7 +476,7 @@ namespace DiscImageChef.Filesystems
zones *= 0x100000000;
zones += drSb.nzones;
if(bytes > imagePlugin.GetSectors() * imagePlugin.GetSectorSize()) return;
if(bytes > imagePlugin.ImageInfo.Sectors * imagePlugin.ImageInfo.SectorSize) return;
XmlFsType = new FileSystemType();

View File

@@ -85,8 +85,8 @@ namespace DiscImageChef.Filesystems
byte[] mdbSector;
ushort drSigWord;
if(imagePlugin.GetSectorSize() == 2352 || imagePlugin.GetSectorSize() == 2448 ||
imagePlugin.GetSectorSize() == 2048)
if(imagePlugin.ImageInfo.SectorSize == 2352 || imagePlugin.ImageInfo.SectorSize == 2448 ||
imagePlugin.ImageInfo.SectorSize == 2048)
{
mdbSector = imagePlugin.ReadSectors(partition.Start, 2);
@@ -128,8 +128,8 @@ namespace DiscImageChef.Filesystems
bool APMFromHDDOnCD = false;
if(imagePlugin.GetSectorSize() == 2352 || imagePlugin.GetSectorSize() == 2448 ||
imagePlugin.GetSectorSize() == 2048)
if(imagePlugin.ImageInfo.SectorSize == 2352 || imagePlugin.ImageInfo.SectorSize == 2448 ||
imagePlugin.ImageInfo.SectorSize == 2048)
{
byte[] tmpSector = imagePlugin.ReadSectors(partition.Start, 2);

View File

@@ -104,7 +104,7 @@ namespace DiscImageChef.Filesystems
ushort drAlBlSt = BigEndianBitConverter.ToUInt16(vhSector, 0x41C);
hfspOffset = (ulong)((drAlBlSt * 512 + xdrStABNt * drAlBlkSiz) / imagePlugin.GetSectorSize());
hfspOffset = (ulong)((drAlBlSt * 512 + xdrStABNt * drAlBlkSiz) / imagePlugin.ImageInfo.SectorSize);
}
else hfspOffset = 0;
}
@@ -145,7 +145,7 @@ namespace DiscImageChef.Filesystems
ushort drAlBlSt = BigEndianBitConverter.ToUInt16(vhSector, 0x41C);
hfspOffset = (ulong)((drAlBlSt * 512 + xdrStABNt * drAlBlkSiz) / imagePlugin.GetSectorSize());
hfspOffset = (ulong)((drAlBlSt * 512 + xdrStABNt * drAlBlkSiz) / imagePlugin.ImageInfo.SectorSize);
wrapped = true;
}
else

View File

@@ -157,7 +157,7 @@ namespace DiscImageChef.Filesystems.AppleMFS
{
stat = new FileEntryInfo
{
BlockSize = device.GetSectorSize(),
BlockSize = device.ImageInfo.SectorSize,
DeviceNo = 0,
GID = 0,
Inode = 0,

View File

@@ -73,12 +73,12 @@ namespace DiscImageChef.Filesystems
public override bool Identify(ImagePlugin imagePlugin, Partition partition)
{
ulong sector = AFS_BOOTBLOCK_SIZE / imagePlugin.GetSectorSize();
uint offset = AFS_BOOTBLOCK_SIZE % imagePlugin.GetSectorSize();
ulong sector = AFS_BOOTBLOCK_SIZE / imagePlugin.ImageInfo.SectorSize;
uint offset = AFS_BOOTBLOCK_SIZE % imagePlugin.ImageInfo.SectorSize;
uint run = 1;
if(imagePlugin.GetSectorSize() < AFS_SUPERBLOCK_SIZE)
run = AFS_SUPERBLOCK_SIZE / imagePlugin.GetSectorSize();
if(imagePlugin.ImageInfo.SectorSize < AFS_SUPERBLOCK_SIZE)
run = AFS_SUPERBLOCK_SIZE / imagePlugin.ImageInfo.SectorSize;
if(sector + partition.Start >= partition.End) return false;
@@ -99,12 +99,12 @@ namespace DiscImageChef.Filesystems
StringBuilder sb = new StringBuilder();
ulong sector = AFS_BOOTBLOCK_SIZE / imagePlugin.GetSectorSize();
uint offset = AFS_BOOTBLOCK_SIZE % imagePlugin.GetSectorSize();
ulong sector = AFS_BOOTBLOCK_SIZE / imagePlugin.ImageInfo.SectorSize;
uint offset = AFS_BOOTBLOCK_SIZE % imagePlugin.ImageInfo.SectorSize;
uint run = 1;
if(imagePlugin.GetSectorSize() < AFS_SUPERBLOCK_SIZE)
run = AFS_SUPERBLOCK_SIZE / imagePlugin.GetSectorSize();
if(imagePlugin.ImageInfo.SectorSize < AFS_SUPERBLOCK_SIZE)
run = AFS_SUPERBLOCK_SIZE / imagePlugin.ImageInfo.SectorSize;
byte[] tmp = imagePlugin.ReadSectors(sector + partition.Start, run);
byte[] sbSector = new byte[AFS_SUPERBLOCK_SIZE];

View File

@@ -73,8 +73,8 @@ namespace DiscImageChef.Filesystems
{
if(partition.Start >= partition.End) return false;
ulong sbSectorOff = 0x10000 / imagePlugin.GetSectorSize();
uint sbSectorSize = 0x1000 / imagePlugin.GetSectorSize();
ulong sbSectorOff = 0x10000 / imagePlugin.ImageInfo.SectorSize;
uint sbSectorSize = 0x1000 / imagePlugin.ImageInfo.SectorSize;
if(sbSectorOff + partition.Start >= partition.End) return false;
@@ -103,8 +103,8 @@ namespace DiscImageChef.Filesystems
XmlFsType = new FileSystemType();
information = "";
ulong sbSectorOff = 0x10000 / imagePlugin.GetSectorSize();
uint sbSectorSize = 0x1000 / imagePlugin.GetSectorSize();
ulong sbSectorOff = 0x10000 / imagePlugin.ImageInfo.SectorSize;
uint sbSectorSize = 0x1000 / imagePlugin.ImageInfo.SectorSize;
byte[] sector = imagePlugin.ReadSectors(sbSectorOff + partition.Start, sbSectorSize);

View File

@@ -203,7 +203,8 @@ namespace DiscImageChef.Filesystems.CPM
sectorSize = (ulong)(128 << amsSb.psh);
// Compare device limits from superblock to real limits
if(sectorSize == imagePlugin.GetSectorSize() && sectorCount == imagePlugin.GetSectors())
if(sectorSize == imagePlugin.ImageInfo.SectorSize &&
sectorCount == imagePlugin.ImageInfo.Sectors)
{
cpmFound = true;
firstDirectorySector = (ulong)(amsSb.off * amsSb.spt);
@@ -318,7 +319,7 @@ namespace DiscImageChef.Filesystems.CPM
(ulong)((hddSb.firstCylinder * hddSb.heads + hddSb.heads) * hddSb.sectorsPerTrack);
// If volume size corresponds with working partition (this variant will be inside MBR partitioning)
if(sectorSize == imagePlugin.GetSectorSize() && startingSector == partition.Start &&
if(sectorSize == imagePlugin.ImageInfo.SectorSize && startingSector == partition.Start &&
sectorsInPartition + partition.Start <= partition.End)
{
cpmFound = true;
@@ -404,7 +405,7 @@ namespace DiscImageChef.Filesystems.CPM
switch((FormatByte)formatByte)
{
case FormatByte.k160:
if(imagePlugin.GetSectorSize() == 512 && imagePlugin.GetSectors() == 320)
if(imagePlugin.ImageInfo.SectorSize == 512 && imagePlugin.ImageInfo.Sectors == 320)
{
cpmFound = true;
firstDirectorySector86 = 8;
@@ -452,7 +453,7 @@ namespace DiscImageChef.Filesystems.CPM
break;
case FormatByte.k320:
if(imagePlugin.GetSectorSize() == 512 && imagePlugin.GetSectors() == 640)
if(imagePlugin.ImageInfo.SectorSize == 512 && imagePlugin.ImageInfo.Sectors == 640)
{
cpmFound = true;
firstDirectorySector86 = 16;
@@ -505,7 +506,7 @@ namespace DiscImageChef.Filesystems.CPM
case FormatByte.k360:
case FormatByte.k360Alt:
case FormatByte.k360Alt2:
if(imagePlugin.GetSectorSize() == 512 && imagePlugin.GetSectors() == 720)
if(imagePlugin.ImageInfo.SectorSize == 512 && imagePlugin.ImageInfo.Sectors == 720)
{
cpmFound = true;
firstDirectorySector86 = 36;
@@ -557,7 +558,7 @@ namespace DiscImageChef.Filesystems.CPM
break;
case FormatByte.k720:
case FormatByte.k720Alt:
if(imagePlugin.GetSectorSize() == 512 && imagePlugin.GetSectors() == 1440)
if(imagePlugin.ImageInfo.SectorSize == 512 && imagePlugin.ImageInfo.Sectors == 1440)
{
cpmFound = true;
firstDirectorySector86 = 36;
@@ -608,7 +609,7 @@ namespace DiscImageChef.Filesystems.CPM
break;
case FormatByte.f720:
if(imagePlugin.GetSectorSize() == 512 && imagePlugin.GetSectors() == 1440)
if(imagePlugin.ImageInfo.SectorSize == 512 && imagePlugin.ImageInfo.Sectors == 1440)
{
cpmFound = true;
firstDirectorySector86 = 18;
@@ -659,7 +660,7 @@ namespace DiscImageChef.Filesystems.CPM
break;
case FormatByte.f1200:
if(imagePlugin.GetSectorSize() == 512 && imagePlugin.GetSectors() == 2400)
if(imagePlugin.ImageInfo.SectorSize == 512 && imagePlugin.ImageInfo.Sectors == 2400)
{
cpmFound = true;
firstDirectorySector86 = 30;
@@ -710,7 +711,7 @@ namespace DiscImageChef.Filesystems.CPM
break;
case FormatByte.f1440:
if(imagePlugin.GetSectorSize() == 512 && imagePlugin.GetSectors() == 2880)
if(imagePlugin.ImageInfo.SectorSize == 512 && imagePlugin.ImageInfo.Sectors == 2880)
{
cpmFound = true;
firstDirectorySector86 = 36;
@@ -764,7 +765,7 @@ namespace DiscImageChef.Filesystems.CPM
if(cpmFound)
{
uint directoryLength = (uint)(((ulong)dpb.drm + 1) * 32 / imagePlugin.GetSectorSize());
uint directoryLength = (uint)(((ulong)dpb.drm + 1) * 32 / imagePlugin.ImageInfo.SectorSize);
directory = imagePlugin.ReadSectors(firstDirectorySector86 + partition.Start, directoryLength);
DicConsole.DebugWriteLine("CP/M Plugin", "Found CP/M-86 floppy identifier.");
}
@@ -793,8 +794,8 @@ namespace DiscImageChef.Filesystems.CPM
foreach(CpmDefinition def in from def in definitions.definitions
let sectors =
(ulong)(def.cylinders * def.sides * def.sectorsPerTrack)
where sectors == imagePlugin.GetSectors() &&
def.bytesPerSector == imagePlugin.GetSectorSize()
where sectors == imagePlugin.ImageInfo.Sectors &&
def.bytesPerSector == imagePlugin.ImageInfo.SectorSize
select def)
{
// Definition seems to describe current disk, at least, same number of volume sectors and bytes per sector

View File

@@ -70,15 +70,15 @@ namespace DiscImageChef.Filesystems
public override bool Identify(ImagePlugin imagePlugin, Partition partition)
{
if(imagePlugin.GetSectorSize() < 512) return false;
if(imagePlugin.ImageInfo.SectorSize < 512) return false;
// Misaligned
if(imagePlugin.ImageInfo.XmlMediaType == XmlMediaType.OpticalDisc)
{
EFS_Superblock efsSb = new EFS_Superblock();
uint sbSize = (uint)((Marshal.SizeOf(efsSb) + 0x200) / imagePlugin.GetSectorSize());
if((Marshal.SizeOf(efsSb) + 0x200) % imagePlugin.GetSectorSize() != 0) sbSize++;
uint sbSize = (uint)((Marshal.SizeOf(efsSb) + 0x200) / imagePlugin.ImageInfo.SectorSize);
if((Marshal.SizeOf(efsSb) + 0x200) % imagePlugin.ImageInfo.SectorSize != 0) sbSize++;
byte[] sector = imagePlugin.ReadSectors(partition.Start, sbSize);
if(sector.Length < Marshal.SizeOf(efsSb)) return false;
@@ -98,8 +98,8 @@ namespace DiscImageChef.Filesystems
{
EFS_Superblock efsSb = new EFS_Superblock();
uint sbSize = (uint)(Marshal.SizeOf(efsSb) / imagePlugin.GetSectorSize());
if(Marshal.SizeOf(efsSb) % imagePlugin.GetSectorSize() != 0) sbSize++;
uint sbSize = (uint)(Marshal.SizeOf(efsSb) / imagePlugin.ImageInfo.SectorSize);
if(Marshal.SizeOf(efsSb) % imagePlugin.ImageInfo.SectorSize != 0) sbSize++;
byte[] sector = imagePlugin.ReadSectors(partition.Start + 1, sbSize);
if(sector.Length < Marshal.SizeOf(efsSb)) return false;
@@ -118,15 +118,15 @@ namespace DiscImageChef.Filesystems
public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information)
{
information = "";
if(imagePlugin.GetSectorSize() < 512) return;
if(imagePlugin.ImageInfo.SectorSize < 512) return;
EFS_Superblock efsSb = new EFS_Superblock();
// Misaligned
if(imagePlugin.ImageInfo.XmlMediaType == XmlMediaType.OpticalDisc)
{
uint sbSize = (uint)((Marshal.SizeOf(efsSb) + 0x400) / imagePlugin.GetSectorSize());
if((Marshal.SizeOf(efsSb) + 0x400) % imagePlugin.GetSectorSize() != 0) sbSize++;
uint sbSize = (uint)((Marshal.SizeOf(efsSb) + 0x400) / imagePlugin.ImageInfo.SectorSize);
if((Marshal.SizeOf(efsSb) + 0x400) % imagePlugin.ImageInfo.SectorSize != 0) sbSize++;
byte[] sector = imagePlugin.ReadSectors(partition.Start, sbSize);
if(sector.Length < Marshal.SizeOf(efsSb)) return;
@@ -142,8 +142,8 @@ namespace DiscImageChef.Filesystems
}
else
{
uint sbSize = (uint)(Marshal.SizeOf(efsSb) / imagePlugin.GetSectorSize());
if(Marshal.SizeOf(efsSb) % imagePlugin.GetSectorSize() != 0) sbSize++;
uint sbSize = (uint)(Marshal.SizeOf(efsSb) / imagePlugin.ImageInfo.SectorSize);
if(Marshal.SizeOf(efsSb) % imagePlugin.ImageInfo.SectorSize != 0) sbSize++;
byte[] sector = imagePlugin.ReadSectors(partition.Start + 1, sbSize);
if(sector.Length < Marshal.SizeOf(efsSb)) return;

View File

@@ -72,16 +72,16 @@ namespace DiscImageChef.Filesystems
public override bool Identify(ImagePlugin imagePlugin, Partition partition)
{
if(imagePlugin.GetSectorSize() < F2FS_MIN_SECTOR || imagePlugin.GetSectorSize() > F2FS_MAX_SECTOR)
return false;
if(imagePlugin.ImageInfo.SectorSize < F2FS_MIN_SECTOR ||
imagePlugin.ImageInfo.SectorSize > F2FS_MAX_SECTOR) return false;
uint sbAddr = F2FS_SUPER_OFFSET / imagePlugin.GetSectorSize();
uint sbAddr = F2FS_SUPER_OFFSET / imagePlugin.ImageInfo.SectorSize;
if(sbAddr == 0) sbAddr = 1;
F2FS_Superblock f2fsSb = new F2FS_Superblock();
uint sbSize = (uint)(Marshal.SizeOf(f2fsSb) / imagePlugin.GetSectorSize());
if(Marshal.SizeOf(f2fsSb) % imagePlugin.GetSectorSize() != 0) sbSize++;
uint sbSize = (uint)(Marshal.SizeOf(f2fsSb) / imagePlugin.ImageInfo.SectorSize);
if(Marshal.SizeOf(f2fsSb) % imagePlugin.ImageInfo.SectorSize != 0) sbSize++;
if(partition.Start + sbAddr >= partition.End) return false;
@@ -99,15 +99,16 @@ namespace DiscImageChef.Filesystems
public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information)
{
information = "";
if(imagePlugin.GetSectorSize() < F2FS_MIN_SECTOR || imagePlugin.GetSectorSize() > F2FS_MAX_SECTOR) return;
if(imagePlugin.ImageInfo.SectorSize < F2FS_MIN_SECTOR ||
imagePlugin.ImageInfo.SectorSize > F2FS_MAX_SECTOR) return;
uint sbAddr = F2FS_SUPER_OFFSET / imagePlugin.GetSectorSize();
uint sbAddr = F2FS_SUPER_OFFSET / imagePlugin.ImageInfo.SectorSize;
if(sbAddr == 0) sbAddr = 1;
F2FS_Superblock f2fsSb = new F2FS_Superblock();
uint sbSize = (uint)(Marshal.SizeOf(f2fsSb) / imagePlugin.GetSectorSize());
if(Marshal.SizeOf(f2fsSb) % imagePlugin.GetSectorSize() != 0) sbSize++;
uint sbSize = (uint)(Marshal.SizeOf(f2fsSb) / imagePlugin.ImageInfo.SectorSize);
if(Marshal.SizeOf(f2fsSb) % imagePlugin.ImageInfo.SectorSize != 0) sbSize++;
byte[] sector = imagePlugin.ReadSectors(partition.Start + sbAddr, sbSize);
if(sector.Length < Marshal.SizeOf(f2fsSb)) return;

View File

@@ -242,7 +242,7 @@ namespace DiscImageChef.Filesystems
if(partition.Start != 0) return false;
// DEC Rainbow, lacks a BPB but has a very concrete structure...
if(imagePlugin.GetSectors() == 800 && imagePlugin.GetSectorSize() == 512)
if(imagePlugin.ImageInfo.Sectors == 800 && imagePlugin.ImageInfo.SectorSize == 512)
{
// DEC Rainbow boots up with a Z80, first byte should be DI (disable interrupts)
byte z80Di = bpbSector[0];
@@ -598,9 +598,9 @@ namespace DiscImageChef.Filesystems
uint sectorsForRootDirectory = 0;
// DEC Rainbow, lacks a BPB but has a very concrete structure...
if(imagePlugin.GetSectors() == 800 && imagePlugin.GetSectorSize() == 512 && !useAtariBpb && !useMsxBpb &&
!useDos2Bpb && !useDos3Bpb && !useDos32Bpb && !useDos33Bpb && !userShortExtendedBpb && !useExtendedBpb &&
!useShortFat32 && !useLongFat32 && !useApricotBpb)
if(imagePlugin.ImageInfo.Sectors == 800 && imagePlugin.ImageInfo.SectorSize == 512 && !useAtariBpb &&
!useMsxBpb && !useDos2Bpb && !useDos3Bpb && !useDos32Bpb && !useDos33Bpb && !userShortExtendedBpb &&
!useExtendedBpb && !useShortFat32 && !useLongFat32 && !useApricotBpb)
{
// DEC Rainbow boots up with a Z80, first byte should be DI (disable interrupts)
byte z80Di = bpbSector[0];
@@ -1132,10 +1132,10 @@ namespace DiscImageChef.Filesystems
XmlFsType.Bootable = apricotBpb.bootType > 0;
if(apricotBpb.bootLocation > 0 &&
apricotBpb.bootLocation + apricotBpb.bootSize < imagePlugin.GetSectors())
apricotBpb.bootLocation + apricotBpb.bootSize < imagePlugin.ImageInfo.Sectors)
fakeBpb.boot_code = imagePlugin.ReadSectors(apricotBpb.bootLocation,
(uint)(apricotBpb.sectorSize * apricotBpb.bootSize) /
imagePlugin.GetSectorSize());
imagePlugin.ImageInfo.SectorSize);
}
if(!isFat32)

View File

@@ -67,7 +67,7 @@ namespace DiscImageChef.Filesystems
public override bool Identify(ImagePlugin imagePlugin, Partition partition)
{
if(imagePlugin.GetSectorSize() < 512) return false;
if(imagePlugin.ImageInfo.SectorSize < 512) return false;
FATX_Superblock fatxSb;
byte[] sector = imagePlugin.ReadSector(partition.Start);
@@ -80,7 +80,7 @@ namespace DiscImageChef.Filesystems
public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information)
{
information = "";
if(imagePlugin.GetSectorSize() < 512) return;
if(imagePlugin.ImageInfo.SectorSize < 512) return;
FATX_Superblock fatxSb;

View File

@@ -108,15 +108,15 @@ namespace DiscImageChef.Filesystems
uint sbSizeInSectors;
if(imagePlugin.GetSectorSize() == 2336 || imagePlugin.GetSectorSize() == 2352 ||
imagePlugin.GetSectorSize() == 2448) sbSizeInSectors = block_size / 2048;
else sbSizeInSectors = block_size / imagePlugin.GetSectorSize();
if(imagePlugin.ImageInfo.SectorSize == 2336 || imagePlugin.ImageInfo.SectorSize == 2352 ||
imagePlugin.ImageInfo.SectorSize == 2448) sbSizeInSectors = block_size / 2048;
else sbSizeInSectors = block_size / imagePlugin.ImageInfo.SectorSize;
ulong[] locations =
{
sb_start_floppy, sb_start_boot, sb_start_long_boot, sb_start_piggy, sb_start_att_dsdd,
8192 / imagePlugin.GetSectorSize(), 65536 / imagePlugin.GetSectorSize(),
262144 / imagePlugin.GetSectorSize()
8192 / imagePlugin.ImageInfo.SectorSize, 65536 / imagePlugin.ImageInfo.SectorSize,
262144 / imagePlugin.ImageInfo.SectorSize
};
return locations.Where(loc => partition.End > partition.Start + loc + sbSizeInSectors)
@@ -144,15 +144,15 @@ namespace DiscImageChef.Filesystems
bool fs_type_sun = false;
bool fs_type_sun86 = false;
if(imagePlugin.GetSectorSize() == 2336 || imagePlugin.GetSectorSize() == 2352 ||
imagePlugin.GetSectorSize() == 2448) sb_size_in_sectors = block_size / 2048;
else sb_size_in_sectors = block_size / imagePlugin.GetSectorSize();
if(imagePlugin.ImageInfo.SectorSize == 2336 || imagePlugin.ImageInfo.SectorSize == 2352 ||
imagePlugin.ImageInfo.SectorSize == 2448) sb_size_in_sectors = block_size / 2048;
else sb_size_in_sectors = block_size / imagePlugin.ImageInfo.SectorSize;
ulong[] locations =
{
sb_start_floppy, sb_start_boot, sb_start_long_boot, sb_start_piggy, sb_start_att_dsdd,
8192 / imagePlugin.GetSectorSize(), 65536 / imagePlugin.GetSectorSize(),
262144 / imagePlugin.GetSectorSize()
8192 / imagePlugin.ImageInfo.SectorSize, 65536 / imagePlugin.ImageInfo.SectorSize,
262144 / imagePlugin.ImageInfo.SectorSize
};
foreach(ulong loc in locations.Where(loc => partition.End > partition.Start + loc + sb_size_in_sectors))
@@ -594,19 +594,19 @@ namespace DiscImageChef.Filesystems
/// </summary>
public uint fs_rlink;
/// <summary>addr of super-block in filesys</summary>
public ufs_daddr_t fs_sblkno;
public int fs_sblkno;
/// <summary>offset of cyl-block in filesys</summary>
public ufs_daddr_t fs_cblkno;
public int fs_cblkno;
/// <summary>offset of inode-blocks in filesys</summary>
public ufs_daddr_t fs_iblkno;
public int fs_iblkno;
/// <summary>offset of first data after cg</summary>
public ufs_daddr_t fs_dblkno;
public int fs_dblkno;
/// <summary>cylinder group offset in cylinder</summary>
public int fs_old_cgoffset;
/// <summary>used to calc mod fs_ntrak</summary>
public int fs_old_cgmask;
/// <summary>last time written</summary>
public time_t fs_old_time;
public int fs_old_time;
/// <summary>number of blocks in fs</summary>
public int fs_old_size;
/// <summary>number of data blocks in fs</summary>
@@ -684,7 +684,7 @@ namespace DiscImageChef.Filesystems
public int fs_id_2;
/* sizes determined by number of cylinder groups and their sizes */
/// <summary>blk addr of cyl grp summary area</summary>
public ufs_daddr_t fs_old_csaddr;
public int fs_old_csaddr;
/// <summary>size of cyl grp summary area</summary>
public int fs_cssize;
/// <summary>cylinder group size</summary>

View File

@@ -73,11 +73,11 @@ namespace DiscImageChef.Filesystems
public override bool Identify(ImagePlugin imagePlugin, Partition partition)
{
ulong hdrSector = HEADER_POS / imagePlugin.GetSectorSize();
ulong hdrSector = HEADER_POS / imagePlugin.ImageInfo.SectorSize;
FossilHeader hdr;
if(partition.Start + hdrSector > imagePlugin.GetSectors()) return false;
if(partition.Start + hdrSector > imagePlugin.ImageInfo.Sectors) return false;
byte[] sector = imagePlugin.ReadSector(partition.Start + hdrSector);
hdr = BigEndianMarshal.ByteArrayToStructureBigEndian<FossilHeader>(sector);
@@ -91,9 +91,9 @@ namespace DiscImageChef.Filesystems
public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information)
{
information = "";
if(imagePlugin.GetSectorSize() < 512) return;
if(imagePlugin.ImageInfo.SectorSize < 512) return;
ulong hdrSector = HEADER_POS / imagePlugin.GetSectorSize();
ulong hdrSector = HEADER_POS / imagePlugin.ImageInfo.SectorSize;
FossilHeader hdr;
@@ -113,7 +113,7 @@ namespace DiscImageChef.Filesystems
sb.AppendFormat("Data starts at block {0}", hdr.data).AppendLine();
sb.AppendFormat("Volume has {0} blocks", hdr.end).AppendLine();
ulong sbLocation = hdr.super * (hdr.blockSize / imagePlugin.GetSectorSize()) + partition.Start;
ulong sbLocation = hdr.super * (hdr.blockSize / imagePlugin.ImageInfo.SectorSize) + partition.Start;
XmlFsType = new FileSystemType
{

View File

@@ -76,9 +76,9 @@ namespace DiscImageChef.Filesystems
public override bool Identify(ImagePlugin imagePlugin, Partition partition)
{
uint run = HAMMER_VOLHDR_SIZE / imagePlugin.GetSectorSize();
uint run = HAMMER_VOLHDR_SIZE / imagePlugin.ImageInfo.SectorSize;
if(HAMMER_VOLHDR_SIZE % imagePlugin.GetSectorSize() > 0) run++;
if(HAMMER_VOLHDR_SIZE % imagePlugin.ImageInfo.SectorSize > 0) run++;
if(run + partition.Start >= partition.End) return false;
@@ -99,9 +99,9 @@ namespace DiscImageChef.Filesystems
HammerSuperBlock hammerSb;
uint run = HAMMER_VOLHDR_SIZE / imagePlugin.GetSectorSize();
uint run = HAMMER_VOLHDR_SIZE / imagePlugin.ImageInfo.SectorSize;
if(HAMMER_VOLHDR_SIZE % imagePlugin.GetSectorSize() > 0) run++;
if(HAMMER_VOLHDR_SIZE % imagePlugin.ImageInfo.SectorSize > 0) run++;
ulong magic;

View File

@@ -48,7 +48,7 @@ namespace DiscImageChef.Filesystems.ISO9660
public override bool Identify(ImagePlugin imagePlugin, Partition partition)
{
// ISO9660 is designed for 2048 bytes/sector devices
if(imagePlugin.GetSectorSize() < 2048) return false;
if(imagePlugin.ImageInfo.SectorSize < 2048) return false;
// ISO9660 Primary Volume Descriptor starts at sector 16, so that's minimal size.
if(partition.End <= 16 + partition.Start) return false;
@@ -94,7 +94,7 @@ namespace DiscImageChef.Filesystems.ISO9660
ElToritoBootRecord? torito = null;
// ISO9660 is designed for 2048 bytes/sector devices
if(imagePlugin.GetSectorSize() < 2048) return;
if(imagePlugin.ImageInfo.SectorSize < 2048) return;
// ISO9660 Primary Volume Descriptor starts at sector 16, so that's minimal size.
if(partition.End < 16) return;

View File

@@ -68,7 +68,7 @@ namespace DiscImageChef.Filesystems
public override bool Identify(ImagePlugin imagePlugin, Partition partition)
{
uint bootSectors = JFS_BOOT_BLOCKS_SIZE / imagePlugin.GetSectorSize();
uint bootSectors = JFS_BOOT_BLOCKS_SIZE / imagePlugin.ImageInfo.SectorSize;
if(partition.Start + bootSectors >= partition.End) return false;
byte[] sector = imagePlugin.ReadSector(partition.Start + bootSectors);
@@ -87,7 +87,7 @@ namespace DiscImageChef.Filesystems
{
information = "";
StringBuilder sb = new StringBuilder();
uint bootSectors = JFS_BOOT_BLOCKS_SIZE / imagePlugin.GetSectorSize();
uint bootSectors = JFS_BOOT_BLOCKS_SIZE / imagePlugin.ImageInfo.SectorSize;
byte[] sector = imagePlugin.ReadSector(partition.Start + bootSectors);
if(sector.Length < 512) return;

View File

@@ -69,7 +69,7 @@ namespace DiscImageChef.Filesystems
public override bool Identify(ImagePlugin imagePlugin, Partition partition)
{
if(imagePlugin.GetSectorSize() < 256) return false;
if(imagePlugin.ImageInfo.SectorSize < 256) return false;
byte[] sector = imagePlugin.ReadSector(partition.Start);
LIF_SystemBlock lifSb = BigEndianMarshal.ByteArrayToStructureBigEndian<LIF_SystemBlock>(sector);
@@ -82,7 +82,7 @@ namespace DiscImageChef.Filesystems
{
information = "";
if(imagePlugin.GetSectorSize() < 256) return;
if(imagePlugin.ImageInfo.SectorSize < 256) return;
byte[] sector = imagePlugin.ReadSector(partition.Start);
LIF_SystemBlock lifSb = BigEndianMarshal.ByteArrayToStructureBigEndian<LIF_SystemBlock>(sector);

View File

@@ -164,7 +164,7 @@ namespace DiscImageChef.Filesystems.LisaFS
// Search for the first sector describing the catalog
// While root catalog is not stored in S-Records, probably rest are? (unchecked)
// If root catalog is not pointed in MDDF (unchecked) maybe it's always following S-Records File?
for(ulong i = 0; i < device.GetSectors(); i++)
for(ulong i = 0; i < device.ImageInfo.Sectors; i++)
{
DecodeTag(device.ReadSectorTag(i, SectorTagType.AppleSectorTag), out LisaTag.PriamTag catTag);

View File

@@ -194,7 +194,7 @@ namespace DiscImageChef.Filesystems.LisaFS
if(count == 0) return Errno.NoSuchFile;
buf = !tags ? new byte[count * device.GetSectorSize()] : new byte[count * devTagSize];
buf = !tags ? new byte[count * device.ImageInfo.SectorSize] : new byte[count * devTagSize];
// Should be enough to check 100 sectors?
for(ulong i = 0; i < 100; i++)
@@ -325,7 +325,7 @@ namespace DiscImageChef.Filesystems.LisaFS
int sectorSize;
if(tags) sectorSize = devTagSize;
else sectorSize = (int)device.GetSectorSize();
else sectorSize = (int)device.ImageInfo.SectorSize;
byte[] temp = new byte[file.length * sectorSize];

View File

@@ -54,7 +54,7 @@ namespace DiscImageChef.Filesystems.LisaFS
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
// Minimal LisaOS disk is 3.5" single sided double density, 800 sectors
if(imagePlugin.GetSectors() < 800) return false;
if(imagePlugin.ImageInfo.Sectors < 800) return false;
int beforeMddf = -1;
@@ -83,18 +83,20 @@ namespace DiscImageChef.Filesystems.LisaFS
DicConsole.DebugWriteLine("LisaFS plugin", "Current sector = {0}", i);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.mddf_block = {0}", infoMddf.mddf_block);
DicConsole.DebugWriteLine("LisaFS plugin", "Disk size = {0} sectors", imagePlugin.GetSectors());
DicConsole.DebugWriteLine("LisaFS plugin", "Disk size = {0} sectors",
imagePlugin.ImageInfo.Sectors);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.vol_size = {0} sectors", infoMddf.vol_size);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.vol_size - 1 = {0}", infoMddf.volsize_minus_one);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.vol_size - mddf.mddf_block -1 = {0}",
infoMddf.volsize_minus_mddf_minus_one);
DicConsole.DebugWriteLine("LisaFS plugin", "Disk sector = {0} bytes", imagePlugin.GetSectorSize());
DicConsole.DebugWriteLine("LisaFS plugin", "Disk sector = {0} bytes",
imagePlugin.ImageInfo.SectorSize);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.blocksize = {0} bytes", infoMddf.blocksize);
DicConsole.DebugWriteLine("LisaFS plugin", "mddf.datasize = {0} bytes", infoMddf.datasize);
if(infoMddf.mddf_block != i - beforeMddf) return false;
if(infoMddf.vol_size > imagePlugin.GetSectors()) return false;
if(infoMddf.vol_size > imagePlugin.ImageInfo.Sectors) return false;
if(infoMddf.vol_size - 1 != infoMddf.volsize_minus_one) return false;
@@ -102,9 +104,9 @@ namespace DiscImageChef.Filesystems.LisaFS
if(infoMddf.datasize > infoMddf.blocksize) return false;
if(infoMddf.blocksize < imagePlugin.GetSectorSize()) return false;
if(infoMddf.blocksize < imagePlugin.ImageInfo.SectorSize) return false;
return infoMddf.datasize == imagePlugin.GetSectorSize();
return infoMddf.datasize == imagePlugin.ImageInfo.SectorSize;
}
return false;
@@ -131,7 +133,7 @@ namespace DiscImageChef.Filesystems.LisaFS
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
// Minimal LisaOS disk is 3.5" single sided double density, 800 sectors
if(imagePlugin.GetSectors() < 800) return;
if(imagePlugin.ImageInfo.Sectors < 800) return;
int beforeMddf = -1;
@@ -274,7 +276,7 @@ namespace DiscImageChef.Filesystems.LisaFS
if(infoMddf.mddf_block != i - beforeMddf) return;
if(infoMddf.vol_size > imagePlugin.GetSectors()) return;
if(infoMddf.vol_size > imagePlugin.ImageInfo.Sectors) return;
if(infoMddf.vol_size - 1 != infoMddf.volsize_minus_one) return;
@@ -282,9 +284,9 @@ namespace DiscImageChef.Filesystems.LisaFS
if(infoMddf.datasize > infoMddf.blocksize) return;
if(infoMddf.blocksize < imagePlugin.GetSectorSize()) return;
if(infoMddf.blocksize < imagePlugin.ImageInfo.SectorSize) return;
if(infoMddf.datasize != imagePlugin.GetSectorSize()) return;
if(infoMddf.datasize != imagePlugin.ImageInfo.SectorSize) return;
switch(infoMddf.fsversion)
{

View File

@@ -70,7 +70,7 @@ namespace DiscImageChef.Filesystems.LisaFS
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
// Minimal LisaOS disk is 3.5" single sided double density, 800 sectors
if(device.GetSectors() < 800)
if(device.ImageInfo.Sectors < 800)
{
DicConsole.DebugWriteLine("LisaFS plugin", "Device is too small");
return Errno.InOutError;
@@ -178,11 +178,11 @@ namespace DiscImageChef.Filesystems.LisaFS
mddf.vol_left_mounted = sector[0x138];
// Check that the MDDF is correct
if(mddf.mddf_block != i - volumePrefix || mddf.vol_size > device.GetSectors() ||
if(mddf.mddf_block != i - volumePrefix || mddf.vol_size > device.ImageInfo.Sectors ||
mddf.vol_size - 1 != mddf.volsize_minus_one ||
mddf.vol_size - i - 1 != mddf.volsize_minus_mddf_minus_one - volumePrefix ||
mddf.datasize > mddf.blocksize || mddf.blocksize < device.GetSectorSize() ||
mddf.datasize != device.GetSectorSize())
mddf.datasize > mddf.blocksize || mddf.blocksize < device.ImageInfo.SectorSize ||
mddf.datasize != device.ImageInfo.SectorSize)
{
DicConsole.DebugWriteLine("LisaFS plugin", "Incorrect MDDF found");
return Errno.InvalidArgument;

View File

@@ -91,16 +91,16 @@ namespace DiscImageChef.Filesystems
public override bool Identify(ImagePlugin imagePlugin, Partition partition)
{
if(imagePlugin.GetSectorSize() < 512) return false;
if(imagePlugin.ImageInfo.SectorSize < 512) return false;
for(ulong location = 0; location <= 8; location++)
{
Locus_Superblock LocusSb = new Locus_Superblock();
uint sbSize = (uint)(Marshal.SizeOf(LocusSb) / imagePlugin.GetSectorSize());
if(Marshal.SizeOf(LocusSb) % imagePlugin.GetSectorSize() != 0) sbSize++;
uint sbSize = (uint)(Marshal.SizeOf(LocusSb) / imagePlugin.ImageInfo.SectorSize);
if(Marshal.SizeOf(LocusSb) % imagePlugin.ImageInfo.SectorSize != 0) sbSize++;
if(partition.Start + location + sbSize >= imagePlugin.GetSectors()) break;
if(partition.Start + location + sbSize >= imagePlugin.ImageInfo.Sectors) break;
byte[] sector = imagePlugin.ReadSectors(partition.Start + location, sbSize);
if(sector.Length < Marshal.SizeOf(LocusSb)) return false;
@@ -122,15 +122,15 @@ namespace DiscImageChef.Filesystems
public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information)
{
information = "";
if(imagePlugin.GetSectorSize() < 512) return;
if(imagePlugin.ImageInfo.SectorSize < 512) return;
Locus_Superblock LocusSb = new Locus_Superblock();
byte[] sector = null;
for(ulong location = 0; location <= 8; location++)
{
uint sbSize = (uint)(Marshal.SizeOf(LocusSb) / imagePlugin.GetSectorSize());
if(Marshal.SizeOf(LocusSb) % imagePlugin.GetSectorSize() != 0) sbSize++;
uint sbSize = (uint)(Marshal.SizeOf(LocusSb) / imagePlugin.ImageInfo.SectorSize);
if(Marshal.SizeOf(LocusSb) % imagePlugin.ImageInfo.SectorSize != 0) sbSize++;
sector = imagePlugin.ReadSectors(partition.Start + location, sbSize);
if(sector.Length < Marshal.SizeOf(LocusSb)) return;

View File

@@ -72,7 +72,7 @@ namespace DiscImageChef.Filesystems
{
if(1 + partition.Start >= partition.End) return false;
if(imagePlugin.GetSectorSize() < 512) return false;
if(imagePlugin.ImageInfo.SectorSize < 512) return false;
byte[] bk0 = imagePlugin.ReadSector(0 + partition.Start);

View File

@@ -68,15 +68,15 @@ namespace DiscImageChef.Filesystems
public override bool Identify(ImagePlugin imagePlugin, Partition partition)
{
if(imagePlugin.GetSectorSize() < 512) return false;
if(imagePlugin.ImageInfo.SectorSize < 512) return false;
uint sbAddr = NILFS2_SUPER_OFFSET / imagePlugin.GetSectorSize();
uint sbAddr = NILFS2_SUPER_OFFSET / imagePlugin.ImageInfo.SectorSize;
if(sbAddr == 0) sbAddr = 1;
NILFS2_Superblock nilfsSb = new NILFS2_Superblock();
uint sbSize = (uint)(Marshal.SizeOf(nilfsSb) / imagePlugin.GetSectorSize());
if(Marshal.SizeOf(nilfsSb) % imagePlugin.GetSectorSize() != 0) sbSize++;
uint sbSize = (uint)(Marshal.SizeOf(nilfsSb) / imagePlugin.ImageInfo.SectorSize);
if(Marshal.SizeOf(nilfsSb) % imagePlugin.ImageInfo.SectorSize != 0) sbSize++;
if(partition.Start + sbAddr + sbSize >= partition.End) return false;
@@ -94,15 +94,15 @@ namespace DiscImageChef.Filesystems
public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information)
{
information = "";
if(imagePlugin.GetSectorSize() < 512) return;
if(imagePlugin.ImageInfo.SectorSize < 512) return;
uint sbAddr = NILFS2_SUPER_OFFSET / imagePlugin.GetSectorSize();
uint sbAddr = NILFS2_SUPER_OFFSET / imagePlugin.ImageInfo.SectorSize;
if(sbAddr == 0) sbAddr = 1;
NILFS2_Superblock nilfsSb = new NILFS2_Superblock();
uint sbSize = (uint)(Marshal.SizeOf(nilfsSb) / imagePlugin.GetSectorSize());
if(Marshal.SizeOf(nilfsSb) % imagePlugin.GetSectorSize() != 0) sbSize++;
uint sbSize = (uint)(Marshal.SizeOf(nilfsSb) / imagePlugin.ImageInfo.SectorSize);
if(Marshal.SizeOf(nilfsSb) % imagePlugin.ImageInfo.SectorSize != 0) sbSize++;
byte[] sector = imagePlugin.ReadSectors(partition.Start + sbAddr, sbSize);
if(sector.Length < Marshal.SizeOf(nilfsSb)) return;

View File

@@ -67,11 +67,11 @@ namespace DiscImageChef.Filesystems
{
if(partition.Start != 0) return false;
if(imagePlugin.GetSectors() * imagePlugin.GetSectorSize() < 0x50000) return false;
if(imagePlugin.ImageInfo.Sectors * imagePlugin.ImageInfo.SectorSize < 0x50000) return false;
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
byte[] header = imagePlugin.ReadSectors(0, 0x50000 / imagePlugin.GetSectorSize());
byte[] header = imagePlugin.ReadSectors(0, 0x50000 / imagePlugin.ImageInfo.SectorSize);
uint magicGc = BigEndianBitConverter.ToUInt32(header, 0x1C);
uint magicWii = BigEndianBitConverter.ToUInt32(header, 0x18);
@@ -88,7 +88,7 @@ namespace DiscImageChef.Filesystems
NintendoFields fields = new NintendoFields();
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
byte[] header = imagePlugin.ReadSectors(0, 0x50000 / imagePlugin.GetSectorSize());
byte[] header = imagePlugin.ReadSectors(0, 0x50000 / imagePlugin.ImageInfo.SectorSize);
bool wii = false;
@@ -304,7 +304,7 @@ namespace DiscImageChef.Filesystems
information = sbInformation.ToString();
XmlFsType.Bootable = true;
XmlFsType.Clusters = (long)(imagePlugin.GetSectors() * imagePlugin.GetSectorSize() / 2048);
XmlFsType.Clusters = (long)(imagePlugin.ImageInfo.Sectors * imagePlugin.ImageInfo.SectorSize / 2048);
XmlFsType.ClusterSize = 2048;
XmlFsType.Type = wii ? "Nintendo Wii filesystem" : "Nintendo Gamecube filesystem";
XmlFsType.VolumeName = fields.Title;

View File

@@ -77,7 +77,7 @@ namespace DiscImageChef.Filesystems
{
if(2 + partition.Start >= partition.End) return false;
if(imagePlugin.GetSectorSize() < 512) return false;
if(imagePlugin.ImageInfo.SectorSize < 512) return false;
byte[] magicB = new byte[12];
byte[] hbSector = imagePlugin.ReadSector(1 + partition.Start);

View File

@@ -106,25 +106,25 @@ namespace DiscImageChef.Filesystems
.AppendLine();
superBlockMetadata.AppendFormat("Volume identifier: 0x{0:X8}", sb.volume_id).AppendLine();
superBlockMetadata.AppendFormat("Block size: {0} bytes", sb.block_size).AppendLine();
if(imagePlugin.GetSectorSize() == 2336 || imagePlugin.GetSectorSize() == 2352 ||
imagePlugin.GetSectorSize() == 2448)
if(imagePlugin.ImageInfo.SectorSize == 2336 || imagePlugin.ImageInfo.SectorSize == 2352 ||
imagePlugin.ImageInfo.SectorSize == 2448)
{
if(sb.block_size != 2048)
superBlockMetadata
.AppendFormat("WARNING: Filesystem indicates {0} bytes/block while device indicates {1} bytes/block",
sb.block_size, 2048);
}
else if(imagePlugin.GetSectorSize() != sb.block_size)
else if(imagePlugin.ImageInfo.SectorSize != sb.block_size)
superBlockMetadata
.AppendFormat("WARNING: Filesystem indicates {0} bytes/block while device indicates {1} bytes/block",
sb.block_size, imagePlugin.GetSectorSize());
sb.block_size, imagePlugin.ImageInfo.SectorSize);
superBlockMetadata
.AppendFormat("Volume size: {0} blocks, {1} bytes", sb.block_count, sb.block_size * sb.block_count)
.AppendLine();
if((ulong)sb.block_count > imagePlugin.GetSectors())
if((ulong)sb.block_count > imagePlugin.ImageInfo.Sectors)
superBlockMetadata
.AppendFormat("WARNING: Filesystem indicates {0} blocks while device indicates {1} blocks",
sb.block_count, imagePlugin.GetSectors());
sb.block_count, imagePlugin.ImageInfo.Sectors);
superBlockMetadata.AppendFormat("Root directory identifier: 0x{0:X8}", sb.root_dirid).AppendLine();
superBlockMetadata.AppendFormat("Root directory block size: {0} bytes", sb.rootdir_bsize).AppendLine();
superBlockMetadata.AppendFormat("Root directory size: {0} blocks, {1} bytes", sb.rootdir_blocks,

View File

@@ -80,7 +80,7 @@ namespace DiscImageChef.Filesystems
XmlFsType = new FileSystemType
{
Type = "PC Engine filesystem",
Clusters = (long)((partition.End - partition.Start + 1) / imagePlugin.GetSectorSize() * 2048),
Clusters = (long)((partition.End - partition.Start + 1) / imagePlugin.ImageInfo.SectorSize * 2048),
ClusterSize = 2048
};
}

View File

@@ -149,7 +149,7 @@ namespace DiscImageChef.Filesystems
XmlFsType.FreeClusters = rootBlock.blocksfree;
XmlFsType.FreeClustersSpecified = true;
XmlFsType.Clusters = rootBlock.diskSize;
XmlFsType.ClusterSize = (int)imagePlugin.GetSectorSize();
XmlFsType.ClusterSize = (int)imagePlugin.ImageInfo.SectorSize;
XmlFsType.VolumeName = StringHandlers.PascalToString(rootBlock.diskname, CurrentEncoding);
}

View File

@@ -115,8 +115,8 @@ namespace DiscImageChef.Filesystems
byte[] rootDirectoryKeyBlock = imagePlugin.ReadSector(2 + partition.Start);
bool APMFromHDDOnCD = false;
if(imagePlugin.GetSectorSize() == 2352 || imagePlugin.GetSectorSize() == 2448 ||
imagePlugin.GetSectorSize() == 2048)
if(imagePlugin.ImageInfo.SectorSize == 2352 || imagePlugin.ImageInfo.SectorSize == 2448 ||
imagePlugin.ImageInfo.SectorSize == 2048)
{
byte[] tmp = imagePlugin.ReadSectors(partition.Start, 2);
@@ -178,8 +178,8 @@ namespace DiscImageChef.Filesystems
bool APMFromHDDOnCD = false;
if(imagePlugin.GetSectorSize() == 2352 || imagePlugin.GetSectorSize() == 2448 ||
imagePlugin.GetSectorSize() == 2048)
if(imagePlugin.ImageInfo.SectorSize == 2352 || imagePlugin.ImageInfo.SectorSize == 2448 ||
imagePlugin.ImageInfo.SectorSize == 2048)
{
byte[] tmp = imagePlugin.ReadSectors(partition.Start, 2);

View File

@@ -69,7 +69,7 @@ namespace DiscImageChef.Filesystems
public override bool Identify(ImagePlugin imagePlugin, Partition partition)
{
if(partition.Start + 1 >= imagePlugin.GetSectors()) return false;
if(partition.Start + 1 >= imagePlugin.ImageInfo.Sectors) return false;
byte[] sector = imagePlugin.ReadSector(partition.Start + 1);
if(sector.Length < 512) return false;

View File

@@ -69,8 +69,8 @@ namespace DiscImageChef.Filesystems
public override bool Identify(ImagePlugin imagePlugin, Partition partition)
{
uint sectors = QNX6_SUPER_BLOCK_SIZE / imagePlugin.GetSectorSize();
uint bootSectors = QNX6_BOOT_BLOCKS_SIZE / imagePlugin.GetSectorSize();
uint sectors = QNX6_SUPER_BLOCK_SIZE / imagePlugin.ImageInfo.SectorSize;
uint bootSectors = QNX6_BOOT_BLOCKS_SIZE / imagePlugin.ImageInfo.SectorSize;
if(partition.Start + bootSectors + sectors >= partition.End) return false;
@@ -97,8 +97,8 @@ namespace DiscImageChef.Filesystems
{
information = "";
StringBuilder sb = new StringBuilder();
uint sectors = QNX6_SUPER_BLOCK_SIZE / imagePlugin.GetSectorSize();
uint bootSectors = QNX6_BOOT_BLOCKS_SIZE / imagePlugin.GetSectorSize();
uint sectors = QNX6_SUPER_BLOCK_SIZE / imagePlugin.ImageInfo.SectorSize;
uint bootSectors = QNX6_BOOT_BLOCKS_SIZE / imagePlugin.ImageInfo.SectorSize;
byte[] audiSector = imagePlugin.ReadSectors(partition.Start, sectors);
byte[] sector = imagePlugin.ReadSectors(partition.Start + bootSectors, sectors);

View File

@@ -70,7 +70,7 @@ namespace DiscImageChef.Filesystems
public override bool Identify(ImagePlugin imagePlugin, Partition partition)
{
if(imagePlugin.GetSectorSize() < 256) return false;
if(imagePlugin.ImageInfo.SectorSize < 256) return false;
// Documentation says ID should be sector 0
// I've found that OS-9/X68000 has it on sector 4
@@ -79,10 +79,10 @@ namespace DiscImageChef.Filesystems
{
RBF_IdSector rbfSb = new RBF_IdSector();
uint sbSize = (uint)(Marshal.SizeOf(rbfSb) / imagePlugin.GetSectorSize());
if(Marshal.SizeOf(rbfSb) % imagePlugin.GetSectorSize() != 0) sbSize++;
uint sbSize = (uint)(Marshal.SizeOf(rbfSb) / imagePlugin.ImageInfo.SectorSize);
if(Marshal.SizeOf(rbfSb) % imagePlugin.ImageInfo.SectorSize != 0) sbSize++;
if(partition.Start + location + sbSize >= imagePlugin.GetSectors()) break;
if(partition.Start + location + sbSize >= imagePlugin.ImageInfo.Sectors) break;
byte[] sector = imagePlugin.ReadSectors(partition.Start + location, sbSize);
if(sector.Length < Marshal.SizeOf(rbfSb)) return false;
@@ -104,15 +104,15 @@ namespace DiscImageChef.Filesystems
public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information)
{
information = "";
if(imagePlugin.GetSectorSize() < 256) return;
if(imagePlugin.ImageInfo.SectorSize < 256) return;
RBF_IdSector rbfSb = new RBF_IdSector();
RBF_NewIdSector rbf9000Sb = new RBF_NewIdSector();
foreach(ulong location in new[] {0, 4, 15})
{
uint sbSize = (uint)(Marshal.SizeOf(rbfSb) / imagePlugin.GetSectorSize());
if(Marshal.SizeOf(rbfSb) % imagePlugin.GetSectorSize() != 0) sbSize++;
uint sbSize = (uint)(Marshal.SizeOf(rbfSb) / imagePlugin.ImageInfo.SectorSize);
if(Marshal.SizeOf(rbfSb) % imagePlugin.ImageInfo.SectorSize != 0) sbSize++;
byte[] sector = imagePlugin.ReadSectors(partition.Start + location, sbSize);
if(sector.Length < Marshal.SizeOf(rbfSb)) return;

View File

@@ -69,7 +69,7 @@ namespace DiscImageChef.Filesystems
{
if(1 + partition.Start >= partition.End) return false;
if(imagePlugin.GetSectorSize() < 512) return false;
if(imagePlugin.ImageInfo.SectorSize < 512) return false;
byte[] magicB = new byte[12];
byte[] hbSector = imagePlugin.ReadSector(1 + partition.Start);

View File

@@ -72,15 +72,15 @@ namespace DiscImageChef.Filesystems
public override bool Identify(ImagePlugin imagePlugin, Partition partition)
{
if(imagePlugin.GetSectorSize() < 512) return false;
if(imagePlugin.ImageInfo.SectorSize < 512) return false;
uint sbAddr = REISER_SUPER_OFFSET / imagePlugin.GetSectorSize();
uint sbAddr = REISER_SUPER_OFFSET / imagePlugin.ImageInfo.SectorSize;
if(sbAddr == 0) sbAddr = 1;
Reiser_Superblock reiserSb = new Reiser_Superblock();
uint sbSize = (uint)(Marshal.SizeOf(reiserSb) / imagePlugin.GetSectorSize());
if(Marshal.SizeOf(reiserSb) % imagePlugin.GetSectorSize() != 0) sbSize++;
uint sbSize = (uint)(Marshal.SizeOf(reiserSb) / imagePlugin.ImageInfo.SectorSize);
if(Marshal.SizeOf(reiserSb) % imagePlugin.ImageInfo.SectorSize != 0) sbSize++;
if(partition.Start + sbAddr + sbSize >= partition.End) return false;
@@ -99,15 +99,15 @@ namespace DiscImageChef.Filesystems
public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information)
{
information = "";
if(imagePlugin.GetSectorSize() < 512) return;
if(imagePlugin.ImageInfo.SectorSize < 512) return;
uint sbAddr = REISER_SUPER_OFFSET / imagePlugin.GetSectorSize();
uint sbAddr = REISER_SUPER_OFFSET / imagePlugin.ImageInfo.SectorSize;
if(sbAddr == 0) sbAddr = 1;
Reiser_Superblock reiserSb = new Reiser_Superblock();
uint sbSize = (uint)(Marshal.SizeOf(reiserSb) / imagePlugin.GetSectorSize());
if(Marshal.SizeOf(reiserSb) % imagePlugin.GetSectorSize() != 0) sbSize++;
uint sbSize = (uint)(Marshal.SizeOf(reiserSb) / imagePlugin.ImageInfo.SectorSize);
if(Marshal.SizeOf(reiserSb) % imagePlugin.ImageInfo.SectorSize != 0) sbSize++;
byte[] sector = imagePlugin.ReadSectors(partition.Start + sbAddr, sbSize);
if(sector.Length < Marshal.SizeOf(reiserSb)) return;

View File

@@ -71,15 +71,15 @@ namespace DiscImageChef.Filesystems
public override bool Identify(ImagePlugin imagePlugin, Partition partition)
{
if(imagePlugin.GetSectorSize() < 512) return false;
if(imagePlugin.ImageInfo.SectorSize < 512) return false;
uint sbAddr = REISER4_SUPER_OFFSET / imagePlugin.GetSectorSize();
uint sbAddr = REISER4_SUPER_OFFSET / imagePlugin.ImageInfo.SectorSize;
if(sbAddr == 0) sbAddr = 1;
Reiser4_Superblock reiserSb = new Reiser4_Superblock();
uint sbSize = (uint)(Marshal.SizeOf(reiserSb) / imagePlugin.GetSectorSize());
if(Marshal.SizeOf(reiserSb) % imagePlugin.GetSectorSize() != 0) sbSize++;
uint sbSize = (uint)(Marshal.SizeOf(reiserSb) / imagePlugin.ImageInfo.SectorSize);
if(Marshal.SizeOf(reiserSb) % imagePlugin.ImageInfo.SectorSize != 0) sbSize++;
if(partition.Start + sbAddr + sbSize >= partition.End) return false;
@@ -97,15 +97,15 @@ namespace DiscImageChef.Filesystems
public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information)
{
information = "";
if(imagePlugin.GetSectorSize() < 512) return;
if(imagePlugin.ImageInfo.SectorSize < 512) return;
uint sbAddr = REISER4_SUPER_OFFSET / imagePlugin.GetSectorSize();
uint sbAddr = REISER4_SUPER_OFFSET / imagePlugin.ImageInfo.SectorSize;
if(sbAddr == 0) sbAddr = 1;
Reiser4_Superblock reiserSb = new Reiser4_Superblock();
uint sbSize = (uint)(Marshal.SizeOf(reiserSb) / imagePlugin.GetSectorSize());
if(Marshal.SizeOf(reiserSb) % imagePlugin.GetSectorSize() != 0) sbSize++;
uint sbSize = (uint)(Marshal.SizeOf(reiserSb) / imagePlugin.ImageInfo.SectorSize);
if(Marshal.SizeOf(reiserSb) % imagePlugin.ImageInfo.SectorSize != 0) sbSize++;
byte[] sector = imagePlugin.ReadSectors(partition.Start + sbAddr, sbSize);
if(sector.Length < Marshal.SizeOf(reiserSb)) return;
@@ -131,7 +131,8 @@ namespace DiscImageChef.Filesystems
{
Type = "Reiser 4 filesystem",
ClusterSize = reiserSb.blocksize,
Clusters = (long)((partition.End - partition.Start) * imagePlugin.GetSectorSize() / reiserSb.blocksize),
Clusters =
(long)((partition.End - partition.Start) * imagePlugin.ImageInfo.SectorSize / reiserSb.blocksize),
VolumeName = StringHandlers.CToString(reiserSb.label, CurrentEncoding),
VolumeSerial = reiserSb.uuid.ToString()
};

View File

@@ -141,22 +141,22 @@ namespace DiscImageChef.Filesystems
sb.AppendLine("Solar_OS filesystem");
sb.AppendFormat("Media descriptor: 0x{0:X2}", bpb.media).AppendLine();
sb.AppendFormat("{0} bytes per sector", bpb.bps).AppendLine();
if(imagePlugin.GetSectorSize() == 2336 || imagePlugin.GetSectorSize() == 2352 ||
imagePlugin.GetSectorSize() == 2448)
if(imagePlugin.ImageInfo.SectorSize == 2336 || imagePlugin.ImageInfo.SectorSize == 2352 ||
imagePlugin.ImageInfo.SectorSize == 2448)
{
if(bpb.bps != imagePlugin.GetSectorSize())
if(bpb.bps != imagePlugin.ImageInfo.SectorSize)
sb
.AppendFormat("WARNING: Filesystem describes a {0} bytes/sector, while device describes a {1} bytes/sector",
bpb.bps, 2048).AppendLine();
}
else if(bpb.bps != imagePlugin.GetSectorSize())
else if(bpb.bps != imagePlugin.ImageInfo.SectorSize)
sb
.AppendFormat("WARNING: Filesystem describes a {0} bytes/sector, while device describes a {1} bytes/sector",
bpb.bps, imagePlugin.GetSectorSize()).AppendLine();
bpb.bps, imagePlugin.ImageInfo.SectorSize).AppendLine();
sb.AppendFormat("{0} sectors on volume ({1} bytes)", bpb.sectors, bpb.sectors * bpb.bps).AppendLine();
if(bpb.sectors > imagePlugin.GetSectors())
if(bpb.sectors > imagePlugin.ImageInfo.Sectors)
sb.AppendFormat("WARNING: Filesystem describes a {0} sectors volume, bigger than device ({1} sectors)",
bpb.sectors, imagePlugin.GetSectors());
bpb.sectors, imagePlugin.ImageInfo.Sectors);
sb.AppendFormat("{0} heads", bpb.heads).AppendLine();
sb.AppendFormat("{0} sectors per track", bpb.sptrk).AppendLine();
sb.AppendFormat("Volume name: {0}", bpb.vol_name).AppendLine();

View File

@@ -90,9 +90,9 @@ namespace DiscImageChef.Filesystems
byte sb_size_in_sectors;
if(imagePlugin.GetSectorSize() <= 0x400
if(imagePlugin.ImageInfo.SectorSize <= 0x400
) // Check if underlying device sector size is smaller than SuperBlock size
sb_size_in_sectors = (byte)(0x400 / imagePlugin.GetSectorSize());
sb_size_in_sectors = (byte)(0x400 / imagePlugin.ImageInfo.SectorSize);
else sb_size_in_sectors = 1; // If not a single sector can store it
if(partition.End <= partition.Start + 4 * (ulong)sb_size_in_sectors + sb_size_in_sectors
@@ -158,8 +158,8 @@ namespace DiscImageChef.Filesystems
if(s_fsize >= V7_MAXSIZE || s_nfree >= V7_NICFREE || s_ninode >= V7_NICINOD) continue;
if(s_fsize * 1024 == (partition.End - partition.Start) * imagePlugin.GetSectorSize() ||
s_fsize * 512 == (partition.End - partition.Start) * imagePlugin.GetSectorSize()) return true;
if(s_fsize * 1024 == (partition.End - partition.Start) * imagePlugin.ImageInfo.SectorSize ||
s_fsize * 512 == (partition.End - partition.Start) * imagePlugin.ImageInfo.SectorSize) return true;
}
return false;
@@ -182,9 +182,9 @@ namespace DiscImageChef.Filesystems
byte sb_size_in_sectors;
int offset = 0;
if(imagePlugin.GetSectorSize() <= 0x400
if(imagePlugin.ImageInfo.SectorSize <= 0x400
) // Check if underlying device sector size is smaller than SuperBlock size
sb_size_in_sectors = (byte)(0x400 / imagePlugin.GetSectorSize());
sb_size_in_sectors = (byte)(0x400 / imagePlugin.ImageInfo.SectorSize);
else sb_size_in_sectors = 1; // If not a single sector can store it
// Sectors in a cylinder
int spc = (int)(imagePlugin.ImageInfo.Heads * imagePlugin.ImageInfo.SectorsPerTrack);
@@ -301,8 +301,8 @@ namespace DiscImageChef.Filesystems
if(s_fsize >= V7_MAXSIZE || s_nfree >= V7_NICFREE || s_ninode >= V7_NICINOD) continue;
if(s_fsize * 1024 != (partition.End - partition.Start) * imagePlugin.GetSectorSize() &&
s_fsize * 512 != (partition.End - partition.Start) * imagePlugin.GetSectorSize()) continue;
if(s_fsize * 1024 != (partition.End - partition.Start) * imagePlugin.ImageInfo.SectorSize &&
s_fsize * 512 != (partition.End - partition.Start) * imagePlugin.ImageInfo.SectorSize) continue;
sys7th = true;
BigEndianBitConverter.IsLittleEndian = true;
@@ -395,8 +395,8 @@ namespace DiscImageChef.Filesystems
break;
}
if(imagePlugin.GetSectorSize() == 2336 || imagePlugin.GetSectorSize() == 2352 ||
imagePlugin.GetSectorSize() == 2448)
if(imagePlugin.ImageInfo.SectorSize == 2336 || imagePlugin.ImageInfo.SectorSize == 2352 ||
imagePlugin.ImageInfo.SectorSize == 2448)
{
if(bs != 2048)
sb
@@ -405,10 +405,10 @@ namespace DiscImageChef.Filesystems
}
else
{
if(bs != imagePlugin.GetSectorSize())
if(bs != imagePlugin.ImageInfo.SectorSize)
sb
.AppendFormat("WARNING: Filesystem indicates {0} bytes/block while device indicates {1} bytes/sector",
bs, imagePlugin.GetSectorSize()).AppendLine();
bs, imagePlugin.ImageInfo.SectorSize).AppendLine();
}
sb.AppendFormat("{0} zones on volume ({1} bytes)", xnx_sb.s_fsize, xnx_sb.s_fsize * bs).AppendLine();
sb.AppendFormat("{0} free zones on volume ({1} bytes)", xnx_sb.s_tfree, xnx_sb.s_tfree * bs)
@@ -593,7 +593,7 @@ namespace DiscImageChef.Filesystems
XmlFsType.Clusters = coh_sb.s_fsize;
sb.AppendLine("Coherent UNIX filesystem");
if(imagePlugin.GetSectorSize() != 512)
if(imagePlugin.ImageInfo.SectorSize != 512)
sb
.AppendFormat("WARNING: Filesystem indicates {0} bytes/block while device indicates {1} bytes/sector",
512, 2048).AppendLine();
@@ -649,7 +649,7 @@ namespace DiscImageChef.Filesystems
XmlFsType.ClusterSize = 512;
XmlFsType.Clusters = v7_sb.s_fsize;
sb.AppendLine("UNIX 7th Edition filesystem");
if(imagePlugin.GetSectorSize() != 512)
if(imagePlugin.ImageInfo.SectorSize != 512)
sb
.AppendFormat("WARNING: Filesystem indicates {0} bytes/block while device indicates {1} bytes/sector",
512, 2048).AppendLine();

View File

@@ -79,7 +79,8 @@ namespace DiscImageChef.Filesystems.UCSDPascal
if(error != Errno.NoError) return error;
byte[] tmp = device.ReadSectors((ulong)entry.firstBlock, (uint)(entry.lastBlock - entry.firstBlock));
file = new byte[(entry.lastBlock - entry.firstBlock - 1) * device.GetSectorSize() + entry.lastBytes];
file = new byte[(entry.lastBlock - entry.firstBlock - 1) * device.ImageInfo.SectorSize +
entry.lastBytes];
Array.Copy(tmp, 0, file, 0, file.Length);
}
@@ -110,7 +111,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
stat = new FileEntryInfo
{
Attributes = FileAttributes.System,
BlockSize = device.GetSectorSize(),
BlockSize = device.ImageInfo.SectorSize,
DeviceNo = 0,
GID = 0,
Inode = 0,
@@ -141,12 +142,12 @@ namespace DiscImageChef.Filesystems.UCSDPascal
{
Attributes = FileAttributes.File,
Blocks = entry.lastBlock - entry.firstBlock,
BlockSize = device.GetSectorSize(),
BlockSize = device.ImageInfo.SectorSize,
DeviceNo = 0,
GID = 0,
Inode = 0,
LastWriteTimeUtc = DateHandlers.UcsdPascalToDateTime(entry.mtime),
Length = (entry.lastBlock - entry.firstBlock) * device.GetSectorSize() + entry.lastBytes,
Length = (entry.lastBlock - entry.firstBlock) * device.ImageInfo.SectorSize + entry.lastBytes,
Links = 1,
Mode = 0x124,
UID = 0

View File

@@ -68,7 +68,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
// Last volume record block must be after first block, and before end of device
if(volEntry.lastBlock <= volEntry.firstBlock ||
(ulong)volEntry.lastBlock > imagePlugin.GetSectors() - 2) return false;
(ulong)volEntry.lastBlock > imagePlugin.ImageInfo.Sectors - 2) return false;
// Volume record entry type must be volume or secure
if(volEntry.entryType != PascalFileKind.Volume && volEntry.entryType != PascalFileKind.Secure) return false;
@@ -77,7 +77,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
if(volEntry.volumeName[0] > 7) return false;
// Volume blocks is equal to volume sectors
if(volEntry.blocks < 0 || (ulong)volEntry.blocks != imagePlugin.GetSectors()) return false;
if(volEntry.blocks < 0 || (ulong)volEntry.blocks != imagePlugin.ImageInfo.Sectors) return false;
// There can be not less than zero files
return volEntry.files >= 0;
@@ -88,7 +88,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
StringBuilder sbInformation = new StringBuilder();
information = "";
if(imagePlugin.GetSectors() < 3) return;
if(imagePlugin.ImageInfo.Sectors < 3) return;
// Blocks 0 and 1 are boot code
byte[] volBlock = imagePlugin.ReadSector(2 + partition.Start);
@@ -113,7 +113,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
// Last volume record block must be after first block, and before end of device
if(volEntry.lastBlock <= volEntry.firstBlock ||
(ulong)volEntry.lastBlock > imagePlugin.GetSectors() - 2) return;
(ulong)volEntry.lastBlock > imagePlugin.ImageInfo.Sectors - 2) return;
// Volume record entry type must be volume or secure
if(volEntry.entryType != PascalFileKind.Volume && volEntry.entryType != PascalFileKind.Secure) return;
@@ -122,7 +122,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
if(volEntry.volumeName[0] > 7) return;
// Volume blocks is equal to volume sectors
if(volEntry.blocks < 0 || (ulong)volEntry.blocks != imagePlugin.GetSectors()) return;
if(volEntry.blocks < 0 || (ulong)volEntry.blocks != imagePlugin.ImageInfo.Sectors) return;
// There can be not less than zero files
if(volEntry.files < 0) return;
@@ -144,7 +144,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
{
Bootable = !ArrayHelpers.ArrayIsNullOrEmpty(imagePlugin.ReadSectors(partition.Start, 2)),
Clusters = volEntry.blocks,
ClusterSize = (int)imagePlugin.GetSectorSize(),
ClusterSize = (int)imagePlugin.ImageInfo.SectorSize,
Files = volEntry.files,
FilesSpecified = true,
Type = "UCSD Pascal",

View File

@@ -47,7 +47,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
public override Errno Mount(bool debug)
{
this.debug = debug;
if(device.GetSectors() < 3) return Errno.InvalidArgument;
if(device.ImageInfo.Sectors < 3) return Errno.InvalidArgument;
// Blocks 0 and 1 are boot code
catalogBlocks = device.ReadSector(2);
@@ -66,10 +66,10 @@ namespace DiscImageChef.Filesystems.UCSDPascal
mountedVolEntry.tail = BigEndianBitConverter.ToInt32(catalogBlocks, 0x16);
if(mountedVolEntry.firstBlock != 0 || mountedVolEntry.lastBlock <= mountedVolEntry.firstBlock ||
(ulong)mountedVolEntry.lastBlock > device.GetSectors() - 2 ||
(ulong)mountedVolEntry.lastBlock > device.ImageInfo.Sectors - 2 ||
mountedVolEntry.entryType != PascalFileKind.Volume &&
mountedVolEntry.entryType != PascalFileKind.Secure || mountedVolEntry.volumeName[0] > 7 ||
mountedVolEntry.blocks < 0 || (ulong)mountedVolEntry.blocks != device.GetSectors() ||
mountedVolEntry.blocks < 0 || (ulong)mountedVolEntry.blocks != device.ImageInfo.Sectors ||
mountedVolEntry.files < 0) return Errno.InvalidArgument;
catalogBlocks = device.ReadSectors(2, (uint)(mountedVolEntry.lastBlock - mountedVolEntry.firstBlock - 2));
@@ -100,7 +100,7 @@ namespace DiscImageChef.Filesystems.UCSDPascal
{
Bootable = !ArrayHelpers.ArrayIsNullOrEmpty(bootBlocks),
Clusters = mountedVolEntry.blocks,
ClusterSize = (int)device.GetSectorSize(),
ClusterSize = (int)device.ImageInfo.SectorSize,
Files = mountedVolEntry.files,
FilesSpecified = true,
Type = "UCSD Pascal",

View File

@@ -80,12 +80,12 @@ namespace DiscImageChef.Filesystems
public override bool Identify(ImagePlugin imagePlugin, Partition partition)
{
if(imagePlugin.GetSectorSize() < 512) return false;
if(imagePlugin.ImageInfo.SectorSize < 512) return false;
UNICOS_Superblock unicosSb = new UNICOS_Superblock();
uint sbSize = (uint)(Marshal.SizeOf(unicosSb) / imagePlugin.GetSectorSize());
if(Marshal.SizeOf(unicosSb) % imagePlugin.GetSectorSize() != 0) sbSize++;
uint sbSize = (uint)(Marshal.SizeOf(unicosSb) / imagePlugin.ImageInfo.SectorSize);
if(Marshal.SizeOf(unicosSb) % imagePlugin.ImageInfo.SectorSize != 0) sbSize++;
byte[] sector = imagePlugin.ReadSectors(partition.Start, sbSize);
if(sector.Length < Marshal.SizeOf(unicosSb)) return false;
@@ -101,12 +101,12 @@ namespace DiscImageChef.Filesystems
public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information)
{
information = "";
if(imagePlugin.GetSectorSize() < 512) return;
if(imagePlugin.ImageInfo.SectorSize < 512) return;
UNICOS_Superblock unicosSb = new UNICOS_Superblock();
uint sbSize = (uint)(Marshal.SizeOf(unicosSb) / imagePlugin.GetSectorSize());
if(Marshal.SizeOf(unicosSb) % imagePlugin.GetSectorSize() != 0) sbSize++;
uint sbSize = (uint)(Marshal.SizeOf(unicosSb) / imagePlugin.ImageInfo.SectorSize);
if(Marshal.SizeOf(unicosSb) % imagePlugin.ImageInfo.SectorSize != 0) sbSize++;
byte[] sector = imagePlugin.ReadSectors(partition.Start, sbSize);
if(sector.Length < Marshal.SizeOf(unicosSb)) return;

View File

@@ -120,7 +120,7 @@ namespace DiscImageChef.Filesystems
XmlFsType = new FileSystemType();
XmlFsType.Type = "BFS";
XmlFsType.VolumeName = bfsSb.s_volume;
XmlFsType.ClusterSize = (int)imagePlugin.GetSectorSize();
XmlFsType.ClusterSize = (int)imagePlugin.ImageInfo.SectorSize;
XmlFsType.Clusters = (long)(partition.End - partition.Start + 1);
information = sb.ToString();

View File

@@ -68,15 +68,15 @@ namespace DiscImageChef.Filesystems
public override bool Identify(ImagePlugin imagePlugin, Partition partition)
{
if(imagePlugin.GetSectorSize() < 512) return false;
if(imagePlugin.ImageInfo.SectorSize < 512) return false;
// Misaligned
if(imagePlugin.ImageInfo.XmlMediaType == XmlMediaType.OpticalDisc)
{
XFS_Superblock xfsSb = new XFS_Superblock();
uint sbSize = (uint)((Marshal.SizeOf(xfsSb) + 0x400) / imagePlugin.GetSectorSize());
if((Marshal.SizeOf(xfsSb) + 0x400) % imagePlugin.GetSectorSize() != 0) sbSize++;
uint sbSize = (uint)((Marshal.SizeOf(xfsSb) + 0x400) / imagePlugin.ImageInfo.SectorSize);
if((Marshal.SizeOf(xfsSb) + 0x400) % imagePlugin.ImageInfo.SectorSize != 0) sbSize++;
byte[] sector = imagePlugin.ReadSectors(partition.Start, sbSize);
if(sector.Length < Marshal.SizeOf(xfsSb)) return false;
@@ -100,8 +100,8 @@ namespace DiscImageChef.Filesystems
{
XFS_Superblock xfsSb = new XFS_Superblock();
uint sbSize = (uint)(Marshal.SizeOf(xfsSb) / imagePlugin.GetSectorSize());
if(Marshal.SizeOf(xfsSb) % imagePlugin.GetSectorSize() != 0) sbSize++;
uint sbSize = (uint)(Marshal.SizeOf(xfsSb) / imagePlugin.ImageInfo.SectorSize);
if(Marshal.SizeOf(xfsSb) % imagePlugin.ImageInfo.SectorSize != 0) sbSize++;
byte[] sector = imagePlugin.ReadSectors(partition.Start + location, sbSize);
if(sector.Length < Marshal.SizeOf(xfsSb)) return false;
@@ -120,15 +120,15 @@ namespace DiscImageChef.Filesystems
public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information)
{
information = "";
if(imagePlugin.GetSectorSize() < 512) return;
if(imagePlugin.ImageInfo.SectorSize < 512) return;
XFS_Superblock xfsSb = new XFS_Superblock();
// Misaligned
if(imagePlugin.ImageInfo.XmlMediaType == XmlMediaType.OpticalDisc)
{
uint sbSize = (uint)((Marshal.SizeOf(xfsSb) + 0x400) / imagePlugin.GetSectorSize());
if((Marshal.SizeOf(xfsSb) + 0x400) % imagePlugin.GetSectorSize() != 0) sbSize++;
uint sbSize = (uint)((Marshal.SizeOf(xfsSb) + 0x400) / imagePlugin.ImageInfo.SectorSize);
if((Marshal.SizeOf(xfsSb) + 0x400) % imagePlugin.ImageInfo.SectorSize != 0) sbSize++;
byte[] sector = imagePlugin.ReadSectors(partition.Start, sbSize);
if(sector.Length < Marshal.SizeOf(xfsSb)) return;
@@ -150,8 +150,8 @@ namespace DiscImageChef.Filesystems
else
foreach(ulong location in new[] {0, 1, 2})
{
uint sbSize = (uint)(Marshal.SizeOf(xfsSb) / imagePlugin.GetSectorSize());
if(Marshal.SizeOf(xfsSb) % imagePlugin.GetSectorSize() != 0) sbSize++;
uint sbSize = (uint)(Marshal.SizeOf(xfsSb) / imagePlugin.ImageInfo.SectorSize);
if(Marshal.SizeOf(xfsSb) % imagePlugin.ImageInfo.SectorSize != 0) sbSize++;
byte[] sector = imagePlugin.ReadSectors(partition.Start + location, sbSize);
if(sector.Length < Marshal.SizeOf(xfsSb)) return;

View File

@@ -75,8 +75,8 @@ namespace DiscImageChef.Filesystems
public override bool Identify(ImagePlugin imagePlugin, Partition partition)
{
int sbSizeInBytes = Marshal.SizeOf(typeof(XiaSuperBlock));
uint sbSizeInSectors = (uint)(sbSizeInBytes / imagePlugin.GetSectorSize());
if(sbSizeInBytes % imagePlugin.GetSectorSize() > 0) sbSizeInSectors++;
uint sbSizeInSectors = (uint)(sbSizeInBytes / imagePlugin.ImageInfo.SectorSize);
if(sbSizeInBytes % imagePlugin.ImageInfo.SectorSize > 0) sbSizeInSectors++;
if(sbSizeInSectors + partition.Start >= partition.End) return false;
byte[] sbSector = imagePlugin.ReadSectors(partition.Start, sbSizeInSectors);
@@ -95,8 +95,8 @@ namespace DiscImageChef.Filesystems
StringBuilder sb = new StringBuilder();
int sbSizeInBytes = Marshal.SizeOf(typeof(XiaSuperBlock));
uint sbSizeInSectors = (uint)(sbSizeInBytes / imagePlugin.GetSectorSize());
if(sbSizeInBytes % imagePlugin.GetSectorSize() > 0) sbSizeInSectors++;
uint sbSizeInSectors = (uint)(sbSizeInBytes / imagePlugin.ImageInfo.SectorSize);
if(sbSizeInBytes % imagePlugin.ImageInfo.SectorSize > 0) sbSizeInSectors++;
byte[] sbSector = imagePlugin.ReadSectors(partition.Start, sbSizeInSectors);
IntPtr sbPtr = Marshal.AllocHGlobal(sbSizeInBytes);

View File

@@ -101,7 +101,7 @@ namespace DiscImageChef.Filesystems
public override bool Identify(ImagePlugin imagePlugin, Partition partition)
{
if(imagePlugin.GetSectorSize() < 512) return false;
if(imagePlugin.ImageInfo.SectorSize < 512) return false;
byte[] sector;
ulong magic;
@@ -123,7 +123,7 @@ namespace DiscImageChef.Filesystems
public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information)
{
information = "";
if(imagePlugin.GetSectorSize() < 512) return;
if(imagePlugin.ImageInfo.SectorSize < 512) return;
byte[] sector;
ulong magic;

View File

@@ -122,7 +122,7 @@ namespace DiscImageChef.Filesystems
public override bool Identify(ImagePlugin imagePlugin, Partition partition)
{
if(imagePlugin.GetSectorSize() < 512) return false;
if(imagePlugin.ImageInfo.SectorSize < 512) return false;
// It should be start of a tape or floppy or file
if(partition.Start != 0) return false;
@@ -131,8 +131,8 @@ namespace DiscImageChef.Filesystems
spcl_aix aixHdr = new spcl_aix();
s_spcl newHdr = new s_spcl();
uint sbSize = (uint)(Marshal.SizeOf(newHdr) / imagePlugin.GetSectorSize());
if(Marshal.SizeOf(newHdr) % imagePlugin.GetSectorSize() != 0) sbSize++;
uint sbSize = (uint)(Marshal.SizeOf(newHdr) / imagePlugin.ImageInfo.SectorSize);
if(Marshal.SizeOf(newHdr) % imagePlugin.ImageInfo.SectorSize != 0) sbSize++;
byte[] sector = imagePlugin.ReadSectors(partition.Start, sbSize);
if(sector.Length < Marshal.SizeOf(newHdr)) return false;
@@ -164,7 +164,7 @@ namespace DiscImageChef.Filesystems
public override void GetInformation(ImagePlugin imagePlugin, Partition partition, out string information)
{
information = "";
if(imagePlugin.GetSectorSize() < 512) return;
if(imagePlugin.ImageInfo.SectorSize < 512) return;
if(partition.Start != 0) return;
@@ -172,8 +172,8 @@ namespace DiscImageChef.Filesystems
spcl_aix aixHdr = new spcl_aix();
s_spcl newHdr = new s_spcl();
uint sbSize = (uint)(Marshal.SizeOf(newHdr) / imagePlugin.GetSectorSize());
if(Marshal.SizeOf(newHdr) % imagePlugin.GetSectorSize() != 0) sbSize++;
uint sbSize = (uint)(Marshal.SizeOf(newHdr) / imagePlugin.ImageInfo.SectorSize);
if(Marshal.SizeOf(newHdr) % imagePlugin.ImageInfo.SectorSize != 0) sbSize++;
byte[] sector = imagePlugin.ReadSectors(partition.Start, sbSize);
if(sector.Length < Marshal.SizeOf(newHdr)) return;
@@ -469,10 +469,9 @@ namespace DiscImageChef.Filesystems
public int di_mtimensec; /* 28: Last modified time. */
public int di_ctime; /* 32: Last inode change time. */
public int di_ctimensec; /* 36: Last inode change time. */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = NDADDR)]
public ufs_daddr_t[] di_db; /* 40: Direct disk blocks. */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = NDADDR)] public int[] di_db; /* 40: Direct disk blocks. */
[MarshalAs(UnmanagedType.ByValArray, SizeConst = NIADDR)]
public ufs_daddr_t[] di_ib; /* 88: Indirect disk blocks. */
public int[] di_ib; /* 88: Indirect disk blocks. */
public uint di_flags; /* 100: Status flags (chflags). */
public uint di_blocks; /* 104: Blocks actually held. */
public int di_gen; /* 108: Generation number. */

View File

@@ -185,14 +185,14 @@ namespace DiscImageChef.Filesystems
public override bool Identify(ImagePlugin imagePlugin, Partition partition)
{
ulong sbSectorOff = SB_POS / imagePlugin.GetSectorSize();
uint sbOff = SB_POS % imagePlugin.GetSectorSize();
ulong sbSectorOff = SB_POS / imagePlugin.ImageInfo.SectorSize;
uint sbOff = SB_POS % imagePlugin.ImageInfo.SectorSize;
if(sbSectorOff + partition.Start >= partition.End) return false;
int sbSizeInBytes = Marshal.SizeOf(typeof(ext2FSSuperBlock));
uint sbSizeInSectors = (uint)(sbSizeInBytes / imagePlugin.GetSectorSize());
if(sbSizeInBytes % imagePlugin.GetSectorSize() > 0) sbSizeInSectors++;
uint sbSizeInSectors = (uint)(sbSizeInBytes / imagePlugin.ImageInfo.SectorSize);
if(sbSizeInBytes % imagePlugin.ImageInfo.SectorSize > 0) sbSizeInSectors++;
byte[] sbSector = imagePlugin.ReadSectors(sbSectorOff + partition.Start, sbSizeInSectors);
byte[] sb = new byte[sbSizeInBytes];
@@ -214,11 +214,11 @@ namespace DiscImageChef.Filesystems
bool ext4 = false;
int sbSizeInBytes = Marshal.SizeOf(typeof(ext2FSSuperBlock));
uint sbSizeInSectors = (uint)(sbSizeInBytes / imagePlugin.GetSectorSize());
if(sbSizeInBytes % imagePlugin.GetSectorSize() > 0) sbSizeInSectors++;
uint sbSizeInSectors = (uint)(sbSizeInBytes / imagePlugin.ImageInfo.SectorSize);
if(sbSizeInBytes % imagePlugin.ImageInfo.SectorSize > 0) sbSizeInSectors++;
ulong sbSectorOff = SB_POS / imagePlugin.GetSectorSize();
uint sbOff = SB_POS % imagePlugin.GetSectorSize();
ulong sbSectorOff = SB_POS / imagePlugin.ImageInfo.SectorSize;
uint sbOff = SB_POS % imagePlugin.ImageInfo.SectorSize;
byte[] sbSector = imagePlugin.ReadSectors(sbSectorOff + partition.Start, sbSizeInSectors);
byte[] sblock = new byte[sbSizeInBytes];

View File

@@ -73,10 +73,10 @@ namespace DiscImageChef.Filesystems
public override bool Identify(ImagePlugin imagePlugin, Partition partition)
{
if(imagePlugin.GetSectorSize() < 512) return false;
if(imagePlugin.ImageInfo.SectorSize < 512) return false;
ulong sbSectorOff = SB_POS / imagePlugin.GetSectorSize();
uint sbOff = SB_POS % imagePlugin.GetSectorSize();
ulong sbSectorOff = SB_POS / imagePlugin.ImageInfo.SectorSize;
uint sbOff = SB_POS % imagePlugin.ImageInfo.SectorSize;
if(sbSectorOff + partition.Start >= partition.End) return false;
@@ -95,10 +95,10 @@ namespace DiscImageChef.Filesystems
StringBuilder sb = new StringBuilder();
if(imagePlugin.GetSectorSize() < 512) return;
if(imagePlugin.ImageInfo.SectorSize < 512) return;
ulong sbSectorOff = SB_POS / imagePlugin.GetSectorSize();
uint sbOff = SB_POS % imagePlugin.GetSectorSize();
ulong sbSectorOff = SB_POS / imagePlugin.ImageInfo.SectorSize;
uint sbOff = SB_POS % imagePlugin.ImageInfo.SectorSize;
if(sbSectorOff + partition.Start >= partition.End) return;
@@ -136,7 +136,7 @@ namespace DiscImageChef.Filesystems
FreeClusters = extSb.freecountblk,
FreeClustersSpecified = true,
ClusterSize = 1024,
Clusters = (long)((partition.End - partition.Start + 1) * imagePlugin.GetSectorSize() / 1024)
Clusters = (long)((partition.End - partition.Start + 1) * imagePlugin.ImageInfo.SectorSize / 1024)
};
information = sb.ToString();