From 66a1f877a6d38391a95627aed5ef8d7fa9b917c6 Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Wed, 22 Aug 2012 22:29:02 +0200 Subject: [PATCH] improved TMD Viewer --- ChangeLog | 5 ++ GUI/Ui_VenPri.py | 60 ++++++++++----------- GUI/VenPri.py | 9 ++-- GUI/VenPri.ui | 136 ++++++++++++++++++++++++++--------------------- TitleIDs.py | 6 +++ 5 files changed, 116 insertions(+), 100 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1d9a4e0..2a70a11 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 diff --git a/GUI/Ui_VenPri.py b/GUI/Ui_VenPri.py index 54f105a..fcd612e 100644 --- a/GUI/Ui_VenPri.py +++ b/GUI/Ui_VenPri.py @@ -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 diff --git a/GUI/VenPri.py b/GUI/VenPri.py index 641b9ce..68ec280 100644 --- a/GUI/VenPri.py +++ b/GUI/VenPri.py @@ -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)) diff --git a/GUI/VenPri.ui b/GUI/VenPri.ui index 92ad9e8..ad0ea01 100644 --- a/GUI/VenPri.ui +++ b/GUI/VenPri.ui @@ -46,7 +46,7 @@ false - 3 + 1 @@ -174,16 +174,6 @@ - - - - 0000000000000000 - - - true - - - @@ -194,13 +184,6 @@ - - - - true - - - @@ -211,16 +194,6 @@ - - - - 0 - - - true - - - @@ -231,13 +204,6 @@ - - - - true - - - @@ -258,13 +224,6 @@ - - - - true - - - @@ -275,13 +234,6 @@ - - - - true - - - @@ -292,13 +244,6 @@ - - - - true - - - @@ -309,15 +254,82 @@ - - - - true + + + + TextLabel - - + + + + TextLabel + + + + + + + TextLabel + + + + + + + TextLabel + + + + + + + TextLabel + + + + + + + TextLabel + + + + + + + TextLabel + + + + + + + TextLabel + + + + + + + TextLabel + + + + + + + Reserved + + + + + + + TextLabel + + diff --git a/TitleIDs.py b/TitleIDs.py index bb069fd..4baafe4 100644 --- a/TitleIDs.py +++ b/TitleIDs.py @@ -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",