Skip to content

Commit

Permalink
get module name by key instead of index, handle exceptions for build_…
Browse files Browse the repository at this point in the history
…modules_sequence
  • Loading branch information
yeggor committed Oct 5, 2024
1 parent 3b5acc5 commit 6fe16b1
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 2 additions & 2 deletions efiXplorer/efi_deps.cc
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ json efi_deps_t::get_module_info(std::string module) {
// can not get name for module
continue;
}
std::string dmodule_name = m_modules_guids[dmodule_guid][0];
std::string dmodule_name = m_modules_guids[dmodule_guid]["name"];
if (dmodule_name == module) {
deps_protocols = element.value();
found = true;
Expand All @@ -268,7 +268,7 @@ string_set_t efi_deps_t::get_apriori_modules() {
for (auto file : files) {
auto modules = m_uefitool_deps[file];
for (auto &mguid : modules) {
std::string module = m_modules_guids[mguid][0];
std::string module = m_modules_guids[mguid]["name"];
apriori_modules.insert(module);
efi_utils::log("module from %s: %s\n", file.c_str(), module.c_str());
}
Expand Down
8 changes: 7 additions & 1 deletion efiXplorer/efi_ui.cc
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,13 @@ void attach_action_protocols_deps() {
// action handler for showing the sequence of modules execution
struct modules_seq_handler_t : public action_handler_t {
virtual int idaapi activate(action_activation_ctx_t *ctx) {
g_deps.build_modules_sequence();
try {
g_deps.build_modules_sequence();
} catch (std::exception &e) {
efi_utils::log("failed to build modules sequence: %s\n", e.what());
return -1;
}

std::string s = g_deps.m_modules_sequence.dump(2);
efi_utils::log("sequence of modules execution: %s\n", s.c_str());

Expand Down

0 comments on commit 6fe16b1

Please sign in to comment.