Add NRR and NRO constants

This commit is contained in:
Thog 2018-10-08 19:49:42 +02:00
commit ef7bd49eae
No known key found for this signature in database
GPG key ID: 0CD291558FAFDBC6

View file

@ -85,6 +85,9 @@ namespace Ryujinx.HLE.HOS.Services.Ldr
private const int MaxNrr = 0x40; private const int MaxNrr = 0x40;
private const int MaxNro = 0x40; private const int MaxNro = 0x40;
private const uint NrrMagic = 0x3052524E;
private const uint NroMagic = 0x304F524E;
private List<NrrInfo> NrrInfos; private List<NrrInfo> NrrInfos;
private List<NroInfo> NroInfos; private List<NroInfo> NroInfos;
@ -121,7 +124,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldr
StructReader Reader = new StructReader(Context.Memory, NrrAddress); StructReader Reader = new StructReader(Context.Memory, NrrAddress);
NrrHeader Header = Reader.Read<NrrHeader>(); NrrHeader Header = Reader.Read<NrrHeader>();
if (Header.Magic != 0x3052524E) if (Header.Magic != NrrMagic)
{ {
return MakeError(ErrorModule.Loader, LoaderErr.InvalidNrr); return MakeError(ErrorModule.Loader, LoaderErr.InvalidNrr);
} }
@ -195,7 +198,7 @@ namespace Ryujinx.HLE.HOS.Services.Ldr
uint Magic = Context.Memory.ReadUInt32(NroHeapAddress + 0x10); uint Magic = Context.Memory.ReadUInt32(NroHeapAddress + 0x10);
uint NroFileSize = Context.Memory.ReadUInt32(NroHeapAddress + 0x18); uint NroFileSize = Context.Memory.ReadUInt32(NroHeapAddress + 0x18);
if (Magic != 0x304F524E || NroSize != NroFileSize) if (Magic != NroMagic || NroSize != NroFileSize)
{ {
return MakeError(ErrorModule.Loader, LoaderErr.InvalidNro); return MakeError(ErrorModule.Loader, LoaderErr.InvalidNro);
} }