Homebrew ARM9Loader -- Technical Details and Discussion

dark_samus3

Well-Known Member
Member
Joined
May 30, 2015
Messages
2,372
Trophies
0
XP
2,142
Country
United States
Oh... well, if it's taken care of by a9lh already, I'm not sure what the point is then. But I had already posted a vid in case someone wanted to argue about the splash. May as well post it, I guess :P


The point of getting screen init into stage 2 was so that ReiNAND could display a splash image, without having the screen init code (or, you know, any payload could use the screen)
 

BreakneckWalrus

Member
Newcomer
Joined
Jun 20, 2011
Messages
17
Trophies
1
XP
125
Country
United States
Mildly confused here. I have A9LH and AuReiNand installed on my N3DS. I'm using the 10.4 FIRM that was linked here https://gbatemp.net/threads/aureinand-n3ds-o3ds-a9lh.411110/. How can I:

  1. Boot into Decrypt9? I have the A9LH version of Decrypt9 that comes with an arm9loaderhax.bin and a D9A9 folder. What do I do with these?
  2. Boot into sysNAND? Someone said I just needed to hold R, and that seemed to work, but then I wasn't able to run D9 after getting to Homebrew again.
 

treebeard

Active Member
Newcomer
Joined
Jan 6, 2016
Messages
32
Trophies
0
Age
33
Location
Lost
XP
58
Country
United States
Is it possible to add xorpad generation and such features to the a9lh Decrypt9 version? or is this out of the question?
 

Bu2d85

Well-Known Member
Member
Joined
Nov 6, 2014
Messages
1,042
Trophies
0
Age
39
XP
1,300
Country
United States
Mildly confused here. I have A9LH and AuReiNand installed on my N3DS. I'm using the 10.4 FIRM that was linked here https://gbatemp.net/threads/aureinand-n3ds-o3ds-a9lh.411110/. How can I:

  1. Boot into Decrypt9? I have the A9LH version of Decrypt9 that comes with an arm9loaderhax.bin and a D9A9 folder. What do I do with these?
  2. Boot into sysNAND? Someone said I just needed to hold R, and that seemed to work, but then I wasn't able to run D9 after getting to Homebrew again.
Regular Decrypt9 will not work if your sysnand is over 9.2. You could try holding L to boot with the 9.0 firm.

If you want to boot the A9LH version of Decrypt9 you will have to replace AuReiNands arm9loaderhax.bin with the one for Decrypt9 or use ctrbootloader9.

The D9A9 folder goes to the root of your SD card.
 
Last edited by Bu2d85,

FenrirWolf

Well-Known Member
Member
Joined
Nov 19, 2008
Messages
4,347
Trophies
1
Location
Sandy, UT
XP
615
Country
United States
Mildly confused here. I have A9LH and AuReiNand installed on my N3DS. I'm using the 10.4 FIRM that was linked here https://gbatemp.net/threads/aureinand-n3ds-o3ds-a9lh.411110/. How can I:

  1. Boot into Decrypt9? I have the A9LH version of Decrypt9 that comes with an arm9loaderhax.bin and a D9A9 folder. What do I do with these?
  2. Boot into sysNAND? Someone said I just needed to hold R, and that seemed to work, but then I wasn't able to run D9 after getting to Homebrew again.
Hold L instead of R
 

Selver

13,5,1,14,9,14,7,12,5,19,19
OP
Member
Joined
Dec 22, 2015
Messages
219
Trophies
0
XP
426
Country
...Continued from Summary of differences from prior *hax (1/2)...

Note: This is a GREATLY simplified view...
  1. Bootrom initializes various keys
  2. Bootrom loads FIRM0 into memory
  3. Bootrom validates FIRM0 crypto signatures
  4. Bootrom branches to loaded FIRM0
  5. FIRM0 is actually a loader for Kernel9 (the ARM9 thread)...
  6. Arm9Loader uses OTP hash plus sector 0x96 contents for further decryption of Kernel9
  7. Arm9Loader branches to properly decrypted Kernel9
  8. System loads lots of stuff
  9. Eventually loads menus / themes / etc. (one hax entry point)
  10. Cartridge launch ... lots of stuff
  11. Cartridge runs game (another hax entry point)
  1. Bootrom initializes various keys
  2. Bootrom loads FIRM0 into memory
  3. Bootrom FAILS to validate FIRM0 crypto signatures
  4. Bootrom loads FIRM1 into memory
  5. Bootrom validates FIRM1 crypto signatures
  6. Bootrom branches to loaded FIRM1
  7. FIRM1 is actually a loader for Kernel9 (the ARM9 thread)...
  8. Arm9Loader uses OTP hash plus sector 0x96 contents for further decryption of Kernel9
    !BUT! because sector 0x96 was modified, the decrypted Kernel9 is corrupt.
  9. The first (few) corrupt instruction(s) of Kernel9 branch into memory that was set from FIRM0, and never overwritten when loading FIRM1
Firm0 (attacker generated code) is loaded into memory:
000000000000000000000000000000xxxxxxxxxxxxxxxxx

Signature mismatch, so firm1 is loaded into memory, but is smaller size so only partially overwrites firm0:
111111111111111111111111110000xxxxxxxxxxxxxxxxx
/ sizeof(firm1) \_______^^^^
\ -sizeof(firm0) /


Corrupt Sector 150 (0x96) causes Kernel9 (after decryption by FIRM1's arm9loader) to branch to the leftover loaded FIRM0 data:
111111111111111111111111110000xxxxxxxxxxxxxxxxx
Branches to here...........^
The description at the top of this thread was based on the premise of overwriting all memory with NOP sleds / BRANCH instructions to the payload.

However, the actual Arm9LoaderHax needed to find a way to change Sector 150 such that the corrupt instructions would decode in a way that branch'd into that tiny region where FIRM0 was loaded, and where FIRM1 would not overwrite that data when it was loaded.

This is a much, much smaller target. How many different iterations needed to be tried to find just the right BRANCH instruction? Almost 4 million iterations -- hint: 0x3BF5F6.

But, once the right key was found to get this "just right" branch, it can be used on any 3DS out there, so long as the OTP_HASH could be found for that 3DS.
 
Last edited by Selver,

TaintedByte

Active Member
Newcomer
Joined
Jan 27, 2016
Messages
31
Trophies
0
XP
130
Country
United States
So I don't know if to make a new thread about this but since everyone seems to be discussing A9LH here and this is a (potential) bug, I figure this would be a great place to see if anyone else is having this issue.

It seems that A9LH breaks injected GBA saves if launched through emuNAND. The game will say it saves with no issues but upon relaunching it, there will show no saves at all. The FIRMs are patched, it's not the CIA or CFW because this same issue does not happen on my gf's non-A9LH console.

After doing some digging I found this Reddit post recently that seems to confirm my findings: https://www.reddit.com/r/3dshacks/comments/48q6d4/custom_made_gba_cias_dont_save_in_emunand/

Just wanted to know if anyone else is experiencing this (that is actually running A9LH with emuNAND, because it works just fine with A9LH sysNAND per the Reddit thread) and if there's an easy fix. I know it's not top priority or anything but was curious.
 

key1340

Well-Known Member
Member
Joined
Jul 6, 2015
Messages
193
Trophies
0
Age
33
XP
222
Country
United States
So I don't know if to make a new thread about this but since everyone seems to be discussing A9LH here and this is a (potential) bug, I figure this would be a great place to see if anyone else is having this issue.

It seems that A9LH breaks injected GBA saves if launched through emuNAND. The game will say it saves with no issues but upon relaunching it, there will show no saves at all. The FIRMs are patched, it's not the CIA or CFW because this same issue does not happen on my gf's non-A9LH console.

After doing some digging I found this Reddit post recently that seems to confirm my findings: https://www.reddit.com/r/3dshacks/comments/48q6d4/custom_made_gba_cias_dont_save_in_emunand/

Just wanted to know if anyone else is experiencing this (that is actually running A9LH with emuNAND, because it works just fine with A9LH sysNAND per the Reddit thread) and if there's an easy fix. I know it's not top priority or anything but was curious.

You need to return to sysNAND after you have finished playing a GBA game for it to finish saving the game.
 

Selver

13,5,1,14,9,14,7,12,5,19,19
OP
Member
Joined
Dec 22, 2015
Messages
219
Trophies
0
XP
426
Country
...Continued from Summary of differences from prior *hax (2/3)...

In conclusion, the main differences for Arm9LoaderHax include:
  • 100% boot rate (vs. semi-random failures)
  • Ability to run homebrew kernels (full-hardware access software)
  • Ability to run homebrew
    (Unfortunately, guaranteeing homebrew can be run also enables less ethical uses)
  • No known way to prevent the continued use of A9LHax (can't fix with firmware/software updates)

Who would've thought that the ability to jump to console-unique, non-predictably corrupt code would be such a huge entry point? I certainly learned a lot while trying to understand the scope and severity of this issue.
 
Last edited by Selver,

TaintedByte

Active Member
Newcomer
Joined
Jan 27, 2016
Messages
31
Trophies
0
XP
130
Country
United States
You need to return to sysNAND after you have finished playing a GBA game for it to finish saving the game.
Ah that makes sense. Sorry, I haven't used GBA injections before A9LH. Thinking about it though, the reason why this didn't crop up before was because with non-A9LH you're returning to sysNAND, however briefly, so it has time to write the save.

I just tried again booting the injected CIA through emuNAND, saving, and returning to sysNAND after shutting down and it works! I guess a quick little reboot after returning to sysNAND isn't too bad, especially with how fast we boot now.

Thanks for the answer.
 

GBHAKC75

Well-Known Member
Member
Joined
Jan 26, 2008
Messages
406
Trophies
0
XP
563
Country
France
Is it possible to add xorpad generation and such features to the a9lh Decrypt9 version? or is this out of the question?

No. XORPad generation needs FIRM init, which happens AFTER A9LH, so it's not possible for now. Maybe we'll find a workaround, but currently that's not possible.
 

NekoMichi

Retro Collector
Member
Joined
Jun 4, 2015
Messages
1,441
Trophies
1
Location
Minus World
Website
www.youtube.com
XP
2,982
Country
I've seen a few posts about 128GB SD cards taking longer to boot A9LH, is this a regular occurrence, or isolated incidences?

I'm currently using a SanDisk Ultra 32GB micro SD on N3DS with A9LH and it boots in 9 seconds. The plan is to upgrade to a 128GB SanDisk micro SD, would it impact performance significantly?
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • BakerMan @ BakerMan:
    sorry, idk what you mean by a space cake, and even if i did, i'm not really taking requests right now, because otherwise people will get mad at me for taking a request but not making a birthday cake for @Xdqwerty (i'm sorry for that btw bro)
  • ZeroT21 @ ZeroT21:
    @BakerMan lies, you just want to smoke it

    :rofl2:
    +1
  • ZeroT21 @ ZeroT21:
    Guess all the food in my fridge can knock out a cow or two
  • ZeroT21 @ ZeroT21:
    I should visit Florida again, miss the alligator barbecues
  • BigOnYa @ BigOnYa:
    Me and wifey was deciding on our next vacation, so I hung up a map on the wall, and give her a dart and said, wherever you hit, we will go. She threw the dart and it missed the map completely and fell into a trash can below on floor. So I said "ok Florida it is."
    +2
  • BakerMan @ BakerMan:
    @ZeroT21 ohhh a pot cake?
    +2
  • SylverReZ @ SylverReZ:
    Gimme some of dat
    +4
  • BakerMan @ BakerMan:
    oh yeah i don't use weed,in my baking or in general
  • BakerMan @ BakerMan:
    besides isn't it usually gummies or brownies?
  • AncientBoi @ AncientBoi:
    So, make a "New Trend"
  • BakerMan @ BakerMan:
    i just said i don't use weed
  • BigOnYa @ BigOnYa:
    You can add it in anything really, you can even make a butter/oil with it, then use that oil in anything
  • BakerMan @ BakerMan:
    besides i'm literally a minor and neurodivergent, so telling me to make a cake with cannabis is traumatizing me, ur cancelled buddy /s/srs
  • BakerMan @ BakerMan:
    (nah jk i'm just parodying those "i'm literally a minor and neurodivergent" mfs on twitter)
    +1
  • BigOnYa @ BigOnYa:
    Michigan has legal rec, so you only have few more years, is it 18 or 21 up there? 21 here in Ohio.
  • BakerMan @ BakerMan:
    prob 21, idk tho
    +1
  • ZeroT21 @ ZeroT21:
    Guess I'll go with plan B and make a Rum Vanilla flavored ice cream
    +1
  • BigOnYa @ BigOnYa:
    That sounds damn good.
  • AncientBoi @ AncientBoi:
    Nah. Tequila maybe
  • AncientBoi @ AncientBoi:
    That, or Old No. 7
  • BigOnYa @ BigOnYa:
    I'm ashamed to ask, but what is old no 7?
  • AncientBoi @ AncientBoi:
    Jack Daniels
    +2
  • BigOnYa @ BigOnYa:
    Oh yea, duh
    +1
  • BigOnYa @ BigOnYa:
    I still have some old no 7, bout to mix with some coke, and get "California Sober".
    +2
  • AncientBoi @ AncientBoi:
    lol, I finally got you to Enjoy a Coc Tail :tpi::rofl2::tpi:
    +2
    AncientBoi @ AncientBoi: lol, I finally got you to Enjoy a Coc Tail :tpi::rofl2::tpi: +2