summaryrefslogtreecommitdiff
path: root/plugins/pychrysa/analysis/binary.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysa/analysis/binary.c')
-rw-r--r--plugins/pychrysa/analysis/binary.c27
1 files changed, 15 insertions, 12 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);