mirror of
https://github.com/SciresM/hactool.git
synced 2024-11-26 22:10:24 +00:00
nso/kip: fix miscalculation when printing rwdata/bss extents
This commit is contained in:
parent
09e01d5dd7
commit
4ca7afa601
4
kip.c
4
kip.c
@ -255,8 +255,8 @@ void kip1_print(kip1_ctx_t *ctx, int suppress) {
|
||||
printf(" Sections:\n");
|
||||
printf(" .text: %08"PRIx32"-%08"PRIx32"\n", ctx->header->section_headers[0].out_offset, ctx->header->section_headers[0].out_offset + align(ctx->header->section_headers[0].out_size, 0x1000));
|
||||
printf(" .rodata: %08"PRIx32"-%08"PRIx32"\n", ctx->header->section_headers[1].out_offset, ctx->header->section_headers[1].out_offset + align(ctx->header->section_headers[1].out_size, 0x1000));
|
||||
printf(" .rwdata: %08"PRIx32"-%08"PRIx32"\n", ctx->header->section_headers[2].out_offset, ctx->header->section_headers[2].out_offset + align(ctx->header->section_headers[2].out_size, 0x1000));
|
||||
printf(" .bss: %08"PRIx32"-%08"PRIx32"\n", ctx->header->section_headers[3].out_offset, ctx->header->section_headers[3].out_offset + align(ctx->header->section_headers[3].out_size, 0x1000));
|
||||
printf(" .rwdata: %08"PRIx32"-%08"PRIx32"\n", ctx->header->section_headers[2].out_offset, ctx->header->section_headers[2].out_offset + ctx->header->section_headers[2].out_size);
|
||||
printf(" .bss: %08"PRIx32"-%08"PRIx32"\n",ctx->header->section_headers[2].out_offset + ctx->header->section_headers[2].out_size, ctx->header->section_headers[3].out_offset + align(ctx->header->section_headers[3].out_size, 0x1000));
|
||||
printf(" Kernel Access Control:\n");
|
||||
kac_print(ctx->header->capabilities, 0x20);
|
||||
printf("\n");
|
||||
|
6
nso.c
6
nso.c
@ -102,11 +102,11 @@ void nso0_print(nso0_ctx_t *ctx) {
|
||||
printf(" .rodata: %08"PRIx32"-%08"PRIx32"\n", ctx->header->segments[1].dst_off, ctx->header->segments[1].dst_off + align(ctx->header->segments[1].decomp_size, 0x1000));
|
||||
}
|
||||
if ((ctx->tool_ctx->action & ACTION_VERIFY) && ctx->segment_validities[2] != VALIDITY_UNCHECKED) {
|
||||
printf(" .rwdata (%s): %08"PRIx32"-%08"PRIx32"\n", GET_VALIDITY_STR(ctx->segment_validities[2]), ctx->header->segments[2].dst_off, ctx->header->segments[2].dst_off + align(ctx->header->segments[2].decomp_size, 0x1000));
|
||||
printf(" .rwdata (%s): %08"PRIx32"-%08"PRIx32"\n", GET_VALIDITY_STR(ctx->segment_validities[2]), ctx->header->segments[2].dst_off, ctx->header->segments[2].dst_off + ctx->header->segments[2].decomp_size);
|
||||
} else {
|
||||
printf(" .rwdata: %08"PRIx32"-%08"PRIx32"\n", ctx->header->segments[2].dst_off, ctx->header->segments[2].dst_off + align(ctx->header->segments[2].decomp_size, 0x1000));
|
||||
printf(" .rwdata: %08"PRIx32"-%08"PRIx32"\n", ctx->header->segments[2].dst_off, ctx->header->segments[2].dst_off + ctx->header->segments[2].decomp_size);
|
||||
}
|
||||
printf(" .bss: %08"PRIx32"-%08"PRIx32"\n", ctx->header->segments[2].dst_off + align(ctx->header->segments[2].decomp_size, 0x1000), ctx->header->segments[2].dst_off + align(ctx->header->segments[2].decomp_size, 0x1000) + align(ctx->header->segments[2].align_or_total_size, 0x1000));
|
||||
printf(" .bss: %08"PRIx32"-%08"PRIx32"\n", ctx->header->segments[2].dst_off + ctx->header->segments[2].decomp_size, ctx->header->segments[2].dst_off + align(ctx->header->segments[2].decomp_size + ctx->header->segments[2].align_or_total_size, 0x1000));
|
||||
}
|
||||
|
||||
void nso0_save(nso0_ctx_t *ctx) {
|
||||
|
Loading…
Reference in New Issue
Block a user