D
Deleted User
Guest
Awesome! Can't wait to see if you ever find a way to make those have a comback! This version is pretty noob-friendly! Glad to see the progress!Uploaded a new version on first post. That's basically the test version above but without the 4 useless "-" at the beginning of the name. Not sure if they'll make a comeback but for now I don't see any reason to have a folder name with 16 characters if only 12 are used.
Old post in spoiler.
As you may be able to tell from the title, this is a fork from arm9select, so credits go to @FIX94 and whoever he credited. This also uses code from Decrypt9 for the password, so credits to @d0k3 and whoever I should credit too, but I have no idea who they are. You can PM me or post in the topic if you want to be credited.
Current boot managers (from what I've seen at least) either "only" allow you you to use one key per file or allow you to use two keys but one of them is fixed (like L+button with AuReiNand). This bothered me a bit, so I wanted to make a boot manager that allows you to use any button configuration for any payload, and that would also support password protection to avoid people booting GodMode9 and erasing all the things. Well here it is.
The magic folder is obviously the "arm9loaderhay" folder on your SD card (create it if needed). Here, you can put a default.bin payload and a default_bl file if the default payload needs backlight (same as arm9select so far).
Then, in that folder, you can have subfolders, containing a "arm9loaderhax.bin" payload (the name "arm9loaderhax.bin" allows to easily update the payload since probably all payloads are released with that name). Along with that payload, you can have a "backlight" file if the payload needs backlight, and a "password" file if the payload needs to be password protected. You can also add other files like a file named "AB_CtrBootManager" to specify that this folder is about CtrBootManager and is launched with AB.
The annoying part is the folder name. It is composed of 16 digits. From right to left, digits describe keys in that order : A, B, SELECT, START, RIGHT, LEFT, UP, DOWN, R, L, X, Y. Now you may say "it makes 12 digits and you said 16". Just put the remaining ones at 0.
So here's an example of what your SD card might look like.
Code:SD ├── arm9loaderhax.bin └── arm9loaderhay/ ├── default.bin ├── default_bl ├── 0000000000000011/ │ ├── arm9loaderhax.bin │ ├── backlight │ └── This_Is_CtrBootManager_On_A_B └── 0000000000100100/ ├── arm9loaderhax.bin ├── backlight ├── password └── This_Is_GodMode9_On_LEFT_SELECT
The password file must actually be a text file containing your password. Yeah, that means you are able to set a different password for each payload. Or you can use the same one by copy-pasting the same password file in all your folders.
To describe your password, use this:
So for example, if your password is A,B,X,Y, just write "ABXY" in your password file.
- A,B,X,Y for the A,B,X,Y keys
- E,T for SELECT and START (they both start with an S so they couldn't use their initials)
- l,r,d,u for the arrow keys (in lowercase to avoid confusion with L and R)
- L,R for the shoulders
Notice that any password longer than 10 characters will be trimmed down to 10.
Also notice that any unrecognized character will mark the end or your password. "ABXYwatLR" for exemple is equivalent to "AXBY".
The last thing to notice is that you can't use the same key twice in a row, so ABA is valid but AAB isn't.
And since I did this during the night and uploaded it today in haste, it's not so heavily tested. I basically only tested it with "ABXY"...
Changes in code are as follow (plus get the hid.c, hid.h files from Decrypt9, and maybe some others I forgot).
In arm9select/payload_stage2/source/main.c
Code:int main() { FATFS fs; if(f_mount(&fs, "0:", 0) == FR_OK) { //Read pad state u16 padInput = (~(*(u16*)0x10146000)) & 0x0FFF; FIL f; //Deduce base filename u16 N = padInput; char base[] = "/arm9loaderhay/0000000000000000/arm9loaderhax.bin"; char back[] = "/arm9loaderhay/0000000000000000/backlight"; char pass[] = "/arm9loaderhay/0000000000000000/password"; for (int i=0; i<16; i++) { base[30-i] = '0' + (N%2); back[30-i] = '0' + (N%2); pass[30-i] = '0' + (N%2); N = N/2; } //Password if needed if (f_open(&f, pass, FA_READ | FA_OPEN_EXISTING) == FR_OK) { //u32 password[] = {BUTTON_LEFT, BUTTON_RIGHT, BUTTON_DOWN, BUTTON_UP, BUTTON_A, 0}; u32 password[11]; //password can't be longer than 10, because a max is reasonably needed and no one will go over 10... for (int i=0; i<11; i++) password[i] = 0; char read[10]; UINT pass_length; f_read(&f, read, 10, &pass_length); f_close(&f); //convert char like 'A' or 'B' into u32 like 0001 or 0010... char ch[] = "ABETrludRLXY"; for (int i=0; i<pass_length; i++) { char cur = read[i]; int index = -1; for (int j=0; j<12; j++) if (cur == ch[j]) index = j; if (index != -1) password[i] = 1<<index; } int n = 0; int miss = 0; u32 pad = 0; u32 oldPad; while (password[n] != 0) { oldPad = pad; while (pad == 0 || pad == oldPad) pad = InputWait() & 0x0FFF; if (password[n] == pad) { n++; } else { miss++; n = 0; } } } if (tryLoadFile(base)) { jumpAndTryEnableBL(back); } else if (tryLoadFile("/arm9loaderhay/default.bin")) { if(*(vu8*)CFG_BOOTENV == COLDBOOT) { jumpAndTryEnableBL("/arm9loaderhay/default_bl"); } else { //dont enable backlight again on soft reset jump(); } } } i2cWriteRegister(I2C_DEV_MCU, 0x20, (u8)(1<<0)); return 0; }
I didn't test everything though, so I am not saying it works perfectly, and I warned you, so I can't be held responsible if your 3DS bricks from using this program (even though it shouldn't happen). For example, I can't test all existing passwords and all key combinations.
(And if you don't trust me because I never released anything, you can read this. Of course, it doesn't prove my program works (and maybe it doesn't, that's the first thing I compile for a 3DS) but at least I'm not a crook doing stuff that doesn't work on purpose).