diff options
Diffstat (limited to 'plugins/arm/python/module.c')
-rw-r--r-- | plugins/arm/python/module.c | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/plugins/arm/python/module.c b/plugins/arm/python/module.c index 9e832ba..12189c9 100644 --- a/plugins/arm/python/module.c +++ b/plugins/arm/python/module.c @@ -29,6 +29,7 @@ #include <plugins/pychrysalide/access.h> +#include <plugins/pychrysalide/helpers.h> #include "instruction.h" @@ -54,7 +55,6 @@ bool add_arch_arm_module_to_python_module(void) bool result; /* Bilan à retourner */ PyObject *super; /* Module à compléter */ PyObject *module; /* Sous-module mis en place */ - int ret; /* Bilan d'un appel */ static PyModuleDef py_chrysalide_arm_module = { @@ -71,34 +71,16 @@ bool add_arch_arm_module_to_python_module(void) super = get_access_to_python_module("pychrysalide.arch"); - module = PyModule_Create(&py_chrysalide_arm_module); - if (module == NULL) return false; + module = build_python_module(super, &py_chrysalide_arm_module); - ret = PyState_AddModule(super, &py_chrysalide_arm_module); - if (ret != 0) goto aaamtpm_exit; + result = (module != NULL); - ret = _PyImport_FixupBuiltin(module, "pychrysalide.arch.arm"); - if (ret != 0) goto aaamtpm_exit; + if (result) result = register_python_arm_instruction(module); + if (result) result = register_python_arm_processor(module); - Py_INCREF(module); - ret = PyModule_AddObject(super, "arm", module); - if (ret != 0) goto aaamtpm_exit; + if (result) result = add_arch_arm_v7_module_to_python_module(module); - result = true; - - result &= register_python_arm_instruction(module); - result &= register_python_arm_processor(module); - - result &= add_arch_arm_v7_module_to_python_module(module); - - aaamtpm_exit: - - if (!result) - { - printf("something went wrong in %s...\n", __FUNCTION__); - /* ... */ - - } + assert(result); return result; |