mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
* DiscImageChef.DiscImages/CDRWin.cs:
Corrected partition start and length calculations. * DiscImageChef.Filesystems/BFS.cs: Corrected decoding fields. Added supports for boot sector smaller than device size as in some Be CDs. * DiscImageChef/Main.cs: Forgot to define Console.Write()
This commit is contained in:
@@ -1055,6 +1055,8 @@ namespace DiscImageChef.ImagePlugins
|
|||||||
|
|
||||||
for (int i = 0; i < discimage.tracks.Count; i++)
|
for (int i = 0; i < discimage.tracks.Count; i++)
|
||||||
{
|
{
|
||||||
|
ulong index0_len = 0;
|
||||||
|
|
||||||
if (discimage.tracks[i].sequence == 1 && i != 0)
|
if (discimage.tracks[i].sequence == 1 && i != 0)
|
||||||
throw new ImageNotSupportedException("Unordered tracks");
|
throw new ImageNotSupportedException("Unordered tracks");
|
||||||
|
|
||||||
@@ -1111,6 +1113,7 @@ namespace DiscImageChef.ImagePlugins
|
|||||||
|
|
||||||
sector_offset += partition.PartitionSectors;
|
sector_offset += partition.PartitionSectors;
|
||||||
byte_offset += partition.PartitionLength;
|
byte_offset += partition.PartitionLength;
|
||||||
|
index0_len = partition.PartitionSectors;
|
||||||
partitionSequence++;
|
partitionSequence++;
|
||||||
|
|
||||||
if (!offsetmap.ContainsKey(discimage.tracks[i].sequence))
|
if (!offsetmap.ContainsKey(discimage.tracks[i].sequence))
|
||||||
@@ -1135,8 +1138,8 @@ namespace DiscImageChef.ImagePlugins
|
|||||||
partition.PartitionDescription = String.Format("Track {0}.", discimage.tracks[i].sequence);
|
partition.PartitionDescription = String.Format("Track {0}.", discimage.tracks[i].sequence);
|
||||||
partition.PartitionName = discimage.tracks[i].title;
|
partition.PartitionName = discimage.tracks[i].title;
|
||||||
partition.PartitionStartSector = sector_offset;
|
partition.PartitionStartSector = sector_offset;
|
||||||
partition.PartitionLength = (discimage.tracks[i].sectors - (index_one_offset - index_zero_offset)) * discimage.tracks[i].bps;
|
partition.PartitionLength = (discimage.tracks[i].sectors - index0_len) * discimage.tracks[i].bps;
|
||||||
partition.PartitionSectors = (discimage.tracks[i].sectors - (index_one_offset - index_zero_offset));
|
partition.PartitionSectors = (discimage.tracks[i].sectors - index0_len);
|
||||||
partition.PartitionSequence = partitionSequence;
|
partition.PartitionSequence = partitionSequence;
|
||||||
partition.PartitionStart = byte_offset;
|
partition.PartitionStart = byte_offset;
|
||||||
partition.PartitionType = discimage.tracks[i].tracktype;
|
partition.PartitionType = discimage.tracks[i].tracktype;
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
2015-11-09 Natalia Portillo <claunia@claunia.com>
|
||||||
|
|
||||||
|
* CDRWin.cs:
|
||||||
|
Corrected partition start and length calculations.
|
||||||
|
|
||||||
2015-10-19 Natalia Portillo <claunia@claunia.com>
|
2015-10-19 Natalia Portillo <claunia@claunia.com>
|
||||||
|
|
||||||
* DiscImageChef.DiscImages.csproj:
|
* DiscImageChef.DiscImages.csproj:
|
||||||
|
|||||||
@@ -78,6 +78,13 @@ namespace DiscImageChef.Plugins
|
|||||||
|
|
||||||
if (magic == BEFS_MAGIC1 || magic_be == BEFS_MAGIC1)
|
if (magic == BEFS_MAGIC1 || magic_be == BEFS_MAGIC1)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
magic = BitConverter.ToUInt32(sb_sector, 0x220);
|
||||||
|
magic_be = BigEndianBitConverter.ToUInt32(sb_sector, 0x220);
|
||||||
|
|
||||||
|
if (magic == BEFS_MAGIC1 || magic_be == BEFS_MAGIC1)
|
||||||
|
return true;
|
||||||
|
|
||||||
sb_sector = imagePlugin.ReadSector(1 + partitionStart);
|
sb_sector = imagePlugin.ReadSector(1 + partitionStart);
|
||||||
|
|
||||||
magic = BitConverter.ToUInt32(sb_sector, 0x20);
|
magic = BitConverter.ToUInt32(sb_sector, 0x20);
|
||||||
@@ -116,35 +123,47 @@ namespace DiscImageChef.Plugins
|
|||||||
BigEndianBitConverter.IsLittleEndian &= besb.magic1 != BEFS_CIGAM1;
|
BigEndianBitConverter.IsLittleEndian &= besb.magic1 != BEFS_CIGAM1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return;
|
{
|
||||||
|
byte[] temp = imagePlugin.ReadSector(0 + partitionStart);
|
||||||
|
besb.magic1 = BigEndianBitConverter.ToUInt32(temp, 0x220);
|
||||||
|
|
||||||
|
if (besb.magic1 == BEFS_MAGIC1 || besb.magic1 == BEFS_CIGAM1) // There is a boot sector
|
||||||
|
{
|
||||||
|
BigEndianBitConverter.IsLittleEndian &= besb.magic1 != BEFS_CIGAM1;
|
||||||
|
sb_sector = new byte[0x200];
|
||||||
|
Array.Copy(temp, 0x200, sb_sector, 0, 0x200);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Array.Copy(sb_sector, 0x000, name_bytes, 0, 0x20);
|
Array.Copy(sb_sector, 0x000, name_bytes, 0, 0x20);
|
||||||
besb.name = StringHandlers.CToString(name_bytes);
|
besb.name = StringHandlers.CToString(name_bytes);
|
||||||
besb.magic1 = BigEndianBitConverter.ToUInt32(sb_sector, 0x20);
|
besb.magic1 = BigEndianBitConverter.ToUInt32(sb_sector, 0x20);
|
||||||
besb.fs_byte_order = BigEndianBitConverter.ToUInt32(sb_sector, 0x20);
|
besb.fs_byte_order = BigEndianBitConverter.ToUInt32(sb_sector, 0x24);
|
||||||
besb.block_size = BigEndianBitConverter.ToUInt32(sb_sector, 0x20);
|
besb.block_size = BigEndianBitConverter.ToUInt32(sb_sector, 0x28);
|
||||||
besb.block_shift = BigEndianBitConverter.ToUInt32(sb_sector, 0x20);
|
besb.block_shift = BigEndianBitConverter.ToUInt32(sb_sector, 0x2C);
|
||||||
besb.num_blocks = BigEndianBitConverter.ToInt64(sb_sector, 0x20);
|
besb.num_blocks = BigEndianBitConverter.ToInt64(sb_sector, 0x30);
|
||||||
besb.used_blocks = BigEndianBitConverter.ToInt64(sb_sector, 0x20);
|
besb.used_blocks = BigEndianBitConverter.ToInt64(sb_sector, 0x38);
|
||||||
besb.inode_size = BigEndianBitConverter.ToInt32(sb_sector, 0x20);
|
besb.inode_size = BigEndianBitConverter.ToInt32(sb_sector, 0x40);
|
||||||
besb.magic2 = BigEndianBitConverter.ToUInt32(sb_sector, 0x20);
|
besb.magic2 = BigEndianBitConverter.ToUInt32(sb_sector, 0x44);
|
||||||
besb.blocks_per_ag = BigEndianBitConverter.ToInt32(sb_sector, 0x20);
|
besb.blocks_per_ag = BigEndianBitConverter.ToInt32(sb_sector, 0x48);
|
||||||
besb.ag_shift = BigEndianBitConverter.ToInt32(sb_sector, 0x20);
|
besb.ag_shift = BigEndianBitConverter.ToInt32(sb_sector, 0x4C);
|
||||||
besb.num_ags = BigEndianBitConverter.ToInt32(sb_sector, 0x20);
|
besb.num_ags = BigEndianBitConverter.ToInt32(sb_sector, 0x50);
|
||||||
besb.flags = BigEndianBitConverter.ToUInt32(sb_sector, 0x20);
|
besb.flags = BigEndianBitConverter.ToUInt32(sb_sector, 0x54);
|
||||||
besb.log_blocks_ag = BigEndianBitConverter.ToInt32(sb_sector, 0x20);
|
besb.log_blocks_ag = BigEndianBitConverter.ToInt32(sb_sector, 0x58);
|
||||||
besb.log_blocks_start = BigEndianBitConverter.ToUInt16(sb_sector, 0x20);
|
besb.log_blocks_start = BigEndianBitConverter.ToUInt16(sb_sector, 0x5C);
|
||||||
besb.log_blocks_len = BigEndianBitConverter.ToUInt16(sb_sector, 0x20);
|
besb.log_blocks_len = BigEndianBitConverter.ToUInt16(sb_sector, 0x5E);
|
||||||
besb.log_start = BigEndianBitConverter.ToInt64(sb_sector, 0x20);
|
besb.log_start = BigEndianBitConverter.ToInt64(sb_sector, 0x60);
|
||||||
besb.log_end = BigEndianBitConverter.ToInt64(sb_sector, 0x20);
|
besb.log_end = BigEndianBitConverter.ToInt64(sb_sector, 0x68);
|
||||||
besb.magic3 = BigEndianBitConverter.ToUInt32(sb_sector, 0x20);
|
besb.magic3 = BigEndianBitConverter.ToUInt32(sb_sector, 0x70);
|
||||||
besb.root_dir_ag = BigEndianBitConverter.ToInt32(sb_sector, 0x20);
|
besb.root_dir_ag = BigEndianBitConverter.ToInt32(sb_sector, 0x74);
|
||||||
besb.root_dir_start = BigEndianBitConverter.ToUInt16(sb_sector, 0x20);
|
besb.root_dir_start = BigEndianBitConverter.ToUInt16(sb_sector, 0x78);
|
||||||
besb.root_dir_len = BigEndianBitConverter.ToUInt16(sb_sector, 0x20);
|
besb.root_dir_len = BigEndianBitConverter.ToUInt16(sb_sector, 0x7A);
|
||||||
besb.indices_ag = BigEndianBitConverter.ToInt32(sb_sector, 0x20);
|
besb.indices_ag = BigEndianBitConverter.ToInt32(sb_sector, 0x7C);
|
||||||
besb.indices_start = BigEndianBitConverter.ToUInt16(sb_sector, 0x20);
|
besb.indices_start = BigEndianBitConverter.ToUInt16(sb_sector, 0x80);
|
||||||
besb.indices_len = BigEndianBitConverter.ToUInt16(sb_sector, 0x20);
|
besb.indices_len = BigEndianBitConverter.ToUInt16(sb_sector, 0x82);
|
||||||
|
|
||||||
if (!BigEndianBitConverter.IsLittleEndian) // Big-endian filesystem
|
if (!BigEndianBitConverter.IsLittleEndian) // Big-endian filesystem
|
||||||
sb.AppendLine("Big-endian BeFS");
|
sb.AppendLine("Big-endian BeFS");
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
2015-11-09 Natalia Portillo <claunia@claunia.com>
|
||||||
|
|
||||||
|
* BFS.cs:
|
||||||
|
Corrected decoding fields.
|
||||||
|
Added supports for boot sector smaller than device size as in
|
||||||
|
some Be CDs.
|
||||||
|
|
||||||
2015-10-19 Natalia Portillo <claunia@claunia.com>
|
2015-10-19 Natalia Portillo <claunia@claunia.com>
|
||||||
|
|
||||||
* DiscImageChef.Filesystems.csproj:
|
* DiscImageChef.Filesystems.csproj:
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
|
2015-11-09 Natalia Portillo <claunia@claunia.com>
|
||||||
|
|
||||||
|
* Main.cs:
|
||||||
|
Forgot to define Console.Write()
|
||||||
|
|
||||||
2015-11-05 Natalia Portillo <claunia@claunia.com>
|
2015-11-05 Natalia Portillo <claunia@claunia.com>
|
||||||
|
|
||||||
* Commands/DeviceInfo.cs:
|
* Commands/DeviceInfo.cs:
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ namespace DiscImageChef
|
|||||||
string AssemblyCopyright = ((AssemblyCopyrightAttribute) attributes[0]).Copyright;
|
string AssemblyCopyright = ((AssemblyCopyrightAttribute) attributes[0]).Copyright;
|
||||||
|
|
||||||
DicConsole.WriteLineEvent += System.Console.WriteLine;
|
DicConsole.WriteLineEvent += System.Console.WriteLine;
|
||||||
|
DicConsole.WriteEvent += System.Console.Write;
|
||||||
DicConsole.ErrorWriteLineEvent += System.Console.Error.WriteLine;
|
DicConsole.ErrorWriteLineEvent += System.Console.Error.WriteLine;
|
||||||
|
|
||||||
DicConsole.WriteLine("{0} {1}", AssemblyTitle, AssemblyVersion);
|
DicConsole.WriteLine("{0} {1}", AssemblyTitle, AssemblyVersion);
|
||||||
|
|||||||
Reference in New Issue
Block a user