pe-binary: split pe_header_find_section() in two

This splits out the core part into a new function
pe_section_table_find().

pe_header_find_section() takes a PeHeader as input, while
pe_section_table_find() just takes the section table and its size.
This commit is contained in:
Lennart Poettering
2024-09-12 10:02:15 +02:00
parent f3c1d7fea1
commit e6c49f7f11
2 changed files with 15 additions and 5 deletions
+1
View File
@@ -135,6 +135,7 @@ bool pe_header_is_64bit(const PeHeader *h);
const IMAGE_DATA_DIRECTORY *pe_header_get_data_directory(const PeHeader *h, size_t i);
const IMAGE_SECTION_HEADER *pe_header_find_section(const PeHeader *pe_header, const IMAGE_SECTION_HEADER *sections, const char *name);
const IMAGE_SECTION_HEADER *pe_section_table_find(const IMAGE_SECTION_HEADER *sections, size_t n_sections, const char *name);
int pe_load_headers(int fd, IMAGE_DOS_HEADER **ret_dos_header, PeHeader **ret_pe_header);