summaryrefslogtreecommitdiff
path: root/src/format/dex/method.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-02-10 10:02:16 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-02-10 10:02:16 (GMT)
commit465488d5b231c2552116a305c48b5fcccea55a09 (patch)
treef4d072ad9cf56466f4e55d0608f7a3fe9204efaf /src/format/dex/method.c
parent946f5f093c7265dc5a5e00694325605b249eea43 (diff)
Improved the support of the DEX format.
Diffstat (limited to 'src/format/dex/method.c')
-rw-r--r--src/format/dex/method.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/format/dex/method.c b/src/format/dex/method.c
index b74a713..316f094 100644
--- a/src/format/dex/method.c
+++ b/src/format/dex/method.c
@@ -294,6 +294,7 @@ 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. *
@@ -304,16 +305,19 @@ GBinRoutine *g_dex_method_get_routine(const GDexMethod *method)
* *
******************************************************************************/
-void g_dex_method_include_as_portion(const GDexMethod *method, GPortionLayer *layer)
+void g_dex_method_include_as_portion(const GDexMethod *method, const GDexFormat *format, GPortionLayer *layer)
{
+ vmpa2t addr; /* Emplacement dans le binaire */
GBinPortion *new; /* Nouvelle portion définie */
char *desc; /* Description d'une portion */
- vmpa2t addr; /* Emplacement dans le binaire */
/* Si la taille est nulle, on ne fait rien */
if (method->info.access_flags & ACC_NATIVE)
return;
+ if (!g_exe_format_translate_offset_into_vmpa(G_EXE_FORMAT(format), method->offset, &addr))
+ return;
+
new = g_binary_portion_new(BPC_CODE);
asprintf(&desc, _("Dalvik code"));
@@ -322,7 +326,6 @@ void g_dex_method_include_as_portion(const GDexMethod *method, GPortionLayer *la
free(desc);
- init_vmpa(&addr, method->offset, VMPA_NO_VIRTUAL);
g_binary_portion_set_values(new, &addr, method->body.insns_size * sizeof(uint16_t));
g_binary_portion_set_rights(new, PAC_READ | PAC_EXEC);