LIEF: Library to Instrument Executable Formats Version 2.0.0
Loading...
Searching...
No Matches
RuntimeFunctionAArch64.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_RUNTIME_FUNCTION_AARCH64_H
16#define LIEF_PE_RUNTIME_FUNCTION_AARCH64_H
17
18#include <memory>
19
21#include "LIEF/visibility.h"
22
23namespace LIEF {
24class BinaryStream;
25
26namespace PE {
27class Parser;
28
39 public:
40 enum class PACKED_FLAGS {
41 UNPACKED = 0,
42 PACKED = 1,
43 PACKED_FRAGMENT = 2,
44 RESERVED = 3,
45 };
46
47 static std::unique_ptr<RuntimeFunctionAArch64>
48 parse(Parser& ctx, BinaryStream& strm, uint64_t size, uint64_t nb_scopes);
49
51 ExceptionInfo(ARCH::ARM64, RVA),
52 length_(length),
53 flag_(flag) {}
54
57
60
61 std::unique_ptr<ExceptionInfo> clone() const override {
62 return std::make_unique<RuntimeFunctionAArch64>(*this);
63 }
64
66 uint32_t length() const {
67 return length_;
68 }
69
72 return flag_;
73 }
74
76 uint32_t rva_end() const {
77 return rva_start() + length();
78 }
79
80
81 std::string to_string() const override;
82
83 static bool classof(const ExceptionInfo* info) {
84 return info->arch() == ExceptionInfo::ARCH::ARM64;
85 }
86
87 ~RuntimeFunctionAArch64() override = default;
88
89 protected:
90 uint32_t length_ = 0;
92};
93
94}
95}
96
97
98#endif
Class that is used to a read stream of data from different sources.
Definition BinaryStream.hpp:34
uint32_t rva_start() const
Function start address.
Definition ExceptionInfo.hpp:70
ARCH
Arch discriminator for the subclasses.
Definition ExceptionInfo.hpp:51
@ ARM64
Definition ExceptionInfo.hpp:53
Main interface to parse PE binaries. In particular, the static Parser::parse functions should be used...
Definition PE/Parser.hpp:53
RuntimeFunctionAArch64(const RuntimeFunctionAArch64 &)=default
static bool classof(const ExceptionInfo *info)
Definition RuntimeFunctionAArch64.hpp:83
RuntimeFunctionAArch64 & operator=(RuntimeFunctionAArch64 &&)=default
uint32_t length() const
Length of the function in bytes.
Definition RuntimeFunctionAArch64.hpp:66
RuntimeFunctionAArch64 & operator=(const RuntimeFunctionAArch64 &)=default
PACKED_FLAGS
Definition RuntimeFunctionAArch64.hpp:40
@ RESERVED
Definition RuntimeFunctionAArch64.hpp:44
std::string to_string() const override
PACKED_FLAGS flag() const
Flag describing the format the unwind data.
Definition RuntimeFunctionAArch64.hpp:71
static std::unique_ptr< RuntimeFunctionAArch64 > parse(Parser &ctx, BinaryStream &strm, uint64_t size, uint64_t nb_scopes)
RuntimeFunctionAArch64(uint64_t RVA, uint32_t length, PACKED_FLAGS flag)
Definition RuntimeFunctionAArch64.hpp:50
uint32_t rva_end() const
Function end address.
Definition RuntimeFunctionAArch64.hpp:76
RuntimeFunctionAArch64(RuntimeFunctionAArch64 &&)=default
~RuntimeFunctionAArch64() override=default
std::unique_ptr< ExceptionInfo > clone() const override
Definition RuntimeFunctionAArch64.hpp:61
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:31
LIEF namespace.
Definition Abstract/Binary.hpp:41
#define LIEF_API
Definition visibility.h:44