LIEF: Library to Instrument Executable Formats
Version 2.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
lief-install
x86_64
static
include
LIEF
PE
exceptions_info
internal_arm64.hpp
Go to the documentation of this file.
1
/* Copyright 2017 - 2026 R. Thomas
2
*
3
* Licensed under the Apache License, Version 2.0 (the "License");
4
* you may not use this file except in compliance with the License.
5
* You may obtain a copy of the License at
6
*
7
* http://www.apache.org/licenses/LICENSE-2.0
8
*
9
* Unless required by applicable law or agreed to in writing, software
10
* distributed under the License is distributed on an "AS IS" BASIS,
11
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
* See the License for the specific language governing permissions and
13
* limitations under the License.
14
*/
15
#ifndef LIEF_PE_UNWIND_CODE_ARM64_INTERNAL_H
16
#define LIEF_PE_UNWIND_CODE_ARM64_INTERNAL_H
17
#include <array>
18
#include <cstdint>
19
20
namespace
LIEF::PE::details
{
21
inline
uint32_t
xdata_unpacked_rva
(uint32_t value) {
22
return
value & ~0x3;
23
}
24
25
struct
arm64_packed_t
{
26
uint32_t
raw
;
27
28
uint8_t
flags
()
const
{
29
return
raw
& 0x03;
30
}
31
32
uint32_t
function_length
()
const
{
33
return
((
raw
& 0x00001ffc) >> 2) << 2;
34
}
35
36
uint8_t
RF
()
const
{
37
return
((
raw
& 0x0000e000) >> 13);
38
}
39
40
uint8_t
RI
()
const
{
41
return
((
raw
& 0x000f0000) >> 16);
42
}
43
44
bool
H
()
const
{
45
return
((
raw
& 0x00100000) >> 20);
46
}
47
48
uint8_t
CR
()
const
{
49
return
((
raw
& 0x600000) >> 21);
50
}
51
52
uint8_t
frame_size
()
const
{
53
return
((
raw
& 0xff800000) >> 23);
54
}
55
};
56
57
static_assert
(
sizeof
(arm64_packed_t) ==
sizeof
(uint32_t));
58
59
struct
arm64_unpacked_t
{
60
static
constexpr
auto
MAX_WORDS
= 2;
61
std::array<uint32_t, MAX_WORDS>
data
= {0};
62
63
uint32_t
function_length
()
const
{
64
return
(
data
[0] & 0x0003ffff) << 2;
65
}
66
67
uint8_t
version
()
const
{
68
return
(
data
[0] & 0x000C0000) >> 18;
69
}
70
71
bool
X
()
const
{
72
return
(
data
[0] & 0x00100000) >> 20;
73
}
74
75
uint8_t
E
()
const
{
76
return
(
data
[0] & 0x00200000) >> 21;
77
}
78
79
uint16_t
epilog_count
()
const
{
80
return
is_extended
() ? (
data
[1] & 0x0000ffff) : (
data
[0] & 0x07C00000) >> 22;
81
}
82
83
uint8_t
code_words
()
const
{
84
return
is_extended
() ? (
data
[1] & 0x00ff0000) >> 16 :
85
(
data
[0] & 0xf8000000) >> 27;
86
}
87
88
bool
is_extended
()
const
{
89
return
(
data
[0] & 0xffc00000) == 0;
90
}
91
};
92
93
struct
arm64_epilog_scope_t
{
94
uint32_t
raw
;
95
96
uint32_t
start_offset
()
const
{
97
return
raw
& 0x0003ffff;
98
}
99
100
uint8_t
reserved
()
const
{
101
return
(
raw
& 0x000f0000) >> 18;
102
}
103
104
uint16_t
start_index
()
const
{
105
return
(
raw
& 0xffc00000) >> 22;
106
}
107
};
108
109
}
110
#endif
LIEF::PE::details
Definition
DataDirectory.hpp:37
LIEF::PE::details::xdata_unpacked_rva
uint32_t xdata_unpacked_rva(uint32_t value)
Definition
internal_arm64.hpp:21
LIEF::PE::details::arm64_epilog_scope_t
Definition
internal_arm64.hpp:93
LIEF::PE::details::arm64_epilog_scope_t::raw
uint32_t raw
Definition
internal_arm64.hpp:94
LIEF::PE::details::arm64_epilog_scope_t::reserved
uint8_t reserved() const
Definition
internal_arm64.hpp:100
LIEF::PE::details::arm64_epilog_scope_t::start_index
uint16_t start_index() const
Definition
internal_arm64.hpp:104
LIEF::PE::details::arm64_epilog_scope_t::start_offset
uint32_t start_offset() const
Definition
internal_arm64.hpp:96
LIEF::PE::details::arm64_packed_t
Definition
internal_arm64.hpp:25
LIEF::PE::details::arm64_packed_t::H
bool H() const
Definition
internal_arm64.hpp:44
LIEF::PE::details::arm64_packed_t::RF
uint8_t RF() const
Definition
internal_arm64.hpp:36
LIEF::PE::details::arm64_packed_t::RI
uint8_t RI() const
Definition
internal_arm64.hpp:40
LIEF::PE::details::arm64_packed_t::flags
uint8_t flags() const
Definition
internal_arm64.hpp:28
LIEF::PE::details::arm64_packed_t::raw
uint32_t raw
Definition
internal_arm64.hpp:26
LIEF::PE::details::arm64_packed_t::function_length
uint32_t function_length() const
Definition
internal_arm64.hpp:32
LIEF::PE::details::arm64_packed_t::frame_size
uint8_t frame_size() const
Definition
internal_arm64.hpp:52
LIEF::PE::details::arm64_packed_t::CR
uint8_t CR() const
Definition
internal_arm64.hpp:48
LIEF::PE::details::arm64_unpacked_t
Definition
internal_arm64.hpp:59
LIEF::PE::details::arm64_unpacked_t::version
uint8_t version() const
Definition
internal_arm64.hpp:67
LIEF::PE::details::arm64_unpacked_t::E
uint8_t E() const
Definition
internal_arm64.hpp:75
LIEF::PE::details::arm64_unpacked_t::code_words
uint8_t code_words() const
Definition
internal_arm64.hpp:83
LIEF::PE::details::arm64_unpacked_t::MAX_WORDS
static constexpr auto MAX_WORDS
Definition
internal_arm64.hpp:60
LIEF::PE::details::arm64_unpacked_t::epilog_count
uint16_t epilog_count() const
Definition
internal_arm64.hpp:79
LIEF::PE::details::arm64_unpacked_t::function_length
uint32_t function_length() const
Definition
internal_arm64.hpp:63
LIEF::PE::details::arm64_unpacked_t::is_extended
bool is_extended() const
Definition
internal_arm64.hpp:88
LIEF::PE::details::arm64_unpacked_t::data
std::array< uint32_t, MAX_WORDS > data
Definition
internal_arm64.hpp:61
LIEF::PE::details::arm64_unpacked_t::X
bool X() const
Definition
internal_arm64.hpp:71
Generated by
1.19.0