Question Is there any exec() function in libnx/others SDK?

Discussion in 'Switch - ROM Hacking, Saves, Translations & Tools' started by SwitchMods, Oct 21, 2018.

  1. SwitchMods
    OP

    SwitchMods Member

    Newcomer
    1
    Aug 27, 2018
    Netherlands
    Okay so let's assume that we have 3 executable files (NSO) in the exeFS called: main.nso, main2.nso and main3.nso
    Is there any sdk exec function that I can call fom main.nso to boot (on the fly) main2.nso or main3.nso?

    This is not a difficult function to implement, but require a lot of knowlege of Horizon and its executable loader. Basically it should load the executable, find its OEP and then call it (but idk if there are any software dependances that need to be loaded too)...

    am I the first one trying to achieve this?
     
  2. hippy dave

    hippy dave BBMB

    Member
    13
    Apr 30, 2012
    United Kingdom
    I have no idea about the libnx functions, but you could have a look at the homebrew menu source to see how it goes about loading & running nros. This looks like it: https://github.com/switchbrew/nx-hbmenu
     
  3. m4xw

    m4xw Ancient Deity

    Member
    14
    May 25, 2018
    Germany
    Last edited by m4xw, Oct 21, 2018
    8BitWonder and hippy dave like this.
  4. hippy dave

    hippy dave BBMB

    Member
    13
    Apr 30, 2012
    United Kingdom
  5. m4xw

    m4xw Ancient Deity

    Member
    14
    May 25, 2018
    Germany
    Yes.
    Thats how I do salamander too
     
    Last edited by m4xw, Oct 21, 2018
    hippy dave likes this.
  6. SwitchMods
    OP

    SwitchMods Member

    Newcomer
    1
    Aug 27, 2018
    Netherlands
    Thank you both (@hippy dave and @m4xw ) for your anwers, I'll give it a look.

    I think that technically should be possible to edit envSetNextLoad to support NSO, by adding a parser of this executable format (atm I don't have this knownledge, but this is a documented format so it shouldn't be a problem).

    We will see... any addition to this topic is welcome ;)
     
  7. m4xw

    m4xw Ancient Deity

    Member
    14
    May 25, 2018
    Germany
Loading...