diff options
Diffstat (limited to 'plugins/pychrysalide/arch/processor.c')
-rw-r--r-- | plugins/pychrysalide/arch/processor.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/plugins/pychrysalide/arch/processor.c b/plugins/pychrysalide/arch/processor.c index f356a91..c356fa4 100644 --- a/plugins/pychrysalide/arch/processor.c +++ b/plugins/pychrysalide/arch/processor.c @@ -645,28 +645,22 @@ static PyObject *py_arch_processor_disassemble(PyObject *self, PyObject *args) PyObject *result; /* Instance à retourner */ GProcContext *ctx; /* Contexte de désassemblage */ GBinContent *content; /* Contenu binaire à parcourir */ - PyObject *pypos; /* Position en objet Python */ + vmpa2t *addr; /* Position d'analyse courante */ GExeFormat *format; /* Format de fichier associé */ int ret; /* Bilan de lecture des args. */ - vmpa2t pos; /* Position d'analyse courante */ GArchProcessor *proc; /* Processeur manipulé */ GArchInstruction *instr; /* Instruction mise en place */ ret = PyArg_ParseTuple(args, "O&O&OO&", convert_to_proc_context, &ctx, convert_to_binary_content, &content, - &pypos, + convert_any_to_vmpa, &addr, convert_to_executable_format, &format); if (!ret) return NULL; - ret = convert_any_to_vmpa(pypos, &pos); - if (ret != 1) return NULL; - proc = G_ARCH_PROCESSOR(pygobject_get(self)); - instr = g_arch_processor_disassemble(proc, ctx, content, &pos, format); - - copy_vmpa(get_internal_vmpa(pypos), &pos); + instr = g_arch_processor_disassemble(proc, ctx, content, addr, format); if (instr != NULL) { @@ -679,6 +673,8 @@ static PyObject *py_arch_processor_disassemble(PyObject *self, PyObject *args) Py_INCREF(result); } + clean_vmpa_arg(addr); + return result; } @@ -706,7 +702,7 @@ static PyObject *py_arch_processor_disassemble(PyObject *self, PyObject *args) static PyObject *py_arch_processor_add_error(PyObject *self, PyObject *args) { ArchProcessingError type; /* Type d'erreur détectée */ - vmpa2t addr; /* Position d'une erreur */ + vmpa2t *addr; /* Position d'une erreur */ const char *desc; /* Description d'une erreur */ int ret; /* Bilan de lecture des args. */ GArchProcessor *proc; /* Processeur manipulé */ @@ -716,7 +712,9 @@ static PyObject *py_arch_processor_add_error(PyObject *self, PyObject *args) proc = G_ARCH_PROCESSOR(pygobject_get(self)); - g_arch_processor_add_error(proc, type, &addr, desc); + g_arch_processor_add_error(proc, type, addr, desc); + + clean_vmpa_arg(addr); Py_RETURN_NONE; |