diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2019-05-12 22:09:53 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2019-05-12 22:09:53 (GMT) |
commit | 00e93226e72bdb18853580f553e32df111422936 (patch) | |
tree | 9c346903d4506cae2df19b9314cf307c783c0cb3 /src/analysis | |
parent | e44ffc323c8a9d4b446baba6e0b131107312fa84 (diff) |
Simplified the way processors are registered.
Diffstat (limited to 'src/analysis')
-rw-r--r-- | src/analysis/binary.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/analysis/binary.c b/src/analysis/binary.c index 2bcc88d..cfb4ea0 100644 --- a/src/analysis/binary.c +++ b/src/analysis/binary.c @@ -1701,8 +1701,8 @@ static bool g_loaded_binary_analyze(GLoadedBinary *binary, bool cache, wgroup_id { bool result; /* Bilan à retourner */ GBinFormat *format; /* Format lié au binaire */ - const char *desc; /* Description humaine associée*/ const char *arch; /* Architecture d'exécution */ + const char *desc; /* Description humaine associée*/ bool has_virt; /* Présence de virtuel ? */ GProcContext *context; /* Contexte de suivi dédié */ GWidthTracker *tracker; /* Gestionnaire de largeur */ @@ -1724,26 +1724,27 @@ static bool g_loaded_binary_analyze(GLoadedBinary *binary, bool cache, wgroup_id /* Architecture visée */ arch = g_exe_format_get_target_machine(binary->format); - desc = get_arch_processor_description(arch); - if (desc == NULL) + if (arch == NULL) { log_simple_message(LMT_INFO, _("Unknown architecture")); result = false; goto glba_exit; } - else - log_variadic_message(LMT_INFO, _("Detected architecture: %s"), desc); - binary->proc = get_arch_processor_for_name(arch); + binary->proc = get_arch_processor_for_key(arch); if (binary->proc == NULL) { - log_simple_message(LMT_ERROR, _("Unable to load the required processor")); + log_variadic_message(LMT_ERROR, _("Unable to load the required processor (%s)"), arch); result = false; goto glba_exit; } + desc = g_arch_processor_get_desc(binary->proc); + + log_variadic_message(LMT_INFO, _("Detected architecture: %s"), desc); + g_signal_connect(binary->proc, "changed", G_CALLBACK(on_binary_processor_changed), binary); has_virt = g_arch_processor_has_virtual_space(binary->proc); |