+ FFSv3 support with large files and large sections
+ proper names for Flash Descriptor v2 regions (#89)
+ better alignment calculations (#96)
+ improved NVRAM parser
+ post IBB hash support for Boot Guard
+  bugfixes
+ companion tool updated
This commit is contained in:
Alex Matrosov 2017-12-10 17:56:00 -08:00
parent 02369442a2
commit 63088afd87
24 changed files with 583 additions and 453 deletions

View file

@ -1,5 +1,5 @@
/* uefiextract_main.cpp
Copyright (c) 2016, Nikolaj Schlej. All rights reserved.
Copyright (c) 2017, 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
@ -20,8 +20,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
a.setOrganizationName("CodeRush");
a.setOrganizationDomain("coderush.me");
a.setOrganizationName("LongSoft");
a.setOrganizationDomain("longsoft.me");
a.setApplicationName("UEFIExtract");
if (a.arguments().length() > 32) {
@ -63,17 +63,17 @@ int main(int argc, char *argv[])
// Get last VTF
std::vector<std::pair<std::vector<QString>, QModelIndex > > fitTable = ffsParser.getFitTable();
if (fitTable.size()) {
std::cout << "---------------------------------------------------------------------------" << std::endl;
std::cout << " Address | Size | Ver | CS | Type / Info " << std::endl;
std::cout << "---------------------------------------------------------------------------" << std::endl;
for (size_t i = 0; i < fitTable.size(); i++) {
std::cout << fitTable[i].first[0].toLatin1().constData() << " | "
<< fitTable[i].first[1].toLatin1().constData() << " | "
<< fitTable[i].first[2].toLatin1().constData() << " | "
<< fitTable[i].first[3].toLatin1().constData() << " | "
<< fitTable[i].first[4].toLatin1().constData() << " | "
<< fitTable[i].first[5].toLatin1().constData() << std::endl;
}
std::cout << "---------------------------------------------------------------------------" << std::endl;
std::cout << " Address | Size | Ver | CS | Type / Info " << std::endl;
std::cout << "---------------------------------------------------------------------------" << std::endl;
for (size_t i = 0; i < fitTable.size(); i++) {
std::cout << fitTable[i].first[0].toLatin1().constData() << " | "
<< fitTable[i].first[1].toLatin1().constData() << " | "
<< fitTable[i].first[2].toLatin1().constData() << " | "
<< fitTable[i].first[3].toLatin1().constData() << " | "
<< fitTable[i].first[4].toLatin1().constData() << " | "
<< fitTable[i].first[5].toLatin1().constData() << std::endl;
}
}
@ -84,7 +84,7 @@ int main(int argc, char *argv[])
if (a.arguments().length() == 3 && a.arguments().at(2) == QString("dump")) {
return (ffsDumper.dump(model.index(0, 0), fileInfo.fileName().append(".dump")) != U_SUCCESS);
}
else if (a.arguments().length() > 3 ||
else if (a.arguments().length() > 3 ||
(a.arguments().length() == 3 && a.arguments().at(2) != QString("all") && a.arguments().at(2) != QString("report"))) { // Dump specific files, without report
UINT32 returned = 0;
for (int i = 2; i < a.arguments().length(); i++) {
@ -94,7 +94,7 @@ int main(int argc, char *argv[])
}
return returned;
}
// Create ffsReport
FfsReport ffsReport(&model);
std::vector<QString> report = ffsReport.generate();
@ -108,7 +108,7 @@ int main(int argc, char *argv[])
file.close();
}
}
// Dump all non-leaf elements, with report, default
if (a.arguments().length() == 2) {
return (ffsDumper.dump(model.index(0, 0), fileInfo.fileName().append(".dump")) != U_SUCCESS);
@ -121,12 +121,12 @@ int main(int argc, char *argv[])
}
}
// If parameters are different, show version and usage information
std::cout << "UEFIExtract 0.13.4" << 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
<< " UEFIExtract imagefile report - only generate report, no dump needed." << std::endl
<< " 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;
std::cout << "UEFIExtract 0.13.5" << 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
<< " UEFIExtract imagefile report - only generate report, no dump needed." << std::endl
<< " 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;
}