mirror of
https://github.com/LongSoft/UEFITool.git
synced 2024-11-22 07:58:22 +08:00
Provide workaround for #196
This commit is contained in:
parent
fc2d8f07b1
commit
cd110eafa6
@ -3360,13 +3360,22 @@ USTATUS FfsParser::checkProtectedRanges(const UModelIndex & index)
|
||||
// Calculate digest for BG-protected ranges
|
||||
UByteArray protectedParts;
|
||||
bool bgProtectedRangeFound = false;
|
||||
for (UINT32 i = 0; i < (UINT32)bgProtectedRanges.size(); i++) {
|
||||
if (bgProtectedRanges[i].Type == BG_PROTECTED_RANGE_INTEL_BOOT_GUARD_IBB) {
|
||||
bgProtectedRangeFound = true;
|
||||
bgProtectedRanges[i].Offset -= (UINT32)addressDiff;
|
||||
protectedParts += openedImage.mid(bgProtectedRanges[i].Offset, bgProtectedRanges[i].Size);
|
||||
markProtectedRangeRecursive(index, bgProtectedRanges[i]);
|
||||
try {
|
||||
for (UINT32 i = 0; i < (UINT32)bgProtectedRanges.size(); i++) {
|
||||
if (bgProtectedRanges[i].Type == BG_PROTECTED_RANGE_INTEL_BOOT_GUARD_IBB && bgProtectedRanges[i].Size > 0) {
|
||||
bgProtectedRangeFound = true;
|
||||
if ((UINT64)bgProtectedRanges[i].Offset >= addressDiff) {
|
||||
bgProtectedRanges[i].Offset -= (UINT32)addressDiff;
|
||||
} else {
|
||||
// TODO: Explore this.
|
||||
msg(usprintf("%s: Suspicious BG protection offset", __FUNCTION__), index);
|
||||
}
|
||||
protectedParts += openedImage.mid(bgProtectedRanges[i].Offset, bgProtectedRanges[i].Size);
|
||||
markProtectedRangeRecursive(index, bgProtectedRanges[i]);
|
||||
}
|
||||
}
|
||||
} catch (...) {
|
||||
bgProtectedRangeFound = false;
|
||||
}
|
||||
|
||||
if (bgProtectedRangeFound) {
|
||||
|
Loading…
Reference in New Issue
Block a user