diff --git a/ffsengine.cpp b/ffsengine.cpp index 2e0a8fe..0029f04 100644 --- a/ffsengine.cpp +++ b/ffsengine.cpp @@ -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; } diff --git a/ffsengine.h b/ffsengine.h index 41d9e0a..281aa6e 100644 --- a/ffsengine.h +++ b/ffsengine.h @@ -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);