Update ELF parser. Sectionr eading implemented

This commit is contained in:
2022-10-18 22:33:32 +02:00
parent fb5f527f45
commit 0278cb19d4
5 changed files with 212 additions and 42 deletions

View File

@@ -1,17 +1,12 @@
#ifndef _ELFPATCH_H_
#define _ELFPATCH_H_
#include <libelf.h>
#include <stdint.h>
struct elfpatch {
int fd;
Elf *elf;
};
typedef struct elfpatch elfpatch_handle_t;
int elf_patch_open(struct elfpatch *ep, const char *path);
elfpatch_handle_t *elf_patch_open(const char *path);
void elf_patch_print_stats(const struct elfpatch *ep);
void elf_patch_close(struct elfpatch *ep);
void elf_patch_close_and_free(elfpatch_handle_t *ep);
#endif /* _ELFPATCH_H_ */

View File

@@ -1,10 +1,14 @@
#ifndef _REPORTING_H_
#define _REPORTING_H_
#include <stdbool.h>
#define print_err(fmt, ...) fprintf(stderr, (fmt), ## __VA_ARGS__);
void print_debug(const char *fmt, ...);
void reporting_enable_verbose(void);
bool reporting_get_verbosity(void);
#endif /* _REPORTING_H_ */