mirror of
https://github.com/LongSoft/UEFITool.git
synced 2024-11-22 16:08:23 +08:00
FIT checksum bugfix
- and small refactorings
This commit is contained in:
parent
f90427229d
commit
03567dbe66
@ -2896,16 +2896,15 @@ USTATUS FfsParser::parseFit(const UModelIndex & index, const UINT32 diff)
|
|||||||
FIT_ENTRY* tempFitHeader = (FIT_ENTRY*)tempFIT.data();
|
FIT_ENTRY* tempFitHeader = (FIT_ENTRY*)tempFIT.data();
|
||||||
tempFitHeader->Checksum = 0;
|
tempFitHeader->Checksum = 0;
|
||||||
UINT8 calculated = calculateChecksum8((const UINT8*)tempFitHeader, fitSize);
|
UINT8 calculated = calculateChecksum8((const UINT8*)tempFitHeader, fitSize);
|
||||||
calculated |= 0x80; // Set checksum flag on calculated checksum
|
|
||||||
if (calculated != fitHeader->Checksum) {
|
if (calculated != fitHeader->Checksum) {
|
||||||
msg(usprintf("parseFit: invalid FIT table checksum %02Xh, should be %02Xh", fitHeader->Checksum, calculated), fitIndex);
|
msg(usprintf("parseFit: invalid FIT table checksum %02Xh, should be %02Xh", fitHeader->Checksum, calculated), fitIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check fit header type
|
// Check fit header type
|
||||||
if ((fitHeader->Type & 0x7F) != FIT_TYPE_HEADER) {
|
if ((fitHeader->Type & 0x7F) != FIT_TYPE_HEADER)
|
||||||
msg(("Invalid FIT header type"), fitIndex);
|
msg(("Invalid FIT header type"), fitIndex);
|
||||||
}
|
|
||||||
|
|
||||||
// Add FIT header to fitTable
|
// Add FIT header to fitTable
|
||||||
std::vector<UString> currentStrings;
|
std::vector<UString> currentStrings;
|
||||||
|
Loading…
Reference in New Issue
Block a user