Permalink
Browse files

massive refactor; partial 6.0 support

  • Loading branch information...
Reisyukaku committed Sep 2, 2018
1 parent 1cf8003 commit 017e620dc6d317e550f0da38728249b63aa6dda3
Showing with 358 additions and 312 deletions.
  1. +2 −1 Makefile
  2. +3 −3 link.ld
  3. +25 −1 src/bootloader.c
  4. +0 −1 src/bootrom.c
  5. +1 −1 src/error.c
  6. +0 −1 src/error.h
  7. +41 −74 src/firmware.c
  8. +4 −7 src/firmware.h
  9. +1 −2 src/fs.c
  10. +0 −47 src/fuse.c
  11. +0 −21 src/fuse.h
  12. +4 −1 src/hwinit.h
  13. +1 −1 src/hwinit/pmc.h
  14. +1 −0 src/hwinit/types.h
  15. +13 −0 src/hwinit/util.c
  16. +1 −0 src/hwinit/util.h
  17. +0 −112 src/kippatches.c
  18. +0 −31 src/kippatches.h
  19. +61 −0 src/kippatches/fs.inc
  20. +134 −2 src/package.c
  21. +60 −0 src/package.h
  22. +6 −6 src/start.s
View
@@ -9,6 +9,7 @@ LD = $(DEVKITARM)/bin/arm-none-eabi-ld
OBJCOPY = $(DEVKITARM)/bin/arm-none-eabi-objcopy OBJCOPY = $(DEVKITARM)/bin/arm-none-eabi-objcopy
name := ReiNX name := ReiNX
ver := 1.6
dir_source := src dir_source := src
dir_data := data dir_data := data
@@ -17,7 +18,7 @@ dir_out := out
dir_sysmod := NX_Sysmodules dir_sysmod := NX_Sysmodules
ARCH := -march=armv4t -mtune=arm7tdmi -mthumb -mthumb-interwork ARCH := -march=armv4t -mtune=arm7tdmi -mthumb -mthumb-interwork
CFLAGS = $(ARCH) -Os -nostdlib -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-inline -fno-builtin -std=gnu11# -Wall CFLAGS = $(ARCH) -DVERSION='"$(ver)"' -Os -nostdlib -ffunction-sections -fdata-sections -fomit-frame-pointer -fno-inline -fno-builtin -std=gnu11# -Wall
LDFLAGS = $(ARCH) -nostartfiles -lgcc -Wl,--nmagic,--gc-sections LDFLAGS = $(ARCH) -nostartfiles -lgcc -Wl,--nmagic,--gc-sections
objects = $(patsubst $(dir_source)/%.s, $(dir_build)/%.o, \ objects = $(patsubst $(dir_source)/%.s, $(dir_build)/%.o, \
View
@@ -2,8 +2,8 @@ ENTRY(_start)
SECTIONS SECTIONS
{ {
PROVIDE(__ipl_start = 0x40003000); PROVIDE(payload_start = 0x40003000);
. = __ipl_start; . = payload_start;
.text.start : .text.start :
{ {
*(.text.start) *(.text.start)
@@ -18,7 +18,7 @@ SECTIONS
*(.rodata*); *(.rodata*);
} }
. = ALIGN(0x10); . = ALIGN(0x10);
__ipl_end = .; payload_end = .;
.bss : .bss :
{ {
__bss_start = .; __bss_start = .;
View
@@ -15,7 +15,6 @@
*/ */
#include "hwinit.h" #include "hwinit.h"
#include "fuse.h"
#include "error.h" #include "error.h"
#include "bootloader.h" #include "bootloader.h"
@@ -24,6 +23,31 @@ void check_sku() {
panic(); panic();
} }
u32 get_unknown_config() {
u32 res = 0;
u32 deviceInfo = FUSE(FUSE_RESERVED_ODMX(4));
u32 config = ((deviceInfo & 4u) >> 2) | 2 * ((deviceInfo & 0x100u) >> 8);
if(config == 1)
return 0;
if(config == 2)
return 1;
if(config || (res = FUSE(FUSE_SPARE_BIT_5)) != 0)
res = 3;
return res;
}
u32 get_unit_type() {
u32 deviceInfo = FUSE(FUSE_RESERVED_ODMX(4));
u32 deviceType = deviceInfo & 3 | 4 * ((deviceInfo & 0x200u) >> 9);
if(deviceType == 3)
return 0;
if(deviceType == 4)
return 1;
return 2;
}
void check_config_fuses() { void check_config_fuses() {
u32 config = get_unknown_config(); u32 config = get_unknown_config();
u32 unitType = get_unit_type(); u32 unitType = get_unit_type();
View
@@ -36,5 +36,4 @@ void bootrom(void) {
// Clear the boot reason to avoid problems later // Clear the boot reason to avoid problems later
PMC(APBDEV_PMC_SCRATCH200) = 0x0; PMC(APBDEV_PMC_SCRATCH200) = 0x0;
PMC(APBDEV_PMC_RST_STATUS_0) = 0x0; PMC(APBDEV_PMC_RST_STATUS_0) = 0x0;
//PMC(APBDEV_PMC_SCRATCH49_0) = 0x0;
} }
View
@@ -32,5 +32,5 @@ void panic() {
void error(char *errStr) { void error(char *errStr) {
gfx_con_setcol(&gfx_con, RED, 0, 0); gfx_con_setcol(&gfx_con, RED, 0, 0);
print("Error: %s", errStr); print("Error: %s", errStr);
gfx_con_setcol(&gfx_con, ORANGE, 0, 0); gfx_con_setcol(&gfx_con, DEFAULT_TEXT_COL, 0, 0);
} }
View
@@ -17,7 +17,6 @@
#pragma once #pragma once
#include "hwinit/types.h" #include "hwinit/types.h"
#include "hwinit/gfx.h"
void panic(); void panic();
void error(char *errStr); void error(char *errStr);
View
@@ -17,31 +17,13 @@
#include <string.h> #include <string.h>
#include <stddef.h> #include <stddef.h>
#include "hwinit.h" #include "hwinit.h"
#include "hwinit/gfx.h"
#include "fs.h" #include "fs.h"
#include "fuse.h"
#include "package.h" #include "package.h"
#include "error.h" #include "error.h"
#include "firmware.h" #include "firmware.h"
#include "kippatches.h"
#define VERSION "v1.0"
static pk11_offs *pk11Offs = NULL; static pk11_offs *pk11Offs = NULL;
static void SE_lock() {
for (u32 i = 0; i < 16; i++)
se_key_acc_ctrl(i, 0x15);
for (u32 i = 0; i < 2; i++)
se_rsa_acc_ctrl(i, 1);
SE(0x4) = 0; // Make this reg secure only.
SE(SE_KEY_TABLE_ACCESS_LOCK_OFFSET) = 0; // Make all key access regs secure only.
SE(SE_RSA_KEYTABLE_ACCESS_LOCK_OFFSET) = 0; // Make all rsa access regs secure only.
SE(SE_SECURITY_0) &= 0xFFFFFFFB; // Make access lock regs secure only.
}
void drawSplash() { void drawSplash() {
// Draw splashscreen to framebuffer. // Draw splashscreen to framebuffer.
if(fopen("/ReiNX/splash.bin", "rb") != 0) { if(fopen("/ReiNX/splash.bin", "rb") != 0) {
@@ -68,7 +50,6 @@ void patch(pk11_offs *pk11, pkg2_hdr_t *pkg2, link_t *kips) {
uPtr *sha2_ptr = NULL; uPtr *sha2_ptr = NULL;
switch(pk11->kb) { switch(pk11->kb) {
case KB_FIRMWARE_VERSION_100_200: { case KB_FIRMWARE_VERSION_100_200: {
//u8 rlcPattern[] = {0xE0, 0xFF, 0x1D, 0xF0, 0x00, 0x00, 0x00, 0x91}; //TODO: relocator patch for 1.0.0
u8 verPattern[] = {0x19, 0x00, 0x36, 0xE0, 0x03, 0x08, 0x91}; u8 verPattern[] = {0x19, 0x00, 0x36, 0xE0, 0x03, 0x08, 0x91};
u8 hdrSigPattern[] = {0xFF, 0x97, 0xC0, 0x00, 0x00, 0x34, 0xA1, 0xFF, 0xFF}; u8 hdrSigPattern[] = {0xFF, 0x97, 0xC0, 0x00, 0x00, 0x34, 0xA1, 0xFF, 0xFF};
u8 sha2Pattern[] = {0xE0, 0x03, 0x08, 0x91, 0xE1, 0x03, 0x13, 0xAA}; u8 sha2Pattern[] = {0xE0, 0x03, 0x08, 0x91, 0xE1, 0x03, 0x13, 0xAA};
@@ -103,21 +84,30 @@ void patch(pk11_offs *pk11, pkg2_hdr_t *pkg2, link_t *kips) {
sha2_ptr = (uPtr*)memsearch((void *)pk11->secmon_base, 0x10000, sha2Pattern, sizeof(sha2Pattern)); sha2_ptr = (uPtr*)memsearch((void *)pk11->secmon_base, 0x10000, sha2Pattern, sizeof(sha2Pattern));
break; break;
} }
default: { case KB_FIRMWARE_VERSION_500: {
u8 verPattern[] = {0x00, 0x01, 0x00, 0x36, 0xFD, 0x7B, 0x41, 0xA9}; u8 verPattern[] = {0x00, 0x01, 0x00, 0x36, 0xFD, 0x7B, 0x41, 0xA9};
u8 hdrSigPattern[] = {0x86, 0xFE, 0xFF, 0x97, 0x80, 0x00, 0x00, 0x36}; u8 hdrSigPattern[] = {0x86, 0xFE, 0xFF, 0x97, 0x80, 0x00, 0x00, 0x36};
u8 sha2Pattern[] = {0xF2, 0xFB, 0xFF, 0x97, 0xE0, 0x03}; u8 sha2Pattern[] = {0xF2, 0xFB, 0xFF, 0x97, 0xE0, 0x03};
ver_ptr = (uPtr*)memsearch((void *)pk11->secmon_base, 0x10000, verPattern, sizeof(verPattern)); ver_ptr = (uPtr*)memsearch((void *)pk11->secmon_base, 0x10000, verPattern, sizeof(verPattern));
pk21_ptr = (uPtr*)((u32)ver_ptr - 0xC); pk21_ptr = (uPtr*)((u32)ver_ptr - 0xC);
hdrsig_ptr = (uPtr*)(memsearch((void *)pk11->secmon_base, 0x10000, hdrSigPattern, sizeof(hdrSigPattern)) + 0x4); hdrsig_ptr = (uPtr*)(memsearch((void *)pk11->secmon_base, 0x10000, hdrSigPattern, sizeof(hdrSigPattern)) + 0x4);
sha2_ptr = (uPtr*)memsearch((void *)pk11->secmon_base, 0x10000, sha2Pattern, sizeof(sha2Pattern)); sha2_ptr = (uPtr*)(memsearch((void *)pk11->secmon_base, 0x10000, sha2Pattern, sizeof(sha2Pattern)));
break;
}
default: {
u8 verPattern[] = {0x00, 0x01, 0x00, 0x36, 0xFD, 0x7B, 0x41, 0xA9};
u8 hdrSigPattern[] = { 0x9A, 0xFF, 0xFF, 0x97, 0x80, 0x00, 0x00, 0x36};
u8 sha2Pattern[] = {0x81, 0x00, 0x80, 0x72, 0xB5, 0xFB, 0xFF, 0x97};
ver_ptr = (uPtr*)memsearch((void *)pk11->secmon_base, 0x10000, verPattern, sizeof(verPattern));
pk21_ptr = (uPtr*)((u32)ver_ptr - 0xC);
hdrsig_ptr = (uPtr*)(memsearch((void *)pk11->secmon_base, 0x10000, hdrSigPattern, sizeof(hdrSigPattern)) + 0x4);
sha2_ptr = (uPtr*)(memsearch((void *)pk11->secmon_base, 0x10000, sha2Pattern, sizeof(sha2Pattern)) + 0x4);
break; break;
} }
} }
/*if (pre2x) { //TODO: relocator patch for 1.0.0
*rlc_ptr = ADRP(0, 0x3BFE8020);
};*/
if (pk11->kb != KB_FIRMWARE_VERSION_100_200) { if (pk11->kb != KB_FIRMWARE_VERSION_100_200) {
*pk21_ptr = NOP; *pk21_ptr = NOP;
}; };
@@ -147,15 +137,7 @@ void patch(pk11_offs *pk11, pkg2_hdr_t *pkg2, link_t *kips) {
} }
u8 kipHash[0x20]; u8 kipHash[0x20];
char *patchFilter[] = { "nosigchk", "nocmac", "nogc", NULL };
// enable nogc if there's a file called "nogc" in /ReiNX/
//(I expect the 1% of people this effects can read the guide)
if (!fopen("/ReiNX/nogc", "rb")) {
patchFilter[2] = NULL;
fclose();
}
//Patch FS module (truly not my proudest code TODO cleanup) //Patch FS module (truly not my proudest code TODO cleanup)
LIST_FOREACH_ENTRY(pkg2_kip1_info_t, ki, kips, link) { LIST_FOREACH_ENTRY(pkg2_kip1_info_t, ki, kips, link) {
//Patch FS //Patch FS
@@ -180,12 +162,8 @@ void patch(pk11_offs *pk11, pkg2_hdr_t *pkg2, link_t *kips) {
if (!pset) { if (!pset) {
print(" could not find patchset with matching hash\n"); print(" could not find patchset with matching hash\n");
} else { } else {
int res = kippatch_apply_set(kipDecompText, moddedKip->sections[i].size_decomp, pset, patchFilter); int res = kippatch_apply_set(kipDecompText, moddedKip->sections[i].size_decomp, pset);
if (res) { if (res) error("kippatch_apply_set() failed\n");
gfx_con_setcol(&gfx_con, RED, 0, 0);
print("Error: kippatch_apply_set() returned %d\n", res);
gfx_con_setcol(&gfx_con, ORANGE, 0, 0);
}
} }
moddedKip->flags &= ~1; moddedKip->flags &= ~1;
@@ -255,6 +233,7 @@ int keygen(u8 *keyblob, u32 fwVer, void *tsec_fw) {
break; break;
case KB_FIRMWARE_VERSION_500: case KB_FIRMWARE_VERSION_500:
case KB_FIRMWARE_VERSION_600:
default: default:
se_aes_unwrap_key(0x0A, 0x0F, console_keyseed_4xx); se_aes_unwrap_key(0x0A, 0x0F, console_keyseed_4xx);
se_aes_unwrap_key(0x0F, 0x0F, console_keyseed); se_aes_unwrap_key(0x0F, 0x0F, console_keyseed);
@@ -271,15 +250,13 @@ int keygen(u8 *keyblob, u32 fwVer, void *tsec_fw) {
u8 loadFirm() { u8 loadFirm() {
sdmmc_storage_t storage; sdmmc_storage_t storage;
sdmmc_t sdmmc; sdmmc_t sdmmc;
u32 ret = 0;
//Init nand
sdmmc_storage_init_mmc(&storage, &sdmmc, SDMMC_4, SDMMC_BUS_WIDTH_8, 4); sdmmc_storage_init_mmc(&storage, &sdmmc, SDMMC_4, SDMMC_BUS_WIDTH_8, 4);
sdmmc_storage_set_mmc_partition(&storage, 1); sdmmc_storage_set_mmc_partition(&storage, 1);
// Read package1. // Read package1.
print("Reading Package1...\n"); u8 *package1 = ReadPackage1(&storage);
u8 *package1 = (u8 *)malloc(0x40000);
sdmmc_storage_read(&storage, 0x100000 / NX_EMMC_BLOCKSIZE, 0x40000 / NX_EMMC_BLOCKSIZE, package1);
// Setup firmware specific data. // Setup firmware specific data.
pk11Offs = pkg11_offsentify(package1); pk11Offs = pkg11_offsentify(package1);
@@ -297,33 +274,8 @@ u8 loadFirm() {
PMC(APBDEV_PMC_SCRATCH1) = pk11Offs->warmboot_base; PMC(APBDEV_PMC_SCRATCH1) = pk11Offs->warmboot_base;
free(package1); free(package1);
// Read GPT partition. //Read package2
LIST_INIT(gpt); u8 *pkg2 = ReadPackage2(&storage);
sdmmc_storage_set_mmc_partition(&storage, 0);
print("Parsing GPT...\n");
nx_emmc_gpt_parse(&gpt, &storage);
emmc_part_t *pkg2_part = nx_emmc_part_find(&gpt, "BCPKG2-1-Normal-Main");
nx_emmc_gpt_free(&gpt);
if (!pkg2_part) {
error("Failed to read GPT!\n");
return 1;
}
// Read Package2.
u8 *tmp = (u8 *)malloc(NX_EMMC_BLOCKSIZE);
print("Reading Package2 size...\n");
nx_emmc_part_read(&storage, pkg2_part, 0x4000 / NX_EMMC_BLOCKSIZE, 1, tmp);
u32 *hdr = (u32 *)(tmp + 0x100);
u32 pkg2_size = hdr[0] ^ hdr[2] ^ hdr[3];
free(tmp);
u8 *pkg2 = malloc(ALIGN(pkg2_size, NX_EMMC_BLOCKSIZE));
print("Reading Package2...\n");
ret = nx_emmc_part_read(&storage, pkg2_part, 0x4000 / NX_EMMC_BLOCKSIZE, ALIGN(pkg2_size, NX_EMMC_BLOCKSIZE) / NX_EMMC_BLOCKSIZE, pkg2);
sdmmc_storage_end(&storage);
if (!ret) {
error("Failed to read Package2!\n");
return 1;
}
// Unpack Package2. // Unpack Package2.
print("Unpacking package2...\n"); print("Unpacking package2...\n");
@@ -339,7 +291,7 @@ u8 loadFirm() {
char **sysmods = NULL; char **sysmods = NULL;
size_t cnt = enumerateDir(&sysmods, "/ReiNX/sysmodules", "*.kip"); size_t cnt = enumerateDir(&sysmods, "/ReiNX/sysmodules", "*.kip");
for (u32 i = 0; i < cnt ; i++) { for (u32 i = 0; i < cnt ; i++) {
print("%kLoading %s\n%k", YELLOW, sysmods[i], ORANGE); print("%kLoading %s\n%k", YELLOW, sysmods[i], DEFAULT_TEXT_COL);
loadKip(&kip1_info, sysmods[i]); loadKip(&kip1_info, sysmods[i]);
free(sysmods[i]); free(sysmods[i]);
} }
@@ -349,6 +301,19 @@ u8 loadFirm() {
buildFirmwarePackage(dec_pkg2->data, dec_pkg2->sec_size[PKG2_SEC_KERNEL], &kip1_info); buildFirmwarePackage(dec_pkg2->data, dec_pkg2->sec_size[PKG2_SEC_KERNEL], &kip1_info);
} }
static void SE_lock() {
for (u32 i = 0; i < 16; i++)
se_key_acc_ctrl(i, 0x15);
for (u32 i = 0; i < 2; i++)
se_rsa_acc_ctrl(i, 1);
SE(0x4) = 0; // Make this reg secure only.
SE(SE_KEY_TABLE_ACCESS_LOCK_OFFSET) = 0; // Make all key access regs secure only.
SE(SE_RSA_KEYTABLE_ACCESS_LOCK_OFFSET) = 0; // Make all rsa access regs secure only.
SE(SE_SECURITY_0) &= 0xFFFFFFFB; // Make access lock regs secure only.
}
void launch() { void launch() {
u8 pre4x = pk11Offs->kb < KB_FIRMWARE_VERSION_400; u8 pre4x = pk11Offs->kb < KB_FIRMWARE_VERSION_400;
@@ -396,7 +361,7 @@ void firmware() {
gfx_init_ctxt(&gfx_ctxt, display_init_framebuffer(), 720, 1280, 768); gfx_init_ctxt(&gfx_ctxt, display_init_framebuffer(), 720, 1280, 768);
gfx_clear_color(&gfx_ctxt, 0xFF000000); gfx_clear_color(&gfx_ctxt, 0xFF000000);
gfx_con_init(&gfx_con, &gfx_ctxt); gfx_con_init(&gfx_con, &gfx_ctxt);
gfx_con_setcol(&gfx_con, ORANGE, 0, 0); gfx_con_setcol(&gfx_con, DEFAULT_TEXT_COL, 0, 0);
while (!sdMount()) { while (!sdMount()) {
error("Failed to init SD card!\n"); error("Failed to init SD card!\n");
@@ -406,16 +371,18 @@ void firmware() {
btn_wait(); btn_wait();
} }
if(PMC(APBDEV_PMC_SCRATCH49_0) != 69 && fopen("/ReiNX.bin", "rb")) { if(PMC(APBDEV_PMC_SCRATCH49) != 69 && fopen("/ReiNX.bin", "rb")) {
fread((void*)PAYLOAD_ADDR, fsize(), 1); fread((void*)PAYLOAD_ADDR, fsize(), 1);
fclose(); fclose();
sdUnmount(); sdUnmount();
display_end(); display_end();
CLOCK(CLK_RST_CONTROLLER_CLK_OUT_ENB_V) |= 0x400; // Enable AHUB clock. CLOCK(CLK_RST_CONTROLLER_CLK_OUT_ENB_V) |= 0x400; // Enable AHUB clock.
CLOCK(CLK_RST_CONTROLLER_CLK_OUT_ENB_Y) |= 0x40; // Enable APE clock. CLOCK(CLK_RST_CONTROLLER_CLK_OUT_ENB_Y) |= 0x40; // Enable APE clock.
PMC(APBDEV_PMC_SCRATCH49_0) = 69; PMC(APBDEV_PMC_SCRATCH49) = 69;
((void (*)())PAYLOAD_ADDR)(); ((void (*)())PAYLOAD_ADDR)();
} }
SYSREG(AHB_AHB_SPARE_REG) = (volatile vu32)0xFFFFFF9F;
PMC(APBDEV_PMC_SCRATCH49) = 0;
print("Welcome to ReiNX %s!\n", VERSION); print("Welcome to ReiNX %s!\n", VERSION);
loadFirm(); loadFirm();
View
@@ -28,10 +28,6 @@
#define PAYLOAD_ADDR 0xCFF00000 #define PAYLOAD_ADDR 0xCFF00000
//Instructions
#define NOP 0xD503201F
#define ADRP(r, o) 0x90000000 | ((((o) >> 12) & 0x3) << 29) | ((((o) >> 12) & 0x1FFFFC) << 3) | ((r) & 0x1F)
// TODO: Maybe find these with memsearch // TODO: Maybe find these with memsearch
static const pk11_offs _pk11_offs[] = { static const pk11_offs _pk11_offs[] = {
//{ "20161121183008", 0, 0x1900, 0x3FE0, { 2, 1, 0 }, 0x4002B020, 0x8000D000, 1 }, //TODO: relocator patch for 1.0.0 //{ "20161121183008", 0, 0x1900, 0x3FE0, { 2, 1, 0 }, 0x4002B020, 0x8000D000, 1 }, //TODO: relocator patch for 1.0.0
@@ -41,16 +37,17 @@ static const pk11_offs _pk11_offs[] = {
{ "20170710161758", 2, 0x1A00, 0x3FE0, { 0, 1, 2 }, 0x4002D000, 0x8000D000, 1 }, //3.0.1 - 3.0.2 { "20170710161758", 2, 0x1A00, 0x3FE0, { 0, 1, 2 }, 0x4002D000, 0x8000D000, 1 }, //3.0.1 - 3.0.2
{ "20170921172629", 3, 0x1800, 0x3FE0, { 1, 2, 0 }, 0x4002B000, 0x4003B000, 0 }, //4.0.0 - 4.1.0 { "20170921172629", 3, 0x1800, 0x3FE0, { 1, 2, 0 }, 0x4002B000, 0x4003B000, 0 }, //4.0.0 - 4.1.0
{ "20180220163747", 4, 0x1900, 0x3FE0, { 1, 2, 0 }, 0x4002B000, 0x4003B000, 0 }, //5.0.0 - 5.0.2 { "20180220163747", 4, 0x1900, 0x3FE0, { 1, 2, 0 }, 0x4002B000, 0x4003B000, 0 }, //5.0.0 - 5.0.2
{ "20180802162753", 5, 0x1900, 0x3FE0, { 1, 2, 0 }, 0x4002B000, 0x4003D800, 0 }, //6.0.0
{ NULL, 0, 0, 0, 0 } // End. { NULL, 0, 0, 0, 0 } // End.
}; };
#define NUM_KEYBLOB_KEYS 5 static const u8 keyblob_keyseeds[][0x10] = {
static const u8 keyblob_keyseeds[NUM_KEYBLOB_KEYS][0x10] = {
{ 0xDF, 0x20, 0x6F, 0x59, 0x44, 0x54, 0xEF, 0xDC, 0x70, 0x74, 0x48, 0x3B, 0x0D, 0xED, 0x9F, 0xD3 }, //1.0.0 { 0xDF, 0x20, 0x6F, 0x59, 0x44, 0x54, 0xEF, 0xDC, 0x70, 0x74, 0x48, 0x3B, 0x0D, 0xED, 0x9F, 0xD3 }, //1.0.0
{ 0x0C, 0x25, 0x61, 0x5D, 0x68, 0x4C, 0xEB, 0x42, 0x1C, 0x23, 0x79, 0xEA, 0x82, 0x25, 0x12, 0xAC }, //3.0.0 { 0x0C, 0x25, 0x61, 0x5D, 0x68, 0x4C, 0xEB, 0x42, 0x1C, 0x23, 0x79, 0xEA, 0x82, 0x25, 0x12, 0xAC }, //3.0.0
{ 0x33, 0x76, 0x85, 0xEE, 0x88, 0x4A, 0xAE, 0x0A, 0xC2, 0x8A, 0xFD, 0x7D, 0x63, 0xC0, 0x43, 0x3B }, //3.0.1 { 0x33, 0x76, 0x85, 0xEE, 0x88, 0x4A, 0xAE, 0x0A, 0xC2, 0x8A, 0xFD, 0x7D, 0x63, 0xC0, 0x43, 0x3B }, //3.0.1
{ 0x2D, 0x1F, 0x48, 0x80, 0xED, 0xEC, 0xED, 0x3E, 0x3C, 0xF2, 0x48, 0xB5, 0x65, 0x7D, 0xF7, 0xBE }, //4.0.0 { 0x2D, 0x1F, 0x48, 0x80, 0xED, 0xEC, 0xED, 0x3E, 0x3C, 0xF2, 0x48, 0xB5, 0x65, 0x7D, 0xF7, 0xBE }, //4.0.0
{ 0xBB, 0x5A, 0x01, 0xF9, 0x88, 0xAF, 0xF5, 0xFC, 0x6C, 0xFF, 0x07, 0x9E, 0x13, 0x3C, 0x39, 0x80 } //5.0.0 { 0xBB, 0x5A, 0x01, 0xF9, 0x88, 0xAF, 0xF5, 0xFC, 0x6C, 0xFF, 0x07, 0x9E, 0x13, 0x3C, 0x39, 0x80 }, //5.0.0
{ 0xD8, 0xCC, 0xE1, 0x26, 0x6A, 0x35, 0x3F, 0xCC, 0x20, 0xF3, 0x2D, 0x3B, 0x51, 0x7D, 0xE9, 0xC0 } //6.0.0
}; };
static const u8 cmac_keyseed[0x10] = { 0x59, 0xC7, 0xFB, 0x6F, 0xBE, 0x9B, 0xBE, 0x87, 0x65, 0x6B, 0x15, 0xC0, 0x53, 0x73, 0x36, 0xA5 }; static const u8 cmac_keyseed[0x10] = { 0x59, 0xC7, 0xFB, 0x6F, 0xBE, 0x9B, 0xBE, 0x87, 0x65, 0x6B, 0x15, 0xC0, 0x53, 0x73, 0x36, 0xA5 };
View
@@ -17,7 +17,6 @@
#include <stddef.h> #include <stddef.h>
#include <string.h> #include <string.h>
#include "hwinit.h" #include "hwinit.h"
#include "hwinit/gfx.h"
#include "hwinit/ff.h" #include "hwinit/ff.h"
#include "error.h" #include "error.h"
#include "fs.h" #include "fs.h"
@@ -40,10 +39,10 @@ u32 sdMount() {
} }
void sdUnmount() { void sdUnmount() {
if (!sd_mounted) return;
f_mount(NULL, "", 1); f_mount(NULL, "", 1);
sdmmc_storage_end(&sd_storage); sdmmc_storage_end(&sd_storage);
sd_mounted = 0; sd_mounted = 0;
} }
u32 fopen(const char *path, const char *mode) { u32 fopen(const char *path, const char *mode) {
Oops, something went wrong.

0 comments on commit 017e620

Please sign in to comment.