diff options
Diffstat (limited to 'src/format/dex/class.c')
-rw-r--r-- | src/format/dex/class.c | 24 |
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: |