diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2012-03-05 00:17:30 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2012-03-05 00:17:30 (GMT) |
commit | 13bd8d546b2de76b1f5a1d758c9e476f7d859f39 (patch) | |
tree | 3d1c7dc3343ad4d460a9245bd2bb138fada611b3 /src/arch/dalvik/opcodes/const.c | |
parent | aba1a14ba28f6df51b3be15648b6f55eea4a0e19 (diff) |
Printed the string values of the Dex pool in the operand rendering.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@237 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/dalvik/opcodes/const.c')
-rw-r--r-- | src/arch/dalvik/opcodes/const.c | 57 |
1 files changed, 34 insertions, 23 deletions
diff --git a/src/arch/dalvik/opcodes/const.c b/src/arch/dalvik/opcodes/const.c index 9cc4341..7918e93 100644 --- a/src/arch/dalvik/opcodes/const.c +++ b/src/arch/dalvik/opcodes/const.c @@ -2,7 +2,7 @@ /* OpenIDA - Outil d'analyse de fichiers binaires * const.c - décodage des chargements de constantes * - * Copyright (C) 2010-2011 Cyrille Bagard + * Copyright (C) 2010-2012 Cyrille Bagard * * This file is part of OpenIDA. * @@ -36,6 +36,7 @@ * len = taille totale des données à analyser. * * addr = adresse virtuelle de l'instruction. * * proc = architecture ciblée par le désassemblage. * +* fmt = format du fichier contenant le code. * * * * Description : Décode une instruction de type 'const'. * * * @@ -45,7 +46,7 @@ * * ******************************************************************************/ -GArchInstruction *dalvik_read_instr_const(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, const GDalvikProcessor *proc) +GArchInstruction *dalvik_read_instr_const(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, const GDalvikProcessor *proc, const GDexFormat *fmt) { GArchInstruction *result; /* Instruction à retourner */ SourceEndian endian; /* Boutisme lié au binaire */ @@ -54,7 +55,7 @@ GArchInstruction *dalvik_read_instr_const(const bin_t *data, off_t *pos, off_t l endian = g_arch_processor_get_endianness(G_ARCH_PROCESSOR(proc)); - if (!dalvik_read_operands(result, data, pos, len, endian, DALVIK_OPT_31I)) + if (!dalvik_read_operands(result, fmt, data, pos, len, endian, DALVIK_OPT_31I)) { g_object_unref(G_OBJECT(result)); return NULL; @@ -72,6 +73,7 @@ GArchInstruction *dalvik_read_instr_const(const bin_t *data, off_t *pos, off_t l * len = taille totale des données à analyser. * * addr = adresse virtuelle de l'instruction. * * proc = architecture ciblée par le désassemblage. * +* fmt = format du fichier contenant le code. * * * * Description : Décode une instruction de type 'const/16'. * * * @@ -81,7 +83,7 @@ GArchInstruction *dalvik_read_instr_const(const bin_t *data, off_t *pos, off_t l * * ******************************************************************************/ -GArchInstruction *dalvik_read_instr_const_16(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, const GDalvikProcessor *proc) +GArchInstruction *dalvik_read_instr_const_16(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, const GDalvikProcessor *proc, const GDexFormat *fmt) { GArchInstruction *result; /* Instruction à retourner */ SourceEndian endian; /* Boutisme lié au binaire */ @@ -90,7 +92,7 @@ GArchInstruction *dalvik_read_instr_const_16(const bin_t *data, off_t *pos, off_ endian = g_arch_processor_get_endianness(G_ARCH_PROCESSOR(proc)); - if (!dalvik_read_operands(result, data, pos, len, endian, DALVIK_OPT_21S)) + if (!dalvik_read_operands(result, fmt, data, pos, len, endian, DALVIK_OPT_21S)) { g_object_unref(G_OBJECT(result)); return NULL; @@ -108,6 +110,7 @@ GArchInstruction *dalvik_read_instr_const_16(const bin_t *data, off_t *pos, off_ * len = taille totale des données à analyser. * * addr = adresse virtuelle de l'instruction. * * proc = architecture ciblée par le désassemblage. * +* fmt = format du fichier contenant le code. * * * * Description : Décode une instruction de type 'const/4'. * * * @@ -117,7 +120,7 @@ GArchInstruction *dalvik_read_instr_const_16(const bin_t *data, off_t *pos, off_ * * ******************************************************************************/ -GArchInstruction *dalvik_read_instr_const_4(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, const GDalvikProcessor *proc) +GArchInstruction *dalvik_read_instr_const_4(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, const GDalvikProcessor *proc, const GDexFormat *fmt) { GArchInstruction *result; /* Instruction à retourner */ SourceEndian endian; /* Boutisme lié au binaire */ @@ -126,7 +129,7 @@ GArchInstruction *dalvik_read_instr_const_4(const bin_t *data, off_t *pos, off_t endian = g_arch_processor_get_endianness(G_ARCH_PROCESSOR(proc)); - if (!dalvik_read_operands(result, data, pos, len, endian, DALVIK_OPT_11N)) + if (!dalvik_read_operands(result, fmt, data, pos, len, endian, DALVIK_OPT_11N)) { g_object_unref(G_OBJECT(result)); return NULL; @@ -144,6 +147,7 @@ GArchInstruction *dalvik_read_instr_const_4(const bin_t *data, off_t *pos, off_t * len = taille totale des données à analyser. * * addr = adresse virtuelle de l'instruction. * * proc = architecture ciblée par le désassemblage. * +* fmt = format du fichier contenant le code. * * * * Description : Décode une instruction de type 'const-class'. * * * @@ -153,7 +157,7 @@ GArchInstruction *dalvik_read_instr_const_4(const bin_t *data, off_t *pos, off_t * * ******************************************************************************/ -GArchInstruction *dalvik_read_instr_const_class(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, const GDalvikProcessor *proc) +GArchInstruction *dalvik_read_instr_const_class(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, const GDalvikProcessor *proc, const GDexFormat *fmt) { GArchInstruction *result; /* Instruction à retourner */ SourceEndian endian; /* Boutisme lié au binaire */ @@ -162,7 +166,7 @@ GArchInstruction *dalvik_read_instr_const_class(const bin_t *data, off_t *pos, o endian = g_arch_processor_get_endianness(G_ARCH_PROCESSOR(proc)); - if (!dalvik_read_operands(result, data, pos, len, endian, DALVIK_OPT_21C | DALVIK_OP_POOL(DPT_TYPE))) + if (!dalvik_read_operands(result, fmt, data, pos, len, endian, DALVIK_OPT_21C | DALVIK_OP_POOL(DPT_TYPE))) { g_object_unref(G_OBJECT(result)); return NULL; @@ -180,6 +184,7 @@ GArchInstruction *dalvik_read_instr_const_class(const bin_t *data, off_t *pos, o * len = taille totale des données à analyser. * * addr = adresse virtuelle de l'instruction. * * proc = architecture ciblée par le désassemblage. * +* fmt = format du fichier contenant le code. * * * * Description : Décode une instruction de type 'const/high16'. * * * @@ -189,7 +194,7 @@ GArchInstruction *dalvik_read_instr_const_class(const bin_t *data, off_t *pos, o * * ******************************************************************************/ -GArchInstruction *dalvik_read_instr_const_high16(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, const GDalvikProcessor *proc) +GArchInstruction *dalvik_read_instr_const_high16(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, const GDalvikProcessor *proc, const GDexFormat *fmt) { GArchInstruction *result; /* Instruction à retourner */ SourceEndian endian; /* Boutisme lié au binaire */ @@ -198,7 +203,7 @@ GArchInstruction *dalvik_read_instr_const_high16(const bin_t *data, off_t *pos, endian = g_arch_processor_get_endianness(G_ARCH_PROCESSOR(proc)); - if (!dalvik_read_operands(result, data, pos, len, endian, DALVIK_OPT_21H)) + if (!dalvik_read_operands(result, fmt, data, pos, len, endian, DALVIK_OPT_21H)) { g_object_unref(G_OBJECT(result)); return NULL; @@ -216,6 +221,7 @@ GArchInstruction *dalvik_read_instr_const_high16(const bin_t *data, off_t *pos, * len = taille totale des données à analyser. * * addr = adresse virtuelle de l'instruction. * * proc = architecture ciblée par le désassemblage. * +* fmt = format du fichier contenant le code. * * * * Description : Décode une instruction de type 'const-string'. * * * @@ -225,7 +231,7 @@ GArchInstruction *dalvik_read_instr_const_high16(const bin_t *data, off_t *pos, * * ******************************************************************************/ -GArchInstruction *dalvik_read_instr_const_string(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, const GDalvikProcessor *proc) +GArchInstruction *dalvik_read_instr_const_string(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, const GDalvikProcessor *proc, const GDexFormat *fmt) { GArchInstruction *result; /* Instruction à retourner */ SourceEndian endian; /* Boutisme lié au binaire */ @@ -234,7 +240,7 @@ GArchInstruction *dalvik_read_instr_const_string(const bin_t *data, off_t *pos, endian = g_arch_processor_get_endianness(G_ARCH_PROCESSOR(proc)); - if (!dalvik_read_operands(result, data, pos, len, endian, DALVIK_OPT_21C | DALVIK_OP_POOL(DPT_STRING))) + if (!dalvik_read_operands(result, fmt, data, pos, len, endian, DALVIK_OPT_21C | DALVIK_OP_POOL(DPT_STRING))) { g_object_unref(G_OBJECT(result)); return NULL; @@ -252,6 +258,7 @@ GArchInstruction *dalvik_read_instr_const_string(const bin_t *data, off_t *pos, * len = taille totale des données à analyser. * * addr = adresse virtuelle de l'instruction. * * proc = architecture ciblée par le désassemblage. * +* fmt = format du fichier contenant le code. * * * * Description : Décode une instruction de type 'const-string/jumbo'. * * * @@ -261,7 +268,7 @@ GArchInstruction *dalvik_read_instr_const_string(const bin_t *data, off_t *pos, * * ******************************************************************************/ -GArchInstruction *dalvik_read_instr_const_string_jumbo(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, const GDalvikProcessor *proc) +GArchInstruction *dalvik_read_instr_const_string_jumbo(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, const GDalvikProcessor *proc, const GDexFormat *fmt) { GArchInstruction *result; /* Instruction à retourner */ SourceEndian endian; /* Boutisme lié au binaire */ @@ -270,7 +277,7 @@ GArchInstruction *dalvik_read_instr_const_string_jumbo(const bin_t *data, off_t endian = g_arch_processor_get_endianness(G_ARCH_PROCESSOR(proc)); - if (!dalvik_read_operands(result, data, pos, len, endian, DALVIK_OPT_31C | DALVIK_OP_POOL(DPT_STRING))) + if (!dalvik_read_operands(result, fmt, data, pos, len, endian, DALVIK_OPT_31C | DALVIK_OP_POOL(DPT_STRING))) { g_object_unref(G_OBJECT(result)); return NULL; @@ -288,6 +295,7 @@ GArchInstruction *dalvik_read_instr_const_string_jumbo(const bin_t *data, off_t * len = taille totale des données à analyser. * * addr = adresse virtuelle de l'instruction. * * proc = architecture ciblée par le désassemblage. * +* fmt = format du fichier contenant le code. * * * * Description : Décode une instruction de type 'const-wide'. * * * @@ -297,7 +305,7 @@ GArchInstruction *dalvik_read_instr_const_string_jumbo(const bin_t *data, off_t * * ******************************************************************************/ -GArchInstruction *dalvik_read_instr_const_wide(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, const GDalvikProcessor *proc) +GArchInstruction *dalvik_read_instr_const_wide(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, const GDalvikProcessor *proc, const GDexFormat *fmt) { GArchInstruction *result; /* Instruction à retourner */ SourceEndian endian; /* Boutisme lié au binaire */ @@ -306,7 +314,7 @@ GArchInstruction *dalvik_read_instr_const_wide(const bin_t *data, off_t *pos, of endian = g_arch_processor_get_endianness(G_ARCH_PROCESSOR(proc)); - if (!dalvik_read_operands(result, data, pos, len, endian, DALVIK_OPT_51L)) + if (!dalvik_read_operands(result, fmt, data, pos, len, endian, DALVIK_OPT_51L)) { g_object_unref(G_OBJECT(result)); return NULL; @@ -324,6 +332,7 @@ GArchInstruction *dalvik_read_instr_const_wide(const bin_t *data, off_t *pos, of * len = taille totale des données à analyser. * * addr = adresse virtuelle de l'instruction. * * proc = architecture ciblée par le désassemblage. * +* fmt = format du fichier contenant le code. * * * * Description : Décode une instruction de type 'const-wide/16'. * * * @@ -333,7 +342,7 @@ GArchInstruction *dalvik_read_instr_const_wide(const bin_t *data, off_t *pos, of * * ******************************************************************************/ -GArchInstruction *dalvik_read_instr_const_wide_16(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, const GDalvikProcessor *proc) +GArchInstruction *dalvik_read_instr_const_wide_16(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, const GDalvikProcessor *proc, const GDexFormat *fmt) { GArchInstruction *result; /* Instruction à retourner */ SourceEndian endian; /* Boutisme lié au binaire */ @@ -342,7 +351,7 @@ GArchInstruction *dalvik_read_instr_const_wide_16(const bin_t *data, off_t *pos, endian = g_arch_processor_get_endianness(G_ARCH_PROCESSOR(proc)); - if (!dalvik_read_operands(result, data, pos, len, endian, DALVIK_OPT_21S)) + if (!dalvik_read_operands(result, fmt, data, pos, len, endian, DALVIK_OPT_21S)) { g_object_unref(G_OBJECT(result)); return NULL; @@ -360,6 +369,7 @@ GArchInstruction *dalvik_read_instr_const_wide_16(const bin_t *data, off_t *pos, * len = taille totale des données à analyser. * * addr = adresse virtuelle de l'instruction. * * proc = architecture ciblée par le désassemblage. * +* fmt = format du fichier contenant le code. * * * * Description : Décode une instruction de type 'const-wide/32'. * * * @@ -369,7 +379,7 @@ GArchInstruction *dalvik_read_instr_const_wide_16(const bin_t *data, off_t *pos, * * ******************************************************************************/ -GArchInstruction *dalvik_read_instr_const_wide_32(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, const GDalvikProcessor *proc) +GArchInstruction *dalvik_read_instr_const_wide_32(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, const GDalvikProcessor *proc, const GDexFormat *fmt) { GArchInstruction *result; /* Instruction à retourner */ SourceEndian endian; /* Boutisme lié au binaire */ @@ -378,7 +388,7 @@ GArchInstruction *dalvik_read_instr_const_wide_32(const bin_t *data, off_t *pos, endian = g_arch_processor_get_endianness(G_ARCH_PROCESSOR(proc)); - if (!dalvik_read_operands(result, data, pos, len, endian, DALVIK_OPT_31I)) + if (!dalvik_read_operands(result, fmt, data, pos, len, endian, DALVIK_OPT_31I)) { g_object_unref(G_OBJECT(result)); return NULL; @@ -396,6 +406,7 @@ GArchInstruction *dalvik_read_instr_const_wide_32(const bin_t *data, off_t *pos, * len = taille totale des données à analyser. * * addr = adresse virtuelle de l'instruction. * * proc = architecture ciblée par le désassemblage. * +* fmt = format du fichier contenant le code. * * * * Description : Décode une instruction de type 'const-wide/high16'. * * * @@ -405,7 +416,7 @@ GArchInstruction *dalvik_read_instr_const_wide_32(const bin_t *data, off_t *pos, * * ******************************************************************************/ -GArchInstruction *dalvik_read_instr_const_wide_high16(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, const GDalvikProcessor *proc) +GArchInstruction *dalvik_read_instr_const_wide_high16(const bin_t *data, off_t *pos, off_t len, vmpa_t addr, const GDalvikProcessor *proc, const GDexFormat *fmt) { GArchInstruction *result; /* Instruction à retourner */ SourceEndian endian; /* Boutisme lié au binaire */ @@ -414,7 +425,7 @@ GArchInstruction *dalvik_read_instr_const_wide_high16(const bin_t *data, off_t * endian = g_arch_processor_get_endianness(G_ARCH_PROCESSOR(proc)); - if (!dalvik_read_operands(result, data, pos, len, endian, DALVIK_OPT_21H)) + if (!dalvik_read_operands(result, fmt, data, pos, len, endian, DALVIK_OPT_21H)) { g_object_unref(G_OBJECT(result)); return NULL; |