summaryrefslogtreecommitdiff
path: root/src/format
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-09-26 18:24:23 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-09-26 18:24:23 (GMT)
commit7972f2da7d0e363fe918992cb5661b17ee3577d7 (patch)
tree6bf42830f32315d01f90c551778b47cc62bba639 /src/format
parent79f384b20e00977f8450920a8a8983b818d302f8 (diff)
Defined a proper cache for routine names with their packages.
Diffstat (limited to 'src/format')
-rw-r--r--src/format/dex/class.c18
-rw-r--r--src/format/symbol.c2
2 files changed, 18 insertions, 2 deletions
diff --git a/src/format/dex/class.c b/src/format/dex/class.c
index a88f3f2..454cc40 100644
--- a/src/format/dex/class.c
+++ b/src/format/dex/class.c
@@ -24,6 +24,7 @@
#include "class.h"
+#include <assert.h>
#include <malloc.h>
@@ -194,6 +195,7 @@ GDexClass *g_dex_class_new(GDexFormat *format, const class_def_item *def)
GDexClass *result; /* Composant à retourner */
vmpa2t addr; /* Tête de lecture générique */
class_data_item data; /* Contenu de la classe */
+ GDataType *ctype; /* Type créé par la classe */
uleb128_t index; /* Conservation du dernier id */
uleb128_t i; /* Boucle de parcours */
GDexMethod *method; /* Méthode chargée */
@@ -230,6 +232,9 @@ GDexClass *g_dex_class_new(GDexFormat *format, const class_def_item *def)
*/
if (def->access_flags & ACC_ANNOTATION) goto gdcn_done;
+ ctype = get_type_from_dex_pool(format, def->class_idx);
+ assert(ctype != NULL);
+
index = 0;
result->dmethods_count = data.direct_methods_size;
@@ -246,6 +251,9 @@ GDexClass *g_dex_class_new(GDexFormat *format, const class_def_item *def)
routine = g_dex_method_get_routine(method);
+ g_object_ref(G_OBJECT(ctype));
+ g_binary_routine_set_namespace(routine, ctype, ".");
+
symbol = g_binary_symbol_new(STP_ROUTINE);
g_binary_symbol_attach_routine(symbol, routine);
@@ -269,6 +277,9 @@ GDexClass *g_dex_class_new(GDexFormat *format, const class_def_item *def)
routine = g_dex_method_get_routine(method);
+ g_object_ref(G_OBJECT(ctype));
+ g_binary_routine_set_namespace(routine, ctype, ".");
+
symbol = g_binary_symbol_new(STP_ROUTINE);
g_binary_symbol_attach_routine(symbol, routine);
@@ -276,13 +287,18 @@ GDexClass *g_dex_class_new(GDexFormat *format, const class_def_item *def)
}
+ g_object_unref(G_OBJECT(ctype));
+
gdcn_done:
return result;
- gdcn_bad_item:
gdcn_bad_method:
+ g_object_unref(G_OBJECT(ctype));
+
+ gdcn_bad_item:
+
g_object_unref(G_OBJECT(result));
return NULL;
diff --git a/src/format/symbol.c b/src/format/symbol.c
index 2c2e5ad..965487d 100644
--- a/src/format/symbol.c
+++ b/src/format/symbol.c
@@ -329,7 +329,7 @@ const char *g_binary_symbol_get_label(const GBinSymbol *symbol)
case STP_ROUTINE:
case STP_ENTRY_POINT:
case STP_CODE_LABEL:
- result = g_binary_routine_get_name(symbol->extra.routine);
+ result = g_binary_routine_get_declarator(symbol->extra.routine, false);
break;
default: