summaryrefslogtreecommitdiff
path: root/src/arch/dalvik/decomp/arithm.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2012-07-29 21:41:52 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2012-07-29 21:41:52 (GMT)
commit8e1f2335773a9025cd46d45a33261725707af3ba (patch)
tree6001a1095985514bbde3c8ec49b4dd5d32182fc8 /src/arch/dalvik/decomp/arithm.c
parent8b35a66464636d0c46237af7490a6ca6866ecc4d (diff)
Updated all decompiled instructions using right pseudo registers.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@253 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/dalvik/decomp/arithm.c')
-rw-r--r--src/arch/dalvik/decomp/arithm.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/arch/dalvik/decomp/arithm.c b/src/arch/dalvik/decomp/arithm.c
index 257c59a..a217adf 100644
--- a/src/arch/dalvik/decomp/arithm.c
+++ b/src/arch/dalvik/decomp/arithm.c
@@ -2,7 +2,7 @@
/* OpenIDA - Outil d'analyse de fichiers binaires
* arithm.c - décompilation des opérations arithmétiques
*
- * Copyright (C) 2010-2011 Cyrille Bagard
+ * Copyright (C) 2010-2012 Cyrille Bagard
*
* This file is part of OpenIDA.
*
@@ -49,9 +49,9 @@ GDecInstruction *dalvik_decomp_instr_arithm(const GArchInstruction *instr, GDecC
GDecInstruction *result; /* Instruction à retourner */
ArithmOperationType type; /* Type d'opération menée */
GArchOperand *operand; /* Opérande de l'instruction */
- GDecInstruction *dest; /* Enregistrement du résultat */
GDecInstruction *op1; /* Premier opérande utilisé */
GDecInstruction *op2; /* Second opérande utilisé */
+ GDecInstruction *dest; /* Enregistrement du résultat */
GDecInstruction *arithm; /* Opération arithmétique */
switch (g_dalvik_instruction_get_opcode(G_DALVIK_INSTRUCTION(instr)))
@@ -85,14 +85,14 @@ GDecInstruction *dalvik_decomp_instr_arithm(const GArchInstruction *instr, GDecC
break;
}
- operand = g_arch_instruction_get_operand(instr, 0);
- dest = g_dec_context_convert_register(ctx, operand);
-
operand = g_arch_instruction_get_operand(instr, 1);
- op1 = g_dec_context_convert_register(ctx, operand);
+ op1 = g_dec_context_convert_register(ctx, operand, false);
operand = g_arch_instruction_get_operand(instr, 2);
- op2 = g_dec_context_convert_register(ctx, operand);
+ op2 = g_dec_context_convert_register(ctx, operand, false);
+
+ operand = g_arch_instruction_get_operand(instr, 0);
+ dest = g_dec_context_convert_register(ctx, operand, true);
arithm = g_arithm_expression_new(G_DEC_EXPRESSION(op1), type, G_DEC_EXPRESSION(op2));
result = g_assign_expression_new(G_DEC_EXPRESSION(dest), G_DEC_EXPRESSION(arithm));
@@ -120,8 +120,8 @@ GDecInstruction *dalvik_decomp_instr_arithm_2addr(const GArchInstruction *instr,
GDecInstruction *result; /* Instruction à retourner */
ArithmOperationType type; /* Type d'opération menée */
GArchOperand *operand; /* Opérande de l'instruction */
- GDecInstruction *dest; /* Enregistrement du résultat */
GDecInstruction *op1; /* Premier opérande utilisé */
+ GDecInstruction *dest; /* Enregistrement du résultat */
GDecInstruction *arithm; /* Opération arithmétique */
switch (g_dalvik_instruction_get_opcode(G_DALVIK_INSTRUCTION(instr)))
@@ -153,11 +153,11 @@ GDecInstruction *dalvik_decomp_instr_arithm_2addr(const GArchInstruction *instr,
break;
}
- operand = g_arch_instruction_get_operand(instr, 0);
- dest = g_dec_context_convert_register(ctx, operand);
-
operand = g_arch_instruction_get_operand(instr, 1);
- op1 = g_dec_context_convert_register(ctx, operand);
+ op1 = g_dec_context_convert_register(ctx, operand, false);
+
+ operand = g_arch_instruction_get_operand(instr, 0);
+ dest = g_dec_context_convert_register(ctx, operand, true);
arithm = g_arithm_expression_new(G_DEC_EXPRESSION(dest), type, G_DEC_EXPRESSION(op1));
result = g_assign_expression_new(G_DEC_EXPRESSION(dest), G_DEC_EXPRESSION(arithm));
@@ -185,9 +185,9 @@ GDecInstruction *dalvik_decomp_instr_arithm_lit(const GArchInstruction *instr, G
GDecInstruction *result; /* Instruction à retourner */
ArithmOperationType type; /* Type d'opération menée */
GArchOperand *operand; /* Opérande de l'instruction */
- GDecInstruction *dest; /* Enregistrement du résultat */
GDecInstruction *op1; /* Premier opérande utilisé */
GDecInstruction *op2; /* Second opérande utilisé */
+ GDecInstruction *dest; /* Enregistrement du résultat */
GDecInstruction *arithm; /* Opération arithmétique */
switch (g_dalvik_instruction_get_opcode(G_DALVIK_INSTRUCTION(instr)))
@@ -225,15 +225,15 @@ GDecInstruction *dalvik_decomp_instr_arithm_lit(const GArchInstruction *instr, G
break;
}
- operand = g_arch_instruction_get_operand(instr, 0);
- dest = g_dec_context_convert_register(ctx, operand);
-
operand = g_arch_instruction_get_operand(instr, 1);
- op1 = g_dec_context_convert_register(ctx, operand);
+ op1 = g_dec_context_convert_register(ctx, operand, false);
operand = g_arch_instruction_get_operand(instr, 2);
op2 = g_imm_expression_new(G_IMM_OPERAND(operand));
+ operand = g_arch_instruction_get_operand(instr, 0);
+ dest = g_dec_context_convert_register(ctx, operand, true);
+
arithm = g_arithm_expression_new(G_DEC_EXPRESSION(op1), type, G_DEC_EXPRESSION(op2));
result = g_assign_expression_new(G_DEC_EXPRESSION(dest), G_DEC_EXPRESSION(arithm));