diff options
Diffstat (limited to 'src/core/loader/ncch.h')
| -rw-r--r-- | src/core/loader/ncch.h | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/src/core/loader/ncch.h b/src/core/loader/ncch.h index f6f670060..3dd151dbd 100644 --- a/src/core/loader/ncch.h +++ b/src/core/loader/ncch.h | |||
| @@ -43,6 +43,8 @@ struct NCCH_Header { | |||
| 43 | u8 romfs_super_block_hash[0x20]; | 43 | u8 romfs_super_block_hash[0x20]; |
| 44 | }; | 44 | }; |
| 45 | 45 | ||
| 46 | static_assert(sizeof(NCCH_Header) == 0x200, "NCCH header structure size is wrong"); | ||
| 47 | |||
| 46 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 48 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| 47 | // ExeFS (executable file system) headers | 49 | // ExeFS (executable file system) headers |
| 48 | 50 | ||
| @@ -77,11 +79,11 @@ struct ExHeader_CodeSetInfo { | |||
| 77 | u8 name[8]; | 79 | u8 name[8]; |
| 78 | ExHeader_SystemInfoFlags flags; | 80 | ExHeader_SystemInfoFlags flags; |
| 79 | ExHeader_CodeSegmentInfo text; | 81 | ExHeader_CodeSegmentInfo text; |
| 80 | u8 stacksize[4]; | 82 | u32 stack_size; |
| 81 | ExHeader_CodeSegmentInfo ro; | 83 | ExHeader_CodeSegmentInfo ro; |
| 82 | u8 reserved[4]; | 84 | u8 reserved[4]; |
| 83 | ExHeader_CodeSegmentInfo data; | 85 | ExHeader_CodeSegmentInfo data; |
| 84 | u8 bsssize[4]; | 86 | u32 bss_size; |
| 85 | }; | 87 | }; |
| 86 | 88 | ||
| 87 | struct ExHeader_DependencyList{ | 89 | struct ExHeader_DependencyList{ |
| @@ -107,9 +109,9 @@ struct ExHeader_ARM11_SystemLocalCaps{ | |||
| 107 | u32 core_version; | 109 | u32 core_version; |
| 108 | u8 flags[3]; | 110 | u8 flags[3]; |
| 109 | u8 priority; | 111 | u8 priority; |
| 110 | u8 resource_limit_descriptor[0x16][2]; | 112 | u8 resource_limit_descriptor[0x10][2]; |
| 111 | ExHeader_StorageInfo storage_info; | 113 | ExHeader_StorageInfo storage_info; |
| 112 | u8 service_access_control[0x32][8]; | 114 | u8 service_access_control[0x20][8]; |
| 113 | u8 ex_service_access_control[0x2][8]; | 115 | u8 ex_service_access_control[0x2][8]; |
| 114 | u8 reserved[0xf]; | 116 | u8 reserved[0xf]; |
| 115 | u8 resource_limit_category; | 117 | u8 resource_limit_category; |
| @@ -141,6 +143,8 @@ struct ExHeader_Header{ | |||
| 141 | } access_desc; | 143 | } access_desc; |
| 142 | }; | 144 | }; |
| 143 | 145 | ||
| 146 | static_assert(sizeof(ExHeader_Header) == 0x800, "ExHeader structure size is wrong"); | ||
| 147 | |||
| 144 | //////////////////////////////////////////////////////////////////////////////////////////////////// | 148 | //////////////////////////////////////////////////////////////////////////////////////////////////// |
| 145 | // Loader namespace | 149 | // Loader namespace |
| 146 | 150 | ||
| @@ -224,6 +228,12 @@ private: | |||
| 224 | bool is_compressed = false; | 228 | bool is_compressed = false; |
| 225 | 229 | ||
| 226 | u32 entry_point = 0; | 230 | u32 entry_point = 0; |
| 231 | u32 code_size = 0; | ||
| 232 | u32 stack_size = 0; | ||
| 233 | u32 bss_size = 0; | ||
| 234 | u32 core_version = 0; | ||
| 235 | u8 priority = 0; | ||
| 236 | u8 resource_limit_category = 0; | ||
| 227 | u32 ncch_offset = 0; // Offset to NCCH header, can be 0 or after NCSD header | 237 | u32 ncch_offset = 0; // Offset to NCCH header, can be 0 or after NCSD header |
| 228 | u32 exefs_offset = 0; | 238 | u32 exefs_offset = 0; |
| 229 | 239 | ||