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

Discussion in '3DS - Flashcards & Custom Firmwares' started by d0k3, Oct 10, 2015.

  1. d0k3
    OP

    d0k3 3DS Homebrew Legend

    Member
    2,596
    2,615
    Dec 3, 2004
    Gambia, The
    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.
     

    Attached Files:

    Last edited by d0k3, Oct 11, 2015


  2. -Xin-

    -Xin- Advanced Member

    Newcomer
    71
    12
    Jul 26, 2015
    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-, Oct 10, 2015
  3. DjoeN

    DjoeN Captain Haddock!

    Member
    5,136
    1,478
    Oct 21, 2005
    Belgium
    Somewhere in this potatoland!
    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
     
  4. -Xin-

    -Xin- Advanced Member

    Newcomer
    71
    12
    Jul 26, 2015
    Morocco
    do you compile on linux or windows ?
     
  5. d0k3
    OP

    d0k3 3DS Homebrew Legend

    Member
    2,596
    2,615
    Dec 3, 2004
    Gambia, The
    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.
    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, Oct 10, 2015
  6. -Xin-

    -Xin- Advanced Member

    Newcomer
    71
    12
    Jul 26, 2015
    Morocco
    well it's the newer one but i think i will use git/github to clone to source it sound more easy
     
  7. d0k3
    OP

    d0k3 3DS Homebrew Legend

    Member
    2,596
    2,615
    Dec 3, 2004
    Gambia, The
    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!
     
  8. DjoeN

    DjoeN Captain Haddock!

    Member
    5,136
    1,478
    Oct 21, 2005
    Belgium
    Somewhere in this potatoland!
    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
     
    d0k3 likes this.
  9. -Xin-

    -Xin- Advanced Member

    Newcomer
    71
    12
    Jul 26, 2015
    Morocco
    ok got it working thanx to git clone command and @d0k3 ;) ( @DjoeN i like linux xD )
     
  10. Asia81

    Asia81 In my Ecchi World <3

    Member
    4,954
    2,444
    Nov 15, 2014
    France
    Albi
    i'm always waiting for rxtool brama2 xD
     
    DjoeN likes this.
  11. DjoeN

    DjoeN Captain Haddock!

    Member
    5,136
    1,478
    Oct 21, 2005
    Belgium
    Somewhere in this potatoland!
    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
     
  12. d0k3
    OP

    d0k3 3DS Homebrew Legend

    Member
    2,596
    2,615
    Dec 3, 2004
    Gambia, The
    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!
     

    Attached Files:

    Last edited by d0k3, Oct 10, 2015
  13. tatundria

    tatundria GBAtemp Regular

    Member
    258
    26
    Feb 24, 2009
    Argentina
    can anyone compile it and send it to me by message please? I would be very grateful!
     
  14. Asia81

    Asia81 In my Ecchi World <3

    Member
    4,954
    2,444
    Nov 15, 2014
    France
    Albi
    It's for compil rxtool with brama2?
     
  15. d0k3
    OP

    d0k3 3DS Homebrew Legend

    Member
    2,596
    2,615
    Dec 3, 2004
    Gambia, The
    Only the Ninjhax loader, but I guess that's all you want and you can get the other files from elsewhere.
     
  16. Asia81

    Asia81 In my Ecchi World <3

    Member
    4,954
    2,444
    Nov 15, 2014
    France
    Albi
    Ok, but could you help me for compil ?
    I edited the app info, but I noob in homebrew compil xD
     
  17. d0k3
    OP

    d0k3 3DS Homebrew Legend

    Member
    2,596
    2,615
    Dec 3, 2004
    Gambia, The
    Look here. Or wait until someone else compiles it. It's bound to happen. As I said, posting the Ninjhax loader is okay.
     
  18. Orkna

    Orkna GBAtemp Fan

    Member
    379
    190
    Feb 7, 2014
    Sviiiiiden
    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, Oct 10, 2015
  19. d0k3
    OP

    d0k3 3DS Homebrew Legend

    Member
    2,596
    2,615
    Dec 3, 2004
    Gambia, The
    That may be due to me being a Windows user and not paying attention... Can you show me where?
     
  20. Orkna

    Orkna GBAtemp Fan

    Member
    379
    190
    Feb 7, 2014
    Sviiiiiden
    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, Oct 10, 2015
    d0k3 likes this.