summaryrefslogtreecommitdiff
path: root/plugins/readdex/ids.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/readdex/ids.c')
-rw-r--r--plugins/readdex/ids.c32
1 files changed, 20 insertions, 12 deletions
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);