summaryrefslogtreecommitdiff
path: root/src/arch/dalvik/pseudo/switch.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2014-07-31 05:53:06 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2014-07-31 05:53:06 (GMT)
commita5d8e3fc30cda2e13d30f099e93ab1b182fdc0bd (patch)
treecf183906b2301cd3c726af820292fd0f2458bfa1 /src/arch/dalvik/pseudo/switch.c
parentdc436357ff29158dddd836d368d152d42d5b086b (diff)
Improved the way code is decoded by avoiding to propagate the base address everywhere.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@385 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/dalvik/pseudo/switch.c')
-rw-r--r--src/arch/dalvik/pseudo/switch.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/arch/dalvik/pseudo/switch.c b/src/arch/dalvik/pseudo/switch.c
index 5548258..c97c82b 100644
--- a/src/arch/dalvik/pseudo/switch.c
+++ b/src/arch/dalvik/pseudo/switch.c
@@ -109,7 +109,7 @@ static void g_dalvik_switch_instr_init(GDalvikSwitchInstr *instr)
* *
* Paramètres : data = flux de données à analyser. *
* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
+* len = limite des données à analyser. *
* addr = adresse virtuelle de l'instruction. *
* proc = architecture ciblée par le désassemblage. *
* *
@@ -121,14 +121,14 @@ static void g_dalvik_switch_instr_init(GDalvikSwitchInstr *instr)
* *
******************************************************************************/
-GArchInstruction *g_dalvik_switch_instr_new(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, const GDalvikProcessor *proc)
+GArchInstruction *g_dalvik_switch_instr_new(const bin_t *data, off_t *pos, off_t end, vmpa_t addr, const GDalvikProcessor *proc)
{
GDalvikSwitchInstr *result; /* Structure à retourner */
uint16_t ident; /* Valeur lue dans le code */
result = g_object_new(G_TYPE_DALVIK_SWITCH_INSTR, NULL);
- if (!read_u16(&ident, data, pos, len, SRE_LITTLE))
+ if (!read_u16(&ident, data, pos, end, SRE_LITTLE))
goto gdsin_bad;
if (ident != DPO_PACKED_SWITCH && ident != DPO_SPARSE_SWITCH)
@@ -136,7 +136,7 @@ GArchInstruction *g_dalvik_switch_instr_new(const bin_t *data, off_t *pos, off_t
G_DALVIK_INSTRUCTION(result)->ptype = ident;
- if (!read_u16(&result->switch_size, data, pos, len, SRE_LITTLE))
+ if (!read_u16(&result->switch_size, data, pos, end, SRE_LITTLE))
goto gdsin_bad;
if (ident != DPO_PACKED_SWITCH)