summaryrefslogtreecommitdiff
path: root/src/analysis/binary.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-05-12 22:09:53 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-05-12 22:09:53 (GMT)
commit00e93226e72bdb18853580f553e32df111422936 (patch)
tree9c346903d4506cae2df19b9314cf307c783c0cb3 /src/analysis/binary.c
parente44ffc323c8a9d4b446baba6e0b131107312fa84 (diff)
Simplified the way processors are registered.
Diffstat (limited to 'src/analysis/binary.c')
-rw-r--r--src/analysis/binary.c15
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);