mirror of
https://github.com/SciresM/hactool.git
synced 2024-11-26 22:10:24 +00:00
hactool: commit whatever I had in my working dir, 17.0.0 needs new pk2 parsing
This commit is contained in:
parent
c2c907430e
commit
8017a7a6b6
@ -304,7 +304,9 @@ void extkeys_initialize_settings(hactool_settings_t *settings, FILE *f) {
|
||||
parse_hex_key(exponent, value, sizeof(exponent));
|
||||
pki_set_beta_nca0_exponent(exponent);
|
||||
matched_key = 1;
|
||||
} else {
|
||||
} else if (strcmp(key, "xci_t1_titlekey_kek_00") == 0) {
|
||||
matched_key = 1;
|
||||
} else {
|
||||
char test_name[0x100] = {0};
|
||||
for (unsigned int i = 0; i < 0x6 && !matched_key; i++) {
|
||||
snprintf(test_name, sizeof(test_name), "keyblob_key_source_%02"PRIx32, i);
|
||||
|
4
kip.c
4
kip.c
@ -196,7 +196,9 @@ static void *kip1_uncompress(kip1_ctx_t *ctx, uint64_t *size) {
|
||||
for (unsigned int i = 0; i < 3; i++) {
|
||||
// Copy in section data */
|
||||
memcpy(new_kip + new_offset, (unsigned char *)ctx->header + old_offset, ctx->header->section_headers[i].compressed_size);
|
||||
kip1_blz_uncompress(new_kip + new_offset + ctx->header->section_headers[i].compressed_size);
|
||||
if (ctx->header->flags & (1 << i)) {
|
||||
kip1_blz_uncompress(new_kip + new_offset + ctx->header->section_headers[i].compressed_size);
|
||||
}
|
||||
new_offset += ctx->header->section_headers[i].out_size;
|
||||
old_offset += ctx->header->section_headers[i].compressed_size;
|
||||
}
|
||||
|
72
npdm.c
72
npdm.c
@ -6,7 +6,7 @@
|
||||
#include "rsa.h"
|
||||
#include "cJSON.h"
|
||||
|
||||
static const char * const svc_names[0x80] = {
|
||||
static const char * const svc_names[0xC0] = {
|
||||
"svcUnknown",
|
||||
"svcSetHeapSize",
|
||||
"svcSetMemoryPermission",
|
||||
@ -135,6 +135,70 @@ static const char * const svc_names[0x80] = {
|
||||
"svcCreateResourceLimit",
|
||||
"svcSetResourceLimitLimitValue",
|
||||
"svcCallSecureMonitor"
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
"svcUnknown",
|
||||
};
|
||||
|
||||
#define MAX_FS_PERM_RW 0x27
|
||||
@ -297,7 +361,7 @@ void kac_print(const uint32_t *descriptors, uint32_t num_descriptors) {
|
||||
break;
|
||||
case 4: /* Syscall mask. */
|
||||
syscall_base = (desc >> 24) * 0x18;
|
||||
for (unsigned int sc = 0; sc < 0x18 && syscall_base + sc < 0x80; sc++) {
|
||||
for (unsigned int sc = 0; sc < 0x18 && syscall_base + sc < 0xC0; sc++) {
|
||||
kac.svcs_allowed[syscall_base+sc] = desc & 1;
|
||||
desc >>= 1;
|
||||
}
|
||||
@ -382,7 +446,7 @@ void kac_print(const uint32_t *descriptors, uint32_t num_descriptors) {
|
||||
}
|
||||
|
||||
int first_svc = 1;
|
||||
for (unsigned int i = 0; i < 0x80; i++) {
|
||||
for (unsigned int i = 0; i < 0xC0; i++) {
|
||||
if (kac.svcs_allowed[i]) {
|
||||
printf(first_svc ? " Allowed SVCs: %-35s (0x%02"PRIx32")\n" : " %-35s (0x%02"PRIx32")\n", svc_names[i], i);
|
||||
first_svc = 0;
|
||||
@ -811,7 +875,7 @@ cJSON *kac_get_json(const uint32_t *descriptors, uint32_t num_descriptors) {
|
||||
temp = syscall_memory;
|
||||
}
|
||||
syscall_base = (desc >> 24) * 0x18;
|
||||
for (unsigned int sc = 0; sc < 0x18 && syscall_base + sc < 0x80; sc++) {
|
||||
for (unsigned int sc = 0; sc < 0x18 && syscall_base + sc < 0xC0; sc++) {
|
||||
if (desc & 1) {
|
||||
cJSON_AddU8ToObject(temp, strdup(svc_names[sc + syscall_base]), sc + syscall_base);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user