From 49190d04dd3688b257da364745e6a152fb11e231 Mon Sep 17 00:00:00 2001 From: Nikolaj Schlej Date: Mon, 5 Oct 2015 10:21:33 +0200 Subject: [PATCH] UT NE A15 - fix for #37 - hide/show FIT tab --- UEFITool/uefitool.cpp | 9 ++++++--- common/ffsparser.cpp | 13 ++++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/UEFITool/uefitool.cpp b/UEFITool/uefitool.cpp index d1669be..81e59e0 100644 --- a/UEFITool/uefitool.cpp +++ b/UEFITool/uefitool.cpp @@ -17,7 +17,7 @@ UEFITool::UEFITool(QWidget *parent) : QMainWindow(parent), ui(new Ui::UEFITool), -version(tr("0.30.0_alpha13")) +version(tr("0.30.0_alpha15")) { clipboard = QApplication::clipboard(); @@ -110,6 +110,7 @@ void UEFITool::init() ui->fitTableWidget->setRowCount(0); ui->fitTableWidget->setColumnCount(0); ui->infoEdit->clear(); + ui->messagesTabWidget->setTabEnabled(2, false); // Set window title this->setWindowTitle(tr("UEFITool %1").arg(version)); @@ -673,7 +674,6 @@ void UEFITool::openImageFile(QString path) showFitTable(); } - // Enable search ... if (ffsFinder) delete ffsFinder; @@ -891,8 +891,11 @@ void UEFITool::writeSettings() void UEFITool::showFitTable() { QVector > fitTable = fitParser->getFitTable(); - if (fitTable.isEmpty()) + if (fitTable.isEmpty()) { return; + } + // Enable FIT tab + ui->messagesTabWidget->setTabEnabled(2, true); // Set up the FIT table ui->fitTableWidget->clear(); diff --git a/common/ffsparser.cpp b/common/ffsparser.cpp index 7834a88..fcc6a1e 100644 --- a/common/ffsparser.cpp +++ b/common/ffsparser.cpp @@ -267,10 +267,17 @@ STATUS FfsParser::parseIntelImage(const QByteArray & intelImage, const UINT32 pa return ERR_INVALID_FLASH_DESCRIPTOR; } biosBegin = meEnd; + bios = intelImage.mid(biosBegin, biosEnd); + // biosEnd will point to the end of the image file + // it may be wrong, but it's pretty hard to detect a padding after BIOS region + // with malformed descriptor + } + // Normal descriptor map + else { + bios = intelImage.mid(biosBegin, biosEnd); + // Calculate biosEnd + biosEnd += biosBegin; } - - bios = intelImage.mid(biosBegin, biosEnd); - biosEnd += biosBegin; } else { msg(tr("parseIntelImage: descriptor parsing failed, BIOS region not found in descriptor"));