mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
On GPT, corrected reading when total entries are less than a whole
sector size.
This commit is contained in:
@@ -113,7 +113,7 @@ namespace DiscImageChef.PartPlugins
|
|||||||
if(hdr.signature != GptMagic)
|
if(hdr.signature != GptMagic)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if(hdr.myLBA != 1)
|
if(hdr.myLBA != 1 + sectorOffset)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
uint divisor, modulo, sectorSize;
|
uint divisor, modulo, sectorSize;
|
||||||
@@ -132,6 +132,8 @@ namespace DiscImageChef.PartPlugins
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint totalEntriesSectors = (hdr.entries * hdr.entriesSize) / imagePlugin.GetSectorSize();
|
uint totalEntriesSectors = (hdr.entries * hdr.entriesSize) / imagePlugin.GetSectorSize();
|
||||||
|
if((hdr.entries * hdr.entriesSize) % imagePlugin.GetSectorSize() > 0)
|
||||||
|
totalEntriesSectors++;
|
||||||
|
|
||||||
byte[] temp = imagePlugin.ReadSectors(hdr.entryLBA / divisor, totalEntriesSectors + modulo);
|
byte[] temp = imagePlugin.ReadSectors(hdr.entryLBA / divisor, totalEntriesSectors + modulo);
|
||||||
byte[] entriesBytes = new byte[temp.Length - (modulo * 512)];
|
byte[] entriesBytes = new byte[temp.Length - (modulo * 512)];
|
||||||
|
|||||||
Reference in New Issue
Block a user