diff options
Diffstat (limited to 'plugins/elf/program.c')
-rw-r--r-- | plugins/elf/program.c | 37 |
1 files changed, 36 insertions, 1 deletions
diff --git a/plugins/elf/program.c b/plugins/elf/program.c index 3016feb..7e6f2e4 100644 --- a/plugins/elf/program.c +++ b/plugins/elf/program.c @@ -108,7 +108,7 @@ const char *get_elf_program_type_desc(const GElfFormat *format, uint32_t p_type) /****************************************************************************** * * * Paramètres : format = description de l'exécutable à consulter. * -* index = indice de la section recherchée. * +* index = indice de la partie recherchée. * * program = ensemble d'informations à faire remonter. [OUT] * * * * Description : Recherche un programme donné au sein de binaire par indice. * @@ -135,6 +135,41 @@ bool find_elf_program_by_index(const GElfFormat *format, uint16_t index, elf_phd /****************************************************************************** * * +* Paramètres : format = description de l'exécutable à consulter. * +* type = type de la partie recherchée. * +* program = ensemble d'informations à faire remonter. [OUT] * +* * +* Description : Recherche un programme donné au sein de binaire par type. * +* * +* Retour : Bilan de l'opération. * +* * +* Remarques : - * +* * +******************************************************************************/ + +bool find_elf_program_by_type(const GElfFormat *format, uint32_t type, elf_phdr *program) +{ + bool result; /* Bilan à retourner */ + uint16_t i; /* Boucle de parcours */ + + result = false; + + for (i = 0; i < ELF_HDR(format, format->header, e_phnum) && !result; i++) + { + find_elf_program_by_index(format, i, program); + + if (ELF_PHDR(format, *program, p_type) == type) + result = true; + + } + + return result; + +} + + +/****************************************************************************** +* * * Paramètres : format = description de l'exécutable à consulter. * * off = position physique à retrouver. * * pos = position correspondante. [OUT] * |