summaryrefslogtreecommitdiff
path: root/plugins/dex
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2018-08-07 18:08:47 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2018-08-07 18:08:47 (GMT)
commit0442cf03782e65bd680449cc213ace9a21bb081b (patch)
tree1ad713e14aeba3189c77454c219b7ab398331615 /plugins/dex
parentae2be2044d39abebfa7b8d5ce64571e72f7ff6fd (diff)
Removed old code used for decompilation.
Diffstat (limited to 'plugins/dex')
-rw-r--r--plugins/dex/class.c79
-rw-r--r--plugins/dex/class.h7
-rw-r--r--plugins/dex/format.c118
-rw-r--r--plugins/dex/method.c22
-rw-r--r--plugins/dex/method.h3
5 files changed, 0 insertions, 229 deletions
diff --git a/plugins/dex/class.c b/plugins/dex/class.c
index d6af91b..8a094d5 100644
--- a/plugins/dex/class.c
+++ b/plugins/dex/class.c
@@ -722,82 +722,3 @@ const char *g_dex_class_get_source_file(const GDexClass *class)
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 : - *
-* *
-******************************************************************************/
-#if 0
-void g_dex_class_decompile(const GDexClass *class, GLangOutput *lang, GCodeBuffer *buffer, const GDexFormat *format)
-{
-
-#if 0
- GDataType *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_append_text(line, BLC_ASSEMBLY, "{", 3, RTT_SIGNS, NULL);
-
- //printf("Output :: %s\n", _g_data_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_fixme(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_fixme(buffer);
- }
-
-
-
-
-
-
-
-
- g_lang_output_end_class(lang, buffer);
-
-
-
-#endif
-
-
-}
-#endif
diff --git a/plugins/dex/class.h b/plugins/dex/class.h
index 9d4e426..cae4a5a 100644
--- a/plugins/dex/class.h
+++ b/plugins/dex/class.h
@@ -93,13 +93,6 @@ GDexMethod *g_dex_class_find_method_by_address(const GDexClass *, vmpa_t);
/* Retrouve si possible le nom du fichier source d'une classe. */
const char *g_dex_class_get_source_file(const GDexClass *);
-/* Procède à la décompilation complète d'une classe donnée. */
-//void g_dex_class_decompile(const GDexClass *, GLangOutput *, GCodeBuffer *, const GDexFormat *);
-
-
-
-
-
#endif /* _PLUGINS_DEX_CLASS_H */
diff --git a/plugins/dex/format.c b/plugins/dex/format.c
index d354ad0..b657fe6 100644
--- a/plugins/dex/format.c
+++ b/plugins/dex/format.c
@@ -85,12 +85,6 @@ static bool g_dex_format_get_section_range_by_name(const GDexFormat *, const cha
-/* Détermine tous les fichiers source indiqués. */
-//static void g_dex_format_find_all_sources(GDexFormat *);
-
-/* Procède à la décompilation complète du format. */
-static void g_dex_format_decompile(const GDexFormat *, void/*GCodeBuffer*/ *, const char *);
-
@@ -194,8 +188,6 @@ static void g_dex_format_init(GDexFormat *format)
bin_format->demangler = get_compiler_demangler_for_type("dex");
assert(bin_format->demangler != NULL);
- bin_format->decompile = (format_decompile_fc)g_dex_format_decompile;
-
}
@@ -560,116 +552,6 @@ GDexMethod *g_dex_format_find_method_by_address(const GDexFormat *format, vmpa_t
}
-/******************************************************************************
-* *
-* Paramètres : format = informations chargées à mettre à jour. *
-* *
-* Description : Détermine tous les fichiers source indiqués. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-#if 0
-static void g_dex_format_find_all_sources(GDexFormat *format)
-{
-
-#if 0
-
- GBinFormat *bf; /* Instance parente */
- size_t i; /* Boucle de parcours #1 */
- const char *source; /* Fichier source trouvé */
- bool found; /* Présence dans la liste */
- size_t k; /* Boucle de parcours #2 */
-
- bf = G_BIN_FORMAT(format);
-
- for (i = 0; i < format->classes_count; i++)
- {
- source = g_dex_class_get_source_file(format->classes[i], format);
- if (source == NULL) continue;
-
- found = false;
-
- for (k = 0; k < bf->src_count && !found; k++)
- found = (strcmp(source, bf->src_files[k]) == 0);
-
- if (!found)
- {
- bf->src_files = (const char **)realloc(bf->src_files,
- ++bf->src_count * sizeof(const char **));
- bf->src_files[bf->src_count - 1] = source;
- }
-
- }
-
-#endif
-
-}
-#endif
-
-/******************************************************************************
-* *
-* Paramètres : format = informations chargées à consulter. *
-* buffer = tampon mis à disposition pour la sortie. *
-* filename = nom du fichier source à cibler. *
-* *
-* Description : Procède à la décompilation complète du format. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_dex_format_decompile(const GDexFormat *format, void/*GCodeBuffer*/ *buffer, const char *filename)
-{
-
-#if 0
-
- GLangOutput *lang; /* Langage de sortie */
- size_t i; /* Boucle de parcours */
- const char *source; /* Fichier source trouvé */
-
- lang = g_java_output_new();
-
- for (i = 0; i < format->classes_count; i++)
- {
- source = g_dex_class_get_source_file(format->classes[i], format);
- if (source == NULL || strcmp(source, filename) != 0) continue;
-
- g_dex_class_decompile(format->classes[i], lang, buffer, format);
-
-
-
-#if 0
- GDataType *get_type_from_dex_pool(const GDexFormat *format, uint16_t index)
-
-
- Décrit le type fourni sous forme de caractères. *
-* *
-* Retour : Chaîne à libérer de la mémoire après usage. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-char *_g_data_type_to_string(const GDataType *type, bool simple)
-
-#endif
-
- }
-
-
-#endif
-
-}
-
-
-
-
-
/******************************************************************************
diff --git a/plugins/dex/method.c b/plugins/dex/method.c
index e5f6273..4d5c34c 100644
--- a/plugins/dex/method.c
+++ b/plugins/dex/method.c
@@ -488,25 +488,3 @@ DexVariableIndex g_dex_method_get_variable(const GDexMethod *method, uint32_t in
return index | DVI_LOCAL;
}
-
-
-/******************************************************************************
-* *
-* Paramètres : method = informations chargées à consulter. *
-* lang = langage à utiliser pour la sortie humaine. *
-* buffer = tampon mis à disposition pour la sortie. *
-* *
-* Description : Procède à la décompilation complète d'une routine donnée. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-#if 0
-void g_dex_method_decompile(const GDexMethod *method, GLangOutput *lang, GCodeBuffer *buffer)
-{
- g_binary_routine_print_code(method->routine, lang, buffer, true);
-
-}
-#endif
diff --git a/plugins/dex/method.h b/plugins/dex/method.h
index 2b99715..e567832 100644
--- a/plugins/dex/method.h
+++ b/plugins/dex/method.h
@@ -96,9 +96,6 @@ bool g_dex_method_get_offset(const GDexMethod *method, phys_t *);
/* Fournit des indications sur la nature d'une variable donnée. */
DexVariableIndex g_dex_method_get_variable(const GDexMethod *, uint32_t);
-/* Procède à la décompilation complète d'une routine donnée. */
-//void g_dex_method_decompile(const GDexMethod *, GLangOutput *, GCodeBuffer *);
-
#endif /* _PLUGINS_DEX_METHOD_H */