mirror of
https://github.com/LongSoft/UEFITool.git
synced 2024-11-22 07:58:22 +08:00
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:
parent
41243f6d25
commit
41448ea49f
@ -1240,18 +1240,36 @@ UINT8 FfsEngine::parseSection(const QByteArray & section, QModelIndex & index, c
|
|||||||
// Tiano compressed section
|
// Tiano compressed section
|
||||||
if (QByteArray((const char*)&guidDefinedSectionHeader->SectionDefinitionGuid, sizeof(EFI_GUID)) == EFI_GUIDED_SECTION_TIANO) {
|
if (QByteArray((const char*)&guidDefinedSectionHeader->SectionDefinitionGuid, sizeof(EFI_GUID)) == EFI_GUIDED_SECTION_TIANO) {
|
||||||
algorithm = COMPRESSION_ALGORITHM_UNKNOWN;
|
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)
|
if (result)
|
||||||
parseCurrentSection = false;
|
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
|
// LZMA compressed section
|
||||||
else if (QByteArray((const char*)&guidDefinedSectionHeader->SectionDefinitionGuid, sizeof(EFI_GUID)) == EFI_GUIDED_SECTION_LZMA) {
|
else if (QByteArray((const char*)&guidDefinedSectionHeader->SectionDefinitionGuid, sizeof(EFI_GUID)) == EFI_GUIDED_SECTION_LZMA) {
|
||||||
algorithm = COMPRESSION_ALGORITHM_UNKNOWN;
|
algorithm = COMPRESSION_ALGORITHM_UNKNOWN;
|
||||||
info += tr("\nCompression type: LZMA");
|
|
||||||
result = decompress(body, EFI_CUSTOMIZED_COMPRESSION, decompressed, &algorithm);
|
result = decompress(body, EFI_CUSTOMIZED_COMPRESSION, decompressed, &algorithm);
|
||||||
if (result)
|
if (result)
|
||||||
parseCurrentSection = false;
|
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
|
// Unknown GUIDed section
|
||||||
else {
|
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);
|
index = model->addItem(Types::Section, sectionHeader->Type, COMPRESSION_ALGORITHM_NONE, name, "", info, header, body, QByteArray(), parent, mode);
|
||||||
|
|
||||||
// Special case of PEI Core
|
// 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);
|
result = getEntryPoint(model->body(index), oldPeiCoreEntryPoint);
|
||||||
if (result)
|
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;
|
break;
|
||||||
|
11
uefitool.cpp
11
uefitool.cpp
@ -16,7 +16,8 @@
|
|||||||
|
|
||||||
UEFITool::UEFITool(QWidget *parent) :
|
UEFITool::UEFITool(QWidget *parent) :
|
||||||
QMainWindow(parent),
|
QMainWindow(parent),
|
||||||
ui(new Ui::UEFITool)
|
ui(new Ui::UEFITool),
|
||||||
|
version(tr("0.18.6"))
|
||||||
{
|
{
|
||||||
clipboard = QApplication::clipboard();
|
clipboard = QApplication::clipboard();
|
||||||
|
|
||||||
@ -25,6 +26,9 @@ ui(new Ui::UEFITool)
|
|||||||
searchDialog = new SearchDialog(this);
|
searchDialog = new SearchDialog(this);
|
||||||
ffsEngine = NULL;
|
ffsEngine = NULL;
|
||||||
|
|
||||||
|
// Set window title
|
||||||
|
this->setWindowTitle(tr("UEFITool %1").arg(version));
|
||||||
|
|
||||||
// Connect signals to slots
|
// Connect signals to slots
|
||||||
connect(ui->actionOpenImageFile, SIGNAL(triggered()), this, SLOT(openImageFile()));
|
connect(ui->actionOpenImageFile, SIGNAL(triggered()), this, SLOT(openImageFile()));
|
||||||
connect(ui->actionSaveImageFile, SIGNAL(triggered()), this, SLOT(saveImageFile()));
|
connect(ui->actionSaveImageFile, SIGNAL(triggered()), this, SLOT(saveImageFile()));
|
||||||
@ -72,6 +76,9 @@ void UEFITool::init()
|
|||||||
ui->messageListWidget->clear();
|
ui->messageListWidget->clear();
|
||||||
ui->infoEdit->clear();
|
ui->infoEdit->clear();
|
||||||
|
|
||||||
|
// Set window title
|
||||||
|
this->setWindowTitle(tr("UEFITool %1").arg(version));
|
||||||
|
|
||||||
// Disable menus
|
// Disable menus
|
||||||
ui->menuCapsuleActions->setDisabled(true);
|
ui->menuCapsuleActions->setDisabled(true);
|
||||||
ui->menuImageActions->setDisabled(true);
|
ui->menuImageActions->setDisabled(true);
|
||||||
@ -544,6 +551,8 @@ void UEFITool::openImageFile(QString path)
|
|||||||
inputFile.close();
|
inputFile.close();
|
||||||
|
|
||||||
init();
|
init();
|
||||||
|
this->setWindowTitle(tr("UEFITool %1 - %2").arg(version).arg(fileInfo.fileName()));
|
||||||
|
|
||||||
UINT8 result = ffsEngine->parseImageFile(buffer);
|
UINT8 result = ffsEngine->parseImageFile(buffer);
|
||||||
showMessages();
|
showMessages();
|
||||||
if (result)
|
if (result)
|
||||||
|
@ -95,7 +95,8 @@ private:
|
|||||||
SearchDialog* searchDialog;
|
SearchDialog* searchDialog;
|
||||||
QClipboard* clipboard;
|
QClipboard* clipboard;
|
||||||
QString currentDir;
|
QString currentDir;
|
||||||
QQueue<MessageListItem> messageItems;
|
QQueue<MessageListItem> messageItems;
|
||||||
|
const QString version;
|
||||||
|
|
||||||
void showMessages();
|
void showMessages();
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>UEFITool 0.18.5</string>
|
<string>UEFITool</string>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="centralWidget">
|
<widget class="QWidget" name="centralWidget">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
Loading…
Reference in New Issue
Block a user