Add field to propagate partition scheme on each partition.

This commit is contained in:
2017-07-23 22:54:36 +01:00
parent 332c2901fd
commit 4b9d012346
18 changed files with 488 additions and 376 deletions

View File

@@ -55,6 +55,8 @@ namespace DiscImageChef.CommonTypes
public string Description; public string Description;
/// <summary>LBA of last partition sector</summary> /// <summary>LBA of last partition sector</summary>
public ulong End { get { return Start + Length - 1; }} public ulong End { get { return Start + Length - 1; }}
/// <summary>Name of partition scheme that contains this partition</summary>
public string Scheme;
} }
} }

View File

@@ -119,12 +119,15 @@ namespace DiscImageChef.PartPlugins
foreach(LinuxEntry entry in table.entries) foreach(LinuxEntry entry in table.entries)
{ {
Partition part = new Partition(); Partition part = new Partition
part.Start = (ulong)(mapSector + entry.start); {
Start = (ulong)(mapSector + entry.start),
Size = entry.size,
Length = (ulong)(entry.size * sector.Length),
Sequence = counter,
Scheme = Name
};
part.Offset = part.Start * (ulong)sector.Length; part.Offset = part.Start * (ulong)sector.Length;
part.Size = entry.size;
part.Length = (ulong)(entry.size * sector.Length);
part.Sequence = counter;
if(entry.magic == LINUX_MAGIC || entry.magic == SWAP_MAGIC) if(entry.magic == LINUX_MAGIC || entry.magic == SWAP_MAGIC)
{ {
partitions.Add(part); partitions.Add(part);
@@ -145,13 +148,16 @@ namespace DiscImageChef.PartPlugins
{ {
foreach(RiscIxEntry entry in table.partitions) foreach(RiscIxEntry entry in table.partitions)
{ {
Partition part = new Partition(); Partition part = new Partition
part.Start = (ulong)(mapSector + entry.start); {
Start = (ulong)(mapSector + entry.start),
Size = entry.length,
Length = (ulong)(entry.length * sector.Length),
Name = StringHandlers.CToString(entry.name, Encoding.GetEncoding("iso-8859-1")),
Sequence = counter,
Scheme = Name
};
part.Offset = part.Start * (ulong)sector.Length; part.Offset = part.Start * (ulong)sector.Length;
part.Size = entry.length;
part.Length = (ulong)(entry.length * sector.Length);
part.Name = StringHandlers.CToString(entry.name, Encoding.GetEncoding("iso-8859-1"));
part.Sequence = counter;
if(entry.length > 0) if(entry.length > 0)
{ {
partitions.Add(part); partitions.Add(part);

View File

@@ -161,6 +161,7 @@ namespace DiscImageChef.PartPlugins
Sequence = sequence, Sequence = sequence,
Offset = old_entry.pdSize * ddm.sbBlockSize, Offset = old_entry.pdSize * ddm.sbBlockSize,
Start = (old_entry.pdSize * ddm.sbBlockSize) / sector_size, Start = (old_entry.pdSize * ddm.sbBlockSize) / sector_size,
Scheme = Name
}; };
if(old_entry.pdFSID == HFS_MAGIC_OLD) if(old_entry.pdFSID == HFS_MAGIC_OLD)
@@ -279,7 +280,8 @@ namespace DiscImageChef.PartPlugins
Offset = entry.start * entry_size, Offset = entry.start * entry_size,
Size = entry.sectors * entry_size, Size = entry.sectors * entry_size,
Start = (entry.start * entry_size) / sector_size, Start = (entry.start * entry_size) / sector_size,
Length = (entry.sectors * entry_size) / sector_size Length = (entry.sectors * entry_size) / sector_size,
Scheme = Name
}; };
sb.AppendLine("Partition flags:"); sb.AppendLine("Partition flags:");
if(flags.HasFlag(AppleMapFlags.Valid)) if(flags.HasFlag(AppleMapFlags.Valid))

View File

@@ -148,20 +148,22 @@ namespace DiscImageChef.PartPlugins
if(sectorSize == 2448 || sectorSize == 2352) if(sectorSize == 2448 || sectorSize == 2352)
sectorSize = 2048; sectorSize = 2048;
CommonTypes.Partition part = new CommonTypes.Partition();
part.Size = table.entries[i].length * sectorSize;
part.Length = table.entries[i].length;
part.Sequence = partitionSequence;
part.Name = "";
part.Offset = table.entries[i].start * sectorSize;
part.Start = table.entries[i].start;
byte[] partType = new byte[3]; byte[] partType = new byte[3];
partType[0] = (byte)((type & 0xFF0000) >> 16); partType[0] = (byte)((type & 0xFF0000) >> 16);
partType[1] = (byte)((type & 0x00FF00) >> 8); partType[1] = (byte)((type & 0x00FF00) >> 8);
partType[2] = (byte)(type & 0x0000FF); partType[2] = (byte)(type & 0x0000FF);
part.Type = Encoding.ASCII.GetString(partType);
CommonTypes.Partition part = new CommonTypes.Partition
{
Size = table.entries[i].length * sectorSize,
Length = table.entries[i].length,
Sequence = partitionSequence,
Name = "",
Offset = table.entries[i].start * sectorSize,
Start = table.entries[i].start,
Type = Encoding.ASCII.GetString(partType),
Scheme = Name
};
switch(type) switch(type)
{ {
case TypeGEMDOS: case TypeGEMDOS:
@@ -237,20 +239,22 @@ namespace DiscImageChef.PartPlugins
if(sectorSize == 2448 || sectorSize == 2352) if(sectorSize == 2448 || sectorSize == 2352)
sectorSize = 2048; sectorSize = 2048;
CommonTypes.Partition part = new CommonTypes.Partition();
part.Size = extendedTable.entries[j].length * sectorSize;
part.Length = extendedTable.entries[j].length;
part.Sequence = partitionSequence;
part.Name = "";
part.Offset = extendedTable.entries[j].start * sectorSize;
part.Start = extendedTable.entries[j].start;
byte[] partType = new byte[3]; byte[] partType = new byte[3];
partType[0] = (byte)((extendedType & 0xFF0000) >> 16); partType[0] = (byte)((extendedType & 0xFF0000) >> 16);
partType[1] = (byte)((extendedType & 0x00FF00) >> 8); partType[1] = (byte)((extendedType & 0x00FF00) >> 8);
partType[2] = (byte)(extendedType & 0x0000FF); partType[2] = (byte)(extendedType & 0x0000FF);
part.Type = Encoding.ASCII.GetString(partType);
CommonTypes.Partition part = new CommonTypes.Partition
{
Size = extendedTable.entries[j].length * sectorSize,
Length = extendedTable.entries[j].length,
Sequence = partitionSequence,
Name = "",
Offset = extendedTable.entries[j].start * sectorSize,
Start = extendedTable.entries[j].start,
Type = Encoding.ASCII.GetString(partType),
Scheme = Name
};
switch(extendedType) switch(extendedType)
{ {
case TypeGEMDOS: case TypeGEMDOS:
@@ -317,20 +321,22 @@ namespace DiscImageChef.PartPlugins
if(sectorSize == 2448 || sectorSize == 2352) if(sectorSize == 2448 || sectorSize == 2352)
sectorSize = 2048; sectorSize = 2048;
CommonTypes.Partition part = new CommonTypes.Partition();
part.Size = table.icdEntries[i].length * sectorSize;
part.Length = table.icdEntries[i].length;
part.Sequence = partitionSequence;
part.Name = "";
part.Offset = table.icdEntries[i].start * sectorSize;
part.Start = table.icdEntries[i].start;
byte[] partType = new byte[3]; byte[] partType = new byte[3];
partType[0] = (byte)((type & 0xFF0000) >> 16); partType[0] = (byte)((type & 0xFF0000) >> 16);
partType[1] = (byte)((type & 0x00FF00) >> 8); partType[1] = (byte)((type & 0x00FF00) >> 8);
partType[2] = (byte)(type & 0x0000FF); partType[2] = (byte)(type & 0x0000FF);
part.Type = Encoding.ASCII.GetString(partType);
CommonTypes.Partition part = new CommonTypes.Partition
{
Size = table.icdEntries[i].length * sectorSize,
Length = table.icdEntries[i].length,
Sequence = partitionSequence,
Name = "",
Offset = table.icdEntries[i].start * sectorSize,
Start = table.icdEntries[i].start,
Type = Encoding.ASCII.GetString(partType),
Scheme = Name
};
switch(type) switch(type)
{ {
case TypeGEMDOS: case TypeGEMDOS:

View File

@@ -76,13 +76,16 @@ namespace DiscImageChef.PartPlugins
foreach(BSDPartition entry in dl.d_partitions) foreach(BSDPartition entry in dl.d_partitions)
{ {
Partition part = new Partition(); Partition part = new Partition
part.Start = entry.p_offset; {
part.Offset = (entry.p_offset * dl.d_secsize); Start = entry.p_offset,
part.Size = entry.p_size; Offset = (entry.p_offset * dl.d_secsize),
part.Length = (entry.p_size * dl.d_secsize); Size = entry.p_size,
part.Type = fsTypeToString(entry.p_fstype); Length = (entry.p_size * dl.d_secsize),
part.Sequence = counter; Type = fsTypeToString(entry.p_fstype),
Sequence = counter,
Scheme = Name
};
if(entry.p_fstype != fsType.Unused) if(entry.p_fstype != fsType.Unused)
{ {
partitions.Add(part); partitions.Add(part);

View File

@@ -70,12 +70,15 @@ namespace DiscImageChef.PartPlugins
foreach(DECPartition entry in table.pt_part) foreach(DECPartition entry in table.pt_part)
{ {
Partition part = new Partition(); Partition part = new Partition
part.Start = entry.pi_blkoff; {
part.Offset = (ulong)(entry.pi_blkoff * sector.Length); Start = entry.pi_blkoff,
part.Size = (ulong)entry.pi_nblocks; Offset = (ulong)(entry.pi_blkoff * sector.Length),
part.Length = (ulong)(entry.pi_nblocks * sector.Length); Size = (ulong)entry.pi_nblocks,
part.Sequence = counter; Length = (ulong)(entry.pi_nblocks * sector.Length),
Sequence = counter,
Scheme = Name
};
if(part.Size > 0) if(part.Size > 0)
{ {
partitions.Add(part); partitions.Add(part);

View File

@@ -70,17 +70,20 @@ namespace DiscImageChef.PartPlugins
foreach(Partition64 entry in disklabel.d_partitions) foreach(Partition64 entry in disklabel.d_partitions)
{ {
Partition part = new Partition(); Partition part = new Partition
part.Start = entry.p_boffset; {
part.Offset = entry.p_boffset; Start = entry.p_boffset,
part.Size = entry.p_bsize; Offset = entry.p_boffset,
part.Length = entry.p_bsize; Size = entry.p_bsize,
Length = entry.p_bsize,
Name = entry.p_stor_uuid.ToString(),
Sequence = counter,
Scheme = Name
};
if((BSD.fsType)entry.p_fstype == BSD.fsType.Other) if((BSD.fsType)entry.p_fstype == BSD.fsType.Other)
part.Type = entry.p_type_uuid.ToString(); part.Type = entry.p_type_uuid.ToString();
else else
part.Type = BSD.fsTypeToString((BSD.fsType)entry.p_fstype); part.Type = BSD.fsTypeToString((BSD.fsType)entry.p_fstype);
part.Name = entry.p_stor_uuid.ToString();
part.Sequence = counter;
if(entry.p_bsize > 0 && entry.p_boffset > 0) if(entry.p_bsize > 0 && entry.p_boffset > 0)
{ {
partitions.Add(part); partitions.Add(part);

View File

@@ -129,15 +129,18 @@ namespace DiscImageChef.PartPlugins
if(entry.startLBA > imagePlugin.GetSectors() || entry.endLBA > imagePlugin.GetSectors()) if(entry.startLBA > imagePlugin.GetSectors() || entry.endLBA > imagePlugin.GetSectors())
return false; return false;
CommonTypes.Partition part = new CommonTypes.Partition(); CommonTypes.Partition part = new CommonTypes.Partition
part.Description = string.Format("ID: {0}", entry.partitionId); {
part.Size = (entry.endLBA - entry.startLBA + 1) * imagePlugin.GetSectorSize(); Description = string.Format("ID: {0}", entry.partitionId),
part.Name = entry.name; Size = (entry.endLBA - entry.startLBA + 1) * imagePlugin.GetSectorSize(),
part.Length = (entry.endLBA - entry.startLBA + 1); Name = entry.name,
part.Sequence = pseq++; Length = (entry.endLBA - entry.startLBA + 1),
part.Offset = entry.startLBA * imagePlugin.GetSectorSize(); Sequence = pseq++,
part.Start = entry.startLBA; Offset = entry.startLBA * imagePlugin.GetSectorSize(),
part.Type = GetGuidTypeName(entry.partitionType); Start = entry.startLBA,
Type = GetGuidTypeName(entry.partitionType),
Scheme = Name
};
DicConsole.DebugWriteLine("GPT Plugin", "part.PartitionType = {0}", part.Type); DicConsole.DebugWriteLine("GPT Plugin", "part.PartitionType = {0}", part.Type);
partitions.Add(part); partitions.Add(part);
} }

View File

@@ -98,13 +98,16 @@ namespace DiscImageChef.PartPlugins
DicConsole.DebugWriteLine("Human68k plugin", "entry.length = {0}", entry.length); DicConsole.DebugWriteLine("Human68k plugin", "entry.length = {0}", entry.length);
DicConsole.DebugWriteLine("Human68k plugin", "sectsPerUnit = {0} {1}", sectsPerUnit, imagePlugin.GetSectorSize()); DicConsole.DebugWriteLine("Human68k plugin", "sectsPerUnit = {0} {1}", sectsPerUnit, imagePlugin.GetSectorSize());
Partition part = new Partition(); Partition part = new Partition
part.Start = (entry.stateStart & 0xFFFFFF) * sectsPerUnit; {
Start = (entry.stateStart & 0xFFFFFF) * sectsPerUnit,
Length = entry.length * sectsPerUnit,
Type = StringHandlers.CToString(entry.name, Encoding.GetEncoding(932)),
Sequence = counter,
Scheme = Name
};
part.Offset = part.Start * (ulong)sector.Length; part.Offset = part.Start * (ulong)sector.Length;
part.Length = entry.length * sectsPerUnit;
part.Size = part.Length * (ulong)sector.Length; part.Size = part.Length * (ulong)sector.Length;
part.Type = StringHandlers.CToString(entry.name, Encoding.GetEncoding(932));
part.Sequence = counter;
if(entry.length > 0) if(entry.length > 0)
{ {
partitions.Add(part); partitions.Add(part);

View File

@@ -145,19 +145,20 @@ namespace DiscImageChef.PartPlugins
foreach(BSD.BSDPartition bsdPartition in bsdDisklabel.d_partitions) foreach(BSD.BSDPartition bsdPartition in bsdDisklabel.d_partitions)
{ {
CommonTypes.Partition part = new CommonTypes.Partition(); CommonTypes.Partition part = new CommonTypes.Partition
{
Length = bsdPartition.p_size,
Start = bsdPartition.p_offset,
Size = bsdPartition.p_size * bsdDisklabel.d_secsize,
Offset = bsdPartition.p_offset * bsdDisklabel.d_secsize,
part.Length = bsdPartition.p_size; Type = string.Format("BSD: {0}", bsdPartition.p_fstype),
part.Start = bsdPartition.p_offset; Name = BSD.fsTypeToString(bsdPartition.p_fstype),
part.Size = bsdPartition.p_size * bsdDisklabel.d_secsize;
part.Offset = bsdPartition.p_offset * bsdDisklabel.d_secsize;
part.Type = string.Format("BSD: {0}", bsdPartition.p_fstype);
part.Name = BSD.fsTypeToString(bsdPartition.p_fstype);
part.Sequence = counter;
part.Description = "Partition inside a BSD disklabel.";
Sequence = counter,
Description = "Partition inside a BSD disklabel.",
Scheme = Name
};
if(bsdPartition.p_fstype != BSD.fsType.Unused) if(bsdPartition.p_fstype != BSD.fsType.Unused)
{ {
partitions.Add(part); partitions.Add(part);
@@ -235,24 +236,26 @@ namespace DiscImageChef.PartPlugins
// TODO: What if number of slices overlaps sector (>23)? // TODO: What if number of slices overlaps sector (>23)?
for(int j = 0; j < vtoc.slices; j++) for(int j = 0; j < vtoc.slices; j++)
{ {
UNIX.UNIXVTOCEntry vtoc_ent = new UNIX.UNIXVTOCEntry(); UNIX.UNIXVTOCEntry vtoc_ent = new UNIX.UNIXVTOCEntry
{
vtoc_ent.tag = (DiscImageChef.PartPlugins.UNIX.UNIX_TAG)BitConverter.ToUInt16(unix_dl_sector, 160 + vtocoffset + j * 12 + 0); // 160/232 + j*12 tag = (UNIX.UNIX_TAG)BitConverter.ToUInt16(unix_dl_sector, 160 + vtocoffset + j * 12 + 0), // 160/232 + j*12
vtoc_ent.flags = BitConverter.ToUInt16(unix_dl_sector, 160 + vtocoffset + j * 12 + 2); // 162/234 + j*12 flags = BitConverter.ToUInt16(unix_dl_sector, 160 + vtocoffset + j * 12 + 2), // 162/234 + j*12
vtoc_ent.start = BitConverter.ToUInt32(unix_dl_sector, 160 + vtocoffset + j * 12 + 6); // 166/238 + j*12 start = BitConverter.ToUInt32(unix_dl_sector, 160 + vtocoffset + j * 12 + 6), // 166/238 + j*12
vtoc_ent.length = BitConverter.ToUInt32(unix_dl_sector, 160 + vtocoffset + j * 12 + 10); // 170/242 + j*12 length = BitConverter.ToUInt32(unix_dl_sector, 160 + vtocoffset + j * 12 + 10) // 170/242 + j*12
};
if((vtoc_ent.flags & 0x200) == 0x200 && vtoc_ent.tag != UNIX.UNIX_TAG.EMPTY && vtoc_ent.tag != UNIX.UNIX_TAG.WHOLE) if((vtoc_ent.flags & 0x200) == 0x200 && vtoc_ent.tag != UNIX.UNIX_TAG.EMPTY && vtoc_ent.tag != UNIX.UNIX_TAG.WHOLE)
{ {
CommonTypes.Partition part = new CommonTypes.Partition(); CommonTypes.Partition part = new CommonTypes.Partition
{
// TODO: Check if device bps == disklabel bps // TODO: Check if device bps == disklabel bps
part.Start = vtoc_ent.start; Start = vtoc_ent.start,
part.Length = vtoc_ent.length; Length = vtoc_ent.length,
part.Offset = vtoc_ent.start * dl.bps; Offset = vtoc_ent.start * dl.bps,
part.Size = vtoc_ent.length * dl.bps; Size = vtoc_ent.length * dl.bps,
part.Sequence = counter; Sequence = counter,
part.Type = string.Format("UNIX: {0}", UNIX.decodeUNIXTAG(vtoc_ent.tag, isNewDL)); Type = string.Format("UNIX: {0}", UNIX.decodeUNIXTAG(vtoc_ent.tag, isNewDL)),
Scheme = Name
};
string info = ""; string info = "";
if((vtoc_ent.flags & 0x01) == 0x01) if((vtoc_ent.flags & 0x01) == 0x01)
@@ -282,14 +285,16 @@ namespace DiscImageChef.PartPlugins
{ {
for(int j = 0; j < 16; j++) for(int j = 0; j < 16; j++)
{ {
CommonTypes.Partition part = new CommonTypes.Partition(); CommonTypes.Partition part = new CommonTypes.Partition
part.Start = BitConverter.ToUInt32(disklabel_sector, 68 + j * 12 + 4); {
part.Length = BitConverter.ToUInt32(disklabel_sector, 68 + j * 12 + 8); Start = BitConverter.ToUInt32(disklabel_sector, 68 + j * 12 + 4),
Length = BitConverter.ToUInt32(disklabel_sector, 68 + j * 12 + 8),
Description = "Solaris slice.",
Scheme = Name,
Sequence = counter
};
part.Offset = part.Start * imagePlugin.GetSectorSize(); // 68+4+j*12 part.Offset = part.Start * imagePlugin.GetSectorSize(); // 68+4+j*12
part.Size = part.Length * imagePlugin.GetSectorSize(); // 68+8+j*12 part.Size = part.Length * imagePlugin.GetSectorSize(); // 68+8+j*12
part.Description = "Solaris slice.";
part.Sequence = counter;
if(part.Size > 0) if(part.Size > 0)
{ {
@@ -313,15 +318,18 @@ namespace DiscImageChef.PartPlugins
if(type == 0x81) if(type == 0x81)
{ {
CommonTypes.Partition part = new CommonTypes.Partition();
minix_subs = true; minix_subs = true;
part.Description = "Minix subpartition"; CommonTypes.Partition part = new CommonTypes.Partition
part.Type = "Minix"; {
part.Start = BitConverter.ToUInt32(disklabel_sector, 0x1BE + j * 16 + 8); Description = "Minix subpartition",
part.Length = BitConverter.ToUInt32(disklabel_sector, 0x1BE + j * 16 + 12); Type = "Minix",
Start = BitConverter.ToUInt32(disklabel_sector, 0x1BE + j * 16 + 8),
Length = BitConverter.ToUInt32(disklabel_sector, 0x1BE + j * 16 + 12),
Sequence = counter,
Scheme = Name
};
part.Offset = part.Start * imagePlugin.GetSectorSize(); part.Offset = part.Start * imagePlugin.GetSectorSize();
part.Size = part.Length * imagePlugin.GetSectorSize(); part.Size = part.Length * imagePlugin.GetSectorSize();
part.Sequence = counter;
partitions.Add(part); partitions.Add(part);
counter++; counter++;
} }
@@ -362,6 +370,7 @@ namespace DiscImageChef.PartPlugins
part.Name = decodeMBRType(entry.type); part.Name = decodeMBRType(entry.type);
part.Sequence = counter; part.Sequence = counter;
part.Description = entry.status == 0x80 ? "Partition is bootable." : ""; part.Description = entry.status == 0x80 ? "Partition is bootable." : "";
part.Scheme = Name;
counter++; counter++;
@@ -444,18 +453,18 @@ namespace DiscImageChef.PartPlugins
foreach(BSD.BSDPartition bsdPartition in bsdDisklabel.d_partitions) foreach(BSD.BSDPartition bsdPartition in bsdDisklabel.d_partitions)
{ {
CommonTypes.Partition part = new CommonTypes.Partition(); CommonTypes.Partition part = new CommonTypes.Partition
{
part.Length = bsdPartition.p_size; Length = bsdPartition.p_size,
part.Start = bsdPartition.p_offset; Start = bsdPartition.p_offset,
part.Size = bsdPartition.p_size * bsdDisklabel.d_secsize; Size = bsdPartition.p_size * bsdDisklabel.d_secsize,
part.Offset = bsdPartition.p_offset * bsdDisklabel.d_secsize; Offset = bsdPartition.p_offset * bsdDisklabel.d_secsize,
Type = string.Format("BSD: {0}", bsdPartition.p_fstype),
part.Type = string.Format("BSD: {0}", bsdPartition.p_fstype); Name = BSD.fsTypeToString(bsdPartition.p_fstype),
part.Name = BSD.fsTypeToString(bsdPartition.p_fstype); Sequence = counter,
Description = "Partition inside a BSD disklabel.",
part.Sequence = counter; Scheme = Name
part.Description = "Partition inside a BSD disklabel."; };
if(bsdPartition.p_fstype != BSD.fsType.Unused) if(bsdPartition.p_fstype != BSD.fsType.Unused)
{ {
@@ -534,24 +543,26 @@ namespace DiscImageChef.PartPlugins
// TODO: What if number of slices overlaps sector (>23)? // TODO: What if number of slices overlaps sector (>23)?
for(int j = 0; j < vtoc.slices; j++) for(int j = 0; j < vtoc.slices; j++)
{ {
UNIX.UNIXVTOCEntry vtoc_ent = new UNIX.UNIXVTOCEntry(); UNIX.UNIXVTOCEntry vtoc_ent = new UNIX.UNIXVTOCEntry
{
vtoc_ent.tag = (DiscImageChef.PartPlugins.UNIX.UNIX_TAG)BitConverter.ToUInt16(unix_dl_sector, 160 + vtocoffset + j * 12 + 0); // 160/232 + j*12 tag = (UNIX.UNIX_TAG)BitConverter.ToUInt16(unix_dl_sector, 160 + vtocoffset + j * 12 + 0), // 160/232 + j*12
vtoc_ent.flags = BitConverter.ToUInt16(unix_dl_sector, 160 + vtocoffset + j * 12 + 2); // 162/234 + j*12 flags = BitConverter.ToUInt16(unix_dl_sector, 160 + vtocoffset + j * 12 + 2), // 162/234 + j*12
vtoc_ent.start = BitConverter.ToUInt32(unix_dl_sector, 160 + vtocoffset + j * 12 + 6); // 166/238 + j*12 start = BitConverter.ToUInt32(unix_dl_sector, 160 + vtocoffset + j * 12 + 6), // 166/238 + j*12
vtoc_ent.length = BitConverter.ToUInt32(unix_dl_sector, 160 + vtocoffset + j * 12 + 10); // 170/242 + j*12 length = BitConverter.ToUInt32(unix_dl_sector, 160 + vtocoffset + j * 12 + 10) // 170/242 + j*12
};
if((vtoc_ent.flags & 0x200) == 0x200 && vtoc_ent.tag != UNIX.UNIX_TAG.EMPTY && vtoc_ent.tag != UNIX.UNIX_TAG.WHOLE) if((vtoc_ent.flags & 0x200) == 0x200 && vtoc_ent.tag != UNIX.UNIX_TAG.EMPTY && vtoc_ent.tag != UNIX.UNIX_TAG.WHOLE)
{ {
CommonTypes.Partition part = new CommonTypes.Partition(); CommonTypes.Partition part = new CommonTypes.Partition
{
// TODO: Check if device bps == disklabel bps // TODO: Check if device bps == disklabel bps
part.Start = vtoc_ent.start; Start = vtoc_ent.start,
part.Length = vtoc_ent.length; Length = vtoc_ent.length,
part.Offset = vtoc_ent.start * dl.bps; Offset = vtoc_ent.start * dl.bps,
part.Size = vtoc_ent.length * dl.bps; Size = vtoc_ent.length * dl.bps,
part.Sequence = counter; Sequence = counter,
part.Type = string.Format("UNIX: {0}", UNIX.decodeUNIXTAG(vtoc_ent.tag, isNewDL)); Type = string.Format("UNIX: {0}", UNIX.decodeUNIXTAG(vtoc_ent.tag, isNewDL)),
Scheme = Name
};
string info = ""; string info = "";
if((vtoc_ent.flags & 0x01) == 0x01) if((vtoc_ent.flags & 0x01) == 0x01)
@@ -581,14 +592,16 @@ namespace DiscImageChef.PartPlugins
{ {
for(int j = 0; j < 16; j++) for(int j = 0; j < 16; j++)
{ {
CommonTypes.Partition part = new CommonTypes.Partition(); CommonTypes.Partition part = new CommonTypes.Partition
part.Start = BitConverter.ToUInt32(disklabel_sector, 68 + j * 12 + 4); {
part.Length = BitConverter.ToUInt32(disklabel_sector, 68 + j * 12 + 8); Start = BitConverter.ToUInt32(disklabel_sector, 68 + j * 12 + 4),
Length = BitConverter.ToUInt32(disklabel_sector, 68 + j * 12 + 8),
Description = "Solaris slice.",
Scheme = Name,
Sequence = counter
};
part.Offset = part.Start * imagePlugin.GetSectorSize(); // 68+4+j*12 part.Offset = part.Start * imagePlugin.GetSectorSize(); // 68+4+j*12
part.Size = part.Length * imagePlugin.GetSectorSize(); // 68+8+j*12 part.Size = part.Length * imagePlugin.GetSectorSize(); // 68+8+j*12
part.Description = "Solaris slice.";
part.Sequence = counter;
if(part.Size > 0) if(part.Size > 0)
{ {
@@ -612,15 +625,18 @@ namespace DiscImageChef.PartPlugins
if(type == 0x81) if(type == 0x81)
{ {
CommonTypes.Partition part = new CommonTypes.Partition(); CommonTypes.Partition part = new CommonTypes.Partition
{
Description = "Minix subpartition",
Type = "Minix",
Start = BitConverter.ToUInt32(disklabel_sector, 0x1BE + j * 16 + 8),
Length = BitConverter.ToUInt32(disklabel_sector, 0x1BE + j * 16 + 12),
Sequence = counter,
Scheme = Name
};
minix_subs = true; minix_subs = true;
part.Description = "Minix subpartition";
part.Type = "Minix";
part.Start = BitConverter.ToUInt32(disklabel_sector, 0x1BE + j * 16 + 8);
part.Length = BitConverter.ToUInt32(disklabel_sector, 0x1BE + j * 16 + 12);
part.Offset = part.Start * imagePlugin.GetSectorSize(); part.Offset = part.Start * imagePlugin.GetSectorSize();
part.Size = part.Length * imagePlugin.GetSectorSize(); part.Size = part.Length * imagePlugin.GetSectorSize();
part.Sequence = counter;
partitions.Add(part); partitions.Add(part);
counter++; counter++;
} }
@@ -662,6 +678,7 @@ namespace DiscImageChef.PartPlugins
part.Name = decodeMBRType(entry2.type); part.Name = decodeMBRType(entry2.type);
part.Sequence = counter; part.Sequence = counter;
part.Description = entry2.status == 0x80 ? "Partition is bootable." : ""; part.Description = entry2.status == 0x80 ? "Partition is bootable." : "";
part.Scheme = Name;
counter++; counter++;

View File

@@ -161,7 +161,8 @@ namespace DiscImageChef.PartPlugins
Sequence = (ulong)i, Sequence = (ulong)i,
Name = StringHandlers.CToString(label.dl_dt.d_partitions[i].p_mountpt), Name = StringHandlers.CToString(label.dl_dt.d_partitions[i].p_mountpt),
Length = (ulong)((label.dl_dt.d_partitions[i].p_size * label.dl_dt.d_secsize) / sector_size), Length = (ulong)((label.dl_dt.d_partitions[i].p_size * label.dl_dt.d_secsize) / sector_size),
Start = (ulong)(((label.dl_dt.d_partitions[i].p_base + label.dl_dt.d_front) * label.dl_dt.d_secsize) / sector_size) Start = (ulong)(((label.dl_dt.d_partitions[i].p_base + label.dl_dt.d_front) * label.dl_dt.d_secsize) / sector_size),
Scheme = Name
}; };
if(part.Start + part.Length > imagePlugin.ImageInfo.sectors) if(part.Start + part.Length > imagePlugin.ImageInfo.sectors)

View File

@@ -76,14 +76,17 @@ namespace DiscImageChef.PartPlugins
entry.dp_ecyl > 0) entry.dp_ecyl > 0)
{ {
Partition part = new Partition(); Partition part = new Partition
part.Start = CHStoLBA(entry.dp_scyl, entry.dp_shd, entry.dp_ssect); {
Start = CHStoLBA(entry.dp_scyl, entry.dp_shd, entry.dp_ssect),
Type = string.Format("{0}", (entry.dp_sid << 8) | entry.dp_mid),
Name = StringHandlers.CToString(entry.dp_name, Encoding.GetEncoding(932)),
Sequence = counter,
Scheme = Name
};
part.Offset = part.Start * imagePlugin.GetSectorSize(); part.Offset = part.Start * imagePlugin.GetSectorSize();
part.Length = CHStoLBA(entry.dp_ecyl, entry.dp_ehd, entry.dp_esect) - part.Start; part.Length = CHStoLBA(entry.dp_ecyl, entry.dp_ehd, entry.dp_esect) - part.Start;
part.Size = part.Length * imagePlugin.GetSectorSize(); part.Size = part.Length * imagePlugin.GetSectorSize();
part.Type = string.Format("{0}", (entry.dp_sid << 8) | entry.dp_mid);
part.Name = StringHandlers.CToString(entry.dp_name, Encoding.GetEncoding(932));
part.Sequence = counter;
if((entry.dp_sid & 0x7F) == 0x44 && if((entry.dp_sid & 0x7F) == 0x44 &&
(entry.dp_mid & 0x7F) == 0x14 && (entry.dp_mid & 0x7F) == 0x14 &&

View File

@@ -1072,14 +1072,15 @@ namespace DiscImageChef.PartPlugins
DicConsole.DebugWriteLine("Amiga RDB plugin", "Found BadBlock block"); DicConsole.DebugWriteLine("Amiga RDB plugin", "Found BadBlock block");
BadBlockList chainEntry = new BadBlockList(); BadBlockList chainEntry = new BadBlockList
chainEntry.magic = BigEndianBitConverter.ToUInt32(sector, 0x00); {
chainEntry.size = BigEndianBitConverter.ToUInt32(sector, 0x04); magic = BigEndianBitConverter.ToUInt32(sector, 0x00),
chainEntry.checksum = BigEndianBitConverter.ToInt32(sector, 0x08); size = BigEndianBitConverter.ToUInt32(sector, 0x04),
chainEntry.targetID = BigEndianBitConverter.ToUInt32(sector, 0x0C); checksum = BigEndianBitConverter.ToInt32(sector, 0x08),
chainEntry.next_ptr = BigEndianBitConverter.ToUInt32(sector, 0x10); targetID = BigEndianBitConverter.ToUInt32(sector, 0x0C),
chainEntry.reserved = BigEndianBitConverter.ToUInt32(sector, 0x14); next_ptr = BigEndianBitConverter.ToUInt32(sector, 0x10),
reserved = BigEndianBitConverter.ToUInt32(sector, 0x14)
};
ulong entries = (chainEntry.size - 6) / 2; ulong entries = (chainEntry.size - 6) / 2;
chainEntry.blockPairs = new BadBlockEntry[entries]; chainEntry.blockPairs = new BadBlockEntry[entries];
@@ -1118,57 +1119,62 @@ namespace DiscImageChef.PartPlugins
DicConsole.DebugWriteLine("Amiga RDB plugin", "Found PartitionEntry block"); DicConsole.DebugWriteLine("Amiga RDB plugin", "Found PartitionEntry block");
PartitionEntry partEntry = new PartitionEntry(); PartitionEntry partEntry = new PartitionEntry
partEntry.dosEnvVec = new DOSEnvironmentVector(); {
magic = BigEndianBitConverter.ToUInt32(sector, 0x00),
size = BigEndianBitConverter.ToUInt32(sector, 0x04),
checksum = BigEndianBitConverter.ToInt32(sector, 0x08),
targetID = BigEndianBitConverter.ToUInt32(sector, 0x0C),
next_ptr = BigEndianBitConverter.ToUInt32(sector, 0x10),
flags = BigEndianBitConverter.ToUInt32(sector, 0x14),
reserved1 = BigEndianBitConverter.ToUInt32(sector, 0x18),
reserved2 = BigEndianBitConverter.ToUInt32(sector, 0x1C),
devFlags = BigEndianBitConverter.ToUInt32(sector, 0x20),
driveNameLen = sector[0x24],
reserved3 = BigEndianBitConverter.ToUInt32(sector, 0x44),
reserved4 = BigEndianBitConverter.ToUInt32(sector, 0x48),
reserved5 = BigEndianBitConverter.ToUInt32(sector, 0x4C),
reserved6 = BigEndianBitConverter.ToUInt32(sector, 0x50),
reserved7 = BigEndianBitConverter.ToUInt32(sector, 0x54),
reserved8 = BigEndianBitConverter.ToUInt32(sector, 0x58),
reserved9 = BigEndianBitConverter.ToUInt32(sector, 0x5C),
reserved10 = BigEndianBitConverter.ToUInt32(sector, 0x60),
reserved11 = BigEndianBitConverter.ToUInt32(sector, 0x64),
reserved12 = BigEndianBitConverter.ToUInt32(sector, 0x68),
reserved13 = BigEndianBitConverter.ToUInt32(sector, 0x6C),
reserved14 = BigEndianBitConverter.ToUInt32(sector, 0x70),
reserved15 = BigEndianBitConverter.ToUInt32(sector, 0x74),
reserved16 = BigEndianBitConverter.ToUInt32(sector, 0x78),
reserved17 = BigEndianBitConverter.ToUInt32(sector, 0x7C),
dosEnvVec = new DOSEnvironmentVector
{
size = BigEndianBitConverter.ToUInt32(sector, 0x80),
block_size = BigEndianBitConverter.ToUInt32(sector, 0x84),
sec_org = BigEndianBitConverter.ToUInt32(sector, 0x88),
surfaces = BigEndianBitConverter.ToUInt32(sector, 0x8C),
spb = BigEndianBitConverter.ToUInt32(sector, 0x90),
bpt = BigEndianBitConverter.ToUInt32(sector, 0x94),
reservedblocks = BigEndianBitConverter.ToUInt32(sector, 0x98),
prealloc = BigEndianBitConverter.ToUInt32(sector, 0x9C),
interleave = BigEndianBitConverter.ToUInt32(sector, 0xA0),
lowCylinder = BigEndianBitConverter.ToUInt32(sector, 0xA4),
highCylinder = BigEndianBitConverter.ToUInt32(sector, 0xA8),
numBuffer = BigEndianBitConverter.ToUInt32(sector, 0xAC),
bufMemType = BigEndianBitConverter.ToUInt32(sector, 0xB0),
maxTransfer = BigEndianBitConverter.ToUInt32(sector, 0xB4),
Mask = BigEndianBitConverter.ToUInt32(sector, 0xB8),
bootPriority = BigEndianBitConverter.ToUInt32(sector, 0xBC),
dosType = BigEndianBitConverter.ToUInt32(sector, 0xC0),
baud = BigEndianBitConverter.ToUInt32(sector, 0xC4),
control = BigEndianBitConverter.ToUInt32(sector, 0xC8),
bootBlocks = BigEndianBitConverter.ToUInt32(sector, 0xCC)
}
};
byte[] driveName = new byte[32]; byte[] driveName = new byte[32];
partEntry.magic = BigEndianBitConverter.ToUInt32(sector, 0x00);
partEntry.size = BigEndianBitConverter.ToUInt32(sector, 0x04);
partEntry.checksum = BigEndianBitConverter.ToInt32(sector, 0x08);
partEntry.targetID = BigEndianBitConverter.ToUInt32(sector, 0x0C);
partEntry.next_ptr = BigEndianBitConverter.ToUInt32(sector, 0x10);
partEntry.flags = BigEndianBitConverter.ToUInt32(sector, 0x14);
partEntry.reserved1 = BigEndianBitConverter.ToUInt32(sector, 0x18);
partEntry.reserved2 = BigEndianBitConverter.ToUInt32(sector, 0x1C);
partEntry.devFlags = BigEndianBitConverter.ToUInt32(sector, 0x20);
partEntry.driveNameLen = sector[0x24];
Array.Copy(sector, 0x24, driveName, 0, 32); Array.Copy(sector, 0x24, driveName, 0, 32);
partEntry.driveName = StringHandlers.PascalToString(driveName, Encoding.GetEncoding("iso-8859-1")); partEntry.driveName = StringHandlers.PascalToString(driveName, Encoding.GetEncoding("iso-8859-1"));
partEntry.reserved3 = BigEndianBitConverter.ToUInt32(sector, 0x44);
partEntry.reserved4 = BigEndianBitConverter.ToUInt32(sector, 0x48);
partEntry.reserved5 = BigEndianBitConverter.ToUInt32(sector, 0x4C);
partEntry.reserved6 = BigEndianBitConverter.ToUInt32(sector, 0x50);
partEntry.reserved7 = BigEndianBitConverter.ToUInt32(sector, 0x54);
partEntry.reserved8 = BigEndianBitConverter.ToUInt32(sector, 0x58);
partEntry.reserved9 = BigEndianBitConverter.ToUInt32(sector, 0x5C);
partEntry.reserved10 = BigEndianBitConverter.ToUInt32(sector, 0x60);
partEntry.reserved11 = BigEndianBitConverter.ToUInt32(sector, 0x64);
partEntry.reserved12 = BigEndianBitConverter.ToUInt32(sector, 0x68);
partEntry.reserved13 = BigEndianBitConverter.ToUInt32(sector, 0x6C);
partEntry.reserved14 = BigEndianBitConverter.ToUInt32(sector, 0x70);
partEntry.reserved15 = BigEndianBitConverter.ToUInt32(sector, 0x74);
partEntry.reserved16 = BigEndianBitConverter.ToUInt32(sector, 0x78);
partEntry.reserved17 = BigEndianBitConverter.ToUInt32(sector, 0x7C);
partEntry.dosEnvVec.size = BigEndianBitConverter.ToUInt32(sector, 0x80);
partEntry.dosEnvVec.block_size = BigEndianBitConverter.ToUInt32(sector, 0x84);
partEntry.dosEnvVec.sec_org = BigEndianBitConverter.ToUInt32(sector, 0x88);
partEntry.dosEnvVec.surfaces = BigEndianBitConverter.ToUInt32(sector, 0x8C);
partEntry.dosEnvVec.spb = BigEndianBitConverter.ToUInt32(sector, 0x90);
partEntry.dosEnvVec.bpt = BigEndianBitConverter.ToUInt32(sector, 0x94);
partEntry.dosEnvVec.reservedblocks = BigEndianBitConverter.ToUInt32(sector, 0x98);
partEntry.dosEnvVec.prealloc = BigEndianBitConverter.ToUInt32(sector, 0x9C);
partEntry.dosEnvVec.interleave = BigEndianBitConverter.ToUInt32(sector, 0xA0);
partEntry.dosEnvVec.lowCylinder = BigEndianBitConverter.ToUInt32(sector, 0xA4);
partEntry.dosEnvVec.highCylinder = BigEndianBitConverter.ToUInt32(sector, 0xA8);
partEntry.dosEnvVec.numBuffer = BigEndianBitConverter.ToUInt32(sector, 0xAC);
partEntry.dosEnvVec.bufMemType = BigEndianBitConverter.ToUInt32(sector, 0xB0);
partEntry.dosEnvVec.maxTransfer = BigEndianBitConverter.ToUInt32(sector, 0xB4);
partEntry.dosEnvVec.Mask = BigEndianBitConverter.ToUInt32(sector, 0xB8);
partEntry.dosEnvVec.bootPriority = BigEndianBitConverter.ToUInt32(sector, 0xBC);
partEntry.dosEnvVec.dosType = BigEndianBitConverter.ToUInt32(sector, 0xC0);
partEntry.dosEnvVec.baud = BigEndianBitConverter.ToUInt32(sector, 0xC4);
partEntry.dosEnvVec.control = BigEndianBitConverter.ToUInt32(sector, 0xC8);
partEntry.dosEnvVec.bootBlocks = BigEndianBitConverter.ToUInt32(sector, 0xCC);
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.magic = 0x{0:X8}", partEntry.magic); DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.magic = 0x{0:X8}", partEntry.magic);
DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.size = {0} longs, {1} bytes", partEntry.size, partEntry.size * 4); DicConsole.DebugWriteLine("Amiga RDB plugin", "partEntry.size = {0} longs, {1} bytes", partEntry.size, partEntry.size * 4);
@@ -1238,30 +1244,32 @@ namespace DiscImageChef.PartPlugins
DicConsole.DebugWriteLine("Amiga RDB plugin", "Found FileSystemHeader block"); DicConsole.DebugWriteLine("Amiga RDB plugin", "Found FileSystemHeader block");
FileSystemHeader FSHD = new FileSystemHeader(); FileSystemHeader FSHD = new FileSystemHeader
FSHD.dnode = new DeviceNode(); {
magic = BigEndianBitConverter.ToUInt32(sector, 0x00),
FSHD.magic = BigEndianBitConverter.ToUInt32(sector, 0x00); size = BigEndianBitConverter.ToUInt32(sector, 0x04),
FSHD.size = BigEndianBitConverter.ToUInt32(sector, 0x04); checksum = BigEndianBitConverter.ToInt32(sector, 0x08),
FSHD.checksum = BigEndianBitConverter.ToInt32(sector, 0x08); targetID = BigEndianBitConverter.ToUInt32(sector, 0x0C),
FSHD.targetID = BigEndianBitConverter.ToUInt32(sector, 0x0C); next_ptr = BigEndianBitConverter.ToUInt32(sector, 0x10),
FSHD.next_ptr = BigEndianBitConverter.ToUInt32(sector, 0x10); flags = BigEndianBitConverter.ToUInt32(sector, 0x14),
FSHD.flags = BigEndianBitConverter.ToUInt32(sector, 0x14); reserved1 = BigEndianBitConverter.ToUInt32(sector, 0x18),
FSHD.reserved1 = BigEndianBitConverter.ToUInt32(sector, 0x18); reserved2 = BigEndianBitConverter.ToUInt32(sector, 0x1C),
FSHD.reserved2 = BigEndianBitConverter.ToUInt32(sector, 0x1C); dosType = BigEndianBitConverter.ToUInt32(sector, 0x20),
FSHD.dosType = BigEndianBitConverter.ToUInt32(sector, 0x20); version = BigEndianBitConverter.ToUInt32(sector, 0x24),
FSHD.version = BigEndianBitConverter.ToUInt32(sector, 0x24); patchFlags = BigEndianBitConverter.ToUInt32(sector, 0x28),
FSHD.patchFlags = BigEndianBitConverter.ToUInt32(sector, 0x28); dnode = new DeviceNode
{
FSHD.dnode.type = BigEndianBitConverter.ToUInt32(sector, 0x2C); type = BigEndianBitConverter.ToUInt32(sector, 0x2C),
FSHD.dnode.task = BigEndianBitConverter.ToUInt32(sector, 0x30); task = BigEndianBitConverter.ToUInt32(sector, 0x30),
FSHD.dnode.locked = BigEndianBitConverter.ToUInt32(sector, 0x34); locked = BigEndianBitConverter.ToUInt32(sector, 0x34),
FSHD.dnode.handler = BigEndianBitConverter.ToUInt32(sector, 0x38); handler = BigEndianBitConverter.ToUInt32(sector, 0x38),
FSHD.dnode.stackSize = BigEndianBitConverter.ToUInt32(sector, 0x3C); stackSize = BigEndianBitConverter.ToUInt32(sector, 0x3C),
FSHD.dnode.priority = BigEndianBitConverter.ToUInt32(sector, 0x40); priority = BigEndianBitConverter.ToUInt32(sector, 0x40),
FSHD.dnode.startup = BigEndianBitConverter.ToUInt32(sector, 0x44); startup = BigEndianBitConverter.ToUInt32(sector, 0x44),
FSHD.dnode.seglist_ptr = BigEndianBitConverter.ToUInt32(sector, 0x48); seglist_ptr = BigEndianBitConverter.ToUInt32(sector, 0x48),
FSHD.dnode.global_vec = BigEndianBitConverter.ToUInt32(sector, 0x4C); global_vec = BigEndianBitConverter.ToUInt32(sector, 0x4C)
}
};
DicConsole.DebugWriteLine("Amiga RDB plugin", "FSHD.magic = 0x{0:X8}", FSHD.magic); DicConsole.DebugWriteLine("Amiga RDB plugin", "FSHD.magic = 0x{0:X8}", FSHD.magic);
DicConsole.DebugWriteLine("Amiga RDB plugin", "FSHD.size = {0} longs, {1} bytes", FSHD.size, FSHD.size * 4); DicConsole.DebugWriteLine("Amiga RDB plugin", "FSHD.size = {0} longs, {1} bytes", FSHD.size, FSHD.size * 4);
@@ -1335,16 +1343,18 @@ namespace DiscImageChef.PartPlugins
ulong sequence = 0; ulong sequence = 0;
foreach(PartitionEntry RDBEntry in PartitionEntries) foreach(PartitionEntry RDBEntry in PartitionEntries)
{ {
CommonTypes.Partition entry = new CommonTypes.Partition(); CommonTypes.Partition entry = new CommonTypes.Partition
{
entry.Description = AmigaDOSTypeToDescriptionString(RDBEntry.dosEnvVec.dosType); Description = AmigaDOSTypeToDescriptionString(RDBEntry.dosEnvVec.dosType),
entry.Name = RDBEntry.driveName; Name = RDBEntry.driveName,
entry.Sequence = sequence; Sequence = sequence,
entry.Length = (RDBEntry.dosEnvVec.highCylinder + 1 - RDBEntry.dosEnvVec.lowCylinder) * RDBEntry.dosEnvVec.surfaces * RDBEntry.dosEnvVec.bpt; Length = (RDBEntry.dosEnvVec.highCylinder + 1 - RDBEntry.dosEnvVec.lowCylinder) * RDBEntry.dosEnvVec.surfaces * RDBEntry.dosEnvVec.bpt,
entry.Start = RDBEntry.dosEnvVec.lowCylinder * RDBEntry.dosEnvVec.surfaces * RDBEntry.dosEnvVec.bpt; Start = RDBEntry.dosEnvVec.lowCylinder * RDBEntry.dosEnvVec.surfaces * RDBEntry.dosEnvVec.bpt,
Type = AmigaDOSTypeToString(RDBEntry.dosEnvVec.dosType),
Scheme = Name
};
entry.Offset = entry.Start * RDB.block_size; entry.Offset = entry.Start * RDB.block_size;
entry.Size = entry.Length * RDB.block_size; entry.Size = entry.Length * RDB.block_size;
entry.Type = AmigaDOSTypeToString(RDBEntry.dosEnvVec.dosType);
partitions.Add(entry); partitions.Add(entry);
sequence++; sequence++;

View File

@@ -70,13 +70,16 @@ namespace DiscImageChef.PartPlugins
foreach(RioKarmaEntry entry in table.entries) foreach(RioKarmaEntry entry in table.entries)
{ {
Partition part = new Partition(); Partition part = new Partition
part.Start = entry.offset; {
part.Offset = (ulong)(entry.offset * sector.Length); Start = entry.offset,
part.Size = entry.size; Offset = (ulong)(entry.offset * sector.Length),
part.Length = (ulong)(entry.size * sector.Length); Size = entry.size,
part.Type = "Rio Karma"; Length = (ulong)(entry.size * sector.Length),
part.Sequence = counter; Type = "Rio Karma",
Sequence = counter,
Scheme = Name
};
if(entry.type == EntryMagic) if(entry.type == EntryMagic)
{ {
partitions.Add(part); partitions.Add(part);

View File

@@ -69,13 +69,16 @@ namespace DiscImageChef.PartPlugins
foreach(SGIPartition entry in disklabel.partitions) foreach(SGIPartition entry in disklabel.partitions)
{ {
Partition part = new Partition(); Partition part = new Partition()
part.Start = entry.first_block; {
part.Offset = (entry.first_block * 512); Start = entry.first_block,
part.Size = entry.num_blocks; Offset = (entry.first_block * 512),
part.Length = (entry.num_blocks * 512); Size = entry.num_blocks,
part.Type = string.Format("{0}", entry.type); Length = (entry.num_blocks * 512),
part.Sequence = counter; Type = string.Format("{0}", entry.type),
Sequence = counter,
Scheme = Name
};
if(part.Size > 0) if(part.Size > 0)
{ {
partitions.Add(part); partitions.Add(part);

View File

@@ -91,15 +91,18 @@ namespace DiscImageChef.PartPlugins
byte[] sunSector = imagePlugin.ReadSector(0); byte[] sunSector = imagePlugin.ReadSector(0);
byte[] tmpString; byte[] tmpString;
SunDiskLabel sdl = new SunDiskLabel(); SunDiskLabel sdl = new SunDiskLabel
sdl.vtoc = new SunVTOC(); {
sdl.spare = new byte[148]; spare = new byte[148],
sdl.vtoc.infos = new SunInfo[8]; vtoc = new SunVTOC
sdl.vtoc.bootinfo = new uint[3]; {
sdl.vtoc.reserved = new byte[40]; infos = new SunInfo[8],
sdl.vtoc.timestamp = new uint[8]; bootinfo = new uint[3],
sdl.partitions = new SunPartition[8]; reserved = new byte[40],
timestamp = new uint[8]
},
partitions = new SunPartition[8]
};
BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian; BigEndianBitConverter.IsLittleEndian = BitConverter.IsLittleEndian;
tmpString = new byte[128]; tmpString = new byte[128];
@@ -113,9 +116,11 @@ namespace DiscImageChef.PartPlugins
sdl.vtoc.nparts = BigEndianBitConverter.ToUInt16(sunSector, 0x80 + 0x0C); sdl.vtoc.nparts = BigEndianBitConverter.ToUInt16(sunSector, 0x80 + 0x0C);
for(int i = 0; i < 8; i++) for(int i = 0; i < 8; i++)
{ {
sdl.vtoc.infos[i] = new SunInfo(); sdl.vtoc.infos[i] = new SunInfo
sdl.vtoc.infos[i].id = BigEndianBitConverter.ToUInt16(sunSector, 0x80 + 0x0E + i * 4 + 0x00); {
sdl.vtoc.infos[i].flags = BigEndianBitConverter.ToUInt16(sunSector, 0x80 + 0x0E + i * 4 + 0x02); id = BigEndianBitConverter.ToUInt16(sunSector, 0x80 + 0x0E + i * 4 + 0x00),
flags = BigEndianBitConverter.ToUInt16(sunSector, 0x80 + 0x0E + i * 4 + 0x02)
};
} }
sdl.vtoc.padding = BigEndianBitConverter.ToUInt16(sunSector, 0x80 + 0x2E); sdl.vtoc.padding = BigEndianBitConverter.ToUInt16(sunSector, 0x80 + 0x2E);
for(int i = 0; i < 3; i++) for(int i = 0; i < 3; i++)
@@ -143,9 +148,11 @@ namespace DiscImageChef.PartPlugins
for(int i = 0; i < 8; i++) for(int i = 0; i < 8; i++)
{ {
sdl.partitions[i] = new SunPartition(); sdl.partitions[i] = new SunPartition
sdl.partitions[i].start_cylinder = BigEndianBitConverter.ToUInt32(sunSector, 0x1BC + i * 8 + 0x00); {
sdl.partitions[i].num_sectors = BigEndianBitConverter.ToUInt32(sunSector, 0x1BC + i * 8 + 0x04); start_cylinder = BigEndianBitConverter.ToUInt32(sunSector, 0x1BC + i * 8 + 0x00),
num_sectors = BigEndianBitConverter.ToUInt32(sunSector, 0x1BC + i * 8 + 0x04)
};
} }
sdl.magic = BigEndianBitConverter.ToUInt16(sunSector, 0x1FC); sdl.magic = BigEndianBitConverter.ToUInt16(sunSector, 0x1FC);
@@ -200,20 +207,22 @@ namespace DiscImageChef.PartPlugins
{ {
if((SunTypes)sdl.vtoc.infos[i].id != SunTypes.SunWholeDisk && sdl.partitions[i].num_sectors > 0) if((SunTypes)sdl.vtoc.infos[i].id != SunTypes.SunWholeDisk && sdl.partitions[i].num_sectors > 0)
{ {
CommonTypes.Partition part = new CommonTypes.Partition(); CommonTypes.Partition part = new CommonTypes.Partition
part.Description = SunFlagsToString((SunFlags)sdl.vtoc.infos[i].flags); {
Description = SunFlagsToString((SunFlags)sdl.vtoc.infos[i].flags),
#pragma warning disable IDE0004 // Remove Unnecessary Cast #pragma warning disable IDE0004 // Remove Unnecessary Cast
part.Size = (ulong)sdl.partitions[i].num_sectors * (ulong)imagePlugin.GetSectorSize(); Size = (ulong)sdl.partitions[i].num_sectors * (ulong)imagePlugin.GetSectorSize(),
#pragma warning restore IDE0004 // Remove Unnecessary Cast #pragma warning restore IDE0004 // Remove Unnecessary Cast
part.Name = ""; Name = "",
part.Length = sdl.partitions[i].num_sectors; Length = sdl.partitions[i].num_sectors,
part.Sequence = (ulong)i; Sequence = (ulong)i,
#pragma warning disable IDE0004 // Remove Unnecessary Cast #pragma warning disable IDE0004 // Remove Unnecessary Cast
part.Offset = (ulong)sdl.partitions[i].start_cylinder * (ulong)sectorsPerCylinder * (ulong)imagePlugin.GetSectorSize(); Offset = (ulong)sdl.partitions[i].start_cylinder * (ulong)sectorsPerCylinder * (ulong)imagePlugin.GetSectorSize(),
#pragma warning restore IDE0004 // Remove Unnecessary Cast #pragma warning restore IDE0004 // Remove Unnecessary Cast
part.Start = sdl.partitions[i].start_cylinder * sectorsPerCylinder; Start = sdl.partitions[i].start_cylinder * sectorsPerCylinder,
part.Type = SunIdToString((SunTypes)sdl.vtoc.infos[i].id); Type = SunIdToString((SunTypes)sdl.vtoc.infos[i].id),
Scheme = Name
};
if(part.Start > imagePlugin.GetSectors() || (part.Start + part.Length) > imagePlugin.GetSectors()) if(part.Start > imagePlugin.GetSectors() || (part.Start + part.Length) > imagePlugin.GetSectors())
return false; return false;

View File

@@ -133,23 +133,25 @@ namespace DiscImageChef.PartPlugins
// TODO: What if number of slices overlaps sector (>23)? // TODO: What if number of slices overlaps sector (>23)?
for(int j = 0; j < vtoc.slices; j++) for(int j = 0; j < vtoc.slices; j++)
{ {
UNIXVTOCEntry vtoc_ent = new UNIXVTOCEntry(); UNIXVTOCEntry vtoc_ent = new UNIXVTOCEntry
{
vtoc_ent.tag = (UNIX_TAG)BitConverter.ToUInt16(unix_dl_sector, 160 + vtocoffset + j * 12 + 0); // 160/232 + j*12 tag = (UNIX_TAG)BitConverter.ToUInt16(unix_dl_sector, 160 + vtocoffset + j * 12 + 0), // 160/232 + j*12
vtoc_ent.flags = BitConverter.ToUInt16(unix_dl_sector, 160 + vtocoffset + j * 12 + 2); // 162/234 + j*12 flags = BitConverter.ToUInt16(unix_dl_sector, 160 + vtocoffset + j * 12 + 2), // 162/234 + j*12
vtoc_ent.start = BitConverter.ToUInt32(unix_dl_sector, 160 + vtocoffset + j * 12 + 6); // 166/238 + j*12 start = BitConverter.ToUInt32(unix_dl_sector, 160 + vtocoffset + j * 12 + 6), // 166/238 + j*12
vtoc_ent.length = BitConverter.ToUInt32(unix_dl_sector, 160 + vtocoffset + j * 12 + 10); // 170/242 + j*12 length = BitConverter.ToUInt32(unix_dl_sector, 160 + vtocoffset + j * 12 + 10) // 170/242 + j*12
};
if((vtoc_ent.flags & 0x200) == 0x200 && vtoc_ent.tag != UNIX_TAG.EMPTY && vtoc_ent.tag != UNIX_TAG.WHOLE) if((vtoc_ent.flags & 0x200) == 0x200 && vtoc_ent.tag != UNIX_TAG.EMPTY && vtoc_ent.tag != UNIX_TAG.WHOLE)
{ {
Partition part = new Partition(); Partition part = new Partition
part.Start = vtoc_ent.start; {
part.Length = vtoc_ent.length; Start = vtoc_ent.start,
part.Offset = vtoc_ent.start * dl.bps; Length = vtoc_ent.length,
part.Size = vtoc_ent.length * dl.bps; Offset = vtoc_ent.start * dl.bps,
part.Sequence = counter; Size = vtoc_ent.length * dl.bps,
part.Type = string.Format("UNIX: {0}", decodeUNIXTAG(vtoc_ent.tag, isNewDL)); Sequence = counter,
Type = string.Format("UNIX: {0}", decodeUNIXTAG(vtoc_ent.tag, isNewDL)),
Scheme = Name
};
string info = ""; string info = "";
if((vtoc_ent.flags & 0x01) == 0x01) if((vtoc_ent.flags & 0x01) == 0x01)

View File

@@ -90,21 +90,27 @@ namespace DiscImageChef.PartPlugins
if(table.magic == Xbox360DevKitMagic && table.contentOff + table.contentLen <= imagePlugin.ImageInfo.sectors && if(table.magic == Xbox360DevKitMagic && table.contentOff + table.contentLen <= imagePlugin.ImageInfo.sectors &&
table.dashboardOff + table.dashboardLen <= imagePlugin.ImageInfo.sectors) table.dashboardOff + table.dashboardLen <= imagePlugin.ImageInfo.sectors)
{ {
Partition contentPart = new Partition(); Partition contentPart = new Partition
contentPart.Description = "Content volume"; {
contentPart.Size = (ulong)table.contentLen * (ulong)imagePlugin.ImageInfo.sectorSize; Description = "Content volume",
contentPart.Length = table.contentLen; Size = (ulong)table.contentLen * imagePlugin.ImageInfo.sectorSize,
contentPart.Sequence = 1; Length = table.contentLen,
contentPart.Offset = (ulong)table.contentOff * (ulong)imagePlugin.ImageInfo.sectorSize; Sequence = 1,
contentPart.Start = table.contentOff; Offset = (ulong)table.contentOff * imagePlugin.ImageInfo.sectorSize,
Start = table.contentOff,
Scheme = Name
};
Partition dashboardPart = new Partition(); Partition dashboardPart = new Partition
dashboardPart.Description = "Dashboard volume"; {
dashboardPart.Size = (ulong)table.dashboardLen * (ulong)imagePlugin.ImageInfo.sectorSize; Description = "Dashboard volume",
dashboardPart.Length = table.dashboardLen; Size = (ulong)table.dashboardLen * imagePlugin.ImageInfo.sectorSize,
dashboardPart.Sequence = 2; Length = table.dashboardLen,
dashboardPart.Offset = (ulong)table.dashboardOff * (ulong)imagePlugin.ImageInfo.sectorSize; Sequence = 2,
dashboardPart.Start = table.dashboardOff; Offset = (ulong)table.dashboardOff * imagePlugin.ImageInfo.sectorSize,
Start = table.dashboardOff,
Scheme = Name
};
partitions.Add(contentPart); partitions.Add(contentPart);
partitions.Add(dashboardPart); partitions.Add(dashboardPart);
@@ -121,21 +127,27 @@ namespace DiscImageChef.PartPlugins
if(temp == XboxCigam) if(temp == XboxCigam)
{ {
Partition sysCachePart = new Partition(); Partition sysCachePart = new Partition
sysCachePart.Description = "System cache"; {
sysCachePart.Size = MemoryUnitDataOff; Description = "System cache",
sysCachePart.Length = (ulong)(MemoryUnitDataOff / imagePlugin.ImageInfo.sectorSize); Size = MemoryUnitDataOff,
sysCachePart.Sequence = 1; Length = (ulong)(MemoryUnitDataOff / imagePlugin.ImageInfo.sectorSize),
sysCachePart.Offset = 0; Sequence = 1,
sysCachePart.Start = 0; Offset = 0,
Start = 0,
Scheme = Name
};
Partition dataPart = new Partition(); Partition dataPart = new Partition
dataPart.Description = "Data volume"; {
dataPart.Size = (ulong)imagePlugin.ImageInfo.sectors * (ulong)imagePlugin.ImageInfo.sectorSize - MemoryUnitDataOff; Description = "Data volume",
dataPart.Length = imagePlugin.ImageInfo.sectors - sysCachePart.Length; Size = (ulong)imagePlugin.ImageInfo.sectors * imagePlugin.ImageInfo.sectorSize - MemoryUnitDataOff,
dataPart.Sequence = 2; Length = imagePlugin.ImageInfo.sectors - sysCachePart.Length,
dataPart.Offset = MemoryUnitDataOff; Sequence = 2,
dataPart.Start = sysCachePart.Length; Offset = MemoryUnitDataOff,
Start = sysCachePart.Length,
Scheme = Name
};
partitions.Add(sysCachePart); partitions.Add(sysCachePart);
partitions.Add(dataPart); partitions.Add(dataPart);
@@ -151,61 +163,82 @@ namespace DiscImageChef.PartPlugins
if(temp == XboxCigam) if(temp == XboxCigam)
{ {
Partition securityPart = new Partition(); Partition securityPart = new Partition
securityPart.Description = "Security sectors"; {
securityPart.Size = Xbox360SecuritySectorLen; Description = "Security sectors",
securityPart.Length = (ulong)(Xbox360SecuritySectorLen / imagePlugin.ImageInfo.sectorSize); Size = Xbox360SecuritySectorLen,
securityPart.Sequence = 1; Length = (ulong)(Xbox360SecuritySectorLen / imagePlugin.ImageInfo.sectorSize),
securityPart.Offset = Xbox360SecuritySectorOff; Sequence = 1,
securityPart.Start = (ulong)(Xbox360SecuritySectorOff / imagePlugin.ImageInfo.sectorSize); Offset = Xbox360SecuritySectorOff,
Start = (ulong)(Xbox360SecuritySectorOff / imagePlugin.ImageInfo.sectorSize),
Scheme = Name
};
Partition sysCachePart = new Partition(); Partition sysCachePart = new Partition
sysCachePart.Description = "System cache"; {
sysCachePart.Size = Xbox360SystemCacheLen; Description = "System cache",
sysCachePart.Length = (ulong)(Xbox360SystemCacheLen / imagePlugin.ImageInfo.sectorSize); Size = Xbox360SystemCacheLen,
sysCachePart.Sequence = 2; Length = (ulong)(Xbox360SystemCacheLen / imagePlugin.ImageInfo.sectorSize),
sysCachePart.Offset = Xbox360SystemCacheOff; Sequence = 2,
sysCachePart.Start = (ulong)(Xbox360SystemCacheOff / imagePlugin.ImageInfo.sectorSize); Offset = Xbox360SystemCacheOff,
Start = (ulong)(Xbox360SystemCacheOff / imagePlugin.ImageInfo.sectorSize),
Scheme = Name
};
Partition gameCachePart = new Partition(); Partition gameCachePart = new Partition
gameCachePart.Description = "Game cache"; {
gameCachePart.Size = Xbox360GameCacheLen; Description = "Game cache",
gameCachePart.Length = (ulong)(Xbox360GameCacheLen / imagePlugin.ImageInfo.sectorSize); Size = Xbox360GameCacheLen,
gameCachePart.Sequence = 3; Length = (ulong)(Xbox360GameCacheLen / imagePlugin.ImageInfo.sectorSize),
gameCachePart.Offset = Xbox360GameCacheOff; Sequence = 3,
gameCachePart.Start = (ulong)(Xbox360GameCacheOff / imagePlugin.ImageInfo.sectorSize); Offset = Xbox360GameCacheOff,
Start = (ulong)(Xbox360GameCacheOff / imagePlugin.ImageInfo.sectorSize),
Scheme = Name
};
Partition sysExtPart = new Partition(); Partition sysExtPart = new Partition
sysExtPart.Description = "System volume"; {
sysExtPart.Size = Xbox368SysExtLen; Description = "System volume",
sysExtPart.Length = (ulong)(Xbox368SysExtLen / imagePlugin.ImageInfo.sectorSize); Size = Xbox368SysExtLen,
sysExtPart.Sequence = 4; Length = (ulong)(Xbox368SysExtLen / imagePlugin.ImageInfo.sectorSize),
sysExtPart.Offset = Xbox368SysExtOff; Sequence = 4,
sysExtPart.Start = (ulong)(Xbox368SysExtOff / imagePlugin.ImageInfo.sectorSize); Offset = Xbox368SysExtOff,
Start = (ulong)(Xbox368SysExtOff / imagePlugin.ImageInfo.sectorSize),
Scheme = Name
};
Partition sysExt2Part = new Partition(); Partition sysExt2Part = new Partition
sysExt2Part.Description = "System volume 2"; {
sysExt2Part.Size = Xbox360SysExt2Len; Description = "System volume 2",
sysExt2Part.Length = (ulong)(Xbox360SysExt2Len / imagePlugin.ImageInfo.sectorSize); Size = Xbox360SysExt2Len,
sysExt2Part.Sequence = 5; Length = (ulong)(Xbox360SysExt2Len / imagePlugin.ImageInfo.sectorSize),
sysExt2Part.Offset = Xbox360SysExt2Off; Sequence = 5,
sysExt2Part.Start = (ulong)(Xbox360SysExt2Off / imagePlugin.ImageInfo.sectorSize); Offset = Xbox360SysExt2Off,
Start = (ulong)(Xbox360SysExt2Off / imagePlugin.ImageInfo.sectorSize),
Scheme = Name
};
Partition xbox1Part = new Partition(); Partition xbox1Part = new Partition
xbox1Part.Description = "Xbox backwards compatibility"; {
xbox1Part.Size = Xbox360CompatLen; Description = "Xbox backwards compatibility",
xbox1Part.Length = (ulong)(Xbox360CompatLen / imagePlugin.ImageInfo.sectorSize); Size = Xbox360CompatLen,
xbox1Part.Sequence = 6; Length = (ulong)(Xbox360CompatLen / imagePlugin.ImageInfo.sectorSize),
xbox1Part.Offset = Xbox360CompatOff; Sequence = 6,
xbox1Part.Start = (ulong)(Xbox360CompatOff / imagePlugin.ImageInfo.sectorSize); Offset = Xbox360CompatOff,
Start = (ulong)(Xbox360CompatOff / imagePlugin.ImageInfo.sectorSize),
Scheme = Name
};
Partition dataPart = new Partition(); Partition dataPart = new Partition
dataPart.Description = "Data volume"; {
dataPart.Sequence = 7; Description = "Data volume",
dataPart.Offset = Xbox360DataOff; Sequence = 7,
dataPart.Start = (ulong)(Xbox360DataOff / imagePlugin.ImageInfo.sectorSize); Offset = Xbox360DataOff,
Start = (ulong)(Xbox360DataOff / imagePlugin.ImageInfo.sectorSize),
Scheme = Name
};
dataPart.Length = imagePlugin.ImageInfo.sectors - dataPart.Start; dataPart.Length = imagePlugin.ImageInfo.sectors - dataPart.Start;
dataPart.Size = (ulong)dataPart.Length * (ulong)imagePlugin.ImageInfo.sectorSize; dataPart.Size = dataPart.Length * imagePlugin.ImageInfo.sectorSize;
partitions.Add(securityPart); partitions.Add(securityPart);
partitions.Add(sysCachePart); partitions.Add(sysCachePart);