diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2019-05-07 21:53:40 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2019-05-07 21:53:40 (GMT) |
commit | dd2b41538e20de5472cd8c888c530327a1351866 (patch) | |
tree | 7f9a24a32ecd33aacb98a5d1ec4234011c1364a6 /plugins/dex/method.c | |
parent | b92a5e56de9198c08956ce486cd12712d7034731 (diff) |
Read raw Dex items by extending the API.
Diffstat (limited to 'plugins/dex/method.c')
-rw-r--r-- | plugins/dex/method.c | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/plugins/dex/method.c b/plugins/dex/method.c index f35858e..75293b7 100644 --- a/plugins/dex/method.c +++ b/plugins/dex/method.c @@ -54,6 +54,7 @@ struct _GDexMethod bool already_defined; /* Vérification d'unicité */ #endif + method_id_item id_item; /* Définition de la méthode */ encoded_method info; /* Propriétés de la méthode */ bool has_body; /* Indication de présence */ code_item body; /* Corps de la méthode */ @@ -257,8 +258,8 @@ GDexMethod *g_dex_method_new_defined(GDexFormat *format, const encoded_method *s /****************************************************************************** * * -* Paramètres : format = représentation interne du format DEX à consulter.* -* method_id = informations de base quant à la méthode. * +* Paramètres : format = représentation interne du format DEX à consulter.* +* id_item = informations de base quant à la méthode. * * * * Description : Crée une nouvelle représentation de methode vide. * * * @@ -268,7 +269,7 @@ GDexMethod *g_dex_method_new_defined(GDexFormat *format, const encoded_method *s * * ******************************************************************************/ -GDexMethod *g_dex_method_new_callable(GDexFormat *format, const method_id_item *method_id) +GDexMethod *g_dex_method_new_callable(GDexFormat *format, const method_id_item *id_item) { GDexMethod *result; /* Composant à retourner */ GDexPool *pool; /* Table de ressources */ @@ -280,12 +281,12 @@ GDexMethod *g_dex_method_new_callable(GDexFormat *format, const method_id_item * pool = g_dex_format_get_pool(format); - ns = g_dex_pool_get_type_(pool, method_id->class_idx); + ns = g_dex_pool_get_type_(pool, id_item->class_idx); - name = g_dex_pool_get_string(pool, method_id->name_idx, NULL); + name = g_dex_pool_get_string(pool, id_item->name_idx, NULL); if (name == NULL) goto gdmne_exit; - routine = g_dex_pool_get_prototype(pool, method_id->proto_idx); + routine = g_dex_pool_get_prototype(pool, id_item->proto_idx); if (routine == NULL) goto gdmne_exit; if (ns != NULL) @@ -299,6 +300,8 @@ GDexMethod *g_dex_method_new_callable(GDexFormat *format, const method_id_item * g_dex_routine_attach_method(G_DEX_ROUTINE(routine), result); + result->id_item = *id_item; + gdmne_exit: g_object_unref(G_OBJECT(pool)); @@ -312,6 +315,25 @@ GDexMethod *g_dex_method_new_callable(GDexFormat *format, const method_id_item * * * * Paramètres : method = représentation interne de la méthode à consulter. * * * +* Description : Fournit les identifiants Dex concernant la méthode. * +* * +* Retour : Données brutes du binaire. * +* * +* Remarques : - * +* * +******************************************************************************/ + +const method_id_item *g_dex_method_get_dex_id_item(const GDexMethod *method) +{ + return &method->id_item; + +} + + +/****************************************************************************** +* * +* Paramètres : method = représentation interne de la méthode à consulter. * +* * * Description : Fournit les indications Dex concernant la méthode. * * * * Retour : Données brutes du binaire. * |