diff options
Diffstat (limited to 'Ryujinx.HLE/Loaders')
19 files changed, 436 insertions, 433 deletions
diff --git a/Ryujinx.HLE/Loaders/Compression/BackwardsLz.cs b/Ryujinx.HLE/Loaders/Compression/BackwardsLz.cs index 43cc601f..166ae60a 100644 --- a/Ryujinx.HLE/Loaders/Compression/BackwardsLz.cs +++ b/Ryujinx.HLE/Loaders/Compression/BackwardsLz.cs @@ -7,22 +7,22 @@ namespace Ryujinx.HLE.Loaders.Compression { private class BackwardsReader { - private Stream BaseStream; + private Stream _baseStream; - public BackwardsReader(Stream BaseStream) + public BackwardsReader(Stream baseStream) { - this.BaseStream = BaseStream; + _baseStream = baseStream; } public byte ReadByte() { - BaseStream.Seek(-1, SeekOrigin.Current); + _baseStream.Seek(-1, SeekOrigin.Current); - byte Value = (byte)BaseStream.ReadByte(); + byte value = (byte)_baseStream.ReadByte(); - BaseStream.Seek(-1, SeekOrigin.Current); + _baseStream.Seek(-1, SeekOrigin.Current); - return Value; + return value; } public short ReadInt16() @@ -39,67 +39,67 @@ namespace Ryujinx.HLE.Loaders.Compression } } - public static byte[] Decompress(Stream Input, int DecompressedLength) + public static byte[] Decompress(Stream input, int decompressedLength) { - long End = Input.Position; + long end = input.Position; - BackwardsReader Reader = new BackwardsReader(Input); + BackwardsReader reader = new BackwardsReader(input); - int AdditionalDecLength = Reader.ReadInt32(); - int StartOffset = Reader.ReadInt32(); - int CompressedLength = Reader.ReadInt32(); + int additionalDecLength = reader.ReadInt32(); + int startOffset = reader.ReadInt32(); + int compressedLength = reader.ReadInt32(); - Input.Seek(12 - StartOffset, SeekOrigin.Current); + input.Seek(12 - startOffset, SeekOrigin.Current); - byte[] Dec = new byte[DecompressedLength]; + byte[] dec = new byte[decompressedLength]; - int DecompressedLengthUnpadded = CompressedLength + AdditionalDecLength; + int decompressedLengthUnpadded = compressedLength + additionalDecLength; - int DecompressionStart = DecompressedLength - DecompressedLengthUnpadded; + int decompressionStart = decompressedLength - decompressedLengthUnpadded; - int DecPos = Dec.Length; + int decPos = dec.Length; - byte Mask = 0; - byte Header = 0; + byte mask = 0; + byte header = 0; - while (DecPos > DecompressionStart) + while (decPos > decompressionStart) { - if ((Mask >>= 1) == 0) + if ((mask >>= 1) == 0) { - Header = Reader.ReadByte(); - Mask = 0x80; + header = reader.ReadByte(); + mask = 0x80; } - if ((Header & Mask) == 0) + if ((header & mask) == 0) { - Dec[--DecPos] = Reader.ReadByte(); + dec[--decPos] = reader.ReadByte(); } else { - ushort Pair = (ushort)Reader.ReadInt16(); + ushort pair = (ushort)reader.ReadInt16(); - int Length = (Pair >> 12) + 3; - int Position = (Pair & 0xfff) + 3; + int length = (pair >> 12) + 3; + int position = (pair & 0xfff) + 3; - DecPos -= Length; + decPos -= length; - if (Length <= Position) + if (length <= position) { - int SrcPos = DecPos + Position; + int srcPos = decPos + position; - Buffer.BlockCopy(Dec, SrcPos, Dec, DecPos, Length); + Buffer.BlockCopy(dec, srcPos, dec, decPos, length); } else { - for (int Offset = 0; Offset < Length; Offset++) + for (int offset = 0; offset < length; offset++) { - Dec[DecPos + Offset] = Dec[DecPos + Position + Offset]; + dec[decPos + offset] = dec[decPos + position + offset]; } } } } - return Dec; + return dec; } } }
\ No newline at end of file diff --git a/Ryujinx.HLE/Loaders/Compression/Lz4.cs b/Ryujinx.HLE/Loaders/Compression/Lz4.cs index cfb49551..e405b107 100644 --- a/Ryujinx.HLE/Loaders/Compression/Lz4.cs +++ b/Ryujinx.HLE/Loaders/Compression/Lz4.cs @@ -4,75 +4,75 @@ namespace Ryujinx.HLE.Loaders.Compression { static class Lz4 { - public static byte[] Decompress(byte[] Cmp, int DecLength) + public static byte[] Decompress(byte[] cmp, int decLength) { - byte[] Dec = new byte[DecLength]; + byte[] dec = new byte[decLength]; - int CmpPos = 0; - int DecPos = 0; + int cmpPos = 0; + int decPos = 0; - int GetLength(int Length) + int GetLength(int length) { - byte Sum; + byte sum; - if (Length == 0xf) + if (length == 0xf) { do { - Length += (Sum = Cmp[CmpPos++]); + length += (sum = cmp[cmpPos++]); } - while (Sum == 0xff); + while (sum == 0xff); } - return Length; + return length; } do { - byte Token = Cmp[CmpPos++]; + byte token = cmp[cmpPos++]; - int EncCount = (Token >> 0) & 0xf; - int LitCount = (Token >> 4) & 0xf; + int encCount = (token >> 0) & 0xf; + int litCount = (token >> 4) & 0xf; //Copy literal chunck - LitCount = GetLength(LitCount); + litCount = GetLength(litCount); - Buffer.BlockCopy(Cmp, CmpPos, Dec, DecPos, LitCount); + Buffer.BlockCopy(cmp, cmpPos, dec, decPos, litCount); - CmpPos += LitCount; - DecPos += LitCount; + cmpPos += litCount; + decPos += litCount; - if (CmpPos >= Cmp.Length) + if (cmpPos >= cmp.Length) { break; } //Copy compressed chunck - int Back = Cmp[CmpPos++] << 0 | - Cmp[CmpPos++] << 8; + int back = cmp[cmpPos++] << 0 | + cmp[cmpPos++] << 8; - EncCount = GetLength(EncCount) + 4; + encCount = GetLength(encCount) + 4; - int EncPos = DecPos - Back; + int encPos = decPos - back; - if (EncCount <= Back) + if (encCount <= back) { - Buffer.BlockCopy(Dec, EncPos, Dec, DecPos, EncCount); + Buffer.BlockCopy(dec, encPos, dec, decPos, encCount); - DecPos += EncCount; + decPos += encCount; } else { - while (EncCount-- > 0) + while (encCount-- > 0) { - Dec[DecPos++] = Dec[EncPos++]; + dec[decPos++] = dec[encPos++]; } } } - while (CmpPos < Cmp.Length && - DecPos < Dec.Length); + while (cmpPos < cmp.Length && + decPos < dec.Length); - return Dec; + return dec; } } }
\ No newline at end of file diff --git a/Ryujinx.HLE/Loaders/Elf/ElfDynamic.cs b/Ryujinx.HLE/Loaders/Elf/ElfDynamic.cs index fb0ea53e..bcf79901 100644 --- a/Ryujinx.HLE/Loaders/Elf/ElfDynamic.cs +++ b/Ryujinx.HLE/Loaders/Elf/ElfDynamic.cs @@ -2,14 +2,14 @@ namespace Ryujinx.HLE.Loaders.Elf { struct ElfDynamic { - public ElfDynamicTag Tag { get; private set; } + public ElfDynamicTag Tag { get; } - public long Value { get; private set; } + public long Value { get; } - public ElfDynamic(ElfDynamicTag Tag, long Value) + public ElfDynamic(ElfDynamicTag tag, long value) { - this.Tag = Tag; - this.Value = Value; + Tag = tag; + Value = value; } } }
\ No newline at end of file diff --git a/Ryujinx.HLE/Loaders/Elf/ElfDynamicTag.cs b/Ryujinx.HLE/Loaders/Elf/ElfDynamicTag.cs index 9d7ad72e..eb37d612 100644 --- a/Ryujinx.HLE/Loaders/Elf/ElfDynamicTag.cs +++ b/Ryujinx.HLE/Loaders/Elf/ElfDynamicTag.cs @@ -1,5 +1,8 @@ +using System.Diagnostics.CodeAnalysis; + namespace Ryujinx.HLE.Loaders.Elf { + [SuppressMessage("ReSharper", "InconsistentNaming")] enum ElfDynamicTag { DT_NULL = 0, diff --git a/Ryujinx.HLE/Loaders/Elf/ElfSymbol.cs b/Ryujinx.HLE/Loaders/Elf/ElfSymbol.cs index 3f3a2a79..9f47e353 100644 --- a/Ryujinx.HLE/Loaders/Elf/ElfSymbol.cs +++ b/Ryujinx.HLE/Loaders/Elf/ElfSymbol.cs @@ -2,39 +2,39 @@ namespace Ryujinx.HLE.Loaders.Elf { struct ElfSymbol { - public string Name { get; private set; } + public string Name { get; } - public ElfSymbolType Type { get; private set; } - public ElfSymbolBinding Binding { get; private set; } - public ElfSymbolVisibility Visibility { get; private set; } + public ElfSymbolType Type { get; } + public ElfSymbolBinding Binding { get; } + public ElfSymbolVisibility Visibility { get; } public bool IsFuncOrObject => - Type == ElfSymbolType.STT_FUNC || - Type == ElfSymbolType.STT_OBJECT; + Type == ElfSymbolType.SttFunc || + Type == ElfSymbolType.SttObject; public bool IsGlobalOrWeak => - Binding == ElfSymbolBinding.STB_GLOBAL || - Binding == ElfSymbolBinding.STB_WEAK; + Binding == ElfSymbolBinding.StbGlobal || + Binding == ElfSymbolBinding.StbWeak; - public int SHIdx { get; private set; } - public long Value { get; private set; } - public long Size { get; private set; } + public int ShIdx { get; } + public long Value { get; } + public long Size { get; } public ElfSymbol( - string Name, - int Info, - int Other, - int SHIdx, - long Value, - long Size) + string name, + int info, + int other, + int shIdx, + long value, + long size) { - this.Name = Name; - this.Type = (ElfSymbolType)(Info & 0xf); - this.Binding = (ElfSymbolBinding)(Info >> 4); - this.Visibility = (ElfSymbolVisibility)Other; - this.SHIdx = SHIdx; - this.Value = Value; - this.Size = Size; + Name = name; + Type = (ElfSymbolType)(info & 0xf); + Binding = (ElfSymbolBinding)(info >> 4); + Visibility = (ElfSymbolVisibility)other; + ShIdx = shIdx; + Value = value; + Size = size; } } }
\ No newline at end of file diff --git a/Ryujinx.HLE/Loaders/Elf/ElfSymbolBinding.cs b/Ryujinx.HLE/Loaders/Elf/ElfSymbolBinding.cs index 3c915311..92274fde 100644 --- a/Ryujinx.HLE/Loaders/Elf/ElfSymbolBinding.cs +++ b/Ryujinx.HLE/Loaders/Elf/ElfSymbolBinding.cs @@ -2,8 +2,8 @@ namespace Ryujinx.HLE.Loaders.Elf { enum ElfSymbolBinding { - STB_LOCAL = 0, - STB_GLOBAL = 1, - STB_WEAK = 2 + StbLocal = 0, + StbGlobal = 1, + StbWeak = 2 } }
\ No newline at end of file diff --git a/Ryujinx.HLE/Loaders/Elf/ElfSymbolType.cs b/Ryujinx.HLE/Loaders/Elf/ElfSymbolType.cs index f22e6c45..4110d4c3 100644 --- a/Ryujinx.HLE/Loaders/Elf/ElfSymbolType.cs +++ b/Ryujinx.HLE/Loaders/Elf/ElfSymbolType.cs @@ -2,12 +2,12 @@ namespace Ryujinx.HLE.Loaders.Elf { enum ElfSymbolType { - STT_NOTYPE = 0, - STT_OBJECT = 1, - STT_FUNC = 2, - STT_SECTION = 3, - STT_FILE = 4, - STT_COMMON = 5, - STT_TLS = 6 + SttNoType = 0, + SttObject = 1, + SttFunc = 2, + SttSection = 3, + SttFile = 4, + SttCommon = 5, + SttTls = 6 } }
\ No newline at end of file diff --git a/Ryujinx.HLE/Loaders/Elf/ElfSymbolVisibility.cs b/Ryujinx.HLE/Loaders/Elf/ElfSymbolVisibility.cs index 4bec50a3..f026fca8 100644 --- a/Ryujinx.HLE/Loaders/Elf/ElfSymbolVisibility.cs +++ b/Ryujinx.HLE/Loaders/Elf/ElfSymbolVisibility.cs @@ -2,9 +2,9 @@ namespace Ryujinx.HLE.Loaders.Elf { enum ElfSymbolVisibility { - STV_DEFAULT = 0, - STV_INTERNAL = 1, - STV_HIDDEN = 2, - STV_PROTECTED = 3 + StvDefault = 0, + StvInternal = 1, + StvHidden = 2, + StvProtected = 3 } }
\ No newline at end of file diff --git a/Ryujinx.HLE/Loaders/Executables/IExecutable.cs b/Ryujinx.HLE/Loaders/Executables/IExecutable.cs index d3eefde6..440e8f5f 100644 --- a/Ryujinx.HLE/Loaders/Executables/IExecutable.cs +++ b/Ryujinx.HLE/Loaders/Executables/IExecutable.cs @@ -3,11 +3,11 @@ namespace Ryujinx.HLE.Loaders.Executables interface IExecutable { byte[] Text { get; } - byte[] RO { get; } + byte[] Ro { get; } byte[] Data { get; } int TextOffset { get; } - int ROOffset { get; } + int RoOffset { get; } int DataOffset { get; } int BssOffset { get; } int BssSize { get; } diff --git a/Ryujinx.HLE/Loaders/Executables/KernelInitialProcess.cs b/Ryujinx.HLE/Loaders/Executables/KernelInitialProcess.cs index 1395d56f..d5ab2e8d 100644 --- a/Ryujinx.HLE/Loaders/Executables/KernelInitialProcess.cs +++ b/Ryujinx.HLE/Loaders/Executables/KernelInitialProcess.cs @@ -5,145 +5,145 @@ namespace Ryujinx.HLE.Loaders.Executables { class KernelInitialProcess : IExecutable { - public string Name { get; private set; } + public string Name { get; } - public long TitleId { get; private set; } + public long TitleId { get; } - public int ProcessCategory { get; private set; } + public int ProcessCategory { get; } - public byte MainThreadPriority { get; private set; } - public byte DefaultProcessorId { get; private set; } + public byte MainThreadPriority { get; } + public byte DefaultProcessorId { get; } - public bool Is64Bits { get; private set; } - public bool Addr39Bits { get; private set; } - public bool IsService { get; private set; } + public bool Is64Bits { get; } + public bool Addr39Bits { get; } + public bool IsService { get; } - public byte[] Text { get; private set; } - public byte[] RO { get; private set; } - public byte[] Data { get; private set; } + public byte[] Text { get; } + public byte[] Ro { get; } + public byte[] Data { get; } - public int TextOffset { get; private set; } - public int ROOffset { get; private set; } - public int DataOffset { get; private set; } - public int BssOffset { get; private set; } - public int BssSize { get; private set; } + public int TextOffset { get; } + public int RoOffset { get; } + public int DataOffset { get; } + public int BssOffset { get; } + public int BssSize { get; } - public int MainThreadStackSize { get; private set; } + public int MainThreadStackSize { get; } - public int[] Capabilities { get; private set; } + public int[] Capabilities { get; } private struct SegmentHeader { - public int Offset { get; private set; } - public int DecompressedSize { get; private set; } - public int CompressedSize { get; private set; } - public int Attribute { get; private set; } + public int Offset { get; } + public int DecompressedSize { get; } + public int CompressedSize { get; } + public int Attribute { get; } public SegmentHeader( - int Offset, - int DecompressedSize, - int CompressedSize, - int Attribute) + int offset, + int decompressedSize, + int compressedSize, + int attribute) { - this.Offset = Offset; - this.DecompressedSize = DecompressedSize; - this.CompressedSize = CompressedSize; - this.Attribute = Attribute; + Offset = offset; + DecompressedSize = decompressedSize; + CompressedSize = compressedSize; + Attribute = attribute; } } - public KernelInitialProcess(Stream Input) + public KernelInitialProcess(Stream input) { - BinaryReader Reader = new BinaryReader(Input); + BinaryReader reader = new BinaryReader(input); - string Magic = ReadString(Reader, 4); + string magic = ReadString(reader, 4); - if (Magic != "KIP1") + if (magic != "KIP1") { } - Name = ReadString(Reader, 12); + Name = ReadString(reader, 12); - TitleId = Reader.ReadInt64(); + TitleId = reader.ReadInt64(); - ProcessCategory = Reader.ReadInt32(); + ProcessCategory = reader.ReadInt32(); - MainThreadPriority = Reader.ReadByte(); - DefaultProcessorId = Reader.ReadByte(); + MainThreadPriority = reader.ReadByte(); + DefaultProcessorId = reader.ReadByte(); - byte Reserved = Reader.ReadByte(); - byte Flags = Reader.ReadByte(); + byte reserved = reader.ReadByte(); + byte flags = reader.ReadByte(); - Is64Bits = (Flags & 0x08) != 0; - Addr39Bits = (Flags & 0x10) != 0; - IsService = (Flags & 0x20) != 0; + Is64Bits = (flags & 0x08) != 0; + Addr39Bits = (flags & 0x10) != 0; + IsService = (flags & 0x20) != 0; - SegmentHeader[] Segments = new SegmentHeader[6]; + SegmentHeader[] segments = new SegmentHeader[6]; - for (int Index = 0; Index < Segments.Length; Index++) + for (int index = 0; index < segments.Length; index++) { - Segments[Index] = new SegmentHeader( - Reader.ReadInt32(), - Reader.ReadInt32(), - Reader.ReadInt32(), - Reader.ReadInt32()); + segments[index] = new SegmentHeader( + reader.ReadInt32(), + reader.ReadInt32(), + reader.ReadInt32(), + reader.ReadInt32()); } - TextOffset = Segments[0].Offset; - ROOffset = Segments[1].Offset; - DataOffset = Segments[2].Offset; - BssOffset = Segments[3].Offset; - BssSize = Segments[3].DecompressedSize; + TextOffset = segments[0].Offset; + RoOffset = segments[1].Offset; + DataOffset = segments[2].Offset; + BssOffset = segments[3].Offset; + BssSize = segments[3].DecompressedSize; - MainThreadStackSize = Segments[1].Attribute; + MainThreadStackSize = segments[1].Attribute; Capabilities = new int[8]; - for (int Index = 0; Index < Capabilities.Length; Index++) + for (int index = 0; index < Capabilities.Length; index++) { - Capabilities[Index] = Reader.ReadInt32(); + Capabilities[index] = reader.ReadInt32(); } - Input.Seek(0x100, SeekOrigin.Begin); + input.Seek(0x100, SeekOrigin.Begin); - Text = ReadSegment(Segments[0], Input); - RO = ReadSegment(Segments[1], Input); - Data = ReadSegment(Segments[2], Input); + Text = ReadSegment(segments[0], input); + Ro = ReadSegment(segments[1], input); + Data = ReadSegment(segments[2], input); } - private byte[] ReadSegment(SegmentHeader Header, Stream Input) + private byte[] ReadSegment(SegmentHeader header, Stream input) { - long End = Input.Position + Header.CompressedSize; + long end = input.Position + header.CompressedSize; - Input.Seek(End, SeekOrigin.Begin); + input.Seek(end, SeekOrigin.Begin); - byte[] Data = BackwardsLz.Decompress(Input, Header.DecompressedSize); + byte[] data = BackwardsLz.Decompress(input, header.DecompressedSize); - Input.Seek(End, SeekOrigin.Begin); + input.Seek(end, SeekOrigin.Begin); - return Data; + return data; } - private static string ReadString(BinaryReader Reader, int MaxSize) + private static string ReadString(BinaryReader reader, int maxSize) { - string Value = string.Empty; + string value = string.Empty; - for (int Index = 0; Index < MaxSize; Index++) + for (int index = 0; index < maxSize; index++) { - char Chr = (char)Reader.ReadByte(); + char chr = (char)reader.ReadByte(); - if (Chr == '\0') + if (chr == '\0') { - Reader.BaseStream.Seek(MaxSize - Index - 1, SeekOrigin.Current); + reader.BaseStream.Seek(maxSize - index - 1, SeekOrigin.Current); break; } - Value += Chr; + value += chr; } - return Value; + return value; } } }
\ No newline at end of file diff --git a/Ryujinx.HLE/Loaders/Executables/NxRelocatableObject.cs b/Ryujinx.HLE/Loaders/Executables/NxRelocatableObject.cs index 20de5b5d..071a6fd9 100644 --- a/Ryujinx.HLE/Loaders/Executables/NxRelocatableObject.cs +++ b/Ryujinx.HLE/Loaders/Executables/NxRelocatableObject.cs @@ -4,61 +4,61 @@ namespace Ryujinx.HLE.Loaders.Executables { class NxRelocatableObject : IExecutable { - public byte[] Text { get; private set; } - public byte[] RO { get; private set; } - public byte[] Data { get; private set; } + public byte[] Text { get; } + public byte[] Ro { get; } + public byte[] Data { get; } - public int Mod0Offset { get; private set; } - public int TextOffset { get; private set; } - public int ROOffset { get; private set; } - public int DataOffset { get; private set; } - public int BssSize { get; private set; } + public int Mod0Offset { get; } + public int TextOffset { get; } + public int RoOffset { get; } + public int DataOffset { get; } + public int BssSize { get; } public int BssOffset => DataOffset + Data.Length; - public ulong SourceAddress { get; private set; } - public ulong BssAddress { get; private set; } + public ulong SourceAddress { get; } + public ulong BssAddress { get; } - public NxRelocatableObject(Stream Input, ulong SourceAddress = 0, ulong BssAddress = 0) + public NxRelocatableObject(Stream input, ulong sourceAddress = 0, ulong bssAddress = 0) { - this.SourceAddress = SourceAddress; - this.BssAddress = BssAddress; + SourceAddress = sourceAddress; + BssAddress = bssAddress; - BinaryReader Reader = new BinaryReader(Input); + BinaryReader reader = new BinaryReader(input); - Input.Seek(4, SeekOrigin.Begin); + input.Seek(4, SeekOrigin.Begin); - int Mod0Offset = Reader.ReadInt32(); - int Padding8 = Reader.ReadInt32(); - int Paddingc = Reader.ReadInt32(); - int NroMagic = Reader.ReadInt32(); - int Unknown14 = Reader.ReadInt32(); - int FileSize = Reader.ReadInt32(); - int Unknown1c = Reader.ReadInt32(); - int TextOffset = Reader.ReadInt32(); - int TextSize = Reader.ReadInt32(); - int ROOffset = Reader.ReadInt32(); - int ROSize = Reader.ReadInt32(); - int DataOffset = Reader.ReadInt32(); - int DataSize = Reader.ReadInt32(); - int BssSize = Reader.ReadInt32(); + int mod0Offset = reader.ReadInt32(); + int padding8 = reader.ReadInt32(); + int paddingC = reader.ReadInt32(); + int nroMagic = reader.ReadInt32(); + int unknown14 = reader.ReadInt32(); + int fileSize = reader.ReadInt32(); + int unknown1C = reader.ReadInt32(); + int textOffset = reader.ReadInt32(); + int textSize = reader.ReadInt32(); + int roOffset = reader.ReadInt32(); + int roSize = reader.ReadInt32(); + int dataOffset = reader.ReadInt32(); + int dataSize = reader.ReadInt32(); + int bssSize = reader.ReadInt32(); - this.Mod0Offset = Mod0Offset; - this.TextOffset = TextOffset; - this.ROOffset = ROOffset; - this.DataOffset = DataOffset; - this.BssSize = BssSize; + Mod0Offset = mod0Offset; + TextOffset = textOffset; + RoOffset = roOffset; + DataOffset = dataOffset; + BssSize = bssSize; - byte[] Read(long Position, int Size) + byte[] Read(long position, int size) { - Input.Seek(Position, SeekOrigin.Begin); + input.Seek(position, SeekOrigin.Begin); - return Reader.ReadBytes(Size); + return reader.ReadBytes(size); } - Text = Read(TextOffset, TextSize); - RO = Read(ROOffset, ROSize); - Data = Read(DataOffset, DataSize); + Text = Read(textOffset, textSize); + Ro = Read(roOffset, roSize); + Data = Read(dataOffset, dataSize); } } }
\ No newline at end of file diff --git a/Ryujinx.HLE/Loaders/Executables/NxStaticObject.cs b/Ryujinx.HLE/Loaders/Executables/NxStaticObject.cs index 9fecb650..5509e865 100644 --- a/Ryujinx.HLE/Loaders/Executables/NxStaticObject.cs +++ b/Ryujinx.HLE/Loaders/Executables/NxStaticObject.cs @@ -6,14 +6,14 @@ namespace Ryujinx.HLE.Loaders.Executables { class NxStaticObject : IExecutable { - public byte[] Text { get; private set; } - public byte[] RO { get; private set; } - public byte[] Data { get; private set; } + public byte[] Text { get; } + public byte[] Ro { get; } + public byte[] Data { get; } - public int TextOffset { get; private set; } - public int ROOffset { get; private set; } - public int DataOffset { get; private set; } - public int BssSize { get; private set; } + public int TextOffset { get; } + public int RoOffset { get; } + public int DataOffset { get; } + public int BssSize { get; } public int BssOffset => DataOffset + Data.Length; @@ -21,88 +21,88 @@ namespace Ryujinx.HLE.Loaders.Executables private enum NsoFlags { IsTextCompressed = 1 << 0, - IsROCompressed = 1 << 1, + IsRoCompressed = 1 << 1, IsDataCompressed = 1 << 2, HasTextHash = 1 << 3, - HasROHash = 1 << 4, + HasRoHash = 1 << 4, HasDataHash = 1 << 5 } - public NxStaticObject(Stream Input) + public NxStaticObject(Stream input) { - BinaryReader Reader = new BinaryReader(Input); - - Input.Seek(0, SeekOrigin.Begin); - - int NsoMagic = Reader.ReadInt32(); - int Version = Reader.ReadInt32(); - int Reserved = Reader.ReadInt32(); - int FlagsMsk = Reader.ReadInt32(); - int TextOffset = Reader.ReadInt32(); - int TextMemOffset = Reader.ReadInt32(); - int TextDecSize = Reader.ReadInt32(); - int ModNameOffset = Reader.ReadInt32(); - int ROOffset = Reader.ReadInt32(); - int ROMemOffset = Reader.ReadInt32(); - int RODecSize = Reader.ReadInt32(); - int ModNameSize = Reader.ReadInt32(); - int DataOffset = Reader.ReadInt32(); - int DataMemOffset = Reader.ReadInt32(); - int DataDecSize = Reader.ReadInt32(); - int BssSize = Reader.ReadInt32(); - - byte[] BuildId = Reader.ReadBytes(0x20); - - int TextSize = Reader.ReadInt32(); - int ROSize = Reader.ReadInt32(); - int DataSize = Reader.ReadInt32(); - - Input.Seek(0x24, SeekOrigin.Current); - - int DynStrOffset = Reader.ReadInt32(); - int DynStrSize = Reader.ReadInt32(); - int DynSymOffset = Reader.ReadInt32(); - int DynSymSize = Reader.ReadInt32(); - - byte[] TextHash = Reader.ReadBytes(0x20); - byte[] ROHash = Reader.ReadBytes(0x20); - byte[] DataHash = Reader.ReadBytes(0x20); - - NsoFlags Flags = (NsoFlags)FlagsMsk; - - this.TextOffset = TextMemOffset; - this.ROOffset = ROMemOffset; - this.DataOffset = DataMemOffset; - this.BssSize = BssSize; + BinaryReader reader = new BinaryReader(input); + + input.Seek(0, SeekOrigin.Begin); + + int nsoMagic = reader.ReadInt32(); + int version = reader.ReadInt32(); + int reserved = reader.ReadInt32(); + int flagsMsk = reader.ReadInt32(); + int textOffset = reader.ReadInt32(); + int textMemOffset = reader.ReadInt32(); + int textDecSize = reader.ReadInt32(); + int modNameOffset = reader.ReadInt32(); + int roOffset = reader.ReadInt32(); + int roMemOffset = reader.ReadInt32(); + int roDecSize = reader.ReadInt32(); + int modNameSize = reader.ReadInt32(); + int dataOffset = reader.ReadInt32(); + int dataMemOffset = reader.ReadInt32(); + int dataDecSize = reader.ReadInt32(); + int bssSize = reader.ReadInt32(); + + byte[] buildId = reader.ReadBytes(0x20); + + int textSize = reader.ReadInt32(); + int roSize = reader.ReadInt32(); + int dataSize = reader.ReadInt32(); + + input.Seek(0x24, SeekOrigin.Current); + + int dynStrOffset = reader.ReadInt32(); + int dynStrSize = reader.ReadInt32(); + int dynSymOffset = reader.ReadInt32(); + int dynSymSize = reader.ReadInt32(); + + byte[] textHash = reader.ReadBytes(0x20); + byte[] roHash = reader.ReadBytes(0x20); + byte[] dataHash = reader.ReadBytes(0x20); + + NsoFlags flags = (NsoFlags)flagsMsk; + + TextOffset = textMemOffset; + RoOffset = roMemOffset; + DataOffset = dataMemOffset; + BssSize = bssSize; //Text segment - Input.Seek(TextOffset, SeekOrigin.Begin); + input.Seek(textOffset, SeekOrigin.Begin); - Text = Reader.ReadBytes(TextSize); + Text = reader.ReadBytes(textSize); - if (Flags.HasFlag(NsoFlags.IsTextCompressed)) + if (flags.HasFlag(NsoFlags.IsTextCompressed)) { - Text = Lz4.Decompress(Text, TextDecSize); + Text = Lz4.Decompress(Text, textDecSize); } //Read-only data segment - Input.Seek(ROOffset, SeekOrigin.Begin); + input.Seek(roOffset, SeekOrigin.Begin); - RO = Reader.ReadBytes(ROSize); + Ro = reader.ReadBytes(roSize); - if (Flags.HasFlag(NsoFlags.IsROCompressed)) + if (flags.HasFlag(NsoFlags.IsRoCompressed)) { - RO = Lz4.Decompress(RO, RODecSize); + Ro = Lz4.Decompress(Ro, roDecSize); } //Data segment - Input.Seek(DataOffset, SeekOrigin.Begin); + input.Seek(dataOffset, SeekOrigin.Begin); - Data = Reader.ReadBytes(DataSize); + Data = reader.ReadBytes(dataSize); - if (Flags.HasFlag(NsoFlags.IsDataCompressed)) + if (flags.HasFlag(NsoFlags.IsDataCompressed)) { - Data = Lz4.Decompress(Data, DataDecSize); + Data = Lz4.Decompress(Data, dataDecSize); } } } diff --git a/Ryujinx.HLE/Loaders/Npdm/ACI0.cs b/Ryujinx.HLE/Loaders/Npdm/ACI0.cs index 4bec93e4..28e11a48 100644 --- a/Ryujinx.HLE/Loaders/Npdm/ACI0.cs +++ b/Ryujinx.HLE/Loaders/Npdm/ACI0.cs @@ -3,51 +3,51 @@ using System.IO; namespace Ryujinx.HLE.Loaders.Npdm { - class ACI0 + class Aci0 { - private const int ACI0Magic = 'A' << 0 | 'C' << 8 | 'I' << 16 | '0' << 24; + private const int Aci0Magic = 'A' << 0 | 'C' << 8 | 'I' << 16 | '0' << 24; - public long TitleId { get; private set; } + public long TitleId { get; } - public int FsVersion { get; private set; } - public ulong FsPermissionsBitmask { get; private set; } + public int FsVersion { get; } + public ulong FsPermissionsBitmask { get; } - public ServiceAccessControl ServiceAccessControl { get; private set; } - public KernelAccessControl KernelAccessControl { get; private set; } + public ServiceAccessControl ServiceAccessControl { get; } + public KernelAccessControl KernelAccessControl { get; } - public ACI0(Stream Stream, int Offset) + public Aci0(Stream stream, int offset) { - Stream.Seek(Offset, SeekOrigin.Begin); + stream.Seek(offset, SeekOrigin.Begin); - BinaryReader Reader = new BinaryReader(Stream); + BinaryReader reader = new BinaryReader(stream); - if (Reader.ReadInt32() != ACI0Magic) + if (reader.ReadInt32() != Aci0Magic) { throw new InvalidNpdmException("ACI0 Stream doesn't contain ACI0 section!"); } - Stream.Seek(0xc, SeekOrigin.Current); + stream.Seek(0xc, SeekOrigin.Current); - TitleId = Reader.ReadInt64(); + TitleId = reader.ReadInt64(); //Reserved. - Stream.Seek(8, SeekOrigin.Current); + stream.Seek(8, SeekOrigin.Current); - int FsAccessHeaderOffset = Reader.ReadInt32(); - int FsAccessHeaderSize = Reader.ReadInt32(); - int ServiceAccessControlOffset = Reader.ReadInt32(); - int ServiceAccessControlSize = Reader.ReadInt32(); - int KernelAccessControlOffset = Reader.ReadInt32(); - int KernelAccessControlSize = Reader.ReadInt32(); + int fsAccessHeaderOffset = reader.ReadInt32(); + int fsAccessHeaderSize = reader.ReadInt32(); + int serviceAccessControlOffset = reader.ReadInt32(); + int serviceAccessControlSize = reader.ReadInt32(); + int kernelAccessControlOffset = reader.ReadInt32(); + int kernelAccessControlSize = reader.ReadInt32(); - FsAccessHeader FsAccessHeader = new FsAccessHeader(Stream, Offset + FsAccessHeaderOffset, FsAccessHeaderSize); + FsAccessHeader fsAccessHeader = new FsAccessHeader(stream, offset + fsAccessHeaderOffset, fsAccessHeaderSize); - FsVersion = FsAccessHeader.Version; - FsPermissionsBitmask = FsAccessHeader.PermissionsBitmask; + FsVersion = fsAccessHeader.Version; + FsPermissionsBitmask = fsAccessHeader.PermissionsBitmask; - ServiceAccessControl = new ServiceAccessControl(Stream, Offset + ServiceAccessControlOffset, ServiceAccessControlSize); + ServiceAccessControl = new ServiceAccessControl(stream, offset + serviceAccessControlOffset, serviceAccessControlSize); - KernelAccessControl = new KernelAccessControl(Stream, Offset + KernelAccessControlOffset, KernelAccessControlSize); + KernelAccessControl = new KernelAccessControl(stream, offset + kernelAccessControlOffset, kernelAccessControlSize); } } } diff --git a/Ryujinx.HLE/Loaders/Npdm/ACID.cs b/Ryujinx.HLE/Loaders/Npdm/ACID.cs index 9206ee7b..3ff87357 100644 --- a/Ryujinx.HLE/Loaders/Npdm/ACID.cs +++ b/Ryujinx.HLE/Loaders/Npdm/ACID.cs @@ -3,59 +3,59 @@ using System.IO; namespace Ryujinx.HLE.Loaders.Npdm { - class ACID + class Acid { - private const int ACIDMagic = 'A' << 0 | 'C' << 8 | 'I' << 16 | 'D' << 24; + private const int AcidMagic = 'A' << 0 | 'C' << 8 | 'I' << 16 | 'D' << 24; - public byte[] RSA2048Signature { get; private set; } - public byte[] RSA2048Modulus { get; private set; } - public int Unknown1 { get; private set; } - public int Flags { get; private set; } + public byte[] Rsa2048Signature { get; } + public byte[] Rsa2048Modulus { get; } + public int Unknown1 { get; } + public int Flags { get; } - public long TitleIdRangeMin { get; private set; } - public long TitleIdRangeMax { get; private set; } + public long TitleIdRangeMin { get; } + public long TitleIdRangeMax { get; } - public FsAccessControl FsAccessControl { get; private set; } - public ServiceAccessControl ServiceAccessControl { get; private set; } - public KernelAccessControl KernelAccessControl { get; private set; } + public FsAccessControl FsAccessControl { get; } + public ServiceAccessControl ServiceAccessControl { get; } + public KernelAccessControl KernelAccessControl { get; } - public ACID(Stream Stream, int Offset) + public Acid(Stream stream, int offset) { - Stream.Seek(Offset, SeekOrigin.Begin); + stream.Seek(offset, SeekOrigin.Begin); - BinaryReader Reader = new BinaryReader(Stream); + BinaryReader reader = new BinaryReader(stream); - RSA2048Signature = Reader.ReadBytes(0x100); - RSA2048Modulus = Reader.ReadBytes(0x100); + Rsa2048Signature = reader.ReadBytes(0x100); + Rsa2048Modulus = reader.ReadBytes(0x100); - if (Reader.ReadInt32() != ACIDMagic) + if (reader.ReadInt32() != AcidMagic) { throw new InvalidNpdmException("ACID Stream doesn't contain ACID section!"); } //Size field used with the above signature (?). - Unknown1 = Reader.ReadInt32(); + Unknown1 = reader.ReadInt32(); - Reader.ReadInt32(); + reader.ReadInt32(); //Bit0 must be 1 on retail, on devunit 0 is also allowed. Bit1 is unknown. - Flags = Reader.ReadInt32(); + Flags = reader.ReadInt32(); - TitleIdRangeMin = Reader.ReadInt64(); - TitleIdRangeMax = Reader.ReadInt64(); + TitleIdRangeMin = reader.ReadInt64(); + TitleIdRangeMax = reader.ReadInt64(); - int FsAccessControlOffset = Reader.ReadInt32(); - int FsAccessControlSize = Reader.ReadInt32(); - int ServiceAccessControlOffset = Reader.ReadInt32(); - int ServiceAccessControlSize = Reader.ReadInt32(); - int KernelAccessControlOffset = Reader.ReadInt32(); - int KernelAccessControlSize = Reader.ReadInt32(); + int fsAccessControlOffset = reader.ReadInt32(); + int fsAccessControlSize = reader.ReadInt32(); + int serviceAccessControlOffset = reader.ReadInt32(); + int serviceAccessControlSize = reader.ReadInt32(); + int kernelAccessControlOffset = reader.ReadInt32(); + int kernelAccessControlSize = reader.ReadInt32(); - FsAccessControl = new FsAccessControl(Stream, Offset + FsAccessControlOffset, FsAccessControlSize); + FsAccessControl = new FsAccessControl(stream, offset + fsAccessControlOffset, fsAccessControlSize); - ServiceAccessControl = new ServiceAccessControl(Stream, Offset + ServiceAccessControlOffset, ServiceAccessControlSize); + ServiceAccessControl = new ServiceAccessControl(stream, offset + serviceAccessControlOffset, serviceAccessControlSize); - KernelAccessControl = new KernelAccessControl(Stream, Offset + KernelAccessControlOffset, KernelAccessControlSize); + KernelAccessControl = new KernelAccessControl(stream, offset + kernelAccessControlOffset, kernelAccessControlSize); } } } diff --git a/Ryujinx.HLE/Loaders/Npdm/FsAccessControl.cs b/Ryujinx.HLE/Loaders/Npdm/FsAccessControl.cs index 00faf321..e246f026 100644 --- a/Ryujinx.HLE/Loaders/Npdm/FsAccessControl.cs +++ b/Ryujinx.HLE/Loaders/Npdm/FsAccessControl.cs @@ -4,25 +4,25 @@ namespace Ryujinx.HLE.Loaders.Npdm { class FsAccessControl { - public int Version { get; private set; } - public ulong PermissionsBitmask { get; private set; } - public int Unknown1 { get; private set; } - public int Unknown2 { get; private set; } - public int Unknown3 { get; private set; } - public int Unknown4 { get; private set; } + public int Version { get; } + public ulong PermissionsBitmask { get; } + public int Unknown1 { get; } + public int Unknown2 { get; } + public int Unknown3 { get; } + public int Unknown4 { get; } - public FsAccessControl(Stream Stream, int Offset, int Size) + public FsAccessControl(Stream stream, int offset, int size) { - Stream.Seek(Offset, SeekOrigin.Begin); + stream.Seek(offset, SeekOrigin.Begin); - BinaryReader Reader = new BinaryReader(Stream); + BinaryReader reader = new BinaryReader(stream); - Version = Reader.ReadInt32(); - PermissionsBitmask = Reader.ReadUInt64(); - Unknown1 = Reader.ReadInt32(); - Unknown2 = Reader.ReadInt32(); - Unknown3 = Reader.ReadInt32(); - Unknown4 = Reader.ReadInt32(); + Version = reader.ReadInt32(); + PermissionsBitmask = reader.ReadUInt64(); + Unknown1 = reader.ReadInt32(); + Unknown2 = reader.ReadInt32(); + Unknown3 = reader.ReadInt32(); + Unknown4 = reader.ReadInt32(); } } } diff --git a/Ryujinx.HLE/Loaders/Npdm/FsAccessHeader.cs b/Ryujinx.HLE/Loaders/Npdm/FsAccessHeader.cs index 50e82309..97fb3b14 100644 --- a/Ryujinx.HLE/Loaders/Npdm/FsAccessHeader.cs +++ b/Ryujinx.HLE/Loaders/Npdm/FsAccessHeader.cs @@ -6,29 +6,29 @@ namespace Ryujinx.HLE.Loaders.Npdm { class FsAccessHeader { - public int Version { get; private set; } - public ulong PermissionsBitmask { get; private set; } + public int Version { get; } + public ulong PermissionsBitmask { get; } - public FsAccessHeader(Stream Stream, int Offset, int Size) + public FsAccessHeader(Stream stream, int offset, int size) { - Stream.Seek(Offset, SeekOrigin.Begin); + stream.Seek(offset, SeekOrigin.Begin); - BinaryReader Reader = new BinaryReader(Stream); + BinaryReader reader = new BinaryReader(stream); - Version = Reader.ReadInt32(); - PermissionsBitmask = Reader.ReadUInt64(); + Version = reader.ReadInt32(); + PermissionsBitmask = reader.ReadUInt64(); - int DataSize = Reader.ReadInt32(); + int dataSize = reader.ReadInt32(); - if (DataSize != 0x1c) + if (dataSize != 0x1c) { throw new InvalidNpdmException("FsAccessHeader is corrupted!"); } - int ContentOwnerIdSize = Reader.ReadInt32(); - int DataAndContentOwnerIdSize = Reader.ReadInt32(); + int contentOwnerIdSize = reader.ReadInt32(); + int dataAndContentOwnerIdSize = reader.ReadInt32(); - if (DataAndContentOwnerIdSize != 0x1c) + if (dataAndContentOwnerIdSize != 0x1c) { throw new NotImplementedException("ContentOwnerId section is not implemented!"); } diff --git a/Ryujinx.HLE/Loaders/Npdm/KernelAccessControl.cs b/Ryujinx.HLE/Loaders/Npdm/KernelAccessControl.cs index 611eda39..a2f525f7 100644 --- a/Ryujinx.HLE/Loaders/Npdm/KernelAccessControl.cs +++ b/Ryujinx.HLE/Loaders/Npdm/KernelAccessControl.cs @@ -4,19 +4,19 @@ namespace Ryujinx.HLE.Loaders.Npdm { class KernelAccessControl { - public int[] Capabilities { get; private set; } + public int[] Capabilities { get; } - public KernelAccessControl(Stream Stream, int Offset, int Size) + public KernelAccessControl(Stream stream, int offset, int size) { - Stream.Seek(Offset, SeekOrigin.Begin); + stream.Seek(offset, SeekOrigin.Begin); - Capabilities = new int[Size / 4]; + Capabilities = new int[size / 4]; - BinaryReader Reader = new BinaryReader(Stream); + BinaryReader reader = new BinaryReader(stream); - for (int Index = 0; Index < Capabilities.Length; Index++) + for (int index = 0; index < Capabilities.Length; index++) { - Capabilities[Index] = Reader.ReadInt32(); + Capabilities[index] = reader.ReadInt32(); } } } diff --git a/Ryujinx.HLE/Loaders/Npdm/Npdm.cs b/Ryujinx.HLE/Loaders/Npdm/Npdm.cs index 6d74668a..2ffef327 100644 --- a/Ryujinx.HLE/Loaders/Npdm/Npdm.cs +++ b/Ryujinx.HLE/Loaders/Npdm/Npdm.cs @@ -11,62 +11,62 @@ namespace Ryujinx.HLE.Loaders.Npdm { private const int MetaMagic = 'M' << 0 | 'E' << 8 | 'T' << 16 | 'A' << 24; - public byte MmuFlags { get; private set; } - public bool Is64Bits { get; private set; } - public byte MainThreadPriority { get; private set; } - public byte DefaultCpuId { get; private set; } - public int PersonalMmHeapSize { get; private set; } - public int ProcessCategory { get; private set; } - public int MainThreadStackSize { get; private set; } - public string TitleName { get; private set; } - public byte[] ProductCode { get; private set; } - - public ACI0 ACI0 { get; private set; } - public ACID ACID { get; private set; } - - public Npdm(Stream Stream) + public byte MmuFlags { get; } + public bool Is64Bits { get; } + public byte MainThreadPriority { get; } + public byte DefaultCpuId { get; } + public int PersonalMmHeapSize { get; } + public int ProcessCategory { get; } + public int MainThreadStackSize { get; } + public string TitleName { get; } + public byte[] ProductCode { get; } + + public Aci0 Aci0 { get; } + public Acid Acid { get; } + + public Npdm(Stream stream) { - BinaryReader Reader = new BinaryReader(Stream); + BinaryReader reader = new BinaryReader(stream); - if (Reader.ReadInt32() != MetaMagic) + if (reader.ReadInt32() != MetaMagic) { throw new InvalidNpdmException("NPDM Stream doesn't contain NPDM file!"); } - Reader.ReadInt64(); + reader.ReadInt64(); - MmuFlags = Reader.ReadByte(); + MmuFlags = reader.ReadByte(); Is64Bits = (MmuFlags & 1) != 0; - Reader.ReadByte(); + reader.ReadByte(); - MainThreadPriority = Reader.ReadByte(); - DefaultCpuId = Reader.ReadByte(); + MainThreadPriority = reader.ReadByte(); + DefaultCpuId = reader.ReadByte(); - Reader.ReadInt32(); + reader.ReadInt32(); - PersonalMmHeapSize = Reader.ReadInt32(); + PersonalMmHeapSize = reader.ReadInt32(); - ProcessCategory = Reader.ReadInt32(); + ProcessCategory = reader.ReadInt32(); - MainThreadStackSize = Reader.ReadInt32(); + MainThreadStackSize = reader.ReadInt32(); - byte[] TempTitleName = Reader.ReadBytes(0x10); + byte[] tempTitleName = reader.ReadBytes(0x10); - TitleName = Encoding.UTF8.GetString(TempTitleName, 0, TempTitleName.Length).Trim('\0'); + TitleName = Encoding.UTF8.GetString(tempTitleName, 0, tempTitleName.Length).Trim('\0'); - ProductCode = Reader.ReadBytes(0x10); + ProductCode = reader.ReadBytes(0x10); - Stream.Seek(0x30, SeekOrigin.Current); + stream.Seek(0x30, SeekOrigin.Current); - int ACI0Offset = Reader.ReadInt32(); - int ACI0Size = Reader.ReadInt32(); - int ACIDOffset = Reader.ReadInt32(); - int ACIDSize = Reader.ReadInt32(); + int aci0Offset = reader.ReadInt32(); + int aci0Size = reader.ReadInt32(); + int acidOffset = reader.ReadInt32(); + int acidSize = reader.ReadInt32(); - ACI0 = new ACI0(Stream, ACI0Offset); - ACID = new ACID(Stream, ACIDOffset); + Aci0 = new Aci0(stream, aci0Offset); + Acid = new Acid(stream, acidOffset); } } } diff --git a/Ryujinx.HLE/Loaders/Npdm/ServiceAccessControl.cs b/Ryujinx.HLE/Loaders/Npdm/ServiceAccessControl.cs index 707be603..d349f26b 100644 --- a/Ryujinx.HLE/Loaders/Npdm/ServiceAccessControl.cs +++ b/Ryujinx.HLE/Loaders/Npdm/ServiceAccessControl.cs @@ -7,36 +7,36 @@ namespace Ryujinx.HLE.Loaders.Npdm { class ServiceAccessControl { - public IReadOnlyDictionary<string, bool> Services { get; private set; } + public IReadOnlyDictionary<string, bool> Services { get; } - public ServiceAccessControl(Stream Stream, int Offset, int Size) + public ServiceAccessControl(Stream stream, int offset, int size) { - Stream.Seek(Offset, SeekOrigin.Begin); + stream.Seek(offset, SeekOrigin.Begin); - BinaryReader Reader = new BinaryReader(Stream); + BinaryReader reader = new BinaryReader(stream); - int ByteReaded = 0; + int byteReaded = 0; - Dictionary<string, bool> Services = new Dictionary<string, bool>(); + Dictionary<string, bool> services = new Dictionary<string, bool>(); - while (ByteReaded != Size) + while (byteReaded != size) { - byte ControlByte = Reader.ReadByte(); + byte controlByte = reader.ReadByte(); - if (ControlByte == 0) + if (controlByte == 0) { break; } - int Length = (ControlByte & 0x07) + 1; - bool RegisterAllowed = (ControlByte & 0x80) != 0; + int length = (controlByte & 0x07) + 1; + bool registerAllowed = (controlByte & 0x80) != 0; - Services.Add(Encoding.ASCII.GetString(Reader.ReadBytes(Length), 0, Length), RegisterAllowed); + services.Add(Encoding.ASCII.GetString(reader.ReadBytes(length), 0, length), registerAllowed); - ByteReaded += Length + 1; + byteReaded += length + 1; } - this.Services = new ReadOnlyDictionary<string, bool>(Services); + Services = new ReadOnlyDictionary<string, bool>(services); } } } |
