summaryrefslogtreecommitdiff
path: root/plugins/pychrysalide/analysis/loaded.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-02-01 18:12:31 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-02-01 18:12:31 (GMT)
commit113f37b954e395beb2a335e5e364746c70af625d (patch)
treed58b2839f1dd95096f72221c07c4b2a508eca6e9 /plugins/pychrysalide/analysis/loaded.c
parent9d4a0ba0e5a217bf4ac63c21e14d5f44580b6138 (diff)
Inserted an option to render disassembly even in batch mode.
Diffstat (limited to 'plugins/pychrysalide/analysis/loaded.c')
-rw-r--r--plugins/pychrysalide/analysis/loaded.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/plugins/pychrysalide/analysis/loaded.c b/plugins/pychrysalide/analysis/loaded.c
index 9c30261..37d11b4 100644
--- a/plugins/pychrysalide/analysis/loaded.c
+++ b/plugins/pychrysalide/analysis/loaded.c
@@ -61,7 +61,7 @@ static PyObject *py_loaded_content_get_content(PyObject *, void *);
/******************************************************************************
* *
* Paramètres : self = contenu binaire à manipuler. *
-* args = non utilisé ici. *
+* args = arguments fournis à l'appel. *
* *
* Description : Lance l'analyse propre à l'élément chargé. *
* *
@@ -73,11 +73,18 @@ static PyObject *py_loaded_content_get_content(PyObject *, void *);
static PyObject *py_loaded_content_analyze(PyObject *self, PyObject *args)
{
+ int cache; /* Préparation de rendu ? */
+ int ret; /* Bilan de lecture des args. */
GLoadedContent *content; /* Version GLib de l'élément */
+ cache = 0;
+
+ ret = PyArg_ParseTuple(args, "|p", &cache);
+ if (!ret) return NULL;
+
content = G_LOADED_CONTENT(pygobject_get(self));
- g_loaded_content_analyze(content);
+ g_loaded_content_analyze(content, cache);
Py_RETURN_NONE;
@@ -87,7 +94,7 @@ static PyObject *py_loaded_content_analyze(PyObject *self, PyObject *args)
/******************************************************************************
* *
* Paramètres : self = contenu binaire à manipuler. *
-* args = non utilisé ici. *
+* args = arguments fournis à l'appel. *
* *
* Description : Lance l'analyse de l'élément chargé et attend sa conclusion. *
* *
@@ -100,15 +107,22 @@ static PyObject *py_loaded_content_analyze(PyObject *self, PyObject *args)
static PyObject *py_loaded_content_analyze_and_wait(PyObject *self, PyObject *args)
{
PyObject *result; /* Bilan à retourner */
+ int cache; /* Préparation de rendu ? */
+ int ret; /* Bilan de lecture des args. */
PyThreadState *_save; /* Sauvegarde de contexte */
GLoadedContent *content; /* Version GLib de l'élément */
bool status; /* Bilan de l'opération */
+ cache = 0;
+
+ ret = PyArg_ParseTuple(args, "|p", &cache);
+ if (!ret) return NULL;
+
content = G_LOADED_CONTENT(pygobject_get(self));
Py_UNBLOCK_THREADS;
- status = g_loaded_content_analyze_and_wait(content);
+ status = g_loaded_content_analyze_and_wait(content, cache);
Py_BLOCK_THREADS;
@@ -245,14 +259,14 @@ PyTypeObject *get_python_loaded_content_type(void)
static PyMethodDef py_loaded_content_methods[] = {
{
"analyze", py_loaded_content_analyze,
- METH_NOARGS,
- "analyze($self, /)\n--\n\nStart the analysis of the loaded binary and " \
+ METH_VARARGS,
+ "analyze($self, cache, /)\n--\n\nStart the analysis of the loaded binary and " \
"send an \"analyzed\" signal when done."
},
{
"analyze_and_wait", py_loaded_content_analyze_and_wait,
- METH_NOARGS,
- "analyze_and_wait($self, /)\n--\n\nRun the analysis of the loaded binary and " \
+ METH_VARARGS,
+ "analyze_and_wait($self, cache, /)\n--\n\nRun the analysis of the loaded binary and " \
"wait for its completion."
},
{