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