summaryrefslogtreecommitdiff
path: root/plugins/readdex
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/readdex')
-rw-r--r--plugins/readdex/class.c55
-rw-r--r--plugins/readdex/code.c50
-rw-r--r--plugins/readdex/header.c70
-rw-r--r--plugins/readdex/ids.c42
4 files changed, 68 insertions, 149 deletions
diff --git a/plugins/readdex/class.c b/plugins/readdex/class.c
index 9d9d0af..43455b2 100644
--- a/plugins/readdex/class.c
+++ b/plugins/readdex/class.c
@@ -73,7 +73,6 @@ bool annotate_dex_class_defs(const GDexFormat *format, GtkStatusStack *status)
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 */
GArchOperand *operand; /* Opérande à venir modifier */
GDbComment *comment; /* Définition de commentaire */
@@ -99,14 +98,13 @@ bool annotate_dex_class_defs(const GDexFormat *format, GtkStatusStack *status)
{
/* class_idx */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
asprintf(&text, _("Index into the type_ids list for this class"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
@@ -115,92 +113,85 @@ bool annotate_dex_class_defs(const GDexFormat *format, GtkStatusStack *status)
/* access_flags */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_HEX);
asprintf(&text, _("Access flags for the class"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
/* superclass_idx */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
asprintf(&text, _("Index for the superclass or NO_INDEX if this class has no superclass"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
/* interfaces_off */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_HEX);
asprintf(&text, _("Offset to the list of interfaces"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
/* source_file_idx */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
asprintf(&text, _("Index for the name of the file containing the original source or NO_INDEX"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
/* annotations_off */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_HEX);
asprintf(&text, _("Offset to the annotations structure for this class"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
/* class_data_off */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_HEX);
asprintf(&text, _("Offset to the associated class data for this item"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
/* static_values_off */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_HEX);
asprintf(&text, _("Offset to the list of initial values for static fields"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
@@ -247,7 +238,6 @@ static bool annotate_dex_class_data(const GDexFormat *format, const GDexClass *c
bool result; /* Bilan à retourner */
GBinContent *content; /* Contenu binaire à lire */
vmpa2t pos; /* Tête de lecture des symboles*/
- vmpa2t start; /* Localisation des symboles */
GArchInstruction *instr; /* Instruction décodée */
GArchOperand *operand; /* Opérande à venir modifier */
GDbComment *comment; /* Définition de commentaire */
@@ -263,14 +253,13 @@ static bool annotate_dex_class_data(const GDexFormat *format, const GDexClass *c
/* static_fields_size */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_uleb128(content, &pos);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
asprintf(&text, _("Number of static fields defined in this item"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
@@ -278,40 +267,37 @@ static bool annotate_dex_class_data(const GDexFormat *format, const GDexClass *c
/* instance_fields_size */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_uleb128(content, &pos);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
asprintf(&text, _("Number of instance fields defined in this item"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
/* direct_methods_size */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_uleb128(content, &pos);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
asprintf(&text, _("Number of direct methods defined in this item"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
/* virtual_methods_size */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_uleb128(content, &pos);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
asprintf(&text, _("Number of virtual methods defined in this item"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
@@ -362,7 +348,6 @@ static bool annotate_dex_class_data(const GDexFormat *format, const GDexClass *c
static bool annotate_dex_encoded_field(const GDexFormat *format, vmpa2t *pos)
{
GBinContent *content; /* Contenu binaire à lire */
- vmpa2t start; /* Localisation des symboles */
GArchInstruction *instr; /* Instruction décodée */
GArchOperand *operand; /* Opérande à venir modifier */
GDbComment *comment; /* Définition de commentaire */
@@ -373,14 +358,13 @@ static bool annotate_dex_encoded_field(const GDexFormat *format, vmpa2t *pos)
/* field_idx_diff */
- copy_vmpa(&start, pos);
instr = g_raw_instruction_new_uleb128(content, pos);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
asprintf(&text, _("Index into the field_ids list for the identity of this field"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
@@ -388,14 +372,13 @@ static bool annotate_dex_encoded_field(const GDexFormat *format, vmpa2t *pos)
/* access_flags */
- copy_vmpa(&start, pos);
instr = g_raw_instruction_new_uleb128(content, pos);
SET_IMM_DISPLAY(instr, operand, 0, IOD_HEX);
asprintf(&text, _("Access flags for the field"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
@@ -426,7 +409,6 @@ static bool annotate_dex_encoded_method(const GDexFormat *format, const encoded_
{
bool result; /* Bilan à retourner */
GBinContent *content; /* Contenu binaire à lire */
- vmpa2t start; /* Localisation des symboles */
GArchInstruction *instr; /* Instruction décodée */
GArchOperand *operand; /* Opérande à venir modifier */
GDbComment *comment; /* Définition de commentaire */
@@ -437,14 +419,13 @@ static bool annotate_dex_encoded_method(const GDexFormat *format, const encoded_
/* method_idx_diff */
- copy_vmpa(&start, pos);
instr = g_raw_instruction_new_uleb128(content, pos);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
asprintf(&text, _("Index into the method_ids list for the identity of this method"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
@@ -452,27 +433,25 @@ static bool annotate_dex_encoded_method(const GDexFormat *format, const encoded_
/* access_flags */
- copy_vmpa(&start, pos);
instr = g_raw_instruction_new_uleb128(content, pos);
SET_IMM_DISPLAY(instr, operand, 0, IOD_HEX);
asprintf(&text, _("Access flags for the method"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
/* code_off */
- copy_vmpa(&start, pos);
instr = g_raw_instruction_new_uleb128(content, pos);
SET_IMM_DISPLAY(instr, operand, 0, IOD_HEX);
asprintf(&text, _("Offset to the code structure for this method"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
diff --git a/plugins/readdex/code.c b/plugins/readdex/code.c
index 6c2a36e..62e846f 100644
--- a/plugins/readdex/code.c
+++ b/plugins/readdex/code.c
@@ -68,7 +68,6 @@ bool annotate_dex_code_item(const GDexFormat *format, uleb128_t offset)
GBinContent *content; /* Contenu binaire à lire */
SourceEndian endian; /* Boutisme utilisé */
vmpa2t pos; /* Tête de lecture des symboles*/
- vmpa2t start; /* Localisation des symboles */
GArchInstruction *instr; /* Instruction décodée */
GArchOperand *operand; /* Opérande à venir modifier */
GDbComment *comment; /* Définition de commentaire */
@@ -87,14 +86,13 @@ bool annotate_dex_code_item(const GDexFormat *format, uleb128_t offset)
/* registers_size */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_16_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
asprintf(&text, _("Number of registers used by this code"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
@@ -102,40 +100,37 @@ bool annotate_dex_code_item(const GDexFormat *format, uleb128_t offset)
/* ins_size */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_16_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
asprintf(&text, _("Number of words of incoming arguments to the method that this code is for"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
/* outs_size */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_16_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
asprintf(&text, _("Number of words of outgoing argument space required by this code for method invocation"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
/* tries_size */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_16_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
asprintf(&text, _("Number of try_items for this instance"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
@@ -143,27 +138,25 @@ bool annotate_dex_code_item(const GDexFormat *format, uleb128_t offset)
/* debug_info_off */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_HEX);
asprintf(&text, _("Offset to the debug info sequence for this code"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
/* insns_size */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
asprintf(&text, _("Size of the instructions list, in 16-bit code units"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
@@ -177,14 +170,13 @@ bool annotate_dex_code_item(const GDexFormat *format, uleb128_t offset)
if (insns_size % 2 != 0)
{
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_16_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_HEX);
asprintf(&text, _("Pading"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
@@ -227,7 +219,6 @@ static bool annotate_dex_try_item(const GDexFormat *format, vmpa2t *pos)
bool result; /* Bilan à retourner */
GBinContent *content; /* Contenu binaire à lire */
SourceEndian endian; /* Boutisme utilisé */
- vmpa2t start; /* Localisation des symboles */
GArchInstruction *instr; /* Instruction décodée */
GArchOperand *operand; /* Opérande à venir modifier */
GDbComment *comment; /* Définition de commentaire */
@@ -242,14 +233,13 @@ static bool annotate_dex_try_item(const GDexFormat *format, vmpa2t *pos)
/* start_addr */
- copy_vmpa(&start, pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_HEX);
asprintf(&text, _("Start address of the block of code covered by this entry"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
@@ -257,27 +247,25 @@ static bool annotate_dex_try_item(const GDexFormat *format, vmpa2t *pos)
/* insn_count */
- copy_vmpa(&start, pos);
instr = g_raw_instruction_new_array(content, MDS_16_BITS, 1, pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
asprintf(&text, _("Number of 16-bit code units covered by this entry"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
/* handler_off */
- copy_vmpa(&start, pos);
instr = g_raw_instruction_new_array(content, MDS_16_BITS, 1, pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_HEX);
asprintf(&text, _("Offset to the encoded_catch_handler for this entry"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
@@ -307,7 +295,6 @@ static bool annotate_dex_encoded_catch_handler_list(const GDexFormat *format, vm
{
bool result; /* Bilan à retourner */
GBinContent *content; /* Contenu binaire à lire */
- vmpa2t start; /* Localisation des symboles */
GArchInstruction *instr; /* Instruction décodée */
GArchOperand *operand; /* Opérande à venir modifier */
GDbComment *comment; /* Définition de commentaire */
@@ -320,14 +307,13 @@ static bool annotate_dex_encoded_catch_handler_list(const GDexFormat *format, vm
/* static_fields_size */
- copy_vmpa(&start, pos);
instr = g_raw_instruction_new_uleb128(content, pos);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
asprintf(&text, _("Size of the list, in entries"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
@@ -368,7 +354,6 @@ static bool annotate_dex_encoded_catch_handler(const GDexFormat *format, vmpa2t
{
bool result; /* Bilan à retourner */
GBinContent *content; /* Contenu binaire à lire */
- vmpa2t start; /* Localisation des symboles */
GArchInstruction *instr; /* Instruction décodée */
GArchOperand *operand; /* Opérande à venir modifier */
GDbComment *comment; /* Définition de commentaire */
@@ -382,14 +367,13 @@ static bool annotate_dex_encoded_catch_handler(const GDexFormat *format, vmpa2t
/* size */
- copy_vmpa(&start, pos);
instr = g_raw_instruction_new_sleb128(content, pos);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
asprintf(&text, _("Number of static fields defined in this item"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
@@ -413,14 +397,13 @@ static bool annotate_dex_encoded_catch_handler(const GDexFormat *format, vmpa2t
if (has_catch_all)
{
- copy_vmpa(&start, pos);
instr = g_raw_instruction_new_uleb128(content, pos);
SET_IMM_DISPLAY(instr, operand, 0, IOD_HEX);
asprintf(&text, _("Bytecode address of the catch-all handler"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
@@ -451,7 +434,6 @@ static bool annotate_dex_encoded_catch_handler(const GDexFormat *format, vmpa2t
static bool annotate_dex_encoded_type_addr_pair(const GDexFormat *format, vmpa2t *pos)
{
GBinContent *content; /* Contenu binaire à lire */
- vmpa2t start; /* Localisation des symboles */
GArchInstruction *instr; /* Instruction décodée */
GArchOperand *operand; /* Opérande à venir modifier */
GDbComment *comment; /* Définition de commentaire */
@@ -462,27 +444,25 @@ static bool annotate_dex_encoded_type_addr_pair(const GDexFormat *format, vmpa2t
/* type_idx */
- copy_vmpa(&start, pos);
instr = g_raw_instruction_new_uleb128(content, pos);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
asprintf(&text, _("Index for the type of the exception to catch"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
/* addr */
- copy_vmpa(&start, pos);
instr = g_raw_instruction_new_uleb128(content, pos);
SET_IMM_DISPLAY(instr, operand, 0, IOD_HEX);
asprintf(&text, _("Bytecode address of the associated exception handler"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
diff --git a/plugins/readdex/header.c b/plugins/readdex/header.c
index 6ebca3f..61d0c83 100644
--- a/plugins/readdex/header.c
+++ b/plugins/readdex/header.c
@@ -48,7 +48,6 @@ bool annotate_dex_header(GDexFormat *format)
GBinContent *content; /* Contenu binaire à lire */
SourceEndian endian; /* Boutisme utilisé */
vmpa2t pos; /* Tête de lecture des symboles*/
- vmpa2t start; /* Localisation des symboles */
GArchInstruction *instr; /* Instruction décodée */
GArchOperand *operand; /* Opérande à venir modifier */
GDbComment *comment; /* Définition de commentaire */
@@ -63,7 +62,6 @@ bool annotate_dex_header(GDexFormat *format)
/* magic */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_8_BITS, DEX_FILE_MAGIC_LEN, &pos, endian);
g_raw_instruction_mark_as_string(G_RAW_INSTRUCTION(instr), true);
@@ -80,208 +78,186 @@ bool annotate_dex_header(GDexFormat *format)
SET_IMM_DISPLAY(instr, operand, 7, IOD_HEX);
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, _("DEX magic number"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("DEX magic number"));
g_binary_symbol_define_as_block_start(symbol, true);
/* checksum */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_HEX);
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, _("adler32 checksum used to detect file corruption"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("adler32 checksum used to detect file corruption"));
/* signature */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 5, &pos, endian);
g_arch_instruction_set_displayed_max_length(instr, 4);
SET_IMM_DISPLAY(instr, operand, 0, IOD_HEX);
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, _("SHA-1 signature used to uniquely identify files"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("SHA-1 signature used to uniquely identify files"));
/* file_size */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, _("Size of the entire file in bytes"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Size of the entire file in bytes"));
/* header_size */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, _("Size of the header in bytes"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Size of the header in bytes"));
/* endian_tag */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_HEX);
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, _("Endianness tag ; 0x12345678 for little-endian"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Endianness tag ; 0x12345678 for little-endian"));
/* link_size */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, _("Size of the link section"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Size of the link section"));
/* link_off */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_HEX);
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, _("Offset to the link section"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Offset to the link section"));
/* map_off */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_HEX);
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, _("Offset to the map item"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Offset to the map item"));
/* string_ids_size */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, _("Count of strings in the string identifiers list"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Count of strings in the string identifiers list"));
/* string_ids_off */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_HEX);
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, _("Offset to the string identifiers list"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Offset to the string identifiers list"));
/* type_ids_size */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, _("Count of elements in the type identifiers list"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Count of elements in the type identifiers list"));
/* type_ids_off */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_HEX);
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, _("Offset to the type identifiers list"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Offset to the type identifiers list"));
/* proto_ids_size */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, _("Count of elements in the prototype identifiers list"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Count of elements in the prototype identifiers list"));
/* proto_ids_off */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_HEX);
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, _("Offset to the prototype identifiers list"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Offset to the prototype identifiers list"));
/* field_ids_size */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, _("Count of elements in the field identifiers list"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Count of elements in the field identifiers list"));
/* field_ids_off */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_HEX);
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, _("Offset to the field identifiers list"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Offset to the field identifiers list"));
/* method_ids_size */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, _("Count of elements in the method identifiers list"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Count of elements in the method identifiers list"));
/* method_ids_off */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_HEX);
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, _("Offset to the method identifiers list"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Offset to the method identifiers list"));
/* class_defs_size */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, _("Count of elements in the class definitions list"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Count of elements in the class definitions list"));
/* class_defs_off */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_HEX);
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, _("Offset to the class definitions list"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Offset to the class definitions list"));
/* data_size */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, _("Size of data section in bytes"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Size of data section in bytes"));
/* data_off */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_HEX);
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, _("Offset to the start of the data section"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Offset to the start of the data section"));
g_object_unref(G_OBJECT(content));
diff --git a/plugins/readdex/ids.c b/plugins/readdex/ids.c
index c6bef48..1b4e623 100644
--- a/plugins/readdex/ids.c
+++ b/plugins/readdex/ids.c
@@ -57,7 +57,6 @@ bool annotate_dex_string_ids(const GDexFormat *format, GtkStatusStack *status)
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 */
GArchOperand *operand; /* Opérande à venir modifier */
GDbComment *comment; /* Définition de commentaire */
@@ -65,6 +64,7 @@ bool annotate_dex_string_ids(const GDexFormat *format, GtkStatusStack *status)
char *text; /* Texte constant à insérer */
phys_t loc; /* Localisation physique */
vmpa2t item_pos; /* Position d'un élément */
+ vmpa2t start; /* Sauvagarde d'une position */
uleb128_t length; /* Taille de la chaîne en cours*/
MemoryDataSize leb_size; /* Taille de la taille */
@@ -83,14 +83,13 @@ bool annotate_dex_string_ids(const GDexFormat *format, GtkStatusStack *status)
{
/* Saut vers la définition */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_HEX);
asprintf(&text, _("Offset for string item #%u/%u"), i, header->string_ids_size - 1);
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
@@ -119,13 +118,12 @@ bool annotate_dex_string_ids(const GDexFormat *format, GtkStatusStack *status)
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, _("String length"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("String length"));
/* Description de la chaîne : contenu */
if (length > 0)
{
- copy_vmpa(&start, &item_pos);
instr = g_raw_instruction_new_array(content, MDS_8_BITS, length, &item_pos, endian);
g_raw_instruction_mark_as_string(G_RAW_INSTRUCTION(instr), true);
@@ -168,7 +166,6 @@ bool annotate_dex_type_ids(const GDexFormat *format, GtkStatusStack *status)
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 */
GArchOperand *operand; /* Opérande à venir modifier */
GDbComment *comment; /* Définition de commentaire */
@@ -188,14 +185,13 @@ bool annotate_dex_type_ids(const GDexFormat *format, GtkStatusStack *status)
for (i = 0; i < header->type_ids_size; i++)
{
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
asprintf(&text, _("Index for the descriptor string of this type"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
@@ -236,7 +232,6 @@ bool annotate_dex_proto_ids(const GDexFormat *format, GtkStatusStack *status)
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 */
GArchOperand *operand; /* Opérande à venir modifier */
GDbComment *comment; /* Définition de commentaire */
@@ -258,14 +253,13 @@ bool annotate_dex_proto_ids(const GDexFormat *format, GtkStatusStack *status)
{
/* shorty_idx */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
asprintf(&text, _("Index for the short-form descriptor string of this prototype"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
@@ -274,27 +268,25 @@ bool annotate_dex_proto_ids(const GDexFormat *format, GtkStatusStack *status)
/* return_type_idx */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
asprintf(&text, _("Index for the return type of this prototype"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
/* parameters_off */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
asprintf(&text, _("Offset to the list of parameter types for this prototype"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
@@ -332,7 +324,6 @@ bool annotate_dex_field_ids(const GDexFormat *format, GtkStatusStack *status)
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 */
GArchOperand *operand; /* Opérande à venir modifier */
GDbComment *comment; /* Définition de commentaire */
@@ -354,14 +345,13 @@ bool annotate_dex_field_ids(const GDexFormat *format, GtkStatusStack *status)
{
/* class_idx */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_16_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
asprintf(&text, _("Index for the definer of this field"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
@@ -370,27 +360,25 @@ bool annotate_dex_field_ids(const GDexFormat *format, GtkStatusStack *status)
/* type_idx */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_16_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
asprintf(&text, _("Index for the type of this field"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
/* name_idx */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
asprintf(&text, _("Index for the name of this field"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
@@ -428,7 +416,6 @@ bool annotate_dex_method_ids(const GDexFormat *format, GtkStatusStack *status)
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 */
GDbComment *comment; /* Définition de commentaire */
@@ -450,14 +437,13 @@ bool annotate_dex_method_ids(const GDexFormat *format, GtkStatusStack *status)
{
/* class_idx */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_16_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
asprintf(&text, _("Index for the definer of this field"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
@@ -466,27 +452,25 @@ bool annotate_dex_method_ids(const GDexFormat *format, GtkStatusStack *status)
/* proto_idx */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_16_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
asprintf(&text, _("Index for the prototype of this method"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);
/* name_idx */
- copy_vmpa(&start, &pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, &pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, IOD_DEC);
asprintf(&text, _("Index for the name of this method"));
- ADD_RAW_AS_SYM(format, symbol, &start, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
free(text);