summaryrefslogtreecommitdiff
path: root/src/format/dex/class.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-04-23 20:23:33 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-04-23 20:23:33 (GMT)
commit3284ce333cc4b09d9150b59c60005af8e4ddc417 (patch)
treeff9c6a51e20f3a15654005f1c9e2ee22d91e7b6c /src/format/dex/class.c
parentdf4bc1a413561f9de095e1c30c678bd7272c3478 (diff)
Loaded all Dex methods in a proper way.
Diffstat (limited to 'src/format/dex/class.c')
-rw-r--r--src/format/dex/class.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/format/dex/class.c b/src/format/dex/class.c
index a5181d2..02ac19d 100644
--- a/src/format/dex/class.c
+++ b/src/format/dex/class.c
@@ -196,6 +196,8 @@ GDexClass *g_dex_class_new(GDexFormat *format, const class_def_item *def)
uleb128_t index; /* Conservation du dernier id */
uleb128_t i; /* Boucle de parcours */
GDexMethod *method; /* Méthode chargée */
+ GBinRoutine *routine; /* Version interne de méthode */
+ GBinSymbol *symbol; /* Nouveau symbole construit */
init_vmpa(&addr, def->class_data_off, VMPA_NO_VIRTUAL);
@@ -219,11 +221,20 @@ GDexClass *g_dex_class_new(GDexFormat *format, const class_def_item *def)
for (i = 0; i < data.direct_methods_size; i++)
{
- method = g_dex_method_new(format, &data.direct_methods[i], &index);
+ method = g_dex_method_new_defined(format, &data.direct_methods[i], &index);
if (method == NULL) goto gdcn_bad_method;
result->direct_methods[i] = method;
+ /* Ajout à la liste des symboles */
+
+ routine = g_dex_method_get_routine(method);
+
+ symbol = g_binary_symbol_new(STP_ROUTINE);
+ g_binary_symbol_attach_routine(symbol, routine);
+
+ _g_binary_format_add_symbol(G_BIN_FORMAT(format), symbol, false);
+
}
index = 0;
@@ -233,11 +244,20 @@ GDexClass *g_dex_class_new(GDexFormat *format, const class_def_item *def)
for (i = 0; i < data.virtual_methods_size; i++)
{
- method = g_dex_method_new(format, &data.virtual_methods[i], &index);
+ method = g_dex_method_new_defined(format, &data.virtual_methods[i], &index);
if (method == NULL) goto gdcn_bad_method;
result->virtual_methods[i] = method;
+ /* Ajout à la liste des symboles */
+
+ routine = g_dex_method_get_routine(method);
+
+ symbol = g_binary_symbol_new(STP_ROUTINE);
+ g_binary_symbol_attach_routine(symbol, routine);
+
+ _g_binary_format_add_symbol(G_BIN_FORMAT(format), symbol, false);
+
}
gdcn_done: