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,085
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: 342
Last edited by d0k3,

Asia81

Yuri Lover ~
Member
Joined
Nov 15, 2014
Messages
6,658
Trophies
3
Age
29
XP
3,504
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.
  • BakerMan @ BakerMan:
    i said i was sleeping...
  • BakerMan @ BakerMan:
    sleeping with uremum
  • K3Nv2 @ K3Nv2:
    Even my mum slept on that uremum
  • TwoSpikedHands @ TwoSpikedHands:
    yall im torn... ive been hacking away at tales of phantasia GBA (the USA version) and have so many documents of reverse engineering i've done
  • TwoSpikedHands @ TwoSpikedHands:
    I just found out that the EU version is better in literally every way, better sound quality, better lighting, and there's even a patch someone made to make the text look nicer
  • TwoSpikedHands @ TwoSpikedHands:
    Do I restart now using what i've learned on the EU version since it's a better overall experience? or do I continue with the US version since that is what ive been using, and if someone decides to play my hack, it would most likely be that version?
  • Sicklyboy @ Sicklyboy:
    @TwoSpikedHands, I'll preface this with the fact that I know nothing about the game, but, I think it depends on what your goals are. Are you trying to make a definitive version of the game? You may want to refocus your efforts on the EU version then. Or, are you trying to make a better US version? In which case, the only way to make a better US version is to keep on plugging away at that one ;)
  • Sicklyboy @ Sicklyboy:
    I'm not familiar with the technicalities of the differences between the two versions, but I'm wondering if at least some of those differences are things that you could port over to the US version in your patch without having to include copyrighted assets from the EU version
  • TwoSpikedHands @ TwoSpikedHands:
    @Sicklyboy I am wanting to fully change the game and bend it to my will lol. I would like to eventually have the ability to add more characters, enemies, even have a completely different story if i wanted. I already have the ability to change the tilemaps in the US version, so I can basically make my own map and warp to it in game - so I'm pretty far into it!
  • TwoSpikedHands @ TwoSpikedHands:
    I really would like to make a hack that I would enjoy playing, and maybe other people would too. swapping to the EU version would also mean my US friends could not legally play it
  • TwoSpikedHands @ TwoSpikedHands:
    I am definitely considering porting over some of the EU features without using the actual ROM itself, tbh that would probably be the best way to go about it... but i'm sad that the voice acting is so.... not good on the US version. May not be a way around that though
  • TwoSpikedHands @ TwoSpikedHands:
    I appreciate the insight!
  • The Real Jdbye @ The Real Jdbye:
    @TwoSpikedHands just switch, all the knowledge you learned still applies and most of the code and assets should be the same anyway
  • The Real Jdbye @ The Real Jdbye:
    and realistically they wouldn't

    be able to play it legally anyway since they need a ROM and they probably don't have the means to dump it themselves
  • The Real Jdbye @ The Real Jdbye:
    why the shit does the shitbox randomly insert newlines in my messages
  • Veho @ Veho:
    It does that when I edit a post.
  • Veho @ Veho:
    It inserts a newline in a random spot.
  • The Real Jdbye @ The Real Jdbye:
    never had that i don't think
  • Karma177 @ Karma177:
    do y'all think having an sd card that has a write speed of 700kb/s is a bad idea?
    trying to restore emunand rn but it's taking ages... (also when I finished the first time hekate decided to delete all my fucking files :wacko:)
  • The Real Jdbye @ The Real Jdbye:
    @Karma177 that sd card is 100% faulty so yes, its a bad idea
  • The Real Jdbye @ The Real Jdbye:
    even the slowest non-sdhc sd cards are a few MB/s
  • Karma177 @ Karma177:
    @The Real Jdbye it hasn't given me any error trying to write things on it so I don't really think it's faulty (pasted 40/50gb+ folders and no write errors)
  • DinohScene @ DinohScene:
    run h2testw on it
  • DinohScene @ DinohScene:
    when SD cards/microSD write speeds drop below a meg a sec, they're usually on the verge of dying
    DinohScene @ DinohScene: when SD cards/microSD write speeds drop below a meg a sec, they're usually on the verge of dying