ReiNand mod for a second emuNAND on SD

Discussion in '3DS - Flashcards & Custom Firmwares' started by wrongmlg, Feb 5, 2016.

  1. wrongmlg
    OP

    wrongmlg Member

    Newcomer
    12
    10
    Feb 5, 2016
    Málaga, Spain
    Hi all! First of all, sorry for my english!!

    I read in this site a Thread about a utility called 3DS MultiEmuNAND creator, from DarkMatterCore, that created it to simplify the process described by nop90 about having two emunand on the same SD, but it needs Palantine and I own a New 3DS XL with 9.2.

    I've revised and made a little modification to ReiNand code to build an alternative version that allows to put a second emuNAND on the SD card with an offset of 2GB, making it compatible with 3DS MultiEmuNAND creator.

    It works in New 3DS 9.2 (as ReiNand does), allowing me to have on the same SD a 10.5 main emunand, with separated id from my sysnand, to install 3ds backup cias, and all that stuff... and a (in my case 9.2) secondary emunand, with the same id that has the sysnand, where i install GBA titles, allowing me to play GBA games in the native emulator, without having to install them to sysnand.

    But it can have more applications!!

    I hope it is useful for other users. In the linked file there are the three releases of ReiNand, 3.0, 3.1 and 3.2b with the mod applied. As you can see, the usually called "rei" folder is now called "rei2", allowing to boot the first emunand with another reinand installation without colliding with it, not being tied to use the same version, and being able to use another splash image for example. For that double-reinand installation, i recommend not using the "3dsx launcher", but renaming Launcher.dat to Launcher1.dat and Launcher2.dat for example (being Launcher1.dat the not-modified Launcher.dat of reinand available on the github), and use CtrBootManager (another incredible and inspiring software) to reference .dat files directly by their distinct names.

    Once you are booted into the second emunand, you can use tools like SysUpdater or FBI if they are installed as cias into the system and you can launch them from Home Menu. If they have to write something to the nand, they will write it to the second emunand, as it must be. But, if you run tools from outside the second emunand system, for example, executing an exploit to run them, or botting them when powering on, through homebrew launcher or similar... any functionality respecting to emunand, will act on firs emunand, that has the traditional location on the SD card. In my case, i needed to use Decrypt9 to dump and later inject FBI on the second emunand, so i had that in mind, and first of all, i put the nand image i was going to use as second emunand, alone, in another SD. There i used Decrypt9 to inject FBI, copied emunand, and used that image to set my second emunand on my first SD.

    IMPORTANT NOTES:

    * If you set an emunand with the same ID as the sysnand, as is my case for second emunand, have in mind that Reinand 3.1 has an important bug respecting to this situation!! It doesn't show the string "Rei" before the firmware version on 3DS settings, so take care not to think you are booting into sysnand!! This bug affects not only my modified version!! Having the same id on sys and emunand, they share the theme and home menu appearance. I don't know an easy way to test it on 3.1, but... if you installed FBI into Health and Security on a separate SD first, as i mentioned, you can see if it is installed and check that way... Or use 3.0 or 3.2b Reinand :)

    * If, for obtaining an emunand with the same id as the sysnand, you made a copy of your sysnand... have in mind that it also has installed the exploit that makes your sysnand boot into emunand... so... once you boot into that emunand... it will execute the exploit and start the boot process again!! So, you must prevent a way to disable the exploit when booting that emunand. For example: In my installation, i use homemenuhax as exploit. It can be configured to boot only if a key is pressed or not (in my case, it boots unless i keep pressing L). So, when i power on my 3ds, i dont press L, and the exploit runs taking me to CtrBootManager, that shows me the boot menu. If i want to enter into the same-id-emunand, i choose it and press L until it enters home menu, to avoid it to enter the booting loop.

    * Another thing respecting HomeMenuHax: Do not change your theme on your same-id-emunand or you will loose HomeMenuHax on emunand and sysnand! (not exactly on sysnand. homemenuhax keeps part of its code in the nintendo ds folder on sd card, associated to the nand id, but you will have to install it again, anyway).


    That's all!! I will be please of helping anyone who needs. This is my fist time taking part actively in a forum and contributing with something that i think is really useful, so will try my best.

    Thanks for reading!


    Download the pack with the three modified versions of ReiNand.


    New
    I have just seen an important thing. For the ones who owns an Old model. If you select "Old 3DS" on 3DS MultiEmuNAND creator, the layout on the SD card will change and my mod of Reinand will not work. I guess you can select "New 3DS" with no problems, as i think the only thing that changes is the offset on the card.


    ----------------------------------------------

    I will explain here what i did on code:

    I modified the function getEmunandSect on emunand.c from:

    void getEmunandSect(u32 *off, u32 *head){
    u32 nandSize = getMMCDevice(0)->total_size;
    if (sdmmc_sdcard_readsectors(nandSize, 1, temp) == 0) {
    if (*(u32*)(temp + 0x100) == NCSD_MAGIC) {
    *off = 0;
    *head = nandSize;​
    }​
    }​
    }

    to:

    void getEmunandSect(u32 *off, u32 *head){
    u32 nandSize = getMMCDevice(0)->total_size;
    if (sdmmc_sdcard_readsectors(0x400000+nandSize, 1, temp) == 0) {
    if (*(u32*)(temp + 0x100) == NCSD_MAGIC) {
    *off = 0x400000;
    *head = nandSize;​
    }​
    }​
    }

    And changed all the ocurrences of "/rei" on source code to "/rei2".
     
    Last edited by wrongmlg, Feb 5, 2016
    emuashui, CeeDee, klear and 2 others like this.


  2. Supster131

    Supster131 (づ。◕‿‿◕。)づ *:・゚✧

    Member
    3,175
    2,186
    Jan 19, 2016
    United States
    My Computer
    I don't see any mention of the 2nd emuNAND being unlinked to the sysNAND, it's possible to have all 3 NANDs unlinked, right?

    Also, would I be able to restore and emuNAND backup to the second emuNAND?
     
  3. wrongmlg
    OP

    wrongmlg Member

    Newcomer
    12
    10
    Feb 5, 2016
    Málaga, Spain
    Of course!! Sorry if i didn't mention it clearly. The three NAND's can be unlinked!!

    I don't understand well your second question. Do you mean if you can inject and extract the second emunand for backup and restore? Of course. That's for what 3D MultiNAND creator was created hehe. You have a selector for NAND id. Select id, and when you choose Inject or Extract, it will be acting on the emunand you selected.
     
    fitz420 and Supster131 like this.
  4. Supster131

    Supster131 (づ。◕‿‿◕。)づ *:・゚✧

    Member
    3,175
    2,186
    Jan 19, 2016
    United States
    My Computer
    Sweet! Yeah I was just wondering as I have a Japanese emuNAND on a 2nd SD card, so it would be much easier to just back that NAND and restore it to the 2nd emuNAND on my 1st SD card. Thanks!
     
  5. wrongmlg
    OP

    wrongmlg Member

    Newcomer
    12
    10
    Feb 5, 2016
    Málaga, Spain
    Thanks to you for liking! :)
     
    fitz420 likes this.
  6. wrongmlg
    OP

    wrongmlg Member

    Newcomer
    12
    10
    Feb 5, 2016
    Málaga, Spain
    I was thinking... what you say is like the process i describe, after injecting fbi on the temporary 4gb sdcard. You would simply come from a previosly created emunand.

    For keeping all your titles, states, and appearance, i think you should do the following:

    * Check inside the "Nintendo 3DS" folder of both your 1st and Jap SD card, you will see two long-named folder inside each SD. One of them, has the same long name on both SDs. That name is obviously the ID of your sysNAND, that is the same in both cards. I guess you can discard that one on your Jap one, as you won't have anything important installed on sysNAND SD database apart from your exploit, that you have for sure, also in your 1st SD. The folder with the other id on your Jap card holds the database of your Jap emunand, so you should copy that one to the "Nintendo 3DS" folder of your main SD, where you should finally have 3 different long-named folders.

    * Backup your Jap emunand (you can do it with 3DS MultiNand creator simply selecting emunand 1).

    * Restore that emunand as emunand 2 on 3DS MultiNand creator.

    And that's all i think!
     
    fitz420 likes this.
  7. Supster131

    Supster131 (づ。◕‿‿◕。)づ *:・゚✧

    Member
    3,175
    2,186
    Jan 19, 2016
    United States
    My Computer
    Thanks! I'll give it a try!
     
  8. Xenon Hacks

    Xenon Hacks GBAtemp Guru

    Member
    7,043
    3,349
    Nov 13, 2014
    United States
    Nice now I can have Sysnand, Emunand ,and a JP Emunand for JP eShop.
     
  9. Supster131

    Supster131 (づ。◕‿‿◕。)づ *:・゚✧

    Member
    3,175
    2,186
    Jan 19, 2016
    United States
    My Computer
    How'd you get the JP eShop to work?
     
  10. Xenon Hacks

    Xenon Hacks GBAtemp Guru

    Member
    7,043
    3,349
    Nov 13, 2014
    United States
    I have an extra SecureInfo_A
     
  11. Supster131

    Supster131 (づ。◕‿‿◕。)づ *:・゚✧

    Member
    3,175
    2,186
    Jan 19, 2016
    United States
    My Computer
    Lucky you lol. I wish I had one >.>

    Edit: Do you think people sell unused SecureInfo_A files? I wouldn't mind buying an unused Japanese one, at a reasonable price of course.
     
    Last edited by Supster131, Feb 5, 2016
  12. Supster131

    Supster131 (づ。◕‿‿◕。)づ *:・゚✧

    Member
    3,175
    2,186
    Jan 19, 2016
    United States
    My Computer
    How would I be able to install FBI on the 2nd emuNAND?
     
    wrongmlg likes this.
  13. wrongmlg
    OP

    wrongmlg Member

    Newcomer
    12
    10
    Feb 5, 2016
    Málaga, Spain
    I mention it on my post.

    "In my case, i needed to use Decrypt9 to dump and later inject FBI on the second emunand, so i had that in mind, and first of all, i put the nand image i was going to use as second emunand, alone, in another SD. There i used Decrypt9 to inject FBI, copied emunand, and used that image to set my second emunand on my first SD."
     
    Supster131 likes this.
  14. Supster131

    Supster131 (づ。◕‿‿◕。)づ *:・゚✧

    Member
    3,175
    2,186
    Jan 19, 2016
    United States
    My Computer
    Sorry about that, it's getting really late and I haven't gotten my sleep XD
     
  15. wrongmlg
    OP

    wrongmlg Member

    Newcomer
    12
    10
    Feb 5, 2016
    Málaga, Spain
    Hahaha :rofl2: don't worry. I can't understand how i am still awake too...
     
  16. wrongmlg
    OP

    wrongmlg Member

    Newcomer
    12
    10
    Feb 5, 2016
    Málaga, Spain
    I have just seen an important thing. For the ones who owns an Old model. If you select "Old 3DS" on 3DS MultiEmuNAND creator, the layout on the SD card will change and my mod of Reinand will not work. I guess you can select "New 3DS" with no problems, as i think the only thing that changes is the offset on the card.
     
  17. Wire

    Wire GBAtemp Regular

    Member
    229
    25
    Oct 17, 2015
    United States
    How many occurrences of /rei were there in the source? I want to know if I found them all for the non-beta release of ReiNand 3.2
     
  18. Supster131

    Supster131 (づ。◕‿‿◕。)づ *:・゚✧

    Member
    3,175
    2,186
    Jan 19, 2016
    United States
    My Computer
    I was wondering that as well, but I ended up just modifying the getEmunandSect on emunand.c, and it worked fine.
     
  19. Wire

    Wire GBAtemp Regular

    Member
    229
    25
    Oct 17, 2015
    United States
    Ok, I guess I will just do that, and it runs fine when they both use the same /rei folder?

    — Posts automatically merged - Please don't double post! —

    Does it matter what I name the second emunand? And do I change the NAND Number from 1 to 2?
     
  20. Supster131

    Supster131 (づ。◕‿‿◕。)づ *:・゚✧

    Member
    3,175
    2,186
    Jan 19, 2016
    United States
    My Computer
    No. First compile ReiNAND normally, and rename ReiNand.dat to ReiNand1.dat (in the out folder), then drag everything in the out folder to the root of your SD card.

    Then delete the "out" and "build" folders from the source code folder. Then modify the getEmunandSect on emunand.c, save it. Then compile the code again. Rename ReiNand.dat to ReiNand2.dat, rename the "rei" folder to "rei2" (in the out folder), finally drag everything in the out folder to the root of your SD card.

    — Posts automatically merged - Please don't double post! —

    Nah, I didn't change the names of my emuNANDs. But yeah, change the NAND number to 2 in multiEmuNAND.