From ca9ee0ebccbdd5e89a887a48a7381b1c6a570eda Mon Sep 17 00:00:00 2001 From: "giantpune@gmail.com" Date: Mon, 21 Feb 2011 16:25:42 +0000 Subject: [PATCH] * nandBinCheck: show titles that rely on busted shared contents git-svn-id: http://wiiqt.googlecode.com/svn/trunk@73 389f4c8b-5dfe-645f-db0e-df882bc27289 --- nandBinCheck/main.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/nandBinCheck/main.cpp b/nandBinCheck/main.cpp index 204d5d2..41237ca 100644 --- a/nandBinCheck/main.cpp +++ b/nandBinCheck/main.cpp @@ -25,6 +25,8 @@ QByteArray sysMenuResource; QByteArray sysMenuExe; quint64 sysMenuIos; +QListBadSharedItems;//remember bad shared items + bool CheckTitleIntegrity( quint64 tid ); #ifdef Q_WS_WIN @@ -432,11 +434,22 @@ void CheckShared() qDebug() << "checking" << path << "..."; QByteArray stuff = nand.GetData( path ); if( stuff.isEmpty() ) + { + BadSharedItems << sharedM.Hash( i ); Fail( "One of the shared contents in this nand is missing" ); + } QByteArray realHash = GetSha1( stuff ); if( realHash != sharedM.Hash( i ) ) + { + BadSharedItems << sharedM.Hash( i ); + if( verbose ) + { + qCritical() << "\texpected: " << sharedM.Hash( i ).toHex(); + qCritical() << "\tactual: " << realHash.toHex(); + } Fail( "The hash for at least 1 content is bad" ); + } } } @@ -716,6 +729,11 @@ bool CheckTitleIntegrity( quint64 tid ) { if( t.Type( i ) == 0x8001 )//shared { + if( BadSharedItems.contains( t.Hash( i ) ) ) + { + qWarning() << "\tthis title relies on a shared content that is borked (" << i << ")\n\t" << t.Hash( i ).toHex(); + return false; + } if( sharedM.GetAppFromHash( t.Hash( i ) ).isEmpty() ) { qWarning() << "\tone of the shared contents is missing";