summaryrefslogtreecommitdiff
path: root/src/arch/dalvik/pseudo
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
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')
-rw-r--r--src/arch/dalvik/pseudo/fill.c10
-rw-r--r--src/arch/dalvik/pseudo/switch.c8
2 files changed, 9 insertions, 9 deletions
diff --git a/src/arch/dalvik/pseudo/fill.c b/src/arch/dalvik/pseudo/fill.c
index 9fa4a59..702f4b9 100644
--- a/src/arch/dalvik/pseudo/fill.c
+++ b/src/arch/dalvik/pseudo/fill.c
@@ -110,7 +110,7 @@ static void g_dalvik_fill_instr_init(GDalvikFillInstr *instr)
* *
* Paramètres : data = flux de données à analyser. *
* pos = position courante dans ce flux. [OUT] *
-* len = taille totale des données à analyser. *
+* end = limite des données à analyser. *
* addr = adresse virtuelle de l'instruction. *
* proc = architecture ciblée par le désassemblage. *
* *
@@ -122,21 +122,21 @@ static void g_dalvik_fill_instr_init(GDalvikFillInstr *instr)
* *
******************************************************************************/
-GArchInstruction *g_dalvik_fill_instr_new(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, const GDalvikProcessor *proc)
+GArchInstruction *g_dalvik_fill_instr_new(const bin_t *data, off_t *pos, off_t end, vmpa_t addr, const GDalvikProcessor *proc)
{
GDalvikFillInstr *result; /* Structure à retourner */
uint16_t ident; /* Valeur lue dans le code */
result = g_object_new(G_TYPE_DALVIK_FILL_INSTR, NULL);
- if (!read_u16(&ident, data, pos, len, SRE_LITTLE))
+ if (!read_u16(&ident, data, pos, end, SRE_LITTLE))
goto gdfin_bad;
G_DALVIK_INSTRUCTION(result)->ptype = DPO_FILL_ARRAY_DATA;
- if (!read_u16(&result->array_width, data, pos, len, SRE_LITTLE))
+ if (!read_u16(&result->array_width, data, pos, end, SRE_LITTLE))
goto gdfin_bad;
- if (!read_u32(&result->array_size, data, pos, len, SRE_LITTLE))
+ if (!read_u32(&result->array_size, data, pos, end, SRE_LITTLE))
goto gdfin_bad;
*pos += result->array_width * result->array_size;
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)