Implement NPDM files parser (#169)
* 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
This commit is contained in:
parent
3c4dafff3f
commit
4e430760b4
10 changed files with 753 additions and 0 deletions
37
Ryujinx.HLE/Loaders/Npdm/FSAccessHeader.cs
Normal file
37
Ryujinx.HLE/Loaders/Npdm/FSAccessHeader.cs
Normal file
|
@ -0,0 +1,37 @@
|
|||
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!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue