summaryrefslogtreecommitdiff
path: root/src/arch/dalvik/operands/target.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/dalvik/operands/target.c')
-rw-r--r--src/arch/dalvik/operands/target.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/arch/dalvik/operands/target.c b/src/arch/dalvik/operands/target.c
index 42d09cf..5e8b91a 100644
--- a/src/arch/dalvik/operands/target.c
+++ b/src/arch/dalvik/operands/target.c
@@ -169,31 +169,34 @@ static void g_dalvik_target_operand_finalize(GDalvikTargetOperand *operand)
* *
******************************************************************************/
-GArchOperand *g_dalvik_target_operand_new(const GBinContent *content, vmpa2t *pos, MemoryDataSize size, SourceEndian endian, vmpa_t base)
+GArchOperand *g_dalvik_target_operand_new(const GBinContent *content, vmpa2t *pos, MemoryDataSize size, SourceEndian endian, const vmpa2t *base)
{
GDalvikTargetOperand *result; /* Structure à retourner */
+ phys_t offset; /* Emplacement de base */
int8_t val8; /* Valeur sur 8 bits */
int16_t val16; /* Valeur sur 16 bits */
int32_t val32; /* Valeur sur 32 bits */
bool test; /* Bilan de lecture */
- vmpa_t address; /* Adresse finale visée */
+ phys_t address; /* Adresse finale visée */
+
+ offset = get_phy_addr(base);
switch (size)
{
case MDS_8_BITS_SIGNED:
test = g_binary_content_read_s8(content, pos, &val8);
- address = base + val8 * sizeof(uint16_t);
+ address = offset + val8 * sizeof(uint16_t);
break;
case MDS_16_BITS_SIGNED:
test = g_binary_content_read_s16(content, pos, endian, &val16);
- address = base + val16 * sizeof(uint16_t);
+ address = offset + val16 * sizeof(uint16_t);
break;
case MDS_32_BITS_SIGNED:
test = g_binary_content_read_s32(content, pos, endian, &val32);
- address = base + val32 * sizeof(uint16_t);
+ address = offset + val32 * sizeof(uint16_t);
break;
default:
- return NULL;
+ test = false;
break;
}
@@ -201,7 +204,7 @@ GArchOperand *g_dalvik_target_operand_new(const GBinContent *content, vmpa2t *po
return NULL;
result = g_object_new(G_TYPE_DALVIK_TARGET_OPERAND, NULL);
- result->immediate = G_IMM_OPERAND(g_imm_operand_new_from_value(MDS_32_BITS/*FIXME*/, (uint32_t)address/* FIXME */));
+ result->immediate = G_IMM_OPERAND(g_imm_operand_new_from_value(MDS_32_BITS, address));
return G_ARCH_OPERAND(result);