diff options
Diffstat (limited to 'plugins/pychrysa')
-rw-r--r-- | plugins/pychrysa/analysis/binary.c | 27 | ||||
-rw-r--r-- | plugins/pychrysa/analysis/binary.h | 2 | ||||
-rw-r--r-- | plugins/pychrysa/analysis/py_binary.c | 6 | ||||
-rw-r--r-- | plugins/pychrysa/analysis/py_binary.h | 2 | ||||
-rw-r--r-- | plugins/pychrysa/plugin.c | 4 |
5 files changed, 22 insertions, 19 deletions
diff --git a/plugins/pychrysa/analysis/binary.c b/plugins/pychrysa/analysis/binary.c index 44721b5..93db685 100644 --- a/plugins/pychrysa/analysis/binary.c +++ b/plugins/pychrysa/analysis/binary.c @@ -28,6 +28,9 @@ #include <pygobject.h> +#include <analysis/binaries/file.h> /* REMME ! */ + + #include "../quirks.h" #include "../arch/instruction.h" #include "../glibext/codebuffer.h" @@ -70,12 +73,12 @@ static PyObject *py_loaded_binary_new(PyTypeObject *type, PyObject *args, PyObje PyObject *result; /* Instance à retourner */ char *filename; /* Nom du fichier à charger */ int ret; /* Bilan de lecture des args. */ - GOpenidaBinary *binary; /* Version GLib du format */ + GLoadedBinary *binary; /* Version GLib du format */ ret = PyArg_ParseTuple(args, "s", &filename); if (!ret) return Py_None; - binary = g_openida_binary_new_from_file(filename); + binary = g_file_binary_new_from_file(filename); result = py_loaded_binary_from_c(binary); g_object_unref(binary); @@ -97,7 +100,7 @@ static PyObject *py_loaded_binary_new(PyTypeObject *type, PyObject *args, PyObje * * ******************************************************************************/ -PyObject *py_loaded_binary_from_c(GOpenidaBinary *binary) +PyObject *py_loaded_binary_from_c(GLoadedBinary *binary) { PyObject *module; /* Module d'appartenance */ PyTypeObject *type; /* Type Python correspondant */ @@ -129,12 +132,12 @@ PyObject *py_loaded_binary_from_c(GOpenidaBinary *binary) static PyObject *py_loaded_binary_get_filename(PyObject *self, PyObject *args) { PyObject *result; /* Trouvailles à retourner */ - GOpenidaBinary *binary; /* Version native */ + GLoadedBinary *binary; /* Version native */ const char *filename; /* Fichier associé au binaire */ - binary = G_OPENIDA_BINARY(pygobject_get(self)); + binary = G_LOADED_BINARY(pygobject_get(self)); - filename = g_openida_binary_get_filename(binary); + filename = g_loaded_binary_get_filename(binary, true); result = PyString_FromString(filename); @@ -159,12 +162,12 @@ static PyObject *py_loaded_binary_get_filename(PyObject *self, PyObject *args) static PyObject *py_loaded_binary_get_instructions(PyObject *self, PyObject *args) { PyObject *result; /* Trouvailles à retourner */ - GOpenidaBinary *binary; /* Version native */ + GLoadedBinary *binary; /* Version native */ GArchInstruction *instr; /* Première instruction */ - binary = G_OPENIDA_BINARY(pygobject_get(self)); + binary = G_LOADED_BINARY(pygobject_get(self)); - instr = g_openida_binary_get_instructions(binary); + instr = g_loaded_binary_get_instructions(binary); result = py_arch_instruction_from_c(instr); @@ -192,11 +195,11 @@ static PyObject *py_loaded_binary_get_instructions(PyObject *self, PyObject *arg static PyObject *py_loaded_binary_get_disassembled_buffer(PyObject *self, void *closure) { PyObject *result; /* Trouvailles à retourner */ - GOpenidaBinary *binary; /* Version native */ + GLoadedBinary *binary; /* Version native */ GCodeBuffer *buffer; /* Tampon à récupérer */ - binary = G_OPENIDA_BINARY(pygobject_get(self)); - buffer = g_openida_binary_get_disassembled_buffer(binary); + binary = G_LOADED_BINARY(pygobject_get(self)); + buffer = g_loaded_binary_get_disassembled_buffer(binary); result = py_code_buffer_from_c(buffer); diff --git a/plugins/pychrysa/analysis/binary.h b/plugins/pychrysa/analysis/binary.h index 89e5e59..33ead7e 100644 --- a/plugins/pychrysa/analysis/binary.h +++ b/plugins/pychrysa/analysis/binary.h @@ -34,7 +34,7 @@ /* Crée un nouvel objet Python de type 'LoadedBinary'. */ -PyObject *py_loaded_binary_from_c(GOpenidaBinary *); +PyObject *py_loaded_binary_from_c(GLoadedBinary *); /* Prend en charge l'objet 'pychrysalide.analysis.LoadedBinary'. */ bool register_python_loaded_binary(PyObject *); diff --git a/plugins/pychrysa/analysis/py_binary.c b/plugins/pychrysa/analysis/py_binary.c index 04d4881..7c1653d 100644 --- a/plugins/pychrysa/analysis/py_binary.c +++ b/plugins/pychrysa/analysis/py_binary.c @@ -35,7 +35,7 @@ typedef struct { PyObject_HEAD - GOpenidaBinary *binary; /* Instance réelle rattachée */ + GLoadedBinary *binary; /* Instance réelle rattachée */ } pybinary; @@ -126,7 +126,7 @@ pybinary_new(PyTypeObject *type, PyObject *args, PyObject *kwds) * * ******************************************************************************/ -PyObject *pybinary_new_from_existing(GOpenidaBinary *binary) +PyObject *pybinary_new_from_existing(GLoadedBinary *binary) { pybinary *result; /* Nouvelle instance à renvoyer*/ PyTypeObject *type; /* Type d'objet à créer */ @@ -216,7 +216,7 @@ static PyObject *pybinary_get_lines(pybinary *self) PyObject *result; /* Liste à retourner */ GRenderingLine *lines; /* Liste récupérée à convertir */ - lines = g_openida_binary_get_lines(self->binary); + lines = g_loaded_binary_get_lines(self->binary); result = pyline_new_from_existing(lines, lines); diff --git a/plugins/pychrysa/analysis/py_binary.h b/plugins/pychrysa/analysis/py_binary.h index f87d2a5..92c37eb 100644 --- a/plugins/pychrysa/analysis/py_binary.h +++ b/plugins/pychrysa/analysis/py_binary.h @@ -35,7 +35,7 @@ /* Initialise le greffon permettant l'usage de Python. */ -PyObject *pybinary_new_from_existing(GOpenidaBinary *); +PyObject *pybinary_new_from_existing(GLoadedBinary *); /* Ajoute l'objet 'binary' au module Python. */ bool add_binary_to_python_module(PyObject *); diff --git a/plugins/pychrysa/plugin.c b/plugins/pychrysa/plugin.c index 6d8a494..70ca26e 100644 --- a/plugins/pychrysa/plugin.c +++ b/plugins/pychrysa/plugin.c @@ -72,7 +72,7 @@ static PluginAction g_python_plugin_get_action(const GPythonPlugin *); static MatchingFormatAction g_python_plugin_is_matching(const GPythonPlugin *, char **, bin_t **, off_t *); /* Exécute une action définie sur un binaire chargé. */ -static bool g_python_plugin_execute_on_binary(GPythonPlugin *, GOpenidaBinary *, PluginAction); +static bool g_python_plugin_execute_on_binary(GPythonPlugin *, GLoadedBinary *, PluginAction); /* Exécute une action relative à un débogueur. */ @@ -496,7 +496,7 @@ static MatchingFormatAction g_python_plugin_is_matching(const GPythonPlugin *plu * * ******************************************************************************/ -static bool g_python_plugin_execute_on_binary(GPythonPlugin *plugin, GOpenidaBinary *binary, PluginAction action) +static bool g_python_plugin_execute_on_binary(GPythonPlugin *plugin, GLoadedBinary *binary, PluginAction action) { bool result; /* Bilan à remonter */ PyObject *args; /* Arguments pour l'appel */ |