Engine 0.20.5

- raw file header was included twice during reconstruction as region
This commit is contained in:
Nikolaj Schlej 2015-05-17 10:38:04 +02:00
parent b9b5758d2d
commit 3013398a9d
2 changed files with 6 additions and 5 deletions

View File

@ -2740,7 +2740,7 @@ UINT8 FfsEngine::reconstructIntelImage(const QModelIndex& index, QByteArray& rec
return ERR_NOT_IMPLEMENTED;
}
UINT8 FfsEngine::reconstructRegion(const QModelIndex& index, QByteArray& reconstructed)
UINT8 FfsEngine::reconstructRegion(const QModelIndex& index, QByteArray& reconstructed, bool includeHeader)
{
if (!index.isValid())
return ERR_SUCCESS;
@ -2790,7 +2790,8 @@ UINT8 FfsEngine::reconstructRegion(const QModelIndex& index, QByteArray& reconst
}
// Reconstruction successful
reconstructed = model->header(index).append(reconstructed);
if (includeHeader)
reconstructed = model->header(index).append(reconstructed);
return ERR_SUCCESS;
}
@ -3207,9 +3208,9 @@ UINT8 FfsEngine::reconstructFile(const QModelIndex& index, const UINT8 revision,
if (model->rowCount(index)) {
reconstructed.clear();
// Construct new file body
// File contains raw data, must be parsed as region
// File contains raw data, must be parsed as region without header
if (model->subtype(index) == EFI_FV_FILETYPE_ALL || model->subtype(index) == EFI_FV_FILETYPE_RAW) {
result = reconstructRegion(index, reconstructed);
result = reconstructRegion(index, reconstructed, false);
if (result)
return result;
}

View File

@ -81,7 +81,7 @@ public:
UINT8 reconstructImageFile(QByteArray &reconstructed);
UINT8 reconstruct(const QModelIndex &index, QByteArray & reconstructed);
UINT8 reconstructIntelImage(const QModelIndex& index, QByteArray & reconstructed);
UINT8 reconstructRegion(const QModelIndex& index, QByteArray & reconstructed);
UINT8 reconstructRegion(const QModelIndex& index, QByteArray & reconstructed, bool includeHeader = true);
UINT8 reconstructBios(const QModelIndex& index, QByteArray & reconstructed);
UINT8 reconstructVolume(const QModelIndex& index, QByteArray & reconstructed);
UINT8 reconstructFile(const QModelIndex& index, const UINT8 revision, const UINT8 erasePolarity, const UINT32 base, QByteArray& reconstructed);