diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2020-01-08 23:42:44 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2020-01-08 23:42:44 (GMT) |
commit | 43f249445c9c69b9eabeea8be08b6b55a474f1fc (patch) | |
tree | d2ef7c1c464c13fb3fbd8c44b233b83a12df09a1 /plugins/pychrysalide/debug | |
parent | 70dce9d37e6b38c5bee7cfe175dcebd021e3a148 (diff) |
Fixed the link between native and Python locations.
Diffstat (limited to 'plugins/pychrysalide/debug')
-rw-r--r-- | plugins/pychrysalide/debug/debugger.c | 36 |
1 files changed, 24 insertions, 12 deletions
diff --git a/plugins/pychrysalide/debug/debugger.c b/plugins/pychrysalide/debug/debugger.c index 0a7f97c..884e644 100644 --- a/plugins/pychrysalide/debug/debugger.c +++ b/plugins/pychrysalide/debug/debugger.c @@ -196,7 +196,7 @@ static PyObject *py_binary_debugger_read_memory_u8(PyObject *self, PyObject *arg PyObject *result; /* Instance à retourner */ GBinaryDebugger *debugger; /* Version GLib du format */ int ret; /* Bilan de lecture des args. */ - vmpa2t addr; /* Position interne associée */ + vmpa2t *addr; /* Position interne associée */ uint8_t value; /* Valeur lue en mémoire */ bool status; /* Bilan de l'opération */ @@ -206,7 +206,7 @@ static PyObject *py_binary_debugger_read_memory_u8(PyObject *self, PyObject *arg ret = PyArg_ParseTuple(args, "O&", convert_any_to_vmpa, &addr); if (!ret) return NULL; - status = g_binary_debugger_read_memory_u8(debugger, get_virt_addr(&addr), &value); + status = g_binary_debugger_read_memory_u8(debugger, get_virt_addr(addr), &value); if (status) result = PyLong_FromUnsignedLongLong(value); @@ -217,6 +217,8 @@ static PyObject *py_binary_debugger_read_memory_u8(PyObject *self, PyObject *arg Py_INCREF(result); } + clean_vmpa_arg(addr); + return result; } @@ -240,7 +242,7 @@ static PyObject *py_binary_debugger_read_memory_u16(PyObject *self, PyObject *ar PyObject *result; /* Instance à retourner */ GBinaryDebugger *debugger; /* Version GLib du format */ int ret; /* Bilan de lecture des args. */ - vmpa2t addr; /* Position interne associée */ + vmpa2t *addr; /* Position interne associée */ uint16_t value; /* Valeur lue en mémoire */ bool status; /* Bilan de l'opération */ @@ -250,7 +252,7 @@ static PyObject *py_binary_debugger_read_memory_u16(PyObject *self, PyObject *ar ret = PyArg_ParseTuple(args, "O&", convert_any_to_vmpa, &addr); if (!ret) return NULL; - status = g_binary_debugger_read_memory_u16(debugger, get_virt_addr(&addr), &value); + status = g_binary_debugger_read_memory_u16(debugger, get_virt_addr(addr), &value); if (status) result = PyLong_FromUnsignedLongLong(value); @@ -261,6 +263,8 @@ static PyObject *py_binary_debugger_read_memory_u16(PyObject *self, PyObject *ar Py_INCREF(result); } + clean_vmpa_arg(addr); + return result; } @@ -284,7 +288,7 @@ static PyObject *py_binary_debugger_read_memory_u32(PyObject *self, PyObject *ar PyObject *result; /* Instance à retourner */ GBinaryDebugger *debugger; /* Version GLib du format */ int ret; /* Bilan de lecture des args. */ - vmpa2t addr; /* Position interne associée */ + vmpa2t *addr; /* Position interne associée */ uint32_t value; /* Valeur lue en mémoire */ bool status; /* Bilan de l'opération */ @@ -294,7 +298,7 @@ static PyObject *py_binary_debugger_read_memory_u32(PyObject *self, PyObject *ar ret = PyArg_ParseTuple(args, "O&", convert_any_to_vmpa, &addr); if (!ret) return NULL; - status = g_binary_debugger_read_memory_u32(debugger, get_virt_addr(&addr), &value); + status = g_binary_debugger_read_memory_u32(debugger, get_virt_addr(addr), &value); if (status) result = PyLong_FromUnsignedLongLong(value); @@ -305,6 +309,8 @@ static PyObject *py_binary_debugger_read_memory_u32(PyObject *self, PyObject *ar Py_INCREF(result); } + clean_vmpa_arg(addr); + return result; } @@ -328,7 +334,7 @@ static PyObject *py_binary_debugger_read_memory_u64(PyObject *self, PyObject *ar PyObject *result; /* Instance à retourner */ GBinaryDebugger *debugger; /* Version GLib du format */ int ret; /* Bilan de lecture des args. */ - vmpa2t addr; /* Position interne associée */ + vmpa2t *addr; /* Position interne associée */ uint64_t value; /* Valeur lue en mémoire */ bool status; /* Bilan de l'opération */ @@ -338,7 +344,7 @@ static PyObject *py_binary_debugger_read_memory_u64(PyObject *self, PyObject *ar ret = PyArg_ParseTuple(args, "O&", convert_any_to_vmpa, &addr); if (!ret) return NULL; - status = g_binary_debugger_read_memory_u64(debugger, get_virt_addr(&addr), &value); + status = g_binary_debugger_read_memory_u64(debugger, get_virt_addr(addr), &value); if (status) result = PyLong_FromUnsignedLongLong(value); @@ -349,6 +355,8 @@ static PyObject *py_binary_debugger_read_memory_u64(PyObject *self, PyObject *ar Py_INCREF(result); } + clean_vmpa_arg(addr); + return result; } @@ -844,7 +852,7 @@ static PyObject *py_binary_debugger_add_mem_bp(PyObject *self, PyObject *args) { PyObject *result; /* Instance à retourner */ GBinaryDebugger *debugger; /* Version GLib du format */ - vmpa2t addr; /* Position interne associée */ + vmpa2t *addr; /* Position interne associée */ int ret; /* Bilan de lecture des args. */ bool status; /* Bilan de l'opération */ @@ -854,11 +862,13 @@ static PyObject *py_binary_debugger_add_mem_bp(PyObject *self, PyObject *args) ret = PyArg_ParseTuple(args, "O&", convert_any_to_vmpa, &addr); if (!ret) return NULL; - status = g_binary_debugger_add_memory_breakpoint(debugger, get_virt_addr(&addr)); + status = g_binary_debugger_add_memory_breakpoint(debugger, get_virt_addr(addr)); result = status ? Py_True : Py_False; Py_INCREF(result); + clean_vmpa_arg(addr); + return result; } @@ -881,7 +891,7 @@ static PyObject *py_binary_debugger_delete_mem_bp(PyObject *self, PyObject *args { PyObject *result; /* Instance à retourner */ GBinaryDebugger *debugger; /* Version GLib du format */ - vmpa2t addr; /* Position interne associée */ + vmpa2t *addr; /* Position interne associée */ int ret; /* Bilan de lecture des args. */ bool status; /* Bilan de l'opération */ @@ -891,11 +901,13 @@ static PyObject *py_binary_debugger_delete_mem_bp(PyObject *self, PyObject *args ret = PyArg_ParseTuple(args, "O&", convert_any_to_vmpa, &addr); if (!ret) return NULL; - status = g_binary_debugger_delete_memory_breakpoint(debugger, get_virt_addr(&addr)); + status = g_binary_debugger_delete_memory_breakpoint(debugger, get_virt_addr(addr)); result = status ? Py_True : Py_False; Py_INCREF(result); + clean_vmpa_arg(addr); + return result; } |