mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
* DiscImageChef.DiscImages/DiskCopy42.cs:
Lisa Twiggies and Macintosh Twiggies use a different track order. Detect a Macintosh File System to know which re-ordering to use. * DiscImageChef.Filesystems/AppleMFS/Dir.cs: Remove spurious debug leftover. "Entries are always an integral number of words" solved. * DiscImageChef.Filesystems/AppleMFS/Super.cs: When filling volume block map, check we are not going out of bounds. * DiscImageChef.Partitions/NeXT.cs: * DiscImageChef.Filesystems/HPFS.cs: * DiscImageChef.Filesystems/SysV.cs: Do not try to read past device.
This commit is contained in:
@@ -95,7 +95,6 @@ namespace DiscImageChef.Filesystems.AppleMFS
|
||||
Array.Copy(directoryBlocks, offset + 50, entry.flNam, 0, entry.flNam.Length);
|
||||
lowerFilename = GetStringFromPascal(entry.flNam).ToLowerInvariant().Replace('/', ':');
|
||||
|
||||
|
||||
if(entry.flFlags.HasFlag(MFS_FileFlags.Used) && !idToFilename.ContainsKey(entry.flFlNum) &&
|
||||
!idToEntry.ContainsKey(entry.flFlNum) && !filenameToId.ContainsKey(lowerFilename) &&
|
||||
entry.flFlNum > 0)
|
||||
@@ -104,7 +103,6 @@ namespace DiscImageChef.Filesystems.AppleMFS
|
||||
idToFilename.Add(entry.flFlNum, GetStringFromPascal(entry.flNam).Replace('/', ':'));
|
||||
filenameToId.Add(lowerFilename, entry.flFlNum);
|
||||
|
||||
System.Console.WriteLine("{0}", offset);
|
||||
DicConsole.DebugWriteLine("DEBUG (AppleMFS plugin)", "entry.flFlags = {0}", entry.flFlags);
|
||||
DicConsole.DebugWriteLine("DEBUG (AppleMFS plugin)", "entry.flTyp = {0}", entry.flTyp);
|
||||
DicConsole.DebugWriteLine("DEBUG (AppleMFS plugin)", "entry.flFlNum = {0}", entry.flFlNum);
|
||||
@@ -120,6 +118,12 @@ namespace DiscImageChef.Filesystems.AppleMFS
|
||||
}
|
||||
|
||||
offset += (50 + entry.flNam.Length);
|
||||
|
||||
// "Entries are always an integral number of words"
|
||||
if((offset % 2) != 0)
|
||||
offset++;
|
||||
|
||||
// TODO: "Entries don't cross logical block boundaries"
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -84,9 +84,16 @@ namespace DiscImageChef.Filesystems.AppleMFS
|
||||
blockMap = new uint[volMDB.drNmAlBlks + 2 + 1];
|
||||
for(int i = 2; i < volMDB.drNmAlBlks + 2; i+=8)
|
||||
{
|
||||
uint tmp1 = BigEndianBitConverter.ToUInt32(blockMapBytes, offset);
|
||||
uint tmp2 = BigEndianBitConverter.ToUInt32(blockMapBytes, offset + 4);
|
||||
uint tmp3 = BigEndianBitConverter.ToUInt32(blockMapBytes, offset + 8);
|
||||
uint tmp1 = 0;
|
||||
uint tmp2 = 0;
|
||||
uint tmp3 = 0;
|
||||
|
||||
if(offset + 4 <= blockMapBytes.Length)
|
||||
tmp1 = BigEndianBitConverter.ToUInt32(blockMapBytes, offset);
|
||||
if(offset + 4 + 4 <= blockMapBytes.Length)
|
||||
tmp2 = BigEndianBitConverter.ToUInt32(blockMapBytes, offset + 4);
|
||||
if(offset + 8 + 4 <= blockMapBytes.Length)
|
||||
tmp3 = BigEndianBitConverter.ToUInt32(blockMapBytes, offset + 8);
|
||||
|
||||
if(i < blockMap.Length)
|
||||
blockMap[i] = (tmp1 & 0xFFF00000) >> 20;
|
||||
|
||||
@@ -1,3 +1,14 @@
|
||||
2016-08-01 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* Dir.cs: Remove spurious debug leftover.
|
||||
"Entries are always an integral number of words" solved.
|
||||
|
||||
* Super.cs: When filling volume block map, check we are not
|
||||
going out of bounds.
|
||||
|
||||
* HPFS.cs:
|
||||
* SysV.cs: Do not try to read past device.
|
||||
|
||||
2016-08-01 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* Dir.cs:
|
||||
|
||||
@@ -56,6 +56,9 @@ namespace DiscImageChef.Filesystems
|
||||
if((2 + partitionStart) >= imagePlugin.GetSectors())
|
||||
return false;
|
||||
|
||||
if(imagePlugin.ImageInfo.sectors <= 16)
|
||||
return false;
|
||||
|
||||
uint magic1, magic2;
|
||||
|
||||
byte[] hpfs_sb_sector = imagePlugin.ReadSector(16 + partitionStart); // Seek to superblock, on logical sector 16
|
||||
|
||||
@@ -109,6 +109,9 @@ namespace DiscImageChef.Filesystems
|
||||
// Superblock can start on 0x000, 0x200, 0x600 and 0x800, not aligned, so we assume 16 (128 bytes/sector) sectors as a safe value
|
||||
for(int i = 0; i <= 16; i++)
|
||||
{
|
||||
if(i + sb_size_in_sectors >= (int)imagePlugin.ImageInfo.sectors)
|
||||
break;
|
||||
|
||||
byte[] sb_sector = imagePlugin.ReadSectors((ulong)i + partitionStart, sb_size_in_sectors);
|
||||
|
||||
magic = BitConverter.ToUInt32(sb_sector, 0x3F8); // XENIX magic location
|
||||
|
||||
Reference in New Issue
Block a user