KernelAccessControl.cs
1 using System.IO; 2 3 namespace Ryujinx.HLE.Loaders.Npdm 4 { 5 public class KernelAccessControl 6 { 7 public int[] Capabilities { get; private set; } 8 9 /// <exception cref="System.ArgumentException">The stream does not support reading, is <see langword="null"/>, or is already closed.</exception> 10 /// <exception cref="EndOfStreamException">The end of the stream is reached.</exception> 11 /// <exception cref="System.ObjectDisposedException">The stream is closed.</exception> 12 /// <exception cref="IOException">An I/O error occurred.</exception> 13 public KernelAccessControl(Stream stream, int offset, int size) 14 { 15 stream.Seek(offset, SeekOrigin.Begin); 16 17 Capabilities = new int[size / 4]; 18 19 BinaryReader reader = new(stream); 20 21 for (int index = 0; index < Capabilities.Length; index++) 22 { 23 Capabilities[index] = reader.ReadInt32(); 24 } 25 } 26 } 27 }