mirror of
https://github.com/LongSoft/UEFITool.git
synced 2024-11-29 11:28:22 +08:00
Allow subguid matching for UEFIReplace
This commit is contained in:
parent
dd90367387
commit
65263f1000
@ -88,7 +88,12 @@ UINT8 UEFIReplace::replaceInFile(const QModelIndex & index, const QByteArray & g
|
||||
if (model->subtype(index) == sectionType) {
|
||||
QModelIndex fileIndex = model->findParentOfType(index, Types::File);
|
||||
QByteArray fileGuid = model->header(fileIndex).left(sizeof(EFI_GUID));
|
||||
if (fileGuid == guid && model->action(index) != Actions::Replace) {
|
||||
bool guidMatch = fileGuid == guid;
|
||||
if (!guidMatch && sectionType == EFI_SECTION_FREEFORM_SUBTYPE_GUID) {
|
||||
QByteArray subGuid = model->header(index).mid(sizeof(uint32_t), sizeof(EFI_GUID));
|
||||
guidMatch = subGuid == guid;
|
||||
}
|
||||
if (guidMatch && model->action(index) != Actions::Replace) {
|
||||
UINT8 result = ffsEngine->replace(index, newData, REPLACE_MODE_BODY);
|
||||
if (replaceOnce || (result != ERR_SUCCESS && result != ERR_NOTHING_TO_PATCH))
|
||||
return result;
|
||||
|
Loading…
Reference in New Issue
Block a user