mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Use generic method to search for partitions, supporting
partitions inside partitions. At the same time SGI DVH is disabled because it is not working correctly. Fixes #60
This commit is contained in:
@@ -56,12 +56,16 @@ namespace DiscImageChef.PartPlugins
|
||||
PluginUUID = new Guid("A7C8FEBE-8D00-4933-B9F3-42184C8BA808");
|
||||
}
|
||||
|
||||
public override bool GetInformation(ImagePlugin imagePlugin, out List<Partition> partitions)
|
||||
public override bool GetInformation(ImagePlugin imagePlugin, out List<Partition> partitions, ulong sectorOffset)
|
||||
{
|
||||
partitions = new List<Partition>();
|
||||
|
||||
ulong sbSector;
|
||||
|
||||
// RISC OS always checks for the partition on 0. Afaik no emulator chains it.
|
||||
if(sectorOffset != 0)
|
||||
return false;
|
||||
|
||||
if(imagePlugin.GetSectorSize() > ADFS_SB_POS)
|
||||
sbSector = 0;
|
||||
else
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace DiscImageChef.PartPlugins
|
||||
PluginUUID = new Guid("36405F8D-4F1A-07F5-209C-223D735D6D22");
|
||||
}
|
||||
|
||||
public override bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<CommonTypes.Partition> partitions)
|
||||
public override bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<CommonTypes.Partition> partitions, ulong sectorOffset)
|
||||
{
|
||||
uint sector_size;
|
||||
|
||||
@@ -68,7 +68,7 @@ namespace DiscImageChef.PartPlugins
|
||||
|
||||
partitions = new List<CommonTypes.Partition>();
|
||||
|
||||
byte[] ddm_sector = imagePlugin.ReadSector(0);
|
||||
byte[] ddm_sector = imagePlugin.ReadSector(sectorOffset);
|
||||
AppleDriverDescriptorMap ddm;
|
||||
|
||||
ushort max_drivers = 61;
|
||||
@@ -132,7 +132,7 @@ namespace DiscImageChef.PartPlugins
|
||||
}
|
||||
}
|
||||
|
||||
byte[] part_sector = imagePlugin.ReadSector(1);
|
||||
byte[] part_sector = imagePlugin.ReadSector(1 + sectorOffset);
|
||||
AppleOldDevicePartitionMap old_map = BigEndianMarshal.ByteArrayToStructureBigEndian<AppleOldDevicePartitionMap>(part_sector);
|
||||
|
||||
// This is the easy one, no sector size mixing
|
||||
@@ -228,7 +228,7 @@ namespace DiscImageChef.PartPlugins
|
||||
return partitions.Count > 0;
|
||||
}
|
||||
|
||||
byte[] entries = imagePlugin.ReadSectors(0, sectors_to_read);
|
||||
byte[] entries = imagePlugin.ReadSectors(sectorOffset, sectors_to_read);
|
||||
DicConsole.DebugWriteLine("AppleMap Plugin", "entry_size = {0}", entry_size);
|
||||
DicConsole.DebugWriteLine("AppleMap Plugin", "entry_count = {0}", entry_count);
|
||||
DicConsole.DebugWriteLine("AppleMap Plugin", "skip_ddm = {0}", skip_ddm);
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace DiscImageChef.PartPlugins
|
||||
PluginUUID = new Guid("d1dd0f24-ec39-4c4d-9072-be31919a3b5e");
|
||||
}
|
||||
|
||||
public override bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<CommonTypes.Partition> partitions)
|
||||
public override bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<CommonTypes.Partition> partitions, ulong sectorOffset)
|
||||
{
|
||||
partitions = new List<CommonTypes.Partition>();
|
||||
|
||||
@@ -67,7 +67,7 @@ namespace DiscImageChef.PartPlugins
|
||||
|
||||
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
|
||||
|
||||
byte[] sector = imagePlugin.ReadSector(0);
|
||||
byte[] sector = imagePlugin.ReadSector(sectorOffset);
|
||||
|
||||
AtariTable table = new AtariTable();
|
||||
table.boot = new byte[342];
|
||||
|
||||
@@ -48,11 +48,11 @@ namespace DiscImageChef.PartPlugins
|
||||
PluginUUID = new Guid("246A6D93-4F1A-1F8A-344D-50187A5513A9");
|
||||
}
|
||||
|
||||
public override bool GetInformation(ImagePlugin imagePlugin, out List<Partition> partitions)
|
||||
public override bool GetInformation(ImagePlugin imagePlugin, out List<Partition> partitions, ulong sectorOffset)
|
||||
{
|
||||
partitions = new List<Partition>();
|
||||
|
||||
byte[] sector = imagePlugin.ReadSector(0);
|
||||
byte[] sector = imagePlugin.ReadSector(sectorOffset);
|
||||
if(sector.Length < 512)
|
||||
return false;
|
||||
bool found = false;
|
||||
@@ -63,7 +63,7 @@ namespace DiscImageChef.PartPlugins
|
||||
found = true;
|
||||
else
|
||||
{
|
||||
sector = imagePlugin.ReadSector(1);
|
||||
sector = imagePlugin.ReadSector(1 + sectorOffset);
|
||||
|
||||
dl = GetDiskLabel(sector);
|
||||
|
||||
|
||||
@@ -49,11 +49,14 @@ namespace DiscImageChef.PartPlugins
|
||||
PluginUUID = new Guid("58CEC3B7-3B93-4D47-86EE-D6DADE9D444F");
|
||||
}
|
||||
|
||||
public override bool GetInformation(ImagePlugin imagePlugin, out List<Partition> partitions)
|
||||
public override bool GetInformation(ImagePlugin imagePlugin, out List<Partition> partitions, ulong sectorOffset)
|
||||
{
|
||||
partitions = new List<Partition>();
|
||||
|
||||
byte[] sector = imagePlugin.ReadSector(31);
|
||||
if(31 + sectorOffset >= imagePlugin.GetSectors())
|
||||
return false;
|
||||
|
||||
byte[] sector = imagePlugin.ReadSector(31 + sectorOffset);
|
||||
if(sector.Length < 512)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -48,12 +48,15 @@ namespace DiscImageChef.PartPlugins
|
||||
PluginUUID = new Guid("D49E41A6-D952-4760-9D94-03DAE2450C5F");
|
||||
}
|
||||
|
||||
public override bool GetInformation(ImagePlugin imagePlugin, out List<Partition> partitions)
|
||||
public override bool GetInformation(ImagePlugin imagePlugin, out List<Partition> partitions, ulong sectorOffset)
|
||||
{
|
||||
partitions = new List<Partition>();
|
||||
uint nSectors = 2048 / imagePlugin.GetSectorSize();
|
||||
|
||||
byte[] sectors = imagePlugin.ReadSectors(0, nSectors);
|
||||
if(sectorOffset + nSectors >= imagePlugin.GetSectors())
|
||||
return false;
|
||||
|
||||
byte[] sectors = imagePlugin.ReadSectors(sectorOffset, nSectors);
|
||||
if(sectors.Length < 2048)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -48,11 +48,11 @@ namespace DiscImageChef.PartPlugins
|
||||
PluginUUID = new Guid("CBC9D281-C1D0-44E8-9038-4D66FD2678AB");
|
||||
}
|
||||
|
||||
public override bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<CommonTypes.Partition> partitions)
|
||||
public override bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<CommonTypes.Partition> partitions, ulong sectorOffset)
|
||||
{
|
||||
partitions = new List<CommonTypes.Partition>();
|
||||
|
||||
byte[] hdrBytes = imagePlugin.ReadSector(1);
|
||||
byte[] hdrBytes = imagePlugin.ReadSector(1 + sectorOffset);
|
||||
GptHeader hdr;
|
||||
|
||||
try
|
||||
|
||||
@@ -50,7 +50,7 @@ namespace DiscImageChef.PartPlugins
|
||||
PluginUUID = new Guid("246A6D93-4F1A-1F8A-344D-50187A5513A9");
|
||||
}
|
||||
|
||||
public override bool GetInformation(ImagePlugin imagePlugin, out List<Partition> partitions)
|
||||
public override bool GetInformation(ImagePlugin imagePlugin, out List<Partition> partitions, ulong sectorOffset)
|
||||
{
|
||||
partitions = new List<Partition>();
|
||||
|
||||
@@ -59,18 +59,21 @@ namespace DiscImageChef.PartPlugins
|
||||
|
||||
DicConsole.DebugWriteLine("Human68k plugin", "sectorSize = {0}", imagePlugin.GetSectorSize());
|
||||
|
||||
if(sectorOffset + 4 >= imagePlugin.GetSectors())
|
||||
return false;
|
||||
|
||||
switch(imagePlugin.GetSectorSize())
|
||||
{
|
||||
case 256:
|
||||
sector = imagePlugin.ReadSector(4);
|
||||
sector = imagePlugin.ReadSector(4 + sectorOffset);
|
||||
sectsPerUnit = 1;
|
||||
break;
|
||||
case 512:
|
||||
sector = imagePlugin.ReadSector(4);
|
||||
sector = imagePlugin.ReadSector(4 + sectorOffset);
|
||||
sectsPerUnit = 2;
|
||||
break;
|
||||
case 1024:
|
||||
sector = imagePlugin.ReadSector(2);
|
||||
sector = imagePlugin.ReadSector(2 + sectorOffset);
|
||||
sectsPerUnit = 1;
|
||||
break;
|
||||
default:
|
||||
@@ -79,13 +82,14 @@ namespace DiscImageChef.PartPlugins
|
||||
|
||||
X68kTable table = BigEndianMarshal.ByteArrayToStructureBigEndian<X68kTable>(sector);
|
||||
|
||||
DicConsole.DebugWriteLine("Human68k plugin", "table.magic = {0:X4}", table.magic);
|
||||
|
||||
if(table.magic != X68kMagic)
|
||||
return false;
|
||||
|
||||
for(int i = 0; i < table.entries.Length; i++)
|
||||
table.entries[i] = BigEndianMarshal.SwapStructureMembersEndian(table.entries[i]);
|
||||
|
||||
DicConsole.DebugWriteLine("Human68k plugin", "table.signature = {0:X4}", table.magic);
|
||||
DicConsole.DebugWriteLine("Human68k plugin", "table.size = {0:X4}", table.size);
|
||||
DicConsole.DebugWriteLine("Human68k plugin", "table.size2 = {0:X4}", table.size2);
|
||||
DicConsole.DebugWriteLine("Human68k plugin", "table.unknown = {0:X4}", table.unknown);
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace DiscImageChef.PartPlugins
|
||||
PluginUUID = new Guid("5E8A34E8-4F1A-59E6-4BF7-7EA647063A76");
|
||||
}
|
||||
|
||||
public override bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<CommonTypes.Partition> partitions)
|
||||
public override bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<CommonTypes.Partition> partitions, ulong sectorOffset)
|
||||
{
|
||||
ulong counter = 0;
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace DiscImageChef.PartPlugins
|
||||
divider = 4;
|
||||
}
|
||||
|
||||
byte[] sector = imagePlugin.ReadSector(0);
|
||||
byte[] sector = imagePlugin.ReadSector(sectorOffset);
|
||||
|
||||
GCHandle handle = GCHandle.Alloc(sector, GCHandleType.Pinned);
|
||||
MasterBootRecord mbr = (MasterBootRecord)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(MasterBootRecord));
|
||||
@@ -76,6 +76,8 @@ namespace DiscImageChef.PartPlugins
|
||||
DiskManagerMasterBootRecord mbr_ontrack = (DiskManagerMasterBootRecord)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(DiskManagerMasterBootRecord));
|
||||
handle.Free();
|
||||
|
||||
DicConsole.DebugWriteLine("MBR plugin", "mbr.magic = {0:X4}", mbr.magic);
|
||||
|
||||
if(mbr.magic != MBR_Magic)
|
||||
return false; // Not MBR
|
||||
|
||||
@@ -152,7 +154,7 @@ namespace DiscImageChef.PartPlugins
|
||||
CommonTypes.Partition part = new CommonTypes.Partition();
|
||||
if(lba_start > 0 && lba_sectors > 0)
|
||||
{
|
||||
part.Start = entry.lba_start;
|
||||
part.Start = entry.lba_start + sectorOffset;
|
||||
part.Length = entry.lba_sectors;
|
||||
part.Offset = part.Start * sectorSize;
|
||||
part.Size = part.Length * sectorSize;
|
||||
@@ -251,7 +253,7 @@ namespace DiscImageChef.PartPlugins
|
||||
CommonTypes.Partition part = new CommonTypes.Partition();
|
||||
if(ext_start > 0 && ext_sectors > 0)
|
||||
{
|
||||
part.Start = ext_start;
|
||||
part.Start = ext_start + sectorOffset;
|
||||
part.Length = ext_sectors;
|
||||
part.Offset = part.Start * sectorSize;
|
||||
part.Size = part.Length * sectorSize;
|
||||
|
||||
@@ -57,7 +57,7 @@ namespace DiscImageChef.PartPlugins
|
||||
PluginUUID = new Guid("246A6D93-4F1A-1F8A-344D-50187A5513A9");
|
||||
}
|
||||
|
||||
public override bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<CommonTypes.Partition> partitions)
|
||||
public override bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<CommonTypes.Partition> partitions, ulong sectorOffset)
|
||||
{
|
||||
bool magic_found = false;
|
||||
byte[] label_sector;
|
||||
@@ -74,18 +74,19 @@ namespace DiscImageChef.PartPlugins
|
||||
|
||||
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
|
||||
|
||||
label_sector = imagePlugin.ReadSector(0); // Starts on sector 0 on NeXT machines, CDs and floppies
|
||||
magic = BigEndianBitConverter.ToUInt32(label_sector, 0x00);
|
||||
ulong label_position = 0;
|
||||
|
||||
foreach(ulong i in new ulong[]{0, 4, 15, 16})
|
||||
{
|
||||
label_sector = imagePlugin.ReadSector(i);
|
||||
if(i + sectorOffset >= imagePlugin.GetSectors())
|
||||
break;
|
||||
|
||||
label_sector = imagePlugin.ReadSector(i + sectorOffset);
|
||||
magic = BigEndianBitConverter.ToUInt32(label_sector, 0x00);
|
||||
if(magic == NEXT_MAGIC1 || magic == NEXT_MAGIC2 || magic == NEXT_MAGIC3)
|
||||
{
|
||||
magic_found = true;
|
||||
label_position = i;
|
||||
label_position = i + sectorOffset;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -49,12 +49,12 @@ namespace DiscImageChef.PartPlugins
|
||||
PluginUUID = new Guid("27333401-C7C2-447D-961C-22AD0641A09A\n");
|
||||
}
|
||||
|
||||
public override bool GetInformation(ImagePlugin imagePlugin, out List<Partition> partitions)
|
||||
public override bool GetInformation(ImagePlugin imagePlugin, out List<Partition> partitions, ulong sectorOffset)
|
||||
{
|
||||
partitions = new List<Partition>();
|
||||
|
||||
byte[] bootSector = imagePlugin.ReadSector(0);
|
||||
byte[] sector = imagePlugin.ReadSector(1);
|
||||
byte[] bootSector = imagePlugin.ReadSector(sectorOffset);
|
||||
byte[] sector = imagePlugin.ReadSector(1 + sectorOffset);
|
||||
if(sector.Length < 512)
|
||||
return false;
|
||||
if(bootSector[0x1FE] != 0x55 || bootSector[0x1FF] != 0xAA)
|
||||
|
||||
@@ -56,6 +56,7 @@ namespace DiscImageChef.PartPlugins
|
||||
/// <returns><c>true</c>, if partitioning scheme is recognized, <c>false</c> otherwise.</returns>
|
||||
/// <param name="imagePlugin">Disk image.</param>
|
||||
/// <param name="partitions">Returns list of partitions.</param>
|
||||
public abstract bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<CommonTypes.Partition> partitions);
|
||||
/// <param name="sectorOffset">At which sector to start searching for the partition scheme.</param>
|
||||
public abstract bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<CommonTypes.Partition> partitions, ulong sectorOffset);
|
||||
}
|
||||
}
|
||||
@@ -889,7 +889,7 @@ namespace DiscImageChef.PartPlugins
|
||||
public byte[] loadData;
|
||||
}
|
||||
|
||||
public override bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<CommonTypes.Partition> partitions)
|
||||
public override bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<CommonTypes.Partition> partitions, ulong sectorOffset)
|
||||
{
|
||||
partitions = new List<CommonTypes.Partition>();
|
||||
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
|
||||
@@ -901,7 +901,10 @@ namespace DiscImageChef.PartPlugins
|
||||
if(imagePlugin.GetSectors() <= RDBBlock)
|
||||
return false;
|
||||
|
||||
byte[] tmpSector = imagePlugin.ReadSector(RDBBlock);
|
||||
if(RDBBlock + sectorOffset >= imagePlugin.GetSectors())
|
||||
break;
|
||||
|
||||
byte[] tmpSector = imagePlugin.ReadSector(RDBBlock + sectorOffset);
|
||||
uint magic = BigEndianBitConverter.ToUInt32(tmpSector, 0);
|
||||
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "Possible magic at block {0} is 0x{1:X8}", RDBBlock, magic);
|
||||
@@ -920,6 +923,8 @@ namespace DiscImageChef.PartPlugins
|
||||
if(!foundRDB)
|
||||
return false;
|
||||
|
||||
RDBBlock += sectorOffset;
|
||||
|
||||
byte[] sector;
|
||||
byte[] tmpString;
|
||||
|
||||
@@ -1109,9 +1114,9 @@ namespace DiscImageChef.PartPlugins
|
||||
nextBlock = RDB.partition_ptr;
|
||||
while(nextBlock != 0xFFFFFFFF)
|
||||
{
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "Going to block {0} in search of a PartitionEntry block", nextBlock);
|
||||
DicConsole.DebugWriteLine("Amiga RDB plugin", "Going to block {0} in search of a PartitionEntry block", nextBlock + sectorOffset);
|
||||
|
||||
sector = imagePlugin.ReadSector(nextBlock);
|
||||
sector = imagePlugin.ReadSector(nextBlock + sectorOffset);
|
||||
uint magic = BigEndianBitConverter.ToUInt32(sector, 0);
|
||||
|
||||
if(magic != PartitionBlockMagic)
|
||||
@@ -1349,7 +1354,7 @@ namespace DiscImageChef.PartPlugins
|
||||
Name = RDBEntry.driveName,
|
||||
Sequence = sequence,
|
||||
Length = (RDBEntry.dosEnvVec.highCylinder + 1 - RDBEntry.dosEnvVec.lowCylinder) * RDBEntry.dosEnvVec.surfaces * RDBEntry.dosEnvVec.bpt,
|
||||
Start = RDBEntry.dosEnvVec.lowCylinder * RDBEntry.dosEnvVec.surfaces * RDBEntry.dosEnvVec.bpt,
|
||||
Start = RDBEntry.dosEnvVec.lowCylinder * RDBEntry.dosEnvVec.surfaces * RDBEntry.dosEnvVec.bpt + sectorOffset,
|
||||
Type = AmigaDOSTypeToString(RDBEntry.dosEnvVec.dosType),
|
||||
Scheme = Name
|
||||
};
|
||||
|
||||
@@ -49,11 +49,11 @@ namespace DiscImageChef.PartPlugins
|
||||
PluginUUID = new Guid("246A6D93-4F1A-1F8A-344D-50187A5513A9");
|
||||
}
|
||||
|
||||
public override bool GetInformation(ImagePlugin imagePlugin, out List<Partition> partitions)
|
||||
public override bool GetInformation(ImagePlugin imagePlugin, out List<Partition> partitions, ulong sectorOffset)
|
||||
{
|
||||
partitions = new List<Partition>();
|
||||
|
||||
byte[] sector = imagePlugin.ReadSector(0);
|
||||
byte[] sector = imagePlugin.ReadSector(sectorOffset);
|
||||
if(sector.Length < 512)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -48,11 +48,14 @@ namespace DiscImageChef.PartPlugins
|
||||
PluginUUID = new Guid("AEF5AB45-4880-4CE8-8735-F0A402E2E5F2");
|
||||
}
|
||||
|
||||
public override bool GetInformation(ImagePlugin imagePlugin, out List<Partition> partitions)
|
||||
public override bool GetInformation(ImagePlugin imagePlugin, out List<Partition> partitions, ulong sectorOffset)
|
||||
{
|
||||
partitions = new List<Partition>();
|
||||
|
||||
byte[] sector = imagePlugin.ReadSector(0);
|
||||
// TODO: This is not working
|
||||
return false;
|
||||
|
||||
byte[] sector = imagePlugin.ReadSector(sectorOffset);
|
||||
if(sector.Length < 512)
|
||||
return false;
|
||||
|
||||
|
||||
@@ -82,14 +82,14 @@ namespace DiscImageChef.PartPlugins
|
||||
PluginUUID = new Guid("50F35CC4-8375-4445-8DCB-1BA550C931A3");
|
||||
}
|
||||
|
||||
public override bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<CommonTypes.Partition> partitions)
|
||||
public override bool GetInformation(ImagePlugins.ImagePlugin imagePlugin, out List<CommonTypes.Partition> partitions, ulong sectorOffset)
|
||||
{
|
||||
partitions = new List<CommonTypes.Partition>();
|
||||
|
||||
if(imagePlugin.GetSectorSize() < 512)
|
||||
return false;
|
||||
|
||||
byte[] sunSector = imagePlugin.ReadSector(0);
|
||||
byte[] sunSector = imagePlugin.ReadSector(sectorOffset);
|
||||
byte[] tmpString;
|
||||
SunDiskLabel sdl = new SunDiskLabel
|
||||
{
|
||||
|
||||
@@ -49,35 +49,31 @@ namespace DiscImageChef.PartPlugins
|
||||
PluginUUID = new Guid("6D35A66F-8D77-426F-A562-D88F6A1F1702");
|
||||
}
|
||||
|
||||
public override bool GetInformation(ImagePlugin imagePlugin, out List<Partition> partitions)
|
||||
public override bool GetInformation(ImagePlugin imagePlugin, out List<Partition> partitions, ulong sectorOffset)
|
||||
{
|
||||
partitions = new List<Partition>();
|
||||
|
||||
uint magic;
|
||||
byte[] unix_dl_sector;
|
||||
byte[] unix_dl_sector = null;
|
||||
bool magic_found = false;
|
||||
|
||||
unix_dl_sector = imagePlugin.ReadSector(0);
|
||||
magic = BitConverter.ToUInt32(unix_dl_sector, 4);
|
||||
if(magic != UNIXDiskLabel_MAGIC)
|
||||
foreach(ulong i in new ulong[] {0, 1, 8, 29})
|
||||
{
|
||||
unix_dl_sector = imagePlugin.ReadSector(1);
|
||||
if(i + sectorOffset >= imagePlugin.GetSectors())
|
||||
break;
|
||||
|
||||
unix_dl_sector = imagePlugin.ReadSector(i + sectorOffset);
|
||||
magic = BitConverter.ToUInt32(unix_dl_sector, 4);
|
||||
if(magic != UNIXDiskLabel_MAGIC)
|
||||
if(magic == UNIXDiskLabel_MAGIC)
|
||||
{
|
||||
unix_dl_sector = imagePlugin.ReadSector(8);
|
||||
magic = BitConverter.ToUInt32(unix_dl_sector, 4);
|
||||
|
||||
if(magic != UNIXDiskLabel_MAGIC)
|
||||
{
|
||||
unix_dl_sector = imagePlugin.ReadSector(29);
|
||||
magic = BitConverter.ToUInt32(unix_dl_sector, 4);
|
||||
|
||||
if(magic != UNIXDiskLabel_MAGIC)
|
||||
return false;
|
||||
}
|
||||
magic_found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(!magic_found)
|
||||
return false;
|
||||
|
||||
UNIXDiskLabel dl = new UNIXDiskLabel();
|
||||
UNIXVTOC vtoc = new UNIXVTOC(); // old/new
|
||||
bool isNewDL = false;
|
||||
|
||||
@@ -77,10 +77,14 @@ namespace DiscImageChef.PartPlugins
|
||||
PluginUUID = new Guid("E3F6FB91-D358-4F22-A550-81E92D50EB78");
|
||||
}
|
||||
|
||||
public override bool GetInformation(ImagePlugin imagePlugin, out List<Partition> partitions)
|
||||
public override bool GetInformation(ImagePlugin imagePlugin, out List<Partition> partitions, ulong sectorOffset)
|
||||
{
|
||||
partitions = new List<Partition>();
|
||||
|
||||
// Xbox partitions always start on 0
|
||||
if(sectorOffset != 0)
|
||||
return false;
|
||||
|
||||
byte[] sector = imagePlugin.ReadSector(0);
|
||||
if(sector.Length < 512)
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user