Skip to content

Instantly share code, notes, and snippets.

@iGlitch
Created February 25, 2017 16:08
Show Gist options
  • Save iGlitch/5a71cfe00deb695cacd0f6fd407ad88e to your computer and use it in GitHub Desktop.
Save iGlitch/5a71cfe00deb695cacd0f6fd407ad88e to your computer and use it in GitHub Desktop.
python script which will generate a title ticket given a title ID and a title key. Obviously the signature will be invalid, so you must install the title from within iosuhax.
import binascii
import sys
import os
if len(sys.argv) != 3:
print("usage: %s titleid titlekey" % sys.argv[0])
sys.exit()
f = open("title.tik", "wb")
if not f:
print("can't open outfile title.tik for writing" % sys.argv[0])
sys.exit()
f.write(b"\x00\x01\x00\x04")
f.write(os.urandom(0x100))
f.write(b"\x00" * 0x3C)
f.write(b"\x52\x6F\x6F\x74\x2D\x43\x41\x30\x30\x30\x30"+
b"\x30\x30\x30\x33\x2D\x58\x53\x30\x30\x30\x30"+
b"\x30\x30\x30\x63\x00\x00\x00\x00\x00\x00")
f.write(b"\x00" * 0x5C)
f.write(b"\x01\x00\x00")
f.write(binascii.unhexlify(sys.argv[2]))
f.write(b"\x00\x00\x05")
f.write(os.urandom(0x6))
f.write(b"\x00\x00\x00\x00")
f.write(binascii.unhexlify(sys.argv[1]))
f.write(b"\x00\x00\x00\x11\x00\x00\x00\x00\x00\x00\x00"+
b"\x00\x00\x00\x00\x05")
f.write(b"\x00" * 0xB0)
f.write(b"\x00\x01\x00\x14\x00\x00\x00\xAC\x00\x00\x00"+
b"\x14\x00\x01\x00\x14\x00\x00\x00\x00\x00\x00"+
b"\x00\x28\x00\x00\x00\x01\x00\x00\x00\x84\x00"+
b"\x00\x00\x84\x00\x03\x00\x00\x00\x00\x00\x00"+
b"\xFF\xFF\xFF\x01")
f.write(b"\x00" * 0x7C)
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment