mirror of
https://github.com/LongSoft/UEFITool.git
synced 2024-11-29 11:28:22 +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
|
||||
@ -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