summaryrefslogtreecommitdiff
path: root/plugins/pychrysa/arch/instruction.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/pychrysa/arch/instruction.c')
-rw-r--r--plugins/pychrysa/arch/instruction.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/plugins/pychrysa/arch/instruction.c b/plugins/pychrysa/arch/instruction.c
index 80cc4ee..bed937b 100644
--- a/plugins/pychrysa/arch/instruction.c
+++ b/plugins/pychrysa/arch/instruction.c
@@ -72,6 +72,9 @@ static PyObject *py_arch_instruction_get_iter(PyObject *);
/* Fournit la valeur associée à une propriété donnée. */
static PyObject *py_arch_instruction_get_location(PyObject *, char *);
+/* Fournit le nom humain de l'instruction manipulée. */
+static PyObject *py_arch_instruction_get_keyword(PyObject *, void *);
+
/* ---------------------------------------------------------------------------------- */
@@ -347,6 +350,35 @@ static PyObject *py_arch_instruction_get_location(PyObject *self, char *name)
/******************************************************************************
* *
+* Paramètres : self = classe représentant une instruction. *
+* unused = adresse non utilisée ici. *
+* *
+* Description : Fournit le nom humain de l'instruction manipulée. *
+* *
+* Retour : Valeur associée à la propriété consultée. *
+* *
+* Remarques : - *
+* *
+******************************************************************************/
+
+static PyObject *py_arch_instruction_get_keyword(PyObject *self, void *unused)
+{
+ PyObject *result; /* Trouvailles à retourner */
+ GArchInstruction *instr; /* Version native */
+ const char *kw; /* Valeur récupérée */
+
+ instr = G_ARCH_INSTRUCTION(pygobject_get(self));
+ kw = g_arch_instruction_get_keyword(instr);
+
+ result = PyString_FromString(kw);
+
+ return result;
+
+}
+
+
+/******************************************************************************
+* *
* Paramètres : module = module dont la définition est à compléter. *
* *
* Description : Prend en charge l'objet 'pychrysalide.arch.ArchInstruction'. *
@@ -379,6 +411,10 @@ bool register_python_arch_instruction(PyObject *module)
"address", (getter)py_arch_instruction_get_location, (setter)NULL,
"Provide the location of the instruction in memory.", "address"
},
+ {
+ "keyword", (getter)py_arch_instruction_get_keyword, (setter)NULL,
+ "Give le name of the assembly instruction.", NULL
+ },
{ NULL }
};