improved TMD Viewer

This commit is contained in:
Christopher Roy Bratusek 2012-08-22 22:29:02 +02:00
parent 5c43ac70b6
commit 66a1f877a6
5 changed files with 116 additions and 100 deletions

View File

@ -8,6 +8,11 @@
* separate combobox for choosing channels, system-menu in downloader
as of now, region-code must be changed manually (instructions given)
* changed order of tabs, downloader is now default tab
* improved TMD Viewer
- display title ID as ascii
- display reserved
- display required IOS (properly)
- use QLabel instead of QLineEdit
-- 0.3 --
* Updated some porject's files which still referenced wii signer

View File

@ -60,32 +60,28 @@ class Ui_Qwad(object):
self.label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label.setObjectName("label")
self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
self.TitleID = QtGui.QLineEdit(self.widget)
self.TitleID.setReadOnly(True)
self.TitleID = QtGui.QLabel(self.widget)
self.TitleID.setObjectName("TitleID")
self.gridLayout.addWidget(self.TitleID, 0, 1, 1, 1)
self.label_9 = QtGui.QLabel(self.widget)
self.label_9.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_9.setObjectName("label_9")
self.gridLayout.addWidget(self.label_9, 0, 2, 1, 2)
self.idASCII = QtGui.QLineEdit(self.widget)
self.idASCII.setReadOnly(True)
self.idASCII = QtGui.QLabel(self.widget)
self.idASCII.setObjectName("idASCII")
self.gridLayout.addWidget(self.idASCII, 0, 4, 1, 1)
self.label_3 = QtGui.QLabel(self.widget)
self.label_3.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_3.setObjectName("label_3")
self.gridLayout.addWidget(self.label_3, 1, 0, 1, 1)
self.Version = QtGui.QLineEdit(self.widget)
self.Version.setReadOnly(True)
self.Version = QtGui.QLabel(self.widget)
self.Version.setObjectName("Version")
self.gridLayout.addWidget(self.Version, 1, 1, 1, 1)
self.label_5 = QtGui.QLabel(self.widget)
self.label_5.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_5.setObjectName("label_5")
self.gridLayout.addWidget(self.label_5, 1, 3, 1, 1)
self.TitleType = QtGui.QLineEdit(self.widget)
self.TitleType.setReadOnly(True)
self.TitleType = QtGui.QLabel(self.widget)
self.TitleType.setObjectName("TitleType")
self.gridLayout.addWidget(self.TitleType, 1, 4, 1, 1)
self.label_2 = QtGui.QLabel(self.widget)
@ -96,35 +92,38 @@ class Ui_Qwad(object):
self.label_6.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_6.setObjectName("label_6")
self.gridLayout.addWidget(self.label_6, 2, 3, 1, 1)
self.GroupID = QtGui.QLineEdit(self.widget)
self.GroupID.setReadOnly(True)
self.GroupID = QtGui.QLabel(self.widget)
self.GroupID.setObjectName("GroupID")
self.gridLayout.addWidget(self.GroupID, 2, 4, 1, 1)
self.label_4 = QtGui.QLabel(self.widget)
self.label_4.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_4.setObjectName("label_4")
self.gridLayout.addWidget(self.label_4, 3, 0, 1, 1)
self.BootIndex = QtGui.QLineEdit(self.widget)
self.BootIndex.setReadOnly(True)
self.BootIndex = QtGui.QLabel(self.widget)
self.BootIndex.setObjectName("BootIndex")
self.gridLayout.addWidget(self.BootIndex, 3, 1, 1, 1)
self.label_7 = QtGui.QLabel(self.widget)
self.label_7.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_7.setObjectName("label_7")
self.gridLayout.addWidget(self.label_7, 3, 3, 1, 1)
self.AccessRights = QtGui.QLineEdit(self.widget)
self.AccessRights.setReadOnly(True)
self.AccessRights = QtGui.QLabel(self.widget)
self.AccessRights.setObjectName("AccessRights")
self.gridLayout.addWidget(self.AccessRights, 3, 4, 1, 1)
self.label_8 = QtGui.QLabel(self.widget)
self.label_8.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_8.setObjectName("label_8")
self.gridLayout.addWidget(self.label_8, 4, 0, 1, 1)
self.Contents = QtGui.QLineEdit(self.widget)
self.Contents.setReadOnly(True)
self.Contents = QtGui.QLabel(self.widget)
self.Contents.setObjectName("Contents")
self.gridLayout.addWidget(self.Contents, 4, 1, 1, 1)
self.IOSversion = QtGui.QComboBox(self.widget)
self.label_10 = QtGui.QLabel(self.widget)
self.label_10.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_10.setObjectName("label_10")
self.gridLayout.addWidget(self.label_10, 4, 3, 1, 1)
self.Reserved = QtGui.QLabel(self.widget)
self.Reserved.setObjectName("Reserved")
self.gridLayout.addWidget(self.Reserved, 4, 4, 1, 1)
self.IOSversion = QtGui.QLabel(self.widget)
self.IOSversion.setObjectName("IOSversion")
self.gridLayout.addWidget(self.IOSversion, 2, 1, 1, 1)
self.packtab = QtGui.QWidget()
@ -240,17 +239,16 @@ class Ui_Qwad(object):
self.tabWidget.setTabText(self.tabWidget.indexOf(self.unpacktab), QtGui.QApplication.translate("Qwad", "Unpack WAD", None, QtGui.QApplication.UnicodeUTF8))
self.TMDfilebutton.setToolTip(QtGui.QApplication.translate("Qwad", "Ruta hacia el archivo WAD que quieres desempaquetar", None, QtGui.QApplication.UnicodeUTF8))
self.TMDfilebutton.setText(QtGui.QApplication.translate("Qwad", "TMD file", None, QtGui.QApplication.UnicodeUTF8))
self.label.setText(QtGui.QApplication.translate("Qwad", "Title ID", None, QtGui.QApplication.UnicodeUTF8))
self.TitleID.setText(QtGui.QApplication.translate("Qwad", "0000000000000000", None, QtGui.QApplication.UnicodeUTF8))
self.label_9.setText(QtGui.QApplication.translate("Qwad", "ID (ascii)", None, QtGui.QApplication.UnicodeUTF8))
self.label_3.setText(QtGui.QApplication.translate("Qwad", "Version", None, QtGui.QApplication.UnicodeUTF8))
self.Version.setText(QtGui.QApplication.translate("Qwad", "0", None, QtGui.QApplication.UnicodeUTF8))
self.label_5.setText(QtGui.QApplication.translate("Qwad", "Title type", None, QtGui.QApplication.UnicodeUTF8))
self.label_2.setText(QtGui.QApplication.translate("Qwad", "IOS needed", None, QtGui.QApplication.UnicodeUTF8))
self.label_6.setText(QtGui.QApplication.translate("Qwad", "Group ID", None, QtGui.QApplication.UnicodeUTF8))
self.label_4.setText(QtGui.QApplication.translate("Qwad", "Boot index", None, QtGui.QApplication.UnicodeUTF8))
self.label_7.setText(QtGui.QApplication.translate("Qwad", "Access rights", None, QtGui.QApplication.UnicodeUTF8))
self.label_8.setText(QtGui.QApplication.translate("Qwad", "Contents", None, QtGui.QApplication.UnicodeUTF8))
self.label.setText(QtGui.QApplication.translate("Qwad", "Title ID:", None, QtGui.QApplication.UnicodeUTF8))
self.label_9.setText(QtGui.QApplication.translate("Qwad", "Title ID (ascii):", None, QtGui.QApplication.UnicodeUTF8))
self.label_3.setText(QtGui.QApplication.translate("Qwad", "Title Version:", None, QtGui.QApplication.UnicodeUTF8))
self.label_5.setText(QtGui.QApplication.translate("Qwad", "Title Type:", None, QtGui.QApplication.UnicodeUTF8))
self.label_2.setText(QtGui.QApplication.translate("Qwad", "Required IOS:", None, QtGui.QApplication.UnicodeUTF8))
self.label_6.setText(QtGui.QApplication.translate("Qwad", "Group ID:", None, QtGui.QApplication.UnicodeUTF8))
self.label_4.setText(QtGui.QApplication.translate("Qwad", "Boot index:", None, QtGui.QApplication.UnicodeUTF8))
self.label_7.setText(QtGui.QApplication.translate("Qwad", "Access rights:", None, QtGui.QApplication.UnicodeUTF8))
self.label_8.setText(QtGui.QApplication.translate("Qwad", "Contents:", None, QtGui.QApplication.UnicodeUTF8))
self.label_10.setText(QtGui.QApplication.translate("Qwad", "Reserved:", None, QtGui.QApplication.UnicodeUTF8))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.TMDviewer), QtGui.QApplication.translate("Qwad", "TMD viewer", None, QtGui.QApplication.UnicodeUTF8))
self.BotonRutaEmpaquetado.setToolTip(QtGui.QApplication.translate("Qwad", "Carpeta y nombre del nuevo WAD", None, QtGui.QApplication.UnicodeUTF8))
self.BotonRutaEmpaquetado.setText(QtGui.QApplication.translate("Qwad", "Output", None, QtGui.QApplication.UnicodeUTF8))
@ -261,22 +259,18 @@ class Ui_Qwad(object):
self.Download_from_NUS.setText(QtGui.QApplication.translate("Qwad", "Download", None, QtGui.QApplication.UnicodeUTF8))
self.NusOutputButton.setToolTip(QtGui.QApplication.translate("Qwad", "Carpeta y nombre del nuevo WAD", None, QtGui.QApplication.UnicodeUTF8))
self.NusOutputButton.setText(QtGui.QApplication.translate("Qwad", "Output", None, QtGui.QApplication.UnicodeUTF8))
self.enteredTitleID.setText(QtGui.QApplication.translate("Qwad", "000000000000000000", None, QtGui.QApplication.UnicodeUTF8))
self.TitleIDlabel.setText(QtGui.QApplication.translate("Qwad", "Title ID", None, QtGui.QApplication.UnicodeUTF8))
self.Title.setText(QtGui.QApplication.translate("Qwad", "Choose title:", None, QtGui.QApplication.UnicodeUTF8))
self.comboBox.setItemText(0, QtGui.QApplication.translate("Qwad", "Choose IOS", None, QtGui.QApplication.UnicodeUTF8))
self.comboBox2.setItemText(0, QtGui.QApplication.translate("Qwad", "Choose Channel/Menu", None, QtGui.QApplication.UnicodeUTF8))
self.decryptCheck.setText(QtGui.QApplication.translate("Qwad", "Decrypt", None, QtGui.QApplication.UnicodeUTF8))
self.pack_in_WAD_checkbox.setText(QtGui.QApplication.translate("Qwad", "Pack into WAD", None, QtGui.QApplication.UnicodeUTF8))
self.VersionlineEdit.setText(QtGui.QApplication.translate("Qwad", "unset", None, QtGui.QApplication.UnicodeUTF8))
self.pack_in_WAD_checkbox.setText(QtGui.QApplication.translate("Qwad", "Pack as WAD", None, QtGui.QApplication.UnicodeUTF8))
self.versionlabel.setText(QtGui.QApplication.translate("Qwad", "Version:", None, QtGui.QApplication.UnicodeUTF8))
self.availableLabel.setText(QtGui.QApplication.translate("Qwad", "Available Versions:", None, QtGui.QApplication.UnicodeUTF8))
self.availableVersions.setText(QtGui.QApplication.translate("Qwad", "unset", None, QtGui.QApplication.UnicodeUTF8))
self.tabWidget.setTabText(self.tabWidget.indexOf(self.NUStab), QtGui.QApplication.translate("Qwad", "Download from NUS", None, QtGui.QApplication.UnicodeUTF8))
self.menuAyuda.setTitle(QtGui.QApplication.translate("Qwad", "Help", None, QtGui.QApplication.UnicodeUTF8))
self.actionAcerca_de_Qwad.setText(QtGui.QApplication.translate("Qwad", "About Qwad", None, QtGui.QApplication.UnicodeUTF8))
self.actionAbout_Qt.setText(QtGui.QApplication.translate("Qwad", "About Qt", None, QtGui.QApplication.UnicodeUTF8))
self.actionAbout_Wii_Signer.setText(QtGui.QApplication.translate("Qwad", "About Wii Signer", None, QtGui.QApplication.UnicodeUTF8))
import Qwad_rc

View File

@ -11,6 +11,7 @@ from shutil import rmtree
from threading import Thread
import TitleIDs
import tempfile, os, time
import binascii
CWD = os.getcwd()
@ -31,8 +32,6 @@ class MWQwad(QMainWindow, Ui_Qwad):
self.comboBox.addItem(key)
for key in TitleIDs.sorted_copy(TitleIDs.ChannelDict):
self.comboBox2.addItem(key)
for ios in TitleIDs.sorted_copy(TitleIDs.IOSdict):
self.IOSversion.addItem(ios)
self.getReady()
def Status(self,status):
@ -61,11 +60,11 @@ class MWQwad(QMainWindow, Ui_Qwad):
"""
tmd = TMD().loadFile(tmdpath)
self.TitleID.setText("%016x" % tmd.tmd.titleid)
# print tmd.tmd.version
#self.IOSversion.setText("%016x" % tmd.tmd.iosversion)
self.idASCII.setText("%s" % binascii.unhexlify(str(tmd.tmd.titleid)[7:]))
self.IOSversion.setText(TitleIDs.TitleSwapDict["%s" % ("%016x" % tmd.tmd.iosversion)])
self.TitleType.setText(str(tmd.tmd.title_type))
self.GroupID.setText(str(tmd.tmd.group_id))
# print tmd.tmd.reserved
self.Reserved.setText(str(tmd.tmd.reserved))
self.AccessRights.setText(str(tmd.tmd.access_rights))
self.Version.setText(str(tmd.tmd.title_version))
self.Contents.setText(str(tmd.tmd.numcontents))

View File

@ -46,7 +46,7 @@
<bool>false</bool>
</property>
<property name="currentIndex">
<number>3</number>
<number>1</number>
</property>
<widget class="QWidget" name="unpacktab">
<attribute name="title">
@ -174,16 +174,6 @@
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="TitleID">
<property name="text">
<string>0000000000000000</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="0" column="2" colspan="2">
<widget class="QLabel" name="label_9">
<property name="text">
@ -194,13 +184,6 @@
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QLineEdit" name="idASCII">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
@ -211,16 +194,6 @@
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLineEdit" name="Version">
<property name="text">
<string>0</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="1" column="3">
<widget class="QLabel" name="label_5">
<property name="text">
@ -231,13 +204,6 @@
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QLineEdit" name="TitleType">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
@ -258,13 +224,6 @@
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QLineEdit" name="GroupID">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="0">
<widget class="QLabel" name="label_4">
<property name="text">
@ -275,13 +234,6 @@
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLineEdit" name="BootIndex">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="3" column="3">
<widget class="QLabel" name="label_7">
<property name="text">
@ -292,13 +244,6 @@
</property>
</widget>
</item>
<item row="3" column="4">
<widget class="QLineEdit" name="AccessRights">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="label_8">
<property name="text">
@ -309,15 +254,82 @@
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLineEdit" name="Contents">
<property name="readOnly">
<bool>true</bool>
<item row="2" column="1">
<widget class="QLabel" name="IOSversion">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="IOSversion"/>
<item row="0" column="1">
<widget class="QLabel" name="TitleID">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QLabel" name="idASCII">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QLabel" name="Version">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QLabel" name="TitleType">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="2" column="4">
<widget class="QLabel" name="GroupID">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="QLabel" name="BootIndex">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="3" column="4">
<widget class="QLabel" name="AccessRights">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="Contents">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
<item row="4" column="3">
<widget class="QLabel" name="label_10">
<property name="text">
<string>Reserved</string>
</property>
</widget>
</item>
<item row="4" column="4">
<widget class="QLabel" name="Reserved">
<property name="text">
<string>TextLabel</string>
</property>
</widget>
</item>
</layout>
</widget>

View File

@ -43,6 +43,10 @@ def _generate_index(str):
_append(current_fragment)
return tuple(index)
def swap_dic(original_dict):
####################### Swap Keys and Values of a dictionary ######################
return dict([(v, k) for (k, v) in original_dict.iteritems()])
TitleDict = {
"IOS4":"0000000100000004",
"IOS9":"0000000100000009",
@ -85,6 +89,8 @@ TitleDict = {
"IOS70":"0000000100000046",
"IOS80":"0000000100000050", }
TitleSwapDict = swap_dic(TitleDict)
ChannelDict = {
"BOOT2":"0000000100000001",
"System Menu [JAP]":"0000000100000002",