summaryrefslogtreecommitdiff
path: root/plugins/pychrysa/analysis/binaries
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysa/analysis/binaries')
-rw-r--r--plugins/pychrysa/analysis/binaries/file.c2
-rw-r--r--plugins/pychrysa/analysis/binaries/module.c24
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;