-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
43 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,54 @@ | ||
/** | ||
* @file nro.h | ||
* @brief NRO headers. | ||
* @copyright libnx Authors | ||
*/ | ||
|
||
#pragma once | ||
|
||
#define NROHEADER_MAGICNUM 0x304f524e | ||
#define NROHEADER_MAGIC 0x304f524e | ||
|
||
#define ASSETHEADER_MAGICNUM 0x54455341 | ||
#define ASSETHEADER_VERSION 0 | ||
#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. | ||
typedef struct { | ||
u64 offset; | ||
u64 size; | ||
} AssetSection; | ||
} NroAssetSection; | ||
|
||
/// Custom asset header. | ||
typedef struct { | ||
u32 magic; | ||
u32 version; | ||
AssetSection icon; | ||
AssetSection nacp; | ||
AssetSection romfs; | ||
} AssetHeader; | ||
NroAssetSection icon; | ||
NroAssetSection nacp; | ||
NroAssetSection romfs; | ||
} NroAssetHeader; | ||
|