forked from nodejs/node
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStructures.hpp
More file actions
144 lines (121 loc) · 3.38 KB
/
Copy pathStructures.hpp
File metadata and controls
144 lines (121 loc) · 3.38 KB
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
/* Copyright 2021 - 2025 R. Thomas
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef LIEF_ELF_STRUCTURES_H
#define LIEF_ELF_STRUCTURES_H
#include <cstring>
#include "LIEF/types.hpp"
#include "LIEF/ELF/enums.hpp"
namespace LIEF {
namespace ELF {
namespace details {
#include "structures.inc"
struct Elf64_Prpsinfo
{
char pr_state;
char pr_sname;
char pr_zomb;
char pr_nice;
uint32_t pr_pad;
uint64_t pr_flag;
uint32_t pr_uid;
uint32_t pr_gid;
int32_t pr_pid;
int32_t pr_ppid;
int32_t pr_pgrp;
int32_t pr_sid;
char pr_fname[16];
char pr_psargs[80];
};
struct Elf32_Prpsinfo
{
char pr_state;
char pr_sname;
char pr_zomb;
char pr_nice;
uint32_t pr_flag;
uint16_t pr_uid;
uint16_t pr_gid;
int32_t pr_pid;
int32_t pr_ppid;
int32_t pr_pgrp;
int32_t pr_sid;
char pr_fname[16];
char pr_psargs[80];
};
class ELF32 {
public:
static constexpr auto r_info_shift = 8;
typedef Elf32_Addr Elf_Addr;
typedef Elf32_Off Elf_Off;
typedef Elf32_Half Elf_Half;
typedef Elf32_Word Elf_Word;
typedef Elf32_Sword Elf_Sword;
// Equivalent
typedef Elf32_Addr Elf_Xword;
typedef Elf32_Sword Elf_Sxword;
typedef uint32_t uint;
typedef Elf32_Phdr Elf_Phdr;
typedef Elf32_Ehdr Elf_Ehdr;
typedef Elf32_Shdr Elf_Shdr;
typedef Elf32_Sym Elf_Sym;
typedef Elf32_Rel Elf_Rel;
typedef Elf32_Rela Elf_Rela;
typedef Elf32_Dyn Elf_Dyn;
typedef Elf32_Verneed Elf_Verneed;
typedef Elf32_Vernaux Elf_Vernaux;
typedef Elf32_Auxv Elf_Auxv;
typedef Elf32_Verdef Elf_Verdef;
typedef Elf32_Verdaux Elf_Verdaux;
typedef Elf32_Prpsinfo Elf_Prpsinfo;
typedef Elf32_FileEntry Elf_FileEntry;
typedef Elf32_Prstatus Elf_Prstatus;
typedef Elf32_timeval Elf_timeval;
};
class ELF64 {
public:
static constexpr auto r_info_shift = 32;
typedef Elf64_Addr Elf_Addr;
typedef Elf64_Off Elf_Off;
typedef Elf64_Half Elf_Half;
typedef Elf64_Word Elf_Word;
typedef Elf64_Sword Elf_Sword;
typedef Elf64_Xword Elf_Xword;
typedef Elf64_Sxword Elf_Sxword;
typedef uint64_t uint;
typedef Elf64_Phdr Elf_Phdr;
typedef Elf64_Ehdr Elf_Ehdr;
typedef Elf64_Shdr Elf_Shdr;
typedef Elf64_Sym Elf_Sym;
typedef Elf64_Rel Elf_Rel;
typedef Elf64_Rela Elf_Rela;
typedef Elf64_Dyn Elf_Dyn;
typedef Elf64_Verneed Elf_Verneed;
typedef Elf64_Vernaux Elf_Vernaux;
typedef Elf64_Auxv Elf_Auxv;
typedef Elf64_Verdef Elf_Verdef;
typedef Elf64_Verdaux Elf_Verdaux;
typedef Elf64_Prpsinfo Elf_Prpsinfo;
typedef Elf64_FileEntry Elf_FileEntry;
typedef Elf64_Prstatus Elf_Prstatus;
typedef Elf64_timeval Elf_timeval;
};
class ELF32_x32 : public ELF32 {
};
class ELF32_arm64 : public ELF32 {
};
} /* end namespace details */
} /* end namespace ELF */
} /* end namespace LIEF */
#endif