diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2016-12-29 10:30:28 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2016-12-29 10:30:28 (GMT) |
commit | 9f9041e11efa71cb043425cd5e89daea0247e76c (patch) | |
tree | 84d8704c291a5efef46af1e14a2aa3544dc29455 /src/format/dex/method.c | |
parent | 403a0519ec85a156a7f306b045d9cab619302473 (diff) |
Cut binary data into several areas using all the available CPUs and less memory.
Diffstat (limited to 'src/format/dex/method.c')
-rw-r--r-- | src/format/dex/method.c | 18 |
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); } |