Wii U - Python One Liners Thread

Discussion in 'Wii U - Hacking & Backup Loaders' started by Onion_Knight, Oct 18, 2015.

  1. Onion_Knight
    OP

    Onion_Knight GBAtemp Advanced Fan

    Member
    878
    832
    Feb 6, 2014
    I use these all the time, and i've posted them in various threads but I thought I'd just consolidate them and offer a place for others to toss their most useful one liners. All of mine are in Python and handle some of the more onerous tasks that I come across. Anyone can use these, you do not need to know how to program in the slightest. They must all be run in the directory where the files are located unless you want to specify their filepaths.

    Copying and Pasting Title Keys in to proper binary format can be tedious and you have to have a hex editor. Here's a python one-liner that makes it happen automagically:

    Make a disckey.bin for vgmtool or ckey for DiscU
    Code:
    python -c "import binascii; open('disckey.bin', 'wb').write(binascii.unhexlify('<insertyourkeyhere>'))"
    
    in between the delete everything from the < to the > and just copy/paste your key in!

    You downloaded a title from NUS and need a title.tik, but you only have the title key. This pads out the the file and inserts the key in the correct location for CDecrypt to read it.
    Code:
    python -c "import binascii; open('title.tik', 'wb').write(b'\0'*0x1bf + binascii.unhexlify('<insertyourkeyhere>'))"
    
    in between the delete everything from the < to the > and just copy/paste your key in!


    You downloaded a title from NUS but you need to remove the ".app" file extension from your files to properly decrypt
    Code:
    python -c "import os; [os.rename(file,file.split('.')[0]) for file in os.listdir('.') if '.app' in file]"
    
    You want to self host the html files but you don't want to try to set up a webserver, this works with the Dimok loadiine's elf loader.

    This depends on what Python version you've installed:
    Python 2:
    Code:
    python -m SimpleHTTPServer [optional port]
    
    the [optional port] is really actually optional if you put nothing there after the SimpleHTTPServer, it defaults to 8000
    so the URL you browse to is: http://<yourip>:8000

    Python 3:
    Code:
    python -m http.server [optional port]
    
    Once again the optional is really optional.


    I'll update this whenever I find myself writing a one liner consitently for something else. I use these all the time and I constantly see people asking how to do these things on a daily basis.
     
    Last edited by Onion_Knight, Oct 24, 2015
    CuriousTommy, vgmoose, eco95 and 9 others like this.
  2. dojafoja

    dojafoja life elevated

    Member
    454
    298
    Jan 2, 2014
    Thanks for all the info!
     
  3. ploggy

    ploggy WAKA! WAKA!

    Member
    1,482
    849
    Aug 29, 2007
    United Kingdom
    He's not the messiah, he's a very naughty boy :) (sorry folks couldn't resist.. and it's late)
     
  4. hippy dave

    hippy dave Butts Butts Megabutts

    Member
    2,572
    1,792
    Apr 30, 2012
    Cool thanks, didn't know how to make a title.tik
     
  5. AntonioMontana

    AntonioMontana Newbie

    Newcomer
    2
    0
    Jun 20, 2007
    Gambia, The
    Thanks for the tut

    but new here
    Need more help to create a title.tik

    i copy paste in python -c "import binascii; open('title.tik', 'wb').write(b'\0'*0x1bf + binascii.unhexlify('<DCB529E0E834BC86CF84B4D575ADA08C>'))"

    python say invalid Syntax

    Sorry for my bad english
     
  6. markehmus

    markehmus GBAtemp Advanced Fan

    Member
    943
    194
    Jul 26, 2008
    Canada
    in the GAME
    delete < to the > , including the <> then try maybe
    <> gives error is all ...
    TypeError: Non-hexadecimal digit found

    edit or i am wrong & maybe python isnt installed right or path is not set in Enviromental variable
     
    Last edited by markehmus, Feb 21, 2016
  7. Cyan

    Cyan GBATemp's lurking knight

    Global Moderator
    17,710
    8,318
    Oct 27, 2002
    France
    Engine room, learning
    <insertyourkeyhere> means you replace it with the ID.

    binascii.unhexlify('ABCDEF01234567896CF84B4D575ADA08C')