2023-12-04 14:17:13 +01:00
|
|
|
using System.IO;
|
2018-11-29 13:01:19 +11:00
|
|
|
|
|
|
|
namespace Ryujinx.HLE.Loaders.Npdm
|
|
|
|
{
|
2019-11-29 04:32:51 +00:00
|
|
|
public class KernelAccessControl
|
2018-11-29 13:01:19 +11:00
|
|
|
{
|
2018-12-04 22:52:39 -02:00
|
|
|
public int[] Capabilities { get; private set; }
|
2018-11-29 13:01:19 +11:00
|
|
|
|
2024-07-20 21:35:43 +02:00
|
|
|
/// <exception cref="System.ArgumentException">The stream does not support reading, is <see langword="null"/>, or is already closed.</exception>
|
|
|
|
/// <exception cref="EndOfStreamException">The end of the stream is reached.</exception>
|
|
|
|
/// <exception cref="System.ObjectDisposedException">The stream is closed.</exception>
|
|
|
|
/// <exception cref="IOException">An I/O error occurred.</exception>
|
2018-12-06 05:16:24 -06:00
|
|
|
public KernelAccessControl(Stream stream, int offset, int size)
|
2018-11-29 13:01:19 +11:00
|
|
|
{
|
2018-12-06 05:16:24 -06:00
|
|
|
stream.Seek(offset, SeekOrigin.Begin);
|
2018-11-29 13:01:19 +11:00
|
|
|
|
2018-12-06 05:16:24 -06:00
|
|
|
Capabilities = new int[size / 4];
|
2018-11-29 13:01:19 +11:00
|
|
|
|
2023-07-16 19:31:14 +02:00
|
|
|
BinaryReader reader = new(stream);
|
2018-11-29 13:01:19 +11:00
|
|
|
|
2018-12-06 05:16:24 -06:00
|
|
|
for (int index = 0; index < Capabilities.Length; index++)
|
2018-11-29 13:01:19 +11:00
|
|
|
{
|
2018-12-06 05:16:24 -06:00
|
|
|
Capabilities[index] = reader.ReadInt32();
|
2018-11-29 13:01:19 +11:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|