summaryrefslogtreecommitdiff
path: root/plugins/readelf
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-04-30 19:21:29 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-04-30 19:21:29 (GMT)
commit33880cfe5e5de8b81e8a825878b3bbe8ef736f3f (patch)
tree9dcbe3e9e9903e447eeac916be689cd2d39614de /plugins/readelf
parentb16071a35adaf95d5e67b0dd984e9ba9d7ba28f9 (diff)
Parsed Dex format fields using the new generic parser.
Diffstat (limited to 'plugins/readelf')
-rw-r--r--plugins/readelf/header.c10
-rw-r--r--plugins/readelf/program.c12
-rw-r--r--plugins/readelf/section.c12
3 files changed, 16 insertions, 18 deletions
diff --git a/plugins/readelf/header.c b/plugins/readelf/header.c
index 21884a3..4b3cdbc 100644
--- a/plugins/readelf/header.c
+++ b/plugins/readelf/header.c
@@ -471,17 +471,15 @@ bool annotate_elf_header(GBinFormat *format)
result = g_exe_format_translate_offset_into_vmpa(G_EXE_FORMAT(format), 0, &pos);
if (result)
- result = parse_field_definitions(_elf_header_base, ARRAY_SIZE(_elf_header_base), format, &pos);
+ result = parse_field_definitions(PARSING_DEFS(_elf_header_base), format, &pos, NULL);
if (result)
{
if (header->hdr32.e_ident[EI_CLASS] == ELFCLASS32)
- result = parse_field_definitions(_elf_header_offset_32, ARRAY_SIZE(_elf_header_offset_32),
- format, &pos);
+ result = parse_field_definitions(PARSING_DEFS(_elf_header_offset_32), format, &pos, NULL);
else if (header->hdr32.e_ident[EI_CLASS] == ELFCLASS64)
- result = parse_field_definitions(_elf_header_offset_64, ARRAY_SIZE(_elf_header_offset_64),
- format, &pos);
+ result = parse_field_definitions(PARSING_DEFS(_elf_header_offset_64), format, &pos, NULL);
else
result = false;
@@ -489,7 +487,7 @@ bool annotate_elf_header(GBinFormat *format)
}
if (result)
- result = parse_field_definitions(_elf_header_ending, ARRAY_SIZE(_elf_header_ending), format, &pos);
+ result = parse_field_definitions(PARSING_DEFS(_elf_header_ending), format, &pos, NULL);
return result;
diff --git a/plugins/readelf/program.c b/plugins/readelf/program.c
index ba47639..b1e253a 100644
--- a/plugins/readelf/program.c
+++ b/plugins/readelf/program.c
@@ -287,28 +287,28 @@ static bool annotate_elf_program_header(GElfFormat *format, SourceEndian endian,
bformat = G_BIN_FORMAT(format);
- result = parse_field_definitions(_elf_phdr_base, ARRAY_SIZE(_elf_phdr_base), bformat, pos);
+ result = parse_field_definitions(PARSING_DEFS(_elf_phdr_base), bformat, pos, NULL);
if (format->is_32b)
{
if (result)
- result = parse_field_definitions(_elf_phdr_32b_a, ARRAY_SIZE(_elf_phdr_32b_a), bformat, pos);
+ result = parse_field_definitions(PARSING_DEFS(_elf_phdr_32b_a), bformat, pos, NULL);
if (result)
- result = parse_field_definitions(&flags_field, 1, bformat, pos);
+ result = parse_field_definitions(&flags_field, 1, bformat, pos, NULL);
if (result)
- result = parse_field_definitions(_elf_phdr_32b_b, ARRAY_SIZE(_elf_phdr_32b_b), bformat, pos);
+ result = parse_field_definitions(PARSING_DEFS(_elf_phdr_32b_b), bformat, pos, NULL);
}
else
{
if (result)
- result = parse_field_definitions(&flags_field, 1, bformat, pos);
+ result = parse_field_definitions(&flags_field, 1, bformat, pos, NULL);
if (result)
- result = parse_field_definitions(_elf_phdr_64b, ARRAY_SIZE(_elf_phdr_64b), bformat, pos);
+ result = parse_field_definitions(PARSING_DEFS(_elf_phdr_64b), bformat, pos, NULL);
}
diff --git a/plugins/readelf/section.c b/plugins/readelf/section.c
index e689aac..6161892 100644
--- a/plugins/readelf/section.c
+++ b/plugins/readelf/section.c
@@ -370,21 +370,21 @@ static bool annotate_elf_section_header(GElfFormat *format, SourceEndian endian,
bformat = G_BIN_FORMAT(format);
- result = parse_field_definitions(&name_field, 1, bformat, pos);
+ result = parse_field_definitions(&name_field, 1, bformat, pos, NULL);
if (result)
- result = parse_field_definitions(_elf_sh_type, ARRAY_SIZE(_elf_sh_type), bformat, pos);
+ result = parse_field_definitions(PARSING_DEFS(_elf_sh_type), bformat, pos, NULL);
if (format->is_32b)
{
if (result)
{
flags_field.size = MDS_32_BITS;
- result = parse_field_definitions(&flags_field, 1, bformat, pos);
+ result = parse_field_definitions(&flags_field, 1, bformat, pos, NULL);
}
if (result)
- result = parse_field_definitions(_elf_shdr_32b, ARRAY_SIZE(_elf_shdr_32b), bformat, pos);
+ result = parse_field_definitions(PARSING_DEFS(_elf_shdr_32b), bformat, pos, NULL);
}
else
@@ -392,11 +392,11 @@ static bool annotate_elf_section_header(GElfFormat *format, SourceEndian endian,
if (result)
{
flags_field.size = MDS_64_BITS;
- result = parse_field_definitions(&flags_field, 1, bformat, pos);
+ result = parse_field_definitions(&flags_field, 1, bformat, pos, NULL);
}
if (result)
- result = parse_field_definitions(_elf_shdr_64b, ARRAY_SIZE(_elf_shdr_64b), bformat, pos);
+ result = parse_field_definitions(PARSING_DEFS(_elf_shdr_64b), bformat, pos, NULL);
}