-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfile.h
55 lines (45 loc) · 1.17 KB
/
file.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* =====================================================================================
*
* Filename: file.h
*
* Description: the declaration of basic data structure for obj file
*
* Version: 1.0
* Created: 03/02/2014 10:10:29 AM
* Revision: none
* Compiler: gcc
*
* Author: YOUR NAME (),
* Organization:
*
* =====================================================================================
*/
#ifndef FILE_H
#define FILE_H
#include <elf.h>
#include "type.h"
typedef enum {
BINARY_CORE_TYPE,
BINARY_SHARED_TYPE,
BINARY_RELOCATABLE_TYPE,
BINARY_EXECUTABLE_TYPE
} BINARY_TYPE;
// Defined for the elf file
typedef struct Elf32_File {
Elf32_Ehdr *elf_file_header;
Elf32_Shdr *elf_section_table;
UINT8 *elf_section_strn_table;
Elf32_Shdr *elf_sym_table_dr;
UINT8 *elf_sym_strn_table;
Elf32_Sym *elf_sym_table;
Elf32_Shdr *elf_dyn_sym_table_dr;
UINT8 *elf_dyn_sym_strn_table;
Elf32_Sym *elf_dyn_sym_table;
int *rel_index;
int rel_num;
UINT8 *elf_file_data;
UINT32 elf_file_size;
BINARY_TYPE elf_file_type;
} Elf32_File;
#endif