Archived
1
0
Fork 0
forked from Mirror/Ryujinx
This repository has been archived on 2024-10-11. You can view files and clone it, but cannot push or open issues or pull requests.
jinx/Ryujinx.HLE/Loaders/Npdm/FSAccessHeader.cs

38 lines
1.1 KiB
C#
Raw Normal View History

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!");
}
}
}
}