Fusee Stage 2: Flesh out Package2 patching (implement decryption, fixing of metadata)

This commit is contained in:
Michael Scire
2018-04-11 20:29:35 -06:00
parent a0d2642bb1
commit e5a0cb1abe
6 changed files with 411 additions and 23 deletions

View File

@@ -5,8 +5,29 @@
#define MAGIC_PK21 (0x31324B50)
#define PACKAGE2_SIZE_MAX 0x7FC000
#define PACKAGE2_SECTION_KERNEL 0x0
#define PACKAGE2_SECTION_INI1 0x1
#define PACKAGE2_SECTION_UNUSED 0x2
#define PACKAGE2_SECTION_MAX 0x3
#define PACKAGE2_MINVER_THEORETICAL 0x0
#define PACKAGE2_MAXVER_100 0x2
#define PACKAGE2_MAXVER_200 0x3
#define PACKAGE2_MAXVER_300 0x4
#define PACKAGE2_MAXVER_302 0x5
#define PACKAGE2_MAXVER_400_410 0x6
#define PACKAGE2_MAXVER_500_CURRENT 0x7
#define PACKAGE2_MINVER_100 0x3
#define PACKAGE2_MINVER_200 0x4
#define PACKAGE2_MINVER_300 0x5
#define PACKAGE2_MINVER_302 0x6
#define PACKAGE2_MINVER_400_410 0x7
#define PACKAGE2_MINVER_500_CURRENT 0x8
#define NX_BOOTLOADER_PACKAGE2_LOAD_ADDRESS ((void *)(0xA9800000ull))
typedef struct {
union {
uint8_t ctr[0x10];