Hacking [RELEASE] - DiscDump.py Python Disc Dumper

  • Thread starter Thread starter TheCyberQuake
  • Start date Start date
  • Views Views 6,255
  • Replies Replies 39
  • Likes Likes 13

TheCyberQuake

Certified Geek
Member
Joined
Dec 2, 2014
Messages
5,026
Reaction score
3,837
Trophies
2
Age
30
Location
Las Vegas, Nevada
XP
4,511
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,
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.
 
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)
 
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 Mustacheboyo,
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)?
 
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 Mustacheboyo,
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
 
then how do i become a gbatemp maniac i mean

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

i changed my title
 
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?
 
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.
 
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?
im pretty sure the signed ticket is in storage_odd_tickets
 
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
 
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
 
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
 
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
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
 
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