Port nandExtract to QT 6

This commit is contained in:
martravi 2024-07-20 01:13:16 +02:00
parent 56a63a72ad
commit b43309e8fe
10 changed files with 23 additions and 58 deletions

View File

@ -465,7 +465,7 @@ QImage ConvertTextureToImage( const QByteArray &ba, quint32 w, quint32 h, quint3
ret = TPL_ConvertCMPToBitMap( (quint8*)ba.constData(), &bitmapdata, w, h ); ret = TPL_ConvertCMPToBitMap( (quint8*)ba.constData(), &bitmapdata, w, h );
break; break;
default: default:
qWarning() << "ConvertTextureToImage -> Unsupported format" << hex << format; qWarning() << "ConvertTextureToImage -> Unsupported format" << Qt::hex << format;
return QImage(); return QImage();
break; break;
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 222 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

View File

@ -1,32 +0,0 @@
# -------------------------------------------------
# Project created by QtCreator 2010-12-06T03:40:50
# -------------------------------------------------
QT = core gui widgets
TARGET = nandExtract
TEMPLATE = app
SOURCES += main.cpp \
nandwindow.cpp \
../WiiQt/blocks0to7.cpp \
../WiiQt/tiktmd.cpp \
../WiiQt/nandbin.cpp \
../WiiQt/tools.cpp \
../WiiQt/aes.c \
../WiiQt/sha1.c \
nandthread.cpp \
boot2infodialog.cpp \
../WiiQt/nandspare.cpp
HEADERS += nandwindow.h \
../WiiQt/tiktmd.h \
../WiiQt/nandbin.h \
../WiiQt/tools.h \
nandthread.h \
boot2infodialog.h \
../WiiQt/nandspare.h
FORMS += nandwindow.ui \
boot2infodialog.ui
RESOURCES += \
rc.qrc

View File

@ -7,7 +7,7 @@ NandWindow::NandWindow( QWidget *parent ) : QMainWindow( parent ), ui( new Ui::N
{ {
ui->setupUi( this ); ui->setupUi( this );
ui->mainToolBar->setVisible( false ); ui->mainToolBar->setVisible( false );
this->setWindowTitle( "NAND Extract r" ); this->setWindowTitle( "NAND Extract" );
//setup the block map //setup the block map
SetUpBlockMap(); SetUpBlockMap();
@ -19,14 +19,14 @@ NandWindow::NandWindow( QWidget *parent ) : QMainWindow( parent ), ui( new Ui::N
LoadSettings(); LoadSettings();
QFontMetrics fm( fontMetrics() ); QFontMetrics fm( fontMetrics() );
ui->treeWidget->header()->resizeSection( 0, fm.width( QString( 22, 'W' ) ) );//name ui->treeWidget->header()->resizeSection( 0, fm.horizontalAdvance( QString( 22, 'W' ) ) );//name
ui->treeWidget->header()->resizeSection( 1, fm.width( "WWWWW" ) );//entry # ui->treeWidget->header()->resizeSection( 1, fm.horizontalAdvance( "WWWWW" ) );//entry #
ui->treeWidget->header()->resizeSection( 2, fm.width( "WWWWW" ) );//size ui->treeWidget->header()->resizeSection( 2, fm.horizontalAdvance( "WWWWW" ) );//size
ui->treeWidget->header()->resizeSection( 3, fm.width( "WWWWWWWWW" ) );//uid ui->treeWidget->header()->resizeSection( 3, fm.horizontalAdvance( "WWWWWWWWW" ) );//uid
ui->treeWidget->header()->resizeSection( 4, fm.width( "WWWWWWWWW" ) );//gid ui->treeWidget->header()->resizeSection( 4, fm.horizontalAdvance( "WWWWWWWWW" ) );//gid
ui->treeWidget->header()->resizeSection( 5, fm.width( "WWWWWWWWW" ) );//x3 ui->treeWidget->header()->resizeSection( 5, fm.horizontalAdvance( "WWWWWWWWW" ) );//x3
ui->treeWidget->header()->resizeSection( 6, fm.width( "WWWWW" ) );//mode ui->treeWidget->header()->resizeSection( 6, fm.horizontalAdvance( "WWWWW" ) );//mode
ui->treeWidget->header()->resizeSection( 7, fm.width( "WWWWW" ) );//attr ui->treeWidget->header()->resizeSection( 7, fm.horizontalAdvance( "WWWWW" ) );//attr
connect( &nThread, SIGNAL( SendError( QString ) ), this, SLOT( GetError( QString ) ) ); connect( &nThread, SIGNAL( SendError( QString ) ), this, SLOT( GetError( QString ) ) );
connect( &nThread, SIGNAL( SendText( QString ) ), this, SLOT( GetStatusUpdate( QString ) ) ); connect( &nThread, SIGNAL( SendText( QString ) ), this, SLOT( GetStatusUpdate( QString ) ) );
@ -264,7 +264,7 @@ void NandWindow::GetBlocksfromNand()
quint32 freeSpace = 0; quint32 freeSpace = 0;
QList<quint16> clusters = nThread.GetFats(); QList<quint16> clusters = nThread.GetFats();
if( !clusters.size() == 0x8000 ) if( !(clusters.size() == 0x8000) )
{ {
QMessageBox::warning( this, tr( "Error" ), tr( "Expected 0x8000 clusters from the nand, but got %1 instead!" ).arg( clusters.size(), 0, 16 ), QMessageBox::Ok ); QMessageBox::warning( this, tr( "Error" ), tr( "Expected 0x8000 clusters from the nand, but got %1 instead!" ).arg( clusters.size(), 0, 16 ), QMessageBox::Ok );
return; return;
@ -318,7 +318,7 @@ void NandWindow::DrawBlockMap( QList<quint16> newFile )
{ {
if( blocks.size() != 0x1000 ) if( blocks.size() != 0x1000 )
{ {
qWarning() << "NandWindow::DrawBlockMap -> current blocks are fucked up, son" << hex << blocks.size(); qWarning() << "NandWindow::DrawBlockMap -> current blocks are fucked up, son" << Qt::hex << blocks.size();
return; return;
} }
QPixmap blue( ":/blue.png" ); QPixmap blue( ":/blue.png" );

View File

@ -18,17 +18,17 @@
<property name="spacing"> <property name="spacing">
<number>0</number> <number>0</number>
</property> </property>
<property name="margin"> <property name="margin" stdset="0">
<number>2</number> <number>2</number>
</property> </property>
<item> <item>
<widget class="QSplitter" name="splitter"> <widget class="QSplitter" name="splitter">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Orientation::Vertical</enum>
</property> </property>
<widget class="QTreeWidget" name="treeWidget"> <widget class="QTreeWidget" name="treeWidget">
<property name="contextMenuPolicy"> <property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum> <enum>Qt::ContextMenuPolicy::CustomContextMenu</enum>
</property> </property>
<column> <column>
<property name="text"> <property name="text">
@ -73,19 +73,16 @@
</widget> </widget>
<widget class="QGraphicsView" name="graphicsView_blocks"> <widget class="QGraphicsView" name="graphicsView_blocks">
<property name="verticalScrollBarPolicy"> <property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum> <enum>Qt::ScrollBarPolicy::ScrollBarAsNeeded</enum>
</property> </property>
<property name="interactive"> <property name="interactive">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set> <set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop</set>
</property>
<property name="renderHints">
<set>QPainter::HighQualityAntialiasing|QPainter::SmoothPixmapTransform|QPainter::TextAntialiasing</set>
</property> </property>
<property name="cacheMode"> <property name="cacheMode">
<set>QGraphicsView::CacheBackground</set> <set>QGraphicsView::CacheModeFlag::CacheBackground</set>
</property> </property>
</widget> </widget>
</widget> </widget>
@ -111,7 +108,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1180</width> <width>1180</width>
<height>27</height> <height>30</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menuFile"> <widget class="QMenu" name="menuFile">
@ -142,7 +139,7 @@
<widget class="QStatusBar" name="statusBar"/> <widget class="QStatusBar" name="statusBar"/>
<action name="actionOpen_Nand"> <action name="actionOpen_Nand">
<property name="text"> <property name="text">
<string>Open Nand...</string> <string>&amp;Open Nand...</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+O</string> <string>Ctrl+O</string>
@ -156,7 +153,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="text"> <property name="text">
<string>Show Usage...</string> <string>&amp;Show Usage...</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+U</string> <string>Ctrl+U</string>
@ -164,7 +161,7 @@
</action> </action>
<action name="actionBoot2"> <action name="actionBoot2">
<property name="text"> <property name="text">
<string>Boot2</string> <string>&amp;Boot2</string>
</property> </property>
<property name="shortcut"> <property name="shortcut">
<string>Ctrl+B</string> <string>Ctrl+B</string>
@ -175,7 +172,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="text"> <property name="text">
<string>Fix Names For FAT</string> <string>&amp;Fix Names For FAT</string>
</property> </property>
</action> </action>
</widget> </widget>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 187 B