mirror of
https://github.com/naehrwert/scetool.git
synced 2025-04-24 21:57:45 +00:00
Header parser fix 2
Another minor update
This commit is contained in:
parent
e5bb42387f
commit
10204bc16c
4 changed files with 28 additions and 10 deletions
Binary file not shown.
|
@ -57,7 +57,9 @@ void _print_metadata_info(FILE *fp, metadata_info_t *mi)
|
||||||
{
|
{
|
||||||
fprintf(fp, "[*] Encryption Root Header:\n");
|
fprintf(fp, "[*] Encryption Root Header:\n");
|
||||||
_hexdump(fp, " Key", 0, mi->key, METADATA_INFO_KEY_LEN, FALSE);
|
_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, " 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)
|
void _print_metadata_header(FILE *fp, metadata_header_t *mh)
|
||||||
|
|
|
@ -81,6 +81,8 @@
|
||||||
#define OPT_HEADER_TYPE_CAP_FLAGS 1
|
#define OPT_HEADER_TYPE_CAP_FLAGS 1
|
||||||
/*! Individuals seed header. */
|
/*! Individuals seed header. */
|
||||||
#define OPT_HEADER_TYPE_INDIV_SEED 2
|
#define OPT_HEADER_TYPE_INDIV_SEED 2
|
||||||
|
/*! Optional header 4. */
|
||||||
|
#define OPT_HEADER_TYPE_4 4
|
||||||
|
|
||||||
/*! Metadata key/iv lengths. */
|
/*! Metadata key/iv lengths. */
|
||||||
#define METADATA_INFO_KEYBITS 128
|
#define METADATA_INFO_KEYBITS 128
|
||||||
|
|
14
src/self.cpp
14
src/self.cpp
|
@ -295,6 +295,8 @@ void _print_opt_header(FILE *fp, opt_header_t *oh)
|
||||||
switch(_ES32(oh->type))
|
switch(_ES32(oh->type))
|
||||||
{
|
{
|
||||||
case OPT_HEADER_TYPE_CAP_FLAGS:
|
case OPT_HEADER_TYPE_CAP_FLAGS:
|
||||||
|
{
|
||||||
|
if (_ES32(oh->size) == 0x30)
|
||||||
{
|
{
|
||||||
oh_data_cap_flags_t *cf = (oh_data_cap_flags_t *)((u8 *)oh + sizeof(opt_header_t));
|
oh_data_cap_flags_t *cf = (oh_data_cap_flags_t *)((u8 *)oh + sizeof(opt_header_t));
|
||||||
|
|
||||||
|
@ -312,6 +314,12 @@ void _print_opt_header(FILE *fp, opt_header_t *oh)
|
||||||
fprintf(fp, " unknown_6 0x%08X\n", _ES32(cf->unk6));
|
fprintf(fp, " unknown_6 0x%08X\n", _ES32(cf->unk6));
|
||||||
fprintf(fp, " unknown_7 0x%08X\n", _ES32(cf->unk7));
|
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;
|
break;
|
||||||
case OPT_HEADER_TYPE_INDIV_SEED:
|
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);
|
_hexdump(fp, " Seed", 0, is, _ES32(oh->size) - sizeof(opt_header_t), FALSE);
|
||||||
}
|
}
|
||||||
break;
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue