summaryrefslogtreecommitdiff
path: root/plugins/readelf/program.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-12-13 11:40:53 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-12-13 11:40:53 (GMT)
commit73d58a38c5847f54aa9458b3612ffd35b7372dc9 (patch)
treeb1412630f4679cdf5c9e97943f0fb9645a426592 /plugins/readelf/program.c
parent3754a5e3edeea98ce426b65772708ae91b291c1f (diff)
Ensured all symbol comments match their symbol address.
Diffstat (limited to 'plugins/readelf/program.c')
-rw-r--r--plugins/readelf/program.c46
1 files changed, 15 insertions, 31 deletions
diff --git a/plugins/readelf/program.c b/plugins/readelf/program.c
index fffb495..eb3bfeb 100644
--- a/plugins/readelf/program.c
+++ b/plugins/readelf/program.c
@@ -57,7 +57,6 @@ static bool annotate_elf_program_header(GElfFormat *format, SourceEndian endian,
GBinContent *content; /* Contenu binaire à lire */
ImmOperandDisplay disp; /* Afficahge de valeur */
const char *text; /* Texte constant à insérer */
- vmpa2t start; /* Localisation des symboles */
GArchInstruction *instr; /* Instruction décodée */
GArchOperand *operand; /* Opérande à venir modifier */
GDbComment *comment; /* Définition de commentaire */
@@ -139,49 +138,43 @@ static bool annotate_elf_program_header(GElfFormat *format, SourceEndian endian,
break;
}
- copy_vmpa(&start, pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, pos, endian);
SET_IMM_DISPLAY(instr, operand, 0, disp);
- ADD_RAW_AS_SYM(format, symbol, pos, instr, comment, text);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, text);
if (format->is_32b)
{
/* Champ "p_offset" */
- copy_vmpa(&start, pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, pos, endian);
- ADD_RAW_AS_SYM(format, symbol, pos, instr, comment, _("Segment file offset"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Segment file offset"));
/* Champ "p_vaddr" */
- copy_vmpa(&start, pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, pos, endian);
- ADD_RAW_AS_SYM(format, symbol, pos, instr, comment, _("Segment virtual address"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Segment virtual address"));
/* Champ "p_paddr" */
- copy_vmpa(&start, pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, pos, endian);
- ADD_RAW_AS_SYM(format, symbol, pos, instr, comment, _("Segment physical address"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Segment physical address"));
/* Champ "p_filesz" */
- copy_vmpa(&start, pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, pos, endian);
- ADD_RAW_AS_SYM(format, symbol, pos, instr, comment, _("Segment size in file"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Segment size in file"));
/* Champ "p_memsz" */
- copy_vmpa(&start, pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, pos, endian);
- ADD_RAW_AS_SYM(format, symbol, pos, instr, comment, _("Segment size in memory"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Segment size in memory"));
/* Champ "p_flags" */
@@ -215,19 +208,17 @@ static bool annotate_elf_program_header(GElfFormat *format, SourceEndian endian,
if (!filled)
dtext = stradd(dtext, _("none"));
- copy_vmpa(&start, pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, pos, endian);
- ADD_RAW_AS_SYM(format, symbol, pos, instr, comment, dtext);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, dtext);
free(dtext);
/* Champ "p_align" */
- copy_vmpa(&start, pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, pos, endian);
- ADD_RAW_AS_SYM(format, symbol, pos, instr, comment, _("Segment alignment"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Segment alignment"));
}
else
@@ -264,54 +255,47 @@ static bool annotate_elf_program_header(GElfFormat *format, SourceEndian endian,
if (!filled)
dtext = stradd(dtext, _("none"));
- copy_vmpa(&start, pos);
instr = g_raw_instruction_new_array(content, MDS_32_BITS, 1, pos, endian);
- ADD_RAW_AS_SYM(format, symbol, pos, instr, comment, dtext);
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, dtext);
free(dtext);
/* Champ "p_offset" */
- copy_vmpa(&start, pos);
instr = g_raw_instruction_new_array(content, MDS_64_BITS, 1, pos, endian);
- ADD_RAW_AS_SYM(format, symbol, pos, instr, comment, _("Segment file offset"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Segment file offset"));
/* Champ "p_vaddr" */
- copy_vmpa(&start, pos);
instr = g_raw_instruction_new_array(content, MDS_64_BITS, 1, pos, endian);
- ADD_RAW_AS_SYM(format, symbol, pos, instr, comment, _("Segment virtual address"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Segment virtual address"));
/* Champ "p_paddr" */
- copy_vmpa(&start, pos);
instr = g_raw_instruction_new_array(content, MDS_64_BITS, 1, pos, endian);
- ADD_RAW_AS_SYM(format, symbol, pos, instr, comment, _("Segment physical address"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Segment physical address"));
/* Champ "p_filesz" */
- copy_vmpa(&start, pos);
instr = g_raw_instruction_new_array(content, MDS_64_BITS, 1, pos, endian);
- ADD_RAW_AS_SYM(format, symbol, pos, instr, comment, _("Segment size in file"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Segment size in file"));
/* Champ "p_memsz" */
- copy_vmpa(&start, pos);
instr = g_raw_instruction_new_array(content, MDS_64_BITS, 1, pos, endian);
- ADD_RAW_AS_SYM(format, symbol, pos, instr, comment, _("Segment size in memory"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Segment size in memory"));
/* Champ "p_align" */
- copy_vmpa(&start, pos);
instr = g_raw_instruction_new_array(content, MDS_64_BITS, 1, pos, endian);
- ADD_RAW_AS_SYM(format, symbol, pos, instr, comment, _("Segment alignment"));
+ ADD_RAW_AS_SYM(format, symbol, instr, comment, _("Segment alignment"));
}