diff options
Diffstat (limited to 'src/format/dex/pool.c')
-rw-r--r-- | src/format/dex/pool.c | 50 |
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; } |