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

This commit is contained in:
giantpune@gmail.com 2011-01-16 14:40:14 +00:00
parent c81e7a9c17
commit 9360cd9721
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 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 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 if( cl == i ) //this one is already added to the list
continue; 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() << "about to writing shit" << clCnt << fts.size();
//qDebug() << "file will be on clusters\n" << hex << fts; //qDebug() << "file will be on clusters\n" << hex << fts;
for( quint32 i = 0; i < clCnt; i++ ) for( quint32 i = 0; i < clCnt; i++ )
@ -1674,6 +1677,7 @@ bool NandBin::WriteMetaData()
//qDebug() << "done adding shit" << hex << (quint32)b.pos(); //qDebug() << "done adding shit" << hex << (quint32)b.pos();
b.close(); b.close();
QByteArray hmR = spare.Get_hmac_meta( scl, nextSuperCluster ); QByteArray hmR = spare.Get_hmac_meta( scl, nextSuperCluster );
qDebug() << "about to write the meta block" << hex << nextSuperCluster << nextClusterVersion << "to page" << (quint32)( nextSuperCluster * 8 ); qDebug() << "about to write the meta block" << hex << nextSuperCluster << nextClusterVersion << "to page" << (quint32)( nextSuperCluster * 8 );
for( quint8 i = 0; i < 0x10; i++ ) for( quint8 i = 0; i < 0x10; i++ )

View File

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

View File

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