summaryrefslogtreecommitdiff
path: root/src/arch/instruction.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2012-07-23 19:07:29 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2012-07-23 19:07:29 (GMT)
commit8b35a66464636d0c46237af7490a6ca6866ecc4d (patch)
tree92199b36e3af00eb4c175a80c20b9b14511a6a45 /src/arch/instruction.c
parent8b2189a819c7a761cfdb97d9e3382ea963f225fb (diff)
Improved decompilation of Dalvik bytecode.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@252 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/instruction.c')
-rw-r--r--src/arch/instruction.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/arch/instruction.c b/src/arch/instruction.c
index 6bb10e8..2d1836b 100644
--- a/src/arch/instruction.c
+++ b/src/arch/instruction.c
@@ -700,10 +700,25 @@ void g_arch_instruction_print(const GArchInstruction *instr, GCodeBuffer *buffer
GDecInstruction *g_arch_instruction_decompile(const GArchInstruction *instr, GDecContext *ctx)
{
GDecInstruction *result; /* Instruction à retourner */
+ GDecInstruction *list; /* Instructions décompilées */
if (instr->decomp != NULL)
+ {
result = instr->decomp(instr, ctx);
+ if (result != NULL)
+ {
+ list = g_dec_context_get_decomp_instrs(ctx);
+
+ if (list == NULL) list = result;
+ else g_dec_instruction_add_to_list(&list, result);
+
+ g_dec_context_set_decomp_instrs(ctx, list);
+
+ }
+
+ }
+
else
result = NULL;