diff --git a/Release/scetool.exe b/Release/scetool.exe index 328c6b9..1718d54 100644 Binary files a/Release/scetool.exe and b/Release/scetool.exe differ diff --git a/src/sce.cpp b/src/sce.cpp index 26e7f56..2845620 100644 --- a/src/sce.cpp +++ b/src/sce.cpp @@ -57,7 +57,9 @@ void _print_metadata_info(FILE *fp, metadata_info_t *mi) { fprintf(fp, "[*] Encryption Root Header:\n"); _hexdump(fp, " Key", 0, mi->key, METADATA_INFO_KEY_LEN, FALSE); + _hexdump(fp, " ", 0, mi->key_pad, METADATA_INFO_KEY_LEN, FALSE); _hexdump(fp, " IV ", 0, mi->iv, METADATA_INFO_IV_LEN, FALSE); + _hexdump(fp, " ", 0, mi->iv_pad, METADATA_INFO_IV_LEN, FALSE); } void _print_metadata_header(FILE *fp, metadata_header_t *mh) diff --git a/src/sce.h b/src/sce.h index 1528b6c..7f0fbb1 100644 --- a/src/sce.h +++ b/src/sce.h @@ -81,6 +81,8 @@ #define OPT_HEADER_TYPE_CAP_FLAGS 1 /*! Individuals seed header. */ #define OPT_HEADER_TYPE_INDIV_SEED 2 +/*! Optional header 4. */ +#define OPT_HEADER_TYPE_4 4 /*! Metadata key/iv lengths. */ #define METADATA_INFO_KEYBITS 128 diff --git a/src/self.cpp b/src/self.cpp index ad43520..524c62f 100644 --- a/src/self.cpp +++ b/src/self.cpp @@ -296,21 +296,29 @@ void _print_opt_header(FILE *fp, opt_header_t *oh) { case OPT_HEADER_TYPE_CAP_FLAGS: { - oh_data_cap_flags_t *cf = (oh_data_cap_flags_t *)((u8 *)oh + sizeof(opt_header_t)); + if (_ES32(oh->size) == 0x30) + { + oh_data_cap_flags_t *cf = (oh_data_cap_flags_t *)((u8 *)oh + sizeof(opt_header_t)); - _IF_RAW(_hexdump(fp, " Flags", 0, (u8 *)cf, sizeof(oh_data_cap_flags_t), FALSE)); + _IF_RAW(_hexdump(fp, " Flags", 0, (u8 *)cf, sizeof(oh_data_cap_flags_t), FALSE)); - // _es_oh_data_cap_flags(cf); + // _es_oh_data_cap_flags(cf); - fprintf(fp, " unknown_3 0x%016llX\n", _ES64(cf->unk3)); - fprintf(fp, " unknown_4 0x%016llX\n", _ES64(cf->unk4)); + fprintf(fp, " unknown_3 0x%016llX\n", _ES64(cf->unk3)); + fprintf(fp, " unknown_4 0x%016llX\n", _ES64(cf->unk4)); - fprintf(fp, " Flags 0x%016llX [ ", _ES64(cf->flags)); - _print_cap_flags_flags(fp, cf); - fprintf(fp, "]\n"); + fprintf(fp, " Flags 0x%016llX [ ", _ES64(cf->flags)); + _print_cap_flags_flags(fp, cf); + fprintf(fp, "]\n"); - fprintf(fp, " unknown_6 0x%08X\n", _ES32(cf->unk6)); - fprintf(fp, " unknown_7 0x%08X\n", _ES32(cf->unk7)); + fprintf(fp, " unknown_6 0x%08X\n", _ES32(cf->unk6)); + fprintf(fp, " unknown_7 0x%08X\n", _ES32(cf->unk7)); + } + else + { + u8 *h1 = (u8 *)oh + sizeof(opt_header_t); + _hexdump(fp, " Data", 0, h1, _ES32(oh->size) - sizeof(opt_header_t), FALSE); + } } break; case OPT_HEADER_TYPE_INDIV_SEED: @@ -319,6 +327,12 @@ void _print_opt_header(FILE *fp, opt_header_t *oh) _hexdump(fp, " Seed", 0, is, _ES32(oh->size) - sizeof(opt_header_t), FALSE); } break; + case OPT_HEADER_TYPE_4: + { + u8 *h4 = (u8 *)oh + sizeof(opt_header_t); + _hexdump(fp, " Data", 0, h4, _ES32(oh->size) - sizeof(opt_header_t), FALSE); + } + break; } }