diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-03-11 21:57:05 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-03-11 21:57:05 (GMT) |
commit | 8088f1cbb4304c686ff41520099707a333084a4e (patch) | |
tree | 147411c3f90097dc1ae950ec390df2dfccf07ad7 /plugins/pychrysalide/analysis/routine.c | |
parent | a33dd28e763e3a8b04145fb549aca9320e100a4b (diff) |
Defined a new Dex demangler with MUTF-8 support as plugin.
Diffstat (limited to 'plugins/pychrysalide/analysis/routine.c')
-rw-r--r-- | plugins/pychrysalide/analysis/routine.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/plugins/pychrysalide/analysis/routine.c b/plugins/pychrysalide/analysis/routine.c index 37f36a7..d0abd72 100644 --- a/plugins/pychrysalide/analysis/routine.c +++ b/plugins/pychrysalide/analysis/routine.c @@ -42,6 +42,9 @@ +/* Décrit la routine fournie sous forme de caractères. */ +static PyObject *py_binary_routine_to_str(PyObject *); + /* Crée un nouvel objet Python de type 'BinRoutine'. */ static PyObject *py_binary_routine_new(PyTypeObject *, PyObject *, PyObject *); @@ -58,6 +61,37 @@ static PyObject *py_binary_routine_get_basic_blocks(PyObject *, void *); /****************************************************************************** * * +* Paramètres : self = instance d'une routine version Python à traiter. * +* * +* Description : Décrit la routine fournie sous forme de caractères. * +* * +* Retour : Chaîne de caractère construite pour l'occasion. * +* * +* Remarques : - * +* * +******************************************************************************/ + +static PyObject *py_binary_routine_to_str(PyObject *self) +{ + PyObject *result; /* Représentation à retourner */ + GBinRoutine *routine; /* Version native de l'objet */ + char *desc; /* Description du type */ + + routine = G_BIN_ROUTINE(pygobject_get(self)); + + desc = g_binary_routine_to_string(routine); + + result = PyUnicode_FromString(desc); + + free(desc); + + return result; + +} + + +/****************************************************************************** +* * * Paramètres : type = type de l'objet à instancier. * * args = arguments fournis à l'appel. * * kwds = arguments de type key=val fournis. * @@ -250,6 +284,8 @@ PyTypeObject *get_python_binary_routine_type(void) .tp_name = "pychrysalide.analysis.BinRoutine", + .tp_str = py_binary_routine_to_str, + .tp_flags = Py_TPFLAGS_DEFAULT, .tp_doc = "PyChrysalide binary routine", |