diff options
Diffstat (limited to 'src/format/dex/method.c')
-rw-r--r-- | src/format/dex/method.c | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/src/format/dex/method.c b/src/format/dex/method.c index 3a604d0..4888c89 100644 --- a/src/format/dex/method.c +++ b/src/format/dex/method.c @@ -111,6 +111,7 @@ static void g_dex_method_init(GDexMethod *method) * * * Paramètres : format = représentation interne du format DEX à consulter. * * seed = graine des informations à extraire. * +* last = dernier indice utilisé (à mettre à jour). [OUT] * * * * Description : Crée une nouvelle représentation de methode issue de code. * * * @@ -120,7 +121,7 @@ static void g_dex_method_init(GDexMethod *method) * * ******************************************************************************/ -GDexMethod *g_dex_method_new(const GDexFormat *format, const encoded_method *seed) +GDexMethod *g_dex_method_new(const GDexFormat *format, const encoded_method *seed, uleb128_t *last) { GDexMethod *result; /* Composant à retourner */ off_t offset; /* Tête de lecture */ @@ -142,19 +143,22 @@ GDexMethod *g_dex_method_new(const GDexFormat *format, const encoded_method *see //printf(" code size :: %d\n", item.insns_size); - routine = get_routine_from_dex_pool(format, seed->method_idx_diff); + *last += seed->method_idx_diff; + routine = get_routine_from_dex_pool(format, *last); + printf(" method idx :: %lld\n", *last); result->offset = seed->code_off + 4 * sizeof(uint16_t) + 2 *sizeof(uint32_t);/* TODO : faire plus propre ! */ + printf(" method off :: 0x%08x\n", result->offset); - g_binary_routine_set_address(routine, result->offset); + g_binary_routine_set_address(routine, result->offset); - g_binary_format_add_routine(G_BIN_FORMAT(format), routine); + result->routine = routine; return result; @@ -166,6 +170,25 @@ GDexMethod *g_dex_method_new(const GDexFormat *format, const encoded_method *see * * * Paramètres : method = représentation interne du format DEX à consulter. * * * +* Description : Fournit la routine OpenIDA correspondant à la méthode. * +* * +* Retour : Instance de routine mise en place. * +* * +* Remarques : - * +* * +******************************************************************************/ + +GBinRoutine *g_dex_method_get_routine(const GDexMethod *method) +{ + return method->routine; + +} + + +/****************************************************************************** +* * +* Paramètres : method = représentation interne du format DEX à consulter. * +* * * Description : Fournit la zone binaire correspondant à la méthode. * * * * Retour : Zone binaire à analyser. * |