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.c55
1 files changed, 50 insertions, 5 deletions
diff --git a/plugins/readdex/ids.c b/plugins/readdex/ids.c
index c9f1cb5..9319b7c 100644
--- a/plugins/readdex/ids.c
+++ b/plugins/readdex/ids.c
@@ -39,6 +39,7 @@
/******************************************************************************
* *
* Paramètres : format = description de l'exécutable à compléter. *
+* status = barre de statut à tenir informée. *
* *
* Description : Commente les définitions des chaînes de caractères. *
* *
@@ -48,12 +49,13 @@
* *
******************************************************************************/
-bool annotate_dex_string_ids(const GDexFormat *format)
+bool annotate_dex_string_ids(const GDexFormat *format, GtkStatusStack *status)
{
GBinContent *content; /* Contenu binaire à lire */
const dex_header *header; /* En-tête principale */
SourceEndian endian; /* Boutisme utilisé */
vmpa2t pos; /* Tête de lecture des symboles*/
+ activity_id_t msg; /* Message de progression */
uint32_t i; /* Boucle de parcours */
vmpa2t start; /* Localisation des symboles */
GArchInstruction *instr; /* Instruction décodée */
@@ -74,6 +76,9 @@ bool annotate_dex_string_ids(const GDexFormat *format)
if (!g_exe_format_translate_offset_into_vmpa(G_EXE_FORMAT(format), header->string_ids_off, &pos))
return false;
+ msg = gtk_status_stack_add_activity(status, _("Writing annotations for all Dex strings..."),
+ header->string_ids_size);
+
for (i = 0; i < header->string_ids_size; i++)
{
/* Saut vers la définition */
@@ -125,8 +130,12 @@ bool annotate_dex_string_ids(const GDexFormat *format)
ADD_STR_AS_SYM(format, symbol, instr);
+ gtk_status_stack_update_activity_value(status, msg, 1);
+
}
+ gtk_status_stack_remove_activity(status, msg);
+
g_object_unref(G_OBJECT(content));
return true;
@@ -137,6 +146,7 @@ bool annotate_dex_string_ids(const GDexFormat *format)
/******************************************************************************
* *
* Paramètres : format = description de l'exécutable à compléter. *
+* status = barre de statut à tenir informée. *
* *
* Description : Commente les définitions des identifiants de types. *
* *
@@ -146,12 +156,13 @@ bool annotate_dex_string_ids(const GDexFormat *format)
* *
******************************************************************************/
-bool annotate_dex_type_ids(const GDexFormat *format)
+bool annotate_dex_type_ids(const GDexFormat *format, GtkStatusStack *status)
{
GBinContent *content; /* Contenu binaire à lire */
const dex_header *header; /* En-tête principale */
SourceEndian endian; /* Boutisme utilisé */
vmpa2t pos; /* Tête de lecture des symboles*/
+ activity_id_t msg; /* Message de progression */
uint32_t i; /* Boucle de parcours */
vmpa2t start; /* Localisation des symboles */
GArchInstruction *instr; /* Instruction décodée */
@@ -168,6 +179,9 @@ bool annotate_dex_type_ids(const GDexFormat *format)
if (!g_exe_format_translate_offset_into_vmpa(G_EXE_FORMAT(format), header->type_ids_off, &pos))
return false;
+ msg = gtk_status_stack_add_activity(status, _("Writing annotations for all Dex types..."),
+ header->type_ids_size);
+
for (i = 0; i < header->type_ids_size; i++)
{
copy_vmpa(&start, &pos);
@@ -184,8 +198,12 @@ bool annotate_dex_type_ids(const GDexFormat *format)
if (i == 0)
g_binary_symbol_define_as_block_start(symbol, true);
+ gtk_status_stack_update_activity_value(status, msg, 1);
+
}
+ gtk_status_stack_remove_activity(status, msg);
+
g_object_unref(G_OBJECT(content));
return true;
@@ -196,6 +214,7 @@ bool annotate_dex_type_ids(const GDexFormat *format)
/******************************************************************************
* *
* Paramètres : format = description de l'exécutable à compléter. *
+* status = barre de statut à tenir informée. *
* *
* Description : Commente les définitions des identifiants de prototypes. *
* *
@@ -205,12 +224,13 @@ bool annotate_dex_type_ids(const GDexFormat *format)
* *
******************************************************************************/
-bool annotate_dex_proto_ids(const GDexFormat *format)
+bool annotate_dex_proto_ids(const GDexFormat *format, GtkStatusStack *status)
{
GBinContent *content; /* Contenu binaire à lire */
const dex_header *header; /* En-tête principale */
SourceEndian endian; /* Boutisme utilisé */
vmpa2t pos; /* Tête de lecture des symboles*/
+ activity_id_t msg; /* Message de progression */
uint32_t i; /* Boucle de parcours */
vmpa2t start; /* Localisation des symboles */
GArchInstruction *instr; /* Instruction décodée */
@@ -227,6 +247,9 @@ bool annotate_dex_proto_ids(const GDexFormat *format)
if (!g_exe_format_translate_offset_into_vmpa(G_EXE_FORMAT(format), header->proto_ids_off, &pos))
return false;
+ msg = gtk_status_stack_add_activity(status, _("Writing annotations for all Dex prototypes..."),
+ header->proto_ids_size);
+
for (i = 0; i < header->proto_ids_size; i++)
{
/* shorty_idx */
@@ -271,8 +294,12 @@ bool annotate_dex_proto_ids(const GDexFormat *format)
free(text);
+ gtk_status_stack_update_activity_value(status, msg, 1);
+
}
+ gtk_status_stack_remove_activity(status, msg);
+
g_object_unref(G_OBJECT(content));
return true;
@@ -283,6 +310,7 @@ bool annotate_dex_proto_ids(const GDexFormat *format)
/******************************************************************************
* *
* Paramètres : format = description de l'exécutable à compléter. *
+* status = barre de statut à tenir informée. *
* *
* Description : Commente les définitions des identifiants de champs. *
* *
@@ -292,12 +320,13 @@ bool annotate_dex_proto_ids(const GDexFormat *format)
* *
******************************************************************************/
-bool annotate_dex_field_ids(const GDexFormat *format)
+bool annotate_dex_field_ids(const GDexFormat *format, GtkStatusStack *status)
{
GBinContent *content; /* Contenu binaire à lire */
const dex_header *header; /* En-tête principale */
SourceEndian endian; /* Boutisme utilisé */
vmpa2t pos; /* Tête de lecture des symboles*/
+ activity_id_t msg; /* Message de progression */
uint32_t i; /* Boucle de parcours */
vmpa2t start; /* Localisation des symboles */
GArchInstruction *instr; /* Instruction décodée */
@@ -314,6 +343,9 @@ bool annotate_dex_field_ids(const GDexFormat *format)
if (!g_exe_format_translate_offset_into_vmpa(G_EXE_FORMAT(format), header->field_ids_off, &pos))
return false;
+ msg = gtk_status_stack_add_activity(status, _("Writing annotations for all Dex fields..."),
+ header->field_ids_size);
+
for (i = 0; i < header->field_ids_size; i++)
{
/* class_idx */
@@ -358,8 +390,12 @@ bool annotate_dex_field_ids(const GDexFormat *format)
free(text);
+ gtk_status_stack_update_activity_value(status, msg, 1);
+
}
+ gtk_status_stack_remove_activity(status, msg);
+
g_object_unref(G_OBJECT(content));
return true;
@@ -370,6 +406,7 @@ bool annotate_dex_field_ids(const GDexFormat *format)
/******************************************************************************
* *
* Paramètres : format = description de l'exécutable à compléter. *
+* status = barre de statut à tenir informée. *
* *
* Description : Commente les définitions des identifiants de méthodes. *
* *
@@ -379,13 +416,14 @@ bool annotate_dex_field_ids(const GDexFormat *format)
* *
******************************************************************************/
-bool annotate_dex_method_ids(const GDexFormat *format)
+bool annotate_dex_method_ids(const GDexFormat *format, GtkStatusStack *status)
{
GBinContent *content; /* Contenu binaire à lire */
const dex_header *header; /* En-tête principale */
SourceEndian endian; /* Boutisme utilisé */
vmpa2t pos; /* Tête de lecture des symboles*/
uint32_t i; /* Boucle de parcours */
+ activity_id_t msg; /* Message de progression */
vmpa2t start; /* Localisation des symboles */
GArchInstruction *instr; /* Instruction décodée */
GArchOperand *operand; /* Opérande à venir modifier */
@@ -401,6 +439,9 @@ bool annotate_dex_method_ids(const GDexFormat *format)
if (!g_exe_format_translate_offset_into_vmpa(G_EXE_FORMAT(format), header->method_ids_off, &pos))
return false;
+ msg = gtk_status_stack_add_activity(status, _("Writing annotations for all Dex methods..."),
+ header->method_ids_size);
+
for (i = 0; i < header->method_ids_size; i++)
{
/* class_idx */
@@ -445,8 +486,12 @@ bool annotate_dex_method_ids(const GDexFormat *format)
free(text);
+ gtk_status_stack_update_activity_value(status, msg, 1);
+
}
+ gtk_status_stack_remove_activity(status, msg);
+
g_object_unref(G_OBJECT(content));
return true;