Skip to content

Commit ddf40c9

Browse files
author
Nikolaj Schlej
committed
Add guids command to UEFIExtract
1 parent d7c8340 commit ddf40c9

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

UEFIExtract/uefiextract_main.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,10 @@ void print_usage()
3636
<< "Usage: UEFIExtract {-h | --help | -v | --version} - show help and/or version information." << std::endl
3737
<< " UEFIExtract imagefile - generate report and dump only leaf tree items into .dump folder." << std::endl
3838
<< " UEFIExtract imagefile all - generate report and dump all tree items." << std::endl
39-
<< " UEFIExtract imagefile unpack - generate report and dump all tree items in one dir." << std::endl
39+
<< " UEFIExtract imagefile unpack - generate report and dump all tree items into a single folder." << std::endl
4040
<< " UEFIExtract imagefile dump - only generate dump, no report needed." << std::endl
4141
<< " UEFIExtract imagefile report - only generate report, no dump needed." << std::endl
42+
<< " UEFIExtract imagefile guids - generate a CSV file with named GUIDs present in the image." << std::endl
4243
<< " UEFIExtract imagefile GUID_1 ... [ -o FILE_1 ... ] [ -m MODE_1 ... ] [ -t TYPE_1 ... ] -" << std::endl
4344
<< " Dump only FFS file(s) with specific GUID(s), without report." << std::endl
4445
<< " Type is section type or FF to ignore. Mode is one of: all, body, header, info, file." << std::endl
@@ -93,6 +94,13 @@ int main(int argc, char *argv[])
9394
if (argc == 3 && !std::strcmp(argv[2], "dump")) {
9495
return (ffsDumper.dump(model.index(0, 0), path + UString(".dump")) != U_SUCCESS);
9596
}
97+
// Dump named GUIDs found in the image
98+
else if (argc == 3 && !std::strcmp(argv[2], "guids")) {
99+
GuidDatabase db = guidDatabaseFromTreeRecursive(&model, model.index(0, 0));
100+
if (!db.empty()) {
101+
return guidDatabaseExportToFile(path + UString(".guids.csv"), db);
102+
}
103+
}
96104
else if (argc > 3 ||
97105
(argc == 3 && std::strcmp(argv[2], "all") != 0 && std::strcmp(argv[2], "report") != 0)) { // Dump specific files, without report
98106
std::vector<UString> inputs, outputs;

0 commit comments

Comments
 (0)