Change the allocation logic in stratosphere.c

This commit is contained in:
TuxSH
2018-05-08 18:46:54 +02:00
parent 70bb496388
commit 7df879d346
4 changed files with 76 additions and 55 deletions

View File

@@ -14,7 +14,7 @@ typedef struct {
uint32_t size;
uint32_t num_processes;
uint32_t _0xC;
unsigned char kip_data[];
uint8_t kip_data[];
} ini1_header_t;
typedef struct {
@@ -35,13 +35,12 @@ typedef struct {
uint8_t flags;
kip_section_header_t section_headers[6];
uint32_t capabilities[0x20];
unsigned char data[];
uint8_t data[];
} kip1_header_t;
static inline uint64_t kip1_get_size_from_header(kip1_header_t *header) {
static inline size_t kip1_get_size_from_header(kip1_header_t *header) {
/* Header + .text + .rodata + .rwdata */
return 0x100 + header->section_headers[0].compressed_size + header->section_headers[1].compressed_size + header->section_headers[2].compressed_size;
}
#endif
#endif