diff options
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; |