summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/pychrysa/arch/immediate.c12
-rw-r--r--plugins/pychrysa/helpers.h8
-rw-r--r--plugins/stackvars/stackvars.c2
3 files changed, 18 insertions, 4 deletions
diff --git a/plugins/pychrysa/arch/immediate.c b/plugins/pychrysa/arch/immediate.c
index e600a9a..363c3cc 100644
--- a/plugins/pychrysa/arch/immediate.c
+++ b/plugins/pychrysa/arch/immediate.c
@@ -243,7 +243,9 @@ static int py_imm_operand_set_padding(PyObject *self, PyObject *value, void *clo
operand = G_IMM_OPERAND(pygobject_get(self));
assert(operand != NULL);
- g_imm_operand_pad(operand, padding);
+ g_imm_operand_pad(&operand, padding, NULL);
+
+ pygobject_set(self, operand);
return 0;
@@ -316,7 +318,9 @@ static int py_imm_operand_set_default_display(PyObject *self, PyObject *value, v
operand = G_IMM_OPERAND(pygobject_get(self));
assert(operand != NULL);
- g_imm_operand_set_default_display(operand, display);
+ g_imm_operand_set_default_display(&operand, display, NULL);
+
+ pygobject_set(self, operand);
return 0;
@@ -390,7 +394,9 @@ static int py_imm_operand_set_display(PyObject *self, PyObject *value, void *clo
operand = G_IMM_OPERAND(pygobject_get(self));
assert(operand != NULL);
- g_imm_operand_set_display(operand, display);
+ g_imm_operand_set_display(&operand, display, NULL);
+
+ pygobject_set(self, operand);
return 0;
diff --git a/plugins/pychrysa/helpers.h b/plugins/pychrysa/helpers.h
index 22f3702..3e079b7 100644
--- a/plugins/pychrysa/helpers.h
+++ b/plugins/pychrysa/helpers.h
@@ -65,5 +65,13 @@ bool PyDict_AddStringConstant(PyTypeObject *, const char *, const char *);
bool register_class_for_pygobject(PyObject *, GType, PyTypeObject *, PyTypeObject *);
+/**
+ * Quand on remplace un objet GLib dans le dos de Python, il faut
+ * le remplacer de la même manière qu'on l'a obtenu !
+ */
+
+#define pygobject_set(p, v) ((PyGObject *)(p))->obj = (GObject *)v
+
+
#endif /* _PLUGINS_HELPERS_H */
diff --git a/plugins/stackvars/stackvars.c b/plugins/stackvars/stackvars.c
index f3baeef..4e07035 100644
--- a/plugins/stackvars/stackvars.c
+++ b/plugins/stackvars/stackvars.c
@@ -216,7 +216,7 @@ static bool replace_stack_vars_in_instruction(GArchInstruction *instr, GBinRouti
if (!dryrun && result)
{
- _g_arch_instruction_replace_operand(instr, new, operand);
+ _g_arch_instruction_replace_operand(instr, operand, new);
result = true;