LIEF: Library to Instrument Executable Formats Version 1.0.0
Loading...
Searching...
No Matches
RuntimeFunctionAArch64.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 2026 R. Thomas
2 * Copyright 2017 - 2026 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
40 public:
41 enum class PACKED_FLAGS {
42 UNPACKED = 0,
43 PACKED = 1,
44 PACKED_FRAGMENT = 2,
45 RESERVED = 3,
46 };
47
48 static std::unique_ptr<RuntimeFunctionAArch64> parse(Parser& ctx,
49 BinaryStream& strm);
50
52 ExceptionInfo(ARCH::ARM64, RVA),
53 length_(length),
54 flag_(flag) {}
55
58
61
62 std::unique_ptr<ExceptionInfo> clone() const override {
63 return std::unique_ptr<RuntimeFunctionAArch64>(
64 new RuntimeFunctionAArch64(*this)
65 );
66 }
67
69 uint32_t length() const {
70 return length_;
71 }
72
75 return flag_;
76 }
77
79 uint32_t rva_end() const {
80 return rva_start() + length();
81 }
82
83
84 std::string to_string() const override;
85
86 static bool classof(const ExceptionInfo* info) {
87 return info->arch() == ExceptionInfo::ARCH::ARM64;
88 }
89
91
92 protected:
93 uint32_t length_ = 0;
95};
96
97}
98}
99
100
101#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:69
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 Parser::parse functions should be used...
Definition PE/Parser.hpp:52
RuntimeFunctionAArch64(const RuntimeFunctionAArch64 &)=default
static bool classof(const ExceptionInfo *info)
Definition RuntimeFunctionAArch64.hpp:86
RuntimeFunctionAArch64 & operator=(RuntimeFunctionAArch64 &&)=default
uint32_t length() const
Length of the function in bytes.
Definition RuntimeFunctionAArch64.hpp:69
RuntimeFunctionAArch64 & operator=(const RuntimeFunctionAArch64 &)=default
PACKED_FLAGS
Definition RuntimeFunctionAArch64.hpp:41
@ RESERVED
Definition RuntimeFunctionAArch64.hpp:45
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:74
RuntimeFunctionAArch64(uint64_t RVA, uint32_t length, PACKED_FLAGS flag)
Definition RuntimeFunctionAArch64.hpp:51
uint32_t rva_end() const
Function end address.
Definition RuntimeFunctionAArch64.hpp:79
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:43