RELEASE hacBrewPack - Make NSPs/NCAs from homebrews

Discussion in 'Switch - Emulation, Homebrew & Software Projects' started by The-4n, Sep 19, 2018.

  1. Milenko

    Milenko GBAtemp Advanced Maniac

    Member
    9
    Oct 16, 2017
    Australia
    It installs fine with SX OS but doesn't open, will installing it with Rei actually make it work? Also tried with Tinfoil under RajNX and wouldn't open in SX OS either

    Nope, installed it under ReiNX and doesn't work in SX OS
     
    Last edited by Milenko, Sep 20, 2018
  2. Milenko
    This message by Milenko has been removed from public view by linuxares, Sep 20, 2018, Reason: Not sure of double post or not.
    Sep 20, 2018
  3. Reecey

    Reecey Mario 64 (favorite game of all time)

    Member
    10
    Mar 7, 2010
    At Home :)
    Brilliant how do you get your key.dat file created?
     
  4. OkazakiTheOtaku

    OkazakiTheOtaku no thanks, I don't want a custom title

    Member
    8
    Jul 20, 2016
    Japan
    127.0.0.1
    W
    Weird. I make custom NSPs and they work on SX.
     
  5. The-4n
    OP

    The-4n GBAtemp Fan

    Member
    9
    Aug 3, 2018
    United States
    new build is out, v0.99-beta.2

    Changelog:
    Added NACP verification for TitleID, Title Name and Author
    Added Plaintext option

    i just added nacp verification so this prevents using invalid titleids which results some problems
    also added --plaintext option so you can create plaintext ncas, remember that they'll work like normal ncas, the difference is that you can easily see nca contens (except header) with hex editor and there's no need to decrypt them
    i also updated readme and npdm.json template file

    https://github.com/The-4n/hacBrewPack/releases/tag/v0.99-beta.2
     
  6. Csmrcc

    Csmrcc GBAtemp Regular

    Member
    3
    Sep 13, 2018
    Spain
    Edited, nevermind
     
    Last edited by Csmrcc, Sep 20, 2018
  7. AnalogMan

    AnalogMan ultraSuMoFramework Dev

    Member
    11
    Apr 20, 2007
    United States
    I made a little python3 script to take a 5 character alphanumeric string and convert it into a Title ID. I did this so that you could easily regenerate your Title ID and you can easily make sure you don't use a title ID someone else used by making your 5 character string meaningful. For example, the homebrew Checkpoint could use the code 'Check' and result in a title ID of 0x010436865636b000. Thought it may be useful for those having trouble thinking up a unique TItle ID. It doesn't cover the entire valid range of 0x0100000000000000 - 0x01ffffffffffffff but it still yields 916,132,832 unique combinations. It also holds to the pattern that base game Title IDs end in '000' so we don't get any that look like updates or DLC content. Here's the source below:

    Code:
    #!/usr/bin/env python3
    # Author: AnalogMan
    # Modified Date: 2018-11-06
    # Purpose: Generates Nintendo Switch Title IDs based on a 5-character alphanumeric code
    
    import os
    import argparse
    import re
    
    def main():
        print('\n========== Title ID Generator ==========\n')
    
        # Arg parser for program options
        parser = argparse.ArgumentParser(description='Generate Title ID from 5-character alphanumeric code')
        parser.add_argument('-c', '--code', help='5-character alphanumeric code')
    
        # Check passed arguments
        args = parser.parse_args()
    
        if args.code:
            code = args.code
        else:
            code = input('\nInput 5-character alphanumeric code: ')
    
        pattern = re.compile("[a-zA-Z0-9]{5}")
        if not pattern.match(code) or len(code) != 5:
            print('\nCode must be alphanumeric (A-Z, a-z, 0-9) and 5 characters in length.\n')
        return
    
        titleID = '010'
        for char in code:
            titleID += '{:02x}'.format(ord(char))
        titleID += '000'
    
        sanitized_titleID = int(titleID, 16) & 0xFFFFFFFFFFFFE000
    
        print('Title ID: 0x{:016x}'.format(sanitized_titleID))
    
    if __name__ == '__main__':
        main()
    
    You may use it by running just the script (in which case it asks for the code) or you can provide a code with the -c argument (python3 titleid_gen.py -c Abc12). Hope someone finds it useful.
     
    Last edited by AnalogMan, Nov 6, 2018 - Reason: Fixed oversight that could accidentally create DLC base TIDs
    Bigjokker and Cyan like this.
  8. zenamez

    zenamez GBAtemp Fan

    Member
    5
    Sep 7, 2016
    Since you can now make things like the Homebrew menu installable, does that mean it has access to different permissions compared to the existing "load via Album" option?

    I ask because I'm fed up with FTPD (Homebrew version) crashing my Switch when I try and do anything (move a file to or from the Switch - regardless of size etc) so if the NSP has file access permissions the existing NRO doesn't, it may fix the crashing for me (last ditch attempt to get it working).
     
    Last edited by zenamez, Sep 20, 2018
  9. Csmrcc

    Csmrcc GBAtemp Regular

    Member
    3
    Sep 13, 2018
    Spain
    What I had read is that way we have access to more ram, don't know other things.
     
  10. Bigjokker

    Bigjokker GBAtemp Regular

    Member
    3
    Jan 4, 2015
    United States
    Do you know if plaintext ncas work with retail games? Also is there a way to encrypt the nca back again?

    Thanks for the great tools!!
     
    DarkUnixOs likes this.
  11. The-4n
    OP

    The-4n GBAtemp Fan

    Member
    9
    Aug 3, 2018
    United States
    I've never looked at FTPD source code and idk why does it crash for you
    so no idea

    plaintext ncas work with retail games, the header is encrypted but sections are plaintext and they are working fine
    it is possible to re-encrypt the sections but you should do it manually
     
  12. sirAnger

    sirAnger GBAtemp Fan

    Member
    4
    Dec 4, 2002
    United States
    Michigan
    The crashing was for a different reason than what the NSP provides for us. There is a more stable version of the FTP HB here, or you can use the sys-ftpd that comes with Tomger's SDFiles, which has faster speeds.
     
  13. Jonhy

    Jonhy GBAtemp Regular

    Member
    3
    May 22, 2016
    United States
    So happy!

    Excellent work.
     
  14. ganons

    ganons GBAtemp Addict

    Member
    6
    Jun 12, 2005
    OP, you should submit this for the homebrew bounty
     
  15. Cyan

    Cyan GBATemp's lurking knight

    Global Moderator
    22
    Oct 27, 2002
    France
    Engine room, learning
    that's too late, unless there's a significant update, one like the tool would do something which it didn't yet.
    but that tool would have been a very good entry in the competition, a lot of people were waiting for an nsp maker :)
     
  16. The-4n
    OP

    The-4n GBAtemp Fan

    Member
    9
    Aug 3, 2018
    United States
    DarkUnixOs, daxtsu and Cyan like this.
  17. BlastedGuy9905

    BlastedGuy9905 where's the updated autopsy report

    Member
    10
    Apr 13, 2017
    United States
    under your desk
    Can I convert an .nro into a .nsp with this?
     
  18. TheGreaKhali

    TheGreaKhali Advanced Member

    Newcomer
    2
    Jul 29, 2018
    United Kingdom
    This is hard to understand. How do I convert a PSNES NSA file into a NSP to be installed through SX OS.
     
  19. mars2fobos

    mars2fobos Newbie

    Newcomer
    2
    Apr 24, 2008
    United States
    How to I modify the npdm.json to force the homebrew not to create a save file?
     
  20. The-4n
    OP

    The-4n GBAtemp Fan

    Member
    9
    Aug 3, 2018
    United States
    you can make a loader for nro by using nx-hbloader, there's a sample folder for this
    otherwise, you have to compile the homebrew with a proper Makefile or you have to extract the nro file which is not that easy

    sx os blocks some svcs, not sure if you can

    fs access control bool permission 0x6
    https://switchbrew.org/wiki/Filesystem_services#Permissions
     
    Last edited by The-4n, Sep 23, 2018
  21. TimeDevouncer

    TimeDevouncer Advanced Member

    Newcomer
    4
    Jun 7, 2018
    Spain
    Arfgh, I need nsps for psnes, pfba and mgba.

    I don't know how, but i try it. Thanks!
     
Loading...