Updated FIRM code in ctrtool according to 3dbrew/boot9. Removed -flto flag since this can cause problems.

This commit is contained in:
profi200
2017-01-07 21:31:05 +01:00
parent 7b384c6213
commit dc81220cf6
3 changed files with 10 additions and 7 deletions
+1 -1
View File
@@ -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)
+6 -3
View File
@@ -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);
+3 -3
View File
@@ -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;