mirror of
https://github.com/LongSoft/UEFITool.git
synced 2024-11-25 09:28:22 +08:00
Provide workaround for #196
This commit is contained in:
parent
fc2d8f07b1
commit
cd110eafa6
@ -3360,14 +3360,23 @@ USTATUS FfsParser::checkProtectedRanges(const UModelIndex & index)
|
||||
// Calculate digest for BG-protected ranges
|
||||
UByteArray protectedParts;
|
||||
bool bgProtectedRangeFound = false;
|
||||
try {
|
||||
for (UINT32 i = 0; i < (UINT32)bgProtectedRanges.size(); i++) {
|
||||
if (bgProtectedRanges[i].Type == BG_PROTECTED_RANGE_INTEL_BOOT_GUARD_IBB) {
|
||||
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) {
|
||||
UByteArray digest(SHA256_DIGEST_SIZE, '\x00');
|
||||
|
Loading…
Reference in New Issue
Block a user