mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Unlike what Inside Macintosh says, some implementations create
a Partition Map without a Driver Descriptor Map preceding it.
This commit is contained in:
@@ -93,36 +93,36 @@ namespace DiscImageChef.PartPlugins
|
|||||||
DicConsole.DebugWriteLine("AppleMap Plugin", "ddm.sbData = 0x{0:X8}", ddm.sbData);
|
DicConsole.DebugWriteLine("AppleMap Plugin", "ddm.sbData = 0x{0:X8}", ddm.sbData);
|
||||||
DicConsole.DebugWriteLine("AppleMap Plugin", "ddm.sbDrvrCount = {0}", ddm.sbDrvrCount);
|
DicConsole.DebugWriteLine("AppleMap Plugin", "ddm.sbDrvrCount = {0}", ddm.sbDrvrCount);
|
||||||
|
|
||||||
if(ddm.sbSig != DDM_MAGIC)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
uint sequence = 0;
|
uint sequence = 0;
|
||||||
|
|
||||||
if(ddm.sbDrvrCount < max_drivers)
|
if(ddm.sbSig == DDM_MAGIC)
|
||||||
{
|
{
|
||||||
ddm.sbMap = new AppleDriverEntry[ddm.sbDrvrCount];
|
if(ddm.sbDrvrCount < max_drivers)
|
||||||
for(int i = 0; i < ddm.sbDrvrCount; i++)
|
|
||||||
{
|
{
|
||||||
byte[] tmp = new byte[8];
|
ddm.sbMap = new AppleDriverEntry[ddm.sbDrvrCount];
|
||||||
Array.Copy(ddm_sector, 18 + i * 8, tmp, 0, 8);
|
for(int i = 0; i < ddm.sbDrvrCount; i++)
|
||||||
ddm.sbMap[i] = BigEndianMarshal.ByteArrayToStructureBigEndian<AppleDriverEntry>(tmp);
|
|
||||||
DicConsole.DebugWriteLine("AppleMap Plugin", "ddm.sbMap[{1}].ddBlock = {0}", ddm.sbMap[i].ddBlock, i);
|
|
||||||
DicConsole.DebugWriteLine("AppleMap Plugin", "ddm.sbMap[{1}].ddSize = {0}", ddm.sbMap[i].ddSize, i);
|
|
||||||
DicConsole.DebugWriteLine("AppleMap Plugin", "ddm.sbMap[{1}].ddType = {0}", ddm.sbMap[i].ddType, i);
|
|
||||||
|
|
||||||
CommonTypes.Partition part = new CommonTypes.Partition()
|
|
||||||
{
|
{
|
||||||
PartitionLength = (ulong)(ddm.sbMap[i].ddSize * 512),
|
byte[] tmp = new byte[8];
|
||||||
PartitionSectors = (ulong)((ddm.sbMap[i].ddSize * 512) / sector_size),
|
Array.Copy(ddm_sector, 18 + i * 8, tmp, 0, 8);
|
||||||
PartitionSequence = sequence,
|
ddm.sbMap[i] = BigEndianMarshal.ByteArrayToStructureBigEndian<AppleDriverEntry>(tmp);
|
||||||
PartitionStart = ddm.sbMap[i].ddBlock * sector_size,
|
DicConsole.DebugWriteLine("AppleMap Plugin", "ddm.sbMap[{1}].ddBlock = {0}", ddm.sbMap[i].ddBlock, i);
|
||||||
PartitionStartSector = ddm.sbMap[i].ddBlock,
|
DicConsole.DebugWriteLine("AppleMap Plugin", "ddm.sbMap[{1}].ddSize = {0}", ddm.sbMap[i].ddSize, i);
|
||||||
PartitionType = "Apple_Driver"
|
DicConsole.DebugWriteLine("AppleMap Plugin", "ddm.sbMap[{1}].ddType = {0}", ddm.sbMap[i].ddType, i);
|
||||||
};
|
|
||||||
|
|
||||||
partitions.Add(part);
|
CommonTypes.Partition part = new CommonTypes.Partition()
|
||||||
|
{
|
||||||
|
PartitionLength = (ulong)(ddm.sbMap[i].ddSize * 512),
|
||||||
|
PartitionSectors = (ulong)((ddm.sbMap[i].ddSize * 512) / sector_size),
|
||||||
|
PartitionSequence = sequence,
|
||||||
|
PartitionStart = ddm.sbMap[i].ddBlock * sector_size,
|
||||||
|
PartitionStartSector = ddm.sbMap[i].ddBlock,
|
||||||
|
PartitionType = "Apple_Driver"
|
||||||
|
};
|
||||||
|
|
||||||
sequence++;
|
partitions.Add(part);
|
||||||
|
|
||||||
|
sequence++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,7 +167,7 @@ namespace DiscImageChef.PartPlugins
|
|||||||
sequence++;
|
sequence++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return partitions.Count > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
AppleMapPartitionEntry entry;
|
AppleMapPartitionEntry entry;
|
||||||
@@ -203,7 +203,7 @@ namespace DiscImageChef.PartPlugins
|
|||||||
sectors_to_read = entry_count + 2;
|
sectors_to_read = entry_count + 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return true;
|
return partitions.Count > 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -218,7 +218,7 @@ namespace DiscImageChef.PartPlugins
|
|||||||
sectors_to_read = entry_count + 2;
|
sectors_to_read = entry_count + 2;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return true;
|
return partitions.Count > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
byte[] entries = imagePlugin.ReadSectors(0, sectors_to_read);
|
byte[] entries = imagePlugin.ReadSectors(0, sectors_to_read);
|
||||||
@@ -308,7 +308,7 @@ namespace DiscImageChef.PartPlugins
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return partitions.Count > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||||
|
|||||||
Reference in New Issue
Block a user