summaryrefslogtreecommitdiff
path: root/src/format/dex/pool.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2010-06-06 14:08:21 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2010-06-06 14:08:21 (GMT)
commitb5934203c1cb287eb46b07e866b54d1de240b87b (patch)
tree283fad2a6d4517b84985331e5234095c71c8734b /src/format/dex/pool.c
parente72eea33b9967d4169d2c8ffcb4a9e85c4c3ee8c (diff)
Used a treeview with icons to show all known symbols.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@165 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/format/dex/pool.c')
-rw-r--r--src/format/dex/pool.c50
1 files changed, 49 insertions, 1 deletions
diff --git a/src/format/dex/pool.c b/src/format/dex/pool.c
index b2ca105..d82144f 100644
--- a/src/format/dex/pool.c
+++ b/src/format/dex/pool.c
@@ -92,7 +92,7 @@ GOpenidaType *get_type_from_dex_pool(const GDexFormat *format, uint16_t index)
string_data_item str_data; /* Description de chaîne */
- //printf("Index :: 0x%04hx\n", index);
+ //printf("Tp Index :: %hd / %d\n", index, format->header.type_ids_size);
if (index >= format->header.type_ids_size)
@@ -255,6 +255,12 @@ GBinRoutine *get_routine_from_dex_pool(const GDexFormat *format, uint32_t index)
string_id_item str_id; /* Identifiant de chaîne */
string_data_item str_data; /* Description de chaîne */
+
+ proto_id_item proto_id; /* Information de prototypage */
+ type_list args; /* Liste des arguments */
+ uint32_t i; /* Boucle de parcours */
+ GBinVariable *arg; /* Argument reconstitué */
+
if (index >= format->header.method_ids_size)
return NULL;
@@ -302,8 +308,50 @@ GBinRoutine *get_routine_from_dex_pool(const GDexFormat *format, uint32_t index)
g_binary_routine_set_namespace(result, type);
+
+ /*
+ printf(" ####\n");
+ printf(" #### ROUTINE '%s'\n", g_binary_routine_to_string(result));
+ printf(" ####\n");
+ printf(" ####\n");
+ */
+
//printf("==>>> routine :: '%s'\n", g_binary_routine_to_string(result));
+
+
+
+
+
+
+ /* Retour de la routine */
+
+ pos = format->header.proto_ids_off + meth_id.proto_idx * sizeof(proto_id_item);
+
+ if (!read_dex_proto_id_item(format, &pos, &proto_id))
+ goto no_more_info;
+
+ type = get_type_from_dex_pool(format, proto_id.return_type_idx);
+
+ g_binary_routine_set_return_type(result, type);
+
+ /* Arguments de la routine */
+
+ pos = proto_id.parameters_off;
+
+ if (read_dex_type_list(format, &pos, &args))
+ for (i = 0; i < args.size; i++)
+ {
+ type = get_type_from_dex_pool(format, args.list[i].type_idx);
+ if (type == NULL) continue;
+
+ arg = g_binary_variable_new(type);
+ g_binary_routine_add_arg(result, arg);
+
+ }
+
+ no_more_info:
+
return result;
}