Compare commits

...

6 Commits
v5.1.2 ... v5.2

Author SHA1 Message Date
Aurora
c928b3b68b New icon 2016-04-23 15:39:40 +02:00
Aurora
ae9c29629c Wrong name in the Makefile 2016-04-23 03:50:04 +02:00
Aurora
3fd4603553 Welcome Luma3DS 2016-04-23 01:43:36 +02:00
Aurora
c14526068a Minor stuff 2016-04-21 23:39:05 +02:00
Aurora
180b2a6f4d Bye bye fileSize! 2016-04-21 05:08:42 +02:00
Aurora
19d8861d27 Give 3ds_injector a sane makefile 2016-04-19 20:51:00 +02:00
33 changed files with 42 additions and 138 deletions

View File

@@ -11,7 +11,7 @@ AS := arm-none-eabi-as
LD := arm-none-eabi-ld LD := arm-none-eabi-ld
OC := arm-none-eabi-objcopy OC := arm-none-eabi-objcopy
name := AuReiNand name := Luma3DS
version := $(shell git describe --abbrev=0 --tags) version := $(shell git describe --abbrev=0 --tags)
dir_source := source dir_source := source
@@ -27,7 +27,7 @@ dir_out := out
ASFLAGS := -mcpu=arm946e-s ASFLAGS := -mcpu=arm946e-s
CFLAGS := -Wall -Wextra -MMD -MP -marm $(ASFLAGS) -fno-builtin -fshort-wchar -std=c11 -Wno-main -O2 -flto -ffast-math CFLAGS := -Wall -Wextra -MMD -MP -marm $(ASFLAGS) -fno-builtin -fshort-wchar -std=c11 -Wno-main -O2 -flto -ffast-math
LDFLAGS := -nostartfiles LDFLAGS := -nostartfiles
FLAGS := name=$(name).dat dir_out=$(abspath $(dir_out)) ICON=$(abspath icon.png) APP_DESCRIPTION="Noob-friendly 3DS CFW." APP_AUTHOR="Reisyukaku/Aurora Wright" --no-print-directory FLAGS := name=$(name).dat dir_out=$(abspath $(dir_out)) ICON=$(abspath icon.png) APP_DESCRIPTION="Noob-friendly 3DS CFW." APP_AUTHOR="Aurora Wright" --no-print-directory
objects = $(patsubst $(dir_source)/%.s, $(dir_build)/%.o, \ objects = $(patsubst $(dir_source)/%.s, $(dir_build)/%.o, \
$(patsubst $(dir_source)/%.c, $(dir_build)/%.o, \ $(patsubst $(dir_source)/%.c, $(dir_build)/%.o, \
@@ -48,10 +48,7 @@ a9lh: $(dir_out)/arm9loaderhax.bin
ninjhax: $(dir_out)/3ds/$(name) ninjhax: $(dir_out)/3ds/$(name)
.PHONY: release .PHONY: release
release: $(dir_out)/$(name).zip release: $(dir_out)/$(name)$(version).7z
.PHONY: pathchanger
pathchanger: $(dir_out)/pathchanger
.PHONY: clean .PHONY: clean
clean: clean:
@@ -63,10 +60,7 @@ clean:
@rm -rf $(dir_out) $(dir_build) @rm -rf $(dir_out) $(dir_build)
$(dir_out): $(dir_out):
@mkdir -p "$(dir_out)/aurei/payloads" @mkdir -p "$(dir_out)/luma/payloads"
$(dir_out)/pathchanger: $(dir_out)
@cc pathchanger/pathchanger.c -o out/pathchanger
$(dir_out)/$(name).dat: $(dir_build)/main.bin $(dir_out) $(dir_out)/$(name).dat: $(dir_build)/main.bin $(dir_out)
@$(MAKE) $(FLAGS) -C $(dir_mset) launcher @$(MAKE) $(FLAGS) -C $(dir_mset) launcher
@@ -80,8 +74,8 @@ $(dir_out)/3ds/$(name): $(dir_out)
@$(MAKE) $(FLAGS) -C $(dir_ninjhax) @$(MAKE) $(FLAGS) -C $(dir_ninjhax)
@mv $(dir_out)/$(name).3dsx $(dir_out)/$(name).smdh $@ @mv $(dir_out)/$(name).3dsx $(dir_out)/$(name).smdh $@
$(dir_out)/$(name).zip: launcher a9lh ninjhax $(dir_out)/$(name)$(version).7z: launcher a9lh ninjhax
@cd "$(@D)" && zip -9 -r $(name) * @7z a -mx $@ ./$(@D)/*
$(dir_build)/main.bin: $(dir_build)/main.elf $(dir_build)/main.bin: $(dir_build)/main.elf
$(OC) -S -O binary $< $@ $(OC) -S -O binary $< $@

View File

@@ -1,5 +1,5 @@
# AuReiNand # Luma3DS
*A modification of the ReiNand custom firmware* *Noob-proof (N)3DS "Custom Firmware"*
**Compiling:** **Compiling:**
@@ -9,8 +9,8 @@ You can find the compiled files in the 'out' folder.
**Setup / Usage / Features:** **Setup / Usage / Features:**
See https://github.com/AuroraWright/AuReiNand/wiki See https://github.com/AuroraWright/Luma3DS/wiki
**Credits:** **Credits:**
See https://github.com/AuroraWright/AuReiNand/wiki/Credits See https://github.com/AuroraWright/Luma3DS/wiki/Credits

BIN
icon.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -123,7 +123,7 @@ static u32 loadConfig(void)
if(!config) if(!config)
{ {
IFile file; IFile file;
if(R_SUCCEEDED(fileOpen(&file, ARCHIVE_SDMC, "/aurei/config.bin", FS_OPEN_READ))) if(R_SUCCEEDED(fileOpen(&file, ARCHIVE_SDMC, "/luma/config.bin", FS_OPEN_READ)))
{ {
u64 total; u64 total;
if(R_SUCCEEDED(IFile_Read(&file, &total, &config, 4))) config |= 1 << 4; if(R_SUCCEEDED(IFile_Read(&file, &total, &config, 4))) config |= 1 << 4;
@@ -136,12 +136,12 @@ static u32 loadConfig(void)
static int loadTitleLocaleConfig(u64 progId, u8 *regionId, u8 *languageId) static int loadTitleLocaleConfig(u64 progId, u8 *regionId, u8 *languageId)
{ {
/* Here we look for "/aurei/locales/[u64 titleID in hex, uppercase].txt" /* Here we look for "/luma/locales/[u64 titleID in hex, uppercase].txt"
If it exists it should contain, for example, "EUR IT" */ If it exists it should contain, for example, "EUR IT" */
char path[] = "/aurei/locales/0000000000000000.txt"; char path[] = "/luma/locales/0000000000000000.txt";
u32 i = 30; u32 i = 29;
while(progId > 0) while(progId > 0)
{ {

View File

@@ -7,7 +7,7 @@
static u32 loadPayload(const char *pattern) static u32 loadPayload(const char *pattern)
{ {
char path[30] = "/aurei/payloads"; char path[30] = "/luma/payloads";
DIR dir; DIR dir;
FILINFO info; FILINFO info;
@@ -19,11 +19,11 @@ static u32 loadPayload(const char *pattern)
if(result != FR_OK || !info.fname[0]) if(result != FR_OK || !info.fname[0])
return 0; return 0;
path[15] = '/'; path[14] = '/';
u32 i; u32 i;
for(i = 0; info.fname[i]; i++) for(i = 0; info.fname[i]; i++)
path[16 + i] = info.fname[i]; path[15 + i] = info.fname[i];
path[16 + i] = '\0'; path[15 + i] = '\0';
FIL payload; FIL payload;
unsigned int br; unsigned int br;

View File

@@ -1,9 +1,3 @@
/*
* types.h
* by Reisyukaku
* Copyright (c) 2015 All Rights Reserved
*/
#pragma once #pragma once
#include <stdint.h> #include <stdint.h>

View File

@@ -80,7 +80,7 @@ fopen: .ascii "OPEN"
.pool .pool
bin_fname: .dcw "sdmc:/arm9loaderhax.bin" bin_fname: .dcw "sdmc:/arm9loaderhax.bin"
.word 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 .word 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
dat_fname: .dcw "sdmc:/AuReiNand.dat" dat_fname: .dcw "sdmc:/Luma3DS.dat"
.word 0 .word 0
.align 4 .align 4

View File

@@ -43,7 +43,7 @@ static int fsize(FILE *fp)
static void error(FILE *payload, const char *message) static void error(FILE *payload, const char *message)
{ {
fclose(payload); fclose(payload);
printf("%s, are you sure you're using an AuReiNand payload?\n", message); printf("%s, are you sure you're using a Luma3DS payload?\n", message);
exit(0); exit(0);
} }
@@ -51,7 +51,7 @@ int main(int argc, char **argv)
{ {
if(argc == 1) if(argc == 1)
{ {
printf("Usage: %s <AuReiNand payload path>\n", argv[0]); printf("Usage: %s <Luma3DS payload path>\n", argv[0]);
exit(0); exit(0);
} }

View File

@@ -1,9 +1,3 @@
/*
* types.h
* by Reisyukaku
* Copyright (c) 2015 All Rights Reserved
*/
#pragma once #pragma once
#include <stdint.h> #include <stdint.h>

View File

@@ -1,7 +1,5 @@
/* /*
* buttons.h * buttons.h
* by Aurora Wright
* Copyright (c) 2016 All Rights Reserved
*/ */
#pragma once #pragma once

View File

@@ -1,7 +1,5 @@
/* /*
* config.c * config.c
* by Aurora Wright
* Copyright (c) 2016 All Rights Reserved
*/ */
#include "config.h" #include "config.h"

View File

@@ -1,7 +1,5 @@
/* /*
* config.h * config.h
* by Aurora Wright
* Copyright (c) 2016 All Rights Reserved
*/ */
#pragma once #pragma once

View File

@@ -1,9 +1,7 @@
/* /*
* crypto.c * crypto.c
* by Reisyukaku / Aurora Wright
* Crypto libs from http://github.com/b1l1s/ctr
* *
* Copyright (c) 2016 All Rights Reserved * Crypto libs from http://github.com/b1l1s/ctr
*/ */
#include "crypto.h" #include "crypto.h"
@@ -386,7 +384,7 @@ void arm9Loader(u8 *arm9Section, u32 mode)
//Set >=9.6 KeyXs //Set >=9.6 KeyXs
if(mode) if(mode)
{ {
u8 keyData[] = {0xDD, 0xDA, 0xA4, 0xC6, 0x2C, 0xC4, 0x50, 0xE9, 0xDA, 0xB6, 0x9B, 0x0D, 0x9D, 0x2A, 0x21, 0x98}; u8 keyData[0x10] = {0xDD, 0xDA, 0xA4, 0xC6, 0x2C, 0xC4, 0x50, 0xE9, 0xDA, 0xB6, 0x9B, 0x0D, 0x9D, 0x2A, 0x21, 0x98};
u8 decKey[0x10]; u8 decKey[0x10];
//Set keys 0x19..0x1F keyXs //Set keys 0x19..0x1F keyXs

View File

@@ -1,9 +1,7 @@
/* /*
* crypto.h * crypto.h
* by Reisyukaku / Aurora Wright
* Crypto libs from http://github.com/b1l1s/ctr
* *
* Copyright (c) 2016 All Rights Reserved * Crypto libs from http://github.com/b1l1s/ctr
*/ */
#pragma once #pragma once

View File

@@ -1,9 +1,7 @@
/* /*
* draw.c * draw.c
* by Reisyukaku / Aurora Wright
* Code to print to the screen by mid-kid @CakesFW
* *
* Copyright (c) 2016 All Rights Reserved * Code to print to the screen by mid-kid @CakesFW
*/ */
#include "draw.h" #include "draw.h"
@@ -41,8 +39,8 @@ void loadSplash(void)
initScreens(); initScreens();
//Don't delay boot if no splash image is on the SD //Don't delay boot if no splash image is on the SD
if(fileRead(fb->top_left, "/aurei/splash.bin", 0x46500) + if(fileRead(fb->top_left, "/luma/splash.bin", 0x46500) +
fileRead(fb->bottom, "/aurei/splashbottom.bin", 0x38400)) fileRead(fb->bottom, "/luma/splashbottom.bin", 0x38400))
{ {
u64 i = 0x1400000; u64 i = 0x1400000;
while(--i) __asm("mov r0, r0"); //Less Ghetto sleep func while(--i) __asm("mov r0, r0"); //Less Ghetto sleep func

View File

@@ -1,9 +1,7 @@
/* /*
* draw.h * draw.h
* by Reisyukaku / Aurora Wright
* Code to print to the screen by mid-kid @CakesFW
* *
* Copyright (c) 2016 All Rights Reserved * Code to print to the screen by mid-kid @CakesFW
*/ */
#pragma once #pragma once

View File

@@ -1,7 +1,5 @@
/* /*
* emunand.c * emunand.c
* by Reisyukaku / Aurora Wright
* Copyright (c) 2016 All Rights Reserved
*/ */
#include "emunand.h" #include "emunand.h"

View File

@@ -1,7 +1,5 @@
/* /*
* emunand.h * emunand.h
* by Reisyukaku / Aurora Wright
* Copyright (c) 2016 All Rights Reserved
*/ */
#pragma once #pragma once

View File

@@ -1,7 +1,5 @@
/* /*
* firm.c * firm.c
* by Reisyukaku / Aurora Wright
* Copyright (c) 2016 All Rights Reserved
*/ */
#include "firm.h" #include "firm.h"
@@ -44,7 +42,7 @@ void main(void)
mountFs(); mountFs();
//Attempt to read the configuration file //Attempt to read the configuration file
const char configPath[] = "/aurei/config.bin"; const char configPath[] = "/luma/config.bin";
if(fileRead(&config, configPath, 4)) needConfig = 1; if(fileRead(&config, configPath, 4)) needConfig = 1;
else else
{ {
@@ -81,9 +79,6 @@ void main(void)
//Get pressed buttons //Get pressed buttons
u32 pressed = HID_PAD; u32 pressed = HID_PAD;
//Determine if we need to autoboot sysNAND
u32 autoBootSys = CONFIG(0);
//Determine if A9LH is installed and the user has an updated sysNAND //Determine if A9LH is installed and the user has an updated sysNAND
if(a9lhBoot || CONFIG(2)) if(a9lhBoot || CONFIG(2))
{ {
@@ -143,6 +138,9 @@ void main(void)
//If screens are inited or the corresponding option is set, load splash screen //If screens are inited or the corresponding option is set, load splash screen
if(PDN_GPU_CNT != 1 || CONFIG(8)) loadSplash(); if(PDN_GPU_CNT != 1 || CONFIG(8)) loadSplash();
//Determine if we need to autoboot sysNAND
u32 autoBootSys = CONFIG(0);
//Determine if we need to boot an emuNAND or sysNAND //Determine if we need to boot an emuNAND or sysNAND
nandType = (pressed & BUTTON_L1) ? autoBootSys : ((pressed & BUTTON_R1) ? updatedSys : !autoBootSys); nandType = (pressed & BUTTON_L1) ? autoBootSys : ((pressed & BUTTON_R1) ? updatedSys : !autoBootSys);
@@ -194,24 +192,10 @@ static inline void loadFirm(u32 firmType, u32 externalFirm)
{ {
section = firm->section; section = firm->section;
u32 firmSize; /* If the conditions to load the external FIRM aren't met, or reading fails, or the FIRM
doesn't match the console, load it from CTRNAND */
if(externalFirm) if(!externalFirm || !fileRead(firm, "/luma/firmware.bin", 0) ||
{ (((u32)section[2].address >> 8) & 0xFF) != (console ? 0x60 : 0x68))
const char path[] = "/aurei/firmware.bin";
firmSize = fileSize(path);
if(firmSize)
{
fileRead(firm, path, firmSize);
//Check that the loaded FIRM matches the console
if((((u32)section[2].address >> 8) & 0xFF) != (console ? 0x60 : 0x68)) firmSize = 0;
}
}
else firmSize = 0;
if(!firmSize)
{ {
const char *firmFolders[3][2] = {{ "00000002", "20000002" }, const char *firmFolders[3][2] = {{ "00000002", "20000002" },
{ "00000102", "20000102" }, { "00000102", "20000102" },
@@ -383,7 +367,8 @@ static inline void patchTwlAgbFirm(u32 firmType)
/* Calculate the amount of patches to apply. Only count the boot screen patch for AGB_FIRM /* Calculate the amount of patches to apply. Only count the boot screen patch for AGB_FIRM
if the matching option was enabled (keep it as last) */ if the matching option was enabled (keep it as last) */
u32 numPatches = firmType == 1 ? (sizeof(twlPatches) / sizeof(patchData)) : (sizeof(agbPatches) / sizeof(patchData) - !CONFIG(7)); u32 numPatches = firmType == 1 ? (sizeof(twlPatches) / sizeof(patchData)) :
(sizeof(agbPatches) / sizeof(patchData) - !CONFIG(7));
const patchData *patches = firmType == 1 ? twlPatches : agbPatches; const patchData *patches = firmType == 1 ? twlPatches : agbPatches;
//Patch //Patch

View File

@@ -1,7 +1,5 @@
/* /*
* firm.h * firm.h
* by Reisyukaku / Aurora Wright
* Copyright (c) 2016 All Rights Reserved
*/ */
#pragma once #pragma once

View File

@@ -1,7 +1,5 @@
/* /*
* fs.c * fs.c
* by Reisyukaku / Aurora Wright
* Copyright (c) 2016 All Rights Reserved
*/ */
#include "fs.h" #include "fs.h"
@@ -51,25 +49,12 @@ u32 fileWrite(const void *buffer, const char *path, u32 size)
return fr ? 0 : 1; return fr ? 0 : 1;
} }
u32 fileSize(const char *path)
{
FIL fp;
u32 size = 0;
if(f_open(&fp, path, FA_READ) == FR_OK)
size = f_size(&fp);
f_close(&fp);
return size;
}
u32 defPayloadExists(void) u32 defPayloadExists(void)
{ {
DIR dir; DIR dir;
FILINFO info; FILINFO info;
FRESULT result = f_findfirst(&dir, &info, "/aurei/payloads", "def_*.bin"); FRESULT result = f_findfirst(&dir, &info, "/luma/payloads", "def_*.bin");
f_closedir(&dir); f_closedir(&dir);
@@ -89,11 +74,8 @@ void firmRead(void *dest, const char *firmFolder)
u32 id = 0; u32 id = 0;
//Parse the target directory //Parse the target directory
while(f_readdir(&dir, &info) == FR_OK) while(f_readdir(&dir, &info) == FR_OK && info.fname[0])
{ {
//We've parsed the whole folder
if(!info.fname[0]) break;
//Not a cxi //Not a cxi
if(info.altname[9] != 'A') continue; if(info.altname[9] != 'A') continue;

View File

@@ -1,7 +1,5 @@
/* /*
* fs.h * fs.h
* by Reisyukaku / Aurora Wright
* Copyright (c) 2016 All Rights Reserved
*/ */
#pragma once #pragma once
@@ -11,6 +9,5 @@
u32 mountFs(void); u32 mountFs(void);
u32 fileRead(void *dest, const char *path, u32 size); u32 fileRead(void *dest, const char *path, u32 size);
u32 fileWrite(const void *buffer, const char *path, u32 size); u32 fileWrite(const void *buffer, const char *path, u32 size);
u32 fileSize(const char *path);
u32 defPayloadExists(void); u32 defPayloadExists(void);
void firmRead(void *dest, const char *firmFolder); void firmRead(void *dest, const char *firmFolder);

View File

@@ -1,7 +1,5 @@
/* /*
* loader.c * loader.c
* by Aurora Wright
* Copyright (c) 2016 All Rights Reserved
*/ */
#include "loader.h" #include "loader.h"

View File

@@ -1,7 +1,5 @@
/* /*
* loader.h * loader.h
* by Aurora Wright
* Copyright (c) 2016 All Rights Reserved
*/ */
#pragma once #pragma once

View File

@@ -1,7 +1,5 @@
/* /*
* memory.c * memory.c
* by Reisyukaku / Aurora Wright
* Copyright (c) 2016 All Rights Reserved
* *
* Quick Search algorithm adapted from http://igm.univ-mlv.fr/~lecroq/string/node19.html#SECTION00190 * Quick Search algorithm adapted from http://igm.univ-mlv.fr/~lecroq/string/node19.html#SECTION00190
*/ */

View File

@@ -1,7 +1,5 @@
/* /*
* memory.h * memory.h
* by Reisyukaku / Aurora Wright
* Copyright (c) 2016 All Rights Reserved
* *
* Quick Search algorithm adapted from http://igm.univ-mlv.fr/~lecroq/string/node19.html#SECTION00190 * Quick Search algorithm adapted from http://igm.univ-mlv.fr/~lecroq/string/node19.html#SECTION00190
*/ */

View File

@@ -1,7 +1,5 @@
/* /*
* patches.c * patches.c
* by Reisyukaku / Aurora Wright
* Copyright (c) 2016 All Rights Reserved
*/ */
#include "patches.h" #include "patches.h"

View File

@@ -1,7 +1,5 @@
/* /*
* patches.h * patches.h
* by Reisyukaku / Aurora Wright
* Copyright (c) 2016 All Rights Reserved
*/ */
#pragma once #pragma once

View File

@@ -1,10 +1,8 @@
/* /*
* screeninit.c * screeninit.c
* by Aurora Wright *
* Screen init code by dark_samus, bil1s, Normmatt, delebile and others. * Screen init code by dark_samus, bil1s, Normmatt, delebile and others.
* Screen deinit code by tiniVi. * Screen deinit code by tiniVi.
*
* Copyright (c) 2016 All Rights Reserved
*/ */
#include "screeninit.h" #include "screeninit.h"

View File

@@ -1,10 +1,8 @@
/* /*
* screeninit.h * screeninit.h
* by Aurora Wright *
* Screen init code by dark_samus, bil1s, Normmatt, delebile and others. * Screen init code by dark_samus, bil1s, Normmatt, delebile and others.
* Screen deinit code by tiniVi. * Screen deinit code by tiniVi.
*
* Copyright (c) 2016 All Rights Reserved
*/ */
#pragma once #pragma once

View File

@@ -1,7 +1,5 @@
/* /*
* types.h * types.h
* by Reisyukaku
* Copyright (c) 2015 All Rights Reserved
*/ */
#pragma once #pragma once

View File

@@ -1,7 +1,5 @@
/* /*
* utils.c * utils.c
* by Aurora Wright
* Copyright (c) 2016 All Rights Reserved
*/ */
#include "utils.h" #include "utils.h"

View File

@@ -1,7 +1,5 @@
/* /*
* utils.h * utils.h
* by Aurora Wright
* Copyright (c) 2016 All Rights Reserved
*/ */
#pragma once #pragma once