summaryrefslogtreecommitdiff
path: root/plugins/pychrysa/analysis/binary.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-12-30 10:38:52 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-12-30 10:38:52 (GMT)
commit932ea7c83c07d3982fee605c6dd9895fd2753874 (patch)
tree766ad53bab9e3e3005334c30e823493de8e84168 /plugins/pychrysa/analysis/binary.c
parent1b5d39bfbc48c33a0ea0924b60e48448c8b45dd4 (diff)
Rewritten the line buffers using generators and on-demand building to save memory.
Diffstat (limited to 'plugins/pychrysa/analysis/binary.c')
-rw-r--r--plugins/pychrysa/analysis/binary.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/plugins/pychrysa/analysis/binary.c b/plugins/pychrysa/analysis/binary.c
index 32e4a71..5b857d5 100644
--- a/plugins/pychrysa/analysis/binary.c
+++ b/plugins/pychrysa/analysis/binary.c
@@ -55,7 +55,7 @@ static PyObject *py_loaded_binary_get_format(PyObject *, void *);
static PyObject *py_loaded_binary_get_processor(PyObject *, void *);
/* Fournit le tampon associé au contenu assembleur d'un binaire. */
-static PyObject *py_loaded_binary_get_disassembled_buffer(PyObject *, void *);
+static PyObject *py_loaded_binary_get_disassembled_cache(PyObject *, void *);
@@ -234,16 +234,18 @@ static PyObject *py_loaded_binary_get_processor(PyObject *self, void *closure)
* *
******************************************************************************/
-static PyObject *py_loaded_binary_get_disassembled_buffer(PyObject *self, void *closure)
+static PyObject *py_loaded_binary_get_disassembled_cache(PyObject *self, void *closure)
{
PyObject *result; /* Trouvailles à retourner */
GLoadedBinary *binary; /* Version native */
- GCodeBuffer *buffer; /* Tampon à récupérer */
+ GBufferCache *cache; /* Tampon à récupérer */
binary = G_LOADED_BINARY(pygobject_get(self));
- buffer = g_loaded_binary_get_disassembled_buffer(binary);
+ cache = g_loaded_binary_get_disassembled_cache(binary);
- result = pygobject_new(G_OBJECT(buffer));
+ result = pygobject_new(G_OBJECT(cache));
+
+ g_object_unref(G_OBJECT(cache));
return result;
@@ -288,8 +290,8 @@ PyTypeObject *get_python_loaded_binary_type(void)
"Handler for the current binary processor.", NULL
},
{
- "disassembled_buffer", py_loaded_binary_get_disassembled_buffer, NULL,
- "Disassembled code buffer.", NULL
+ "disassembled_cache", py_loaded_binary_get_disassembled_cache, NULL,
+ "Disassembled buffer cache.", NULL
},
{ NULL }
};