mirror of
https://github.com/switchbrew/libnx.git
synced 2025-08-06 00:19:22 +02:00
Added Nro prefix to Asset in nro.h + updated romfs_dev for this.
This commit is contained in:
parent
4c1b09d6b9
commit
e24c20f9e7
@ -8,8 +8,8 @@
|
|||||||
|
|
||||||
#define NROHEADER_MAGICNUM 0x304f524e
|
#define NROHEADER_MAGICNUM 0x304f524e
|
||||||
|
|
||||||
#define ASSETHEADER_MAGICNUM 0x54455341
|
#define NROASSETHEADER_MAGICNUM 0x54455341
|
||||||
#define ASSETHEADER_VERSION 0
|
#define NROASSETHEADER_VERSION 0
|
||||||
|
|
||||||
/// Entry for each segment in the codebin.
|
/// Entry for each segment in the codebin.
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@ -41,14 +41,14 @@ typedef struct {
|
|||||||
typedef struct {
|
typedef struct {
|
||||||
u64 offset;
|
u64 offset;
|
||||||
u64 size;
|
u64 size;
|
||||||
} AssetSection;
|
} NroAssetSection;
|
||||||
|
|
||||||
/// Custom asset header.
|
/// Custom asset header.
|
||||||
typedef struct {
|
typedef struct {
|
||||||
u32 magic;
|
u32 magic;
|
||||||
u32 version;
|
u32 version;
|
||||||
AssetSection icon;
|
NroAssetSection icon;
|
||||||
AssetSection nacp;
|
NroAssetSection nacp;
|
||||||
AssetSection romfs;
|
NroAssetSection romfs;
|
||||||
} AssetHeader;
|
} NroAssetHeader;
|
||||||
|
|
||||||
|
@ -213,14 +213,14 @@ Result romfsMount(struct romfs_mount **p)
|
|||||||
romfsInitMtime(mount);
|
romfsInitMtime(mount);
|
||||||
|
|
||||||
NroHeader hdr;
|
NroHeader hdr;
|
||||||
AssetHeader asset_header;
|
NroAssetHeader asset_header;
|
||||||
|
|
||||||
if (!_romfs_read_chk(mount, sizeof(NroStart), &hdr, sizeof(hdr))) goto _fail0;
|
if (!_romfs_read_chk(mount, sizeof(NroStart), &hdr, sizeof(hdr))) goto _fail0;
|
||||||
if (hdr.Magic != NROHEADER_MAGICNUM) goto _fail0;
|
if (hdr.Magic != NROHEADER_MAGICNUM) goto _fail0;
|
||||||
if (!_romfs_read_chk(mount, hdr.size, &asset_header, sizeof(asset_header))) goto _fail0;
|
if (!_romfs_read_chk(mount, hdr.size, &asset_header, sizeof(asset_header))) goto _fail0;
|
||||||
|
|
||||||
if (asset_header.magic != ASSETHEADER_MAGICNUM
|
if (asset_header.magic != NROASSETHEADER_MAGICNUM
|
||||||
|| asset_header.version > ASSETHEADER_VERSION
|
|| asset_header.version > NROASSETHEADER_VERSION
|
||||||
|| asset_header.romfs.offset == 0
|
|| asset_header.romfs.offset == 0
|
||||||
|| asset_header.romfs.size == 0)
|
|| asset_header.romfs.size == 0)
|
||||||
goto _fail0;
|
goto _fail0;
|
||||||
|
Loading…
Reference in New Issue
Block a user