mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Invert 'if' statement to reduce nesting.
This commit is contained in:
Submodule Aaru.Checksums updated: 3429b9012b...29c9f29554
Submodule Aaru.CommonTypes updated: 47294b2f62...d841ec2800
@@ -319,12 +319,12 @@ public class TeleDiskLzh
|
|||||||
|
|
||||||
for(i = 0; i < T; i++)
|
for(i = 0; i < T; i++)
|
||||||
{
|
{
|
||||||
if(_son[i] >= T)
|
if(_son[i] < T)
|
||||||
{
|
continue;
|
||||||
_freq[j] = (ushort)((_freq[i] + 1) / 2);
|
|
||||||
_son[j] = _son[i];
|
_freq[j] = (ushort)((_freq[i] + 1) / 2);
|
||||||
j++;
|
_son[j] = _son[i];
|
||||||
}
|
j++;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* make a tree : first, connect children nodes */
|
/* make a tree : first, connect children nodes */
|
||||||
|
|||||||
Submodule Aaru.Decoders updated: 99e85ca762...629ed3dcd9
@@ -386,14 +386,14 @@ public sealed partial class FAT
|
|||||||
{
|
{
|
||||||
for(var c = 0; c < 11; c++)
|
for(var c = 0; c < 11; c++)
|
||||||
{
|
{
|
||||||
if(rootDir[c + e] < 0x20 && rootDir[c + e] != 0x00 && rootDir[c + e] != 0x05 ||
|
if((rootDir[c + e] >= 0x20 || rootDir[c + e] == 0x00 || rootDir[c + e] == 0x05) &&
|
||||||
rootDir[c + e] == 0xFF ||
|
rootDir[c + e] != 0xFF &&
|
||||||
rootDir[c + e] == 0x2E)
|
rootDir[c + e] != 0x2E)
|
||||||
{
|
continue;
|
||||||
validRootDir = false;
|
|
||||||
|
|
||||||
break;
|
validRootDir = false;
|
||||||
}
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!validRootDir)
|
if(!validRootDir)
|
||||||
|
|||||||
@@ -331,14 +331,14 @@ public sealed partial class FAT
|
|||||||
{
|
{
|
||||||
for(var c = 0; c < 11; c++)
|
for(var c = 0; c < 11; c++)
|
||||||
{
|
{
|
||||||
if(rootDir[c + e] < 0x20 && rootDir[c + e] != 0x00 && rootDir[c + e] != 0x05 ||
|
if((rootDir[c + e] >= 0x20 || rootDir[c + e] == 0x00 || rootDir[c + e] == 0x05) &&
|
||||||
rootDir[c + e] == 0xFF ||
|
rootDir[c + e] != 0xFF &&
|
||||||
rootDir[c + e] == 0x2E)
|
rootDir[c + e] != 0x2E)
|
||||||
{
|
continue;
|
||||||
validRootDir = false;
|
|
||||||
|
|
||||||
break;
|
validRootDir = false;
|
||||||
}
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!validRootDir)
|
if(!validRootDir)
|
||||||
|
|||||||
@@ -126,50 +126,50 @@ public sealed partial class NintendoPlugin
|
|||||||
|
|
||||||
for(var i = 0; i < fields.FirstPartitions.Length; i++)
|
for(var i = 0; i < fields.FirstPartitions.Length; i++)
|
||||||
{
|
{
|
||||||
if(offset1 + i * 8 + 8 < 0x50000)
|
if(offset1 + i * 8 + 8 >= 0x50000)
|
||||||
{
|
continue;
|
||||||
fields.FirstPartitions[i].Offset =
|
|
||||||
BigEndianBitConverter.ToUInt32(header, (int)(offset1 + i * 8 + 0)) << 2;
|
|
||||||
|
|
||||||
fields.FirstPartitions[i].Type =
|
fields.FirstPartitions[i].Offset =
|
||||||
BigEndianBitConverter.ToUInt32(header, (int)(offset1 + i * 8 + 4));
|
BigEndianBitConverter.ToUInt32(header, (int)(offset1 + i * 8 + 0)) << 2;
|
||||||
}
|
|
||||||
|
fields.FirstPartitions[i].Type =
|
||||||
|
BigEndianBitConverter.ToUInt32(header, (int)(offset1 + i * 8 + 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
for(var i = 0; i < fields.SecondPartitions.Length; i++)
|
for(var i = 0; i < fields.SecondPartitions.Length; i++)
|
||||||
{
|
{
|
||||||
if(offset1 + i * 8 + 8 < 0x50000)
|
if(offset1 + i * 8 + 8 >= 0x50000)
|
||||||
{
|
continue;
|
||||||
fields.FirstPartitions[i].Offset =
|
|
||||||
BigEndianBitConverter.ToUInt32(header, (int)(offset2 + i * 8 + 0)) << 2;
|
|
||||||
|
|
||||||
fields.FirstPartitions[i].Type =
|
fields.FirstPartitions[i].Offset =
|
||||||
BigEndianBitConverter.ToUInt32(header, (int)(offset2 + i * 8 + 4));
|
BigEndianBitConverter.ToUInt32(header, (int)(offset2 + i * 8 + 0)) << 2;
|
||||||
}
|
|
||||||
|
fields.FirstPartitions[i].Type =
|
||||||
|
BigEndianBitConverter.ToUInt32(header, (int)(offset2 + i * 8 + 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
for(var i = 0; i < fields.ThirdPartitions.Length; i++)
|
for(var i = 0; i < fields.ThirdPartitions.Length; i++)
|
||||||
{
|
{
|
||||||
if(offset1 + i * 8 + 8 < 0x50000)
|
if(offset1 + i * 8 + 8 >= 0x50000)
|
||||||
{
|
continue;
|
||||||
fields.FirstPartitions[i].Offset =
|
|
||||||
BigEndianBitConverter.ToUInt32(header, (int)(offset3 + i * 8 + 0)) << 2;
|
|
||||||
|
|
||||||
fields.FirstPartitions[i].Type =
|
fields.FirstPartitions[i].Offset =
|
||||||
BigEndianBitConverter.ToUInt32(header, (int)(offset3 + i * 8 + 4));
|
BigEndianBitConverter.ToUInt32(header, (int)(offset3 + i * 8 + 0)) << 2;
|
||||||
}
|
|
||||||
|
fields.FirstPartitions[i].Type =
|
||||||
|
BigEndianBitConverter.ToUInt32(header, (int)(offset3 + i * 8 + 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
for(var i = 0; i < fields.FourthPartitions.Length; i++)
|
for(var i = 0; i < fields.FourthPartitions.Length; i++)
|
||||||
{
|
{
|
||||||
if(offset1 + i * 8 + 8 < 0x50000)
|
if(offset1 + i * 8 + 8 >= 0x50000)
|
||||||
{
|
continue;
|
||||||
fields.FirstPartitions[i].Offset =
|
|
||||||
BigEndianBitConverter.ToUInt32(header, (int)(offset4 + i * 8 + 0)) << 2;
|
|
||||||
|
|
||||||
fields.FirstPartitions[i].Type =
|
fields.FirstPartitions[i].Offset =
|
||||||
BigEndianBitConverter.ToUInt32(header, (int)(offset4 + i * 8 + 4));
|
BigEndianBitConverter.ToUInt32(header, (int)(offset4 + i * 8 + 0)) << 2;
|
||||||
}
|
|
||||||
|
fields.FirstPartitions[i].Type =
|
||||||
|
BigEndianBitConverter.ToUInt32(header, (int)(offset4 + i * 8 + 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
fields.Region = header[0x4E000];
|
fields.Region = header[0x4E000];
|
||||||
|
|||||||
@@ -644,55 +644,54 @@ public sealed class MainWindowViewModel : ViewModelBase
|
|||||||
|
|
||||||
foreach(string pluginName in idPlugins)
|
foreach(string pluginName in idPlugins)
|
||||||
{
|
{
|
||||||
if(plugins.Filesystems.TryGetValue(pluginName, out pluginType))
|
if(!plugins.Filesystems.TryGetValue(pluginName, out pluginType))
|
||||||
|
continue;
|
||||||
|
if(Activator.CreateInstance(pluginType) is not IFilesystem fs)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
fs.GetInformation(imageFormat, partition, null, out string information,
|
||||||
|
out CommonTypes.AaruMetadata.FileSystem fsMetadata);
|
||||||
|
|
||||||
|
var rofs = fs as IReadOnlyFilesystem;
|
||||||
|
|
||||||
|
if(rofs != null)
|
||||||
{
|
{
|
||||||
if(Activator.CreateInstance(pluginType) is not IFilesystem fs)
|
ErrorNumber error =
|
||||||
continue;
|
rofs.Mount(imageFormat, partition, null,
|
||||||
|
new Dictionary<string, string>(), null);
|
||||||
|
|
||||||
fs.GetInformation(imageFormat, partition, null, out string information,
|
if(error != ErrorNumber.NoError)
|
||||||
out CommonTypes.AaruMetadata.FileSystem fsMetadata);
|
rofs = null;
|
||||||
|
|
||||||
var rofs = fs as IReadOnlyFilesystem;
|
|
||||||
|
|
||||||
if(rofs != null)
|
|
||||||
{
|
|
||||||
ErrorNumber error =
|
|
||||||
rofs.Mount(imageFormat, partition, null,
|
|
||||||
new Dictionary<string, string>(), null);
|
|
||||||
|
|
||||||
if(error != ErrorNumber.NoError)
|
|
||||||
rofs = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
var filesystemModel = new FileSystemModel
|
|
||||||
{
|
|
||||||
VolumeName = rofs?.Metadata.VolumeName is null
|
|
||||||
? fsMetadata.VolumeName is null
|
|
||||||
? $"{fsMetadata.Type}"
|
|
||||||
: $"{fsMetadata.VolumeName} ({fsMetadata.Type})"
|
|
||||||
: $"{rofs.Metadata.VolumeName} ({rofs.Metadata.Type})",
|
|
||||||
Filesystem = fs,
|
|
||||||
ReadOnlyFilesystem = rofs,
|
|
||||||
ViewModel = new FileSystemViewModel(rofs?.Metadata ?? fsMetadata,
|
|
||||||
information)
|
|
||||||
};
|
|
||||||
|
|
||||||
// TODO: Trap expanding item
|
|
||||||
if(rofs != null)
|
|
||||||
{
|
|
||||||
filesystemModel.Roots.Add(new SubdirectoryModel
|
|
||||||
{
|
|
||||||
Name = "/",
|
|
||||||
Path = "",
|
|
||||||
Plugin = rofs
|
|
||||||
});
|
|
||||||
|
|
||||||
Statistics.AddCommand("ls");
|
|
||||||
}
|
|
||||||
|
|
||||||
Statistics.AddFilesystem(rofs?.Metadata.Type ?? fsMetadata.Type);
|
|
||||||
partitionModel.FileSystems.Add(filesystemModel);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var filesystemModel = new FileSystemModel
|
||||||
|
{
|
||||||
|
VolumeName = rofs?.Metadata.VolumeName is null
|
||||||
|
? fsMetadata.VolumeName is null
|
||||||
|
? $"{fsMetadata.Type}"
|
||||||
|
: $"{fsMetadata.VolumeName} ({fsMetadata.Type})"
|
||||||
|
: $"{rofs.Metadata.VolumeName} ({rofs.Metadata.Type})",
|
||||||
|
Filesystem = fs,
|
||||||
|
ReadOnlyFilesystem = rofs,
|
||||||
|
ViewModel = new FileSystemViewModel(rofs?.Metadata ?? fsMetadata,
|
||||||
|
information)
|
||||||
|
};
|
||||||
|
|
||||||
|
// TODO: Trap expanding item
|
||||||
|
if(rofs != null)
|
||||||
|
{
|
||||||
|
filesystemModel.Roots.Add(new SubdirectoryModel
|
||||||
|
{
|
||||||
|
Name = "/",
|
||||||
|
Path = "",
|
||||||
|
Plugin = rofs
|
||||||
|
});
|
||||||
|
|
||||||
|
Statistics.AddCommand("ls");
|
||||||
|
}
|
||||||
|
|
||||||
|
Statistics.AddFilesystem(rofs?.Metadata.Type ?? fsMetadata.Type);
|
||||||
|
partitionModel.FileSystems.Add(filesystemModel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -722,53 +721,52 @@ public sealed class MainWindowViewModel : ViewModelBase
|
|||||||
|
|
||||||
foreach(string pluginName in idPlugins)
|
foreach(string pluginName in idPlugins)
|
||||||
{
|
{
|
||||||
if(plugins.Filesystems.TryGetValue(pluginName, out pluginType))
|
if(!plugins.Filesystems.TryGetValue(pluginName, out pluginType))
|
||||||
|
continue;
|
||||||
|
if(Activator.CreateInstance(pluginType) is not IFilesystem fs)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
fs.GetInformation(imageFormat, wholePart, null, out string information,
|
||||||
|
out CommonTypes.AaruMetadata.FileSystem fsMetadata);
|
||||||
|
|
||||||
|
var rofs = fs as IReadOnlyFilesystem;
|
||||||
|
|
||||||
|
if(rofs != null)
|
||||||
{
|
{
|
||||||
if(Activator.CreateInstance(pluginType) is not IFilesystem fs)
|
ErrorNumber error = rofs.Mount(imageFormat, wholePart, null,
|
||||||
continue;
|
new Dictionary<string, string>(), null);
|
||||||
|
|
||||||
fs.GetInformation(imageFormat, wholePart, null, out string information,
|
if(error != ErrorNumber.NoError)
|
||||||
out CommonTypes.AaruMetadata.FileSystem fsMetadata);
|
rofs = null;
|
||||||
|
|
||||||
var rofs = fs as IReadOnlyFilesystem;
|
|
||||||
|
|
||||||
if(rofs != null)
|
|
||||||
{
|
|
||||||
ErrorNumber error = rofs.Mount(imageFormat, wholePart, null,
|
|
||||||
new Dictionary<string, string>(), null);
|
|
||||||
|
|
||||||
if(error != ErrorNumber.NoError)
|
|
||||||
rofs = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
var filesystemModel = new FileSystemModel
|
|
||||||
{
|
|
||||||
VolumeName = rofs?.Metadata.VolumeName is null
|
|
||||||
? fsMetadata.VolumeName is null
|
|
||||||
? $"{fsMetadata.Type}"
|
|
||||||
: $"{fsMetadata.VolumeName} ({fsMetadata.Type})"
|
|
||||||
: $"{rofs.Metadata.VolumeName} ({rofs.Metadata.Type})",
|
|
||||||
Filesystem = fs,
|
|
||||||
ReadOnlyFilesystem = rofs,
|
|
||||||
ViewModel = new FileSystemViewModel(rofs?.Metadata ?? fsMetadata, information)
|
|
||||||
};
|
|
||||||
|
|
||||||
// TODO: Trap expanding item
|
|
||||||
if(rofs != null)
|
|
||||||
{
|
|
||||||
filesystemModel.Roots.Add(new SubdirectoryModel
|
|
||||||
{
|
|
||||||
Name = "/",
|
|
||||||
Path = "",
|
|
||||||
Plugin = rofs
|
|
||||||
});
|
|
||||||
|
|
||||||
Statistics.AddCommand("ls");
|
|
||||||
}
|
|
||||||
|
|
||||||
Statistics.AddFilesystem(rofs?.Metadata.Type ?? fsMetadata.Type);
|
|
||||||
imageModel.PartitionSchemesOrFileSystems.Add(filesystemModel);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var filesystemModel = new FileSystemModel
|
||||||
|
{
|
||||||
|
VolumeName = rofs?.Metadata.VolumeName is null
|
||||||
|
? fsMetadata.VolumeName is null
|
||||||
|
? $"{fsMetadata.Type}"
|
||||||
|
: $"{fsMetadata.VolumeName} ({fsMetadata.Type})"
|
||||||
|
: $"{rofs.Metadata.VolumeName} ({rofs.Metadata.Type})",
|
||||||
|
Filesystem = fs,
|
||||||
|
ReadOnlyFilesystem = rofs,
|
||||||
|
ViewModel = new FileSystemViewModel(rofs?.Metadata ?? fsMetadata, information)
|
||||||
|
};
|
||||||
|
|
||||||
|
// TODO: Trap expanding item
|
||||||
|
if(rofs != null)
|
||||||
|
{
|
||||||
|
filesystemModel.Roots.Add(new SubdirectoryModel
|
||||||
|
{
|
||||||
|
Name = "/",
|
||||||
|
Path = "",
|
||||||
|
Plugin = rofs
|
||||||
|
});
|
||||||
|
|
||||||
|
Statistics.AddCommand("ls");
|
||||||
|
}
|
||||||
|
|
||||||
|
Statistics.AddFilesystem(rofs?.Metadata.Type ?? fsMetadata.Type);
|
||||||
|
imageModel.PartitionSchemesOrFileSystems.Add(filesystemModel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Submodule Aaru.Helpers updated: 57ad637c20...6f76a5d460
@@ -772,19 +772,19 @@ public sealed partial class Alcohol120
|
|||||||
|
|
||||||
foreach(KeyValuePair<uint, ulong> kvp in _offsetMap)
|
foreach(KeyValuePair<uint, ulong> kvp in _offsetMap)
|
||||||
{
|
{
|
||||||
if(sectorAddress >= kvp.Value)
|
if(sectorAddress < kvp.Value)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
foreach(Track track in _alcTracks.Values)
|
||||||
{
|
{
|
||||||
foreach(Track track in _alcTracks.Values)
|
if(track.point != kvp.Key ||
|
||||||
{
|
!_alcTrackExtras.TryGetValue(track.point, out TrackExtra extra))
|
||||||
if(track.point != kvp.Key ||
|
continue;
|
||||||
!_alcTrackExtras.TryGetValue(track.point, out TrackExtra extra))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if(sectorAddress - kvp.Value >= extra.sectors + extra.pregap)
|
if(sectorAddress - kvp.Value >= extra.sectors + extra.pregap)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
return ReadSectors(sectorAddress - kvp.Value, length, kvp.Key, out buffer);
|
return ReadSectors(sectorAddress - kvp.Value, length, kvp.Key, out buffer);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -798,19 +798,19 @@ public sealed partial class Alcohol120
|
|||||||
|
|
||||||
foreach(KeyValuePair<uint, ulong> kvp in _offsetMap)
|
foreach(KeyValuePair<uint, ulong> kvp in _offsetMap)
|
||||||
{
|
{
|
||||||
if(sectorAddress >= kvp.Value)
|
if(sectorAddress < kvp.Value)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
foreach(Track track in _alcTracks.Values)
|
||||||
{
|
{
|
||||||
foreach(Track track in _alcTracks.Values)
|
if(track.point != kvp.Key ||
|
||||||
{
|
!_alcTrackExtras.TryGetValue(track.point, out TrackExtra extra))
|
||||||
if(track.point != kvp.Key ||
|
continue;
|
||||||
!_alcTrackExtras.TryGetValue(track.point, out TrackExtra extra))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if(sectorAddress - kvp.Value >= extra.sectors + extra.pregap)
|
if(sectorAddress - kvp.Value >= extra.sectors + extra.pregap)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
return ReadSectorsTag(sectorAddress - kvp.Value, length, kvp.Key, tag, out buffer);
|
return ReadSectorsTag(sectorAddress - kvp.Value, length, kvp.Key, tag, out buffer);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1390,19 +1390,19 @@ public sealed partial class Alcohol120
|
|||||||
|
|
||||||
foreach(KeyValuePair<uint, ulong> kvp in _offsetMap)
|
foreach(KeyValuePair<uint, ulong> kvp in _offsetMap)
|
||||||
{
|
{
|
||||||
if(sectorAddress >= kvp.Value)
|
if(sectorAddress < kvp.Value)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
foreach(Track alcTrack in _alcTracks.Values)
|
||||||
{
|
{
|
||||||
foreach(Track alcTrack in _alcTracks.Values)
|
if(alcTrack.point != kvp.Key ||
|
||||||
{
|
!_alcTrackExtras.TryGetValue(alcTrack.point, out TrackExtra alcExtra))
|
||||||
if(alcTrack.point != kvp.Key ||
|
continue;
|
||||||
!_alcTrackExtras.TryGetValue(alcTrack.point, out TrackExtra alcExtra))
|
|
||||||
continue;
|
|
||||||
|
|
||||||
if(sectorAddress - kvp.Value >= alcExtra.sectors + alcExtra.pregap)
|
if(sectorAddress - kvp.Value >= alcExtra.sectors + alcExtra.pregap)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
return ReadSectorsLong(sectorAddress - kvp.Value, length, kvp.Key, out buffer);
|
return ReadSectorsLong(sectorAddress - kvp.Value, length, kvp.Key, out buffer);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1010,19 +1010,19 @@ public sealed partial class CdrWin
|
|||||||
|
|
||||||
for(var i = 0; i < cueTracks.Length; i++)
|
for(var i = 0; i < cueTracks.Length; i++)
|
||||||
{
|
{
|
||||||
if(cueTracks[i].Session == s)
|
if(cueTracks[i].Session != s)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if(!firstTrackRead)
|
||||||
{
|
{
|
||||||
if(!firstTrackRead)
|
firstSessionTrk = i;
|
||||||
{
|
firstTrackRead = true;
|
||||||
firstSessionTrk = i;
|
|
||||||
firstTrackRead = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
sessionSectors += cueTracks[i].Sectors;
|
|
||||||
|
|
||||||
if(i > lastSessionTrack)
|
|
||||||
lastSessionTrack = i;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sessionSectors += cueTracks[i].Sectors;
|
||||||
|
|
||||||
|
if(i > lastSessionTrack)
|
||||||
|
lastSessionTrack = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(s > 1)
|
if(s > 1)
|
||||||
@@ -1691,13 +1691,13 @@ public sealed partial class CdrWin
|
|||||||
|
|
||||||
for(var s = 0; s < sessions.Length; s++)
|
for(var s = 0; s < sessions.Length; s++)
|
||||||
{
|
{
|
||||||
if(sessions[s].Sequence > 1 &&
|
if(sessions[s].Sequence <= 1 ||
|
||||||
track.Sequence == sessions[s].StartTrack)
|
track.Sequence != sessions[s].StartTrack)
|
||||||
{
|
continue;
|
||||||
track.TrackFile.Offset += 307200;
|
|
||||||
track.Sectors -= 150;
|
track.TrackFile.Offset += 307200;
|
||||||
sessions[s].StartSector = (ulong)track.Indexes[1];
|
track.Sectors -= 150;
|
||||||
}
|
sessions[s].StartSector = (ulong)track.Indexes[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -127,40 +127,40 @@ public sealed partial class Dart
|
|||||||
|
|
||||||
foreach(short l in bLength)
|
foreach(short l in bLength)
|
||||||
{
|
{
|
||||||
if(l != 0)
|
if(l == 0)
|
||||||
{
|
continue;
|
||||||
var buffer = new byte[BUFFER_SIZE];
|
|
||||||
|
|
||||||
if(l == -1)
|
var buffer = new byte[BUFFER_SIZE];
|
||||||
|
|
||||||
|
if(l == -1)
|
||||||
|
{
|
||||||
|
stream.EnsureRead(buffer, 0, BUFFER_SIZE);
|
||||||
|
dataMs.Write(buffer, 0, DATA_SIZE);
|
||||||
|
tagMs.Write(buffer, DATA_SIZE, TAG_SIZE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
byte[] temp;
|
||||||
|
|
||||||
|
if(header.srcCmp == COMPRESS_RLE)
|
||||||
{
|
{
|
||||||
stream.EnsureRead(buffer, 0, BUFFER_SIZE);
|
temp = new byte[l * 2];
|
||||||
|
stream.EnsureRead(temp, 0, temp.Length);
|
||||||
|
buffer = new byte[BUFFER_SIZE];
|
||||||
|
|
||||||
|
AppleRle.DecodeBuffer(temp, buffer);
|
||||||
|
|
||||||
dataMs.Write(buffer, 0, DATA_SIZE);
|
dataMs.Write(buffer, 0, DATA_SIZE);
|
||||||
tagMs.Write(buffer, DATA_SIZE, TAG_SIZE);
|
tagMs.Write(buffer, DATA_SIZE, TAG_SIZE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
byte[] temp;
|
temp = new byte[l];
|
||||||
|
stream.EnsureRead(temp, 0, temp.Length);
|
||||||
|
|
||||||
if(header.srcCmp == COMPRESS_RLE)
|
AaruConsole.ErrorWriteLine(Localization.LZH_Compressed_images_not_yet_supported);
|
||||||
{
|
|
||||||
temp = new byte[l * 2];
|
|
||||||
stream.EnsureRead(temp, 0, temp.Length);
|
|
||||||
buffer = new byte[BUFFER_SIZE];
|
|
||||||
|
|
||||||
AppleRle.DecodeBuffer(temp, buffer);
|
return ErrorNumber.NotImplemented;
|
||||||
|
|
||||||
dataMs.Write(buffer, 0, DATA_SIZE);
|
|
||||||
tagMs.Write(buffer, DATA_SIZE, TAG_SIZE);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
temp = new byte[l];
|
|
||||||
stream.EnsureRead(temp, 0, temp.Length);
|
|
||||||
|
|
||||||
AaruConsole.ErrorWriteLine(Localization.LZH_Compressed_images_not_yet_supported);
|
|
||||||
|
|
||||||
return ErrorNumber.NotImplemented;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -929,29 +929,29 @@ public sealed partial class Gdi
|
|||||||
|
|
||||||
foreach(GdiTrack gdiTrack in _discImage.Tracks)
|
foreach(GdiTrack gdiTrack in _discImage.Tracks)
|
||||||
{
|
{
|
||||||
if(gdiTrack.HighDensity == expectedDensity)
|
if(gdiTrack.HighDensity != expectedDensity)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
var track = new Track
|
||||||
{
|
{
|
||||||
var track = new Track
|
Description = null,
|
||||||
{
|
StartSector = gdiTrack.StartSector,
|
||||||
Description = null,
|
Pregap = gdiTrack.Pregap,
|
||||||
StartSector = gdiTrack.StartSector,
|
Session = (ushort)(gdiTrack.HighDensity ? 2 : 1),
|
||||||
Pregap = gdiTrack.Pregap,
|
Sequence = gdiTrack.Sequence,
|
||||||
Session = (ushort)(gdiTrack.HighDensity ? 2 : 1),
|
Type = gdiTrack.TrackType,
|
||||||
Sequence = gdiTrack.Sequence,
|
Filter = gdiTrack.TrackFilter,
|
||||||
Type = gdiTrack.TrackType,
|
File = gdiTrack.TrackFile,
|
||||||
Filter = gdiTrack.TrackFilter,
|
FileOffset = (ulong)gdiTrack.Offset,
|
||||||
File = gdiTrack.TrackFile,
|
FileType = "BINARY",
|
||||||
FileOffset = (ulong)gdiTrack.Offset,
|
RawBytesPerSector = gdiTrack.Bps,
|
||||||
FileType = "BINARY",
|
BytesPerSector = gdiTrack.TrackType == TrackType.Data ? 2048 : 2352,
|
||||||
RawBytesPerSector = gdiTrack.Bps,
|
SubchannelType = TrackSubchannelType.None
|
||||||
BytesPerSector = gdiTrack.TrackType == TrackType.Data ? 2048 : 2352,
|
};
|
||||||
SubchannelType = TrackSubchannelType.None
|
|
||||||
};
|
|
||||||
|
|
||||||
track.EndSector = track.StartSector + gdiTrack.Sectors - 1;
|
track.EndSector = track.StartSector + gdiTrack.Sectors - 1;
|
||||||
|
|
||||||
tracks.Add(track);
|
tracks.Add(track);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return tracks;
|
return tracks;
|
||||||
|
|||||||
@@ -194,12 +194,12 @@ public sealed partial class PartClone
|
|||||||
|
|
||||||
for(uint i = 0; i < length; i++)
|
for(uint i = 0; i < length; i++)
|
||||||
{
|
{
|
||||||
if(_byteMap[sectorAddress + i] != 0)
|
if(_byteMap[sectorAddress + i] == 0)
|
||||||
{
|
continue;
|
||||||
allEmpty = false;
|
|
||||||
|
|
||||||
break;
|
allEmpty = false;
|
||||||
}
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(allEmpty)
|
if(allEmpty)
|
||||||
|
|||||||
@@ -445,12 +445,12 @@ public sealed partial class Partimage
|
|||||||
|
|
||||||
for(uint i = 0; i < length; i++)
|
for(uint i = 0; i < length; i++)
|
||||||
{
|
{
|
||||||
if((_bitmap[sectorAddress / 8] & 1 << (int)(sectorAddress % 8)) != 0)
|
if((_bitmap[sectorAddress / 8] & 1 << (int)(sectorAddress % 8)) == 0)
|
||||||
{
|
continue;
|
||||||
allEmpty = false;
|
|
||||||
|
|
||||||
break;
|
allEmpty = false;
|
||||||
}
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(allEmpty)
|
if(allEmpty)
|
||||||
|
|||||||
@@ -193,26 +193,26 @@ public sealed class SunDisklabel : IPartition
|
|||||||
|
|
||||||
for(var i = 0; i < NDKMAP; i++)
|
for(var i = 0; i < NDKMAP; i++)
|
||||||
{
|
{
|
||||||
if(dkl.dkl_map[i].dkl_cylno > 0 &&
|
if(dkl.dkl_map[i].dkl_cylno <= 0 ||
|
||||||
dkl.dkl_map[i].dkl_nblk > 0)
|
dkl.dkl_map[i].dkl_nblk <= 0)
|
||||||
{
|
continue;
|
||||||
var part = new Partition
|
|
||||||
{
|
|
||||||
Size = (ulong)dkl.dkl_map[i].dkl_nblk * DK_LABEL_SIZE,
|
|
||||||
Length = (ulong)(dkl.dkl_map[i].dkl_nblk * DK_LABEL_SIZE / imagePlugin.Info.SectorSize),
|
|
||||||
Sequence = (ulong)i,
|
|
||||||
Offset =
|
|
||||||
((ulong)dkl.dkl_map[i].dkl_cylno * sectorsPerCylinder + sectorOffset) * DK_LABEL_SIZE,
|
|
||||||
Start = ((ulong)dkl.dkl_map[i].dkl_cylno * sectorsPerCylinder + sectorOffset) *
|
|
||||||
DK_LABEL_SIZE / imagePlugin.Info.SectorSize,
|
|
||||||
Type = Localization.SunOS_partition,
|
|
||||||
Scheme = Name
|
|
||||||
};
|
|
||||||
|
|
||||||
if(part.Start < imagePlugin.Info.Sectors &&
|
var part = new Partition
|
||||||
part.End <= imagePlugin.Info.Sectors)
|
{
|
||||||
partitions.Add(part);
|
Size = (ulong)dkl.dkl_map[i].dkl_nblk * DK_LABEL_SIZE,
|
||||||
}
|
Length = (ulong)(dkl.dkl_map[i].dkl_nblk * DK_LABEL_SIZE / imagePlugin.Info.SectorSize),
|
||||||
|
Sequence = (ulong)i,
|
||||||
|
Offset =
|
||||||
|
((ulong)dkl.dkl_map[i].dkl_cylno * sectorsPerCylinder + sectorOffset) * DK_LABEL_SIZE,
|
||||||
|
Start = ((ulong)dkl.dkl_map[i].dkl_cylno * sectorsPerCylinder + sectorOffset) *
|
||||||
|
DK_LABEL_SIZE / imagePlugin.Info.SectorSize,
|
||||||
|
Type = Localization.SunOS_partition,
|
||||||
|
Scheme = Name
|
||||||
|
};
|
||||||
|
|
||||||
|
if(part.Start < imagePlugin.Info.Sectors &&
|
||||||
|
part.End <= imagePlugin.Info.Sectors)
|
||||||
|
partitions.Add(part);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(useDkl8)
|
else if(useDkl8)
|
||||||
@@ -271,35 +271,35 @@ public sealed class SunDisklabel : IPartition
|
|||||||
|
|
||||||
for(var i = 0; i < dkl8.dkl_vtoc.v_nparts; i++)
|
for(var i = 0; i < dkl8.dkl_vtoc.v_nparts; i++)
|
||||||
{
|
{
|
||||||
if(dkl8.dkl_map[i].dkl_nblk > 0 &&
|
if(dkl8.dkl_map[i].dkl_nblk <= 0 ||
|
||||||
dkl8.dkl_vtoc.v_part[i].p_tag != SunTag.SunEmpty &&
|
dkl8.dkl_vtoc.v_part[i].p_tag == SunTag.SunEmpty ||
|
||||||
dkl8.dkl_vtoc.v_part[i].p_tag != SunTag.SunWholeDisk)
|
dkl8.dkl_vtoc.v_part[i].p_tag == SunTag.SunWholeDisk)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
var part = new Partition
|
||||||
{
|
{
|
||||||
var part = new Partition
|
Description = SunFlagsToString(dkl8.dkl_vtoc.v_part[i].p_flag),
|
||||||
{
|
Size = (ulong)dkl8.dkl_map[i].dkl_nblk * DK_LABEL_SIZE,
|
||||||
Description = SunFlagsToString(dkl8.dkl_vtoc.v_part[i].p_flag),
|
Length = (ulong)(dkl8.dkl_map[i].dkl_nblk * DK_LABEL_SIZE / imagePlugin.Info.SectorSize),
|
||||||
Size = (ulong)dkl8.dkl_map[i].dkl_nblk * DK_LABEL_SIZE,
|
Sequence = (ulong)i,
|
||||||
Length = (ulong)(dkl8.dkl_map[i].dkl_nblk * DK_LABEL_SIZE / imagePlugin.Info.SectorSize),
|
Offset = ((ulong)dkl8.dkl_map[i].dkl_cylno * sectorsPerCylinder + sectorOffset) *
|
||||||
Sequence = (ulong)i,
|
DK_LABEL_SIZE,
|
||||||
Offset = ((ulong)dkl8.dkl_map[i].dkl_cylno * sectorsPerCylinder + sectorOffset) *
|
Start = ((ulong)dkl8.dkl_map[i].dkl_cylno * sectorsPerCylinder + sectorOffset) *
|
||||||
DK_LABEL_SIZE,
|
DK_LABEL_SIZE / imagePlugin.Info.SectorSize,
|
||||||
Start = ((ulong)dkl8.dkl_map[i].dkl_cylno * sectorsPerCylinder + sectorOffset) *
|
Type = SunIdToString(dkl8.dkl_vtoc.v_part[i].p_tag),
|
||||||
DK_LABEL_SIZE / imagePlugin.Info.SectorSize,
|
Scheme = Name
|
||||||
Type = SunIdToString(dkl8.dkl_vtoc.v_part[i].p_tag),
|
};
|
||||||
Scheme = Name
|
|
||||||
};
|
|
||||||
|
|
||||||
if(dkl8.dkl_vtoc.v_timestamp[i] != 0)
|
if(dkl8.dkl_vtoc.v_timestamp[i] != 0)
|
||||||
{
|
{
|
||||||
part.Description += "\n" + string.Format(Localization.Partition_timestamped_on_0,
|
part.Description += "\n" + string.Format(Localization.Partition_timestamped_on_0,
|
||||||
DateHandlers.
|
DateHandlers.
|
||||||
UnixToDateTime(dkl8.dkl_vtoc.v_timestamp[i]));
|
UnixToDateTime(dkl8.dkl_vtoc.v_timestamp[i]));
|
||||||
}
|
|
||||||
|
|
||||||
if(part.Start < imagePlugin.Info.Sectors &&
|
|
||||||
part.End <= imagePlugin.Info.Sectors)
|
|
||||||
partitions.Add(part);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(part.Start < imagePlugin.Info.Sectors &&
|
||||||
|
part.End <= imagePlugin.Info.Sectors)
|
||||||
|
partitions.Add(part);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -357,35 +357,35 @@ public sealed class SunDisklabel : IPartition
|
|||||||
|
|
||||||
for(var i = 0; i < dkl16.dkl_vtoc.v_nparts; i++)
|
for(var i = 0; i < dkl16.dkl_vtoc.v_nparts; i++)
|
||||||
{
|
{
|
||||||
if(dkl16.dkl_vtoc.v_part[i].p_size > 0 &&
|
if(dkl16.dkl_vtoc.v_part[i].p_size <= 0 ||
|
||||||
dkl16.dkl_vtoc.v_part[i].p_tag != SunTag.SunEmpty &&
|
dkl16.dkl_vtoc.v_part[i].p_tag == SunTag.SunEmpty ||
|
||||||
dkl16.dkl_vtoc.v_part[i].p_tag != SunTag.SunWholeDisk)
|
dkl16.dkl_vtoc.v_part[i].p_tag == SunTag.SunWholeDisk)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
var part = new Partition
|
||||||
{
|
{
|
||||||
var part = new Partition
|
Description = SunFlagsToString(dkl16.dkl_vtoc.v_part[i].p_flag),
|
||||||
{
|
Size = (ulong)dkl16.dkl_vtoc.v_part[i].p_size * dkl16.dkl_vtoc.v_sectorsz,
|
||||||
Description = SunFlagsToString(dkl16.dkl_vtoc.v_part[i].p_flag),
|
Length = (ulong)(dkl16.dkl_vtoc.v_part[i].p_size * dkl16.dkl_vtoc.v_sectorsz /
|
||||||
Size = (ulong)dkl16.dkl_vtoc.v_part[i].p_size * dkl16.dkl_vtoc.v_sectorsz,
|
imagePlugin.Info.SectorSize),
|
||||||
Length = (ulong)(dkl16.dkl_vtoc.v_part[i].p_size * dkl16.dkl_vtoc.v_sectorsz /
|
Sequence = (ulong)i,
|
||||||
imagePlugin.Info.SectorSize),
|
Offset = ((ulong)dkl16.dkl_vtoc.v_part[i].p_start + sectorOffset) * dkl16.dkl_vtoc.v_sectorsz,
|
||||||
Sequence = (ulong)i,
|
Start = ((ulong)dkl16.dkl_vtoc.v_part[i].p_start + sectorOffset) * dkl16.dkl_vtoc.v_sectorsz /
|
||||||
Offset = ((ulong)dkl16.dkl_vtoc.v_part[i].p_start + sectorOffset) * dkl16.dkl_vtoc.v_sectorsz,
|
imagePlugin.Info.SectorSize,
|
||||||
Start = ((ulong)dkl16.dkl_vtoc.v_part[i].p_start + sectorOffset) * dkl16.dkl_vtoc.v_sectorsz /
|
Type = SunIdToString(dkl16.dkl_vtoc.v_part[i].p_tag),
|
||||||
imagePlugin.Info.SectorSize,
|
Scheme = Name
|
||||||
Type = SunIdToString(dkl16.dkl_vtoc.v_part[i].p_tag),
|
};
|
||||||
Scheme = Name
|
|
||||||
};
|
|
||||||
|
|
||||||
if(dkl16.dkl_vtoc.v_timestamp[i] != 0)
|
if(dkl16.dkl_vtoc.v_timestamp[i] != 0)
|
||||||
{
|
{
|
||||||
part.Description += "\n" + string.Format(Localization.Partition_timestamped_on_0,
|
part.Description += "\n" + string.Format(Localization.Partition_timestamped_on_0,
|
||||||
DateHandlers.
|
DateHandlers.
|
||||||
UnixToDateTime(dkl16.dkl_vtoc.v_timestamp[i]));
|
UnixToDateTime(dkl16.dkl_vtoc.v_timestamp[i]));
|
||||||
}
|
|
||||||
|
|
||||||
if(part.Start < imagePlugin.Info.Sectors &&
|
|
||||||
part.End <= imagePlugin.Info.Sectors)
|
|
||||||
partitions.Add(part);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(part.Start < imagePlugin.Info.Sectors &&
|
||||||
|
part.End <= imagePlugin.Info.Sectors)
|
||||||
|
partitions.Add(part);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -367,63 +367,63 @@ public sealed class VTOC : IPartition
|
|||||||
// This means partition starts are absolute, not relative, to the VTOC position
|
// This means partition starts are absolute, not relative, to the VTOC position
|
||||||
for(var i = 0; i < V_NUMPAR; i++)
|
for(var i = 0; i < V_NUMPAR; i++)
|
||||||
{
|
{
|
||||||
if(parts[i].p_tag == pTag.V_BACKUP &&
|
if(parts[i].p_tag != pTag.V_BACKUP ||
|
||||||
(ulong)parts[i].p_start == sectorOffset)
|
(ulong)parts[i].p_start != sectorOffset)
|
||||||
{
|
continue;
|
||||||
absolute = true;
|
|
||||||
|
|
||||||
break;
|
absolute = true;
|
||||||
}
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
for(var i = 0; i < V_NUMPAR; i++)
|
for(var i = 0; i < V_NUMPAR; i++)
|
||||||
{
|
{
|
||||||
if(parts[i].p_tag != pTag.V_UNUSED)
|
if(parts[i].p_tag == pTag.V_UNUSED)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
var part = new Partition
|
||||||
{
|
{
|
||||||
var part = new Partition
|
Start = (ulong)(parts[i].p_start * bps) / imagePlugin.Info.SectorSize,
|
||||||
{
|
Length = (ulong)(parts[i].p_size * bps) / imagePlugin.Info.SectorSize,
|
||||||
Start = (ulong)(parts[i].p_start * bps) / imagePlugin.Info.SectorSize,
|
Offset = (ulong)(parts[i].p_start * bps),
|
||||||
Length = (ulong)(parts[i].p_size * bps) / imagePlugin.Info.SectorSize,
|
Size = (ulong)(parts[i].p_size * bps),
|
||||||
Offset = (ulong)(parts[i].p_start * bps),
|
Sequence = (ulong)i,
|
||||||
Size = (ulong)(parts[i].p_size * bps),
|
Type = $"UNIX: {DecodeUnixtag(parts[i].p_tag, !useOld)}",
|
||||||
Sequence = (ulong)i,
|
Scheme = Name
|
||||||
Type = $"UNIX: {DecodeUnixtag(parts[i].p_tag, !useOld)}",
|
};
|
||||||
Scheme = Name
|
|
||||||
};
|
|
||||||
|
|
||||||
var info = "";
|
var info = "";
|
||||||
|
|
||||||
// Apparently old ones are absolute :?
|
// Apparently old ones are absolute :?
|
||||||
if(!useOld &&
|
if(!useOld &&
|
||||||
!absolute)
|
!absolute)
|
||||||
{
|
{
|
||||||
part.Start += sectorOffset;
|
part.Start += sectorOffset;
|
||||||
part.Offset += sectorOffset * imagePlugin.Info.SectorSize;
|
part.Offset += sectorOffset * imagePlugin.Info.SectorSize;
|
||||||
}
|
|
||||||
|
|
||||||
if(parts[i].p_flag.HasFlag(pFlag.V_VALID))
|
|
||||||
info += Localization.valid;
|
|
||||||
|
|
||||||
if(parts[i].p_flag.HasFlag(pFlag.V_UNMNT))
|
|
||||||
info += Localization._unmountable_;
|
|
||||||
|
|
||||||
if(parts[i].p_flag.HasFlag(pFlag.V_OPEN))
|
|
||||||
info += Localization.open;
|
|
||||||
|
|
||||||
if(parts[i].p_flag.HasFlag(pFlag.V_REMAP))
|
|
||||||
info += Localization.alternate_sector_mapping;
|
|
||||||
|
|
||||||
if(parts[i].p_flag.HasFlag(pFlag.V_RONLY))
|
|
||||||
info += Localization._read_only_;
|
|
||||||
|
|
||||||
if(timestamps[i] != 0)
|
|
||||||
info += string.Format(Localization.created_on_0, DateHandlers.UnixToDateTime(timestamps[i]));
|
|
||||||
|
|
||||||
part.Description = "UNIX slice" + info + ".";
|
|
||||||
|
|
||||||
if(part.End < imagePlugin.Info.Sectors)
|
|
||||||
partitions.Add(part);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(parts[i].p_flag.HasFlag(pFlag.V_VALID))
|
||||||
|
info += Localization.valid;
|
||||||
|
|
||||||
|
if(parts[i].p_flag.HasFlag(pFlag.V_UNMNT))
|
||||||
|
info += Localization._unmountable_;
|
||||||
|
|
||||||
|
if(parts[i].p_flag.HasFlag(pFlag.V_OPEN))
|
||||||
|
info += Localization.open;
|
||||||
|
|
||||||
|
if(parts[i].p_flag.HasFlag(pFlag.V_REMAP))
|
||||||
|
info += Localization.alternate_sector_mapping;
|
||||||
|
|
||||||
|
if(parts[i].p_flag.HasFlag(pFlag.V_RONLY))
|
||||||
|
info += Localization._read_only_;
|
||||||
|
|
||||||
|
if(timestamps[i] != 0)
|
||||||
|
info += string.Format(Localization.created_on_0, DateHandlers.UnixToDateTime(timestamps[i]));
|
||||||
|
|
||||||
|
part.Description = "UNIX slice" + info + ".";
|
||||||
|
|
||||||
|
if(part.End < imagePlugin.Info.Sectors)
|
||||||
|
partitions.Add(part);
|
||||||
}
|
}
|
||||||
|
|
||||||
return partitions.Count > 0;
|
return partitions.Count > 0;
|
||||||
@@ -440,15 +440,15 @@ public sealed class VTOC : IPartition
|
|||||||
pTag.V_USER => "/usr",
|
pTag.V_USER => "/usr",
|
||||||
pTag.V_BACKUP => Localization.Whole_disk,
|
pTag.V_BACKUP => Localization.Whole_disk,
|
||||||
pTag.V_STAND_OLD => isNew
|
pTag.V_STAND_OLD => isNew
|
||||||
? "Stand"
|
? "Stand"
|
||||||
: Localization.Alternate_sector_space,
|
: Localization.Alternate_sector_space,
|
||||||
pTag.V_VAR_OLD => isNew ? "/var" : Localization.non_UNIX,
|
pTag.V_VAR_OLD => isNew ? "/var" : Localization.non_UNIX,
|
||||||
pTag.V_HOME_OLD => isNew
|
pTag.V_HOME_OLD => isNew
|
||||||
? "/home"
|
? "/home"
|
||||||
: Localization.Alternate_track_space,
|
: Localization.Alternate_track_space,
|
||||||
pTag.V_ALTSCTR_OLD => isNew
|
pTag.V_ALTSCTR_OLD => isNew
|
||||||
? Localization.Alternate_sector_track
|
? Localization.Alternate_sector_track
|
||||||
: "Stand",
|
: "Stand",
|
||||||
pTag.V_CACHE => isNew ? Localization.Cache : "/var",
|
pTag.V_CACHE => isNew ? Localization.Cache : "/var",
|
||||||
pTag.V_RESERVED =>
|
pTag.V_RESERVED =>
|
||||||
isNew ? Localization.Reserved : "/home",
|
isNew ? Localization.Reserved : "/home",
|
||||||
|
|||||||
@@ -81,24 +81,24 @@ public abstract class FsExtractIssueTest
|
|||||||
{
|
{
|
||||||
foreach(string pluginName in idPlugins)
|
foreach(string pluginName in idPlugins)
|
||||||
{
|
{
|
||||||
if(plugins.ReadOnlyFilesystems.TryGetValue(pluginName, out pluginType))
|
if(!plugins.ReadOnlyFilesystems.TryGetValue(pluginName, out pluginType))
|
||||||
{
|
continue;
|
||||||
Assert.IsNotNull(pluginType, Localization.Could_not_instantiate_filesystem_plugin);
|
|
||||||
|
|
||||||
var fs = Activator.CreateInstance(pluginType) as IReadOnlyFilesystem;
|
Assert.IsNotNull(pluginType, Localization.Could_not_instantiate_filesystem_plugin);
|
||||||
|
|
||||||
Assert.IsNotNull(fs,
|
var fs = Activator.CreateInstance(pluginType) as IReadOnlyFilesystem;
|
||||||
string.Format(Localization.Could_not_instantiate_filesystem_0, pluginName));
|
|
||||||
|
|
||||||
filesystemFound = true;
|
Assert.IsNotNull(fs,
|
||||||
|
string.Format(Localization.Could_not_instantiate_filesystem_0, pluginName));
|
||||||
|
|
||||||
error = fs.Mount(imageFormat, partitions[i], encodingClass, options, Namespace);
|
filesystemFound = true;
|
||||||
|
|
||||||
Assert.AreEqual(ErrorNumber.NoError, error,
|
error = fs.Mount(imageFormat, partitions[i], encodingClass, options, Namespace);
|
||||||
string.Format(Localization.Could_not_mount_0_in_partition_1, pluginName, i));
|
|
||||||
|
|
||||||
ExtractFilesInDir("/", fs, Xattrs);
|
Assert.AreEqual(ErrorNumber.NoError, error,
|
||||||
}
|
string.Format(Localization.Could_not_mount_0_in_partition_1, pluginName, i));
|
||||||
|
|
||||||
|
ExtractFilesInDir("/", fs, Xattrs);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -630,6 +630,9 @@
|
|||||||
<s:String x:Key="/Default/CustomTools/CustomToolsData/@EntryValue"></s:String>
|
<s:String x:Key="/Default/CustomTools/CustomToolsData/@EntryValue"></s:String>
|
||||||
<s:String x:Key="/Default/Environment/Hierarchy/Build/BuildTool/CustomBuildToolPath/@EntryValue">/opt/dotnet/sdk/3.0.100/MSBuild.dll</s:String>
|
<s:String x:Key="/Default/Environment/Hierarchy/Build/BuildTool/CustomBuildToolPath/@EntryValue">/opt/dotnet/sdk/3.0.100/MSBuild.dll</s:String>
|
||||||
<s:Int64 x:Key="/Default/Environment/Hierarchy/Build/BuildTool/MsbuildVersion/@EntryValue">1048576</s:Int64>
|
<s:Int64 x:Key="/Default/Environment/Hierarchy/Build/BuildTool/MsbuildVersion/@EntryValue">1048576</s:Int64>
|
||||||
|
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002ECpp_002ECodeStyle_002EIncludesOrder_002ECppIncludeDirectiveSettingsMigration/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002ECpp_002ECodeStyle_002ESettingsUpgrade_002EFunctionReturnStyleSettingsUpgrader/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002ECpp_002ECodeStyle_002ESettingsUpgrade_002ESpaceAroundPtrSettingsUpgrader/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpKeepExistingMigration/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpPlaceEmbeddedOnSameLineMigration/@EntryIndexedValue">True</s:Boolean>
|
||||||
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
|
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EPsi_002ECSharp_002ECodeStyle_002ECSharpUseContinuousIndentInsideBracesMigration/@EntryIndexedValue">True</s:Boolean>
|
||||||
|
|||||||
@@ -314,37 +314,37 @@ sealed class ExtractFilesCommand : Command
|
|||||||
|
|
||||||
foreach(string pluginName in idPlugins)
|
foreach(string pluginName in idPlugins)
|
||||||
{
|
{
|
||||||
if(plugins.ReadOnlyFilesystems.TryGetValue(pluginName, out pluginType))
|
if(!plugins.ReadOnlyFilesystems.TryGetValue(pluginName, out pluginType))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
AaruConsole.WriteLine($"[bold]{string.Format(UI.As_identified_by_0, pluginType.Name)
|
||||||
|
}[/]");
|
||||||
|
|
||||||
|
if(Activator.CreateInstance(pluginType) is not IReadOnlyFilesystem fs)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
Core.Spectre.ProgressSingleSpinner(ctx =>
|
||||||
{
|
{
|
||||||
AaruConsole.WriteLine($"[bold]{string.Format(UI.As_identified_by_0, pluginType.Name)
|
ctx.AddTask(UI.Mounting_filesystem).
|
||||||
}[/]");
|
IsIndeterminate();
|
||||||
|
|
||||||
if(Activator.CreateInstance(pluginType) is not IReadOnlyFilesystem fs)
|
error = fs.Mount(imageFormat, partitions[i],
|
||||||
continue;
|
encodingClass, parsedOptions,
|
||||||
|
@namespace);
|
||||||
|
});
|
||||||
|
|
||||||
Core.Spectre.ProgressSingleSpinner(ctx =>
|
if(error == ErrorNumber.NoError)
|
||||||
{
|
{
|
||||||
ctx.AddTask(UI.Mounting_filesystem).
|
string volumeName = string.IsNullOrEmpty(fs.Metadata.VolumeName)
|
||||||
IsIndeterminate();
|
? "NO NAME"
|
||||||
|
: fs.Metadata.VolumeName;
|
||||||
|
|
||||||
error = fs.Mount(imageFormat, partitions[i],
|
ExtractFilesInDir("/", fs, volumeName, outputDir, xattrs);
|
||||||
encodingClass, parsedOptions,
|
|
||||||
@namespace);
|
|
||||||
});
|
|
||||||
|
|
||||||
if(error == ErrorNumber.NoError)
|
Statistics.AddFilesystem(fs.Metadata.Type);
|
||||||
{
|
|
||||||
string volumeName = string.IsNullOrEmpty(fs.Metadata.VolumeName)
|
|
||||||
? "NO NAME"
|
|
||||||
: fs.Metadata.VolumeName;
|
|
||||||
|
|
||||||
ExtractFilesInDir("/", fs, volumeName, outputDir, xattrs);
|
|
||||||
|
|
||||||
Statistics.AddFilesystem(fs.Metadata.Type);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
AaruConsole.ErrorWriteLine(UI.Unable_to_mount_volume_error_0, error.ToString());
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
AaruConsole.ErrorWriteLine(UI.Unable_to_mount_volume_error_0, error.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -304,20 +304,19 @@ sealed class FilesystemInfoCommand : Command
|
|||||||
|
|
||||||
foreach(string pluginName in idPlugins)
|
foreach(string pluginName in idPlugins)
|
||||||
{
|
{
|
||||||
if(plugins.Filesystems.TryGetValue(pluginName, out pluginType))
|
if(!plugins.Filesystems.TryGetValue(pluginName, out pluginType))
|
||||||
{
|
continue;
|
||||||
if(Activator.CreateInstance(pluginType) is not IFilesystem fs)
|
if(Activator.CreateInstance(pluginType) is not IFilesystem fs)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
AaruConsole.WriteLine($"[bold]{string.Format(UI.As_identified_by_0, fs.Name)
|
AaruConsole.WriteLine($"[bold]{string.Format(UI.As_identified_by_0, fs.Name)
|
||||||
}[/]");
|
}[/]");
|
||||||
|
|
||||||
fs.GetInformation(imageFormat, partitionsList[i], encodingClass,
|
fs.GetInformation(imageFormat, partitionsList[i], encodingClass,
|
||||||
out information, out FileSystem fsMetadata);
|
out information, out FileSystem fsMetadata);
|
||||||
|
|
||||||
AaruConsole.Write(information);
|
AaruConsole.Write(information);
|
||||||
Statistics.AddFilesystem(fsMetadata.Type);
|
Statistics.AddFilesystem(fsMetadata.Type);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@@ -375,19 +374,18 @@ sealed class FilesystemInfoCommand : Command
|
|||||||
|
|
||||||
foreach(string pluginName in idPlugins)
|
foreach(string pluginName in idPlugins)
|
||||||
{
|
{
|
||||||
if(plugins.Filesystems.TryGetValue(pluginName, out pluginType))
|
if(!plugins.Filesystems.TryGetValue(pluginName, out pluginType))
|
||||||
{
|
continue;
|
||||||
if(Activator.CreateInstance(pluginType) is not IFilesystem fs)
|
if(Activator.CreateInstance(pluginType) is not IFilesystem fs)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
AaruConsole.WriteLine($"[bold]{string.Format(UI.As_identified_by_0, fs.Name)}[/]");
|
AaruConsole.WriteLine($"[bold]{string.Format(UI.As_identified_by_0, fs.Name)}[/]");
|
||||||
|
|
||||||
fs.GetInformation(imageFormat, wholePart, encodingClass, out information,
|
fs.GetInformation(imageFormat, wholePart, encodingClass, out information,
|
||||||
out FileSystem fsMetadata);
|
out FileSystem fsMetadata);
|
||||||
|
|
||||||
AaruConsole.Write(information);
|
AaruConsole.Write(information);
|
||||||
Statistics.AddFilesystem(fsMetadata.Type);
|
Statistics.AddFilesystem(fsMetadata.Type);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -286,32 +286,31 @@ sealed class LsCommand : Command
|
|||||||
|
|
||||||
foreach(string pluginName in idPlugins)
|
foreach(string pluginName in idPlugins)
|
||||||
{
|
{
|
||||||
if(plugins.ReadOnlyFilesystems.TryGetValue(pluginName, out pluginType))
|
if(!plugins.ReadOnlyFilesystems.TryGetValue(pluginName, out pluginType))
|
||||||
|
continue;
|
||||||
|
if(Activator.CreateInstance(pluginType) is not IReadOnlyFilesystem fs)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
AaruConsole.WriteLine($"[bold]{string.Format(UI.As_identified_by_0, fs.Name)}[/]");
|
||||||
|
|
||||||
|
Core.Spectre.ProgressSingleSpinner(ctx =>
|
||||||
{
|
{
|
||||||
if(Activator.CreateInstance(pluginType) is not IReadOnlyFilesystem fs)
|
ctx.AddTask(UI.Mounting_filesystem).
|
||||||
continue;
|
IsIndeterminate();
|
||||||
|
|
||||||
AaruConsole.WriteLine($"[bold]{string.Format(UI.As_identified_by_0, fs.Name)}[/]");
|
error = fs.Mount(imageFormat, partitions[i],
|
||||||
|
encodingClass, parsedOptions,
|
||||||
|
@namespace);
|
||||||
|
});
|
||||||
|
|
||||||
Core.Spectre.ProgressSingleSpinner(ctx =>
|
if(error == ErrorNumber.NoError)
|
||||||
{
|
{
|
||||||
ctx.AddTask(UI.Mounting_filesystem).
|
ListFilesInDir("/", fs, longFormat);
|
||||||
IsIndeterminate();
|
|
||||||
|
|
||||||
error = fs.Mount(imageFormat, partitions[i],
|
Statistics.AddFilesystem(fs.Metadata.Type);
|
||||||
encodingClass, parsedOptions,
|
|
||||||
@namespace);
|
|
||||||
});
|
|
||||||
|
|
||||||
if(error == ErrorNumber.NoError)
|
|
||||||
{
|
|
||||||
ListFilesInDir("/", fs, longFormat);
|
|
||||||
|
|
||||||
Statistics.AddFilesystem(fs.Metadata.Type);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
AaruConsole.ErrorWriteLine(UI.Unable_to_mount_volume_error_0, error.ToString());
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
AaruConsole.ErrorWriteLine(UI.Unable_to_mount_volume_error_0, error.ToString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user