Changing the .3dsx file path in ROP Payload

Discussion in '3DS - Homebrew Development and Emulators' started by Platinum Lucario, Jan 27, 2017.

  1. Platinum Lucario
    OP

    Platinum Lucario GBAtemp Advanced Fan

    Member
    520
    234
    May 17, 2014
    Australia
    Warrnambool, Victoria, Australia
    So I tried to experiment with attempting to change the file path for MenuHax in the ROP Payload binary. When I tried to edit the ROP Payload binary file with a text editor and replaced the text "/boot.3dsx" with "CtrBootManager.3dsx", it resulted in MenuHax loading, but when it tried to load the ROP Payload, the bottom screen stayed as white.

    Is there anything I can do besides renaming the .3dsx file? You see, what I'm trying to do is have the Homebrew Launcher app load the "boot.3dsx" for the Homebrew Launcher, and have MenuHax load the "CtrBootManager.3dsx" for the CtrBootManager.

    As I've found out, just simply editing the text in binary file makes it not work at all. Is there any particular part of the ROP Payload source code in which has the "/boot.3dsx" text in it?

    I'd really like to work towards solutions for an ARM11 Userland to load upon boot, with multiple .3dsx files that can be loaded separately for each exploit. One for MenuHax, one for an app loading a .3dsx file and so fourth.
     
    Quantumcat likes this.
  2. Zidapi

    Zidapi GBAtemp Psycho!

    Member
    3,045
    1,826
    Dec 1, 2002
    :rofl2::teach:

    Try a hex editor friend.
     
    smileyhead and Platinum Lucario like this.
  3. FenrirWolf

    FenrirWolf GBAtemp Psycho!

    Member
    4,347
    329
    Nov 19, 2008
    United States
    Sandy, UT
    I think you have to stick with a 4-character path. So rename ctrbootmanager.3dsx to ctrb.3dsx or something and try that.
     
    iAqua likes this.
  4. Platinum Lucario
    OP

    Platinum Lucario GBAtemp Advanced Fan

    Member
    520
    234
    May 17, 2014
    Australia
    Warrnambool, Victoria, Australia
    Yep, I did this time round.

    Yep, I noticed that any characters past 10 characters won't be read properly. But having it at four characters (excluding the .3dsx and / characters) works.

    Now the question is, where can I find the values in which determine how many characters are in the file path, as well as the values that determine the size of each section of the .3dsx file? I'll need to know this so I can increase the amount of characters in the path to the number needed for CtrBootManager, as well as ensure that the sections are within the offsets.
     
    Last edited by Platinum Lucario, Jan 28, 2017
  5. Joom

    Joom  ❤❤❤

    Member
    4,286
    2,944
    Jan 8, 2016
    United States
    Why use a bootloader when you can just have your custom firmware's 3dsx on the root as "boot.3dsx" and hex the otherapp payload to point to something like "hblc.3dsx" for the homebrew launcher? Also, I already know someone's gonna come along and slam you for still using Menuhax, so I'm gonna go ahead and beat them to it; why are you still using Menuhax?
     
  6. Giodude

    Giodude GBAtemp's official rock

    Member
    GBAtemp Patron
    Giodude is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    4,216
    1,296
    May 17, 2015
    United States
    New York
    All i do, is open up the payload in notepad++, search for boot.3dsx, and rename it to the actual 3dsx i want booting, as long as it's also 4 characters. For example i used temp.3dsx.
     
  7. Platinum Lucario
    OP

    Platinum Lucario GBAtemp Advanced Fan

    Member
    520
    234
    May 17, 2014
    Australia
    Warrnambool, Victoria, Australia
    I am already using A9LH as well as MenuHax. The only reason I'm using it, is for compatibility with .3dsx files, A9LH does not support .3dsx since the ARM9 is the only processor that's initialised. The ARM11 Userland is required to load .3dsx files. Also, the reason I don't want to rename boot.3dsx is because it will affect the Homebrew Launcher loader app, since it just redirects to the boot.3dsx.
    Yep, which I can do. But I'm actually trying to find out how to make it more than four characters.
     
    Last edited by Platinum Lucario, Jan 28, 2017
  8. Joom

    Joom  ❤❤❤

    Member
    4,286
    2,944
    Jan 8, 2016
    United States
    Are you opposed to installing the HBL CIA?
     
  9. Platinum Lucario
    OP

    Platinum Lucario GBAtemp Advanced Fan

    Member
    520
    234
    May 17, 2014
    Australia
    Warrnambool, Victoria, Australia
    The thing is, I already have it installed. But renaming the boot.3dsx file will result in it not working. And renaming something else to boot.3dsx will result in it loading that instead. What I'm trying to do is have boot.3dsx for the regular Homebrew Launcher, and a bootable source for CtrBootManager.3dsx.
     
  10. Joom

    Joom  ❤❤❤

    Member
    4,286
    2,944
    Jan 8, 2016
    United States
    And what do you need the boot manager for? Sorry for the 20 questions, but I'm really confused as to why any of this is necessary.
     
  11. Platinum Lucario
    OP

    Platinum Lucario GBAtemp Advanced Fan

    Member
    520
    234
    May 17, 2014
    Australia
    Warrnambool, Victoria, Australia
    So I can either boot into Grid Launcher or regular Homebrew Launcher upon boot. And to boot directly into other .3dsx files too, when needed. The apps that don't even come with a .bin or .dat file.
     
    Last edited by Platinum Lucario, Jan 28, 2017
  12. Joom

    Joom  ❤❤❤

    Member
    4,286
    2,944
    Jan 8, 2016
    United States
    Hmm, well, alright, I guess.
     
  13. Roboman

    Roboman GBAtemp Fan

    Member
    303
    70
    Jan 7, 2016
    United States
    Just rename it to a four character name. It would disrupt spacing for the payload if you try to insert more characters.
    You can try brew.3dsx or ctrb.3dsx or anything. Just rename the file and you are set.

    There is the finicky payload that can only handle four letter files, and the easygoing file that can have as many or few letters as you want, and you want to wrestle with the payload?
     
  14. Platinum Lucario
    OP

    Platinum Lucario GBAtemp Advanced Fan

    Member
    520
    234
    May 17, 2014
    Australia
    Warrnambool, Victoria, Australia
    Yep, which is exactly what I've done. I'd really like to find out a way to allow for more characters without disrupting the spacing for the payload. From I know in machine code within most binary files, there's always the hex values that determine how big the file is, how many bytes long the header can be, how many values can be stored (such as with collecting coins in some video game) and how many bytes long the name of a file path can be.
     
  15. ihaveamac

    ihaveamac GBAtemp Guru

    Member
    5,504
    6,095
    Apr 20, 2015
    United States
    Tigard, OR
    only way to have an arbitrary filename length is to build *hax from source.

    https://github.com/smealum/ninjhax2.x/tree/superto probably, has the most recent commit
     
  16. Fishaman P

    Fishaman P Speedrunner

    Member
    3,244
    510
    Jan 2, 2010
    United States
    Wisconsin
    That may be the case for data storage files with defined formats, but you'll never see that in a program binary. You'd have to update every other pointer on the file, which is far too big a task.
    MAYBE you could recompile from source with a different filename specified in the code, but that's your best bet.
     
  17. Joom

    Joom  ❤❤❤

    Member
    4,286
    2,944
    Jan 8, 2016
    United States
    I don't understand why he's wanting to alternate between the two launchers, or what system tools he might be using that only exist as a 3dsx anymore. This is like trying to reinvent the wheel with a square frame.
     
    Quantumcat likes this.
  18. Platinum Lucario
    OP

    Platinum Lucario GBAtemp Advanced Fan

    Member
    520
    234
    May 17, 2014
    Australia
    Warrnambool, Victoria, Australia
    Thank you. I looked through the source code again and I found the file that contains the file path, it's in ninjhax2.x/app_bootloader/source/main.c and I will compile it into a binary and release it along with it's source code.
    Yep, this is exactly what I'm going to do. And that's what I've been thinking of doing.
    The reason I'm thinking of doing this, is so that CtrBootManager can be booted with MenuHax, while also being able to boot into Homebrew Launcher normally with other exploits, as well as the Homebrew Launcher app in which is designed for boot.3dsx file, without the need of renaming of any .3dsx files.