summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-09-18 20:12:26 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-09-18 20:12:26 (GMT)
commitaa3cb06f056ccf1a0467eaff8aa4b40701902f5e (patch)
treedde8cdc10459f932235ee8709dda3ae6b164c752
parent175e8193759e01b45b1f6d2d7970e2993ec8c364 (diff)
Removed the old way to load binaries.
-rw-r--r--plugins/dex/format.h3
-rw-r--r--plugins/elf/format.h3
-rw-r--r--plugins/mobicore/mclf.h3
-rw-r--r--plugins/pychrysalide/core/Makefile.am1
-rw-r--r--plugins/pychrysalide/core/formats.c201
-rw-r--r--plugins/pychrysalide/core/formats.h42
-rw-r--r--plugins/pychrysalide/core/module.c2
-rw-r--r--plugins/pychrysalide/plugin.c138
-rw-r--r--plugins/readdex/class.h1
-rw-r--r--plugins/readdex/ids.h1
-rw-r--r--plugins/ropgadgets/select.c249
-rw-r--r--src/analysis/binary.c60
-rw-r--r--src/analysis/binary.h3
-rw-r--r--src/core/Makefile.am1
-rw-r--r--src/core/core.c5
-rw-r--r--src/core/formats.c394
-rw-r--r--src/core/formats.h80
-rw-r--r--src/format/Makefile.am7
-rw-r--r--src/plugins/plugin-def.h20
-rw-r--r--src/plugins/plugin.c15
20 files changed, 13 insertions, 1216 deletions
diff --git a/plugins/dex/format.h b/plugins/dex/format.h
index 1879da3..e0f1739 100644
--- a/plugins/dex/format.h
+++ b/plugins/dex/format.h
@@ -30,7 +30,8 @@
#include <sys/types.h>
-#include <core/formats.h>
+#include <analysis/content.h>
+#include <format/executable.h>
#include "dex_def.h"
diff --git a/plugins/elf/format.h b/plugins/elf/format.h
index 895ae16..51caf87 100644
--- a/plugins/elf/format.h
+++ b/plugins/elf/format.h
@@ -29,7 +29,8 @@
#include <stdbool.h>
-#include <core/formats.h>
+#include <analysis/content.h>
+#include <format/executable.h>
#include "elf_def.h"
diff --git a/plugins/mobicore/mclf.h b/plugins/mobicore/mclf.h
index d56968b..259f49d 100644
--- a/plugins/mobicore/mclf.h
+++ b/plugins/mobicore/mclf.h
@@ -29,7 +29,8 @@
#include <stdbool.h>
-#include <core/formats.h>
+#include <analysis/content.h>
+#include <format/executable.h>
diff --git a/plugins/pychrysalide/core/Makefile.am b/plugins/pychrysalide/core/Makefile.am
index 9e467ff..b431dcc 100644
--- a/plugins/pychrysalide/core/Makefile.am
+++ b/plugins/pychrysalide/core/Makefile.am
@@ -3,7 +3,6 @@ noinst_LTLIBRARIES = libpychrysacore.la
libpychrysacore_la_SOURCES = \
demanglers.h demanglers.c \
- formats.h formats.c \
global.h global.c \
logs.h logs.c \
module.h module.c \
diff --git a/plugins/pychrysalide/core/formats.c b/plugins/pychrysalide/core/formats.c
deleted file mode 100644
index f11bb46..0000000
--- a/plugins/pychrysalide/core/formats.c
+++ /dev/null
@@ -1,201 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * formats.c - équivalent Python du fichier "core/formats.c"
- *
- * Copyright (C) 2015-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * Chrysalide is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-
-#include "formats.h"
-
-
-#include <pygobject.h>
-
-
-#include <core/formats.h>
-
-
-#include "../access.h"
-#include "../helpers.h"
-
-
-
-/* Fournit le nom humain du format binaire visé. */
-static PyObject *py_formats_get_binary_format_name(PyObject *, PyObject *);
-
-/* Définit les constantes pour les paramètres. */
-static bool py_formats_define_constants(PyTypeObject *);
-
-
-
-/******************************************************************************
-* *
-* Paramètres : self = NULL car méthode statique. *
-* args = non utilisé ici. *
-* *
-* Description : Fournit le nom humain du format binaire visé. *
-* *
-* Retour : Désignation humaine trouvée ou None. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static PyObject *py_formats_get_binary_format_name(PyObject *self, PyObject *args)
-{
- PyObject *result; /* Désignation à retourner */
- const char *key; /* Nom court du format */
- int ret; /* Bilan de lecture des args. */
- const char *name; /* Désignation humaine */
-
- ret = PyArg_ParseTuple(args, "s", &key);
- if (!ret) return NULL;
-
- name = get_binary_format_name(key);
-
- if (name != NULL)
- result = PyUnicode_FromString(name);
-
- else
- {
- result = Py_None;
- Py_INCREF(result);
- }
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Fournit un accès à une définition de type à diffuser. *
-* *
-* Retour : Définition d'objet pour Python. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-PyTypeObject *get_python_formats_type(void)
-{
- static PyMethodDef py_formats_methods[] = {
-
- { "get_binary_format_name", py_formats_get_binary_format_name,
- METH_VARARGS | METH_STATIC,
- "get_binary_format_name(key, /)\n--\n\nGive access to the main configuration of Chrysalide."
- },
- { NULL }
-
- };
-
- static PyTypeObject py_formats_type = {
-
- PyVarObject_HEAD_INIT(NULL, 0)
-
- .tp_name = "pychrysalide.core.formats",
- .tp_basicsize = sizeof(PyObject),
-
- .tp_flags = Py_TPFLAGS_DEFAULT,
-
- .tp_doc = "Access to the code formats",
-
- .tp_methods = py_formats_methods
-
- };
-
- return &py_formats_type;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : obj_type = type dont le dictionnaire est à compléter. *
-* *
-* Description : Définit les constantes pour les paramètres. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool py_formats_define_constants(PyTypeObject *obj_type)
-{
- bool result; /* Bilan à retourner */
-
- result = true;
-
- result &= PyDict_AddIntMacro(obj_type, FMS_MATCHED);
- result &= PyDict_AddIntMacro(obj_type, FMS_FORWARDED);
- result &= PyDict_AddIntMacro(obj_type, FMS_UNKNOWN);
-
- result &= PyDict_AddIntMacro(obj_type, FMS_COUNT);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : module = module dont la définition est à compléter. *
-* *
-* Description : Prend en charge l'objet 'pychrysalide.core.formats'. *
-* *
-* Retour : Bilan de l'opération. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-bool ensure_python_formats_is_registered(void)
-{
- PyTypeObject *type; /* Type Python pour 'formats' */
- PyObject *module; /* Module à recompléter */
- int ret; /* Bilan d'un appel */
-
- type = get_python_formats_type();
-
- if (!PyType_HasFeature(type, Py_TPFLAGS_READY))
- {
- type->tp_new = PyType_GenericNew;
-
- if (PyType_Ready(type) != 0)
- return false;
-
- if (!py_formats_define_constants(type))
- return false;
-
- module = get_access_to_python_module("pychrysalide.core");
-
- Py_INCREF(type);
- ret = PyModule_AddObject(module, "formats", (PyObject *)type);
-
- if (ret != 0)
- return false;
-
- }
-
- return true;
-
-}
diff --git a/plugins/pychrysalide/core/formats.h b/plugins/pychrysalide/core/formats.h
deleted file mode 100644
index 55d948a..0000000
--- a/plugins/pychrysalide/core/formats.h
+++ /dev/null
@@ -1,42 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * formats.h - prototypes pour l'équivalent Python du fichier "core/formats.h"
- *
- * Copyright (C) 2015-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * Chrysalide is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- */
-
-
-#ifndef _PLUGINS_PYCHRYSALIDE_CORE_FORMATS_H
-#define _PLUGINS_PYCHRYSALIDE_CORE_FORMATS_H
-
-
-#include <Python.h>
-#include <stdbool.h>
-
-
-
-/* Fournit un accès à une définition de type à diffuser. */
-PyTypeObject *get_python_formats_type(void);
-
-/* Prend en charge l'objet 'pychrysalide.core.formats'. */
-bool ensure_python_formats_is_registered(void);
-
-
-
-#endif /* _PLUGINS_PYCHRYSALIDE_CORE_FORMATS_H */
diff --git a/plugins/pychrysalide/core/module.c b/plugins/pychrysalide/core/module.c
index 6171e18..71fa508 100644
--- a/plugins/pychrysalide/core/module.c
+++ b/plugins/pychrysalide/core/module.c
@@ -29,7 +29,6 @@
#include "demanglers.h"
-#include "formats.h"
#include "global.h"
#include "logs.h"
#include "params.h"
@@ -93,7 +92,6 @@ bool populate_core_module(void)
result = true;
if (result) result = ensure_python_demanglers_is_registered();
- if (result) result = ensure_python_formats_is_registered();
if (result) result = ensure_python_global_is_registered();
if (result) result = ensure_python_logs_is_registered();
if (result) result = ensure_python_params_is_registered();
diff --git a/plugins/pychrysalide/plugin.c b/plugins/pychrysalide/plugin.c
index b957eff..321fda9 100644
--- a/plugins/pychrysalide/plugin.c
+++ b/plugins/pychrysalide/plugin.c
@@ -32,8 +32,6 @@
#include <common/extstr.h>
-#include "../../src/core/formats.h"
-//#include <core/formats.h>
#include <plugins/plugin-int.h>
@@ -88,9 +86,6 @@ static bool g_python_plugin_do_exit(GPythonPlugin *);
/* Procède à une opération liée à un contenu binaire. */
static void g_python_plugin_handle_binary_content(const GPythonPlugin *, PluginAction, GBinContent *, wgroup_id_t, GtkStatusStack *);
-/* Indique si le format peut être pris en charge ici. */
-FormatMatchStatus python_plugin_is_matching(GBinContent *, GExeFormat *, GPythonPlugin *, char **);
-
/* Exécute une action pendant un désassemblage de binaire. */
static void g_python_plugin_process_disass(const GPythonPlugin *, PluginAction, GLoadedBinary *, GtkStatusStack *, GProcContext *);
@@ -387,22 +382,6 @@ GPluginModule *g_python_plugin_new(const char *modname, const char *filename)
switch (action)
{
- case PGA_FORMAT_MATCHER:
-
- if (!has_python_method(instance, "is_format_matching"))
- {
- log_variadic_message(LMT_ERROR,
- _("No '%s' entry in plugin candidate '%s'"),
- "is_format_matching",
- G_PLUGIN_MODULE(result)->filename);
- goto gppn_bad_plugin;
- }
-
- if (!register_format_matcher((format_match_fc)python_plugin_is_matching, result))
- goto gppn_bad_plugin;
-
- break;
-
case PGA_FORMAT_LOADER_LAST:
/* TODO */
break;
@@ -683,122 +662,6 @@ static void g_python_plugin_handle_binary_content(const GPythonPlugin *plugin, P
/******************************************************************************
* *
-* Paramètres : content = contenu binaire à parcourir. *
-* parent = éventuel format exécutable déjà chargé. *
-* plugin = grefon C interne représentant le grefon Python. *
-* key = identifiant de format trouvé ou NULL. [OUT] *
-* *
-* Description : Indique si le format peut être pris en charge ici. *
-* *
-* Retour : Conclusion de haut niveau sur la reconnaissance effectuée. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-FormatMatchStatus python_plugin_is_matching(GBinContent *content, GExeFormat *parent, GPythonPlugin *plugin, char **key)
-{
- FormatMatchStatus result; /* Bilan à renvoyer */
- PyObject *args; /* Arguments pour l'appel */
- PyObject *value; /* Valeur obtenue */
- PyObject *arg; /* Argument en élément de tuple*/
-
- result = FMS_UNKNOWN;
-
- args = PyTuple_New(2);
- PyTuple_SetItem(args, 0, pygobject_new(G_OBJECT(content)));
- PyTuple_SetItem(args, 1, pygobject_new(G_OBJECT(parent)));
-
- value = run_python_method(plugin->instance, "is_format_matching", args);
-
- if (PyTuple_Check(value))
- {
- if (PyTuple_Size(value) > 0)
- {
- arg = PyTuple_GetItem(value, 0);
-
- if (PyLong_Check(arg))
- {
- result = PyLong_AsLong(arg);
-
- switch (result)
- {
- case FMS_MATCHED:
-
- if (PyTuple_Size(value) != 2)
- {
- g_plugin_module_log_variadic_message(G_PLUGIN_MODULE(plugin), LMT_ERROR,
- _("Expecting only a tuple [ status, key ] " \
- "as result for format matching."));
- result = FMS_UNKNOWN;
- break;
- }
-
- arg = PyTuple_GetItem(value, 1);
-
- if (PyUnicode_Check(arg))
- *key = strdup(PyUnicode_AsUTF8(arg));
-
- else
- {
- g_plugin_module_log_variadic_message(G_PLUGIN_MODULE(plugin), LMT_ERROR,
- _("Expecting a key string for format matching."));
- result = FMS_UNKNOWN;
- }
-
- break;
-
- case FMS_FORWARDED:
- case FMS_UNKNOWN:
- if (PyTuple_Size(value) != 1)
- {
- g_plugin_module_log_variadic_message(G_PLUGIN_MODULE(plugin), LMT_WARNING,
- _("Unused second item for format matching."));
- }
- break;
-
- default:
- g_plugin_module_log_variadic_message(G_PLUGIN_MODULE(plugin), LMT_ERROR,
- _("Unexpected result for format matching."));
- result = FMS_UNKNOWN;
- break;
-
- }
-
- }
-
- else
- {
- g_plugin_module_log_variadic_message(G_PLUGIN_MODULE(plugin), LMT_ERROR,
- _("Unexpected result status for format matching."));
- result = FMS_UNKNOWN;
- }
-
- }
- else
- g_plugin_module_log_variadic_message(G_PLUGIN_MODULE(plugin), LMT_WARNING,
- _("Interpreting a empty tuple as FMS_UNKNOWN " \
- "for format matching."));
-
- }
- else
- g_plugin_module_log_variadic_message(G_PLUGIN_MODULE(plugin), LMT_ERROR,
- _("Expected a tuple containing [ status, key ] as result " \
- "for format matching."));
-
- Py_XDECREF(value);
- Py_DECREF(args);
-
- return result;
-
-
-
-
-}
-
-
-/******************************************************************************
-* *
* Paramètres : plugin = greffon à manipuler. *
* action = type d'action attendue. *
* binary = binaire dont le contenu est en cours de traitement.*
@@ -862,7 +725,6 @@ static bool py_plugin_module_define_constants(PyTypeObject *obj_type)
result &= PyDict_AddIntMacro(obj_type, PGA_PLUGIN_EXIT);
result &= PyDict_AddIntMacro(obj_type, PGA_CONTENT_EXPLORER);
result &= PyDict_AddIntMacro(obj_type, PGA_CONTENT_RESOLVER);
- result &= PyDict_AddIntMacro(obj_type, PGA_FORMAT_MATCHER);
result &= PyDict_AddIntMacro(obj_type, PGA_FORMAT_LOADER_LAST);
result &= PyDict_AddIntMacro(obj_type, PGA_DISASSEMBLY_STARTED);
result &= PyDict_AddIntMacro(obj_type, PGA_DISASSEMBLY_RAW);
diff --git a/plugins/readdex/class.h b/plugins/readdex/class.h
index a9f5079..4f5b7c3 100644
--- a/plugins/readdex/class.h
+++ b/plugins/readdex/class.h
@@ -26,6 +26,7 @@
#include <format/preload.h>
+#include <gtkext/gtkstatusstack.h>
#include <plugins/dex/format.h>
diff --git a/plugins/readdex/ids.h b/plugins/readdex/ids.h
index 489d389..beb3828 100644
--- a/plugins/readdex/ids.h
+++ b/plugins/readdex/ids.h
@@ -26,6 +26,7 @@
#include <format/preload.h>
+#include <gtkext/gtkstatusstack.h>
#include <plugins/dex/format.h>
diff --git a/plugins/ropgadgets/select.c b/plugins/ropgadgets/select.c
index e8ee8c3..ea679bb 100644
--- a/plugins/ropgadgets/select.c
+++ b/plugins/ropgadgets/select.c
@@ -39,7 +39,6 @@
#include <core/global.h>
#include <common/cpp.h>
#include <common/extstr.h>
-#include <core/formats.h>
#include <core/processors.h>
#include <gui/core/global.h>
#include <gtkext/easygtk.h>
@@ -83,18 +82,9 @@ static void register_input_output_panel(GtkAssistant *, GObject *);
/* Construit la sélection d'un binaire déjà chargé. */
static GtkWidget *load_and_populate_current_project_binaries(GObject *);
-/* Met à jour l'accès à la sélection du type d'entrée. */
-static void on_input_type_toggle(GtkToggleButton *, GObject *);
-
/* Réagit à un changement de sélection du binaire d'entrée. */
static void on_loaded_binary_selection_change(GtkComboBox *, GObject *);
-/* Réagit à un changement de fichier binaire d'entrée. */
-static void on_input_filename_change(GtkEditable *, GObject *);
-
-/* Sélectionne ou non un nouveau fichier d'entrée. */
-static void on_input_filename_browsing_clicked(GtkButton *, GObject *);
-
/* Met à jour l'accès à la définition d'un fichier de sortie. */
static void on_output_need_toggle(GtkToggleButton *, GObject *);
@@ -173,9 +163,6 @@ static void push_found_rop_gadgets(GObject *, GExeFormat *, found_rop_list *, si
/* Charge un format binaire interne déjà chargé. */
static GExeFormat *load_internal_format_for_rop_gadgets(GObject *);
-/* Charge un format binaire externe. */
-static GExeFormat *load_external_format_for_rop_gadgets(GObject *);
-
/* Procède à la recherche de gadgets de façon séparée. */
static gpointer look_for_rop_gadgets(GObject *);
@@ -401,7 +388,6 @@ static void register_input_output_panel(GtkAssistant *assistant, GObject *ref)
GtkWidget *vbox; /* Support principal */
GtkWidget *frame; /* Support avec encadrement */
GtkWidget *sub_vbox; /* Division verticale */
- GtkWidget *radio; /* Choix du type d'entrée */
GtkWidget *combobox; /* Sélection du binaire interne*/
GtkWidget *sub_hbox; /* Division horizontale */
GtkWidget *entry; /* Zone de saisie de texte */
@@ -419,34 +405,9 @@ static void register_input_output_panel(GtkAssistant *assistant, GObject *ref)
frame = qck_create_frame(_("<b>Input binary</b>"), sub_vbox, 0, 0, 12, 8);
gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, TRUE, 0);
- radio = qck_create_radio_button(ref, "loaded_as_input", _("Use a binary from the current project:"),
- NULL, G_CALLBACK(on_input_type_toggle), ref);
- gtk_box_pack_start(GTK_BOX(sub_vbox), radio, FALSE, FALSE, 0);
-
combobox = load_and_populate_current_project_binaries(ref);
gtk_box_pack_start(GTK_BOX(sub_vbox), combobox, TRUE, TRUE, 0);
- radio = qck_create_radio_button(ref, "extern_as_input", _("Open a new binary file:"),
- GTK_RADIO_BUTTON(radio), G_CALLBACK(on_input_type_toggle), ref);
- gtk_box_pack_start(GTK_BOX(sub_vbox), radio, FALSE, FALSE, 0);
-
- sub_hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 8);
- gtk_widget_show(sub_hbox);
- gtk_box_pack_start(GTK_BOX(sub_vbox), sub_hbox, FALSE, FALSE, 0);
-
- entry = qck_create_entry(ref, "input_filename", NULL);
- g_signal_connect(entry, "changed", G_CALLBACK(on_input_filename_change), ref);
- gtk_box_pack_start(GTK_BOX(sub_hbox), entry, TRUE, TRUE, 0);
-
- button = qck_create_button(ref, "input_browser", _("Browse..."),
- G_CALLBACK(on_input_filename_browsing_clicked), assistant);
- gtk_box_pack_start(GTK_BOX(sub_hbox), button, FALSE, FALSE, 0);
-
- /* Actualisation des accès */
-
- gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(radio), TRUE);
- on_input_type_toggle(GTK_TOGGLE_BUTTON(radio), ref);
-
/* Fichier de sortie */
sub_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
@@ -586,61 +547,6 @@ static GtkWidget *load_and_populate_current_project_binaries(GObject *ref)
/******************************************************************************
* *
-* Paramètres : button = oche dont le status vient de changer. *
-* ref = espace de référencements inter-panneaux. *
-* *
-* Description : Met à jour l'accès à la sélection du type d'entrée. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void on_input_type_toggle(GtkToggleButton *button, GObject *ref)
-{
- GtkToggleButton *internal; /* Bouton de sélection interne */
- gboolean state; /* Etat du bouton courant */
- GtkWidget *widget; /* Element dont l'accès change */
-
- internal = GTK_TOGGLE_BUTTON(g_object_get_data(ref, "loaded_as_input"));
- state = gtk_toggle_button_get_active(internal);
-
- /* Elément de sélection interne */
-
- widget = GTK_WIDGET(g_object_get_data(ref, "input_binary"));
-
- if (widget != NULL)
- {
- gtk_widget_set_sensitive(widget, state);
-
- if (state)
- on_loaded_binary_selection_change(GTK_COMBO_BOX(widget), ref);
-
- }
-
- /* Elément de sélection externe */
-
- widget = GTK_WIDGET(g_object_get_data(ref, "input_filename"));
-
- if (widget != NULL)
- {
- gtk_widget_set_sensitive(widget, !state);
-
- if (!state)
- on_input_filename_change(GTK_EDITABLE(widget), ref);
-
- }
-
- widget = GTK_WIDGET(g_object_get_data(ref, "input_browser"));
- if (widget != NULL)
- gtk_widget_set_sensitive(widget, !state);
-
-}
-
-
-/******************************************************************************
-* *
* Paramètres : combo = composant graphique de sélection concerné. *
* ref = espace de référencement principal. *
* *
@@ -669,77 +575,6 @@ static void on_loaded_binary_selection_change(GtkComboBox *combo, GObject *ref)
/******************************************************************************
* *
-* Paramètres : editable = composant graphique d'édition concerné. *
-* ref = espace de référencement principal. *
-* *
-* Description : Réagit à un changement de fichier binaire d'entrée. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void on_input_filename_change(GtkEditable *editable, GObject *ref)
-{
- guint16 length; /* Taille du texte fourni */
- GtkWidget *page; /* Page de la partie terminée */
-
- length = gtk_entry_get_text_length(GTK_ENTRY(editable));
-
- page = gtk_assistant_get_nth_page(GTK_ASSISTANT(ref), 0);
-
- if (page != NULL)
- gtk_assistant_set_page_complete(GTK_ASSISTANT(ref), page, length > 0);
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : button = bouton d'édition de la sélection. *
-* ref = espace de référencement principal. *
-* *
-* Description : Sélectionne ou non un nouveau fichier d'entrée. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void on_input_filename_browsing_clicked(GtkButton *button, GObject *ref)
-{
- GtkWidget *dialog; /* Boîte à afficher */
- gchar *filename; /* Nom du fichier à intégrer */
- GtkEntry *entry; /* Zone de saisie à maj. */
-
- dialog = gtk_file_chooser_dialog_new(_("Choose an input filename"), GTK_WINDOW(ref),
- GTK_FILE_CHOOSER_ACTION_OPEN,
- _("_Cancel"), GTK_RESPONSE_CANCEL,
- _("_Open"), GTK_RESPONSE_ACCEPT,
- NULL);
-
- entry = GTK_ENTRY(g_object_get_data(ref, "input_filename"));
- gtk_file_chooser_set_filename(GTK_FILE_CHOOSER(dialog), gtk_entry_get_text(entry));
-
- if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT)
- {
- filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
-
- gtk_entry_set_text(GTK_ENTRY(entry), filename);
-
- g_free(filename);
-
- }
-
- gtk_widget_destroy(dialog);
-
-}
-
-
-/******************************************************************************
-* *
* Paramètres : button = coche dont le status vient de changer. *
* ref = espace de référencements inter-panneaux. *
* *
@@ -1310,79 +1145,6 @@ static GExeFormat *load_internal_format_for_rop_gadgets(GObject *ref)
* *
* Paramètres : ref = espace de référencements inter-panneaux. *
* *
-* Description : Charge un format binaire externe. *
-* *
-* Retour : Nouveau format au contenu à fouiller ou NULL en cas d'échec. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GExeFormat *load_external_format_for_rop_gadgets(GObject *ref)
-{
- GExeFormat *result; /* Format chargé à retourner */
- GtkEntry *entry; /* Zone de saisie de texte */
- const gchar *filename; /* Nom du fichier à charger */
- GBinContent *content; /* Contenu binaire chargé */
- FormatMatchStatus status; /* Statut d'une reconnaissance */
- char *target; /* Sous-traitance requise */
- const char *desc; /* Description humaine associée*/
-
- /* Récupération du nom de fichier */
-
- entry = GTK_ENTRY(g_object_get_data(ref, "input_filename"));
-
- filename = gtk_entry_get_text(entry);
-
- /* Récupération du contenu binaire */
-
- content = g_file_content_new(filename);
- if (content == NULL)
- {
- push_status_printing_of_rop_search_step(ref, "loading", _("unable to get the binary content"), false);
- goto leffrg_error;
- }
-
- push_status_printing_of_rop_search_step(ref, "loading", _("done"), true);
-
- /* Récupération du format de fichier associé */
-
- status = find_matching_format(content, NULL, &target);
-
- if (status != FMS_MATCHED)
- {
- g_object_unref(G_OBJECT(content));
- push_status_printing_of_rop_search_step(ref, "format", _("unknown binary format"), false);
- goto leffrg_error;
- }
-
- desc = get_binary_format_name(target);
-
- result = G_EXE_FORMAT(load_new_named_format(target, content, NULL));
-
- free(target);
-
- if (result == NULL)
- {
- push_status_printing_of_rop_search_step(ref, "format", _("error while loading the binary"), false);
- goto leffrg_error;
- }
-
- push_status_printing_of_rop_search_step(ref, "format", desc, true);
-
- return result;
-
- leffrg_error:
-
- return NULL;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : ref = espace de référencements inter-panneaux. *
-* *
* Description : Procède à la recherche de gadgets de façon séparée. *
* *
* Retour : ? *
@@ -1393,8 +1155,6 @@ static GExeFormat *load_external_format_for_rop_gadgets(GObject *ref)
static gpointer look_for_rop_gadgets(GObject *ref)
{
- GtkToggleButton *internal; /* Bouton de sélection interne */
- gboolean state; /* Etat du bouton courant */
GExeFormat *format; /* Format du binaire à traiter */
found_rop_list *list; /* Liste de gadgets ROP trouvés*/
size_t count; /* Nombre de ces listes */
@@ -1402,14 +1162,7 @@ static gpointer look_for_rop_gadgets(GObject *ref)
size_t i; /* Boucle de parcours */
char *msg; /* Message final à faire passer*/
- internal = GTK_TOGGLE_BUTTON(g_object_get_data(ref, "loaded_as_input"));
- state = gtk_toggle_button_get_active(internal);
-
- if (state)
- format = load_internal_format_for_rop_gadgets(ref);
- else
- format = load_external_format_for_rop_gadgets(ref);
-
+ format = load_internal_format_for_rop_gadgets(ref);
if (format == NULL) goto lfrg_unlock;
list = list_all_gadgets(format, 7, push_new_progress_fraction, ref, &count);
diff --git a/src/analysis/binary.c b/src/analysis/binary.c
index fd0dd3b..5b84f58 100644
--- a/src/analysis/binary.c
+++ b/src/analysis/binary.c
@@ -44,7 +44,6 @@
#include "../common/cpp.h"
#include "../common/xdg.h"
#include "../core/collections.h"
-#include "../core/formats.h"
#include "../core/global.h"
#include "../core/logs.h"
#include "../core/params.h"
@@ -1236,65 +1235,6 @@ bool _g_loaded_binary_remove_from_collection(GLoadedBinary *binary, DBFeatures f
* *
******************************************************************************/
-bool g_loaded_binary_attach_debug_info(GLoadedBinary *binary, GBinContent *content)
-{
- bool result; /* Bilan à retourner pour info */
- FormatMatchStatus status; /* Statut d'une reconnaissance */
- char *target; /* Sous-traitance requise */
- const char *desc; /* Description humaine associée*/
- GDbgFormat *debug; /* Format de débogage trouvé */
-
- status = find_matching_format(content, binary->format, &target);
-
- if (status == FMS_MATCHED)
- {
- result = false;
-
- desc = get_binary_format_name(target);
-
- if (desc == NULL)
- log_simple_message(LMT_INFO, _("Unknown binary debug format"));
-
- else
- {
- log_variadic_message(LMT_INFO, _("Detected debug format: %s"), desc);
-
- debug = G_DBG_FORMAT(load_new_named_format(target, content, binary->format));
-
- if (debug == NULL)
- log_simple_message(LMT_ERROR, _("Error while loading the debug information for binary"));
-
- else
- {
- result = true;
- g_exe_format_add_debug_info(binary->format, debug);
- }
-
- }
-
- free(target);
-
- }
- else
- result = true;
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : binary = élément binaire à consulter. *
-* *
-* Description : Fournit le format de fichier reconnu dans le contenu binaire.*
-* *
-* Retour : Instance du format reconnu. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
GExeFormat *g_loaded_binary_get_format(const GLoadedBinary *binary)
{
GExeFormat *result; /* Instance à retourner */
diff --git a/src/analysis/binary.h b/src/analysis/binary.h
index 648da10..7c2c760 100644
--- a/src/analysis/binary.h
+++ b/src/analysis/binary.h
@@ -153,9 +153,6 @@ bool _g_loaded_binary_remove_from_collection(GLoadedBinary *, DBFeatures, GDbIte
/* Fournit le format de fichier reconnu dans le contenu binaire. */
-bool g_loaded_binary_attach_debug_info(GLoadedBinary *, GBinContent *);
-
-/* Fournit le format de fichier reconnu dans le contenu binaire. */
GExeFormat *g_loaded_binary_get_format(const GLoadedBinary *);
/* Fournit le processeur de l'architecture liée au binaire. */
diff --git a/src/core/Makefile.am b/src/core/Makefile.am
index 89dd345..b783603 100644
--- a/src/core/Makefile.am
+++ b/src/core/Makefile.am
@@ -5,7 +5,6 @@ libcore_la_SOURCES = \
collections.h collections.c \
core.h core.c \
demanglers.h demanglers.c \
- formats.h formats.c \
global.h global.c \
logs.h logs.c \
nproc.h nproc.c \
diff --git a/src/core/core.c b/src/core/core.c
index 3f0d244..fe8ccbb 100644
--- a/src/core/core.c
+++ b/src/core/core.c
@@ -35,7 +35,6 @@
#include "collections.h"
#include "demanglers.h"
-#include "formats.h"
#include "global.h"
#include "params.h"
#include "processors.h"
@@ -106,8 +105,6 @@ bool load_all_basic_components(void)
result &= load_hard_coded_processors_definitions();
- result &= load_hard_coded_formats_definitions();
-
result &= load_hard_coded_collection_definitions();
}
@@ -135,8 +132,6 @@ void unload_all_basic_components(void)
unload_demanglers_definitions();
- unload_formats_definitions();
-
unload_processors_definitions();
exit_global_works();
diff --git a/src/core/formats.c b/src/core/formats.c
deleted file mode 100644
index d16cb26..0000000
--- a/src/core/formats.c
+++ /dev/null
@@ -1,394 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * formats.c - enregistrement et fourniture des formats de binaires supportés
- *
- * Copyright (C) 2015-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * Chrysalide is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Chrysalide. If not, see <http://www.gnu.org/licenses/>.
- */
-
-
-#include "formats.h"
-
-
-#include <malloc.h>
-#include <pthread.h>
-#include <string.h>
-
-
-#include "../format/dwarf/dwarf.h"
-#include "../format/dwarf/v2/dwarf.h"
-#include "../format/dwarf/v3/dwarf.h"
-#include "../format/dwarf/v4/dwarf.h"
-
-
-
-/* Eléments pour détection */
-typedef struct _format_matcher_t
-{
- format_match_fc func; /* Recherche de correspondance */
- void *data; /* Eventuelle donnée à y lier */
-
-} format_matcher_t;
-
-
-/* Caractéristiques d'un processeur */
-typedef struct _format_loader_t
-{
- char *key; /* Clef pour un accès rapide */
- char *name; /* Désignation humaine */
-
- format_load_fc func; /* Procédure de chargement */
-
-} format_loader_t;
-
-
-/* Mémorisation des détections de format enregistrées */
-static format_matcher_t *_formats_matchers = NULL;
-static size_t _formats_matchers_count = 0;
-
-/* Mémorisation des types de formats enregistrés */
-static format_loader_t *_formats_loaders = NULL;
-static size_t _formats_loaders_count = 0;
-
-/* Verrou pour des accès atomiques */
-static GRWLock _formats_lock;
-
-
-/* Retrouve l'enregistrement correspondant à une architecture. */
-static format_loader_t *find_format_by_key(const char *);
-
-
-
-/******************************************************************************
-* *
-* Paramètres : func = procédure de détection à utiliser. *
-* data = éventuelle donnée à associer aux opérations. *
-* *
-* Description : Enregistre un détection de format(s) binaire(s). *
-* *
-* Retour : Bilan de l'opération. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-bool register_format_matcher(format_match_fc func, void *data)
-{
- bool result; /* Bilan à retourner */
- size_t i; /* Boucle de parcours */
- const format_matcher_t *cur; /* Elément parcouru et analysé */
- format_matcher_t *new; /* Nouvel élément à définir */
-
- g_rw_lock_writer_lock(&_formats_lock);
-
- for (i = 0; i < _formats_matchers_count; i++)
- {
- cur = &_formats_matchers[i];
-
- if (cur->func == func && cur->data == data)
- break;
-
- }
-
- result = (i == _formats_matchers_count);
-
- if (result)
- {
- _formats_matchers = (format_matcher_t *)realloc(_formats_matchers,
- ++_formats_matchers_count * sizeof(format_matcher_t));
-
- new = &_formats_matchers[_formats_matchers_count - 1];
-
- new->func = func;
- new->data = data;
-
- }
-
- g_rw_lock_writer_unlock(&_formats_lock);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : key = désignation rapide et interne d'un format. *
-* name = désignation humaine au format de binaire. *
-* func = procédure de chargement associée. *
-* *
-* Description : Enregistre un format de contenu binaire donné. *
-* *
-* Retour : Bilan de l'opération. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-bool register_format_loader(const char *key, const char *name, format_load_fc func)
-{
- bool result; /* Bilan à retourner */
- size_t i; /* Boucle de parcours */
- format_loader_t *new; /* Nouvel élément à définir */
-
- g_rw_lock_writer_lock(&_formats_lock);
-
- for (i = 0; i < _formats_loaders_count; i++)
- if (strcmp(_formats_loaders[i].key, key) == 0 && strcmp(_formats_loaders[i].name, name) == 0)
- break;
-
- result = (i == _formats_loaders_count);
-
- if (result)
- {
- _formats_loaders = (format_loader_t *)realloc(_formats_loaders,
- ++_formats_loaders_count * sizeof(format_loader_t));
-
- new = &_formats_loaders[_formats_loaders_count - 1];
-
- new->key = strdup(key);
- new->name = strdup(name);
-
- new->func = func;
-
- }
-
- g_rw_lock_writer_unlock(&_formats_lock);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Charge les définitions de formats "natifs". *
-* *
-* Retour : Bilan de l'opération. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-bool load_hard_coded_formats_definitions(void)
-{
- bool result; /* Bilan à retourner */
-
- result = true;
-
- /* Détections */
-
- result &= register_format_matcher(dwarf_is_matching, NULL);
-
- /* Chargements */
-
- result &= register_format_loader("dwarf_v2", "Debugging With Arbitrary Record Formats (v2)",
- g_dwarfv2_format_new);
-
- result &= register_format_loader("dwarf_v3", "Debugging With Arbitrary Record Formats (v3)",
- g_dwarfv3_format_new);
-
- result &= register_format_loader("dwarf_v4", "Debugging With Arbitrary Record Formats (v4)",
- g_dwarfv4_format_new);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Décharge toutes les définitions de formats. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void unload_formats_definitions(void)
-{
- size_t i; /* Boucle de parcours */
-
- if (_formats_matchers != NULL)
- free(_formats_matchers);
-
- _formats_matchers = NULL;
- _formats_matchers_count = 0;
-
- for (i = 0; i < _formats_loaders_count; i++)
- {
- free(_formats_loaders[i].key);
- free(_formats_loaders[i].name);
- }
-
- if (_formats_loaders != NULL)
- free(_formats_loaders);
-
- _formats_loaders = NULL;
- _formats_loaders_count = 0;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : key = nom technique du processeur recherché. *
-* *
-* Description : Retrouve l'enregistrement correspondant à une architecture. *
-* *
-* Retour : Définition trouvée ou NULL en cas d'échec. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static format_loader_t *find_format_by_key(const char *key)
-{
- format_loader_t *result; /* Trouvaille à retourner */
- size_t i; /* Boucle de parcours */
-
- /**
- * Le verrou d'accès global doit être posé !
- */
-
- result = NULL;
-
- if (key != NULL)
- for (i = 0; i < _formats_loaders_count; i++)
- if (strcmp(_formats_loaders[i].key, key) == 0)
- result = &_formats_loaders[i];
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : key = nom technique du format recherché. *
-* *
-* Description : Fournit le nom humain du format binaire visé. *
-* *
-* Retour : Désignation humaine trouvée ou NULL. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-const char *get_binary_format_name(const char *key)
-{
- const char *result; /* Description à retourner */
- format_loader_t *def; /* Définition d'architecture */
-
- g_rw_lock_reader_lock(&_formats_lock);
-
- def = find_format_by_key(key);
-
- if (def == NULL)
- result = NULL;
- else
- result = def->name;
-
- g_rw_lock_reader_unlock(&_formats_lock);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : content = contenu binaire à parcourir. *
-* parent = éventuel format exécutable déjà chargé. *
-* key = identifiant de format trouvé ou NULL. [OUT] *
-* *
-* Description : Identifie un format binaire par son contenu. *
-* *
-* Retour : Conclusion de haut niveau sur la reconnaissance effectuée. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-FormatMatchStatus find_matching_format(GBinContent *content, GExeFormat *parent, char **key)
-{
- FormatMatchStatus result; /* Bilan à retourner */
- size_t i; /* Boucle de parcours */
- const format_matcher_t *cur; /* Elément parcouru et analysé */
-
- result = FMS_UNKNOWN;
-
- g_rw_lock_reader_lock(&_formats_lock);
-
- for (i = 0; i < _formats_matchers_count && result == FMS_UNKNOWN; i++)
- {
- cur = &_formats_matchers[i];
-
- result = cur->func(content, parent, cur->data, key);
-
- }
-
- g_rw_lock_reader_unlock(&_formats_lock);
-
- return result;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : key = nom technique du processeur recherché. *
-* content = contenu binaire pré-chargé à traiter. *
-* parent = contenu binaire principal éventuel déjà chargé. *
-* *
-* Description : Charge le format binaire correspondant à un type. *
-* *
-* Retour : Format binaire instancié. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-GBinFormat *load_new_named_format(const char *key, GBinContent *content, GExeFormat *parent)
-{
- GBinFormat *result; /* Instance à retourner */
- format_loader_t *def; /* Définition d'architecture */
-
- g_rw_lock_reader_lock(&_formats_lock);
-
- def = find_format_by_key(key);
-
- if (def == NULL)
- result = NULL;
- else
- {
- extern GtkStatusStack *get_global_status(void);
-
- result = def->func(content, parent, get_global_status());
-
- }
-
- g_rw_lock_reader_unlock(&_formats_lock);
-
- return result;
-
-}
diff --git a/src/core/formats.h b/src/core/formats.h
deleted file mode 100644
index 2d155a0..0000000
--- a/src/core/formats.h
+++ /dev/null
@@ -1,80 +0,0 @@
-
-/* Chrysalide - Outil d'analyse de fichiers binaires
- * formats.h - prototypes pour l'enregistrement et la fourniture des formats de binaires supportés
- *
- * Copyright (C) 2015-2017 Cyrille Bagard
- *
- * This file is part of Chrysalide.
- *
- * Chrysalide is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * Chrysalide is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with Chrysalide. If not, see <http://www.gnu.org/licenses/>.
- */
-
-
-#ifndef _CORE_FORMATS_H
-#define _CORE_FORMATS_H
-
-
-#include <glib-object.h>
-#include <stdbool.h>
-
-
-#include "../format/format.h"
-#include "../format/executable.h"
-#include "../gtkext/gtkstatusstack.h"
-
-
-
-/* Conclusion d'une opération de reconnaissance */
-typedef enum _FormatMatchStatus
-{
- FMS_MATCHED, /* Correspondance établie */
- FMS_FORWARDED, /* Sous-formats détectés */
- FMS_UNKNOWN, /* Aucun format reconnu */
-
- FMS_COUNT
-
-} FormatMatchStatus;
-
-
-/* Indication à propos du support d'un format */
-typedef FormatMatchStatus (* format_match_fc) (GBinContent *, GExeFormat *, void *, char **);
-
-/* Méthode de chargement d'un format */
-typedef GBinFormat * (* format_load_fc) (GBinContent *, GExeFormat *, GtkStatusStack *);
-
-
-/* Enregistre un détection de format(s) binaire(s). */
-bool register_format_matcher(format_match_fc, void *);
-
-/* Enregistre un format de contenu binaire donné. */
-bool register_format_loader(const char *, const char *, format_load_fc);
-
-/* Charge les définitions de formats "natifs". */
-bool load_hard_coded_formats_definitions(void);
-
-/* Décharge toutes les définitions de formats. */
-void unload_formats_definitions(void);
-
-/* Fournit le nom humain du format binaire visé. */
-const char *get_binary_format_name(const char *);
-
-/* Identifie un format binaire par son contenu. */
-FormatMatchStatus find_matching_format(GBinContent *, GExeFormat *, char **);
-
-/* Charge le format binaire correspondant à un type. */
-GBinFormat *load_new_named_format(const char *, GBinContent *, GExeFormat *);
-
-
-
-#endif /* _CORE_FORMATS_H */
diff --git a/src/format/Makefile.am b/src/format/Makefile.am
index 8a47b82..24f03da 100644
--- a/src/format/Makefile.am
+++ b/src/format/Makefile.am
@@ -17,10 +17,7 @@ libformat_la_SOURCES = \
symbol-int.h \
symbol.h symbol.c
-libformat_la_LIBADD = \
- dwarf/libformatdwarf.la \
- java/libformatjava.la \
- pe/libformatpe.la
+libformat_la_LIBADD =
libformat_la_LDFLAGS =
@@ -34,4 +31,4 @@ AM_CPPFLAGS = $(LIBGTK_CFLAGS) $(LIBXML_CFLAGS)
AM_CFLAGS = $(DEBUG_CFLAGS) $(WARNING_FLAGS) $(COMPLIANCE_FLAGS)
-SUBDIRS = dwarf java pe
+# SUBDIRS = dwarf java pe
diff --git a/src/plugins/plugin-def.h b/src/plugins/plugin-def.h
index b8b0e0d..8b7ac7d 100644
--- a/src/plugins/plugin-def.h
+++ b/src/plugins/plugin-def.h
@@ -130,14 +130,11 @@ typedef enum _PluginAction
* DPC_BINARY_PROCESSING | DPS_FORMAT
*/
- /* Détection et chargement */
- PGA_FORMAT_MATCHER = DPC_BINARY_PROCESSING | DPS_FORMAT | DEFINE_PLUGIN_ACTION(0),
-
/* Accompagnement du chargement (fin) */
- PGA_FORMAT_LOADER_LAST = DPC_BINARY_PROCESSING | DPS_FORMAT | DEFINE_PLUGIN_ACTION(1),
+ PGA_FORMAT_LOADER_LAST = DPC_BINARY_PROCESSING | DPS_FORMAT | DEFINE_PLUGIN_ACTION(0),
/* Accompagnement du chargement (fin) */
- PGA_FORMAT_PRELOAD = DPC_BINARY_PROCESSING | DPS_FORMAT | DEFINE_PLUGIN_ACTION(2),
+ PGA_FORMAT_PRELOAD = DPC_BINARY_PROCESSING | DPS_FORMAT | DEFINE_PLUGIN_ACTION(1),
/**
* DPC_BINARY_PROCESSING | DPS_DISASSEMBLY
@@ -269,19 +266,6 @@ typedef enum _PluginAction
//typedef PluginAction (* get_plugin_action_fc) (void);
-/* PGA_FORMAT_MATCHER */
-
-/* Bilans d'une reconnaissance */
-typedef enum _MatchingFormatAction
-{
- MFA_NONE, /* Aucune détection */
- MFA_MATCHED, /* Format reconnu */
- MFA_RELOAD, /* Rechargemet opéré */
-
- MFA_COUNT
-
-} MatchingFormatAction;
-
diff --git a/src/plugins/plugin.c b/src/plugins/plugin.c
index 7780f43..d309332 100644
--- a/src/plugins/plugin.c
+++ b/src/plugins/plugin.c
@@ -39,9 +39,6 @@
#include "plugin-int.h"
-#include "../core/formats.h"
-
-
/* Initialise la classe des greffons. */
static void g_plugin_module_class_init(GPluginModuleClass *);
@@ -199,7 +196,6 @@ GPluginModule *g_plugin_module_new(const gchar *filename)
uint32_t action; /* Identifiant d'une action */
uint32_t category; /* Catégorie principale */
uint32_t sub; /* Sous-catégorie visée */
- format_match_fc matcher; /* Routine de reconnaissance */
result = g_object_new(G_TYPE_PLUGIN_MODULE, NULL);
@@ -334,17 +330,6 @@ GPluginModule *g_plugin_module_new(const gchar *filename)
switch (action)
{
- case PGA_FORMAT_MATCHER:
-
- if (!load_plugin_symbol(result->module,
- "is_format_matching", &matcher))
- goto bad_plugin;
-
- if (!register_format_matcher(matcher, result))
- goto bad_plugin;
-
- break;
-
case PGA_FORMAT_LOADER_LAST:
if (!load_plugin_symbol(result->module,
"handle_binary_format", &result->handle_format))