diff options
Diffstat (limited to 'src/arch/dalvik/decomp/if.c')
-rw-r--r-- | src/arch/dalvik/decomp/if.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/arch/dalvik/decomp/if.c b/src/arch/dalvik/decomp/if.c index b274ead..6a156ec 100644 --- a/src/arch/dalvik/decomp/if.c +++ b/src/arch/dalvik/decomp/if.c @@ -47,6 +47,7 @@ GDecInstruction *dalvik_decomp_instr_if(const GArchInstruction *instr, GDecConte { GDecInstruction *result; /* Instruction à retourner */ CompSignType sign; /* 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é */ @@ -78,14 +79,16 @@ GDecInstruction *dalvik_decomp_instr_if(const GArchInstruction *instr, GDecConte break; } + g_arch_instruction_get_location(instr, NULL, NULL, &addr); + operand = g_arch_instruction_get_operand(instr, 0); - 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, 1); - 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, 2); - jmp = 0x1234ull;/*g_dec_context_convert_register(ctx, operand);*/ + jmp = 0x1234ull;/*g_dec_context_convert_register(ctx, operand, addr);*/ cond = g_cond_expression_new(G_DEC_EXPRESSION(op1), sign, G_DEC_EXPRESSION(op2)); result = g_ite_instruction_new(G_DEC_EXPRESSION(cond), jmp, jmp); @@ -113,6 +116,7 @@ GDecInstruction *dalvik_decomp_instr_if_zero(const GArchInstruction *instr, GDec { GDecInstruction *result; /* Instruction à retourner */ CompSignType sign; /* 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é */ @@ -144,14 +148,16 @@ GDecInstruction *dalvik_decomp_instr_if_zero(const GArchInstruction *instr, GDec break; } + g_arch_instruction_get_location(instr, NULL, NULL, &addr); + operand = g_arch_instruction_get_operand(instr, 0); - op1 = g_dec_context_convert_register(ctx, operand, false); + op1 = g_dec_context_convert_register(ctx, operand, false, addr); operand = g_imm_operand_new_from_value(MDS_8_BITS_UNSIGNED, (unsigned int)0); op2 = g_imm_expression_new(operand); operand = g_arch_instruction_get_operand(instr, 2); - jmp = 0x1234ull;/*g_dec_context_convert_register(ctx, operand);*/ + jmp = 0x1234ull;/*g_dec_context_convert_register(ctx, operand, addr);*/ cond = g_cond_expression_new(G_DEC_EXPRESSION(op1), sign, G_DEC_EXPRESSION(op2)); result = g_ite_instruction_new(G_DEC_EXPRESSION(cond), jmp, jmp); |