| 6 |
| #define BREVENT_PLT_H |
| 7 |
| 8 | #include <elf.h> |
| 9 | #include <link.h> |
| 10 | #include <android/log.h> |
| 11 | #include <stdbool.h> |
| 12 |
| 13 | #ifdef __cplusplus |
| 14 | extern "C" { |
| 15 | #endif |
| 16 |
| 17 | #define PLT_CHECK_PLT_APP ((unsigned short) 0x1u) |
| 18 | #define PLT_CHECK_PLT_ALL ((unsigned short) 0x2u) |
| 19 | #define PLT_CHECK_NAME ((unsigned short) 0x4u) |
| 20 | #define PLT_CHECK_SYM_ONE ((unsigned short) 0x8u) |
| 21 |
| 22 | typedef struct Symbol { |
| 23 | unsigned short check; |
| 24 | unsigned short size; |
| 25 | size_t total; |
| 26 | ElfW(Addr) *symbol_plt; |
| 27 | ElfW(Addr) *symbol_sym; |
| 28 | const char *symbol_name; |
| 29 | char **names; |
| 30 | } Symbol; |
| 31 |
| 32 | int dl_iterate_phdr_symbol(Symbol *symbol); |
| 33 |
| 34 | void *plt_dlsym(const char *name, size_t *total); |
| 35 |
| 36 | bool isPltHooked(const char *name, bool all); |
| 37 |
| 38 | #ifdef __cplusplus |
| 39 | } |
| 40 | #endif |
| 41 |
| 42 | #endif //BREVENT_PLT_H |
| 43 |