mirror of
https://github.com/ryujinx-mirror/ryujinx.git
synced 2024-12-23 23:05:48 +00:00
4e430760b4
* Implement NPDM files parser (Currently not used in Ryujinx) * Add credits * Add Swap32 * Update Npdm.cs * Update ACI0.cs * Update ACID.cs * Update Npdm.cs * Update EndianSwap.cs * Update ACI0.cs * Update ACID.cs * Update KernelAccessControl.cs * Update NpdmInfo.cs * Update ServiceAccessControl.cs * Update NpdmInfo.cs
38 lines
1.1 KiB
C#
38 lines
1.1 KiB
C#
using System.IO;
|
|
|
|
namespace Ryujinx.HLE.Loaders.Npdm
|
|
{
|
|
public class FSAccessHeader
|
|
{
|
|
public int Version;
|
|
public ulong PermissionsBitmask;
|
|
public int DataSize;
|
|
public int ContentOwnerIDSize;
|
|
public int DataAndContentOwnerIDSize;
|
|
|
|
public FSAccessHeader(Stream FSAccessHeaderStream, int Offset, int Size)
|
|
{
|
|
FSAccessHeaderStream.Seek(Offset, SeekOrigin.Begin);
|
|
|
|
BinaryReader Reader = new BinaryReader(FSAccessHeaderStream);
|
|
|
|
Version = Reader.ReadInt32();
|
|
PermissionsBitmask = Reader.ReadUInt64();
|
|
DataSize = Reader.ReadInt32();
|
|
|
|
if (DataSize != 0x1C)
|
|
{
|
|
throw new InvalidNpdmException("FSAccessHeader is corrupted!");
|
|
}
|
|
|
|
ContentOwnerIDSize = Reader.ReadInt32();
|
|
DataAndContentOwnerIDSize = Reader.ReadInt32();
|
|
|
|
if (DataAndContentOwnerIDSize != 0x1C)
|
|
{
|
|
throw new InvalidNpdmException("ContentOwnerID section is not implemented!");
|
|
}
|
|
}
|
|
}
|
|
}
|