From dd2963b55cea53c50120206a52df2c1b1dba0981 Mon Sep 17 00:00:00 2001 From: d0k3 Date: Wed, 17 May 2017 21:44:31 +0200 Subject: [PATCH] Where the magic happens... --- README.md | 9 +++------ source/common/common.h | 4 ++-- source/safety/validator.c | 14 ++++++++++---- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index b08aa62..df9b3c8 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,15 @@ # SafeB9SInstaller Safe, simple, user-friendly installer for sighaxed FIRMs -**DON'T USE THIS YET** - -**Stop asking - it's done when it's done(tm)** - For usage instructions, refer to [Plailect's guide](https://3ds.guide/). ## Credits * **Normmatt**, for sdmmc.c / sdmmc.h * **Cha(N)**, **Kane49**, and all other FatFS contributors for FatFS -* **SciresM** for being the first fearless person to test this +* **Myria** for the sighax bruteforcer and for finding the sighax (retail&dev) signature +* **SciresM** for dumping boot9, creating boot9strap.firm and for being the first fearless person to test this +* **hedgeberg** for her tireless efforts in dumping the bootrom * **TuxSH** for FIRM research and useful hints -* **hedgeberg** for dumping the bootrom (when it's done) * **Plailect** for providing the guide and making this accessible to the common user * **stuckpixel** for his tireless behind-the-scenes work * **Gelex** for being of great help on countless occasions diff --git a/source/common/common.h b/source/common/common.h index f63b128..3f1be8e 100644 --- a/source/common/common.h +++ b/source/common/common.h @@ -40,8 +40,8 @@ #define ENTRY_BRAHMA (1) #define ENTRY_GATEWAY (2) -// SafeSigHaxInstaller version -#define VERSION "0.0.3" +// SafeB9SInstaller version +#define VERSION "0.0.5" // input / output paths #define INPUT_PATH "0:/boot9strap" diff --git a/source/safety/validator.c b/source/safety/validator.c index 2a5f0bd..63e1060 100644 --- a/source/safety/validator.c +++ b/source/safety/validator.c @@ -40,10 +40,16 @@ const u8 sectorHash_dev[0x20] = { 0x09, 0x54, 0xE3, 0x85, 0xDE, 0x47, 0x55, 0xAF, 0xC6, 0xCB, 0x1D, 0x8D, 0xC7, 0x84, 0x5A, 0x64 }; -// standard sighax signature hash - still unknown (= missing puzzle piece) +// sighax signature hash - thanks go to Myria & SciresM for bruteforcing this const u8 sighaxHash[0x20] = { - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + 0x07, 0x8C, 0xC0, 0xCF, 0xD8, 0x50, 0xA2, 0x70, 0x93, 0xDD, 0xA2, 0x63, 0x0C, 0x36, 0x03, 0xCA, + 0x0C, 0x96, 0x96, 0x9B, 0xD1, 0xF2, 0x6D, 0xA4, 0x8A, 0xC7, 0xB1, 0xBA, 0xE5, 0xDD, 0x52, 0x19 +}; + +// sighax dev signature hash - thanks go to Myria & SciresM for bruteforcing this +const u8 sighaxHash_dev[0x20] = { + 0xE6, 0x35, 0xC6, 0x36, 0xDC, 0x62, 0x59, 0xD6, 0x22, 0x8A, 0xF5, 0xBE, 0xD2, 0x84, 0x6E, 0x33, + 0x96, 0xD3, 0x78, 0x6E, 0xDF, 0x50, 0x3D, 0x11, 0x86, 0x84, 0x01, 0x59, 0x97, 0x50, 0x42, 0x26 }; u32 ValidateFirmHeader(FirmHeader* header, u32 data_size) { @@ -111,7 +117,7 @@ u32 ValidateSector(void* sector) { u32 CheckFirmSigHax(void* firm) { FirmHeader* header = (FirmHeader*) firm; - return (sha_cmp(sighaxHash, header->signature, 0x100, SHA256_MODE) == 0) ? 0 : 1; + return (sha_cmp((IS_DEVKIT) ? sighaxHash_dev : sighaxHash, header->signature, 0x100, SHA256_MODE) == 0) ? 0 : 1; } u32 CheckBoot9Strap(void* firm) {