forked from grp/Wii.py
-
Notifications
You must be signed in to change notification settings - Fork 1
/
NUStool.py
28 lines (24 loc) · 870 Bytes
/
NUStool.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#----------------------------------------------------------------------
# NUS - a simple command line tool for NUS downloading.
# (c) 2009 |Omega| and #HACKERCHANNEL Productions.
#
# Wii.py (c) Xuzz, SquidMan, megazig, TheLemonMan, |Omega|, and Matt_P.
#----------------------------------------------------------------------
import Wii, sys, os, shutil
def downloadPack(titleid, version, outDir, pack):
if version != 0:
Wii.NUS.download(titleid, version).dumpDir(outDir)
else:
Wii.NUS.download(titleid).dumpDir(outDir)
if pack == True:
Wii.WAD.loadDir(outDir).dumpFile(str(outDir+".wad"))
shutil.rmtree(outDir)
if len(sys.argv) % 3 == 2:
pack, x = False, 1
else:
pack, x = True, 0
for i in range(1 + x, len(sys.argv), 3):
titleid = int(sys.argv[i], 16)
version = int(sys.argv[i+1])
outDir = sys.argv[i+2]
downloadPack(titleid, version, outDir, pack)