diff --git a/UEFITool/uefitool.cpp b/UEFITool/uefitool.cpp
index 23cb60d..f0501a8 100644
--- a/UEFITool/uefitool.cpp
+++ b/UEFITool/uefitool.cpp
@@ -65,6 +65,7 @@ markingEnabled(true)
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->actionExportDiscoveredGuids, SIGNAL(triggered()), this, SLOT(exportDiscoveredGuids()));
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()));
@@ -654,6 +655,9 @@ void UEFITool::openImageFile(QString path)
// Enable generateReport
ui->actionGenerateReport->setEnabled(true);
+ // Enable saving GUIDs
+ ui->actionExportDiscoveredGuids->setEnabled(true);
+
// Set current directory
currentDir = fileInfo.absolutePath();
@@ -1009,6 +1013,16 @@ void UEFITool::loadDefaultGuidDatabase()
openImageFile(currentPath);
}
+void UEFITool::exportDiscoveredGuids()
+{
+ GuidDatabase db = guidDatabaseFromTreeRecursive(model, model->index(0, 0));
+ if (!db.empty()) {
+ QString path = QFileDialog::getSaveFileName(this, tr("Save parsed GUIDs to datavase"), currentPath + ".guids.csv", tr("Comma-separated values files (*.csv);;All files (*)"));
+ if (!path.isEmpty())
+ guidDatabseExportToFile(path, db);
+ }
+}
+
void UEFITool::generateReport()
{
QString path = QFileDialog::getSaveFileName(this, tr("Save report to text file"), currentPath + ".report.txt", tr("Text files (*.txt);;All files (*)"));
diff --git a/UEFITool/uefitool.h b/UEFITool/uefitool.h
index 74a70c9..021df95 100644
--- a/UEFITool/uefitool.h
+++ b/UEFITool/uefitool.h
@@ -117,8 +117,9 @@ private slots:
void writeSettings();
void loadGuidDatabase();
- void unloadGuidDatabase();
- void loadDefaultGuidDatabase();
+ void unloadGuidDatabase();
+ void loadDefaultGuidDatabase();
+ void exportDiscoveredGuids();
void generateReport();
void currentTabChanged(int index);
diff --git a/UEFITool/uefitool.ui b/UEFITool/uefitool.ui
index 50a5252..0d6a502 100644
--- a/UEFITool/uefitool.ui
+++ b/UEFITool/uefitool.ui
@@ -327,6 +327,7 @@
+
@@ -907,6 +908,14 @@
Ctrl+Alt+D
+
+
+ false
+
+
+ Export discovered GUIDs
+
+
diff --git a/common/guiddatabase.cpp b/common/guiddatabase.cpp
index dd76367..8361771 100644
--- a/common/guiddatabase.cpp
+++ b/common/guiddatabase.cpp
@@ -14,24 +14,15 @@ WITHWARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include "ubytearray.h"
#include "ffs.h"
-#if defined(U_ENABLE_GUID_DATABASE_SUPPORT)
-#include