diff options
Diffstat (limited to 'plugins/pychrysalide/analysis/loaded.c')
-rw-r--r-- | plugins/pychrysalide/analysis/loaded.c | 77 |
1 files changed, 76 insertions, 1 deletions
diff --git a/plugins/pychrysalide/analysis/loaded.c b/plugins/pychrysalide/analysis/loaded.c index b38025a..328bf7b 100644 --- a/plugins/pychrysalide/analysis/loaded.c +++ b/plugins/pychrysalide/analysis/loaded.c @@ -36,6 +36,12 @@ +/* Lance l'analyse propre à l'élément chargé. */ +static PyObject *py_loaded_content_analyze(PyObject *, PyObject *); + +/* Lance l'analyse de l'élément chargé et attend sa conclusion. */ +static PyObject *py_loaded_content_analyze_and_wait(PyObject *, PyObject *); + /* Détermine le nombre de vues disponibles pour un contenu. */ static PyObject *py_loaded_content_count_views(PyObject *, PyObject *); @@ -43,6 +49,63 @@ static PyObject *py_loaded_content_count_views(PyObject *, PyObject *); /****************************************************************************** * * +* Paramètres : self = contenu binaire à manipuler. * +* args = non utilisé ici. * +* * +* Description : Lance l'analyse propre à l'élément chargé. * +* * +* Retour : Rien (None). * +* * +* Remarques : - * +* * +******************************************************************************/ + +static PyObject *py_loaded_content_analyze(PyObject *self, PyObject *args) +{ + GLoadedContent *content; /* Version GLib de l'élément */ + + content = G_LOADED_CONTENT(pygobject_get(self)); + + g_loaded_content_analyze(content); + + Py_RETURN_NONE; + +} + + +/****************************************************************************** +* * +* Paramètres : self = contenu binaire à manipuler. * +* args = non utilisé ici. * +* * +* Description : Lance l'analyse de l'élément chargé et attend sa conclusion. * +* * +* Retour : Bilan de l'opération. * +* * +* Remarques : - * +* * +******************************************************************************/ + +static PyObject *py_loaded_content_analyze_and_wait(PyObject *self, PyObject *args) +{ + PyObject *result; /* Bilan à retourner */ + GLoadedContent *content; /* Version GLib de l'élément */ + bool status; /* Bilan de l'opération */ + + content = G_LOADED_CONTENT(pygobject_get(self)); + + status = g_loaded_content_analyze_and_wait(content); + + result = status ? Py_True : Py_False; + Py_INCREF(result); + + return result; + +} + + +/****************************************************************************** +* * * Paramètres : self = contenu chargé à manipuler. * * args = non utilisé ici. * * * @@ -57,7 +120,7 @@ static PyObject *py_loaded_content_count_views(PyObject *, PyObject *); static PyObject *py_loaded_content_count_views(PyObject *self, PyObject *args) { PyObject *result; /* Instance à retourner */ - GLoadedContent *content; /* Version GLib du format */ + GLoadedContent *content; /* Version GLib de l'élément */ size_t count; /* Quantité à retourner */ content = G_LOADED_CONTENT(pygobject_get(self)); @@ -87,6 +150,18 @@ 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 " \ + "send a \"disassembly-done\" 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 " \ + "wait for its completion." + }, + { "count_views", py_loaded_content_count_views, METH_NOARGS, "count_views($self, /)\n--\n\nCompute the quantity of available views." |