Stylefix for nro

This commit is contained in:
plutoo 2018-02-26 02:10:49 +01:00
parent 7b0e4194de
commit d3cc781bf6
2 changed files with 17 additions and 17 deletions

View File

@ -6,35 +6,35 @@
#pragma once
#define NROHEADER_MAGICNUM 0x304f524e
#define NROHEADER_MAGIC 0x304f524e
#define NROASSETHEADER_MAGICNUM 0x54455341
#define NROASSETHEADER_MAGIC 0x54455341
#define NROASSETHEADER_VERSION 0
/// Entry for each segment in the codebin.
typedef struct {
u32 FileOff;
u32 Size;
} NsoSegment;
u32 file_off;
u32 size;
} NroSegment;
/// Offset 0x0 in the NRO.
typedef struct {
u32 unused;
u32 modOffset;
u8 Padding[8];
u32 mod_offset;
u8 padding[8];
} NroStart;
/// This follows NroStart, the actual nro-header.
typedef struct {
u32 Magic;
u32 Unk1;
u32 magic;
u32 unk1;
u32 size;
u32 Unk2;
NsoSegment Segments[3];
u32 bssSize;
u32 Unk3;
u8 BuildId[0x20];
u8 Padding[0x20];
u32 unk2;
NroSegment segments[3];
u32 bss_size;
u32 unk3;
u8 build_id[0x20];
u8 padding[0x20];
} NroHeader;
/// Custom asset section.

View File

@ -216,10 +216,10 @@ Result romfsMount(struct romfs_mount **p)
NroAssetHeader asset_header;
if (!_romfs_read_chk(mount, sizeof(NroStart), &hdr, sizeof(hdr))) goto _fail0;
if (hdr.Magic != NROHEADER_MAGICNUM) goto _fail0;
if (hdr.magic != NROHEADER_MAGIC) goto _fail0;
if (!_romfs_read_chk(mount, hdr.size, &asset_header, sizeof(asset_header))) goto _fail0;
if (asset_header.magic != NROASSETHEADER_MAGICNUM
if (asset_header.magic != NROASSETHEADER_MAGIC
|| asset_header.version > NROASSETHEADER_VERSION
|| asset_header.romfs.offset == 0
|| asset_header.romfs.size == 0)