mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
* TODO:
* README.md: * DiscImageChef.Partitions/GPT.cs: * DiscImageChef.Partitions/DiscImageChef.Partitions.csproj: Added support for EFI GPT. Fixes #8. * commandline: * DiscImageChef.Decoders/SCSI/Sense.cs: Corrected handling when sense contains multiple repeated sense codes, in a not clean way (just ignoring repeats). * DiscImageChef.Filesystems/Acorn.cs: Added exception catching and unsigned values to correct Acorn DiscRecord structure. Fixes #34 * DiscImageChef/Commands/DeviceReport.cs: Check for 36 blocks in long block search in all cases. * DiscImageChef/Commands/DumpMedia.cs: Only try the persistent pass one time. If it didn't correct in the previous cycle it won't magically do now. Sort unreadalbe sectors before printing them.
This commit is contained in:
@@ -67,18 +67,18 @@ namespace DiscImageChef.Plugins
|
||||
public byte bootoption;
|
||||
public byte lowsector;
|
||||
public byte nzones;
|
||||
public short zone_spare;
|
||||
public int root;
|
||||
public ushort zone_spare;
|
||||
public uint root;
|
||||
public uint disc_size;
|
||||
public short disc_id;
|
||||
public ushort disc_id;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)]
|
||||
public byte[] disc_name;
|
||||
public int disc_type;
|
||||
public uint disc_type;
|
||||
public uint disc_size_high;
|
||||
public byte flags;
|
||||
public byte nzones_high;
|
||||
public int format_version;
|
||||
public int root_size;
|
||||
public uint format_version;
|
||||
public uint root_size;
|
||||
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)]
|
||||
public byte[] reserved;
|
||||
}
|
||||
@@ -96,10 +96,18 @@ namespace DiscImageChef.Plugins
|
||||
sbSector = ADFS_SB_POS / imagePlugin.GetSectorSize();
|
||||
|
||||
byte[] sector = imagePlugin.ReadSector(sbSector + partitionStart);
|
||||
DiscRecord drSb;
|
||||
|
||||
GCHandle handle = GCHandle.Alloc(sector, GCHandleType.Pinned);
|
||||
DiscRecord drSb = (DiscRecord)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(DiscRecord));
|
||||
handle.Free();
|
||||
try
|
||||
{
|
||||
GCHandle handle = GCHandle.Alloc(sector, GCHandleType.Pinned);
|
||||
drSb = (DiscRecord)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(DiscRecord));
|
||||
handle.Free();
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (drSb.log2secsize < 8 || drSb.log2secsize > 10)
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user