diff options
Diffstat (limited to 'src/arch/dalvik/decomp/arithm.c')
-rw-r--r-- | src/arch/dalvik/decomp/arithm.c | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/arch/dalvik/decomp/arithm.c b/src/arch/dalvik/decomp/arithm.c index a217adf..464694f 100644 --- a/src/arch/dalvik/decomp/arithm.c +++ b/src/arch/dalvik/decomp/arithm.c @@ -48,6 +48,7 @@ GDecInstruction *dalvik_decomp_instr_arithm(const GArchInstruction *instr, GDecC { GDecInstruction *result; /* Instruction à retourner */ ArithmOperationType type; /* Type d'opération menée */ + vmpa_t addr; /* Adresse de l'instruction */ GArchOperand *operand; /* Opérande de l'instruction */ GDecInstruction *op1; /* Premier opérande utilisé */ GDecInstruction *op2; /* Second opérande utilisé */ @@ -85,14 +86,16 @@ GDecInstruction *dalvik_decomp_instr_arithm(const GArchInstruction *instr, GDecC break; } + g_arch_instruction_get_location(instr, NULL, NULL, &addr); + operand = g_arch_instruction_get_operand(instr, 1); - op1 = g_dec_context_convert_register(ctx, operand, false); + op1 = g_dec_context_convert_register(ctx, operand, false, addr); operand = g_arch_instruction_get_operand(instr, 2); - op2 = g_dec_context_convert_register(ctx, operand, false); + op2 = g_dec_context_convert_register(ctx, operand, false, addr); operand = g_arch_instruction_get_operand(instr, 0); - dest = g_dec_context_convert_register(ctx, operand, true); + dest = g_dec_context_convert_register(ctx, operand, true, addr); 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)); @@ -119,6 +122,7 @@ GDecInstruction *dalvik_decomp_instr_arithm_2addr(const GArchInstruction *instr, { GDecInstruction *result; /* Instruction à retourner */ ArithmOperationType type; /* Type d'opération menée */ + vmpa_t addr; /* Adresse de l'instruction */ GArchOperand *operand; /* Opérande de l'instruction */ GDecInstruction *op1; /* Premier opérande utilisé */ GDecInstruction *dest; /* Enregistrement du résultat */ @@ -153,11 +157,13 @@ GDecInstruction *dalvik_decomp_instr_arithm_2addr(const GArchInstruction *instr, break; } + g_arch_instruction_get_location(instr, NULL, NULL, &addr); + operand = g_arch_instruction_get_operand(instr, 1); - op1 = g_dec_context_convert_register(ctx, operand, false); + op1 = g_dec_context_convert_register(ctx, operand, false, addr); operand = g_arch_instruction_get_operand(instr, 0); - dest = g_dec_context_convert_register(ctx, operand, true); + dest = g_dec_context_convert_register(ctx, operand, true, addr); 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)); @@ -184,6 +190,7 @@ GDecInstruction *dalvik_decomp_instr_arithm_lit(const GArchInstruction *instr, G { GDecInstruction *result; /* Instruction à retourner */ ArithmOperationType type; /* Type d'opération menée */ + vmpa_t addr; /* Adresse de l'instruction */ GArchOperand *operand; /* Opérande de l'instruction */ GDecInstruction *op1; /* Premier opérande utilisé */ GDecInstruction *op2; /* Second opérande utilisé */ @@ -225,14 +232,16 @@ GDecInstruction *dalvik_decomp_instr_arithm_lit(const GArchInstruction *instr, G break; } + g_arch_instruction_get_location(instr, NULL, NULL, &addr); + operand = g_arch_instruction_get_operand(instr, 1); - op1 = g_dec_context_convert_register(ctx, operand, false); + op1 = g_dec_context_convert_register(ctx, operand, false, addr); 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); + dest = g_dec_context_convert_register(ctx, operand, true, addr); 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)); |