Homebrew arm9loaderhay - my own take on a A9LH file select

Hayleia

Well-Known Member
OP
Member
Joined
Feb 26, 2015
Messages
1,485
Trophies
0
XP
1,294
Country
France
But what does this?
This is a payload manager such as the more convenient arm9select, CtrBootManager and friends.
But this one here is made less convenient on purpose so that the user can still launch what they want, but random people can't.

Down side to this? I would have to write down what each button does.
True this. But you can put comment files in your folders. Or read what I say below :P

Could it just be a N3DS problem? I'll keep testing this out.
I just tried the 2016/04/02 build on my N3DS XL and I still can launch it. Well, it says "KeyY not found" and "KeyX not found" then "Initialization failed" but that's my fault, at least the program seems to run fine.

Also maybe someday instead of binary folders, you could actually use the same password combinations as folder combinations! So like you could use "YBLd" folder to hold The y, b, X, and down button :)
Not so sure. Because YBLd could also be described with LdBY and whatever other permutation you can think about. So there isn't any convenient way to check this. Because right now, all I do is check the current pad state, translate that into a unique folder name then check if that folder exists. But yeah, just think about it, if you have a YBLd and a LdBY folder in your SD card then (that's stupid but) what is arm9loaderhay supposed to do ? And even if you don't have a weird configuration, it will need the program to run the other way round, check all folders, translate their names into pad states and check if the pad states corresponds, which is probably doable but a lot more annoying to do.

At worst, if readability is the main issue here, I guess I can do something weirder but probably already better like writing "______________BA" instead of "0000000000000011" ? That would be doable. Still needs the user to check the doc to create folders, but once they are created, their names make sense to both them and the program ?
 
  • Like
Reactions: Deleted User
D

Deleted User

Guest
This is a payload manager such as the more convenient arm9select, CtrBootManager and friends.
But this one here is made less convenient on purpose so that the user can still launch what they want, but random people can't.


True this. But you can put comment files in your folders. Or read what I say below :P


I just tried the 2016/04/02 build on my N3DS XL and I still can launch it. Well, it says "KeyY not found" and "KeyX not found" then "Initialization failed" but that's my fault, at least the program seems to run fine.


Not so sure. Because YBLd could also be described with LdBY and whatever other permutation you can think about. So there isn't any convenient way to check this. Because right now, all I do is check the current pad state, translate that into a unique folder name then check if that folder exists. But yeah, just think about it, if you have a YBLd and a LdBY folder in your SD card then (that's stupid but) what is arm9loaderhay supposed to do ? And even if you don't have a weird configuration, it will need the program to run the other way round, check all folders, translate their names into pad states and check if the pad states corresponds, which is probably doable but a lot more annoying to do.

At worst, if readability is the main issue here, I guess I can do something weirder but probably already better like writing "______________BA" instead of "0000000000000011" ? That would be doable. Still needs the user to check the doc to create folders, but once they are created, their names make sense to both them and the program ?
Maybe you could set parameters so that the letters HAVE to be in order and it'll just read the letters there on the folder. I'm not a great coder so I don't know if this would work.
 

Hayleia

Well-Known Member
OP
Member
Joined
Feb 26, 2015
Messages
1,485
Trophies
0
XP
1,294
Country
France
Maybe you could set parameters so that the letters HAVE to be in order and it'll just read the letters there on the folder. I'm not a great coder so I don't know if this would work.
Yeah, if the order is fixed, it solves the "unique name" problem. But then, it's also not so much more harder to read and write "______________BA" than "BA" :P
And it's not so much harder to code either you'd say, well yes and no. Because the "______________BA" solution only requires something like two lines changed in the code to work (where I say "put zeroes" I say "put underscores" and where I say "put ones" I say "put that letter here from the string I already have for the password").

The "BA" one needs to rewrite most of the name deduction in order to support names with a variable length for example. Which once again isn't hard, but... is it worth it ? I mean, if the user has to read the documentation to know the key order, then adding the underscores to the rules to follow isn't much in my opinion, and it keeps the code much simpler. Also, is it worth making it just a bit simpler to use if we are only two people to use this ? :P
 
  • Like
Reactions: Deleted User
D

Deleted User

Guest
instead of underscores, could you use these? "----" so we could count them easily?
Also, I made a template:

4 zeros Y X L R Down Up Left Right Start Select A B
0 0 0 0
 
D

Deleted User

Guest
Yes I can. Basically any character that can be put in a folder name.
Btw, I got Decrypt9 to work again, I just had a weird setup mixed with Aurora Wright's newestly compiled A9LH and AuReiNand's Bootloader. I just reinstalled FIX94's A9LH and got rid of the setup
 
  • Like
Reactions: Hayleia

Hayleia

Well-Known Member
OP
Member
Joined
Feb 26, 2015
Messages
1,485
Trophies
0
XP
1,294
Country
France
this is splendid for people like ,families , a guy having a lil sis/bro or basically for a parent having kids.
after all this is like booting it up but you needing to enter a password nay ?
Depends. If you specify a password then yes.
Also, I never tried that with the default.bin. I guess it should work with a "0000000000000000" folder and no default.bin but I never tried it... I was thinking that usually, the default boot is pretty safe and people want to add safety for more sensible payloads like ones that can erase your NAND and stuff.

And here is a test build. Instead of zeroes and ones, take this base name "----YXLRdulrTEBA" and replace whatever you want with "-" to have a valid name describing a key combination for your folder.
Tested on my N3DS XL with --------------BA and ----YX----------, worked.
 

Attachments

  • arm9loaderhax.zip
    6.6 KB · Views: 86
  • Like
Reactions: leonmagnus99
D

Deleted User

Guest
Depends. If you specify a password then yes.
Also, I never tried that with the default.bin. I guess it should work with a "0000000000000000" folder and no default.bin but I never tried it... I was thinking that usually, the default boot is pretty safe and people want to add safety for more sensible payloads like ones that can erase your NAND and stuff.

And here is a test build. Instead of zeroes and ones, take this base name "----YXLRdulrTEBA" and replace whatever you want with "-" to have a valid name describing a key combination for your folder.
Tested on my N3DS XL with --------------BA and ----YX----------, worked.
Love it! A little more Noob-Friendly now!
 

Hayleia

Well-Known Member
OP
Member
Joined
Feb 26, 2015
Messages
1,485
Trophies
0
XP
1,294
Country
France
Love it! A little more Noob-Friendly now!
Ok, but did it work for you ? :P

Also, should I get rid of the first four characters ? I mean, they are not used (the code just really can't put them at something else than "-"), and if they were, I guess from this that they would probably describe only ZL and ZR, but are people really going to use these in their combinations and passwords ? Well, Old 3DS users can already say "no", but even New 3DS users, are they going to use ZL and ZR ?
 
D

Deleted User

Guest
Ok, but did it work for you ? :P

Also, should I get rid of the first four characters ? I mean, they are not used (the code just really can't put them at something else than "-"), and if they were, I guess from this that they would probably describe only ZL and ZR, but are people really going to use these in their combinations and passwords ? Well, Old 3DS users can already say "no", but even New 3DS users, are they going to use ZL and ZR ?
Some might in the future. Adding ZL and ZR would make it more complete but if you don't want to add it then just get rid of it. Your call :P

--------------------- MERGED ---------------------------

Some might in the future. Adding ZL and ZR would make it more complete but if you don't want to add it then just get rid of it. Your call :P
Why are there 4 ---- btw? ZL and ZR are only 2 buttons extra
 

Hayleia

Well-Known Member
OP
Member
Joined
Feb 26, 2015
Messages
1,485
Trophies
0
XP
1,294
Country
France
Why are there 4 ---- btw? ZL and ZR are only 2 buttons extra
No idea. From hid.h in ctrulib, bits from 0 to 11 are the ones I use, bits 14 and 15 are ZL and ZR, then 12 and 13 are... useless ?? So this makes the "vector" 16 bits even though two bits are not used.
Then yeah, as usual, same as for removing "-", it is obviously possible to only use the 14 bits I want instead of 12 or 16 with two useless ones, but it adds code for no reason. I might end up doing it anyway since ZL and ZR can be funny to use (make a password using 4 keys that no one sees you press when you type it :P) but thos two bits are bothering me.

The only problem I see is... what on earth do I use to describe ZL and ZR ? "L" and "R" are already taken for L and R, "l" and "r" are already taken for Left and Right, so what can be logical for ZL and ZR ??
 
D

Deleted User

Guest
No idea. From hid.h in ctrulib, bits from 0 to 11 are the ones I use, bits 14 and 15 are ZL and ZR, then 12 and 13 are... useless ?? So this makes the "vector" 16 bits even though two bits are not used.
Then yeah, as usual, same as for removing "-", it is obviously possible to only use the 14 bits I want instead of 12 or 16 with two useless ones, but it adds code for no reason. I might end up doing it anyway since ZL and ZR can be funny to use (make a password using 4 keys that no one sees you press when you type it :P) but thos two bits are bothering me.

The only problem I see is... what on earth do I use to describe ZL and ZR ? "L" and "R" are already taken for L and R, "l" and "r" are already taken for Left and Right, so what can be logical for ZL and ZR ??
x and y :P
 
  • Like
Reactions: Hayleia

Hayleia

Well-Known Member
OP
Member
Joined
Feb 26, 2015
Messages
1,485
Trophies
0
XP
1,294
Country
France
I guess you could just get rid of it
Well, now that I think of it, if I the program takes at least bits 14 and 15 into account, they'll be at 1 for no reason all the time on Old 3DS (problem mentionned on the original first post and that post quoting the orignal first post too). So I'd need a way to make the difference between an O3DS and a N3DS or force O3DS users to specify both Z shoulders in every folder even though they don't (and can't) use them -.-

Too bad, selecting payloads and typing a password using only shoulders would have been awesome.
 
Last edited by Hayleia,
  • Like
Reactions: Deleted User
D

Deleted User

Guest
Well, now that I think of it, if I the program takes at least bits 14 and 15 into account, they'll be at 1 for no reason all the time on Old 3DS (problem mentionned on the original first post and that post quoting the orignal first post too). So I'd need a way to make the difference between an O3DS and a N3DS or force O3DS users to specify both Z shoulders in every folder even though they don't (and can't) use them -.-

Too bad, selecting payloads and typing a password using only shoulders would have been awesome.
That would be, that's ok though :)
 

Hayleia

Well-Known Member
OP
Member
Joined
Feb 26, 2015
Messages
1,485
Trophies
0
XP
1,294
Country
France
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:
  • 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
So for example, if your password is A,B,X,Y, just write "ABXY" in your password file.
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).
 
  • Like
Reactions: Deleted User

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
  • realtimesave @ realtimesave:
    I tried to get a slim on a black friday once, but they ran out of stock for the $100 one
  • realtimesave @ realtimesave:
    many ages ago
  • BigOnYa @ BigOnYa:
    You can find them $50-75 nowdays if catch a deal
  • K3Nv2 @ K3Nv2:
    Still remember grabbing this ps4 slim on black Friday for $200 when the msrp was still around 300
    +1
  • BigOnYa @ BigOnYa:
    I went to auction at a mom/pops video game store few months ago that was closing, and bought 11 slims for $200, 1 was DOA but 10 work fine. so hella deal. Already rgh3'ed 8 of them. But most younger kids don't even want anymore, unless it plays stupid "fortnight", or newer shit.
  • K3Nv2 @ K3Nv2:
    Think I'm gonna use my giftcard balance on a nice pair of headphones but $100 is still limited
  • K3Nv2 @ K3Nv2:
    Soundcore q30s are nice but they leak so much sound it sounds like speakers
  • Psionic Roshambo @ Psionic Roshambo:
    Ken spend the 100 on a gun and skii mask, wait for a jogger at the park jewelry money and headphones!
    +1
  • K3Nv2 @ K3Nv2:
    If only Amazon sold guns
  • K3Nv2 @ K3Nv2:
    Fucking dick heads think it's a bad idea to get a gun 2 days later
  • BigOnYa @ BigOnYa:
    Wait, I thought you were the dickhe...nvm
  • K3Nv2 @ K3Nv2:
    I got balls on my chin and two dicks on my forehead sir
    +1
  • BigOnYa @ BigOnYa:
    Sorry, no offense there double dickhead chinballs.
  • K3Nv2 @ K3Nv2:
    Chicks still love it
    +1
  • BigOnYa @ BigOnYa:
    "Mommy, look, what is that?". "That's your soon to be daddy."
    +1
  • K3Nv2 @ K3Nv2:
    That you'll only see once
    +2
  • Veho @ Veho:
    Double dickhead chinballs is still better than double dickhead eyeballs.
  • Veho @ Veho:
    As in, the balls will grow in your eye sockets.
  • K3Nv2 @ K3Nv2:
    I paid 5 grand to get them moved to my chin
    +1
  • Veho @ Veho:
    This you?
  • K3Nv2 @ K3Nv2:
    My hair can't be that cool
    Sonic Angel Knight @ Sonic Angel Knight: JOE! :P