summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-02-28 17:28:35 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-03-01 20:15:46 (GMT)
commit11047009c222d3dba1380e63c3099cce0dbc6996 (patch)
treef5f3d5cae29d1df647b69e993bf0574ec17ad1fc
parent463a48ca6647f9bd4e2a2ba62cef73fbf0d0ac8d (diff)
Been sure to process relevant only file formats (ELF here).
-rw-r--r--ChangeLog6
-rw-r--r--plugins/readelf/reader.c19
-rw-r--r--plugins/readelf/reader.h2
3 files changed, 22 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 1462654..b75257d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+16-02-28 Cyrille Bagard <nocbos@gmail.com>
+
+ * plugins/readelf/reader.c:
+ * plugins/readelf/reader.h:
+ Be sure to process relevant only file formats (ELF here).
+
16-02-20 Cyrille Bagard <nocbos@gmail.com>
* src/gui/menus/view.c:
diff --git a/plugins/readelf/reader.c b/plugins/readelf/reader.c
index 5da60b7..2d10540 100644
--- a/plugins/readelf/reader.c
+++ b/plugins/readelf/reader.c
@@ -51,15 +51,26 @@ DEFINE_CHRYSALIDE_ACTIVE_PLUGIN("readelf", "Displays information about ELF files
* *
******************************************************************************/
-G_MODULE_EXPORT bool handle_binary_format(const GPluginModule *plugin, PluginAction action, GElfFormat *format)
+G_MODULE_EXPORT bool handle_binary_format(const GPluginModule *plugin, PluginAction action, GBinFormat *format)
{
bool result; /* Bilan à retourner */
+ GElfFormat *elf_fmt; /* Version ELF */
- result = annotate_elf_header(format);
+ if (!G_IS_ELF_FORMAT(format))
+ {
+ result = true;
+ goto hbf_exit;
+ }
- result &= annotate_elf_program_header_table(format);
+ elf_fmt = G_ELF_FORMAT(format);
- result &= annotate_elf_section_header_table(format);
+ result = annotate_elf_header(elf_fmt);
+
+ result &= annotate_elf_program_header_table(elf_fmt);
+
+ result &= annotate_elf_section_header_table(elf_fmt);
+
+ hbf_exit:
return result;
diff --git a/plugins/readelf/reader.h b/plugins/readelf/reader.h
index fe997b6..0080766 100644
--- a/plugins/readelf/reader.h
+++ b/plugins/readelf/reader.h
@@ -32,7 +32,7 @@
/* Etablit des symboles complémentaires dans un format ELF. */
-G_MODULE_EXPORT bool handle_binary_format(const GPluginModule *, PluginAction, GElfFormat *);
+G_MODULE_EXPORT bool handle_binary_format(const GPluginModule *, PluginAction, GBinFormat *);