diff --git a/efiXloader/uefitool.cpp b/efiXloader/uefitool.cpp index 5c8a8244..a89d61c6 100644 --- a/efiXloader/uefitool.cpp +++ b/efiXloader/uefitool.cpp @@ -272,6 +272,8 @@ void efiloader::Uefitool::dump(const UModelIndex &index, uint8_t el_type, .is_null()) { // check if GUID already exists get_unique_name(module_name); images_guids[guid.c_str()] = module_name.c_str(); + mod_types[module_name.c_str()] = + fileTypeToUString(model.subtype(index.parent())).toLocal8Bit(); file->qname.swap(module_name); file->write(); files.push_back(file); @@ -307,6 +309,8 @@ void efiloader::Uefitool::dump(const UModelIndex &index, uint8_t el_type, if (module_name.size()) { // save image to the images_guids images_guids[module_name.c_str()] = module_name.c_str(); + mod_types[module_name.c_str()] = + fileTypeToUString(model.subtype(index.parent())).toLocal8Bit(); } } break; @@ -370,4 +374,8 @@ void efiloader::Uefitool::dump_jsons() { out.replace_extension("").replace_extension(".images.json"); std::ofstream out_guids(out); out_guids << std::setw(4) << images_guids << std::endl; + // Dump module types + out.replace_extension("").replace_extension(".mod_types.json"); + std::ofstream out_mod_types(out); + out_mod_types << std::setw(4) << mod_types << std::endl; } diff --git a/efiXloader/uefitool.h b/efiXloader/uefitool.h index 3e69b618..f29e5322 100644 --- a/efiXloader/uefitool.h +++ b/efiXloader/uefitool.h @@ -112,7 +112,7 @@ class Uefitool { } messages = ffs.getMessages(); } - ~Uefitool(){}; + ~Uefitool() {}; void show_messages(); bool messages_occurs() { return !messages.empty(); }; void dump(); @@ -133,6 +133,7 @@ class Uefitool { void dump_jsons(); // dump JSON with DEPEX and GUIDs information for each image json all_deps; // DEPEX information for each image json images_guids; // matching the modules to the parent's GUIDs + json mod_types; // EFI module name and its type TreeModel model; const char *buffer; uint32_t buffer_size;