From f9978b58a4040ea0ffeff6f49db067d7f7b92564 Mon Sep 17 00:00:00 2001 From: Cyrille Bagard Date: Sun, 14 Oct 2018 15:57:59 +0200 Subject: Cleaned code. --- plugins/pychrysalide/plugin.c | 2 ++ src/plugins/plugin-int.h | 66 ++++++------------------------------------- 2 files changed, 11 insertions(+), 57 deletions(-) diff --git a/plugins/pychrysalide/plugin.c b/plugins/pychrysalide/plugin.c index e57ffaf..5454740 100644 --- a/plugins/pychrysalide/plugin.c +++ b/plugins/pychrysalide/plugin.c @@ -773,6 +773,8 @@ static bool py_plugin_module_define_constants(PyTypeObject *obj_type) result &= PyDict_AddIntMacro(obj_type, PGA_DISASSEMBLY_RANKED); result &= PyDict_AddIntMacro(obj_type, PGA_DISASSEMBLY_ENDED); + result &= PyDict_AddIntMacro(obj_type, PGA_DETECTION_OBFUSCATORS); + return result; } diff --git a/src/plugins/plugin-int.h b/src/plugins/plugin-int.h index 0ab4f56..19993e9 100644 --- a/src/plugins/plugin-int.h +++ b/src/plugins/plugin-int.h @@ -21,8 +21,8 @@ */ -#ifndef _FORMAT_PLUGINS_PLUGIN_INT_H -#define _FORMAT_PLUGINS_PLUGIN_INT_H +#ifndef _PLUGINS_PLUGIN_INT_H +#define _PLUGINS_PLUGIN_INT_H #include @@ -41,12 +41,6 @@ /* Prend acte du [dé]chargement du greffon. */ typedef bool (* pg_management_fc) (GPluginModule *); -/* Exécute une action pendant un désassemblage de binaire. */ -typedef void (* pg_process_disassembly_fc) (const GPluginModule *, PluginAction, GLoadedBinary *, GtkStatusStack *, GProcContext *); - - - - /* Procède à une opération liée à un contenu binaire. */ typedef void (* pg_handle_content_fc) (const GPluginModule *, PluginAction, GBinContent *, wgroup_id_t, GtkStatusStack *); @@ -62,36 +56,13 @@ typedef bool (* pg_handle_format_fc) (const GPluginModule *, PluginAction, GBinF /* Procède à un préchargement de format de fichier. */ typedef bool (* pg_preload_format_fc) (const GPluginModule *, PluginAction, GBinFormat *, GPreloadInfo *, GtkStatusStack *); +/* Exécute une action pendant un désassemblage de binaire. */ +typedef void (* pg_process_disassembly_fc) (const GPluginModule *, PluginAction, GLoadedBinary *, GtkStatusStack *, GProcContext *); + /* Effectue la détection d'effets d'outils externes. */ typedef void (* pg_detect_tools_fc) (const GPluginModule *, PluginAction, const GLoadedContent *, bool, char ***, size_t *); - - - - -/* Précise le nom associé au greffon. */ -//typedef char * (* get_plugin_name_fc) (void); - -/* Procède à l'initialisation du greffon. */ -//typedef bool (* init_plugin_fc) (GPluginModule *, GObject *); - -/* Procède à l'extinction du greffon. */ -//typedef void (* exit_plugin_fc) (GPluginModule *); - -/* Fournit une indication sur le type d'opération(s) menée(s). */ -//typedef PluginAction (* get_plugin_action_fc) (const GPluginModule *); - -/* Identifie un format à associer à un contenu binaire. */ -//typedef MatchingFormatAction (* is_matching_fc) (const GPluginModule *, char **, bin_t **, off_t *); - -/* Exécute une action définie sur un binaire chargé. */ -//typedef bool (* execute_action_on_binary_fc) (const GPluginModule *, GLoadedBinary *, PluginAction); - -/* Exécute une action relative à un débogueur. */ -//typedef bool (* execute_on_debugger_fc) (const GPluginModule *, GBinaryDebugger *, PluginAction); - - /* Greffon pour Chrysalide (instance) */ struct _GPluginModule { @@ -109,28 +80,15 @@ struct _GPluginModule pg_management_fc init; /* Procédure d'initialisation */ pg_management_fc exit; /* Procédure d'extinction */ - pg_process_disassembly_fc process_disass; /* Catégorie 'désassemblage' */ - - - //char *name; /* Nom associé au greffon */ - //PluginType type; /* Type(s) du greffon */ - - //init_plugin_fc init; /* Procédure d'initialisation */ - //exit_plugin_fc exit; /* Procédure d'extinction */ - //get_plugin_action_fc get_action; /* Opération(s) menée(s) */ - - //is_matching_fc is_matching; /* Recherche de correspondance */ - - //execute_action_on_binary_fc exec_on_bin;/* Action sur un binaire */ - //execute_on_debugger_fc handle_debugger; /* Action liée à un débogueur */ - - pg_handle_content_fc handle_content; /* Explorations ou résolutions */ 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_process_disassembly_fc process_disass; /* Catégorie 'désassemblage' */ + pg_detect_tools_fc detect; /* Lancement de détections */ }; @@ -144,7 +102,6 @@ struct _GPluginModuleClass }; - /* Présente dans le journal un message simple. */ void g_plugin_module_log_simple_message(const GPluginModule *, LogMessageType, const char *); @@ -153,9 +110,4 @@ void g_plugin_module_log_variadic_message(const GPluginModule *, LogMessageType, - - - - - -#endif /* _FORMAT_PLUGINS_PLUGIN_INT_H */ +#endif /* _PLUGINS_PLUGIN_INT_H */ -- cgit v0.11.2-87-g4458