libnx  v4.7.0
nro.h
Go to the documentation of this file.
1 /**
2  * @file nro.h
3  * @brief NRO headers.
4  * @copyright libnx Authors
5  */
6 
7 #pragma once
8 
9 #define NROHEADER_MAGIC 0x304f524e
10 
11 #define NROASSETHEADER_MAGIC 0x54455341
12 #define NROASSETHEADER_VERSION 0
13 
14 /// Entry for each segment in the codebin.
15 typedef struct {
16  u32 file_off;
17  u32 size;
18 } NroSegment;
19 
20 /// Offset 0x0 in the NRO.
21 typedef struct {
22  u32 unused;
23  u32 mod_offset;
24  u8 padding[8];
25 } NroStart;
26 
27 /// This follows NroStart, the actual nro-header.
28 typedef struct {
29  u32 magic;
30  u32 unk1;
31  u32 size;
32  u32 unk2;
33  NroSegment segments[3];
34  u32 bss_size;
35  u32 unk3;
36  u8 build_id[0x20];
37  u8 padding[0x20];
38 } NroHeader;
39 
40 /// Custom asset section.
41 typedef struct {
42  u64 offset;
43  u64 size;
45 
46 /// Custom asset header.
47 typedef struct {
48  u32 magic;
49  u32 version;
50  NroAssetSection icon;
51  NroAssetSection nacp;
52  NroAssetSection romfs;
54 
Custom asset header.
Definition: nro.h:47
Custom asset section.
Definition: nro.h:41
This follows NroStart, the actual nro-header.
Definition: nro.h:28
Entry for each segment in the codebin.
Definition: nro.h:15
Offset 0x0 in the NRO.
Definition: nro.h:21
uint64_t u64
64-bit unsigned integer.
Definition: types.h:22
uint8_t u8
8-bit unsigned integer.
Definition: types.h:19
uint32_t u32
32-bit unsigned integer.
Definition: types.h:21