diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2012-11-19 21:26:51 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2012-11-19 21:26:51 (GMT) |
commit | 5a70286f7f56cc72a0249fcaf404afabfb033956 (patch) | |
tree | ef2b94b04a3e84b93832749ccf6cd9b9cc370d3c /plugins/pychrysa/analysis | |
parent | 760e2e7346518dd1264126c1696f9ad88884d64c (diff) |
Handled Dalvik exception handlers in the graphic view.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@285 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'plugins/pychrysa/analysis')
-rw-r--r-- | plugins/pychrysa/analysis/binary.c | 39 |
1 files changed, 38 insertions, 1 deletions
diff --git a/plugins/pychrysa/analysis/binary.c b/plugins/pychrysa/analysis/binary.c index 93db685..e8158a2 100644 --- a/plugins/pychrysa/analysis/binary.c +++ b/plugins/pychrysa/analysis/binary.c @@ -33,6 +33,7 @@ #include "../quirks.h" #include "../arch/instruction.h" +#include "../format/executable.h" #include "../glibext/codebuffer.h" @@ -43,6 +44,9 @@ static PyObject *py_loaded_binary_new(PyTypeObject *, PyObject *, PyObject *); /* Fournit le fichier correspondant à l'élément binaire. */ static PyObject *py_loaded_binary_get_filename(PyObject *self, PyObject *args); +/* Fournit le format de fichier reconnu dans le contenu binaire. */ +static PyObject *py_loaded_binary_get_format(PyObject *, PyObject *); + /* Fournit les instructions issues du désassemblage. */ static PyObject *py_loaded_binary_get_instructions(PyObject *, PyObject *); @@ -151,6 +155,35 @@ static PyObject *py_loaded_binary_get_filename(PyObject *self, PyObject *args) * Paramètres : self = classe représentant un binaire. * * args = arguments fournis à l'appel. * * * +* Description : Fournit le format de fichier reconnu dans le contenu binaire.* +* * +* Retour : Nom de fichier avec chemin absolu. * +* * +* Remarques : - * +* * +******************************************************************************/ + +static PyObject *py_loaded_binary_get_format(PyObject *self, PyObject *args) +{ + PyObject *result; /* Trouvailles à retourner */ + GLoadedBinary *binary; /* Version native */ + GExeFormat *format; /* Format du binaire physique */ + + binary = G_LOADED_BINARY(pygobject_get(self)); + format = g_loaded_binary_get_format(binary); + + result = py_executable_format_from_c(format); + + return result; + +} + + +/****************************************************************************** +* * +* Paramètres : self = classe représentant un binaire. * +* args = arguments fournis à l'appel. * +* * * Description : Fournit les instructions issues du désassemblage. * * * * Retour : Instructions issues du désassemblage. * @@ -239,11 +272,15 @@ bool register_python_loaded_binary(PyObject *module) "Provide the filename of the loaded binary." }, { + "get_format", (PyCFunction)py_loaded_binary_get_format, + METH_NOARGS, + "Provide the file format recognized in the binary content." + }, + { "get_instructions", (PyCFunction)py_loaded_binary_get_instructions, METH_NOARGS, "Give access to all disassembled instructions." }, - { NULL } }; |