diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2015-07-17 16:36:21 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2015-07-17 16:36:21 (GMT) |
commit | 24d3836fcf8d443eb654b981f65478cd9923b8f1 (patch) | |
tree | 7672a28b864127e8958c3c6cce751dcf646d2fbe /plugins/pychrysa/analysis/binaries | |
parent | a61f089babe336b012da31a494b0f7470b6e1a9a (diff) |
Updated the Python bindings.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@552 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'plugins/pychrysa/analysis/binaries')
-rw-r--r-- | plugins/pychrysa/analysis/binaries/file.c | 2 | ||||
-rw-r--r-- | plugins/pychrysa/analysis/binaries/module.c | 24 |
2 files changed, 12 insertions, 14 deletions
diff --git a/plugins/pychrysa/analysis/binaries/file.c b/plugins/pychrysa/analysis/binaries/file.c index af285d9..40463ba 100644 --- a/plugins/pychrysa/analysis/binaries/file.c +++ b/plugins/pychrysa/analysis/binaries/file.c @@ -60,7 +60,7 @@ static PyObject *py_binary_file_get_filename(PyObject *, void *); static PyObject *py_binary_file_new(PyTypeObject *type, PyObject *args, PyObject *kwds) { PyObject *result; /* Instance à retourner */ - char *filename; /* Nom du fichier à charger */ + const char *filename; /* Nom du fichier à charger */ int ret; /* Bilan de lecture des args. */ GLoadedBinary *binary; /* Version GLib du format */ diff --git a/plugins/pychrysa/analysis/binaries/module.c b/plugins/pychrysa/analysis/binaries/module.c index c2adddf..b43d24f 100644 --- a/plugins/pychrysa/analysis/binaries/module.c +++ b/plugins/pychrysa/analysis/binaries/module.c @@ -25,6 +25,9 @@ #include "module.h" +#include <assert.h> + + #include "file.h" @@ -47,7 +50,7 @@ bool add_analysis_binaries_module_to_python_module(PyObject *super) PyObject *module; /* Sous-module mis en place */ int ret; /* Bilan d'un appel */ - static PyModuleDef py_chrysalide_arch_module = { + static PyModuleDef py_chrysalide_binaries_module = { .m_base = PyModuleDef_HEAD_INIT, @@ -60,31 +63,26 @@ bool add_analysis_binaries_module_to_python_module(PyObject *super) result = false; - module = PyModule_Create(&py_chrysalide_arch_module); + module = PyModule_Create(&py_chrysalide_binaries_module); if (module == NULL) return false; - ret = PyState_AddModule(super, &py_chrysalide_arch_module); - if (ret != 0) goto aabmtpm_exit; + ret = PyState_AddModule(super, &py_chrysalide_binaries_module); + if (ret != 0) goto loading_failed; ret = _PyImport_FixupBuiltin(module, "pychrysalide.analysis.binaries"); - if (ret != 0) goto aabmtpm_exit; + if (ret != 0) goto loading_failed; Py_INCREF(module); ret = PyModule_AddObject(super, "binaries", module); - if (ret != 0) goto aabmtpm_exit; + if (ret != 0) goto loading_failed; result = true; result &= register_python_binary_file(module); - aabmtpm_exit: - - if (!result) - { - printf("something went wrong in %s...\n", __FUNCTION__); - /* ... */ + loading_failed: - } + assert(result); return result; |