Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
87073f0
Added new menu entries. Added Kecleon to title.
Dec 23, 2016
271546c
Added description for last option.
Dec 23, 2016
21901d5
Reworded two new options.
Dec 23, 2016
658e055
Added Kecleon config enums.
Dec 23, 2016
a444c83
Implemented option to disable boot menu.
Dec 23, 2016
b652937
Implemented option to disable sig/twl patches.
Dec 23, 2016
9fb2d97
Fixed text in options.
Dec 23, 2016
1473456
Again rephrased text to be more accurate.
Dec 23, 2016
3475d76
Choose config version that makes more sense.
Dec 23, 2016
dd4aec1
Added option to save to CTRNAND.
Dec 23, 2016
f64c095
Implemented load config.bin from CTRNAND.
Dec 24, 2016
2250728
Implemented config.bin saving features.
Dec 24, 2016
a36c959
Fixed config.bin write to CTRNAND.
Dec 24, 2016
bb0973e
Hide save to CTRNAND option when SD card is not inserted.
Dec 24, 2016
eee449a
Removed PIN.
Dec 25, 2016
53d0e44
Added key-combo option to menu.
Dec 26, 2016
8ef8192
Merge branch 'master' into kecleon
Dec 26, 2016
263f6ed
Implemented disable patches option.
Dec 26, 2016
552e4cf
Changed to 64bit config.
Dec 27, 2016
d14e129
Implemented key combo
Dec 30, 2016
55b7ea6
Rewrote some of the descriptions.
Dec 30, 2016
a36745c
Fixed first time boot to EmuNAND.
Dec 30, 2016
d3fcf76
Fixed luma folder on SD card.
Dec 30, 2016
86d77fc
Merge branch 'master' into kecleon
Jan 5, 2017
2f11e29
Merge branch 'master' into kecleon
Jan 26, 2017
c2e856b
Updated README.md.
Jan 31, 2017
f703885
Cleaned up minor things in source code.
Jan 31, 2017
72c0399
Load payloads only from SD card.
Feb 2, 2017
004f07b
Fixed payload loading.
Feb 3, 2017
f84494f
Merge branch 'master' into kecleon
Feb 13, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ endif

include $(DEVKITARM)/base_tools

name := Luma3DS
name := Luma3DS-Kecleon
revision := $(shell git describe --tags --match v[0-9]* --abbrev=8 | sed 's/-[0-9]*-g/-/i')
commit := $(shell git rev-parse --short=8 HEAD)

Expand Down Expand Up @@ -96,7 +96,7 @@ $(dir_build)/%.bin: $(dir_patches)/%.s $(dir_build)
@armips $<

$(dir_build)/memory.o $(dir_build)/strings.o: CFLAGS += -O3
$(dir_build)/config.o: CFLAGS += -DCONFIG_TITLE="\"$(name) $(revision) configuration\""
$(dir_build)/config.o: CFLAGS += -DCONFIG_TITLE="\"$(name) $(revision)\""
$(dir_build)/patches.o: CFLAGS += -DREVISION=\"$(revision)\" -DCOMMIT_HASH="0x$(commit)"

$(dir_build)/%.o: $(dir_source)/%.c $(bundled)
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# Luma3DS - Kecleon

Please read the [gbatemp thread](https://gbatemp.net/threads/release-kecleon-patch-for-luma3ds.455090/).

Original Readme:

# Luma3DS
*Noob-proof (N)3DS "Custom Firmware"*

Expand Down
21 changes: 11 additions & 10 deletions injector/source/patcher.c
Original file line number Diff line number Diff line change
Expand Up @@ -499,14 +499,15 @@ void patchCode(u64 progId, u16 progVer, u8 *code, u32 size)
{
loadCFWInfo();

if(((progId == 0x0004003000008F02LL || //USA Home Menu
progId == 0x0004003000008202LL || //JPN Home Menu
progId == 0x0004003000009802LL) //EUR Home Menu
&& progVer > 4) ||
(progId == 0x000400300000A902LL //KOR Home Menu
&& progVer > 0) ||
progId == 0x000400300000A102LL || //CHN Home Menu
progId == 0x000400300000B102LL) //TWN Home Menu
if((((progId == 0x0004003000008F02LL || //USA Home Menu
progId == 0x0004003000008202LL || //JPN Home Menu
progId == 0x0004003000009802LL) //EUR Home Menu
&& progVer > 4) ||
(progId == 0x000400300000A902LL //KOR Home Menu
&& progVer > 0) ||
progId == 0x000400300000A102LL || //CHN Home Menu
progId == 0x000400300000B102LL) //TWN Home Menu
&& !CONFIG(KECPATCH))
{
static const u8 pattern[] = {
0x0A, 0x0C, 0x00, 0x10
Expand Down Expand Up @@ -591,7 +592,7 @@ void patchCode(u64 progId, u16 progVer, u8 *code, u32 size)
)) goto error;
}

else if(progId == 0x0004013000008002LL) //NS
else if(progId == 0x0004013000008002LL && !CONFIG(KECPATCH)) //NS
{
if(progVer > 4)
{
Expand Down Expand Up @@ -731,7 +732,7 @@ void patchCode(u64 progId, u16 progVer, u8 *code, u32 size)
) != 3) goto error;
}

else if(progId == 0x0004013000002802LL && progVer > 0) //DLP
else if(progId == 0x0004013000002802LL && progVer > 0 && !CONFIG(KECPATCH)) //DLP
{
static const u8 pattern[] = {
0x0C, 0xAC, 0xC0, 0xD8
Expand Down
9 changes: 6 additions & 3 deletions injector/source/patcher.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ enum multiOptions
DEFAULTEMU = 0,
BRIGHTNESS,
SPLASH,
PIN,
NEWCPU,
DEVOPTIONS
};
Expand All @@ -34,7 +33,11 @@ enum singleOptions
PATCHGAMES,
PATCHVERSTRING,
SHOWGBABOOT,
PATCHACCESS
PATCHACCESS,
KECNAND,
KECPATCH,
KECMENU,
KECCOMBO
};

enum flags
Expand All @@ -43,4 +46,4 @@ enum flags
ISSAFEMODE
};

void patchCode(u64 progId, u16 progVer, u8 *code, u32 size);
void patchCode(u64 progId, u16 progVer, u8 *code, u32 size);
75 changes: 51 additions & 24 deletions source/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include "screen.h"
#include "draw.h"
#include "buttons.h"
#include "pin.h"

CfgData configData;

Expand All @@ -50,7 +49,7 @@ void writeConfig(ConfigurationStatus needConfig, u32 configTemp)
{
/* If the configuration is different from previously, overwrite it.
Just the no-forcing flag being set is not enough */
if(needConfig != CREATE_CONFIGURATION && (configTemp & 0xFFFFFF7F) == configData.config) return;
if(needConfig != CREATE_CONFIGURATION && (configTemp & 0xFFFFFFFFFFFFFF7F) == configData.config) return;

if(needConfig == CREATE_CONFIGURATION)
{
Expand All @@ -60,18 +59,35 @@ void writeConfig(ConfigurationStatus needConfig, u32 configTemp)
}

//Merge the new options and new boot configuration
configData.config = (configData.config & 0xFFFFFF00) | (configTemp & 0xFF);
configData.config = (configData.config & 0xFFFFFFFFFFFFFF00) | (configTemp & 0xFF);

if(!fileWrite(&configData, CONFIG_FILE, sizeof(CfgData)))
error("Error writing the configuration file");
}

void configMenu(bool isSdMode, bool oldPinStatus, u32 oldPinMode)
u32 getPAD()
{
initScreens();

drawString("Set key combo with ABXY, START, SELECT & D-Pad.\n"
"Press R while holding down combo to finish.\n"
"This may take a few seconds.",
true, 10, 10, COLOR_WHITE);

u32 pressed;
do {
pressed = waitInput(true);
}
while(!(pressed & BUTTON_R1));

return pressed & PIN_BUTTONS;
}

void configMenu(bool isSdMode)
{
const char *multiOptionsText[] = { "Default EmuNAND: 1( ) 2( ) 3( ) 4( )",
"Screen brightness: 4( ) 3( ) 2( ) 1( )",
"Splash: Off( ) Before( ) After( ) payloads",
"PIN lock: Off( ) 4( ) 6( ) 8( ) digits",
"New 3DS CPU: Off( ) Clock( ) L2( ) Clock+L2( )",
"Dev. features: Off( ) ErrDisp( ) UNITINFO( )"
};
Expand All @@ -84,7 +100,10 @@ void configMenu(bool isSdMode, bool oldPinStatus, u32 oldPinMode)
"( ) Show NAND or user string in System Settings",
"( ) Show GBA boot screen in patched AGB_FIRM",
"( ) Patch SVC/service/archive/ARM9 access",
"( ) Hide Pin when entering"
"( ) Kecleon: Save config.bin in CTRNAND.",
"( ) Kecleon: Disable Region-Free/Flashcart\n patches",
"( ) Kecleon: Ignore all Button Presses on boot",
"( ) Kecleon: Set key-combo to remove above lock"
};

const char *optionsDescription[] = { "Select the default EmuNAND.\n\n"
Expand All @@ -101,15 +120,6 @@ void configMenu(bool isSdMode, bool oldPinStatus, u32 oldPinMode)
"\t* 'After payloads' displays it\n"
"afterwards.",

"Activate a PIN lock.\n\n"
"The PIN will be asked each time\n"
"Luma3DS boots.\n\n"
"4, 6 or 8 digits can be selected.\n\n"
"The ABXY buttons and the directional\n"
"pad buttons can be used as keys.\n\n"
"A message can also be displayed\n"
"(refer to the wiki for instructions).",

"Select the New 3DS CPU mode.\n\n"
"This won't apply to\n"
"New 3DS exclusive/enhanced games.\n\n"
Expand Down Expand Up @@ -191,9 +201,28 @@ void configMenu(bool isSdMode, bool oldPinStatus, u32 oldPinMode)
"9.3 and 10.4.\n\n"
"Only change this if you know what you\n"
"are doing!",

"Hides the input when entering pin\n"
"to unlock the 3DS"

"Save configuration file in CTRNAND\n"
"at '/rw/luma/config.bin'.",

"This disables patches that can give\n"
"away this 3DS is running CFW,\n"
"such as out-of-region cartridges,\n"
"out-of-region download play,\n"
"or banned flashcarts.",

"This makes Luma3DS ignore all Button\n"
"Presses on boot, hiding chainloading\n"
"and boot menus that give away this\n"
"3DS is running CFW.\n\n"
"Warning: config.bin must be deleted\n"
"to re-enable configuration menus\n"
"if Key Combo is not set.\n",

"Set a Key Combo to make this\n"
"configuration menu appear on\n"
"startup, when the above option is\n"
"set."
};

struct multiOption {
Expand All @@ -205,7 +234,6 @@ void configMenu(bool isSdMode, bool oldPinStatus, u32 oldPinMode)
{ .posXs = {19, 24, 29, 34}, .visible = isSdMode },
{ .posXs = {21, 26, 31, 36}, .visible = true },
{ .posXs = {12, 22, 31, 0}, .visible = true },
{ .posXs = {14, 19, 24, 29}, .visible = true },
{ .posXs = {17, 26, 32, 44}, .visible = ISN3DS },
{ .posXs = {19, 30, 42, 0}, .visible = true }
};
Expand All @@ -223,6 +251,9 @@ void configMenu(bool isSdMode, bool oldPinStatus, u32 oldPinMode)
{ .visible = true },
{ .visible = true },
{ .visible = true },
{ .visible = true },
{ .visible = true },
{ .visible = true },
{ .visible = true }
};

Expand Down Expand Up @@ -392,11 +423,7 @@ void configMenu(bool isSdMode, bool oldPinStatus, u32 oldPinMode)
for(u32 i = 0; i < singleOptionsAmount; i++)
configData.config |= (singleOptions[i].enabled ? 1 : 0) << (i + 20);

u32 newPinMode = MULTICONFIG(PIN);

if(newPinMode != 0) newPin(oldPinStatus && newPinMode == oldPinMode, newPinMode);
else if(oldPinStatus) fileDelete(PIN_FILE);
if (CONFIG(KECCOMBO)) configData.combo = getPAD();

while(HID_PAD & PIN_BUTTONS);
wait(2000ULL);
}
11 changes: 7 additions & 4 deletions source/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
#define BOOTCONFIG(a, b) ((configData.config >> a) & b)

#define CONFIG_FILE "config.bin"
#define CONFIG_VERSIONMAJOR 1
/* Corresponds to downstream 1.8 */
#define CONFIG_VERSIONMAJOR 24801
#define CONFIG_VERSIONMINOR 8

#define BOOTCFG_NAND BOOTCONFIG(0, 7)
Expand All @@ -42,7 +43,6 @@ enum multiOptions
DEFAULTEMU = 0,
BRIGHTNESS,
SPLASH,
PIN,
NEWCPU,
DEVOPTIONS
};
Expand All @@ -57,7 +57,10 @@ enum singleOptions
PATCHVERSTRING,
SHOWGBABOOT,
PATCHACCESS,
HIDEPIN
KECNAND,
KECPATCH,
KECMENU,
KECCOMBO
};

typedef enum ConfigurationStatus
Expand All @@ -69,4 +72,4 @@ typedef enum ConfigurationStatus

bool readConfig(void);
void writeConfig(ConfigurationStatus needConfig, u32 configTemp);
void configMenu(bool isSdMode, bool oldPinStatus, u32 oldPinMode);
void configMenu(bool isSdMode);
Loading