summaryrefslogtreecommitdiff
path: root/plugins/readdex
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-05-05 21:58:46 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-05-05 21:59:01 (GMT)
commita66f854ce4e19dc0f772fc55a3899643252afa3d (patch)
tree52e46f77acc199904a73e2260117a3a5198aeb86 /plugins/readdex
parent07768223823d8c2b0071be8d8e6dfc5ccb891b17 (diff)
Inserted preloaded format information from instructions instead of symbols.
Diffstat (limited to 'plugins/readdex')
-rw-r--r--plugins/readdex/class.c38
-rw-r--r--plugins/readdex/class.h3
-rw-r--r--plugins/readdex/code.c48
-rw-r--r--plugins/readdex/code.h3
-rw-r--r--plugins/readdex/header.c5
-rw-r--r--plugins/readdex/header.h3
-rw-r--r--plugins/readdex/ids.c32
-rw-r--r--plugins/readdex/ids.h11
-rw-r--r--plugins/readdex/reader.c21
-rw-r--r--plugins/readdex/reader.h2
10 files changed, 96 insertions, 70 deletions
diff --git a/plugins/readdex/class.c b/plugins/readdex/class.c
index 7b7b253..7911c6f 100644
--- a/plugins/readdex/class.c
+++ b/plugins/readdex/class.c
@@ -236,19 +236,20 @@ static fmt_field_def _dex_encoded_method[] = {
/* Commente les définitions des classes pour la VM Dalvik. */
-static bool annotate_dex_class_data(const GDexFormat *, const GDexClass *, uint32_t );
+static bool annotate_dex_class_data(const GDexFormat *, GPreloadInfo *, const GDexClass *, uint32_t );
/* Commente les définitions des champs encodés. */
-static bool annotate_dex_encoded_field(const GDexFormat *, vmpa2t *);
+static bool annotate_dex_encoded_field(const GDexFormat *, GPreloadInfo *, vmpa2t *);
/* Commente les définitions des méthodes encodées. */
-static bool annotate_dex_encoded_method(const GDexFormat *, const encoded_method *, vmpa2t *);
+static bool annotate_dex_encoded_method(const GDexFormat *, GPreloadInfo *, const encoded_method *, vmpa2t *);
/******************************************************************************
* *
* Paramètres : format = description de l'exécutable à compléter. *
+* info = informations à constituer en avance de phase. *
* status = barre de statut à tenir informée. *
* *
* Description : Commente les définitions des classes pour la VM Dalvik. *
@@ -259,7 +260,7 @@ static bool annotate_dex_encoded_method(const GDexFormat *, const encoded_method
* *
******************************************************************************/
-bool annotate_dex_class_defs(const GDexFormat *format, GtkStatusStack *status)
+bool annotate_dex_class_defs(const GDexFormat *format, GPreloadInfo *info, GtkStatusStack *status)
{
bool result; /* Bilan à retourner */
const dex_header *header; /* En-tête principale */
@@ -284,7 +285,7 @@ bool annotate_dex_class_defs(const GDexFormat *format, GtkStatusStack *status)
for (i = 0; i < header->class_defs_size && result; i++)
{
- result = parse_field_definitions(PARSING_DEFS(_dex_class_defs), bformat, &pos, NULL);
+ result = parse_field_definitions(PARSING_DEFS(_dex_class_defs), bformat, info, &pos, NULL);
if (!result) break;
/* Annotations supplémentaires */
@@ -294,7 +295,7 @@ bool annotate_dex_class_defs(const GDexFormat *format, GtkStatusStack *status)
def = g_dex_class_get_definition(class);
if (def->class_data_off > 0)
- result = annotate_dex_class_data(format, class, def->class_data_off);
+ result = annotate_dex_class_data(format, info, class, def->class_data_off);
/* TODO : g_object_unref(G_OBJECT(class));*/
@@ -314,6 +315,7 @@ bool annotate_dex_class_defs(const GDexFormat *format, GtkStatusStack *status)
/******************************************************************************
* *
* Paramètres : format = description de l'exécutable à compléter. *
+* info = informations à constituer en avance de phase. *
* class = classe Dex dont les données sont à commenter. *
* offset = tête de lecture physique des symboles. *
* *
@@ -325,7 +327,7 @@ bool annotate_dex_class_defs(const GDexFormat *format, GtkStatusStack *status)
* *
******************************************************************************/
-static bool annotate_dex_class_data(const GDexFormat *format, const GDexClass *class, uint32_t offset)
+static bool annotate_dex_class_data(const GDexFormat *format, GPreloadInfo *info, const GDexClass *class, uint32_t offset)
{
bool result; /* Bilan à retourner */
vmpa2t pos; /* Tête de lecture des symboles*/
@@ -340,7 +342,7 @@ static bool annotate_dex_class_data(const GDexFormat *format, const GDexClass *c
bformat = G_BIN_FORMAT(format);
- result = parse_field_definitions(PARSING_DEFS(_dex_class_data), bformat, &pos, NULL);
+ result = parse_field_definitions(PARSING_DEFS(_dex_class_data), bformat, info, &pos, NULL);
if (!result)
goto adcd_exit;
@@ -352,16 +354,16 @@ static bool annotate_dex_class_data(const GDexFormat *format, const GDexClass *c
if (data != NULL)
{
for (i = 0; i < data->static_fields_size && result; i++)
- result = annotate_dex_encoded_field(format, &pos);
+ result = annotate_dex_encoded_field(format, info, &pos);
for (i = 0; i < data->instance_fields_size && result; i++)
- result = annotate_dex_encoded_field(format, &pos);
+ result = annotate_dex_encoded_field(format, info, &pos);
for (i = 0; i < data->direct_methods_size && result; i++)
- result = annotate_dex_encoded_method(format, &data->direct_methods[i], &pos);
+ result = annotate_dex_encoded_method(format, info, &data->direct_methods[i], &pos);
for (i = 0; i < data->virtual_methods_size && result; i++)
- result = annotate_dex_encoded_method(format, &data->virtual_methods[i], &pos);
+ result = annotate_dex_encoded_method(format, info, &data->virtual_methods[i], &pos);
}
@@ -375,6 +377,7 @@ static bool annotate_dex_class_data(const GDexFormat *format, const GDexClass *c
/******************************************************************************
* *
* Paramètres : format = description de l'exécutable à compléter. *
+* info = informations à constituer en avance de phase. *
* pos = tête de lecture à faire progresser. [OUT] *
* *
* Description : Commente les définitions des champs encodés. *
@@ -385,14 +388,14 @@ static bool annotate_dex_class_data(const GDexFormat *format, const GDexClass *c
* *
******************************************************************************/
-static bool annotate_dex_encoded_field(const GDexFormat *format, vmpa2t *pos)
+static bool annotate_dex_encoded_field(const GDexFormat *format, GPreloadInfo *info, vmpa2t *pos)
{
bool result; /* Bilan à retourner */
GBinFormat *bformat; /* Autre version du format */
bformat = G_BIN_FORMAT(format);
- result = parse_field_definitions(PARSING_DEFS(_dex_encoded_field), bformat, pos, NULL);
+ result = parse_field_definitions(PARSING_DEFS(_dex_encoded_field), bformat, info, pos, NULL);
return result;
@@ -402,6 +405,7 @@ static bool annotate_dex_encoded_field(const GDexFormat *format, vmpa2t *pos)
/******************************************************************************
* *
* Paramètres : format = description de l'exécutable à compléter. *
+* info = informations à constituer en avance de phase. *
* method = méthode à décrire. *
* pos = tête de lecture à faire progresser. [OUT] *
* *
@@ -413,19 +417,19 @@ static bool annotate_dex_encoded_field(const GDexFormat *format, vmpa2t *pos)
* *
******************************************************************************/
-static bool annotate_dex_encoded_method(const GDexFormat *format, const encoded_method *method, vmpa2t *pos)
+static bool annotate_dex_encoded_method(const GDexFormat *format, GPreloadInfo *info, const encoded_method *method, vmpa2t *pos)
{
bool result; /* Bilan à retourner */
GBinFormat *bformat; /* Autre version du format */
bformat = G_BIN_FORMAT(format);
- result = parse_field_definitions(PARSING_DEFS(_dex_encoded_method), bformat, pos, NULL);
+ result = parse_field_definitions(PARSING_DEFS(_dex_encoded_method), bformat, info, pos, NULL);
/* Chargements complémentaires, si non abstraite ni native */
if (result && method->code_off > 0)
- result = annotate_dex_code_item(format, method->code_off);
+ result = annotate_dex_code_item(format, info, method->code_off);
return result;
diff --git a/plugins/readdex/class.h b/plugins/readdex/class.h
index 2df7097..4e71fb2 100644
--- a/plugins/readdex/class.h
+++ b/plugins/readdex/class.h
@@ -25,12 +25,13 @@
#define _PLUGINS_READDEX_CLASS_H
+#include <format/preload.h>
#include <format/dex/dex.h>
/* Commente les définitions des classes pour la VM Dalvik. */
-bool annotate_dex_class_defs(const GDexFormat *, GtkStatusStack *);
+bool annotate_dex_class_defs(const GDexFormat *, GPreloadInfo *, GtkStatusStack *);
diff --git a/plugins/readdex/code.c b/plugins/readdex/code.c
index 23e82ac..3a36c19 100644
--- a/plugins/readdex/code.c
+++ b/plugins/readdex/code.c
@@ -255,16 +255,16 @@ static fmt_field_def _dex_encoded_type_addr_pair[] = {
/* Commente les définitions d'une protection contre exceptions. */
-static bool annotate_dex_try_item(const GDexFormat *, vmpa2t *);
+static bool annotate_dex_try_item(const GDexFormat *, GPreloadInfo *, vmpa2t *);
/*Commente les définitions des listes de gestion d'exceptions. */
-static bool annotate_dex_encoded_catch_handler_list(const GDexFormat *, vmpa2t *);
+static bool annotate_dex_encoded_catch_handler_list(const GDexFormat *, GPreloadInfo *, vmpa2t *);
/* Commente les définitions d'une prise en compte d'exceptions. */
-static bool annotate_dex_encoded_catch_handler(const GDexFormat *, vmpa2t *);
+static bool annotate_dex_encoded_catch_handler(const GDexFormat *, GPreloadInfo *, vmpa2t *);
/* Commente les définitions des gestions d'exceptions par type. */
-static bool annotate_dex_encoded_type_addr_pair(const GDexFormat *, vmpa2t *);
+static bool annotate_dex_encoded_type_addr_pair(const GDexFormat *, GPreloadInfo *, vmpa2t *);
@@ -379,6 +379,7 @@ static bool get_encoded_catch_handler_size_value(const fmt_field_def *def, GBinC
/******************************************************************************
* *
* Paramètres : format = description de l'exécutable à compléter. *
+* info = informations à constituer en avance de phase. *
* *
* Description : Commente les définitions d'un corps de méthode. *
* *
@@ -388,7 +389,7 @@ static bool get_encoded_catch_handler_size_value(const fmt_field_def *def, GBinC
* *
******************************************************************************/
-bool annotate_dex_code_item(const GDexFormat *format, uleb128_t offset)
+bool annotate_dex_code_item(const GDexFormat *format, GPreloadInfo *info, uleb128_t offset)
{
bool result; /* Bilan à retourner */
vmpa2t pos; /* Tête de lecture des symboles*/
@@ -400,7 +401,7 @@ bool annotate_dex_code_item(const GDexFormat *format, uleb128_t offset)
if (!result)
goto adci_exit;
- result = parse_field_definitions(PARSING_DEFS(_dex_code_item), G_BIN_FORMAT(format), &pos, &data);
+ result = parse_field_definitions(PARSING_DEFS(_dex_code_item), G_BIN_FORMAT(format), info, &pos, &data);
if (!result)
goto adci_exit;
@@ -412,15 +413,16 @@ bool annotate_dex_code_item(const GDexFormat *format, uleb128_t offset)
/* padding */
if (data.insns_size % 2 != 0)
- result = parse_field_definitions(PARSING_DEFS(_dex_code_item_padding), G_BIN_FORMAT(format), &pos, NULL);
+ result = parse_field_definitions(PARSING_DEFS(_dex_code_item_padding),
+ G_BIN_FORMAT(format), info, &pos, NULL);
/* tries */
for (i = 0; i < data.tries_size && result; i++)
- result = annotate_dex_try_item(format, &pos);
+ result = annotate_dex_try_item(format, info, &pos);
if (data.tries_size > 0 && result)
- result = annotate_dex_encoded_catch_handler_list(format, &pos);
+ result = annotate_dex_encoded_catch_handler_list(format, info, &pos);
adci_exit:
@@ -432,6 +434,7 @@ bool annotate_dex_code_item(const GDexFormat *format, uleb128_t offset)
/******************************************************************************
* *
* Paramètres : format = description de l'exécutable à compléter. *
+* info = informations à constituer en avance de phase. *
* pos = tête de lecture pour les symboles. *
* *
* Description : Commente les définitions d'une protection contre exceptions. *
@@ -442,11 +445,11 @@ bool annotate_dex_code_item(const GDexFormat *format, uleb128_t offset)
* *
******************************************************************************/
-static bool annotate_dex_try_item(const GDexFormat *format, vmpa2t *pos)
+static bool annotate_dex_try_item(const GDexFormat *format, GPreloadInfo *info, vmpa2t *pos)
{
bool result; /* Bilan à retourner */
- result = parse_field_definitions(PARSING_DEFS(_dex_try_item), G_BIN_FORMAT(format), pos, NULL);
+ result = parse_field_definitions(PARSING_DEFS(_dex_try_item), G_BIN_FORMAT(format), info, pos, NULL);
return result;
@@ -456,6 +459,7 @@ static bool annotate_dex_try_item(const GDexFormat *format, vmpa2t *pos)
/******************************************************************************
* *
* Paramètres : format = description de l'exécutable à compléter. *
+* info = informations à constituer en avance de phase. *
* pos = tête de lecture physique des symboles. *
* *
* Description : Commente les définitions des listes de gestion d'exceptions. *
@@ -466,17 +470,17 @@ static bool annotate_dex_try_item(const GDexFormat *format, vmpa2t *pos)
* *
******************************************************************************/
-static bool annotate_dex_encoded_catch_handler_list(const GDexFormat *format, vmpa2t *pos)
+static bool annotate_dex_encoded_catch_handler_list(const GDexFormat *format, GPreloadInfo *info, vmpa2t *pos)
{
bool result; /* Bilan à retourner */
uleb128_t size; /* Nombre d'entrées */
uleb128_t i; /* Boucle de parcours */
result = parse_field_definitions(PARSING_DEFS(_dex_encoded_catch_handler_list),
- G_BIN_FORMAT(format), pos, &size);
+ G_BIN_FORMAT(format), info, pos, &size);
for (i = 0; i < size && result; i++)
- result = annotate_dex_encoded_catch_handler(format, pos);
+ result = annotate_dex_encoded_catch_handler(format, info, pos);
return result;
@@ -486,6 +490,7 @@ static bool annotate_dex_encoded_catch_handler_list(const GDexFormat *format, vm
/******************************************************************************
* *
* Paramètres : format = description de l'exécutable à compléter. *
+* info = informations à constituer en avance de phase. *
* pos = tête de lecture physique des symboles. *
* *
* Description : Commente les définitions d'une prise en compte d'exceptions. *
@@ -496,14 +501,15 @@ static bool annotate_dex_encoded_catch_handler_list(const GDexFormat *format, vm
* *
******************************************************************************/
-static bool annotate_dex_encoded_catch_handler(const GDexFormat *format, vmpa2t *pos)
+static bool annotate_dex_encoded_catch_handler(const GDexFormat *format, GPreloadInfo *info, vmpa2t *pos)
{
bool result; /* Bilan à retourner */
leb128_t size; /* Nombre de gestionnaires */
bool has_catch_all; /* Gestion par défaut ? */
uleb128_t i; /* Boucle de parcours */
- result = parse_field_definitions(PARSING_DEFS(_dex_encoded_catch_handler), G_BIN_FORMAT(format), pos, &size);
+ result = parse_field_definitions(PARSING_DEFS(_dex_encoded_catch_handler),
+ G_BIN_FORMAT(format), info, pos, &size);
if (!result)
goto adech_exit;
@@ -516,13 +522,13 @@ static bool annotate_dex_encoded_catch_handler(const GDexFormat *format, vmpa2t
/* handlers */
for (i = 0; i < size && result; i++)
- result = annotate_dex_encoded_type_addr_pair(format, pos);
+ result = annotate_dex_encoded_type_addr_pair(format, info, pos);
/* catch_all_addr */
if (result && has_catch_all)
result = parse_field_definitions(PARSING_DEFS(_dex_encoded_catch_handler_all),
- G_BIN_FORMAT(format), pos, &size);
+ G_BIN_FORMAT(format), info, pos, &size);
adech_exit:
@@ -534,6 +540,7 @@ static bool annotate_dex_encoded_catch_handler(const GDexFormat *format, vmpa2t
/******************************************************************************
* *
* Paramètres : format = description de l'exécutable à compléter. *
+* info = informations à constituer en avance de phase. *
* pos = tête de lecture des symboles. *
* *
* Description : Commente les définitions des gestions d'exceptions par type. *
@@ -544,11 +551,12 @@ static bool annotate_dex_encoded_catch_handler(const GDexFormat *format, vmpa2t
* *
******************************************************************************/
-static bool annotate_dex_encoded_type_addr_pair(const GDexFormat *format, vmpa2t *pos)
+static bool annotate_dex_encoded_type_addr_pair(const GDexFormat *format, GPreloadInfo *info, vmpa2t *pos)
{
bool result; /* Bilan à retourner */
- result = parse_field_definitions(PARSING_DEFS(_dex_encoded_type_addr_pair), G_BIN_FORMAT(format), pos, NULL);
+ result = parse_field_definitions(PARSING_DEFS(_dex_encoded_type_addr_pair),
+ G_BIN_FORMAT(format), info, pos, NULL);
return result;
diff --git a/plugins/readdex/code.h b/plugins/readdex/code.h
index 7f23ee7..ea70df8 100644
--- a/plugins/readdex/code.h
+++ b/plugins/readdex/code.h
@@ -25,12 +25,13 @@
#define _PLUGINS_READDEX_CODE_H
+#include <format/preload.h>
#include <format/dex/dex.h>
/* Commente les définitions d'un corps de méthode. */
-bool annotate_dex_code_item(const GDexFormat *, uleb128_t);
+bool annotate_dex_code_item(const GDexFormat *, GPreloadInfo *, uleb128_t);
diff --git a/plugins/readdex/header.c b/plugins/readdex/header.c
index d0d0cd7..b5ea776 100644
--- a/plugins/readdex/header.c
+++ b/plugins/readdex/header.c
@@ -294,6 +294,7 @@ static fmt_field_def _dex_header[] = {
/******************************************************************************
* *
* Paramètres : format = description de l'exécutable à compléter. *
+* info = informations à constituer en avance de phase. *
* *
* Description : Charge tous les symboles de l'en-tête DEX. *
* *
@@ -303,7 +304,7 @@ static fmt_field_def _dex_header[] = {
* *
******************************************************************************/
-bool annotate_dex_header(GDexFormat *format)
+bool annotate_dex_header(GDexFormat *format, GPreloadInfo *info)
{
bool result; /* Bilan à retourner */
vmpa2t pos; /* Tête de lecture des symboles*/
@@ -311,7 +312,7 @@ bool annotate_dex_header(GDexFormat *format)
result = g_exe_format_translate_offset_into_vmpa(G_EXE_FORMAT(format), 0, &pos);
if (result)
- result = parse_field_definitions(PARSING_DEFS(_dex_header), G_BIN_FORMAT(format), &pos, NULL);
+ result = parse_field_definitions(PARSING_DEFS(_dex_header), G_BIN_FORMAT(format), info, &pos, NULL);
return result;
diff --git a/plugins/readdex/header.h b/plugins/readdex/header.h
index 0d147f7..17c6ccd 100644
--- a/plugins/readdex/header.h
+++ b/plugins/readdex/header.h
@@ -25,12 +25,13 @@
#define _PLUGINS_READDEX_HEADER_H
+#include <format/preload.h>
#include <format/dex/dex.h>
/* Charge tous les symboles de l'en-tête DEX. */
-bool annotate_dex_header(GDexFormat *);
+bool annotate_dex_header(GDexFormat *, GPreloadInfo *);
diff --git a/plugins/readdex/ids.c b/plugins/readdex/ids.c
index 2586eaf..14ad6fb 100644
--- a/plugins/readdex/ids.c
+++ b/plugins/readdex/ids.c
@@ -227,6 +227,7 @@ static bool get_dex_string_length_value(const fmt_field_def *def, GBinContent *c
/******************************************************************************
* *
* Paramètres : format = description de l'exécutable à compléter. *
+* info = informations à constituer en avance de phase. *
* status = barre de statut à tenir informée. *
* *
* Description : Commente les définitions des chaînes de caractères. *
@@ -237,7 +238,7 @@ static bool get_dex_string_length_value(const fmt_field_def *def, GBinContent *c
* *
******************************************************************************/
-bool annotate_dex_string_ids(const GDexFormat *format, GtkStatusStack *status)
+bool annotate_dex_string_ids(const GDexFormat *format, GPreloadInfo *info, GtkStatusStack *status)
{
bool result; /* Bilan à retourner */
GBinContent *content; /* Contenu binaire à lire */
@@ -258,7 +259,7 @@ bool annotate_dex_string_ids(const GDexFormat *format, GtkStatusStack *status)
content = g_binary_format_get_content(G_BIN_FORMAT(format));
header = g_dex_format_get_header(format);
- endian = SRE_LITTLE;//g_dex_format_get_endianness(format);
+ endian = g_binary_format_get_endianness(G_BIN_FORMAT(format));
result = g_exe_format_translate_offset_into_vmpa(G_EXE_FORMAT(format), header->string_ids_off, &pos);
@@ -307,7 +308,7 @@ bool annotate_dex_string_ids(const GDexFormat *format, GtkStatusStack *status)
field.comment.parts = parts;
field.comment.pcount = ARRAY_SIZE(parts);
- result = parse_field_definitions(&field, 1, bformat, &pos, &loc);
+ result = parse_field_definitions(&field, 1, bformat, info, &pos, &loc);
if (!result)
break;
@@ -317,7 +318,7 @@ bool annotate_dex_string_ids(const GDexFormat *format, GtkStatusStack *status)
if (!g_exe_format_translate_offset_into_vmpa(G_EXE_FORMAT(format), loc, &item_pos))
continue;
- result = parse_field_definitions(PARSING_DEFS(_dex_string_ids_length), bformat, &item_pos, &length);
+ result = parse_field_definitions(PARSING_DEFS(_dex_string_ids_length), bformat, info, &item_pos, &length);
/* Description de la chaîne : contenu */
@@ -327,6 +328,9 @@ bool annotate_dex_string_ids(const GDexFormat *format, GtkStatusStack *status)
g_raw_instruction_mark_as_string(G_RAW_INSTRUCTION(instr), true);
+ g_preload_info_add_instruction(info, instr);
+
+ g_object_ref(G_OBJECT(instr));
ADD_STR_AS_SYM(format, symbol, instr);
}
@@ -349,6 +353,7 @@ bool annotate_dex_string_ids(const GDexFormat *format, GtkStatusStack *status)
/******************************************************************************
* *
* Paramètres : format = description de l'exécutable à compléter. *
+* info = informations à constituer en avance de phase. *
* status = barre de statut à tenir informée. *
* *
* Description : Commente les définitions des identifiants de types. *
@@ -359,7 +364,7 @@ bool annotate_dex_string_ids(const GDexFormat *format, GtkStatusStack *status)
* *
******************************************************************************/
-bool annotate_dex_type_ids(const GDexFormat *format, GtkStatusStack *status)
+bool annotate_dex_type_ids(const GDexFormat *format, GPreloadInfo *info, GtkStatusStack *status)
{
bool result; /* Bilan à retourner */
const dex_header *header; /* En-tête principale */
@@ -382,7 +387,7 @@ bool annotate_dex_type_ids(const GDexFormat *format, GtkStatusStack *status)
for (i = 0; i < header->type_ids_size && result; i++)
{
- result = parse_field_definitions(PARSING_DEFS(_dex_type_ids), bformat, &pos, NULL);
+ result = parse_field_definitions(PARSING_DEFS(_dex_type_ids), bformat, info, &pos, NULL);
gtk_status_stack_update_activity_value(status, msg, 1);
@@ -400,6 +405,7 @@ bool annotate_dex_type_ids(const GDexFormat *format, GtkStatusStack *status)
/******************************************************************************
* *
* Paramètres : format = description de l'exécutable à compléter. *
+* info = informations à constituer en avance de phase. *
* status = barre de statut à tenir informée. *
* *
* Description : Commente les définitions des identifiants de prototypes. *
@@ -410,7 +416,7 @@ bool annotate_dex_type_ids(const GDexFormat *format, GtkStatusStack *status)
* *
******************************************************************************/
-bool annotate_dex_proto_ids(const GDexFormat *format, GtkStatusStack *status)
+bool annotate_dex_proto_ids(const GDexFormat *format, GPreloadInfo *info, GtkStatusStack *status)
{
bool result; /* Bilan à retourner */
const dex_header *header; /* En-tête principale */
@@ -433,7 +439,7 @@ bool annotate_dex_proto_ids(const GDexFormat *format, GtkStatusStack *status)
for (i = 0; i < header->proto_ids_size && result; i++)
{
- result = parse_field_definitions(PARSING_DEFS(_dex_proto_ids), bformat, &pos, NULL);
+ result = parse_field_definitions(PARSING_DEFS(_dex_proto_ids), bformat, info, &pos, NULL);
gtk_status_stack_update_activity_value(status, msg, 1);
@@ -451,6 +457,7 @@ bool annotate_dex_proto_ids(const GDexFormat *format, GtkStatusStack *status)
/******************************************************************************
* *
* Paramètres : format = description de l'exécutable à compléter. *
+* info = informations à constituer en avance de phase. *
* status = barre de statut à tenir informée. *
* *
* Description : Commente les définitions des identifiants de champs. *
@@ -461,7 +468,7 @@ bool annotate_dex_proto_ids(const GDexFormat *format, GtkStatusStack *status)
* *
******************************************************************************/
-bool annotate_dex_field_ids(const GDexFormat *format, GtkStatusStack *status)
+bool annotate_dex_field_ids(const GDexFormat *format, GPreloadInfo *info, GtkStatusStack *status)
{
bool result; /* Bilan à retourner */
const dex_header *header; /* En-tête principale */
@@ -484,7 +491,7 @@ bool annotate_dex_field_ids(const GDexFormat *format, GtkStatusStack *status)
for (i = 0; i < header->field_ids_size && result; i++)
{
- result = parse_field_definitions(PARSING_DEFS(_dex_field_ids), bformat, &pos, NULL);
+ result = parse_field_definitions(PARSING_DEFS(_dex_field_ids), bformat, info, &pos, NULL);
gtk_status_stack_update_activity_value(status, msg, 1);
@@ -502,6 +509,7 @@ bool annotate_dex_field_ids(const GDexFormat *format, GtkStatusStack *status)
/******************************************************************************
* *
* Paramètres : format = description de l'exécutable à compléter. *
+* info = informations à constituer en avance de phase. *
* status = barre de statut à tenir informée. *
* *
* Description : Commente les définitions des identifiants de méthodes. *
@@ -512,7 +520,7 @@ bool annotate_dex_field_ids(const GDexFormat *format, GtkStatusStack *status)
* *
******************************************************************************/
-bool annotate_dex_method_ids(const GDexFormat *format, GtkStatusStack *status)
+bool annotate_dex_method_ids(const GDexFormat *format, GPreloadInfo *info, GtkStatusStack *status)
{
bool result; /* Bilan à retourner */
const dex_header *header; /* En-tête principale */
@@ -535,7 +543,7 @@ bool annotate_dex_method_ids(const GDexFormat *format, GtkStatusStack *status)
for (i = 0; i < header->method_ids_size && result; i++)
{
- result = parse_field_definitions(PARSING_DEFS(_dex_method_ids), bformat, &pos, NULL);
+ result = parse_field_definitions(PARSING_DEFS(_dex_method_ids), bformat, info, &pos, NULL);
gtk_status_stack_update_activity_value(status, msg, 1);
diff --git a/plugins/readdex/ids.h b/plugins/readdex/ids.h
index 8fe9626..79618ce 100644
--- a/plugins/readdex/ids.h
+++ b/plugins/readdex/ids.h
@@ -25,24 +25,25 @@
#define _PLUGINS_READDEX_IDS_H
+#include <format/preload.h>
#include <format/dex/dex.h>
/* Charge tous les symboles de l'en-tête DEX. */
-bool annotate_dex_string_ids(const GDexFormat *, GtkStatusStack *);
+bool annotate_dex_string_ids(const GDexFormat *, GPreloadInfo *, GtkStatusStack *);
/* Commente les définitions des identifiants de types. */
-bool annotate_dex_type_ids(const GDexFormat *, GtkStatusStack *);
+bool annotate_dex_type_ids(const GDexFormat *, GPreloadInfo *, GtkStatusStack *);
/* Commente les définitions des identifiants de prototypes. */
-bool annotate_dex_proto_ids(const GDexFormat *, GtkStatusStack *);
+bool annotate_dex_proto_ids(const GDexFormat *, GPreloadInfo *, GtkStatusStack *);
/* Commente les définitions des identifiants de champs. */
-bool annotate_dex_field_ids(const GDexFormat *, GtkStatusStack *);
+bool annotate_dex_field_ids(const GDexFormat *, GPreloadInfo *, GtkStatusStack *);
/* Commente les définitions des identifiants de méthodes. */
-bool annotate_dex_method_ids(const GDexFormat *, GtkStatusStack *);
+bool annotate_dex_method_ids(const GDexFormat *, GPreloadInfo *, GtkStatusStack *);
diff --git a/plugins/readdex/reader.c b/plugins/readdex/reader.c
index 5bd7649..645ec5b 100644
--- a/plugins/readdex/reader.c
+++ b/plugins/readdex/reader.c
@@ -33,8 +33,8 @@
-DEFINE_CHRYSALIDE_ACTIVE_PLUGIN("readdex", "Displays information about DEX files", "0.1.0",
- PGA_FORMAT_LOADER_LAST);
+DEFINE_CHRYSALIDE_ACTIVE_PLUGIN("readdex", "Displays information about DEX files", "0.2.0",
+ PGA_FORMAT_PRELOAD);
/******************************************************************************
@@ -42,6 +42,7 @@ DEFINE_CHRYSALIDE_ACTIVE_PLUGIN("readdex", "Displays information about DEX files
* Paramètres : plugin = greffon à manipuler. *
* action = type d'action attendue. *
* format = description de l'exécutable à compléter. *
+* info = informations à constituer en avance de phase. *
* status = barre de statut à tenir informée. *
* *
* Description : Etablit des symboles complémentaires dans un format DEX. *
@@ -52,7 +53,7 @@ DEFINE_CHRYSALIDE_ACTIVE_PLUGIN("readdex", "Displays information about DEX files
* *
******************************************************************************/
-G_MODULE_EXPORT bool handle_binary_format(const GPluginModule *plugin, PluginAction action, GBinFormat *format, GtkStatusStack *status)
+G_MODULE_EXPORT bool preload_binary_format(const GPluginModule *plugin, PluginAction action, GBinFormat *format, GPreloadInfo *info, GtkStatusStack *status)
{
bool result; /* Bilan à retourner */
GDexFormat *dex_fmt; /* Version DEX */
@@ -65,19 +66,19 @@ G_MODULE_EXPORT bool handle_binary_format(const GPluginModule *plugin, PluginAct
dex_fmt = G_DEX_FORMAT(format);
- result = annotate_dex_header(dex_fmt);
+ result = annotate_dex_header(dex_fmt, info);
- result &= annotate_dex_string_ids(dex_fmt, status);
+ result &= annotate_dex_string_ids(dex_fmt, info, status);
- result &= annotate_dex_type_ids(dex_fmt, status);
+ result &= annotate_dex_type_ids(dex_fmt, info, status);
- result &= annotate_dex_proto_ids(dex_fmt, status);
+ result &= annotate_dex_proto_ids(dex_fmt, info, status);
- result &= annotate_dex_field_ids(dex_fmt, status);
+ result &= annotate_dex_field_ids(dex_fmt, info, status);
- result &= annotate_dex_method_ids(dex_fmt, status);
+ result &= annotate_dex_method_ids(dex_fmt, info, status);
- result &= annotate_dex_class_defs(dex_fmt, status);
+ result &= annotate_dex_class_defs(dex_fmt, info, status);
hbf_exit:
diff --git a/plugins/readdex/reader.h b/plugins/readdex/reader.h
index f56d928..74a2968 100644
--- a/plugins/readdex/reader.h
+++ b/plugins/readdex/reader.h
@@ -32,7 +32,7 @@
/* Etablit des symboles complémentaires dans un format DEX. */
-G_MODULE_EXPORT bool handle_binary_format(const GPluginModule *, PluginAction, GBinFormat *, GtkStatusStack *);
+G_MODULE_EXPORT bool preload_binary_format(const GPluginModule *, PluginAction, GBinFormat *, GPreloadInfo *, GtkStatusStack *);