diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2020-02-02 20:38:58 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2020-02-02 20:38:58 (GMT) |
commit | 296b4ed15fd074f80266e1d22ef4ade7ee11905e (patch) | |
tree | 9ec0dc238f42c5f3b7f12e96dd1c631685c539b3 /plugins/pychrysalide/arch/instruction.c | |
parent | 62f178cc3dcc889d56ba6d94f6fc8bba7b503c1a (diff) |
Relied on flags for raw instructions.
Diffstat (limited to 'plugins/pychrysalide/arch/instruction.c')
-rw-r--r-- | plugins/pychrysalide/arch/instruction.c | 40 |
1 files changed, 2 insertions, 38 deletions
diff --git a/plugins/pychrysalide/arch/instruction.c b/plugins/pychrysalide/arch/instruction.c index 757949a..3b3033f 100644 --- a/plugins/pychrysalide/arch/instruction.c +++ b/plugins/pychrysalide/arch/instruction.c @@ -35,6 +35,7 @@ #include <plugins/dt.h> +#include "constants.h" #include "operand.h" #include "vmpa.h" #include "../access.h" @@ -149,9 +150,6 @@ static int py_arch_instruction_set_range(PyObject *, PyObject *, void *); /* Fournit le nom humain de l'instruction manipulée. */ static PyObject *py_arch_instruction_get_keyword(PyObject *, void *); -/* Définit les constantes pour les instructions. */ -static bool py_arch_instruction_define_constants(PyTypeObject *); - /* ---------------------------------------------------------------------------------- */ @@ -839,40 +837,6 @@ static PyObject *py_arch_instruction_get_keyword(PyObject *self, void *unused) /****************************************************************************** * * -* Paramètres : obj_type = type dont le dictionnaire est à compléter. * -* * -* Description : Définit les constantes pour les instructions. * -* * -* Retour : true en cas de succès de l'opération, false sinon. * -* * -* Remarques : - * -* * -******************************************************************************/ - -static bool py_arch_instruction_define_constants(PyTypeObject *obj_type) -{ - bool result; /* Bilan à retourner */ - - result = true; - - result &= PyDict_AddULongMacro(obj_type, ILT_EXEC_FLOW); - result &= PyDict_AddULongMacro(obj_type, ILT_JUMP); - result &= PyDict_AddULongMacro(obj_type, ILT_CASE_JUMP); - result &= PyDict_AddULongMacro(obj_type, ILT_JUMP_IF_TRUE); - result &= PyDict_AddULongMacro(obj_type, ILT_JUMP_IF_FALSE); - result &= PyDict_AddULongMacro(obj_type, ILT_LOOP); - result &= PyDict_AddULongMacro(obj_type, ILT_CALL); - result &= PyDict_AddULongMacro(obj_type, ILT_CATCH_EXCEPTION); - result &= PyDict_AddULongMacro(obj_type, ILT_REF); - result &= PyDict_AddULongMacro(obj_type, ILT_COUNT); - - return result; - -} - - -/****************************************************************************** -* * * Paramètres : - * * * * Description : Fournit un accès à une définition de type à diffuser. * @@ -989,7 +953,7 @@ bool ensure_python_arch_instruction_is_registered(void) &PyGObject_Type, get_python_line_generator_type(), NULL)) return false; - if (!py_arch_instruction_define_constants(type)) + if (!define_arch_instruction_constants(type)) return false; } |