summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-11-18 18:46:08 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-11-18 18:46:08 (GMT)
commit0f914ad3fdcc1ebac5789b55b9677e7868016e21 (patch)
treebafc46ac54d02ff35310c3433615e6b74010a920 /src/plugins
parent23bc425f9c35c31a80d65d824452c8728614a206 (diff)
Allowed to attach debug information to formats.
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/pglist.h3
-rw-r--r--src/plugins/plugin-def.h4
-rw-r--r--src/plugins/plugin-int.h8
-rw-r--r--src/plugins/plugin.c25
-rw-r--r--src/plugins/plugin.h6
5 files changed, 24 insertions, 22 deletions
diff --git a/src/plugins/pglist.h b/src/plugins/pglist.h
index 31c9c29..0c8f6af 100644
--- a/src/plugins/pglist.h
+++ b/src/plugins/pglist.h
@@ -109,6 +109,9 @@ GPluginModule **get_all_plugins_for_action(PluginAction, size_t *);
#define preload_binary_format(a, f, i, s) \
process_all_plugins_for(a, g_plugin_module_preload_binary_format, f, i, s)
+#define attach_debug_format(f) \
+ process_all_plugins_for(PGA_FORMAT_ATTACH_DEBUG, g_plugin_module_attach_debug_format, f)
+
/* DPS_DISASSEMBLY */
#define process_disassembly_event(a, b, s, c) \
diff --git a/src/plugins/plugin-def.h b/src/plugins/plugin-def.h
index fd05b00..96b04b1 100644
--- a/src/plugins/plugin-def.h
+++ b/src/plugins/plugin-def.h
@@ -147,7 +147,7 @@ typedef enum _PluginAction
PGA_FORMAT_PRELOAD = DPC_BINARY_PROCESSING | DPS_FORMAT | DEFINE_PLUGIN_ACTION(1),
/* Accompagnement du chargement */
- PGA_FORMAT_LOADER_LAST = DPC_BINARY_PROCESSING | DPS_FORMAT | DEFINE_PLUGIN_ACTION(2),
+ PGA_FORMAT_ATTACH_DEBUG = DPC_BINARY_PROCESSING | DPS_FORMAT | DEFINE_PLUGIN_ACTION(2),
/* Fin de l'analyse d'un format */
PGA_FORMAT_ANALYSIS_ENDED = DPC_BINARY_PROCESSING | DPS_FORMAT | DEFINE_PLUGIN_ACTION(3),
@@ -155,7 +155,7 @@ typedef enum _PluginAction
/* Début de la vague finale d'analyse d'un format */
PGA_FORMAT_POST_ANALYSIS_STARTED = DPC_BINARY_PROCESSING | DPS_FORMAT | DEFINE_PLUGIN_ACTION(4),
- /* Début de la vague finale d'analyse d'un format */
+ /* Fin de la vague finale d'analyse d'un format */
PGA_FORMAT_POST_ANALYSIS_ENDED = DPC_BINARY_PROCESSING | DPS_FORMAT | DEFINE_PLUGIN_ACTION(5),
/**
diff --git a/src/plugins/plugin-int.h b/src/plugins/plugin-int.h
index cee6242..8df3527 100644
--- a/src/plugins/plugin-int.h
+++ b/src/plugins/plugin-int.h
@@ -53,12 +53,12 @@ typedef void (* pg_include_theme_fc) (const GPluginModule *, PluginAction, char
/* Assure l'interprétation d'un format en différé. */
typedef bool (* pg_handle_format_analysis_fc) (const GPluginModule *, PluginAction, GBinFormat *, wgroup_id_t, GtkStatusStack *);
-/* Procède à une opération liée au format de fichier uniquement. */
-typedef bool (* pg_handle_format_fc) (const GPluginModule *, PluginAction, GBinFormat *, GtkStatusStack *);
-
/* Procède à un préchargement de format de fichier. */
typedef bool (* pg_preload_format_fc) (const GPluginModule *, PluginAction, GBinFormat *, GPreloadInfo *, GtkStatusStack *);
+/* Procède au rattachement d'éventuelles infos de débogage. */
+typedef void (* pg_attach_debug) (const GPluginModule *, PluginAction, GExeFormat *);
+
/* Exécute une action pendant un désassemblage de binaire. */
typedef void (* pg_process_disassembly_fc) (const GPluginModule *, PluginAction, GLoadedBinary *, GtkStatusStack *, GProcContext *);
@@ -89,8 +89,8 @@ struct _GPluginModule
pg_handle_loaded_fc handle_loaded; /* Traitement de contenu chargé*/
pg_handle_format_analysis_fc handle_fmt_analysis; /* Analyse de format */
- pg_handle_format_fc handle_format; /* Manipulation du format */
pg_preload_format_fc preload_format; /* Préchargement d'un format */
+ pg_attach_debug attach_debug; /* Informations de débogage */
pg_process_disassembly_fc process_disass; /* Catégorie 'désassemblage' */
diff --git a/src/plugins/plugin.c b/src/plugins/plugin.c
index 161d6a6..1608032 100644
--- a/src/plugins/plugin.c
+++ b/src/plugins/plugin.c
@@ -377,15 +377,15 @@ GPluginModule *g_plugin_module_new(const gchar *filename)
goto bad_plugin;
break;
- case PGA_FORMAT_LOADER_LAST:
+ case PGA_FORMAT_PRELOAD:
if (!load_plugin_symbol(result->module,
- "handle_binary_format", &result->handle_format))
+ "preload_binary_format", &result->preload_format))
goto bad_plugin;
break;
- case PGA_FORMAT_PRELOAD:
+ case PGA_FORMAT_ATTACH_DEBUG:
if (!load_plugin_symbol(result->module,
- "preload_binary_format", &result->preload_format))
+ "chrysalide_plugin_attach_debug", &result->attach_debug))
goto bad_plugin;
break;
@@ -869,9 +869,10 @@ bool g_plugin_module_handle_binary_format_analysis(const GPluginModule *plugin,
* Paramètres : plugin = greffon à manipuler. *
* action = type d'action attendue. *
* format = format de binaire à manipuler pendant l'opération. *
+* info = informations à constituer en avance de phase. *
* status = barre de statut à tenir informée. *
* *
-* Description : Procède à une opération liée au format de fichier uniquement.*
+* Description : Procède à un préchargement de format de fichier. *
* *
* Retour : Bilan de l'exécution du traitement. *
* *
@@ -879,9 +880,9 @@ bool g_plugin_module_handle_binary_format_analysis(const GPluginModule *plugin,
* *
******************************************************************************/
-bool g_plugin_module_handle_binary_format(const GPluginModule *plugin, PluginAction action, GBinFormat *format, GtkStatusStack *status)
+bool g_plugin_module_preload_binary_format(const GPluginModule *plugin, PluginAction action, GBinFormat *format, GPreloadInfo *info, GtkStatusStack *status)
{
- return plugin->handle_format(plugin, action, format, status);
+ return plugin->preload_format(plugin, action, format, info, status);
}
@@ -891,20 +892,18 @@ bool g_plugin_module_handle_binary_format(const GPluginModule *plugin, PluginAct
* Paramètres : plugin = greffon à manipuler. *
* action = type d'action attendue. *
* format = format de binaire à manipuler pendant l'opération. *
-* info = informations à constituer en avance de phase. *
-* status = barre de statut à tenir informée. *
* *
-* Description : Procède à un préchargement de format de fichier. *
+* Description : Procède au rattachement d'éventuelles infos de débogage. *
* *
-* Retour : Bilan de l'exécution du traitement. *
+* Retour : - *
* *
* Remarques : - *
* *
******************************************************************************/
-bool g_plugin_module_preload_binary_format(const GPluginModule *plugin, PluginAction action, GBinFormat *format, GPreloadInfo *info, GtkStatusStack *status)
+void g_plugin_module_attach_debug_format(const GPluginModule *plugin, PluginAction action, GExeFormat *format)
{
- return plugin->preload_format(plugin, action, format, info, status);
+ plugin->attach_debug(plugin, action, format);
}
diff --git a/src/plugins/plugin.h b/src/plugins/plugin.h
index 1127604..86dba25 100644
--- a/src/plugins/plugin.h
+++ b/src/plugins/plugin.h
@@ -103,12 +103,12 @@ void g_plugin_module_handle_loaded_content(const GPluginModule *, PluginAction,
/* Procède à une opération liée à l'analyse d'un format. */
bool g_plugin_module_handle_binary_format_analysis(const GPluginModule *, PluginAction, GBinFormat *, wgroup_id_t, GtkStatusStack *);
-/* Procède à une opération liée au format de fichier uniquement. */
-bool g_plugin_module_handle_binary_format(const GPluginModule *, PluginAction, GBinFormat *, GtkStatusStack *);
-
/* Procède à un préchargement de format de fichier. */
bool g_plugin_module_preload_binary_format(const GPluginModule *, PluginAction, GBinFormat *, GPreloadInfo *, GtkStatusStack *);
+/* Procède au rattachement d'éventuelles infos de débogage. */
+void g_plugin_module_attach_debug_format(const GPluginModule *, PluginAction, GExeFormat *);
+
/* Exécute une action pendant un désassemblage de binaire. */
void g_plugin_module_process_disassembly_event(const GPluginModule *, PluginAction, GLoadedBinary *, GtkStatusStack *, GProcContext *);