diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2010-06-27 11:46:06 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2010-06-27 11:46:06 (GMT) |
commit | a3b128d4f448fa1eee12074a9bf0256b06e222e8 (patch) | |
tree | 260b2df0c52a6e998a81c7af0aa7f62b74c33fe5 /src/arch/dalvik/operand.c | |
parent | dad83b556250a85a9b2ccf68e5fb6f4df7dca1f4 (diff) |
Fixed many bugs with the branch targets and supported one sub opcode.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@170 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/dalvik/operand.c')
-rw-r--r-- | src/arch/dalvik/operand.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/arch/dalvik/operand.c b/src/arch/dalvik/operand.c index 07c0675..2b64a10 100644 --- a/src/arch/dalvik/operand.c +++ b/src/arch/dalvik/operand.c @@ -939,28 +939,24 @@ static void g_dalvik_target_operand_init(GDalvikTargetOperand *operand) GArchOperand *g_dalvik_target_operand_new(const bin_t *data, off_t *pos, off_t len, MemoryDataSize size, SourceEndian endian, vmpa_t base) { GDalvikTargetOperand *result; /* Structure à retourner */ - off_t init_pos; /* Position avant lecture */ int8_t val8; /* Valeur sur 8 bits */ int16_t val16; /* Valeur sur 16 bits */ int32_t val32; /* Valeur sur 32 bits */ vmpa_t address; /* Adresse finale visée */ - init_pos = *pos; - switch (size) { case MDS_8_BITS_SIGNED: read_s8(&val8, data, pos, len, endian); - address = base + (*pos - init_pos) + val8; + address = base + val8 * sizeof(uint16_t); break; case MDS_16_BITS_SIGNED: read_s16(&val16, data, pos, len, endian); - printf("ADDR :: 0x%08llx + (%d - %d) + 0x%08x\n", base, *pos, init_pos, val16); - address = base + (*pos - init_pos) + val16; + address = base + val16 * sizeof(uint16_t); break; case MDS_32_BITS_SIGNED: read_s32(&val32, data, pos, len, endian); - address = base + (*pos - init_pos) + val32; + address = base + val32 * sizeof(uint16_t); break; default: return NULL; |