summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/analysis/blocks/flow.c4
-rw-r--r--src/analysis/disass/disassembler.c4
-rw-r--r--src/analysis/disass/macro.c4
-rw-r--r--src/plugins/pglist.c15
-rw-r--r--src/plugins/plugin-int.h3
-rw-r--r--src/plugins/plugin.c10
-rw-r--r--src/plugins/plugin.h2
7 files changed, 21 insertions, 21 deletions
diff --git a/src/analysis/blocks/flow.c b/src/analysis/blocks/flow.c
index 62856dd..2bdd0cf 100644
--- a/src/analysis/blocks/flow.c
+++ b/src/analysis/blocks/flow.c
@@ -203,10 +203,10 @@ GInstrBlock *g_flow_block_new(GArchInstruction *instrs, GArchInstruction *first,
g_arch_instruction_get_location(first, NULL, NULL, &addr);
- printf(" ! new block @ 0x%llx - ", addr);
+ //printf(" ! new block @ 0x%llx - ", addr);
g_arch_instruction_get_location(last, NULL, NULL, &addr);
- printf("0x%llx\n", addr);
+ //printf("0x%llx\n", addr);
diff --git a/src/analysis/disass/disassembler.c b/src/analysis/disass/disassembler.c
index e7c972d..6147f3b 100644
--- a/src/analysis/disass/disassembler.c
+++ b/src/analysis/disass/disassembler.c
@@ -257,7 +257,7 @@ static void g_delayed_disassembly_process(GDelayedDisassembly *disass, GtkExtSta
run_plugins_on_binary(disass->binary, PGA_BINARY_BOUNDED, true);
/* Quatrième étape */
-
+#if 0
id = gtk_extended_status_bar_push(statusbar, _("Grouping routines instructions..."), true);
qsort(routines, routines_count, sizeof(GBinRoutine *), (__compar_fn_t)g_binary_routine_rcompare);
@@ -267,7 +267,7 @@ static void g_delayed_disassembly_process(GDelayedDisassembly *disass, GtkExtSta
gtk_extended_status_bar_remove(statusbar, id);
run_plugins_on_binary(disass->binary, PGA_BINARY_GROUPED, true);
-
+#endif
/* Cinquième étape */
id = gtk_extended_status_bar_push(statusbar, _("Printing disassembled code..."), true);
diff --git a/src/analysis/disass/macro.c b/src/analysis/disass/macro.c
index fc5d8dc..7fda6b9 100644
--- a/src/analysis/disass/macro.c
+++ b/src/analysis/disass/macro.c
@@ -238,7 +238,7 @@ static GInstrBlock *build_instruction_block(GArchInstruction *instrs, vmpa_t sta
first = NULL;
last = NULL;
- printf("[+] blocking 0x%08llx -> 0x%08llx... stop @ 0x%08llx\n", start, end, stop);
+ //printf("[+] blocking 0x%08llx -> 0x%08llx... stop @ 0x%08llx\n", start, end, stop);
for (iter = g_arch_instruction_find_by_address(instrs, start, true);
iter != NULL;
@@ -385,7 +385,7 @@ void group_routines_instructions(GArchInstruction *list, GBinRoutine **routines,
end = start + g_binary_routine_get_size(routines[i]);
- printf("==== %s ====\n", g_binary_routine_to_string(routines[i]));
+ //printf("==== %s ====\n", g_binary_routine_to_string(routines[i]));
block = build_instruction_block(list, start, end, VMPA_MAX);
diff --git a/src/plugins/pglist.c b/src/plugins/pglist.c
index bca3e6a..6b51690 100644
--- a/src/plugins/pglist.c
+++ b/src/plugins/pglist.c
@@ -151,13 +151,10 @@ void browse_directory_for_plugins(plugins_list *list, const char *dir)
else
{
- plugin = g_plugin_module_new(filename, list->ref);
+ plugin = g_plugin_module_new(filename);
if (plugin != NULL)
- {
- list->plugins = (GPluginModule **)realloc(list->plugins, ++list->plugins_count * sizeof(GPluginModule *));
- list->plugins[list->plugins_count - 1] = plugin;
- }
+ add_plugin_to_main_list(plugin);
}
@@ -253,6 +250,14 @@ void add_plugin_to_main_list(GPluginModule *plugin)
list = &_list;
+ if (plugin->init != NULL && !plugin->init(plugin, list->ref))
+ {
+ log_variadic_message(LMT_ERROR, _("Initialization of plugin '%s' failed !"),
+ plugin->filename);
+ g_object_unref(G_OBJECT(plugin));
+ return;
+ }
+
list->plugins = (GPluginModule **)realloc(list->plugins, ++list->plugins_count * sizeof(GPluginModule *));
list->plugins[list->plugins_count - 1] = plugin;
diff --git a/src/plugins/plugin-int.h b/src/plugins/plugin-int.h
index 9a5c37c..055f6ff 100644
--- a/src/plugins/plugin-int.h
+++ b/src/plugins/plugin-int.h
@@ -37,7 +37,7 @@
/* Précise le nom associé au greffon. */
typedef char * (* get_plugin_name_fc) (void);
-/* Procède à l'initialisation du greffon */
+/* Procède à l'initialisation du greffon. */
typedef bool (* init_plugin_fc) (GPluginModule *, GObject *);
/* Fournit une indication sur le type d'opération(s) menée(s). */
@@ -61,6 +61,7 @@ struct _GPluginModule
GModule *module; /* Abstration de manipulation */
char *name; /* Nom associé au greffon */
+ char *filename; /* Fichier associé au greffon */
PluginType type; /* Type(s) du greffon */
init_plugin_fc init; /* Procédure d'initialisation */
diff --git a/src/plugins/plugin.c b/src/plugins/plugin.c
index c6a49c6..dabe493 100644
--- a/src/plugins/plugin.c
+++ b/src/plugins/plugin.c
@@ -90,7 +90,6 @@ static void g_plugin_module_init(GPluginModule *line)
/******************************************************************************
* *
* Paramètres : filename = nom du fichier à charger. *
-* ref = espace de référencement global. *
* *
* Description : Crée un module pour un greffon donné. *
* *
@@ -100,7 +99,7 @@ static void g_plugin_module_init(GPluginModule *line)
* *
******************************************************************************/
-GPluginModule *g_plugin_module_new(const gchar *filename, GObject *ref)
+GPluginModule *g_plugin_module_new(const gchar *filename)
{
GPluginModule *result; /* Structure à retourner */
get_plugin_name_fc get_name; /* Nom du greffon */
@@ -123,6 +122,7 @@ GPluginModule *g_plugin_module_new(const gchar *filename, GObject *ref)
}
result->name = get_name();
+ result->filename = strdup(filename);
if (!g_module_symbol(result->module, "init_plugin", (gpointer *)&result->init))
result->init = NULL;
@@ -170,12 +170,6 @@ GPluginModule *g_plugin_module_new(const gchar *filename, GObject *ref)
- if (result->init != NULL && !result->init(result, ref))
- {
- log_variadic_message(LMT_ERROR, _("Initialization of plugin '%s' failed !"), filename);
- goto bad_plugin;
- }
-
dir = strdup(filename);
dir = dirname(dir);
diff --git a/src/plugins/plugin.h b/src/plugins/plugin.h
index 6fbba4d..c0f6cd1 100644
--- a/src/plugins/plugin.h
+++ b/src/plugins/plugin.h
@@ -52,7 +52,7 @@ typedef struct _GPluginModuleClass GPluginModuleClass;
GType g_plugin_module_get_type(void);
/* Crée un module pour un greffon donné. */
-GPluginModule *g_plugin_module_new(const gchar *, GObject *);
+GPluginModule *g_plugin_module_new(const gchar *);
/* Fournit le nom associé au greffon. */
const char *g_plugin_module_get_name(const GPluginModule *);