* nandBin - change the way gathering clusters for new data works. this seems to better emulate the way IOS does it

git-svn-id: http://wiiqt.googlecode.com/svn/trunk@54 389f4c8b-5dfe-645f-db0e-df882bc27289
This commit is contained in:
giantpune@gmail.com 2011-01-16 14:40:14 +00:00
parent 2769d3a891
commit e8bd408ba6
4 changed files with 11 additions and 5 deletions

View File

@ -1540,7 +1540,9 @@ bool NandBin::SetData( quint16 idx, const QByteArray &data )
fts << cl; //add this one to the clusters that will be used to hold the data
quint16 block = cl / 8; //try to find other clusters in the same block
for( quint16 i = block * 8; i < ( ( block + 1 ) * 8 ) && fts.size() < clCnt; i++ )
//for( quint16 i = block * 8; i < ( ( block + 1 ) * 8 ) && fts.size() < clCnt; i++ )
quint16 max = freeClusters.at( freeClusters.size() - 1 );
for( quint16 i = block * 8; i < max && fts.size() < clCnt; i++ )
{
if( cl == i ) //this one is already added to the list
continue;
@ -1568,6 +1570,7 @@ bool NandBin::SetData( quint16 idx, const QByteArray &data )
}
}
qSort( fts.begin(), fts.end() );
//qDebug() << "about to writing shit" << clCnt << fts.size();
//qDebug() << "file will be on clusters\n" << hex << fts;
for( quint32 i = 0; i < clCnt; i++ )
@ -1674,6 +1677,7 @@ bool NandBin::WriteMetaData()
//qDebug() << "done adding shit" << hex << (quint32)b.pos();
b.close();
QByteArray hmR = spare.Get_hmac_meta( scl, nextSuperCluster );
qDebug() << "about to write the meta block" << hex << nextSuperCluster << nextClusterVersion << "to page" << (quint32)( nextSuperCluster * 8 );
for( quint8 i = 0; i < 0x10; i++ )

View File

@ -378,6 +378,7 @@ bool CheckTitleIntegrity( quint64 tid )
if( verbose )
{
qDebug() << "\tversion:" << t.Version() << hex << t.Version();
if( t.AccessFlags() )
qDebug() << "\taccess :" << hex << t.AccessFlags();
}
}

View File

@ -165,6 +165,7 @@ void NgDialog::on_pushButton_keys_clicked()
default:
break;
}
//WriteFile( QFileInfo( fn ).absoluteDir().absoluteFilePath( "keys.bin" ), ba );
if( ba.size() != 0x400 )
{