diff --git a/ctrtool/Makefile b/ctrtool/Makefile index c316463..7a534c9 100644 --- a/ctrtool/Makefile +++ b/ctrtool/Makefile @@ -5,7 +5,7 @@ OBJS = $(foreach dir,$(SRC_DIR),$(subst .c,.o,$(wildcard $(dir)/*.c))) $(foreach # Compiler Settings OUTPUT = ctrtool CXXFLAGS = -I. -CFLAGS = -O2 -flto -Wall -Wno-unused-variable -Wno-unused-result -I. -std=c99 +CFLAGS = -O2 -Wall -Wno-unused-variable -Wno-unused-result -I. -std=c99 CC = gcc CXX = g++ ifeq ($(OS),Windows_NT) diff --git a/ctrtool/firm.c b/ctrtool/firm.c index e865cc0..491f4a7 100644 --- a/ctrtool/firm.c +++ b/ctrtool/firm.c @@ -206,9 +206,10 @@ void firm_print(firm_context* ctx) { u32 i; u32 address; - u32 type; + u32 copyMethod; u32 offset; u32 size; + u32 priority = getle32(ctx->header.priority); u32 entrypointarm11 = getle32(ctx->header.entrypointarm11); u32 entrypointarm9 = getle32(ctx->header.entrypointarm9); @@ -221,6 +222,7 @@ void firm_print(firm_context* ctx) memdump(stdout, "Signature (FAIL): ", ctx->header.signature, 0x100); fprintf(stdout, "\n"); + fprintf(stdout, "Priority: %u\n", priority); fprintf(stdout, "Entrypoint ARM9: 0x%08X\n", entrypointarm9); fprintf(stdout, "Entrypoint ARM11: 0x%08X\n", entrypointarm11); fprintf(stdout, "\n"); @@ -234,12 +236,13 @@ void firm_print(firm_context* ctx) offset = getle32(section->offset); size = getle32(section->size); address = getle32(section->address); - type = getle32(section->type); + copyMethod = getle32(section->copyMethod); if (size) { fprintf(stdout, "Section %d \n", i); - fprintf(stdout, " Type: %s\n", type==0? "ARM9" : type==1? "ARM11" : "UNKNOWN"); + fprintf(stdout, " Copy Method: %s\n", copyMethod==0 ? "NDMA" : copyMethod==1 ? "XDMA" : + copyMethod==2 ? "memcpy" : "UNKNOWN"); fprintf(stdout, " Address: 0x%08X\n", address); fprintf(stdout, " Offset: 0x%08X\n", offset); fprintf(stdout, " Size: 0x%08X\n", size); diff --git a/ctrtool/firm.h b/ctrtool/firm.h index 29af98f..5d1ebbc 100644 --- a/ctrtool/firm.h +++ b/ctrtool/firm.h @@ -13,7 +13,7 @@ typedef struct u8 offset[4]; u8 address[4]; u8 size[4]; - u8 type[4]; + u8 copyMethod[4]; u8 hash[32]; } firm_sectionheader; @@ -23,10 +23,10 @@ typedef struct typedef struct { u8 magic[4]; - u8 reserved1[4]; + u8 priority[4]; u8 entrypointarm11[4]; u8 entrypointarm9[4]; - u8 reserved2[0x30]; + u8 reserved1[0x30]; firm_sectionheader section[4]; u8 signature[0x100]; } firm_header;