From 8294800e9df6fee0fd0fecc2e09d03c56aec271a Mon Sep 17 00:00:00 2001 From: "giantpune@gmail.com" Date: Mon, 17 Jan 2011 16:24:12 +0000 Subject: [PATCH] * nanddump: fix bug when changing basepath * NUSdownloader: dont always include IOS35, since the class is used for other things besides just sneek now git-svn-id: http://wiiqt.googlecode.com/svn/trunk@59 389f4c8b-5dfe-645f-db0e-df882bc27289 --- WiiQt/nanddump.cpp | 2 ++ WiiQt/nusdownloader.cpp | 8 ++------ WiiQt/nusdownloader.h | 2 +- nand_dump/mainwindow.cpp | 16 +++++++++++++++- 4 files changed, 20 insertions(+), 8 deletions(-) diff --git a/WiiQt/nanddump.cpp b/WiiQt/nanddump.cpp index e919911..f2db30f 100644 --- a/WiiQt/nanddump.cpp +++ b/WiiQt/nanddump.cpp @@ -26,6 +26,8 @@ bool NandDump::Flush() bool NandDump::SetPath( const QString &path ) { qDebug() << "NandDump::SetPath(" << path << ")"; + uidDirty = true; + cmDirty = true; //check what is already in this path and create stuff that is missing QFileInfo fi( path ); basePath = fi.absoluteFilePath(); diff --git a/WiiQt/nusdownloader.cpp b/WiiQt/nusdownloader.cpp index d6efc05..9916445 100644 --- a/WiiQt/nusdownloader.cpp +++ b/WiiQt/nusdownloader.cpp @@ -599,7 +599,6 @@ QMap< quint64, quint16 > NusDownloader::List20j() titles.insert( 0x10000000dull, 10 );//13v10 titles.insert( 0x10000000full, 257 );//15v257 titles.insert( 0x100000011ull, 512 );//17v512 - titles.insert( 0x100000023ull, 0xc10 ); // IOS35 - not really part of this update, but needed for sneek titles.insert( 0x100000100ull, 0x2 );//bcv2 titles.insert( 0x100000101ull, 0x4 );//miosv4 titles.insert( 0x1000848414B4aull, 0 );//EULA - HAKJ @@ -614,7 +613,6 @@ QMap< quint64, quint16 > NusDownloader::List30j() { QMap< quint64, quint16 > titles = List20j(); titles.insert( 0x100000002ull, 128 ); //sys menu - titles.insert( 0x100000023ull, 0xc10 ); // IOS35 - not really part of this update, but needed for sneek titles.insert( 0x100000101ull, 5 ); //miosv5 titles.insert( 0x1000848414B4aull, 2 ); //EULA v2- HAKJ titles.insert( 0x1000848414C4aull, 0x2 ); //regsel @@ -853,8 +851,7 @@ QMap< quint64, quint16 > NusDownloader::List21e() titles.insert( 0x100000014ull, 12 );//20v12 titles.insert( 0x100000015ull, 514 );//21v514 titles.insert( 0x100000016ull, 777 );//22v772 //should be getting v772 but it isnt available on NUS, get 777 instead - titles.insert( 0x10000001cull, 1292 );//28v1228 //should be getting v1288 but it isnt on NUS - titles.insert( 0x100000023ull, 0xc10 ); // IOS35 - not really part of this update, but needed for sneek + titles.insert( 0x10000001cull, 1292 );//28v1228 //should be getting v1288 but it isnt on NUS titles.insert( 0x100000100ull, 0x2 );//bcv2 titles.insert( 0x100000101ull, 0x4 );//miosv4 titles.insert( 0x1000848414B50ull, 0 );//EULA - HAKP @@ -1105,8 +1102,7 @@ QMap< quint64, quint16 > NusDownloader::List20u() titles.insert( 0x10000000cull, 6 );//12v6 titles.insert( 0x10000000dull, 10 );//13v10 titles.insert( 0x10000000full, 257 );//15v257 - titles.insert( 0x100000011ull, 512 );//17v512 - titles.insert( 0x100000023ull, 0xc10 ); // IOS35 - not really part of this update, but needed for sneek + titles.insert( 0x100000011ull, 512 );//17v512 titles.insert( 0x100000100ull, 0x2 );//bcv2 titles.insert( 0x100000101ull, 0x4 );//miosv4 titles.insert( 0x1000848414B45ull, 0 );//EULA - HAKE diff --git a/WiiQt/nusdownloader.h b/WiiQt/nusdownloader.h index 0e5d1e5..769e273 100644 --- a/WiiQt/nusdownloader.h +++ b/WiiQt/nusdownloader.h @@ -55,7 +55,7 @@ public: //get a list of titles for a given update //if a title is not available on NUS, a substitute is given instead ( a later version of the same title ) //to keep people from bulk DLing and installing and messing something up, any boot2 update will NOT be included - //in the list, ask for it specifically. IOS35 is added in all updates for use in sneek + //in the list, ask for it specifically. //lists are created from wiimpersonator logs when available. otherwise they come from examining game update partitions static QMap< quint64, quint16 > List20u(); diff --git a/nand_dump/mainwindow.cpp b/nand_dump/mainwindow.cpp index d98c6ca..a689269 100644 --- a/nand_dump/mainwindow.cpp +++ b/nand_dump/mainwindow.cpp @@ -73,6 +73,7 @@ void MainWindow::SaveSettings() //paths s.beginGroup( "paths" ); s.setValue( "nusCache", ui->lineEdit_cachePath->text() ); + s.setValue( "sneek", ui->lineEdit_nandPath->text() ); s.endGroup(); } @@ -154,6 +155,14 @@ void MainWindow::NusIsDone() } else if( ui->radioButton_nand->isChecked() ) { + //check if IOS35 is present in nand dump - needed for sneek + QByteArray tmdBA = nand.GetFile( "/title/00000001/00000023/content/title.tmd" ); + if( tmdBA.isEmpty() ) + { + ui->plainTextEdit_log->appendHtml( tr( "IOS35 not found on nand. Getting it now...") ); + nus.Get( 0x100000023ull, true ); + return; + } ui->lineEdit_nandPath->setEnabled( true ); ui->pushButton_nandPath->setEnabled( true ); @@ -480,9 +489,14 @@ void MainWindow::SaveJobToFolder( NusJob job ) for( quint16 i = 0; i < cnt; i++ )//write all the contents in the new folder. if the job is decrypted, append ".app" to the end of their names { QString appName = t.Cid( i ); + QByteArray stuff = job.data.takeFirst(); if( job.decrypt ) + { appName += ".app"; - if( !WriteFile( d.absoluteFilePath( appName ), job.data.takeFirst() ) ) + //qDebug() << "resizing from" << hex << stuff.size() << "to" << (quint32)t.Size( i ); + //stuff.resize( t.Size( i ) ); + } + if( !WriteFile( d.absoluteFilePath( appName ), stuff ) ) { ShowMessage( "Error writing " + d.absoluteFilePath( appName ) + "!<\b>" ); return;