My own elf programs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

57 lines
1.2 KiB

#pragma once
#include <elf.h>
#include <fcntl.h>
#include <sys/mman.h>
#include <sys/stat.h>
#include <sys/types.h>
typedef struct s_elf_opts {
int D;
int a;
int g;
int p;
int r;
int u;
} t_elf_opts;
typedef struct s_elf64 {
void *ptr;
char *file;
size_t size;
Elf64_Ehdr *ehdr;
Elf64_Shdr *shdr;
char **name;
char *type;
char **value;
char **section;
char **desc;
char *string_table;
char *sym_types;
int *ordered_sym_ids;
char *linked_symnames;
char **sym_names;
Elf64_Sym *symtab;
Elf64_Sym *symtab_end;
t_elf_opts opts;
} t_elf64;
typedef struct s_elf32 {
void *ptr;
char *file;
size_t size;
Elf32_Ehdr *ehdr;
Elf32_Shdr *shdr;
char **name;
char *type;
char **value;
char **section;
char **desc;
char *string_table;
char *sym_types;
int *ordered_sym_ids;
char *linked_symnames;
char **sym_names;
Elf32_Sym *symtab;
Elf32_Sym *symtab_end;
t_elf_opts opts;
} t_elf32;