diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | plugins/readelf/reader.c | 19 | ||||
-rw-r--r-- | plugins/readelf/reader.h | 2 |
3 files changed, 22 insertions, 5 deletions
@@ -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 *); |