Tutorial  Updated

Haxchi Mod - Custom redNAND Launch Title

Just to keep myself safe from blame...
PLEASE DO NOT ATTEMPT THIS UNLESS YOU KNOW WHAT YOU ARE DOING

I decided to just make a new thread dedicated to everything I've modified and created to have a "custom title" on sysNAND that launches redNAND
It makes use of Haxchi, a DS VC exploit originally released by @smealum and then modified by @FIX94 to launch HBL and work for other games.

UPDATE: The latest commit for FIX94's haxchi includes a version with cfwbooter built in, omitting the need for cfwboot.elf. Files and instructions have been updated to reflect this.

Latest install.py version: 2.1.1
New in this version:
  • Fixed bug in uploading config.txt (for some reason I made it upload to config.ini -_-)
Features:
  • Allows input of any low ID, meaning it will automatically work with future exploit games (and can possibly be used to inject DS games, untested)
  • Makes sure the game and location provided actually exist before attempting to install
  • Automatically downloads and modifies meta.xml with user-defined name
  • Installs files from SD instead of uploading over network, which greatly increases speed (especially for the larger .tga meta files)

As for the modified iosuhax, you will have to compile a new fw.img from the github below
https://github.com/TheCyberQuake/iosuhax



NEW INSTALLER AND INSTALL PROCESS:
Finally got around to fixing up the installer.
It's now a universal installer, and should work automatically with future exploit games.

Download install.py from below, and place in the same folder as wupclient.py
https://mega.nz/#!xVVAHRgL!cMJdtZD6sLp0TIQ7q6BIjNzk5xB25jr8qamy423zUoE

From there you can either download a pre-made install pack from below and place it's files onto the SD card within a folder called haxchi (i.e. sd:/haxchi), or you can place any rom.zip and config.txt in /haxchi, and meta files within /haxchi/meta (excluding meta.xml, which will automatically be modified later).
https://mega.nz/#F!lRFgzSJY!ANFeNyPwRM_SjlH23ca4Zg
At this point I recommend grabbing the official haxchi from fix94, at least until I can rework my install packs or find a better way to do it while still being user friendly.

From there you can run wupserver on the Wii U (by loading fw.img with CFW Booter or haxchi).

You can then either double-click install.py, or type "python install.py" into command prompt/terminal

Enter the low ID of the game you wish to install to (can be found on this github page, it's the last 8 characters of the full 16 character title ID), and then enter the games install location (USB or NAND).
From there the script will install haxchi's rom.zip from sd:/haxchi, and the meta files from sd:/haxchi/meta. After that it will download meta.xml over the network to the PC, and then ask for what you wish the custom name to be (i.e. the name that shows up on home menu), then modify meta.xml to meta.xml.tmp, and then finally upload back to the Wii U.

Finally, the script will attempt to install config.txt, which is needed for the latest haxchi versions made by FIX94. If it succeeds (meaning the file existed on SD) it will also apply chmod 0x644 to the file to make it properly work with haxchi.
 
Last edited by TheCyberQuake,

TheCyberQuake

Certified Geek
OP
Member
Joined
Dec 2, 2014
Messages
5,012
Trophies
1
Age
28
Location
Las Vegas, Nevada
XP
4,433
Country
United States
so where in the file would i need to edit it?
If you want to edit and compile your own fw.img to place it somewhere else, it is the file /patches/0x50000000.s
Edit: look for this
launch_os_hook_mountpath:
.ascii "/vol/sdcard"
.byte0x00
.align0x4

and

fw_img_path:
.ascii "/vol/sdcard"
.byte0x00
.align0x4
 
Last edited by TheCyberQuake,

OCinzento

Member
Newcomer
Joined
Jul 2, 2016
Messages
6
Trophies
0
Age
33
XP
92
Country
Brazil
Hi Guys,

I tried several tutorials to install haxchi but didn't work.
After I executed the command "python -i install_brainage_us.py" I get this error:

Pastebin: http://pastebin.com/G1nr86cL

Image:
30c7vhh.jpg


And my WiiU freeze, to use it again I need to restart it.
I tried to do this hax a lot of times, with different methods but I get same error ever.

Has anyone seen this error?

Thank You.
 

pietempgba

Well-Known Member
Member
Joined
Jun 9, 2016
Messages
1,049
Trophies
0
XP
1,515
Country
United States
i haven't but replacing spaces with underscores might help rename Haxchi Install to Haxchi_Install

--------------------- MERGED ---------------------------

Weird, I don't get that on my end. Have you tried using python 2.7, most of the python scripts in the community use that, so it may be version difference.
changing to python27 fixed it
 

TheCyberQuake

Certified Geek
OP
Member
Joined
Dec 2, 2014
Messages
5,012
Trophies
1
Age
28
Location
Las Vegas, Nevada
XP
4,433
Country
United States
Hi,

I changed the spaces for underscores and got the same error.

http://pastebin.com/q26NjPXg

Thanks,
Don't run it with -i, instead just type python install_brainage_us.py (or double click it in windows)
Also should note there is a better version of the script I uploaded the other day, I just haven't had time to update op with new info.

Sent from my SM-G386T using Tapatalk
 

OCinzento

Member
Newcomer
Joined
Jul 2, 2016
Messages
6
Trophies
0
Age
33
XP
92
Country
Brazil
Bro,

Seems like the problem is with Python 2.7 and Win10/Win7 (I tried both).
I installed a WinXP on a Virtual Machine and executed the script again and it works.

Thank You!
 
Last edited by OCinzento,

TheCyberQuake

Certified Geek
OP
Member
Joined
Dec 2, 2014
Messages
5,012
Trophies
1
Age
28
Location
Las Vegas, Nevada
XP
4,433
Country
United States
Bro,

Seems like the problem is with Python 2.7 and Win10/Win7 (I tried both).
I installed a WinXP on a Virtual Machine and executed the script again and it works.

Thank You!
That's weird, I use Win 10 and python 2.7 and have had no issues. I would try reinstalling python on both windows systems then.
 

OCinzento

Member
Newcomer
Joined
Jul 2, 2016
Messages
6
Trophies
0
Age
33
XP
92
Country
Brazil
My friend said the same thing to me.
But I tried to reinstall and got the same thing. It works here only on winxp.

Enviado de meu Moto G (4) usando Tapatalk
 

TheCyberQuake

Certified Geek
OP
Member
Joined
Dec 2, 2014
Messages
5,012
Trophies
1
Age
28
Location
Las Vegas, Nevada
XP
4,433
Country
United States
New version of install.py.
This one cleans up code a bit more and adds a few safety checks to verify if the game install location exists, along with checking the SD to make sure the haxchi folder exists on root.
https://mega.nz/#!dMMxVTiR!MCCK_3KgARixs6y6XcmngXraeG8NkUxkLXkfDh5qQMY
Code:
import sys
import os
import wupclient

"""Define functions for repeated code + safety checks"""
def clear():
    os.system('cls' if os.name == 'nt' else 'clear')

def isdir(path):
    if path[0] != "/" and w.cwd[0] == "/":
        return isdir(w.cwd + "/" + path)
    fsa_handle = w.get_fsa_handle()
    ret, dir_handle = w.FSA_OpenDir(fsa_handle, path if path != None else w.cwd)
    if ret == 0:
        w.FSA_CloseDir(fsa_handle, dir_handle)
        return True
    else:
        return False

def askyesno():
    answer = raw_input("Are you sure?: " )
    if(answer.lower() == "y" or answer.lower() == "yes"):
        return True
    else:
        return False

"""Connect to wupserver"""
print("Connecting to wupserver")
w = wupclient.wupclient()
if(w.s == None):
    print("Failed to connect to wupserver!")
    sys.exit(1)
print("Connected!")
wupclient.w = w

"""Get low ID from user, assign to variable 'installid'"""
for retry in range(5):
    installid = raw_input("VC lower ID (last 8 chars): ")
    clear()
    print("You chose '" + installid + "'")
    if askyesno():
        break
    clear()
else:
    sys.exit(1)

"""Get location of game from user, assign to variable 'installLocation'"""
for retry in range(5):
    clear()
    installLocation = raw_input("VC Location (NAND, USB): ")
    if(installLocation.lower() == "nand"):
        clear()
        print("You selected 'NAND'")
        if askyesno():
            location = "mlc01"
            if isdir("/vol/storage_" + location + "/usr/title/00050000/" + installid):
                break
            else:
                clear()
                print("Error: Game directory does not exist on Wii U.")
                input("Make sure game ID and location are correct")
                sys.exit(1)
    elif(installLocation.lower() == "usb"):
        clear()
        print("You selected 'USB'")
        if askyesno():
            location = "usb01"
            if isdir("/vol/storage_" + location + "/usr/title/00050000/" + installid):
                break
            else:
                clear()
                print("Error: Game directory does not exist on Wii U.")
                input("Make sure game ID and location are correct")
                sys.exit(1)
    else:
        clear()
        print("'" + installLocation + "' is not a suitable answer")
else:
    sys.exit(1)

"""Mount SD in preparation for file transfers, check if /haxchi exists"""
print("Mounting SD")
ret = wupclient.mount_sd()
if(ret == 0):
    input("Failed to mount SD! Press enter to quit.")
    sys.exit(1)
else:
    if not isdir("/vol/storage_sdcard/haxchi"):
        clear()
        input("Haxchi folder does not exist on SD. Aborting.")
        sys.exit(1)

"""Transfer rom.zip from sd:/haxchi to Wii U"""
print("Mounted! Installing Haxchi from SD")
ret = w.cp("/vol/storage_sdcard/haxchi/rom.zip", "/vol/storage_" + location + "/usr/title/00050000/" + installid + "/content/0010/rom.zip")
if(ret == 0):
    print("Failed to install Haxchi! Press enter to quit.")
    sys.exit(1)

"""Transfer meta files from sd:/haxchi/meta to Wii U"""
print("Installing Meta files")
ret = w.cpdir("/vol/storage_sdcard/haxchi/meta", "/vol/storage_" + location + "/usr/title/00050000/" + installid + "/meta")
if(ret == 0):
    print("Failed to install Meta files!")
    print("Not crucial, haxchi will still run without these files")

"""Download meta.xml for modification later"""
print("Downloading meta.xml for modification")
ret = w.dl("/vol/storage_" + location + "/usr/title/00050000/" + installid + "/meta/meta.xml")
if(ret == 0):
    input("Download failed! Press enter to quit.")
    sys.exit(1)

"""Get user input for custom longname, assign to variable 'customname'"""
for retry in range(5):
    clear()
    customname = raw_input("Custom title name: ")
    clear()
    print("You typed '" + customname + "'")
    if askyesno():
        break
else:
    sys.exit(1)

"""Read each line from meta.xml, and write to meta.xml.tmp"""
"""Modify every longname to match variable 'customname'"""
print("Modifying meta.xml")
linecount = 0
f1 = open('meta.xml', 'r')
f2 = open('meta.xml.tmp', 'w')
for line in f1:
    linecount = linecount + 1
    if(72 <= linecount <= 77 or 79 <= linecount <= 82):
        customline = line[0:42] + customname + line[-15:]
        f2.write(customline)
    elif(linecount == 78 or linecount == 83):
        customline = line[0:43] + customname + line[-16:]
        f2.write(customline)
    else:
        f2.write(line)
f1.close()
f2.close()

"""Uploads the modified meta.xml.tmp to Wii U"""                  
print("Uploading modified meta.xml")
ret = w.up("meta.xml.tmp", "/vol/storage_" + location + "/usr/title/00050000/" + installid + "/meta/meta.xml")                 
if(ret == 0):
    input("Meta.xml upload failed! Press enter to quit.")
    sys.exit(1)

"""Attempts to upload config.txt, and if successful chmod it as well"""
print("Attempting to upload config.txt")
ret = w.cp("/vol/storage_sdcard/haxchi/config.txt", "/vol/storage_" + location + "/usr/title/00050000/" + installid + "/content/config.ini")
if(ret == 0):
    print("Config.txt upload failed, normal for older haxchi versions")
else:
    print("Applying chmod to config.txt")
    ret = w.chmod("/vol/storage_" + location + "/usr/title/00050000/" + installid + "/content/config.txt", 0x644)
    if(ret != 0):
        input("Install complete! Press enter to quit.")
    else:
        input("chmod failed! Press enter to quit.")

if(w.fsa_handle != None):
    w.close(w.fsa_handle)
    w.fsa_handle = None
if(w.s != None):
    w.s.close()
    w.s = None

Edit: I'll be updating OP in a bit for the new installer
 
Last edited by TheCyberQuake,

urherenow

Well-Known Member
Member
Joined
Mar 8, 2009
Messages
4,811
Trophies
2
Age
48
Location
Japan
XP
3,718
Country
United States
My friend said the same thing to me.
But I tried to reinstall and got the same thing. It works here only on winxp.

Enviado de meu Moto G (4) usando Tapatalk
Use fix94's stuff -> https://github.com/FIX94/haxchi

It's easy, setup for more games, and there is no point at all to any of the other modifications in this thread.

I use Win10 as well and have zero issues. If fix94's stuff gives you the same issue then it's not Win10; you're doing something wrong.
 
Last edited by urherenow,

TheCyberQuake

Certified Geek
OP
Member
Joined
Dec 2, 2014
Messages
5,012
Trophies
1
Age
28
Location
Las Vegas, Nevada
XP
4,433
Country
United States
Use fix94's stuff -> https://github.com/FIX94/haxchi

It's easy, setup for more games, and there is no point at all to any of the other modifications in this thread.

I use Win10 as well and have zero issues. If fix94's stuff gives you the same issue then it's not Win10; you're doing something wrong.
My custom versions of haxchi were made before fix94 even added cfwbooter to haxchi, let alone loading fw.img from places other than sd root. Though at this point I too don't really recommend them, I just have yet to fully update everything in OP to better explain everything
Secondly, the main creation from this thread now is the custom install.py script, which fix94 has not yet created one himself. I know there exists a "better" version that is more user friendly, but mine is different because it allows you to use any DS VC, meaning you could probably use this to inject DS roms into DS VC (haven't tested this myself though) and it will automatically support newer exploit games. Along with that it gives the user more customization over the existing script by allowing you to use any meta files. So the other one is for the noobier people who want everything to be done for them, and mine is more for people who want to modify it using their own files or files created by others
Multiple people including myself have had no issues on windows 10 using my scripts, and thus it is most likely something on the users end causing issues, and not the script itself.

--------------------- MERGED ---------------------------

Use fix94's stuff -> https://github.com/FIX94/haxchi

It's easy, setup for more games, and there is no point at all to any of the other modifications in this thread.

I use Win10 as well and have zero issues. If fix94's stuff gives you the same issue then it's not Win10; you're doing something wrong.
Plus you clearly don't understand the issue the user is having. Even if the user used fix94's stuff, if they use the same script it will be the same result. The problem is clearly with python (or my script), not any of the modified content I uploaded. So worst case there is a bug with my script, which I'm very doubtful of but wouldn't deny it if true.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Psionic Roshambo @ Psionic Roshambo: Lol