remove non-required stuff

This commit is contained in:
Christopher Roy Bratusek 2013-06-17 10:04:27 +02:00
parent e573cd1f2f
commit e99f1c2b8d
13 changed files with 0 additions and 308 deletions

View File

@ -1,95 +0,0 @@
import Wii, os, sys, shutil
def packbanner()
bannerbin = U8()
bannerbin['arc'] = None #dir
bannerbin['arc/blyt'] = None
bannerbin['arc/anim'] = None
bannerbin['arc/timg'] = None
# then do
origdir = os.getcwd()
for files in os.walk(origdir + 'arc/timg/')
bannerbin['arc/timg/' + file] = open(file, "rb").read()
for files in os.walk(origdir + 'arc/anim/')
bannerbin['arc/anim/' + file] = open(file, "rb").read()
for files in os.walk(origdir + 'arc/blyt/')
bannerbin['arc/blyt/' + file] = open(file, "rb").read()
fn = open("banner.bin", "w+b")
fn.write(u8object.dumpFile())
fn.close()
def doPack():
exchange = [sys.argv[2], sys.argv[3], sys.argv[4]]
global banneru8, iconu8
print "Unpacking WAD..."
wad = wii.WAD.loadFile("squid.wad")
title = wii.IMET(wad[0]).getTitle()
print "Unpacking 00000000.app..."
wad[0] = wii.IMET(wad[0]).remove()
meta = wii.U8.load(wad[0])
prog = 20
for i, item in enumerate(exchange):
if(item == ""): #skip what doesn't get changed
continue
if(i == 0):
bin = "banner"
print "Replacing banner.bin..."
elif(i == 1):
bin = "icon"
print "Replacing icon.bin..."
else:
bin = "sound"
print "Replacing sound.bin..."
if(item[len(item) - 3:] == "app" or item[len(item) - 3:] == "bnr" or item[len(item - 3):] == "wad"):
if(item[len(item) - 3:] == "wad"):
wad2 = wii.WAD.loadFile(item)
wad2[0] = wii.IMET(wad2[0]).remove()
meta2 = wii.U8.load(wad2[0])
else:
meta2 = wii.IMET.loadFile(item).remove()
bin2 = meta2['meta/%s.bin' % bin]
elif(item[len(item) - 3:] == "bin"):
bin2 = wii.U8.loadFile(item)
else:
continue #only bin, wad, bnr and app are supported
meta['arc/%s.bin' % bin] = bin2.dump()
print "Unpacking banner.bin..."
meta['meta/banner.bin'] = wii.IMD5(meta['meta/banner.bin']).remove()
meta['meta/banner.bin'] = wii.LZ77(meta['meta/banner.bin']).remove()
banneru8 = wii.U8.load(meta['meta/banner.bin'])
print "Unpacking icon.bin..."
meta['meta/icon.bin'] = wii.IMD5(meta['meta/icon.bin']).remove()
meta['meta/icon.bin'] = wii.LZ77(meta['meta/icon.bin']).remove()
iconu8 = wii.U8.load(meta['meta/icon.bin'])
print "Packing banner.bin..."
meta['meta/banner.bin'] = banneru8.dump()
meta['meta/banner.bin'] = wii.IMD5(meta['meta/banner.bin']).add()
print "Packing icon.bin..."
meta['meta/icon.bin'] = iconu8.dump()
meta['meta/icon.bin'] = wii.IMD5(meta['meta/icon.bin']).add()
print "Packing 00000000.app..."
#meta['meta/sound.bin'] = open('wadunpack/00000000_app_out/meta/sound.bin', 'rb').read()
langs = []
wad[0] = meta.dump()
wad[0] = wii.IMET(wad[0]).add(len(meta['meta/icon.bin']), len(meta['meta/banner.bin']), len(meta['meta/sound.bin']), title, langs)
print "Packing WAD..."
wad.dumpFile("squid.wad")
packbanner()
doPack()

View File

@ -1,30 +0,0 @@
from disc import *
from title import *
from Struct import Struct
import os
def fakesignPartition(self, iso, index)
iso = WOD(iso)
iso.openPartition(index)
fstBuf = iso.getFst() "
fn = open(os.getcwd() + "/" + iso.discHdr.discId + iso.discHdr.gameCode + iso.discHdr.region + "/" + "PART" + index + "/" + 'appldr.bin', 'w+b')
fn.write(iso.getPartitionApploader()) #saved to cwd/GAMEID/PARTITION/file
fn.close()
fn = open(os.getcwd() + "/" + iso.discHdr.discId + iso.discHdr.gameCode + iso.discHdr.region + "/" + "PART" + index + "/" + 'h3.bin', 'w+b')
fn.write(iso.getPartitionH3Table())
fn.close()
fn = open(os.getcwd() + "/" + iso.discHdr.discId + iso.discHdr.gameCode + iso.discHdr.region + "/" + "PART" + index + "/" + 'main.dol', 'w+b')
fn.write(iso.getPartitionMainDol())
fn.close()
fn = open(os.getcwd() + "/" + iso.discHdr.discId + iso.discHdr.gameCode + iso.discHdr.region + "/" + "PART" + index + "/" + 'fst.bin', 'w+b')
fn.write(fstBuf)
fn.close()
fileNumber = struct.unpack(">I", fstBuf[0x8:0xc])[0]
fileObject = iso.fstObject("", iso)
iso.parseFst(fstBuf, fstBuf[12 * fileNumber:], 0, fileObject)
fileObject.write(os.getcwd() + "/" + iso.discHdr.discId + iso.discHdr.gameCode + iso.discHdr.region + "/" + "PART" + index + "/")
fileObject.close()
isoTik = Ticket(iso.getPartitionTik())
isoTik.dump(os.getcwd() + "/" + iso.discHdr.discId + iso.discHdr.gameCode + iso.discHdr.region + "/" + "PART" + index + "/" + "tik")
isoTMD = TMD(iso.getPartitionTmd())
isoTMD.dump(os.getcwd() + "/" + iso.discHdr.discId + iso.discHdr.gameCode + iso.discHdr.region + "/" + "PART" + index + "/" + "tmd")

View File

@ -1,5 +0,0 @@
import Wii
import sys
for elem in sys.argv:
Wii.IMD5(elem).add(elem)

View File

@ -1,26 +0,0 @@
import os, Wii
print 'Enter the sysmenu version you want then just wait...'
version = int(input()) #97
#Wii.NUS(0x0000000100000002, version).download('0000000100000002ver' + str(version))
os.chdir('0000000100000002ver' + str(version))
print 'Tmd dump :\n'
print '%s' % Wii.TMD().loadFile('tmd')
print 'Now unpacking all the archives in there :3\n'
for root, dirs, files in os.walk(os.getcwd()):
for name in files:
print '%s' % name
location = os.getcwd() + '/' + str(name)
if name == '00000000.app':
print 'IMET Title : %s' % Wii.IMET(name).getTitle()
if open(location).read(4) == '\x55\xaa\x38\x2d':
print 'Now unpacking the u8 archive %s' % location
try:
Wii.U8().loadFile(location)
except:
print "fix the U8 code!"
if open(location).read(4) == '\x43\x43\x46\x00':
print 'Now unpacking the CCF archive %s' % location
Wii.CCF(location).decompress()

View File

@ -1,10 +0,0 @@
import os
from U8 import *
from title import WAD
sysmenuWad = WAD('/home/giuseppe/Scrivania/RVL-WiiSystemmenu-v258.wad')
sysmenuWad.unpack('/home/giuseppe/Scrivania/sysdump')
for file in os.listdir('/home/giuseppe/Scrivania/sysdump'):
if open('/home/giuseppe/Scrivania/sysdump/' + file).read(4) == '\x55\xaa\x38\x2d':
U8('/home/giuseppe/Scrivania/sysdump/' + file).unpack('/home/giuseppe/Scrivania/sysdump/' + file + '_decompressed/')

View File

@ -1,25 +0,0 @@
from disc import *
from title import *
from Struct import Struct
import os
iso = WOD('/enter/other/wii/SUPER_MARIO_GALAXY.iso')
iso.openPartition(1)
#print '%s' % iso
#iso.decryptAll()
#open('appldr.bin', 'w+b').write(iso.getPartitionApploader())
fstBuf = iso.getFst()
open('fst.bin', 'w+b').write(fstBuf)
fileNumber = struct.unpack(">I", fstBuf[0x8:0xc])[0]
fileObject = iso.fstObject("", iso)
iso.parseFst(fstBuf, fstBuf[12 * fileNumber:], 0, fileObject)
print fileObject.getList()
fileObject.write(os.getcwd() + "/" + iso.discHdr.discId + iso.discHdr.gameCode + iso.discHdr.region)
#open('h3.bin', 'w+b').write(iso.getPartitionH3Table())
#isoTik = Ticket('tik.bin')
#print '%s' % isoTik
#open('main.dol', 'w+b').write(iso.getPartitionMainDol())
#isoTmd = TMD(iso.getPartitionTmd())
#print isoTmd

View File

@ -1,9 +0,0 @@
from formats import locDat
sdLoc = locDat('/home/giuseppe/Scrivania/sysmenu/loc.dat')
print '%s' % sdLoc
#concorsiMii = sdLoc.getTitle(0, 0, 0)
sdLoc.delTitle(0, 0, 0)

View File

@ -1,9 +0,0 @@
from savedata import *
save = Savegame('/home/giuseppe/Scrivania/data' + str(4) + '.bin')
save.analyzeHeader()
print '%s' % save
save.getBanner()
for i in range(save.getIconsCount()):
save.getIcon(i)
save.extractFiles()

View File

@ -1,51 +0,0 @@
#----------------------------------------------------------------------
# NUS Tool - 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 os, sys, Wii, shutil
if len(sys.argv) < 3:
print "Usage: python %s -(d/p) titleid version [decrypt/fakesign](True/False) [download/pack](dirname/filename)" % sys.argv[0]
sys.exit()
print sys.argv
titleid = int(sys.argv[2], 16)
print titleid
ver = int(sys.argv[3])
print type(ver)
print ver
if not (sys.argv[4]) and sys.argv[1] == "-d" :
decrypt = False
else:
decrypt = True
if len(sys.argv) < 6:
tmp = "tmp"
else:
tmp = sys.argv[5]
#downloading
print "Downloading..."
if(ver != 0):
Wii.NUS(titleid, ver).download(tmp, decrypt = decrypt)
else:
Wii.NUS(titleid).download(tmp, decrypt = decrypt)
print "Done downloading!"
#wadpacking
if sys.argv[1] == "-p":
print "packing"
if len(sys.argv[5]) != 0:
wadfile = str(sys.argv[5]) + ".wad"
else:
wadfile = str(titleid) + "ver" + str(ver) + ".wad"
Wii.WAD.loadDir(tmp).dumpFile(wadfile, fakesign = sys.argv[4])
if(os.path.isdir(tmp)): #cleanup
shutil.rmtree(tmp)
print"Done packing the WAD!"
print "Everything is done!\nHave a nice day. :3"
sys.exit()

View File

@ -1,21 +0,0 @@
#----------------------------------------------------------------------
# WADd - a simple command line tool for packing and unpacking wads.
# (c) 2009 |Omega and #HACKERCHANNEL Productions.
#
# Wii.py (c) Xuzz, SquidMan, megazig, TheLemonMan, |Omega, and Matt_P.
#----------------------------------------------------------------------
import Wii, sys, os
if(len(sys.argv) < 2):
print "Usage: python wads.py <input> <output> ..."
sys.exit(0)
for i in range(1, len(sys.argv), 2):
if(os.isdir(sys.argv[i]):
elem = sys.argv[i]
elem2 = sys.argv[i + 1]
Wii.WAD.loadDir(elem).dumpFile(elem2)
else:
elem = sys.argv[i]
elem2 = sys.argv[i + 1]
Wii.WAD.loadFile(elem).dumpDir(elem2)

View File

@ -1,27 +0,0 @@
#----------------------------------------------------------------------
# Copyright (C) 2009 zc00gii
#
# Wii.py (c) Xuzz, SquidMan, megazig, TheLemonMan, |Omega, and Matt_P.
#----------------------------------------------------------------------
import os, sys, Wii
def wadpack(waddir, wadfile):
Wii.WAD.loadDir(waddir).dumpFile(wadfile)
print "WAD packed successfully"
def wadunpack(wadfile,waddir):
Wii.WAD.loadFile(wadfile).dumpDir(waddir)
print "WAD unpacked successfully"
if(len(sys.argv) < 4):
print "Usage: python wadtool.py [option] <input> <output>\nOptions:\n-u, --unpack Unpack your desired WAD file\n-p, --pack Pack your desired WAD file"
sys.exit(0)
doPackOrUnpack = sys.argv[1]
inputWad = sys.argv[2]
outputWad = sys.argv[3]
if doPackOrUnpack in ('-u','--unpack'):
wadunpack(inputWad, outputWad)
if doPackOrUnpack in ('-p','--pack'):
wadpack(inputWad, outputWad)