mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Rename Aaru.Console project to Aaru.Logging.
This commit is contained in:
@@ -41,8 +41,8 @@ using Aaru.CommonTypes.AaruMetadata;
|
||||
using Aaru.CommonTypes.Enums;
|
||||
using Aaru.CommonTypes.Interfaces;
|
||||
using Aaru.CommonTypes.Structs;
|
||||
using Aaru.Console;
|
||||
using Aaru.Helpers;
|
||||
using Aaru.Logging;
|
||||
using FileAttributes = Aaru.CommonTypes.Structs.FileAttributes;
|
||||
using FileSystemInfo = Aaru.CommonTypes.Structs.FileSystemInfo;
|
||||
using Partition = Aaru.CommonTypes.Partition;
|
||||
@@ -69,7 +69,7 @@ public sealed partial class CPM
|
||||
{
|
||||
_sectorMask = new int[_workingDefinition.side1.sectorIds.Length];
|
||||
|
||||
for(var m = 0; m < _sectorMask.Length; m++)
|
||||
for(int m = 0; m < _sectorMask.Length; m++)
|
||||
_sectorMask[m] = _workingDefinition.side1.sectorIds[m] - _workingDefinition.side1.sectorIds[0];
|
||||
}
|
||||
else
|
||||
@@ -80,11 +80,11 @@ public sealed partial class CPM
|
||||
_sectorMask = new int[_workingDefinition.side1.sectorIds.Length +
|
||||
_workingDefinition.side2.sectorIds.Length];
|
||||
|
||||
for(var m = 0; m < _workingDefinition.side1.sectorIds.Length; m++)
|
||||
for(int m = 0; m < _workingDefinition.side1.sectorIds.Length; m++)
|
||||
_sectorMask[m] = _workingDefinition.side1.sectorIds[m] - _workingDefinition.side1.sectorIds[0];
|
||||
|
||||
// Skip first track (first side)
|
||||
for(var m = 0; m < _workingDefinition.side2.sectorIds.Length; m++)
|
||||
for(int m = 0; m < _workingDefinition.side2.sectorIds.Length; m++)
|
||||
{
|
||||
_sectorMask[m + _workingDefinition.side1.sectorIds.Length] =
|
||||
_workingDefinition.side2.sectorIds[m] -
|
||||
@@ -99,11 +99,11 @@ public sealed partial class CPM
|
||||
StringComparison.InvariantCultureIgnoreCase) ==
|
||||
0)
|
||||
{
|
||||
for(var m = 0; m < _workingDefinition.side1.sectorIds.Length; m++)
|
||||
for(int m = 0; m < _workingDefinition.side1.sectorIds.Length; m++)
|
||||
_sectorMask[m] = _workingDefinition.side1.sectorIds[m] - _workingDefinition.side1.sectorIds[0];
|
||||
|
||||
// Skip first track (first side) and first track (second side)
|
||||
for(var m = 0; m < _workingDefinition.side1.sectorIds.Length; m++)
|
||||
for(int m = 0; m < _workingDefinition.side1.sectorIds.Length; m++)
|
||||
{
|
||||
_sectorMask[m + _workingDefinition.side1.sectorIds.Length] =
|
||||
_workingDefinition.side1.sectorIds[m] -
|
||||
@@ -156,7 +156,7 @@ public sealed partial class CPM
|
||||
{
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Deinterleaving_whole_volume);
|
||||
|
||||
for(var p = 0; p <= (int)(partition.End - partition.Start); p++)
|
||||
for(int p = 0; p <= (int)(partition.End - partition.Start); p++)
|
||||
{
|
||||
ErrorNumber errno =
|
||||
_device.ReadSector((ulong)((int)partition.Start +
|
||||
@@ -167,9 +167,8 @@ public sealed partial class CPM
|
||||
if(errno != ErrorNumber.NoError) return errno;
|
||||
|
||||
if(_workingDefinition.complement)
|
||||
{
|
||||
for(var b = 0; b < readSector.Length; b++) readSector[b] = (byte)(~readSector[b] & 0xFF);
|
||||
}
|
||||
for(int b = 0; b < readSector.Length; b++)
|
||||
readSector[b] = (byte)(~readSector[b] & 0xFF);
|
||||
|
||||
deinterleavedSectors.Add((ulong)p, readSector);
|
||||
}
|
||||
@@ -178,7 +177,7 @@ public sealed partial class CPM
|
||||
int blockSize = 128 << _dpb.bsh;
|
||||
var blockMs = new MemoryStream();
|
||||
ulong blockNo = 0;
|
||||
var sectorsPerBlock = 0;
|
||||
int sectorsPerBlock = 0;
|
||||
Dictionary<ulong, byte[]> allocationBlocks = new();
|
||||
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Creating_allocation_blocks);
|
||||
@@ -191,9 +190,9 @@ public sealed partial class CPM
|
||||
// May it happen? Just in case, CP/M blocks are smaller than physical sectors
|
||||
if(sector.Length > blockSize)
|
||||
{
|
||||
for(var i = 0; i < sector.Length / blockSize; i++)
|
||||
for(int i = 0; i < sector.Length / blockSize; i++)
|
||||
{
|
||||
var tmp = new byte[blockSize];
|
||||
byte[] tmp = new byte[blockSize];
|
||||
Array.Copy(sector, blockSize * i, tmp, 0, blockSize);
|
||||
allocationBlocks.Add(blockNo++, tmp);
|
||||
}
|
||||
@@ -230,7 +229,7 @@ public sealed partial class CPM
|
||||
// Read the whole directory blocks
|
||||
var dirMs = new MemoryStream();
|
||||
|
||||
for(var d = 0; d < dirSectors; d++)
|
||||
for(int d = 0; d < dirSectors; d++)
|
||||
{
|
||||
deinterleavedSectors.TryGetValue((ulong)(d + dirOff), out byte[] sector);
|
||||
dirMs.Write(sector, 0, sector.Length);
|
||||
@@ -240,7 +239,7 @@ public sealed partial class CPM
|
||||
|
||||
if(directory == null) return ErrorNumber.InvalidArgument;
|
||||
|
||||
var dirCnt = 0;
|
||||
int dirCnt = 0;
|
||||
string file1 = null;
|
||||
string file2 = null;
|
||||
string file3 = null;
|
||||
@@ -249,7 +248,7 @@ public sealed partial class CPM
|
||||
|
||||
_statCache = new Dictionary<string, FileEntryInfo>();
|
||||
_cpmStat = new FileSystemInfo();
|
||||
var atime = false;
|
||||
bool atime = false;
|
||||
_dirList = [];
|
||||
_labelCreationDate = null;
|
||||
_labelUpdateDate = null;
|
||||
@@ -258,7 +257,7 @@ public sealed partial class CPM
|
||||
AaruConsole.DebugWriteLine(MODULE_NAME, Localization.Traversing_directory);
|
||||
|
||||
// For each directory entry
|
||||
for(var dOff = 0; dOff < directory.Length; dOff += 32)
|
||||
for(int dOff = 0; dOff < directory.Length; dOff += 32)
|
||||
|
||||
{
|
||||
switch(directory[dOff] & 0x7F)
|
||||
@@ -276,15 +275,15 @@ public sealed partial class CPM
|
||||
//bool backed = (entry.filename[3] & 0x80) == 0x80 || (entry.extension[3] & 0x80) == 0x80;
|
||||
int user = entry.statusUser & 0x0F;
|
||||
|
||||
var validEntry = true;
|
||||
bool validEntry = true;
|
||||
|
||||
for(var i = 0; i < 8; i++)
|
||||
for(int i = 0; i < 8; i++)
|
||||
{
|
||||
entry.filename[i] &= 0x7F;
|
||||
validEntry &= entry.filename[i] >= 0x20;
|
||||
}
|
||||
|
||||
for(var i = 0; i < 3; i++)
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
entry.extension[i] &= 0x7F;
|
||||
validEntry &= entry.extension[i] >= 0x20;
|
||||
@@ -384,15 +383,15 @@ public sealed partial class CPM
|
||||
//bool backed = (entry.filename[3] & 0x80) == 0x80 || (entry.extension[3] & 0x80) == 0x80;
|
||||
int user = entry.statusUser & 0x0F;
|
||||
|
||||
var validEntry = true;
|
||||
bool validEntry = true;
|
||||
|
||||
for(var i = 0; i < 8; i++)
|
||||
for(int i = 0; i < 8; i++)
|
||||
{
|
||||
entry.filename[i] &= 0x7F;
|
||||
validEntry &= entry.filename[i] >= 0x20;
|
||||
}
|
||||
|
||||
for(var i = 0; i < 3; i++)
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
entry.extension[i] &= 0x7F;
|
||||
validEntry &= entry.extension[i] >= 0x20;
|
||||
@@ -488,9 +487,9 @@ public sealed partial class CPM
|
||||
|
||||
int user = entry.userNumber & 0x0F;
|
||||
|
||||
for(var i = 0; i < 8; i++) entry.filename[i] &= 0x7F;
|
||||
for(int i = 0; i < 8; i++) entry.filename[i] &= 0x7F;
|
||||
|
||||
for(var i = 0; i < 3; i++) entry.extension[i] &= 0x7F;
|
||||
for(int i = 0; i < 3; i++) entry.extension[i] &= 0x7F;
|
||||
|
||||
string filename = Encoding.ASCII.GetString(entry.filename).Trim();
|
||||
string extension = Encoding.ASCII.GetString(entry.extension).Trim();
|
||||
@@ -506,7 +505,7 @@ public sealed partial class CPM
|
||||
if(_passwordCache.ContainsKey(filename)) _passwordCache.Remove(filename);
|
||||
|
||||
// Copy whole password entry
|
||||
var tmp = new byte[32];
|
||||
byte[] tmp = new byte[32];
|
||||
Array.Copy(directory, dOff, tmp, 0, 32);
|
||||
_passwordCache.Add(filename, tmp);
|
||||
|
||||
@@ -655,7 +654,7 @@ public sealed partial class CPM
|
||||
else
|
||||
fInfo = new FileEntryInfo();
|
||||
|
||||
var ctime = new byte[4];
|
||||
byte[] ctime = new byte[4];
|
||||
ctime[0] = trdPartyDateEntry.create1[0];
|
||||
ctime[1] = trdPartyDateEntry.create1[1];
|
||||
|
||||
@@ -673,7 +672,7 @@ public sealed partial class CPM
|
||||
else
|
||||
fInfo = new FileEntryInfo();
|
||||
|
||||
var ctime = new byte[4];
|
||||
byte[] ctime = new byte[4];
|
||||
ctime[0] = trdPartyDateEntry.create2[0];
|
||||
ctime[1] = trdPartyDateEntry.create2[1];
|
||||
|
||||
@@ -691,7 +690,7 @@ public sealed partial class CPM
|
||||
else
|
||||
fInfo = new FileEntryInfo();
|
||||
|
||||
var ctime = new byte[4];
|
||||
byte[] ctime = new byte[4];
|
||||
ctime[0] = trdPartyDateEntry.create3[0];
|
||||
ctime[1] = trdPartyDateEntry.create3[1];
|
||||
|
||||
@@ -731,7 +730,7 @@ public sealed partial class CPM
|
||||
|
||||
if(fileExtents.TryGetValue(filename, out Dictionary<int, List<ushort>> extents))
|
||||
{
|
||||
for(var ex = 0; ex < extents.Count; ex++)
|
||||
for(int ex = 0; ex < extents.Count; ex++)
|
||||
{
|
||||
if(!extents.TryGetValue(ex, out List<ushort> alBlks)) continue;
|
||||
|
||||
@@ -760,10 +759,10 @@ public sealed partial class CPM
|
||||
// For each stored password, store a decoded version of it
|
||||
foreach(KeyValuePair<string, byte[]> kvp in _passwordCache)
|
||||
{
|
||||
var tmp = new byte[8];
|
||||
byte[] tmp = new byte[8];
|
||||
Array.Copy(kvp.Value, 16, tmp, 0, 8);
|
||||
|
||||
for(var t = 0; t < 8; t++) tmp[t] ^= kvp.Value[13];
|
||||
for(int t = 0; t < 8; t++) tmp[t] ^= kvp.Value[13];
|
||||
|
||||
_decodedPasswordCache.Add(kvp.Key, tmp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user