summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/analysis/loaded.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-12-12 03:13:36 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-12-12 03:13:36 (GMT)
commitc9ee0db8f8012eb523ef26de6b8a0b86181c2609 (patch)
treee34bd57c7eab3ae2c6bf968d93ce37c7c2c927a5 /plugins/pychrysalide/analysis/loaded.c
parentcdfc8c13fdd78c4af6e0ad120a8369e5fcb2e78d (diff)
Provided access to loaded content from Python.
Diffstat (limited to 'plugins/pychrysalide/analysis/loaded.c')
-rw-r--r--plugins/pychrysalide/analysis/loaded.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/plugins/pychrysalide/analysis/loaded.c b/plugins/pychrysalide/analysis/loaded.c
index ac8176f..6801ec3 100644
--- a/plugins/pychrysalide/analysis/loaded.c
+++ b/plugins/pychrysalide/analysis/loaded.c
@@ -52,6 +52,9 @@ static PyObject *py_loaded_content_detect_obfuscators(PyObject *, PyObject *);
/* Détermine le nombre de vues disponibles pour un contenu. */
static PyObject *py_loaded_content_count_views(PyObject *, PyObject *);
+/* Fournit le contenu représenté de l'élément chargé. */
+static PyObject *py_loaded_content_get_content(PyObject *, void *);
+
/******************************************************************************
@@ -189,6 +192,38 @@ static PyObject *py_loaded_content_count_views(PyObject *self, PyObject *args)
/******************************************************************************
* *
+* Paramètres : self = objet Python concerné par l'appel. *
+* closure = non utilisé ici. *
+* *
+* Description : Fournit le contenu représenté de l'élément chargé. *
+* *
+* Retour : Contenu représenté. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static PyObject *py_loaded_content_get_content(PyObject *self, void *closure)
+{
+ PyObject *result; /* Instance Python à retourner */
+ GLoadedContent *content; /* Version GLib de l'élément */
+ GBinContent *bincnt; /* Contenu binaire associé */
+
+ content = G_LOADED_CONTENT(pygobject_get(self));
+
+ bincnt = g_loaded_content_get_content(content);
+
+ result = pygobject_new(G_OBJECT(bincnt));
+
+ g_object_unref(G_OBJECT(bincnt));
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : - *
* *
* Description : Fournit un accès à une définition de type à diffuser. *
@@ -228,6 +263,10 @@ PyTypeObject *get_python_loaded_content_type(void)
};
static PyGetSetDef py_loaded_content_getseters[] = {
+ {
+ "content", py_loaded_content_get_content, NULL,
+ "Binary content.", NULL
+ },
{ NULL }
};