UEFITool 0.18.6

- solved a bug with unneeded original PEI core entry point recalculation
- name of opened file is now shown in window title
- added compression type and decompressed size info for compressed GUID-defined sections
This commit is contained in:
Nikolaj Schlej 2014-08-14 14:02:35 +02:00
parent 41243f6d25
commit 41448ea49f
4 changed files with 39 additions and 9 deletions

View File

@ -1240,18 +1240,36 @@ UINT8 FfsEngine::parseSection(const QByteArray & section, QModelIndex & index, c
// Tiano compressed section
if (QByteArray((const char*)&guidDefinedSectionHeader->SectionDefinitionGuid, sizeof(EFI_GUID)) == EFI_GUIDED_SECTION_TIANO) {
algorithm = COMPRESSION_ALGORITHM_UNKNOWN;
info += tr("\nCompression type: Tiano");
result = decompress(body, EFI_STANDARD_COMPRESSION, decompressed, &algorithm);
result = decompress(body, EFI_STANDARD_COMPRESSION, decompressed, &algorithm);
if (result)
parseCurrentSection = false;
if (algorithm == COMPRESSION_ALGORITHM_TIANO) {
info += tr("\nCompression type: Tiano");
info += tr("\nDecompressed size: %1").arg(decompressed.length(), 8, 16, QChar('0'));
}
else if (algorithm == COMPRESSION_ALGORITHM_EFI11) {
info += tr("\nCompression type: EFI 1.1");
info += tr("\nDecompressed size: %1").arg(decompressed.length(), 8, 16, QChar('0'));
}
else
info += tr("\nCompression type: unknown");
}
// LZMA compressed section
else if (QByteArray((const char*)&guidDefinedSectionHeader->SectionDefinitionGuid, sizeof(EFI_GUID)) == EFI_GUIDED_SECTION_LZMA) {
algorithm = COMPRESSION_ALGORITHM_UNKNOWN;
info += tr("\nCompression type: LZMA");
result = decompress(body, EFI_CUSTOMIZED_COMPRESSION, decompressed, &algorithm);
if (result)
if (result)
parseCurrentSection = false;
if (algorithm == COMPRESSION_ALGORITHM_LZMA) {
info += tr("\nCompression type: LZMA");
info += tr("\nDecompressed size: %1").arg(decompressed.length(), 8, 16, QChar('0'));
}
else
info += tr("\nCompression type: unknown");
}
// Unknown GUIDed section
else {
@ -1342,10 +1360,12 @@ UINT8 FfsEngine::parseSection(const QByteArray & section, QModelIndex & index, c
index = model->addItem(Types::Section, sectionHeader->Type, COMPRESSION_ALGORITHM_NONE, name, "", info, header, body, QByteArray(), parent, mode);
// Special case of PEI Core
if ((sectionHeader->Type == EFI_SECTION_PE32 || sectionHeader->Type == EFI_SECTION_TE) && model->subtype(parent) == EFI_FV_FILETYPE_PEI_CORE) {
if ((sectionHeader->Type == EFI_SECTION_PE32 || sectionHeader->Type == EFI_SECTION_TE)
&& model->subtype(parent) == EFI_FV_FILETYPE_PEI_CORE
&& oldPeiCoreEntryPoint == 0) {
result = getEntryPoint(model->body(index), oldPeiCoreEntryPoint);
if (result)
msg(tr("parseSection: Can't get entry point of image file"), index);
msg(tr("parseSection: Can't get original PEI core entry point"), index);
}
}
break;

View File

@ -16,7 +16,8 @@
UEFITool::UEFITool(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::UEFITool)
ui(new Ui::UEFITool),
version(tr("0.18.6"))
{
clipboard = QApplication::clipboard();
@ -25,6 +26,9 @@ ui(new Ui::UEFITool)
searchDialog = new SearchDialog(this);
ffsEngine = NULL;
// Set window title
this->setWindowTitle(tr("UEFITool %1").arg(version));
// Connect signals to slots
connect(ui->actionOpenImageFile, SIGNAL(triggered()), this, SLOT(openImageFile()));
connect(ui->actionSaveImageFile, SIGNAL(triggered()), this, SLOT(saveImageFile()));
@ -72,6 +76,9 @@ void UEFITool::init()
ui->messageListWidget->clear();
ui->infoEdit->clear();
// Set window title
this->setWindowTitle(tr("UEFITool %1").arg(version));
// Disable menus
ui->menuCapsuleActions->setDisabled(true);
ui->menuImageActions->setDisabled(true);
@ -544,6 +551,8 @@ void UEFITool::openImageFile(QString path)
inputFile.close();
init();
this->setWindowTitle(tr("UEFITool %1 - %2").arg(version).arg(fileInfo.fileName()));
UINT8 result = ffsEngine->parseImageFile(buffer);
showMessages();
if (result)

View File

@ -95,7 +95,8 @@ private:
SearchDialog* searchDialog;
QClipboard* clipboard;
QString currentDir;
QQueue<MessageListItem> messageItems;
QQueue<MessageListItem> messageItems;
const QString version;
void showMessages();

View File

@ -20,7 +20,7 @@
<bool>true</bool>
</property>
<property name="windowTitle">
<string>UEFITool 0.18.5</string>
<string>UEFITool</string>
</property>
<widget class="QWidget" name="centralWidget">
<property name="sizePolicy">