mirror of
https://github.com/LongSoft/UEFITool.git
synced 2024-11-26 01:48:23 +08:00
fix for #99
This commit is contained in:
parent
3ffdae1123
commit
9d623c91e6
@ -871,9 +871,8 @@ UINT8 FfsEngine::parseBios(const QByteArray & bios, const QModelIndex & parent)
|
||||
if (msgUnknownRevision)
|
||||
msg(tr("parseBios: unknown volume revision %1").arg(volumeHeader->Revision), index);
|
||||
if (msgSizeMismach)
|
||||
msg(tr("parseBios: volume size stored in header %1h (%2) differs from calculated using block map %3h (%4)")
|
||||
.hexarg(volumeSize).arg(volumeSize)
|
||||
.hexarg(bmVolumeSize).arg(bmVolumeSize),
|
||||
msg(tr("parseBios: volume size stored in header %1h differs from calculated using block map %3h")
|
||||
.hexarg(volumeSize).arg(bmVolumeSize),
|
||||
index);
|
||||
|
||||
// Go to next volume
|
||||
@ -1228,7 +1227,7 @@ UINT8 FfsEngine::parseFile(const QByteArray & file, QModelIndex & index, const U
|
||||
}
|
||||
|
||||
// Check header checksum
|
||||
UINT8 calculatedHeader = 0x100 -(calculateSum8((const UINT8*)header.constData(), header.size()) - fileHeader->IntegrityCheck.Checksum.Header - fileHeader->IntegrityCheck.Checksum.File - fileHeader->State);
|
||||
UINT8 calculatedHeader = 0x100 - (calculateSum8((const UINT8*)header.constData(), header.size()) - fileHeader->IntegrityCheck.Checksum.Header - fileHeader->IntegrityCheck.Checksum.File - fileHeader->State);
|
||||
if (fileHeader->IntegrityCheck.Checksum.Header != calculatedHeader)
|
||||
msgInvalidHeaderChecksum = true;
|
||||
|
||||
@ -1253,12 +1252,16 @@ UINT8 FfsEngine::parseFile(const QByteArray & file, QModelIndex & index, const U
|
||||
UINT8 calculatedData = 0;
|
||||
if (fileHeader->Attributes & FFS_ATTRIB_CHECKSUM) {
|
||||
calculatedData = calculateChecksum8((const UINT8*)body.constData(), body.size());
|
||||
if (fileHeader->IntegrityCheck.Checksum.File != calculatedData)
|
||||
msgInvalidDataChecksum = true;
|
||||
}
|
||||
// Data checksum must be one of predefined values
|
||||
else if ((revision == 1 && fileHeader->IntegrityCheck.Checksum.File != FFS_FIXED_CHECKSUM)
|
||||
|| fileHeader->IntegrityCheck.Checksum.File != FFS_FIXED_CHECKSUM2)
|
||||
else if (revision == 1) {
|
||||
calculatedData = FFS_FIXED_CHECKSUM;
|
||||
}
|
||||
else {
|
||||
calculatedData = FFS_FIXED_CHECKSUM2;
|
||||
}
|
||||
|
||||
if (fileHeader->IntegrityCheck.Checksum.File != calculatedData)
|
||||
msgInvalidDataChecksum = true;
|
||||
|
||||
// Parse current file by default
|
||||
|
@ -17,7 +17,7 @@
|
||||
UEFITool::UEFITool(QWidget *parent) :
|
||||
QMainWindow(parent),
|
||||
ui(new Ui::UEFITool),
|
||||
version(tr("0.22.1"))
|
||||
version(tr("0.22.2"))
|
||||
{
|
||||
clipboard = QApplication::clipboard();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user