Hacking [RELEASE] - DiscDump.py Python Disc Dumper

TheCyberQuake

Certified Geek
OP
Member
Joined
Dec 2, 2014
Messages
5,012
Trophies
1
Age
28
Location
Las Vegas, Nevada
XP
4,432
Country
United States
I got bored and decided to write a basic python script that will create a 1:1 decrypted ("loadiine-ready") game dump to the SD card. It will automatically find the titleID of the game, create a the folder /gamedumps/*titleID*, and then dump the disc's code, content and meta folders there.

The main use I can see wit this it to dump disc-only games that can't be downloaded from NUS, repack them with NUSPacker and then install them to redNAND/sigpatched sysNAND. I've seen many people have issues trying to do this with current "loadiine-ready" dumps because they were made with DDD which will not give a 1:1 dump of the game.

I believe this is currently the fastest way to dump a game as it dumps straight to SD, unlike DDD which would dump over the network to a computer.

All you need is wupclient.py in the same folder and have it modified it to have your Wii U's IP address. Then just run any fw.img to load wupserver on the Wii U and then run DiscDump.py

Also I won't say I'm a perfect programmer, so if you see anything in my script I can improve or change feel free to let me know!

https://mega.nz/#!4QVxRTBK!Dk8aGwF2n5yUielabiuSvpBU6hrqnw8z-Rwu0udhVAI

Code:
import wupclient

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

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

"""Mount SD card for dumping"""
print("Mounting SD")
ret = wupclient.mount_sd()
if(ret == 0):
    input("Failed to mount SD! Press enter to quit.")
    sys.exit(1)

"""Mount optical disc content for dumping"""   
print("Mounted! Mounting optical disc content")
ret = wupclient.mount_odd_content()
if(ret == 0):
    input("Failed to mount optical disc! Press enter to quit.")
    sys.exit(1)

"""Download meta.xml from disc to pull title ID"""
print("Downloading meta.xml to obtain title ID")
ret = w.dl("/vol/storage_odd_content/meta/meta.xml")
if(ret == 0):
    input("Failed to download meta.xml! Press enter to quit.")
    sys.exit(1)

"""Grab title ID from downloaded meta.xml"""
print("Grabbing title ID from meta.xml")
import xml.etree.ElementTree as ET
tree = ET.parse("meta.xml")
root = tree.getroot()
for child in root:
    if(child.tag.startswith("title_id")):
        titleID = child.text

"""Make directories on SD to dump to"""
print("Creating directories on SD to dump to")
if isdir("/vol/storage_sdcard/gamedumps"):
    if not(isdir("/vol/storage_sdcard/gamedumps/" + titleID)):
        ret = w.mkdir("/vol/storage_sdcard/gamedumps/" + titleID, 0x600)
        if(ret != 0):
            print("Failed to make directory on SD to dump to.")
            input("Press enter to quit.")
            sys.exit(1)
else:
    ret = w.mkdir("/vol/storage_sdcard/gamedumps", 0x600)
    if(ret != 0):
        print("Failed to make directory on SD to dump to.")
        input("Press enter to quit.")
        sys.exit(1)
    else:
        ret = w.mkdir("/vol/storage_sdcard/gamedumps/" + titleID, 0x600)
        if(ret != 0):
            print("Failed to make directory on SD to dump to.")
            input("Press enter to quit.")
            sys.exit(1)

"""Use cpdir() to dump disc contents to SD"""
print("Dumping decrypted disc contents")
ret = w.cpdir("/vol/storage_odd_content", "/vol/storage_sdcard/gamedumps/" + titleID)
if(ret == 0):
    input("Game dump failed! Press enter to quit")
    sys.exit(1)
else:
    print("Game dump compete!")
    input("Press enter to exit.")
 
Last edited by TheCyberQuake,

zeldaism

Well-Known Member
Member
Joined
Apr 19, 2016
Messages
844
Trophies
0
Age
26
XP
1,350
Country
United States
I got bored and decided to write a basic python script that will create a 1:1 decrypted ("loadiine-ready") game dump to the SD card. It will automatically find the titleID of the game, create a the folder /gamedumps/*titleID*, and then dump the disc's code, content and meta folders there.

The main use I can see wit this it to dump disc-only games that can't be downloaded from NUS, repack them with NUSPacker and then install them to redNAND/sigpatched sysNAND. I've seen many people have issues trying to do this with current "loadiine-ready" dumps because they were made with DDD which will not give a 1:1 dump of the game.

I believe this is currently the fastest way to dump a game as it dumps straight to SD, unlike DDD which would dump over the network to a computer.

All you need is wupclient.py in the same folder and have it modified it to have your Wii U's IP address. Then just run any fw.img to load wupserver on the Wii U and then run DiscDump.py

Also I won't say I'm a perfect programmer, so if you see anything in my script I can improve or change feel free to let me know!

https://mega.nz/#!4QVxRTBK!Dk8aGwF2n5yUielabiuSvpBU6hrqnw8z-Rwu0udhVAI

Code:
import wupclient

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

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

"""Mount SD card for dumping"""
print("Mounting SD")
ret = wupclient.mount_sd()
if(ret == 0):
    input("Failed to mount SD! Press enter to quit.")
    sys.exit(1)

"""Mount optical disc content for dumping"""  
print("Mounted! Mounting optical disc content")
ret = wupclient.mount_odd_content()
if(ret == 0):
    input("Failed to mount optical disc! Press enter to quit.")
    sys.exit(1)

"""Download meta.xml from disc to pull title ID"""
print("Downloading meta.xml to obtain title ID")
ret = w.dl("/vol/storage_odd_content/meta/meta.xml")
if(ret == 0):
    input("Failed to download meta.xml! Press enter to quit.")
    sys.exit(1)

"""Grab title ID from downloaded meta.xml"""
print("Grabbing title ID from meta.xml")
import xml.etree.ElementTree as ET
tree = ET.parse("meta.xml")
root = tree.getroot()
for child in root:
    if(child.tag.startswith("title_id")):
        titleID = child.text

"""Make directories on SD to dump to"""
print("Creating directories on SD to dump to")
if isdir("/vol/storage_sdcard/gamedumps"):
    if not(isdir("/vol/storage_sdcard/gamedumps/" + titleID)):
        ret = w.mkdir("/vol/storage_sdcard/gamedumps/" + titleID, 0x600)
        if(ret != 0):
            print("Failed to make directory on SD to dump to.")
            input("Press enter to quit.")
            sys.exit(1)
else:
    ret = w.mkdir("/vol/storage_sdcard/gamedumps", 0x600)
    if(ret != 0):
        print("Failed to make directory on SD to dump to.")
        input("Press enter to quit.")
        sys.exit(1)
    else:
        ret = w.mkdir("/vol/storage_sdcard/gamedumps/" + titleID, 0x600)
        if(ret != 0):
            print("Failed to make directory on SD to dump to.")
            input("Press enter to quit.")
            sys.exit(1)

"""Use cpdir() to dump disc contents to SD"""
print("Dumping decrypted disc contents")
ret = w.cpdir("/vol/storage_odd_content", "/vol/storage_sdcard/gamedumps/" + titleID)
if(ret == 0):
    input("Game dump failed! Press enter to quit")
    sys.exit(1)
else:
    print("Game dump compete!")
    input("Press enter to exit.")
Thank you for this amazing script. Will try it out when I get home.
 

TheCyberQuake

Certified Geek
OP
Member
Joined
Dec 2, 2014
Messages
5,012
Trophies
1
Age
28
Location
Las Vegas, Nevada
XP
4,432
Country
United States
im going to make it download a game from the wiiu to the sd card
A couple simple modifications could probably make it dump any title, though I haven't looked into how game files are stored on Wii U when installed.

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

Holy crap, thanks :3

Amazed that this wasn't already a thing, but to do it "since you were bored"..........sweeeeeeeeeeeet.
When I get bored I poke around and test wupserver commands to see if I can do anything cool with it. I found several days ago you could copy files directly to/from the SD/Wii U. I've also looked at python scripts by other users to learn how to do useful things with python (like pulling titleID from meta.xml)
 

pietempgba

Well-Known Member
Member
Joined
Jun 9, 2016
Messages
1,049
Trophies
0
XP
1,515
Country
United States
I have a file directory structure here you go

the x's are the last 8 letters and numbers of the title id
Code:
\storage_mlc\sys\title\00050010\XXXXXXXX
\storage_mlc\sys\title\0005001b\XXXXXXXX
\storage_mlc\sys\title\00050030\XXXXXXXX


\storage_mlc\usr\title\00050000\XXXXXXXX
\storage_mlc\usr\title\0005000c\XXXXXXXX
\storage_mlc\usr\title\0005000e\XXXXXXXX


\storage_usb\usr\title\00050000\XXXXXXXX
\storage_usb\usr\title\0005000c\XXXXXXXX
\storage_usb\usr\title\0005000e\XXXXXXXX
 
Last edited by pietempgba,

TheCyberQuake

Certified Geek
OP
Member
Joined
Dec 2, 2014
Messages
5,012
Trophies
1
Age
28
Location
Las Vegas, Nevada
XP
4,432
Country
United States
I have a file directory structure here you go

the x's are the last 8 letters of the title id
Code:
\storage_mlc\sys\title\00050010\XXXXXXXX
\storage_mlc\sys\title\0005001b\XXXXXXXX
\storage_mlc\sys\title\00050030\XXXXXXXX


\storage_mlc\usr\title\00050000\XXXXXXXX
\storage_mlc\usr\title\0005000c\XXXXXXXX
\storage_mlc\usr\title\0005000e\XXXXXXXX


\storage_usb\usr\title\00050000\XXXXXXXX
\storage_usb\usr\title\0005000c\XXXXXXXX
\storage_usb\usr\title\0005000e\XXXXXXXX
I can probably write all the code to do it right now, but I can't test it right now as I'm currently dumping Star Fox Zero as a test of the script in OP.
Do you know what the differences are with the first part of the title ID (0005xxxx)?
 

pietempgba

Well-Known Member
Member
Joined
Jun 9, 2016
Messages
1,049
Trophies
0
XP
1,515
Country
United States
yeah
00050000 are for the games themselves
0005000c is eShop title dlc
0005000e are updates for games

totally random question below

how do i become at least a certified geek do i just post alot?
 
Last edited by pietempgba,

TheCyberQuake

Certified Geek
OP
Member
Joined
Dec 2, 2014
Messages
5,012
Trophies
1
Age
28
Location
Las Vegas, Nevada
XP
4,432
Country
United States
yeah
00050000 are for the games themselves
0005000c is eShop title dlc
0005000e are updates for games

totally random question below

how do i become at least a certified geek do i just post alot?
Nah, that's just a custom title I gave myself. You can make your title say anything you want by editing your custom title from the personal details page:
http://gbatemp.net/account/personal-details
 

yahoo

G͝B͢A͜t͞em҉p̡ R̨e͢g̷ul̨aŗ
Member
Joined
Aug 4, 2014
Messages
345
Trophies
0
XP
522
Country
United States
A couple simple modifications could probably make it dump any title, though I haven't looked into how game files are stored on Wii U when installed.

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


When I get bored I poke around and test wupserver commands to see if I can do anything cool with it. I found several days ago you could copy files directly to/from the SD/Wii U. I've also looked at python scripts by other users to learn how to do useful things with python (like pulling titleID from meta.xml)
Have any idea how to dump the encrypted contents of the disc so it's directly installable with wupinstaller with the the signed ticket from the disc?
 

TheCyberQuake

Certified Geek
OP
Member
Joined
Dec 2, 2014
Messages
5,012
Trophies
1
Age
28
Location
Las Vegas, Nevada
XP
4,432
Country
United States
then how do i become a gbatemp maniac i mean
Post count of 1,000 I believe, but don't just post a bunch of nonsense to get that status. Just give it time of being an active member of the forums and you'll get there.

Anyway, going back on topic I'm still duming star fox zero, which had a ton of small files. I may have to let it go overnight if it doesn't finish in the next two hours. But I must make sure I can get a full dump.

Also to note, you can also use the command mount_odd_update(), which seems to have update files. Unsure if this is updates for the game, or system updates baked into the disc, or maybe both. I'll have to look into it later to see what it comes up with. It seems to dump encrypted files (.app), but I didn't let it finish to see what I would get. Maybe tomorrow.

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

Have any idea how to dump the encrypted contents of the disc so it's directly installable with wupinstaller with the the signed ticket from the disc?
At this point there is no way to dump encrypted content from a disc. To dump WUD you need a hardmod afaik.
But we do have signature patches at this point, so you could use NUSpacker to encrypted the unencrypted files and then install to redNAND or sysNAND with signature patches.
 

pietempgba

Well-Known Member
Member
Joined
Jun 9, 2016
Messages
1,049
Trophies
0
XP
1,515
Country
United States
the brazillian method is using tickets from discs to install stuff
exactly so you use utikdownloader with the title.tik or with that title site
the ticket can download encrypted files
 

TheCyberQuake

Certified Geek
OP
Member
Joined
Dec 2, 2014
Messages
5,012
Trophies
1
Age
28
Location
Las Vegas, Nevada
XP
4,432
Country
United States
the brazillian method is using tickets from discs to install stuff
Yes, but that method also involves downloading the install files from NUS, which are encrypted files. You can't use just the ticket, you also need the actual install files, which are encrypted. This dumps decrypted files, and thus need to be re-enrypted with NUSpacker

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

the ticket can download encrypted files
That only works for games that are both disc and eShop. For disc only you can't get them from NUS
 

pietempgba

Well-Known Member
Member
Joined
Jun 9, 2016
Messages
1,049
Trophies
0
XP
1,515
Country
United States
im pretty sure i know what im talking about you can use title.tik to download encrypted files
edit: oh ok sorry for the argument

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

ohh so you can get the long lost luigi u that is only a few gb instead of 15 like nsmbu + nslu
 

wicksand420

Well-Known Member
Member
Joined
Nov 13, 2016
Messages
2,787
Trophies
1
Age
39
XP
2,295
Country
United States
Hi TheCyberQuake, Nice py. I was wondering if you looked up ft2sd? It's a homebrew application that dumps tik, disc content, and odds and also a lot of other interesting things to SD. You don't need to be connected to a server either so no worry of connection issues. Happy Hacking!
 
Last edited by wicksand420,
  • Like
Reactions: Conn0r

TheCyberQuake

Certified Geek
OP
Member
Joined
Dec 2, 2014
Messages
5,012
Trophies
1
Age
28
Location
Las Vegas, Nevada
XP
4,432
Country
United States
Hi TheCyberQuake, Nice py. I was wondering if you looked up ft2sd? It's a homebrew application that dumps tik, disc content, and odds and also a lot of other interesting things to SD. You don't need to be connected to a server either so no worry of connection issues. Happy Hacking!
I saw it, but make is giving me issues for some reason so I need to look into it later.

Sent from my SM-G386T using Tapatalk
 

wicksand420

Well-Known Member
Member
Joined
Nov 13, 2016
Messages
2,787
Trophies
1
Age
39
XP
2,295
Country
United States
I saw it, but make is giving me issues for some reason so I need to look into it later.

Sent from my SM-G386T using Tapatalk
I wanted to try out your app but Skylanders is taking forever to dump, I've been at it for 16 hours and its not done with the nfc figure data yet. It hasn't even gotten to the game data yet. Hopefully starfox isn't taking you this long.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    K3Nv2 @ K3Nv2: https://youtu.be/MddR6PTmGKg?si=mU2EO5hoE7XXSbSr