From fba8429db38723943463af82f52fef42cc9c060a Mon Sep 17 00:00:00 2001 From: JimmyZ Date: Sat, 7 Oct 2017 18:59:05 +0800 Subject: [PATCH] loosen the partition table white list, as samples shown in #2 --- Makefile | 2 +- arm9/source/sector0.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index ef7c9e9..d89f41a 100644 --- a/Makefile +++ b/Makefile @@ -10,7 +10,7 @@ include $(DEVKITARM)/ds_rules export TARGET := twlnf export TOPDIR := $(CURDIR) -export VERSION := 0.3.1 +export VERSION := 0.3.1a .PHONY: arm7/$(TARGET).elf arm9/$(TARGET).elf diff --git a/arm9/source/sector0.c b/arm9/source/sector0.c index 2b6009d..56a8b7e 100644 --- a/arm9/source/sector0.c +++ b/arm9/source/sector0.c @@ -91,8 +91,9 @@ int parse_mbr(const uint8_t sector0[SECTOR_SIZE], int is3DS, int verbose) { } else { ref_ptable = ptable_3DS; } - if (memcmp(ref_ptable, sector0 + MBR_BOOTSTRAP_SIZE, - sizeof(mbr_partition_t) * MBR_PARTITIONS)) { + // only test the 1st partition now, we've seen variations on the 3rd partition + // and after all we only care about the 1st partition + if (memcmp(ref_ptable, m->partitions, sizeof(mbr_partition_t))) { prt("invalid partition table\n"); ret = -2; }