Hacking [Source Code] ReiNAND with Brahma2Loader (Ninjhax 2.x support) (FW <= 9.2)

d0k3

3DS Homebrew Legend
OP
Member
Joined
Dec 3, 2004
Messages
2,786
Trophies
1
XP
3,896
Country
Germany
I coupled ReiNAND by @Reisyukaku with my own Brahma2Loader. As a result I can now boot to ReiNAND from Ninjhax 2.1 (or earlier).

Get the source code from here:
https://github.com/d0k3/ReiNand

Note that this (Ninjhax 2.x support for ReiNAND) has been done before. I am biased, of course, and this is in no way based on any scientific research, but I do think that Brahma2Loader gives a better success rate than CakeBrah at the moment. In fact, I had no failed boots so far.

Anyways, the usual yada yada...
  • I won't provide binaries (no, not even in a pastebin). Don't even bother pestering me about that in a PM.
  • I won't provide the firmware.bin file required for compiling either. It is the same that is included in ReiNAND releases, though, so hunt it down.
  • No, this won't work on any FW above 9.2.
  • In short: You've got the source, but now you're on your own.
I will shoot @Reisyukaku a pull request once this has been tested by enough people, and he can decide wether to include it or not then. By the way... a Youtube video showing this in action would be nice. If anyone wants to do it, just post it here in the thread.


UPDATE 1: Check this post if you want to build your own Brahma2Loader for rxTools/ReiNAND/CakesFW. I promise, it's easy, no programming skills required.

UPDATE 2: Yeah, I understand. You hate compiling, and you still want to try this. For your convenience, I decided to attach the Brahma2Loader files (the .3DSX / .SMDH files only!) to this post. Understand that these will not work on their own. You need to hunt down the other ReiNAND (version >= 2.1) files yourselves.

UPDATE 3: Check this thread for instructions on an even more DIY approach to run ReiNAND. This will also enable you to run ReiNAND on boot, while keeping the possibility to run HB launcher.
 

Attachments

  • Brahma2Loader_ReiNand.zip
    105.6 KB · Views: 1,083
Last edited by d0k3,

-Xin-

Well-Known Member
Newcomer
Joined
Jul 26, 2015
Messages
72
Trophies
0
XP
118
Country
Morocco
-.-
this evil error ............
/BrahmaLoader-loader2/source/libkhax/khaxinit.cpp:795:29: error: 'svcBackdoor' was not declared in this scope
svcBackdoor(Step7a_PatchPID);
^
make[1]: *** [khaxinit.o] Error 1
make: *** [build] Error 2
 
Last edited by -Xin-,

-Xin-

Well-Known Member
Newcomer
Joined
Jul 26, 2015
Messages
72
Trophies
0
XP
118
Country
Morocco
er, euh, But can we ask 1 for CakeCFW and rxTools :unsure: ? (Source to compile ourself ;) )
I don't use ReiNAND and i know nothing about modifying/programming, but i do know how to compile working sourcecode :D
do you compile on linux or windows ?
 

d0k3

3DS Homebrew Legend
OP
Member
Joined
Dec 3, 2004
Messages
2,786
Trophies
1
XP
3,896
Country
Germany
-.-
this evil error ............
/BrahmaLoader-loader2/source/libkhax/khaxinit.cpp:795:29: error: 'svcBackdoor' was not declared in this scope
svcBackdoor(Step7a_PatchPID);
^
make[1]: *** [khaxinit.o] Error 1
make: *** [build] Error 2
Either use git/github to clone the source or do it manually. That means downloading the most recent libkhax same as you downloaded BrahmaLoader and memset. Make sure you get the newest versions and use the loader2 branch for BrahmaLoader.
er, euh, But can we ask 1 for CakeCFW and rxTools :unsure: ? (Source to compile ourself ;) )
I don't use ReiNAND and i know nothing about modifying/programming, but i do know how to compile working sourcecode :D
You can try it yourself, there is some work involved. Basically you replace the existing Brahma code in these two with the Brahma2Loader source code. I might do it myself later, but not anytime soon.

EDIT: If all you want to do is be able to boot into these two quickly, have a look here. (link fixed)
 
Last edited by d0k3,

-Xin-

Well-Known Member
Newcomer
Joined
Jul 26, 2015
Messages
72
Trophies
0
XP
118
Country
Morocco
Either use git/github to clone to source or do it manually. That means downloading the most recent libkhax same as you downloaded BrahmaLoader and memset. Make sure you get the newest versions and use the loader2 branch for BrahmaLoader.
well it's the newer one but i think i will use git/github to clone to source it sound more easy
 

d0k3

3DS Homebrew Legend
OP
Member
Joined
Dec 3, 2004
Messages
2,786
Trophies
1
XP
3,896
Country
Germany
Maybe another hint for those struggling with compiling it without git / github...

You can also just download the Brahma2Loader source code. Replace the resources dir there with the resources dir from my ReiNAND release & don't forget to also download the latest libkhax source & extract it into source/libkhax. Then compile it and you get the Ninjhax binaries. No need to compile the other files (ReiNand.dat et al) anew, cause the only relevant changes are in the .3DSX.

Good luck!
 

DjoeN

Captain Haddock!
Member
Joined
Oct 21, 2005
Messages
5,489
Trophies
0
Age
54
Location
Somewhere in this potatoland!
Website
djoen.dommel.be
XP
2,857
Country
Belgium
do you compile on linux or windows ?
Windows
Like @d0k3 says, gitclone libkhax and BrahamaLoader to your pc and manually move them (overwrite older) to your gitcloned reinand fork of him in the correct folders
after that it compiles fine.

Also be sure to have the correct firmware.bin in your \ReiNand\data folder
 
  • Like
Reactions: d0k3

DjoeN

Captain Haddock!
Member
Joined
Oct 21, 2005
Messages
5,489
Trophies
0
Age
54
Location
Somewhere in this potatoland!
Website
djoen.dommel.be
XP
2,857
Country
Belgium
Yes, since i don't know anything about programming, so i can't couple rxTools with Brahma2Loader
it would be nice for someone to do it for us (me) ;)

also can't test this, since to my understanding latest ReiNAND only supports N3DS? (or am i misinformed on that one) and i don't have an exploitable N3DS
 

d0k3

3DS Homebrew Legend
OP
Member
Joined
Dec 3, 2004
Messages
2,786
Trophies
1
XP
3,896
Country
Germany
Yes, since i don't know anything about programming, so i can't couple rxTools with Brahma2Loader
it would be nice for someone to do it for us (me) ;)

also can't test this, since to my understanding latest ReiNAND only supports N3DS? (or am i misinformed on that one) and i don't have an exploitable N3DS
Alright, I'll help you (because I'm a nice person ;)).

Download Brahma2Loader source code, also don't forget about libkhax. In Brahma2Loaders resource dir, you'll find a file called "AppInfo". Contents:
Code:
#---------------------------------------------------------------------------------
# APP_TITLE: Name of the homebrew app, also name of folder and .3DSX/.SMDH
# APP_DESCRIPTION: Description of the homebrew app in HB launcher
# APP_AUTHOR: Author of the homebrew app, also display in HB launcher
#
# PAYLOAD_PATH: Path to the ARM9 payload on the 3DS SD card (don't forget "//")
# PAYLOAD_OFFSET: Offset of the ARM9 payload in the file given above
#
# If PAYLOAD_PATH is not given, payload is loaded from memory (data dir in source)
# PAYLOAD_OFFSET is optional if offset is 0x00000000
#---------------------------------------------------------------------------------

APP_TITLE = BrahmaLoader
APP_DESCRIPTION = Brahma based loader.
APP_AUTHOR = patois, delebile & d0k3

# PAYLOAD_PATH = /payload.bin
# PAYLOAD_OFFSET = 0x00000000

replace:
# PAYLOAD_OFFSET = 0x00000000
with
PAYLOAD_OFFSET = 0x12000

and:
# PAYLOAD_PATH = /payload.bin
with (for ReiNAND):
PAYLOAD_PATH = //ReiNand.dat
with (for CakesFW):
PAYLOAD_PATH = //Cakes.dat
with (for rxTools):
PAYLOAD_PATH = //rxTools/sys/code.bin

Set APP_TITLE, APP_DESCRIPTION and APP_AUTHOR as you wish (but credit the original authors). Also replace the icon as you wish. Compile and you get a fully functional Ninjhax loader. And yes, you can post this here (binaries and source code) cause there is nothing critical in there. All free code :).


Note (to be sure): Only the (modified) Brahma Loader (and the compiled 3DSX/SMDH) can be posted here, not the actual ReiNAND CFW. If you post anything, credit the original authors!

EDIT: I figured I'd just attach a functional copy of the Brahma2Loader source code. Can be compiled right away, but you may wish to modify it as described above. Have fun!
 

Attachments

  • Brahma2Loader.zip
    66.5 KB · Views: 340
Last edited by d0k3,

Asia81

Yuri Lover ~
Member
Joined
Nov 15, 2014
Messages
6,656
Trophies
3
Age
29
XP
3,488
Country
France
Alright, I'll help you (because I'm a nice person ;)).

Download Brahma2Loader source code, also don't forget about libkhax. In Brahma2Loaders resource dir, you'll find a file called "AppInfo". Contents:
Code:
#---------------------------------------------------------------------------------
# APP_TITLE: Name of the homebrew app, also name of folder and .3DSX/.SMDH
# APP_DESCRIPTION: Description of the homebrew app in HB launcher
# APP_AUTHOR: Author of the homebrew app, also display in HB launcher
#
# PAYLOAD_PATH: Path to the ARM9 payload on the 3DS SD card (don't forget "//")
# PAYLOAD_OFFSET: Offset of the ARM9 payload in the file given above
#
# If PAYLOAD_PATH is not given, payload is loaded from memory (data dir in source)
# PAYLOAD_OFFSET is optional if offset is 0x00000000
#---------------------------------------------------------------------------------

APP_TITLE = BrahmaLoader
APP_DESCRIPTION = Brahma based loader.
APP_AUTHOR = patois, delebile & d0k3

# PAYLOAD_PATH = /payload.bin
# PAYLOAD_OFFSET = 0x00000000

replace:
# PAYLOAD_OFFSET = 0x00000000
with
PAYLOAD_OFFSET = 0x12000

and:
# PAYLOAD_PATH = /payload.bin
with (for ReiNAND):
PAYLOAD_PATH = //ReiNand.dat
with (for CakesFW):
PAYLOAD_PATH = //Cakes.dat
with (for rxTools):
PAYLOAD_PATH = //rxTools/sys/code.bin

Set APP_TITLE, APP_DESCRIPTION and APP_AUTHOR as you wish (but credit the original authors). Also replace the icon as you wish. Compile and you get a fully functional Ninjhax loader. And yes, you can post this here (binaries and source code) cause there is nothin critical in there. All free code :).

Note to be sure: Only the (modified) Brahma Loader (and the compiled 3DSX/SMDH) can be posted here, not the actual ReiNAND CFW.

It's for compil rxtool with brama2?
 

Orkna

Well-Known Member
Member
Joined
Feb 7, 2014
Messages
379
Trophies
0
Location
Sviiiiiden
XP
277
Country
Hm, i see reiNAND and ReiNAND in the sources. Getting some errors because of this. Linux does not like that. ;)

Checking out:
Code:
git clone --recursive https://github.com/d0k3/ReiNand
Cloning into 'ReiNand'...
remote: Counting objects: 284, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 284 (delta 1), reused 0 (delta 0), pack-reused 274
Receiving objects: 100% (284/284), 3.38 MiB | 708.00 KiB/s, done.
Resolving deltas: 100% (103/103), done.
Checking connectivity... done.
Submodule 'BrahmaLoader' (https://github.com/d0k3/BrahmaLoader) registered for path 'BrahmaLoader'
Submodule 'mset' (https://github.com/Reisyukaku/mset) registered for path 'mset'
Cloning into 'BrahmaLoader'...
remote: Counting objects: 371, done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 371 (delta 3), reused 0 (delta 0), pack-reused 354
Receiving objects: 100% (371/371), 398.44 KiB | 330.00 KiB/s, done.
Resolving deltas: 100% (196/196), done.
Checking connectivity... done.
fatal: reference is not a tree: e91330fab181cc15d595065229fd907229aa5796
Cloning into 'mset'...
remote: Counting objects: 221, done.
remote: Total 221 (delta 0), reused 0 (delta 0), pack-reused 221
Receiving objects: 100% (221/221), 119.11 KiB | 0 bytes/s, done.
Resolving deltas: 100% (116/116), done.
Checking connectivity... done.
Submodule path 'mset': checked out '7f5e51a1fc969ce6d7db1dc81ea92426960367ac'
Submodule 'rop3ds' (https://github.com/Reisyukaku/rop3ds) registered for path 'rop3ds'
Cloning into 'rop3ds'...
remote: Counting objects: 371, done.
remote: Total 371 (delta 0), reused 0 (delta 0), pack-reused 371
Receiving objects: 100% (371/371), 58.38 KiB | 0 bytes/s, done.
Resolving deltas: 100% (227/227), done.
Checking connectivity... done.
Submodule path 'mset/rop3ds': checked out '621c8d267d4c088bf057baf509e458c9abe97bee'
Unable to checkout 'e91330fab181cc15d595065229fd907229aa5796' in submodule path 'BrahmaLoader'

Am I doing something wrong?
 
Last edited by Orkna,

d0k3

3DS Homebrew Legend
OP
Member
Joined
Dec 3, 2004
Messages
2,786
Trophies
1
XP
3,896
Country
Germany
Hm, i see reiNAND and ReiNAND in the sources. Getting some errors because of this. Linux does not like that. ;-)

Checking out:
Code:
git clone --recursive https://github.com/d0k3/ReiNand
Cloning into 'ReiNand'...
remote: Counting objects: 284, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 284 (delta 1), reused 0 (delta 0), pack-reused 274
Receiving objects: 100% (284/284), 3.38 MiB | 708.00 KiB/s, done.
Resolving deltas: 100% (103/103), done.
Checking connectivity... done.
Submodule 'BrahmaLoader' (https://github.com/d0k3/BrahmaLoader) registered for path 'BrahmaLoader'
Submodule 'mset' (https://github.com/Reisyukaku/mset) registered for path 'mset'
Cloning into 'BrahmaLoader'...
remote: Counting objects: 371, done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 371 (delta 3), reused 0 (delta 0), pack-reused 354
Receiving objects: 100% (371/371), 398.44 KiB | 330.00 KiB/s, done.
Resolving deltas: 100% (196/196), done.
Checking connectivity... done.
fatal: reference is not a tree: e91330fab181cc15d595065229fd907229aa5796
Cloning into 'mset'...
remote: Counting objects: 221, done.
remote: Total 221 (delta 0), reused 0 (delta 0), pack-reused 221
Receiving objects: 100% (221/221), 119.11 KiB | 0 bytes/s, done.
Resolving deltas: 100% (116/116), done.
Checking connectivity... done.
Submodule path 'mset': checked out '7f5e51a1fc969ce6d7db1dc81ea92426960367ac'
Submodule 'rop3ds' (https://github.com/Reisyukaku/rop3ds) registered for path 'rop3ds'
Cloning into 'rop3ds'...
remote: Counting objects: 371, done.
remote: Total 371 (delta 0), reused 0 (delta 0), pack-reused 371
Receiving objects: 100% (371/371), 58.38 KiB | 0 bytes/s, done.
Resolving deltas: 100% (227/227), done.
Checking connectivity... done.
Submodule path 'mset/rop3ds': checked out '621c8d267d4c088bf057baf509e458c9abe97bee'
Unable to checkout 'e91330fab181cc15d595065229fd907229aa5796' in submodule path 'BrahmaLoader'

Am I doing something wrong?
That may be due to me being a Windows user and not paying attention... Can you show me where?
 

Orkna

Well-Known Member
Member
Joined
Feb 7, 2014
Messages
379
Trophies
0
Location
Sviiiiiden
XP
277
Country
That may be due to me being a Windows user and not paying attention... Can you show me where?

Code:
ReiNand/mset/source/launcher_path.h:#define LAUNCHER_PATH "/reiNand.dat"
ReiNand/mset/.gitignore:reiNand.dat
ReiNand/mset/Makefile:name ?= reiNand.dat
ReiNand/mset/rop3ds/download.html.template:     l='reiNand.dat',g=decodeURI(d.URL).split('?');


Code:
ReiNand/Makefile:launcher: $(dir_out)/ReiNand.dat
ReiNand/Makefile:ninjhax: $(dir_out)/3ds/ReiNand
ReiNand/Makefile:.PHONY: $(dir_out)/ReiNand.dat
ReiNand/Makefile:$(dir_out)/ReiNand.dat: $(dir_build)/main.bin $(dir_out)/rei/
ReiNand/Makefile:$(dir_out)/3ds/ReiNand:
ReiNand/Makefile:       @mkdir -p "$(dir_out)/3ds/ReiNand"
ReiNand/Makefile:       @cp -av $(dir_ninjhax)/output/ReiNand.3dsx $@
ReiNand/Makefile:       @cp -av $(dir_ninjhax)/output/ReiNand.smdh $@

I don't think that will fail the checkout?

Edit:
If I checkout from rei's git and replaces BrahmaLoader I can compile but it will fail on copying the 3dsx and smdh-file because it expects Rei and not rei but it builds rei. ;)
built ... reiNAND.3dsx
built ... reiNAND.smdh
 
Last edited by Orkna,
  • Like
Reactions: d0k3

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: It's mostly the ones that are just pictures and no instructions at all