diff --git a/.travis.yml b/.travis.yml
index aadc7d2..d93fc47 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,28 +1,46 @@
language: cpp
-compiler: gcc
-sudo: require
-dist: trusty
+matrix:
+ include:
+ - os: osx
+ osx_image: xcode9.2
-before_install:
- - sudo add-apt-repository ppa:beineri/opt-qt58-trusty -y
- - sudo apt-get update -qq
-
-install:
- - sudo apt-get -y install qt58base
- - source /opt/qt58/bin/qt58-env.sh
+ compiler: clang
-script:
- - cd UEFITool
- - qmake PREFIX=/usr
- - make -j4
- - mkdir -p appdir/usr/bin ; mkdir -p appdir/usr/share/{applications,icons} ; cd appdir
- - cp ../UEFITool usr/bin/uefitool
- - cp ../uefitool.desktop .
- - cp ../icons/uefitool_256x256.png uefitool.png
- - cd ..
- - wget -c "https://github.com/probonopd/linuxdeployqt/releases/download/3/linuxdeployqt-3-x86_64.AppImage"
- - chmod a+x linuxdeployqt*.AppImage
- - unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH
- - ./linuxdeployqt*.AppImage ./appdir/usr/bin/* -bundle-non-qt-libs
- - ./linuxdeployqt*.AppImage ./appdir/usr/bin/* -appimage
- - curl --upload-file ./UEFITool-*.AppImage https://transfer.sh/UEFITool-git.$(git rev-parse --short HEAD)-x86_64.AppImage
+ script:
+ - ./macbuild.sh
+
+ deploy:
+ provider: releases
+ skip_cleanup: true
+ file: "dist/*.zip"
+ file_glob: true
+ api_key:
+ secure: "WjYd93lVLKHULBpUXS/WtGrkdXyAwxHOUnLJotyDmQipAQP5Ox7Kj12JwkSJGEmVOEdcbIQJyi0QxPjn1UYbYsAt6Op8zrjnYLS4G4fMdBtcxprWzid85uTW7oAAIFs7ygMVhpzxRKpu70yNb683vbThqNmaOu6RyG9aJOLtPAg="
+ on:
+ tags: true
+
+ - os: linux
+ compiler: clang
+
+ before_install:
+ - sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa
+ - sudo apt-get update -qq
+ - sudo apt-get install -qq qt5-qmake qtbase5-dev qtdeclarative5-dev libqt5webkit5-dev libsqlite3-dev
+
+ script:
+ - cd UEFITool
+ - qmake -qt=qt5 uefitool.pro
+ - make
+
+ - os: linux
+ compiler: gcc
+
+ before_install:
+ - sudo add-apt-repository --yes ppa:ubuntu-sdk-team/ppa
+ - sudo apt-get update -qq
+ - sudo apt-get install -qq qt5-qmake qtbase5-dev qtdeclarative5-dev libqt5webkit5-dev libsqlite3-dev
+
+ script:
+ - cd UEFITool
+ - qmake -qt=qt5 uefitool.pro
+ - make
diff --git a/UEFIDump/uefidump_main.cpp b/UEFIDump/uefidump_main.cpp
index b280a3d..696fa22 100644
--- a/UEFIDump/uefidump_main.cpp
+++ b/UEFIDump/uefidump_main.cpp
@@ -1,6 +1,6 @@
/* uefidump_main.cpp
-Copyright (c) 2017, LongSoft. All rights reserved.
+Copyright (c) 2018, LongSoft. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -29,7 +29,7 @@ int main(int argc, char *argv[])
return (uefidumper.dump(buffer, UString(argv[1])) != U_SUCCESS);
}
- std::cout << "UEFIDump 0.1.6" << std::endl << std::endl
+ std::cout << "UEFIDump 0.1.8" << std::endl << std::endl
<< "Usage: UEFIDump imagefile" << std::endl;
return 0;
}
diff --git a/UEFIExtract/uefiextract.pro b/UEFIExtract/uefiextract.pro
index d2411e9..8ecc101 100644
--- a/UEFIExtract/uefiextract.pro
+++ b/UEFIExtract/uefiextract.pro
@@ -25,7 +25,7 @@ SOURCES += \
../common/LZMA/LzmaDecompress.c \
../common/LZMA/SDK/C/LzmaDec.c \
../common/Tiano/EfiTianoDecompress.c \
- ../common/ustring.cpp
+ ../common/ustring.cpp \
../common/sha256.c
HEADERS += \
diff --git a/UEFIExtract/uefiextract_main.cpp b/UEFIExtract/uefiextract_main.cpp
index d8a9cb5..70bf583 100644
--- a/UEFIExtract/uefiextract_main.cpp
+++ b/UEFIExtract/uefiextract_main.cpp
@@ -1,5 +1,5 @@
/* uefiextract_main.cpp
-Copyright (c) 2017, LongSoft. All rights reserved.
+Copyright (c) 2018, LongSoft. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -121,7 +121,7 @@ int main(int argc, char *argv[])
}
}
// If parameters are different, show version and usage information
- std::cout << "UEFIExtract 0.13.5" << std::endl << std::endl
+ std::cout << "UEFIExtract 0.13.7" << std::endl << std::endl
<< "Usage: UEFIExtract imagefile - generate report and dump only leaf tree items into .dump folder." << std::endl
<< " UEFIExtract imagefile all - generate report and dump all tree items." << std::endl
<< " UEFIExtract imagefile dump - only generate dump, no report needed." << std::endl
@@ -129,4 +129,4 @@ int main(int argc, char *argv[])
<< " UEFIExtract imagefile GUID_1 GUID_2 ... GUID_31 - dump only FFS file(s) with specific GUID(s), without report." << std::endl
<< "Return value is a bit mask where 0 at position N means that file with GUID_N was found and unpacked, 1 otherwise." << std::endl;
return 1;
-}
\ No newline at end of file
+}
diff --git a/UEFIFind/uefifind_main.cpp b/UEFIFind/uefifind_main.cpp
index 09c64ec..7dd3034 100644
--- a/UEFIFind/uefifind_main.cpp
+++ b/UEFIFind/uefifind_main.cpp
@@ -1,6 +1,6 @@
/* uefifind_main.cpp
-Copyright (c) 2017, LongSoft. All rights reserved.
+Copyright (c) 2018, LongSoft. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -148,7 +148,7 @@ int main(int argc, char *argv[])
return U_SUCCESS;
}
else {
- std::cout << "UEFIFind 0.10.10" << std::endl << std::endl <<
+ std::cout << "UEFIFind 0.10.12" << std::endl << std::endl <<
"Usage: UEFIFind {header | body | all} {list | count} pattern imagefile" << std::endl <<
" or UEFIFind file patternsfile imagefile" << std::endl;
return U_INVALID_PARAMETER;
diff --git a/UEFITool/qhexedit2/qhexedit.cpp b/UEFITool/qhexedit2/qhexedit.cpp
index 25e3151..6ecfc8b 100644
--- a/UEFITool/qhexedit2/qhexedit.cpp
+++ b/UEFITool/qhexedit2/qhexedit.cpp
@@ -165,7 +165,7 @@ void QHexEdit::setCursorPosition(qint64 position)
// 3. Calc new position of cursor
_bPosCurrent = position / 2;
- _pxCursorY = ((position / 2 - _bPosFirst) / _bytesPerLine + 1) * _pxCharHeight;
+ _pxCursorY = (int)((position / 2 - _bPosFirst) / _bytesPerLine + 1) * _pxCharHeight;
int x = (position % (2 * _bytesPerLine));
if (_editAreaIsAscii)
{
@@ -341,7 +341,7 @@ void QHexEdit::insert(qint64 pos, const QByteArray &ba)
void QHexEdit::replace(qint64 pos, qint64 len, const QByteArray &ba)
{
- _undoStack->overwrite(pos, len, ba);
+ _undoStack->overwrite(pos, (int)len, ba);
refresh();
}
diff --git a/UEFITool/uefitool.cpp b/UEFITool/uefitool.cpp
index 95bd58a..9721663 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("NE alpha 45"))
+version(tr("NE alpha 49"))
{
clipboard = QApplication::clipboard();
@@ -32,6 +32,7 @@ version(tr("NE alpha 45"))
ffsFinder = NULL;
ffsOps = NULL;
ffsBuilder = NULL;
+ ffsReport = NULL;
// Connect signals to slots
connect(ui->actionOpenImageFile, SIGNAL(triggered()), this, SLOT(openImageFile()));
@@ -60,35 +61,21 @@ version(tr("NE alpha 45"))
connect(ui->actionGoToOffset, SIGNAL(triggered()), this, SLOT(goToOffset()));
connect(ui->actionGoToAddress, SIGNAL(triggered()), this, SLOT(goToAddress()));
connect(ui->actionLoadGuidDatabase, SIGNAL(triggered()), this, SLOT(loadGuidDatabase()));
+ connect(ui->actionUnloadGuidDatabase, SIGNAL(triggered()), this, SLOT(unloadGuidDatabase()));
+ connect(ui->actionLoadDefaultGuidDatabase, SIGNAL(triggered()), this, SLOT(loadDefaultGuidDatabase()));
+ connect(ui->actionGenerateReport, SIGNAL(triggered()), this, SLOT(generateReport()));
connect(ui->actionToggleBootGuardMarking, SIGNAL(toggled(bool)), this, SLOT(toggleBootGuardMarking(bool)));
connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()), this, SLOT(writeSettings()));
// Enable Drag-and-Drop actions
setAcceptDrops(true);
+ // Disable Builder tab, doesn't work right now
+ ui->messagesTabWidget->setTabEnabled(4, false);
+
// Set current directory
currentDir = ".";
- // Set monospace font for some controls
- QFont font("Courier New", 10);
-#if defined Q_OS_OSX
- font = QFont("Menlo", 10);
-#elif defined Q_OS_WIN
- font = QFont("Consolas", 9);
-#endif
- ui->infoEdit->setFont(font);
- ui->parserMessagesListWidget->setFont(font);
- ui->finderMessagesListWidget->setFont(font);
- ui->builderMessagesListWidget->setFont(font);
- ui->fitTableWidget->setFont(font);
- ui->bootGuardEdit->setFont(font);
- ui->structureTreeView->setFont(font);
- searchDialog->ui->guidEdit->setFont(font);
- searchDialog->ui->hexEdit->setFont(font);
- hexViewDialog->setFont(font);
- goToOffsetDialog->ui->hexSpinBox->setFont(font);
- goToAddressDialog->ui->hexSpinBox->setFont(font);
-
// Load built-in GUID database
initGuidDatabase(":/guids.csv");
@@ -105,6 +92,7 @@ UEFITool::~UEFITool()
delete ffsOps;
delete ffsFinder;
delete ffsParser;
+ delete ffsReport;
delete model;
delete hexViewDialog;
delete searchDialog;
@@ -171,8 +159,9 @@ void UEFITool::init()
void UEFITool::populateUi(const QItemSelection &selected)
{
- if (selected.isEmpty())
+ if (selected.isEmpty()) {
return;
+ }
populateUi(selected.indexes().at(0));
}
@@ -180,8 +169,9 @@ void UEFITool::populateUi(const QItemSelection &selected)
void UEFITool::populateUi(const QModelIndex ¤t)
{
// Check sanity
- if (!current.isValid())
+ if (!current.isValid()) {
return;
+ }
UINT8 type = model->type(current);
UINT8 subtype = model->subtype(current);
@@ -364,7 +354,7 @@ void UEFITool::goToAddress()
return;
UINT32 address = (UINT32)goToAddressDialog->ui->hexSpinBox->value();
- QModelIndex index = model->findByOffset(address - ffsParser->getAddressDiff());
+ QModelIndex index = model->findByOffset(address - (UINT32)ffsParser->getAddressDiff());
if (index.isValid()) {
ui->structureTreeView->scrollTo(index, QAbstractItemView::PositionAtCenter);
ui->structureTreeView->selectionModel()->select(index, QItemSelectionModel::Select | QItemSelectionModel::Rows | QItemSelectionModel::Clear);
@@ -622,75 +612,75 @@ void UEFITool::extract(const UINT8 mode)
QString path;
if (mode == EXTRACT_MODE_AS_IS) {
switch (type) {
- case Types::Capsule: path = QFileDialog::getSaveFileName(this, tr("Save capsule to file"), name + ".cap", "Capsule files (*.cap *.bin);;All files (*)"); break;
- case Types::Image: path = QFileDialog::getSaveFileName(this, tr("Save image to file"), name + ".rom", "Image files (*.rom *.bin);;All files (*)"); break;
- case Types::Region: path = QFileDialog::getSaveFileName(this, tr("Save region to file"), name + ".rgn", "Region files (*.rgn *.bin);;All files (*)"); break;
- case Types::Padding: path = QFileDialog::getSaveFileName(this, tr("Save padding to file"), name + ".pad", "Padding files (*.pad *.bin);;All files (*)"); break;
- case Types::Volume: path = QFileDialog::getSaveFileName(this, tr("Save volume to file"), name + ".vol", "Volume files (*.vol *.bin);;All files (*)"); break;
- case Types::File: path = QFileDialog::getSaveFileName(this, tr("Save FFS file to file"), name + ".ffs", "FFS files (*.ffs *.bin);;All files (*)"); break;
- case Types::Section: path = QFileDialog::getSaveFileName(this, tr("Save section to file"), name + ".sct", "Section files (*.sct *.bin);;All files (*)"); break;
- case Types::NvarEntry: path = QFileDialog::getSaveFileName(this, tr("Save NVAR entry to file"), name + ".nvar", "NVAR entry files (*.nvar *.bin);;All files (*)"); break;
- case Types::VssEntry: path = QFileDialog::getSaveFileName(this, tr("Save VSS entry to file"), name + ".vss", "VSS entry files (*.vss *.bin);;All files (*)"); break;
- case Types::FsysEntry: path = QFileDialog::getSaveFileName(this, tr("Save Fsys entry to file"), name + ".fse", "Fsys entry files (*.fse *.bin);;All files (*)"); break;
- case Types::EvsaEntry: path = QFileDialog::getSaveFileName(this, tr("Save EVSA entry to file"), name + ".evse", "EVSA entry files (*.evse *.bin);;All files (*)"); break;
- case Types::FlashMapEntry: path = QFileDialog::getSaveFileName(this, tr("Save FlashMap entry to file"), name + ".fme", "FlashMap entry files (*.fme *.bin);;All files (*)"); break;
- case Types::VssStore: path = QFileDialog::getSaveFileName(this, tr("Save VSS store to file"), name + ".vss", "VSS store files (*.vss *.bin);;All files (*)"); break;
- case Types::Vss2Store: path = QFileDialog::getSaveFileName(this, tr("Save VSS2 store to file"), name + ".vss2", "VSS2 store files (*.vss2 *.bin);;All files (*)"); break;
- case Types::FdcStore: path = QFileDialog::getSaveFileName(this, tr("Save FDC store to file"), name + ".fdc", "FDC store files (*.fdc *.bin);;All files (*)"); break;
- case Types::FsysStore: path = QFileDialog::getSaveFileName(this, tr("Save Fsys store to file"), name + ".fsys", "Fsys store files (*.fsys *.bin);;All files (*)"); break;
- case Types::EvsaStore: path = QFileDialog::getSaveFileName(this, tr("Save EVSA store to file"), name + ".evsa", "EVSA store files (*.evsa *.bin);;All files (*)"); break;
- case Types::FtwStore: path = QFileDialog::getSaveFileName(this, tr("Save FTW store to file"), name + ".ftw", "FTW store files (*.ftw *.bin);;All files (*)"); break;
- case Types::FlashMapStore: path = QFileDialog::getSaveFileName(this, tr("Save FlashMap store to file"), name + ".fmap", "FlashMap store files (*.fmap *.bin);;All files (*)"); break;
- case Types::CmdbStore: path = QFileDialog::getSaveFileName(this, tr("Save CMDB store to file"), name + ".cmdb", "CMDB store files (*.cmdb *.bin);;All files (*)"); break;
- case Types::Microcode: path = QFileDialog::getSaveFileName(this, tr("Save microcode binary to file"), name + ".ucd", "Microcode binary files (*.ucd *.bin);;All files (*)"); break;
+ case Types::Capsule: path = QFileDialog::getSaveFileName(this, tr("Save capsule to file"), name + ".cap", tr("Capsule files (*.cap *.bin);;All files (*)")); break;
+ case Types::Image: path = QFileDialog::getSaveFileName(this, tr("Save image to file"), name + ".rom", tr("Image files (*.rom *.bin);;All files (*)")); break;
+ case Types::Region: path = QFileDialog::getSaveFileName(this, tr("Save region to file"), name + ".rgn", tr("Region files (*.rgn *.bin);;All files (*)")); break;
+ case Types::Padding: path = QFileDialog::getSaveFileName(this, tr("Save padding to file"), name + ".pad", tr("Padding files (*.pad *.bin);;All files (*)")); break;
+ case Types::Volume: path = QFileDialog::getSaveFileName(this, tr("Save volume to file"), name + ".vol", tr("Volume files (*.vol *.bin);;All files (*)")); break;
+ case Types::File: path = QFileDialog::getSaveFileName(this, tr("Save FFS file to file"), name + ".ffs", tr("FFS files (*.ffs *.bin);;All files (*)")); break;
+ case Types::Section: path = QFileDialog::getSaveFileName(this, tr("Save section to file"), name + ".sct", tr("Section files (*.sct *.bin);;All files (*)")); break;
+ case Types::NvarEntry: path = QFileDialog::getSaveFileName(this, tr("Save NVAR entry to file"), name + ".nvar", tr("NVAR entry files (*.nvar *.bin);;All files (*)")); break;
+ case Types::VssEntry: path = QFileDialog::getSaveFileName(this, tr("Save VSS entry to file"), name + ".vss", tr("VSS entry files (*.vss *.bin);;All files (*)")); break;
+ case Types::FsysEntry: path = QFileDialog::getSaveFileName(this, tr("Save Fsys entry to file"), name + ".fse", tr("Fsys entry files (*.fse *.bin);;All files (*)")); break;
+ case Types::EvsaEntry: path = QFileDialog::getSaveFileName(this, tr("Save EVSA entry to file"), name + ".evse", tr("EVSA entry files (*.evse *.bin);;All files (*)")); break;
+ case Types::FlashMapEntry: path = QFileDialog::getSaveFileName(this, tr("Save FlashMap entry to file"), name + ".fme", tr("FlashMap entry files (*.fme *.bin);;All files (*)")); break;
+ case Types::VssStore: path = QFileDialog::getSaveFileName(this, tr("Save VSS store to file"), name + ".vss", tr("VSS store files (*.vss *.bin);;All files (*)")); break;
+ case Types::Vss2Store: path = QFileDialog::getSaveFileName(this, tr("Save VSS2 store to file"), name + ".vss2", tr("VSS2 store files (*.vss2 *.bin);;All files (*)")); break;
+ case Types::FdcStore: path = QFileDialog::getSaveFileName(this, tr("Save FDC store to file"), name + ".fdc", tr("FDC store files (*.fdc *.bin);;All files (*)")); break;
+ case Types::FsysStore: path = QFileDialog::getSaveFileName(this, tr("Save Fsys store to file"), name + ".fsys", tr("Fsys store files (*.fsys *.bin);;All files (*)")); break;
+ case Types::EvsaStore: path = QFileDialog::getSaveFileName(this, tr("Save EVSA store to file"), name + ".evsa", tr("EVSA store files (*.evsa *.bin);;All files (*)")); break;
+ case Types::FtwStore: path = QFileDialog::getSaveFileName(this, tr("Save FTW store to file"), name + ".ftw", tr("FTW store files (*.ftw *.bin);;All files (*)")); break;
+ case Types::FlashMapStore: path = QFileDialog::getSaveFileName(this, tr("Save FlashMap store to file"), name + ".fmap", tr("FlashMap store files (*.fmap *.bin);;All files (*)")); break;
+ case Types::CmdbStore: path = QFileDialog::getSaveFileName(this, tr("Save CMDB store to file"), name + ".cmdb", tr("CMDB store files (*.cmdb *.bin);;All files (*)")); break;
+ case Types::Microcode: path = QFileDialog::getSaveFileName(this, tr("Save microcode binary to file"), name + ".ucd", tr("Microcode binary files (*.ucd *.bin);;All files (*)")); break;
case Types::SlicData:
- if (subtype == Subtypes::PubkeySlicData) path = QFileDialog::getSaveFileName(this, tr("Save SLIC pubkey to file"), name + ".spk", "SLIC pubkey files (*.spk *.bin);;All files (*)");
- else path = QFileDialog::getSaveFileName(this, tr("Save SLIC marker to file"), name + ".smk", "SLIC marker files (*.smk *.bin);;All files (*)");
+ if (subtype == Subtypes::PubkeySlicData) path = QFileDialog::getSaveFileName(this, tr("Save SLIC pubkey to file"), name + ".spk", tr("SLIC pubkey files (*.spk *.bin);;All files (*)"));
+ else path = QFileDialog::getSaveFileName(this, tr("Save SLIC marker to file"), name + ".smk", tr("SLIC marker files (*.smk *.bin);;All files (*)"));
break;
- default: path = QFileDialog::getSaveFileName(this, tr("Save object to file"), name + ".bin", "Binary files (*.bin);;All files (*)");
+ default: path = QFileDialog::getSaveFileName(this, tr("Save object to file"), name + ".bin", tr("Binary files (*.bin);;All files (*)"));
}
}
else if (mode == EXTRACT_MODE_BODY || mode == EXTRACT_MODE_BODY_UNCOMPRESSED) {
switch (type) {
- case Types::Capsule: path = QFileDialog::getSaveFileName(this, tr("Save capsule body to image file"), name + ".rom", "Image files (*.rom *.bin);;All files (*)"); break;
- case Types::Volume: path = QFileDialog::getSaveFileName(this, tr("Save volume body to file"), name + ".vbd", "Volume body files (*.vbd *.bin);;All files (*)"); break;
+ case Types::Capsule: path = QFileDialog::getSaveFileName(this, tr("Save capsule body to image file"), name + ".rom", tr("Image files (*.rom *.bin);;All files (*)")); break;
+ case Types::Volume: path = QFileDialog::getSaveFileName(this, tr("Save volume body to file"), name + ".vbd", tr("Volume body files (*.vbd *.bin);;All files (*)")); break;
case Types::File:
if (subtype == EFI_FV_FILETYPE_ALL
- || subtype == EFI_FV_FILETYPE_RAW) path = QFileDialog::getSaveFileName(this, tr("Save FFS file body to raw file"), name + ".raw", "Raw files (*.raw *.bin);;All files (*)");
- else path = QFileDialog::getSaveFileName(this, tr("Save FFS file body to file"), name + ".fbd", "FFS file body files (*.fbd *.bin);;All files (*)");
+ || subtype == EFI_FV_FILETYPE_RAW) path = QFileDialog::getSaveFileName(this, tr("Save FFS file body to raw file"), name + ".raw", tr("Raw files (*.raw *.bin);;All files (*)"));
+ else path = QFileDialog::getSaveFileName(this, tr("Save FFS file body to file"), name + ".fbd", tr("FFS file body files (*.fbd *.bin);;All files (*)"));
break;
case Types::Section:
if (subtype == EFI_SECTION_COMPRESSION
|| subtype == EFI_SECTION_GUID_DEFINED
- || subtype == EFI_SECTION_DISPOSABLE) path = QFileDialog::getSaveFileName(this, tr("Save encapsulation section body to FFS body file"), name + ".fbd", "FFS file body files (*.fbd *.bin);;All files (*)");
- else if (subtype == EFI_SECTION_FIRMWARE_VOLUME_IMAGE) path = QFileDialog::getSaveFileName(this, tr("Save section body to volume file"), name + ".vol", "Volume files (*.vol *.bin);;All files (*)");
- else if (subtype == EFI_SECTION_RAW) path = QFileDialog::getSaveFileName(this, tr("Save section body to raw file"), name + ".raw", "Raw files (*.raw *.bin);;All files (*)");
+ || subtype == EFI_SECTION_DISPOSABLE) path = QFileDialog::getSaveFileName(this, tr("Save encapsulation section body to FFS body file"), name + ".fbd", tr("FFS file body files (*.fbd *.bin);;All files (*)"));
+ else if (subtype == EFI_SECTION_FIRMWARE_VOLUME_IMAGE) path = QFileDialog::getSaveFileName(this, tr("Save section body to volume file"), name + ".vol", tr("Volume files (*.vol *.bin);;All files (*)"));
+ else if (subtype == EFI_SECTION_RAW) path = QFileDialog::getSaveFileName(this, tr("Save section body to raw file"), name + ".raw", tr("Raw files (*.raw *.bin);;All files (*)"));
else if (subtype == EFI_SECTION_PE32
|| subtype == EFI_SECTION_TE
- || subtype == EFI_SECTION_PIC) path = QFileDialog::getSaveFileName(this, tr("Save section body to EFI executable file"), name + ".efi", "EFI executable files (*.efi *.bin);;All files (*)");
- else path = QFileDialog::getSaveFileName(this, tr("Save section body to file"), name + ".bin", "Binary files (*.bin);;All files (*)");
+ || subtype == EFI_SECTION_PIC) path = QFileDialog::getSaveFileName(this, tr("Save section body to EFI executable file"), name + ".efi", tr("EFI executable files (*.efi *.bin);;All files (*)"));
+ else path = QFileDialog::getSaveFileName(this, tr("Save section body to file"), name + ".bin", tr("Binary files (*.bin);;All files (*)"));
break;
case Types::NvarEntry:
case Types::VssEntry:
case Types::EvsaEntry:
case Types::FlashMapEntry:
- case Types::FsysEntry: path = QFileDialog::getSaveFileName(this, tr("Save entry body to file"), name + ".bin", "Binary files (*.bin);;All files (*)"); break;
+ case Types::FsysEntry: path = QFileDialog::getSaveFileName(this, tr("Save entry body to file"), name + ".bin", tr("Binary files (*.bin);;All files (*)")); break;
case Types::VssStore:
case Types::Vss2Store:
case Types::FtwStore:
case Types::FdcStore:
case Types::FsysStore:
case Types::FlashMapStore:
- case Types::CmdbStore: path = QFileDialog::getSaveFileName(this, tr("Save store body to file"), name + ".bin", "Binary files (*.bin);;All files (*)"); break;
- case Types::Microcode: path = QFileDialog::getSaveFileName(this, tr("Save microcode body to file"), name + ".ucb", "Microcode body files (*.ucb *.bin);;All files (*)"); break;
+ case Types::CmdbStore: path = QFileDialog::getSaveFileName(this, tr("Save store body to file"), name + ".bin", tr("Binary files (*.bin);;All files (*)")); break;
+ case Types::Microcode: path = QFileDialog::getSaveFileName(this, tr("Save microcode body to file"), name + ".ucb", tr("Microcode body files (*.ucb *.bin);;All files (*)")); break;
case Types::SlicData:
- if (subtype == Subtypes::PubkeySlicData) path = QFileDialog::getSaveFileName(this, tr("Save SLIC pubkey body to file"), name + ".spb", "SLIC pubkey body files (*.spb *.bin);;All files (*)");
- else path = QFileDialog::getSaveFileName(this, tr("Save SLIC marker body to file"), name + ".smb", "SLIC marker body files (*.smb *.bin);;All files (*)");
+ if (subtype == Subtypes::PubkeySlicData) path = QFileDialog::getSaveFileName(this, tr("Save SLIC pubkey body to file"), name + ".spb", tr("SLIC pubkey body files (*.spb *.bin);;All files (*)"));
+ else path = QFileDialog::getSaveFileName(this, tr("Save SLIC marker body to file"), name + ".smb", tr("SLIC marker body files (*.smb *.bin);;All files (*)"));
break;
- default: path = QFileDialog::getSaveFileName(this, tr("Save object to file"), name + ".bin", "Binary files (*.bin);;All files (*)");
+ default: path = QFileDialog::getSaveFileName(this, tr("Save object to file"), name + ".bin", tr("Binary files (*.bin);;All files (*)"));
}
}
- else path = QFileDialog::getSaveFileName(this, tr("Save object to file"), name + ".bin", "Binary files (*.bin);;All files (*)");
+ else path = QFileDialog::getSaveFileName(this, tr("Save object to file"), name + ".bin", tr("Binary files (*.bin);;All files (*)"));
if (path.trimmed().isEmpty())
return;
@@ -733,7 +723,7 @@ void UEFITool::remove()
void UEFITool::about()
{
QMessageBox::about(this, tr("About UEFITool"), tr(
- "Copyright (c) 2016, Nikolaj Schlej aka CodeRush.
"
+ "Copyright (c) 2018, LongSoft"
"Program icon made by Alexander Zhidkov.
"
"The program uses QHexEdit2 library made by Simsys.
"
"Qt-less engine is using Bstrlib made by Paul Hsieh.
"
@@ -757,7 +747,7 @@ void UEFITool::exit()
void UEFITool::saveImageFile()
{
- /*QString path = QFileDialog::getSaveFileName(this, tr("Save BIOS image file"), currentDir, "BIOS image files (*.rom *.bin *.cap *.scap *.bio *.fd *.wph *.dec);;All files (*)");
+ /*QString path = QFileDialog::getSaveFileName(this, tr("Save BIOS image file"), currentDir, tr("BIOS image files (*.rom *.bin *.cap *.scap *.bio *.fd *.wph *.dec);;All files (*)"));
if (path.isEmpty())
return;
@@ -790,13 +780,13 @@ void UEFITool::saveImageFile()
void UEFITool::openImageFile()
{
- QString path = QFileDialog::getOpenFileName(this, tr("Open BIOS image file"), currentDir, "BIOS image files (*.rom *.bin *.cap *scap *.bio *.fd *.wph *.dec);;All files (*)");
+ QString path = QFileDialog::getOpenFileName(this, tr("Open BIOS image file"), currentDir, tr("BIOS image files (*.rom *.bin *.cap *scap *.bio *.fd *.wph *.dec);;All files (*)"));
openImageFile(path);
}
void UEFITool::openImageFileInNewWindow()
{
- QString path = QFileDialog::getOpenFileName(this, tr("Open BIOS image file in new window"), currentDir, "BIOS image files (*.rom *.bin *.cap *scap *.bio *.fd *.wph *.dec);;All files (*)");
+ QString path = QFileDialog::getOpenFileName(this, tr("Open BIOS image file in new window"), currentDir, tr("BIOS image files (*.rom *.bin *.cap *scap *.bio *.fd *.wph *.dec);;All files (*)"));
if (path.trimmed().isEmpty())
return;
QProcess::startDetached(currentProgramPath, QStringList(path));
@@ -848,12 +838,18 @@ void UEFITool::openImageFile(QString path)
// ... and other operations
delete ffsOps;
ffsOps = new FfsOperations(model);
+ // ... and reports
+ delete ffsReport;
+ ffsReport = new FfsReport(model);
// Enable goToOffset and goToAddress
ui->actionGoToOffset->setEnabled(true);
if (ffsParser->getAddressDiff() < 0xFFFFFFFFUL)
ui->actionGoToAddress->setEnabled(true);
+ // Enable generateReport
+ ui->actionGenerateReport->setEnabled(true);
+
// Set current directory
currentDir = fileInfo.absolutePath();
@@ -1023,13 +1019,15 @@ void UEFITool::contextMenuEvent(QContextMenuEvent* event)
return;
}
- if (!ui->structureTreeView->underMouse())
+ if (!ui->structureTreeView->underMouse()) {
return;
+ }
QPoint pt = event->pos();
QModelIndex index = ui->structureTreeView->indexAt(ui->structureTreeView->viewport()->mapFrom(this, pt));
- if (!index.isValid())
+ if (!index.isValid()) {
return;
+ }
switch (model->type(index))
{
@@ -1075,6 +1073,34 @@ void UEFITool::readSettings()
ui->structureTreeView->setColumnWidth(2, settings.value("tree/columnWidth2", ui->structureTreeView->columnWidth(2)).toInt());
ui->structureTreeView->setColumnWidth(3, settings.value("tree/columnWidth3", ui->structureTreeView->columnWidth(3)).toInt());
markingEnabled = settings.value("tree/markingEnabled", true).toBool();
+ ui->actionToggleBootGuardMarking->setChecked(markingEnabled);
+
+ // Set monospace font for some controls
+ QString fontName;
+ int fontSize;
+#if defined Q_OS_OSX
+ fontName = settings.value("mainWindow/fontName", QString("Menlo")).toString();
+ fontSize = settings.value("mainWindow/fontSize", 10).toInt();
+#elif defined Q_OS_WIN
+ fontName = settings.value("mainWindow/fontName", QString("Consolas")).toString();
+ fontSize = settings.value("mainWindow/fontSize", 9).toInt();
+#else
+ fontName = settings.value("mainWindow/fontName", QString("Courier New")).toString();
+ fontSize = settings.value("mainWindow/fontSize", 10).toInt();
+#endif
+ currentFont = QFont(fontName, fontSize);
+ ui->infoEdit->setFont(currentFont);
+ ui->parserMessagesListWidget->setFont(currentFont);
+ ui->finderMessagesListWidget->setFont(currentFont);
+ ui->builderMessagesListWidget->setFont(currentFont);
+ ui->fitTableWidget->setFont(currentFont);
+ ui->bootGuardEdit->setFont(currentFont);
+ ui->structureTreeView->setFont(currentFont);
+ searchDialog->ui->guidEdit->setFont(currentFont);
+ searchDialog->ui->hexEdit->setFont(currentFont);
+ hexViewDialog->setFont(currentFont);
+ goToOffsetDialog->ui->hexSpinBox->setFont(currentFont);
+ goToAddressDialog->ui->hexSpinBox->setFont(currentFont);
}
void UEFITool::writeSettings()
@@ -1091,6 +1117,8 @@ void UEFITool::writeSettings()
settings.setValue("tree/columnWidth2", ui->structureTreeView->columnWidth(2));
settings.setValue("tree/columnWidth3", ui->structureTreeView->columnWidth(3));
settings.setValue("tree/markingEnabled", markingEnabled);
+ settings.setValue("mainWindow/fontName", currentFont.family());
+ settings.setValue("mainWindow/fontSize", currentFont.pointSize());
}
void UEFITool::showFitTable()
@@ -1155,10 +1183,44 @@ void UEFITool::currentTabChanged(int index)
void UEFITool::loadGuidDatabase()
{
- QString path = QFileDialog::getOpenFileName(this, tr("Select GUID database file to load"), currentDir, "GUID database files (*.gdb);;All files (*)");
+ QString path = QFileDialog::getOpenFileName(this, tr("Select GUID database file to load"), currentDir, tr("Comma-separated values files (*.csv);;All files (*)"));
if (!path.isEmpty()) {
initGuidDatabase(path);
if (!currentPath.isEmpty() && QMessageBox::Yes == QMessageBox::information(this, tr("New GUID database loaded"), tr("Apply new GUID database on the opened file?\nUnsaved changes and tree position will be lost."), QMessageBox::Yes, QMessageBox::No))
openImageFile(currentPath);
}
}
+
+void UEFITool::unloadGuidDatabase()
+{
+ initGuidDatabase();
+ if (!currentPath.isEmpty() && QMessageBox::Yes == QMessageBox::information(this, tr("GUID database unloaded"), tr("Apply changes on the opened file?\nUnsaved changes and tree position will be lost."), QMessageBox::Yes, QMessageBox::No))
+ openImageFile(currentPath);
+}
+
+void UEFITool::loadDefaultGuidDatabase()
+{
+ initGuidDatabase(":/guids.csv");
+ if (!currentPath.isEmpty() && QMessageBox::Yes == QMessageBox::information(this, tr("Default GUID database loaded"), tr("Apply default GUID database on the opened file?\nUnsaved changes and tree position will be lost."), QMessageBox::Yes, QMessageBox::No))
+ openImageFile(currentPath);
+}
+
+
+
+void UEFITool::generateReport()
+{
+ QString path = QFileDialog::getSaveFileName(this, tr("Save report to text file"), currentPath + ".report.txt", tr("Text files (*.txt);;All files (*)"));
+ if (!path.isEmpty()) {
+ std::vector report = ffsReport->generate();
+ if (report.size()) {
+ QFile file;
+ file.setFileName(path);
+ if (file.open(QFile::Text | QFile::WriteOnly)) {
+ for (size_t i = 0; i < report.size(); i++) {
+ file.write(report[i].toLatin1().append('\n'));
+ }
+ file.close();
+ }
+ }
+ }
+}
diff --git a/UEFITool/uefitool.h b/UEFITool/uefitool.h
index dbc243e..ced3065 100644
--- a/UEFITool/uefitool.h
+++ b/UEFITool/uefitool.h
@@ -22,6 +22,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -41,6 +42,7 @@
#include "../common/ffsparser.h"
#include "../common/ffsops.h"
#include "../common/ffsbuilder.h"
+#include "../common/ffsreport.h"
#include "../common/guiddatabase.h"
#include "searchdialog.h"
@@ -115,6 +117,9 @@ private slots:
void writeSettings();
void loadGuidDatabase();
+ void unloadGuidDatabase();
+ void loadDefaultGuidDatabase();
+ void generateReport();
void currentTabChanged(int index);
@@ -123,6 +128,7 @@ private:
TreeModel* model;
FfsParser* ffsParser;
FfsFinder* ffsFinder;
+ FfsReport* ffsReport;
FfsOperations* ffsOps;
FfsBuilder* ffsBuilder;
SearchDialog* searchDialog;
@@ -133,6 +139,7 @@ private:
QString currentDir;
QString currentPath;
QString currentProgramPath;
+ QFont currentFont;
const QString version;
bool markingEnabled;
diff --git a/UEFITool/uefitool.pro b/UEFITool/uefitool.pro
index 2acb10a..468aefa 100644
--- a/UEFITool/uefitool.pro
+++ b/UEFITool/uefitool.pro
@@ -32,6 +32,7 @@ HEADERS += uefitool.h \
../common/parsingdata.h \
../common/ffsbuilder.h \
../common/ffsparser.h \
+ ../common/ffsreport.h \
../common/treeitem.h \
../common/treemodel.h \
../common/LZMA/LzmaCompress.h \
@@ -64,6 +65,7 @@ SOURCES += uefitool_main.cpp \
../common/utility.cpp \
../common/ffsbuilder.cpp \
../common/ffsparser.cpp \
+ ../common/ffsreport.cpp \
../common/treeitem.cpp \
../common/treemodel.cpp \
../common/LZMA/LzmaCompress.c \
diff --git a/UEFITool/uefitool.ui b/UEFITool/uefitool.ui
index 98142e5..6950a81 100644
--- a/UEFITool/uefitool.ui
+++ b/UEFITool/uefitool.ui
@@ -322,7 +322,11 @@
+
+
+
+
@@ -473,7 +477,7 @@
false
- Entry
+ &Entry
@@ -532,7 +536,7 @@
-
@@ -718,7 +722,7 @@
false
- Sear&ch...
+ Searc&h...
Ctrl+F
@@ -867,12 +871,42 @@
true
- &BootGuard marking
+ BootGuard &markings
Ctrl+Shift+B
+
+
+ false
+
+
+ Generate &report...
+
+
+ Generate report
+
+
+ Ctrl+Alt+R
+
+
+
+
+ &Unload GUID database
+
+
+ Ctrl+Alt+U
+
+
+
+
+ Load &default GUID database
+
+
+ Ctrl+Alt+D
+
+
diff --git a/UEFITool/uefitool_main.cpp b/UEFITool/uefitool_main.cpp
index ca81d24..1b2df2a 100644
--- a/UEFITool/uefitool_main.cpp
+++ b/UEFITool/uefitool_main.cpp
@@ -1,6 +1,6 @@
/* uefitool_main.cpp
- Copyright (c) 2014, Nikolaj Schlej. All rights reserved.
+ Copyright (c) 2018, LongSoft. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
diff --git a/common/LZMA/LzmaCompress.c b/common/LZMA/LzmaCompress.c
index f796cfd..c4411f3 100644
--- a/common/LZMA/LzmaCompress.c
+++ b/common/LZMA/LzmaCompress.c
@@ -25,8 +25,8 @@ static ISzAlloc SzAllocForLzma = { &AllocForLzma, &FreeForLzma };
SRes OnProgress(void *p, UInt64 inSize, UInt64 outSize)
{
- (void)p; (void) inSize; (void) outSize;
- return SZ_OK;
+ (void)p; (void)inSize; (void)outSize;
+ return SZ_OK;
}
static ICompressProgress g_ProgressCallback = { &OnProgress };
@@ -35,75 +35,76 @@ STATIC
UINT64
EFIAPI
RShiftU64(
-UINT64 Operand,
-UINT32 Count
+ UINT64 Operand,
+ UINT32 Count
)
{
- return Operand >> Count;
+ return Operand >> Count;
}
VOID
SetEncodedSizeOfBuf(
-UINT64 EncodedSize,
-UINT8 *EncodedData
+ UINT64 EncodedSize,
+ UINT8* EncodedData
)
{
- INT32 Index;
+ INT32 Index;
- EncodedData[LZMA_PROPS_SIZE] = EncodedSize & 0xFF;
- for (Index = LZMA_PROPS_SIZE + 1; Index <= LZMA_PROPS_SIZE + 7; Index++)
- {
- EncodedSize = RShiftU64(EncodedSize, 8);
- EncodedData[Index] = EncodedSize & 0xFF;
- }
+ EncodedData[LZMA_PROPS_SIZE] = EncodedSize & 0xFF;
+ for (Index = LZMA_PROPS_SIZE + 1; Index <= LZMA_PROPS_SIZE + 7; Index++)
+ {
+ EncodedSize = RShiftU64(EncodedSize, 8);
+ EncodedData[Index] = EncodedSize & 0xFF;
+ }
}
INT32
EFIAPI
LzmaCompress(
-CONST UINT8 *Source,
-UINT32 SourceSize,
-UINT8 *Destination,
-UINT32 *DestinationSize
+ CONST UINT8 *Source,
+ UINTN SourceSize,
+ UINT8 *Destination,
+ UINTN *DestinationSize
)
{
- SRes LzmaResult;
- CLzmaEncProps props;
- SizeT propsSize = LZMA_PROPS_SIZE;
- SizeT destLen = SourceSize + SourceSize / 3 + 128;
+ SRes LzmaResult;
+ CLzmaEncProps props;
+ SizeT propsSize = LZMA_PROPS_SIZE;
+ SizeT destLen = SourceSize + SourceSize / 3 + 128;
- if (*DestinationSize < destLen)
- {
- *DestinationSize = (UINT32)destLen;
- return EFI_BUFFER_TOO_SMALL;
- }
+ if (*DestinationSize < destLen)
+ {
+ *DestinationSize = destLen;
+ return EFI_BUFFER_TOO_SMALL;
+ }
- LzmaEncProps_Init(&props);
- props.dictSize = LZMA_DICTIONARY_SIZE;
- props.level = 9;
- props.fb = 273;
+ LzmaEncProps_Init(&props);
+ // TOOD: need to detect this instead of hardcoding
+ props.dictSize = LZMA_DICTIONARY_SIZE;
+ props.level = 9;
+ props.fb = 273;
- LzmaResult = LzmaEncode(
- (Byte*)((UINT8*)Destination + LZMA_HEADER_SIZE),
- &destLen,
- Source,
- SourceSize,
- &props,
- (UINT8*)Destination,
- &propsSize,
- props.writeEndMark,
- &g_ProgressCallback,
- &SzAllocForLzma,
- &SzAllocForLzma);
+ LzmaResult = LzmaEncode(
+ (Byte*)((UINT8*)Destination + LZMA_HEADER_SIZE),
+ &destLen,
+ Source,
+ SourceSize,
+ &props,
+ (UINT8*)Destination,
+ &propsSize,
+ props.writeEndMark,
+ &g_ProgressCallback,
+ &SzAllocForLzma,
+ &SzAllocForLzma);
- *DestinationSize = (UINT32)(destLen + LZMA_HEADER_SIZE);
+ *DestinationSize = destLen + LZMA_HEADER_SIZE;
- SetEncodedSizeOfBuf((UINT64)SourceSize, Destination);
+ SetEncodedSizeOfBuf(SourceSize, Destination);
- if (LzmaResult == SZ_OK) {
- return EFI_SUCCESS;
- }
- else {
- return EFI_INVALID_PARAMETER;
- }
+ if (LzmaResult == SZ_OK) {
+ return EFI_SUCCESS;
+ }
+ else {
+ return EFI_INVALID_PARAMETER;
+ }
}
diff --git a/common/LZMA/LzmaCompress.h b/common/LZMA/LzmaCompress.h
index eeadb5c..afed363 100644
--- a/common/LZMA/LzmaCompress.h
+++ b/common/LZMA/LzmaCompress.h
@@ -24,14 +24,14 @@ extern "C" {
#define LZMA_DICTIONARY_SIZE 0x800000
#define _LZMA_SIZE_OPT
- INT32
- EFIAPI
- LzmaCompress(
- const UINT8 *Source,
- UINT32 SourceSize,
- UINT8 *Destination,
- UINT32 *DestinationSize
- );
+ INT32
+ EFIAPI
+ LzmaCompress(
+ const UINT8 *Source,
+ UINTN SourceSize,
+ UINT8 *Destination,
+ UINTN *DestinationSize
+ );
#ifdef __cplusplus
}
diff --git a/common/LZMA/LzmaDecompress.c b/common/LZMA/LzmaDecompress.c
index 1bac9d7..03a3799 100644
--- a/common/LZMA/LzmaDecompress.c
+++ b/common/LZMA/LzmaDecompress.c
@@ -89,17 +89,13 @@ INT32
EFIAPI
LzmaGetInfo(
CONST VOID *Source,
-UINT32 SourceSize,
-UINT32 *DestinationSize
+UINTN SourceSize,
+UINTN *DestinationSize
)
{
- UInt64 DecodedSize;
-
ASSERT(SourceSize >= LZMA_HEADER_SIZE); (void)SourceSize;
-
- DecodedSize = GetDecodedSizeOfBuf((UINT8*)Source);
- *DestinationSize = (UINT32)DecodedSize;
+ *DestinationSize = (UINTN)GetDecodedSizeOfBuf((UINT8*)Source);
return U_SUCCESS;
}
@@ -126,8 +122,8 @@ INT32
EFIAPI
LzmaDecompress(
CONST VOID *Source,
-UINT32 SourceSize,
-VOID *Destination
+UINTN SourceSize,
+VOID *Destination
)
{
SRes LzmaResult;
diff --git a/common/Tiano/EfiTianoCompress.c b/common/Tiano/EfiTianoCompress.c
index a2fe4bf..afd2ec2 100644
--- a/common/Tiano/EfiTianoCompress.c
+++ b/common/Tiano/EfiTianoCompress.c
@@ -69,18 +69,15 @@ PutDword(
STATIC
EFI_STATUS
-AllocateMemory (
- );
+AllocateMemory (VOID);
STATIC
VOID
-FreeMemory (
- );
+FreeMemory (VOID);
STATIC
VOID
-InitSlide (
- );
+InitSlide (VOID);
STATIC
NODE
@@ -105,28 +102,23 @@ Split (
STATIC
VOID
-InsertNode (
- );
+InsertNode (VOID);
STATIC
VOID
-DeleteNode (
- );
+DeleteNode (VOID);
STATIC
VOID
-GetNextMatch (
- );
+GetNextMatch (VOID);
STATIC
EFI_STATUS
-Encode (
- );
+Encode (VOID);
STATIC
VOID
-CountTFreq (
- );
+CountTFreq (VOID);
STATIC
VOID
@@ -138,8 +130,7 @@ WritePTLen (
STATIC
VOID
-WriteCLen (
- );
+WriteCLen (VOID);
STATIC
VOID
@@ -155,8 +146,7 @@ EncodeP (
STATIC
VOID
-SendBlock (
- );
+SendBlock (VOID);
STATIC
VOID
@@ -167,18 +157,15 @@ Output (
STATIC
VOID
-HufEncodeStart (
- );
+HufEncodeStart (VOID);
STATIC
VOID
-HufEncodeEnd (
- );
+HufEncodeEnd (VOID);
STATIC
VOID
-MakeCrcTable (
- );
+MakeCrcTable (VOID);
STATIC
VOID
@@ -196,8 +183,7 @@ FreadCrc (
STATIC
VOID
-InitPutBits (
- );
+InitPutBits (VOID);
STATIC
VOID
diff --git a/common/Tiano/EfiTianoDecompress.c b/common/Tiano/EfiTianoDecompress.c
index 156392c..7f2f31a 100644
--- a/common/Tiano/EfiTianoDecompress.c
+++ b/common/Tiano/EfiTianoDecompress.c
@@ -100,10 +100,10 @@ Returns: (VOID)
--*/
{
- Sd->mBitBuf = (UINT32)(Sd->mBitBuf << NumOfBits);
+ Sd->mBitBuf = (UINT32) (((UINT64)Sd->mBitBuf) << NumOfBits);
while (NumOfBits > Sd->mBitCount) {
- Sd->mBitBuf |= (UINT32)(Sd->mSubBitBuf << (NumOfBits = (UINT16)(NumOfBits - Sd->mBitCount)));
+ Sd->mBitBuf |= (UINT32) (((UINT64)Sd->mSubBitBuf) << (NumOfBits = (UINT16) (NumOfBits - Sd->mBitCount)));
if (Sd->mCompSize > 0) {
//
diff --git a/common/descriptor.cpp b/common/descriptor.cpp
index 578bd82..7f072b7 100644
--- a/common/descriptor.cpp
+++ b/common/descriptor.cpp
@@ -25,13 +25,13 @@ const UINT8* calculateAddress16(const UINT8* baseAddress, const UINT16 baseOrLim
return baseAddress + baseOrLimit * 0x1000;
}
-// Calculate offset of region using it's base
+// Calculate offset of region using its base
UINT32 calculateRegionOffset(const UINT16 base)
{
return base * 0x1000;
}
-//Calculate size of region using it's base and limit
+//Calculate size of region using its base and limit
UINT32 calculateRegionSize(const UINT16 base, const UINT16 limit)
{
if (limit)
@@ -114,6 +114,14 @@ UString jedecIdToUString(UINT8 vendorId, UINT8 deviceId0, UINT8 deviceId1)
case 0x20BB19: return UString("Micron MT25Q256");
case 0x20BB20: return UString("Micron MT25Q512");
+ // Intel
+ case 0x898911: return UString("Intel 25F160S33B8");
+ case 0x898912: return UString("Intel 25F320S33B8");
+ case 0x898913: return UString("Intel 25F640S33B8");
+ case 0x898915: return UString("Intel 25F160S33T8");
+ case 0x898916: return UString("Intel 25F320S33T8");
+ case 0x898917: return UString("Intel 25F640S33T8");
+
// Atmel
case 0x1F4500: return UString("Atmel AT26DF081");
case 0x1F4501: return UString("Atmel AT26DF081A");
@@ -177,11 +185,15 @@ UString jedecIdToUString(UINT8 vendorId, UINT8 deviceId0, UINT8 deviceId1)
case 0x374016: return UString("Amic A25L032A");
// PMC
- case 0x7F9D13: return UString("PMC Pm25LV080B");
- case 0x7F9D14: return UString("PMC Pm25LV016B");
- case 0x7F9D44: return UString("PMC Pm25LQ080C");
- case 0x7F9D45: return UString("PMC Pm25LQ016C");
- case 0x7F9D46: return UString("PMC Pm25LQ032C");
+ case 0x9DF713: return UString("PMC Pm25LV080B");
+ case 0x9DF714: return UString("PMC Pm25LV016B");
+ case 0x9DF744: return UString("PMC Pm25LQ080C");
+ case 0x9DF745: return UString("PMC Pm25LQ016C");
+ case 0x9DF746: return UString("PMC Pm25LQ032C");
+ case 0x9DF77B: return UString("PMC Pm25LV512A");
+ case 0x9DF77C: return UString("PMC Pm25LV010A");
+ case 0x9DF77D: return UString("PMC Pm25LV020");
+ case 0x9DF77E: return UString("PMC Pm25LV040");
// ISSI
case 0x9D6017: return UString("ISSI Ix25LP064");
diff --git a/common/ffsparser.cpp b/common/ffsparser.cpp
index 7b27b91..db47964 100644
--- a/common/ffsparser.cpp
+++ b/common/ffsparser.cpp
@@ -1,6 +1,6 @@
/* ffsparser.cpp
-Copyright (c) 2016, Nikolaj Schlej. All rights reserved.
+Copyright (c) 2018, Nikolaj Schlej. All rights reserved.
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -14,7 +14,6 @@ WITHWARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include