LIEF: Library to Instrument Executable Formats
Version 0.15.1
Loading...
Searching...
No Matches
install
linux
x86_64
sdk
static
include
LIEF
PE
PE/Header.h
Go to the documentation of this file.
1
/* Copyright 2017 - 2024 R. Thomas
2
* Copyright 2017 - 2024 Quarkslab
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
#ifndef C_LIEF_PE_HEADER_H
17
#define C_LIEF_PE_HEADER_H
18
19
#include <inttypes.h>
20
21
#include "
LIEF/visibility.h
"
22
23
#ifdef __cplusplus
24
extern
"C"
{
25
#endif
26
27
enum
LIEF_PE_MACHINE_TYPES
{
28
LIEF_PE_MACHINE_UNKNOWN
= 0x0,
29
LIEF_PE_MACHINE_AM33
= 0x1D3,
30
LIEF_PE_MACHINE_AMD64
= 0x8664,
31
LIEF_PE_MACHINE_ARM
= 0x1C0,
32
LIEF_PE_MACHINE_ARMNT
= 0x1C4,
33
LIEF_PE_MACHINE_ARM64
= 0xAA64,
34
LIEF_PE_MACHINE_EBC
= 0xEBC,
35
LIEF_PE_MACHINE_I386
= 0x14C,
36
LIEF_PE_MACHINE_IA64
= 0x200,
37
LIEF_PE_MACHINE_M32R
= 0x9041,
38
LIEF_PE_MACHINE_MIPS16
= 0x266,
39
LIEF_PE_MACHINE_MIPSFPU
= 0x366,
40
LIEF_PE_MACHINE_MIPSFPU16
= 0x466,
41
LIEF_PE_MACHINE_POWERPC
= 0x1F0,
42
LIEF_PE_MACHINE_POWERPCFP
= 0x1F1,
43
LIEF_PE_MACHINE_R4000
= 0x166,
44
LIEF_PE_MACHINE_RISCV32
= 0x5032,
45
LIEF_PE_MACHINE_RISCV64
= 0x5064,
46
LIEF_PE_MACHINE_RISCV128
= 0x5128,
47
LIEF_PE_MACHINE_SH3
= 0x1A2,
48
LIEF_PE_MACHINE_SH3DSP
= 0x1A3,
49
LIEF_PE_MACHINE_SH4
= 0x1A6,
50
LIEF_PE_MACHINE_SH5
= 0x1A8,
51
LIEF_PE_MACHINE_THUMB
= 0x1C2,
52
LIEF_PE_MACHINE_WCEMIPSV2
= 0x169
53
};
54
55
enum
LIEF_PE_HEADER_CHARACTERISTICS
{
56
LIEF_PE_HEADER_CHARACTERISTICS_INVALID
= 0x0000,
57
LIEF_PE_HEADER_CHARACTERISTICS_RELOCS_STRIPPED
= 0x0001,
58
LIEF_PE_HEADER_CHARACTERISTICS_EXECUTABLE_IMAGE
= 0x0002,
59
LIEF_PE_HEADER_CHARACTERISTICS_LINE_NUMS_STRIPPED
= 0x0004,
60
LIEF_PE_HEADER_CHARACTERISTICS_LOCAL_SYMS_STRIPPED
= 0x0008,
61
LIEF_PE_HEADER_CHARACTERISTICS_AGGRESSIVE_WS_TRIM
= 0x0010,
62
LIEF_PE_HEADER_CHARACTERISTICS_LARGE_ADDRESS_AWARE
= 0x0020,
63
LIEF_PE_HEADER_CHARACTERISTICS_BYTES_REVERSED_LO
= 0x0080,
64
LIEF_PE_HEADER_CHARACTERISTICS_32BIT_MACHINE
= 0x0100,
65
LIEF_PE_HEADER_CHARACTERISTICS_DEBUG_STRIPPED
= 0x0200,
66
LIEF_PE_HEADER_CHARACTERISTICS_REMOVABLE_RUN_FROM_SWAP
= 0x0400,
67
LIEF_PE_HEADER_CHARACTERISTICS_NET_RUN_FROM_SWAP
= 0x0800,
68
LIEF_PE_HEADER_CHARACTERISTICS_SYSTEM
= 0x1000,
69
LIEF_PE_HEADER_CHARACTERISTICS_DLL
= 0x2000,
70
LIEF_PE_HEADER_CHARACTERISTICS_UP_SYSTEM_ONLY
= 0x4000,
71
LIEF_PE_HEADER_CHARACTERISTICS_BYTES_REVERSED_HI
= 0x8000
72
};
73
74
struct
Pe_Header_t
{
75
uint8_t
signature
[4];
76
enum
LIEF_PE_MACHINE_TYPES
machine
;
77
uint16_t
numberof_sections
;
78
uint32_t
time_date_stamp
;
79
uint32_t
pointerto_symbol_table
;
80
uint32_t
numberof_symbols
;
81
uint16_t
sizeof_optional_header
;
82
uint16_t
characteristics
;
83
};
84
85
typedef
struct
Pe_Header_t
Pe_Header_t
;
86
87
LIEF_API
const
char
*
lief_pe_header_machine_str
(
enum
LIEF_PE_MACHINE_TYPES
e);
88
LIEF_API
const
char
*
lief_pe_header_characteristics_str
(
enum
LIEF_PE_HEADER_CHARACTERISTICS
e);
89
90
#ifdef __cplusplus
91
}
92
#endif
93
94
#endif
LIEF_PE_MACHINE_TYPES
LIEF_PE_MACHINE_TYPES
Definition
PE/Header.h:27
LIEF_PE_MACHINE_IA64
@ LIEF_PE_MACHINE_IA64
Definition
PE/Header.h:36
LIEF_PE_MACHINE_AM33
@ LIEF_PE_MACHINE_AM33
Definition
PE/Header.h:29
LIEF_PE_MACHINE_RISCV32
@ LIEF_PE_MACHINE_RISCV32
Definition
PE/Header.h:44
LIEF_PE_MACHINE_R4000
@ LIEF_PE_MACHINE_R4000
Definition
PE/Header.h:43
LIEF_PE_MACHINE_RISCV64
@ LIEF_PE_MACHINE_RISCV64
Definition
PE/Header.h:45
LIEF_PE_MACHINE_MIPSFPU16
@ LIEF_PE_MACHINE_MIPSFPU16
Definition
PE/Header.h:40
LIEF_PE_MACHINE_AMD64
@ LIEF_PE_MACHINE_AMD64
Definition
PE/Header.h:30
LIEF_PE_MACHINE_POWERPC
@ LIEF_PE_MACHINE_POWERPC
Definition
PE/Header.h:41
LIEF_PE_MACHINE_THUMB
@ LIEF_PE_MACHINE_THUMB
Definition
PE/Header.h:51
LIEF_PE_MACHINE_WCEMIPSV2
@ LIEF_PE_MACHINE_WCEMIPSV2
Definition
PE/Header.h:52
LIEF_PE_MACHINE_ARM
@ LIEF_PE_MACHINE_ARM
Definition
PE/Header.h:31
LIEF_PE_MACHINE_POWERPCFP
@ LIEF_PE_MACHINE_POWERPCFP
Definition
PE/Header.h:42
LIEF_PE_MACHINE_SH3
@ LIEF_PE_MACHINE_SH3
Definition
PE/Header.h:47
LIEF_PE_MACHINE_MIPS16
@ LIEF_PE_MACHINE_MIPS16
Definition
PE/Header.h:38
LIEF_PE_MACHINE_ARMNT
@ LIEF_PE_MACHINE_ARMNT
Definition
PE/Header.h:32
LIEF_PE_MACHINE_EBC
@ LIEF_PE_MACHINE_EBC
Definition
PE/Header.h:34
LIEF_PE_MACHINE_MIPSFPU
@ LIEF_PE_MACHINE_MIPSFPU
Definition
PE/Header.h:39
LIEF_PE_MACHINE_ARM64
@ LIEF_PE_MACHINE_ARM64
Definition
PE/Header.h:33
LIEF_PE_MACHINE_SH4
@ LIEF_PE_MACHINE_SH4
Definition
PE/Header.h:49
LIEF_PE_MACHINE_I386
@ LIEF_PE_MACHINE_I386
Definition
PE/Header.h:35
LIEF_PE_MACHINE_UNKNOWN
@ LIEF_PE_MACHINE_UNKNOWN
Definition
PE/Header.h:28
LIEF_PE_MACHINE_SH3DSP
@ LIEF_PE_MACHINE_SH3DSP
Definition
PE/Header.h:48
LIEF_PE_MACHINE_RISCV128
@ LIEF_PE_MACHINE_RISCV128
Definition
PE/Header.h:46
LIEF_PE_MACHINE_M32R
@ LIEF_PE_MACHINE_M32R
Definition
PE/Header.h:37
LIEF_PE_MACHINE_SH5
@ LIEF_PE_MACHINE_SH5
Definition
PE/Header.h:50
lief_pe_header_characteristics_str
const char * lief_pe_header_characteristics_str(enum LIEF_PE_HEADER_CHARACTERISTICS e)
lief_pe_header_machine_str
const char * lief_pe_header_machine_str(enum LIEF_PE_MACHINE_TYPES e)
LIEF_PE_HEADER_CHARACTERISTICS
LIEF_PE_HEADER_CHARACTERISTICS
Definition
PE/Header.h:55
LIEF_PE_HEADER_CHARACTERISTICS_BYTES_REVERSED_LO
@ LIEF_PE_HEADER_CHARACTERISTICS_BYTES_REVERSED_LO
Definition
PE/Header.h:63
LIEF_PE_HEADER_CHARACTERISTICS_LARGE_ADDRESS_AWARE
@ LIEF_PE_HEADER_CHARACTERISTICS_LARGE_ADDRESS_AWARE
Definition
PE/Header.h:62
LIEF_PE_HEADER_CHARACTERISTICS_DLL
@ LIEF_PE_HEADER_CHARACTERISTICS_DLL
Definition
PE/Header.h:69
LIEF_PE_HEADER_CHARACTERISTICS_LINE_NUMS_STRIPPED
@ LIEF_PE_HEADER_CHARACTERISTICS_LINE_NUMS_STRIPPED
Definition
PE/Header.h:59
LIEF_PE_HEADER_CHARACTERISTICS_EXECUTABLE_IMAGE
@ LIEF_PE_HEADER_CHARACTERISTICS_EXECUTABLE_IMAGE
Definition
PE/Header.h:58
LIEF_PE_HEADER_CHARACTERISTICS_SYSTEM
@ LIEF_PE_HEADER_CHARACTERISTICS_SYSTEM
Definition
PE/Header.h:68
LIEF_PE_HEADER_CHARACTERISTICS_BYTES_REVERSED_HI
@ LIEF_PE_HEADER_CHARACTERISTICS_BYTES_REVERSED_HI
Definition
PE/Header.h:71
LIEF_PE_HEADER_CHARACTERISTICS_NET_RUN_FROM_SWAP
@ LIEF_PE_HEADER_CHARACTERISTICS_NET_RUN_FROM_SWAP
Definition
PE/Header.h:67
LIEF_PE_HEADER_CHARACTERISTICS_AGGRESSIVE_WS_TRIM
@ LIEF_PE_HEADER_CHARACTERISTICS_AGGRESSIVE_WS_TRIM
Definition
PE/Header.h:61
LIEF_PE_HEADER_CHARACTERISTICS_INVALID
@ LIEF_PE_HEADER_CHARACTERISTICS_INVALID
Definition
PE/Header.h:56
LIEF_PE_HEADER_CHARACTERISTICS_DEBUG_STRIPPED
@ LIEF_PE_HEADER_CHARACTERISTICS_DEBUG_STRIPPED
Definition
PE/Header.h:65
LIEF_PE_HEADER_CHARACTERISTICS_LOCAL_SYMS_STRIPPED
@ LIEF_PE_HEADER_CHARACTERISTICS_LOCAL_SYMS_STRIPPED
Definition
PE/Header.h:60
LIEF_PE_HEADER_CHARACTERISTICS_32BIT_MACHINE
@ LIEF_PE_HEADER_CHARACTERISTICS_32BIT_MACHINE
Definition
PE/Header.h:64
LIEF_PE_HEADER_CHARACTERISTICS_RELOCS_STRIPPED
@ LIEF_PE_HEADER_CHARACTERISTICS_RELOCS_STRIPPED
Definition
PE/Header.h:57
LIEF_PE_HEADER_CHARACTERISTICS_REMOVABLE_RUN_FROM_SWAP
@ LIEF_PE_HEADER_CHARACTERISTICS_REMOVABLE_RUN_FROM_SWAP
Definition
PE/Header.h:66
LIEF_PE_HEADER_CHARACTERISTICS_UP_SYSTEM_ONLY
@ LIEF_PE_HEADER_CHARACTERISTICS_UP_SYSTEM_ONLY
Definition
PE/Header.h:70
Pe_Header_t
Definition
PE/Header.h:74
Pe_Header_t::numberof_symbols
uint32_t numberof_symbols
Definition
PE/Header.h:80
Pe_Header_t::machine
enum LIEF_PE_MACHINE_TYPES machine
Definition
PE/Header.h:76
Pe_Header_t::time_date_stamp
uint32_t time_date_stamp
Definition
PE/Header.h:78
Pe_Header_t::sizeof_optional_header
uint16_t sizeof_optional_header
Definition
PE/Header.h:81
Pe_Header_t::signature
uint8_t signature[4]
Definition
PE/Header.h:75
Pe_Header_t::pointerto_symbol_table
uint32_t pointerto_symbol_table
Definition
PE/Header.h:79
Pe_Header_t::characteristics
uint16_t characteristics
Definition
PE/Header.h:82
Pe_Header_t::numberof_sections
uint16_t numberof_sections
Definition
PE/Header.h:77
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:41
Generated by
1.11.0