[Release] [Multi-platform GUI] HiyaCFW Helper

Discussion in 'NDS - Emulation and Homebrew' started by mondul, Sep 17, 2018.

  1. mondul
    OP

    mondul Advanced Member

    Newcomer
    3
    Aug 8, 2018
    Colombia
    Barranquilla
    In order to make things easier for me, and because I don't have Windows, I edited the HiyaCFW Helper Python script by @jerbear64 and LmN in order to add a graphical user interface to it.
    [​IMG]
    What it does:
    • Allows you to browse for your NAND backup, no need to place it at the same folder.
    • Downloads the latest HiyaCFW release and decompress it.
    • Autodetects the console region from the NAND dump, downloads and decrypts its v512 launcher.
    • Creates the patched 00000002.app and bootloader.nds for the custom firmware.
    • Uses your platform's twltool (binaries for Linux and MacOS included) to decrypt the NAND.
    • Mounts the decrypted NAND (OSFMount required for Windows) and extracts it to a folder named "out".
    • Installs the HiyaCFW and the patched files on the the chosen output destination.
    • (Optional) installs the latest release of TWiLightMenu++ on the the chosen output destination.

    NAND mode:
    Clicking on the integrated circuit button will give you a NAND mode, where you can uninstall unlaunch or install its v1.4 stable release, remove the No$GBA footer or add it. Recommended only for those with a hardmod.

    Requirements:
    Windows:
    • OSFMount.
    • You will need to run the HiyaCFW_Helper.exe file as administrator in order to mount the decrypted NAND.
    Linux:
    • Python <3.5 with the Tk library (I had to do sudo apt-get install python3-tk -y in my LUbuntu virtual machine; sudo dnf install python3-tkinter in Fedora).
    • You will need to run the script as sudo in order to mount the decrypted NAND.
    MacOS:

    What it includes:
    • 7za binaries for Windows, Linux and MacOS. It's used to decompress the HiyaCFW latest release as @Robz8 uploaded it as a 7z archive. Compiled from the LZMA SDK available from the kornelski's GitHub repo.
    • twltool binaries for Windows, Linux and MacOS. Compiled from the WinterMute's GitHub repo.
    • NDS bootloader creator binaries for Linux and MacOS (based off devkitPro's ndstool v1.27). Compiled from my GitHub repo. For Windows the ndstool included with HiyaCFW is used.
    • In order to decrypt the launcher, the pyaes library by ricmoo, taken from his GitHub repo, was used.
    • fatattr binary for Linux. It's used for setting FAT attributes in NAND mode. Compiled from the Terseus' GitHub repo.

    How to use it:
    Windows:
    • Go to the helper's folder.
    • Right-click on the HiyaCFW_Helper.exe file and click Run as administrator.
    Linux:
    • Open a terminal.
    • cd to the helper's folder (cd ~/Downloads/HiyaCFW-Helper or whatever).
    • Run sudo ./HiyaCFW_Helper.py.
    MacOS:
    • Open a Terminal (⌘+Space and write terminal).
    • cd to the helper's folder (cd ~/Downloads/HiyaCFW-Helper or whatever).
    • Run ./HiyaCFW_Helper.py.

    Thanks to:

    Download it from the GitHub repo releases page.
     
    Last edited by mondul, Feb 2, 2019
    Vol_M, astrocapsule, Zense and 6 others like this.
  2. mondul
    OP

    mondul Advanced Member

    Newcomer
    3
    Aug 8, 2018
    Colombia
    Barranquilla
    Plans for the future:
    • Choose the output folder. Done!
    • Have the option to integrate the latest release of DSiMenu++ on the output folder. Done!
    • Have an advanced section for those people with a hardmod where you can do NAND stuff like install/uninstall unlaunch. Done!
    • Translate the code for that tool written by WB3000 used to get the decrypted launcher files in order to download them from the CDN directly and decrypt them. Done!
    • Make the GUI prettier.
     
    Last edited by mondul, Feb 2, 2019
  3. Sha8q

    Sha8q pls help

    Member
    3
    Mar 31, 2018
    Jamaica
    On Windows, I keep getting an error about OSFMount needing to be installed, and it is installed on my computer. I also tried with OSFMount open, but still it didn't work.
     
  4. mondul
    OP

    mondul Advanced Member

    Newcomer
    3
    Aug 8, 2018
    Colombia
    Barranquilla
    Please tell me the location of the OSFMount program folder and if it has the dot com file in it
     
  5. Sha8q

    Sha8q pls help

    Member
    3
    Mar 31, 2018
    Jamaica
    Well, this only occurs when I run it in my E: drive. I installed OSFMount on the C: drive, and it works there.
     
  6. brunocar

    brunocar GBAtemp Advanced Fan

    Member
    5
    Aug 14, 2017
    Argentina
    I'm also having the same issue regarding it not recognizing OSFmount on windows, but mine is the same drive as OSFmount
     
  7. brunocar

    brunocar GBAtemp Advanced Fan

    Member
    5
    Aug 14, 2017
    Argentina
    sorry, double posted by accident
     
  8. mondul
    OP

    mondul Advanced Member

    Newcomer
    3
    Aug 8, 2018
    Colombia
    Barranquilla
    Uploaded version 2.1 with the option to install the latest TWiLightMenu++ release and changed the way OSFMount is recognized in Windows.

    EDiT: Link
     
    Last edited by mondul, Oct 4, 2018
  9. mondul
    OP

    mondul Advanced Member

    Newcomer
    3
    Aug 8, 2018
    Colombia
    Barranquilla
    New release!

    v2.2 with auto 00000002.app downloading and decrypting! You don't need to provide it anymore!

    Link
     
    Last edited by mondul, Oct 4, 2018
    Clyde_271 and Sha8q like this.
  10. mondul
    OP

    mondul Advanced Member

    Newcomer
    3
    Aug 8, 2018
    Colombia
    Barranquilla
    Another new release!

    v2.3 with a couple of bug fixes:
    • Some people were having problems due the log list box wasn't working correctly, so changed it to a thread-safe text box.
    • Got reports again about the helper not opening on 64-bit Windows because it was unable to find OSFMount. I was searching for the install path on the registry, but because the bundle was made with a 32-bit version of PyInstaller, it was not accesing the 64-bit registry but a 32-bit mirror. Tried to change the detection method fom registry to using the REG command, but still was running 32-bit hence it was unable to find the right keys. So, I had to limit the search scope to the Program Files folder. In other words, now the script requires that OSFMount must be installed at its default location (%PROGRAMFILES%\OSFMount)
    Also I would like to note that the launcher decryption is much slower in MacOS and Linux because it's using the pyaes library, which is written entirely in Python. Windows uses PyCrypto so is (a lot) faster.

    Link
     
    Tarmfot likes this.
  11. jerbear64

    jerbear64 GBAtemp Fan

    Member
    3
    Dec 10, 2011
    United States
    I'm getting this error when installing TWiLight Menu++ with this tool on Fedora 28:
    Code:
    Exception in thread Thread-17:
    Traceback (most recent call last):
      File "/usr/lib64/python2.7/threading.py", line 804, in __bootstrap_inner
        self.run()
      File "/usr/lib64/python2.7/threading.py", line 757, in run
        self.__target(*self.__args, **self.__kwargs)
      File "HiyaCFW_Helper.py", line 700, in clean
        remove(self.files.pop())
    OSError: [Errno 2] No such file or directory: 'BOOT_fc.NDS'
    
    BOOT_fc.nds shows up in the helper folder itself rather than the out folder for whatever reason, causing this error.

    The tool successfully does its job otherwise, producing a proper out folder as expected once the binaries in the Linux folder are set to executable. You might want to chown/chmod the out folder/files at the end, though- I can't delete them without using sudo otherwise.
     
    mondul likes this.
  12. mondul
    OP

    mondul Advanced Member

    Newcomer
    3
    Aug 8, 2018
    Colombia
    Barranquilla
    The BOOT_fc.NDS file is not needed by the generated output, that's why I'm deleting it, but I don't know why is not deleting it though the script is running with elevated priveleges. I have in mind updating the script to extract only the files it needs, I will need to check if the 7-Zip extractor I'm using has that feature.
    For the permissions, I'm thinking of something that will only require sudo when it's about to mount and unmount the NAND, though I will have to request the sudo password in the script at some point, I hope Linux users will be comfortable with that.
     
    JSMastah likes this.
  13. mondul
    OP

    mondul Advanced Member

    Newcomer
    3
    Aug 8, 2018
    Colombia
    Barranquilla
    Fifth release!

    @Robz8 changed his GitHub username to RocketRobz and the repos URLs got changed. Updated the script to reflect that. Also changed the 7zDec binary for the full 7za tool in order to decompress only what is needed from the HiyaCFW and TWiLightMenu++ releases.

    Link

    @jerbear64 I was unable to make the chmod change because it removes the read-only status of the TWLCFG0.dat and TWLCFG1.dat files.
     
  14. mondul
    OP

    mondul Advanced Member

    Newcomer
    3
    Aug 8, 2018
    Colombia
    Barranquilla
    Sixth Release!

    Read-only permissions are now correctly set for TWLCFG0.dat and TWLCFG1.dat when installing TWiLightMenu++

    @jerbear64 in Linux, now the out folder gets its owner changed to the one who opened the terminal, so you don't need to run sudo to delete the folder. Also, thanks again for your script which this one is based from.

    Link
     
  15. mondul
    OP

    mondul Advanced Member

    Newcomer
    3
    Aug 8, 2018
    Colombia
    Barranquilla
    Seventh Release!

    Added NAND mode for those with a hardmod, just click on the integrated circuit icon to access it. Thanks again @Sha8q for the idea and @jerbear64 for including this helper script on the DSi guide site.

    Link
     
    Last edited by mondul, Oct 18, 2018
  16. Robz8

    Robz8 Coolest of TWL

    Member
    17
    Oct 1, 2010
    United States
    So it seems this isn't patching the launcher .app correctly.
    Some users are reporting that the CFW patches aren't working.

    For the patches to work, their .app should contain this MD5 checksum:
    and this SHA1 checksum:
    Both are for non-JAP users.

    For JAP users, their .app should contain this MD5 checksum:
    and this SHA1 checksum:
     
    ChampionLeake and JSMastah like this.
  17. ChampionLeake

    ChampionLeake NTR/TWL Exploiter

    Member
    4
    Jan 19, 2016
    United States
    It also seems that tons of users are now experiencing hangs on the hiyaCFW-Helper at "Downloading launcher....". No matter what version you use, it'll just freeze.
     
  18. mondul
    OP

    mondul Advanced Member

    Newcomer
    3
    Aug 8, 2018
    Colombia
    Barranquilla
    Maybe I'm not detecting the console region accurately, or maybe an additional patch is needed. If possible I'd like to have a dump from one of those consoles to check better. Also it would be nice if I can get in touch with the users having that issue in order to assist them directly.

    It could be the way I'm detecting the console region. By sunday I will release a Windows version with the console available to check for any errors.

    Thanks for these reports, they help me to give you all a better helper.
     
    ChampionLeake, JSMastah and Robz8 like this.
  19. ChampionLeake

    ChampionLeake NTR/TWL Exploiter

    Member
    4
    Jan 19, 2016
    United States
    Alrighty, I'll keep an eye on your github so I can see what's up and test to see if things are working.
     
    JSMastah likes this.
  20. Sha8q

    Sha8q pls help

    Member
    3
    Mar 31, 2018
    Jamaica
    I am just going to say (hint?): PowerISO is the key for Windows. It comes with a program called "piso.exe" and that can mount and unmount NAND images with scripts (.bat works, not sure about python) and the user won't have to do a thing.
     
    JSMastah likes this.
  21. edo9300

    edo9300 Member

    Newcomer
    3
    Aug 19, 2018
    Italy
    Hmm i tried the helper, and it seemed to work, the only downside i found is that on windows you are forced to have osfmount installed to even start the app, i think it would be good to add teh possibility to make the user manually mount the image at runtime in case he doesn't want to install osfmount or, like me, is already using another tool to moint images and installing osfmount would just be redoundant
     
  22. ChampionLeake

    ChampionLeake NTR/TWL Exploiter

    Member
    4
    Jan 19, 2016
    United States
    Not just that, some of us already have OSFMount installed already and seems o not want to run at all. From both osfmount 32/64 bit versions.
     
Loading...