summaryrefslogtreecommitdiff
path: root/src/format/dex/method.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/format/dex/method.c')
-rw-r--r--src/format/dex/method.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/format/dex/method.c b/src/format/dex/method.c
index 1223eb9..8659a73 100644
--- a/src/format/dex/method.c
+++ b/src/format/dex/method.c
@@ -338,7 +338,6 @@ GBinRoutine *g_dex_method_get_routine(const GDexMethod *method)
* *
* Paramètres : method = représentation interne du format DEX à consulter. *
* format = format permettant d'obtenir une adresse complète. *
-* layer = couche de portions à raffiner. *
* *
* Description : Intègre la méthode en tant que portion de code. *
* *
@@ -348,11 +347,10 @@ GBinRoutine *g_dex_method_get_routine(const GDexMethod *method)
* *
******************************************************************************/
-void g_dex_method_include_as_portion(const GDexMethod *method, const GDexFormat *format, GPortionLayer *layer)
+void g_dex_method_include_as_portion(const GDexMethod *method, GExeFormat *format)
{
vmpa2t addr; /* Emplacement dans le binaire */
GBinPortion *new; /* Nouvelle portion définie */
- char *desc; /* Description d'une portion */
/* Si la taille est nulle, on ne fait rien */
if (method->info.access_flags & ACC_NATIVE)
@@ -361,22 +359,16 @@ void g_dex_method_include_as_portion(const GDexMethod *method, const GDexFormat
if (!method->has_body)
return;
- if (!g_exe_format_translate_offset_into_vmpa(G_EXE_FORMAT(format), method->offset, &addr))
+ if (!g_exe_format_translate_offset_into_vmpa(format, method->offset, &addr))
return;
- new = g_binary_portion_new(BPC_CODE);
+ new = g_binary_portion_new(BPC_CODE, &addr, method->body.insns_size * sizeof(uint16_t));
- asprintf(&desc, _("Dalvik code"));
-
- g_binary_portion_set_desc(new, desc);
-
- free(desc);
-
- g_binary_portion_set_values(new, &addr, method->body.insns_size * sizeof(uint16_t));
+ g_binary_portion_set_desc(new, _("Dalvik code"));
g_binary_portion_set_rights(new, PAC_READ | PAC_EXEC);
- g_portion_layer_include(layer, new);
+ g_exe_format_include_portion(format, new);
}