diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2010-12-02 00:59:53 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2010-12-02 00:59:53 (GMT) |
commit | 957f50b657456c4c7da2778197c144548eded8cd (patch) | |
tree | 9aea0e8ffb4dc62b23fd324b55910916cef95167 /src/format/dex/class.c | |
parent | f2d479c16a427696790441fa1459e7194f49bb6a (diff) |
Improved the rendering of decompiled Dex code.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@196 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/format/dex/class.c')
-rw-r--r-- | src/format/dex/class.c | 80 |
1 files changed, 78 insertions, 2 deletions
diff --git a/src/format/dex/class.c b/src/format/dex/class.c index 8182987..710b023 100644 --- a/src/format/dex/class.c +++ b/src/format/dex/class.c @@ -307,14 +307,90 @@ const char *g_dex_class_get_source_file(const GDexClass *class, const GDexFormat { const char *result; /* Trouvaille à renvoyer */ - result = get_string_from_dex_pool(format, - class->definition.source_file_idx); + result = get_string_from_dex_pool(format, class->definition.source_file_idx); return result; } +/****************************************************************************** +* * +* Paramètres : class = informations chargées à consulter. * +* lang = langage à utiliser pour la sortie humaine. * +* buffer = tampon mis à disposition pour la sortie. * +* format = informations chargées à consulter. * +* * +* Description : Procède à la décompilation complète d'une classe donnée. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void g_dex_class_decompile(const GDexClass *class, GLangOutput *lang, GCodeBuffer *buffer, const GDexFormat *format) +{ + + + GOpenidaType *type; + + + size_t i; /* Boucle de parcours */ + + + /* +GBufferLine *line, GLangOutput *output) + + for (i = 0; i < block->count; i++) + { + if (i > 0) + line = g_code_buffer_append_new_line(buffer); + +*/ + + + + type = get_type_from_dex_pool(format, class->definition.class_idx); + + //g_buffer_line_insert_text(line, BLC_ASSEMBLY, "{", 3, RTT_SIGNS); + + printf("Output :: %s\n", _g_openida_type_to_string(type, true)); + + + + g_lang_output_start_class(lang, buffer, type); + + + + for (i = 0; i < class->vmethods_count; i++) + { + g_dex_method_decompile(class->virtual_methods[i], lang, buffer); + g_code_buffer_append_new_line(buffer); + } + + for (i = 0; i < class->dmethods_count; i++) + { + g_dex_method_decompile(class->direct_methods[i], lang, buffer); + g_code_buffer_append_new_line(buffer); + } + + + + + + + + + g_lang_output_end_class(lang, buffer); + + + + + + +} + |