mirror of
https://github.com/LongSoft/UEFITool.git
synced 2025-05-16 08:04:55 -04:00
Merge recent updates but without broken builder and with minor refactoring and bugfixes
This commit is contained in:
parent
b064495db8
commit
0a634ebcbd
37 changed files with 712 additions and 8665 deletions
|
@ -28,29 +28,29 @@ USTATUS FfsOperations::extract(const UModelIndex & index, UString & name, UByteA
|
|||
if (mode == EXTRACT_MODE_AS_IS) {
|
||||
// Extract as is, with header body and tail
|
||||
extracted.clear();
|
||||
extracted.append(model->header(index));
|
||||
extracted.append(model->body(index));
|
||||
extracted.append(model->tail(index));
|
||||
extracted += model->header(index);
|
||||
extracted += model->body(index);
|
||||
extracted += model->tail(index);
|
||||
}
|
||||
else if (mode == EXTRACT_MODE_BODY) {
|
||||
name += QObject::tr("_body");
|
||||
name += UString("_body");
|
||||
// Extract without header and tail
|
||||
extracted.clear();
|
||||
extracted.append(model->body(index));
|
||||
extracted += model->body(index);
|
||||
}
|
||||
else if (mode == EXTRACT_MODE_BODY_UNCOMPRESSED) {
|
||||
name += QObject::tr("_body_unc");
|
||||
name += UString("_body_unc");
|
||||
// Extract without header and tail, uncompressed
|
||||
extracted.clear();
|
||||
// There is no need to redo decompression, we can use child items
|
||||
for (int i = 0; i < model->rowCount(index); i++) {
|
||||
UModelIndex childIndex = index.child(i, 0);
|
||||
// Ensure 4-byte alignment of current section
|
||||
extracted.append(UByteArray('\x00', ALIGN4((UINT32)extracted.size()) - (UINT32)extracted.size()));
|
||||
extracted += UByteArray(ALIGN4((UINT32)extracted.size()) - (UINT32)extracted.size(), '\x00');
|
||||
// Add current section header, body and tail
|
||||
extracted.append(model->header(childIndex));
|
||||
extracted.append(model->body(childIndex));
|
||||
extracted.append(model->tail(childIndex));
|
||||
extracted += model->header(childIndex);
|
||||
extracted += model->body(childIndex);
|
||||
extracted += model->tail(childIndex);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -59,7 +59,7 @@ USTATUS FfsOperations::extract(const UModelIndex & index, UString & name, UByteA
|
|||
return U_SUCCESS;
|
||||
}
|
||||
|
||||
USTATUS FfsOperations::replace(const UModelIndex & index, const UString & data, const UINT8 mode)
|
||||
USTATUS FfsOperations::replace(const UModelIndex & index, UByteArray & data, const UINT8 mode)
|
||||
{
|
||||
U_UNUSED_PARAMETER(data);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue