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;
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);
49
50 RuntimeFunctionAArch64(uint64_t RVA, uint32_t length, PACKED_FLAGS flag) :
51 ExceptionInfo(ARCH::ARM64, RVA),
52 length_(length),
53 flag_(flag)
54 {}
55
56 RuntimeFunctionAArch64(const RuntimeFunctionAArch64&) = default;
57 RuntimeFunctionAArch64& operator=(const RuntimeFunctionAArch64&) = default;
58
59 RuntimeFunctionAArch64(RuntimeFunctionAArch64&&) = default;
60 RuntimeFunctionAArch64& operator=(RuntimeFunctionAArch64&&) = default;
61
62 std::unique_ptr<ExceptionInfo> clone() const override {
63 return std::unique_ptr<RuntimeFunctionAArch64>(new RuntimeFunctionAArch64(*this));
64 }
65 uint32_t length() const {
68 return length_;
69 }
70 PACKED_FLAGS flag() const {
73 return flag_;
74 }
75 uint32_t rva_end() const {
78 return rva_start() + length();
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() = default;
88
89 protected:
90 uint32_t length_ = 0;
91 PACKED_FLAGS flag_ = PACKED_FLAGS::RESERVED;
92};
93
94}
95}
96
97
98#endif
ExceptionInfo.hpp
LIEF::BinaryStream
Class that is used to a read stream of data from different sources.
Definition BinaryStream.hpp:33
LIEF::PE::ExceptionInfo
This class is the base class for any exception or runtime function entry.
Definition ExceptionInfo.hpp:33
LIEF::PE::Parser
Main interface to parse PE binaries. In particular the static functions: Parser::parse should be used...
Definition PE/Parser.hpp:52
LIEF::PE::RuntimeFunctionAArch64
This class represents an entry in the exception table (.pdata section) for the AArch64 architecture.
Definition RuntimeFunctionAArch64.hpp:38
LIEF::PE::RuntimeFunctionAArch64::RuntimeFunctionAArch64
RuntimeFunctionAArch64(const RuntimeFunctionAArch64 &)=default
LIEF::PE::RuntimeFunctionAArch64::classof
static bool classof(const ExceptionInfo *info)
Definition RuntimeFunctionAArch64.hpp:83
LIEF::PE::RuntimeFunctionAArch64::operator=
RuntimeFunctionAArch64 & operator=(RuntimeFunctionAArch64 &&)=default
LIEF::PE::RuntimeFunctionAArch64::length
uint32_t length() const
Length of the function in bytes.
Definition RuntimeFunctionAArch64.hpp:67
LIEF::PE::RuntimeFunctionAArch64::operator=
RuntimeFunctionAArch64 & operator=(const RuntimeFunctionAArch64 &)=default
LIEF::PE::RuntimeFunctionAArch64::to_string
std::string to_string() const override
LIEF::PE::RuntimeFunctionAArch64::parse
static std::unique_ptr< RuntimeFunctionAArch64 > parse(Parser &ctx, BinaryStream &strm)
LIEF::PE::RuntimeFunctionAArch64::flag
PACKED_FLAGS flag() const
Flag describing the format the unwind data.
Definition RuntimeFunctionAArch64.hpp:72
LIEF::PE::RuntimeFunctionAArch64::~RuntimeFunctionAArch64
~RuntimeFunctionAArch64()=default
LIEF::PE::RuntimeFunctionAArch64::RuntimeFunctionAArch64
RuntimeFunctionAArch64(uint64_t RVA, uint32_t length, PACKED_FLAGS flag)
Definition RuntimeFunctionAArch64.hpp:50
LIEF::PE::RuntimeFunctionAArch64::rva_end
uint32_t rva_end() const
Function end address.
Definition RuntimeFunctionAArch64.hpp:77
LIEF::PE::RuntimeFunctionAArch64::RuntimeFunctionAArch64
RuntimeFunctionAArch64(RuntimeFunctionAArch64 &&)=default
LIEF::PE::RuntimeFunctionAArch64::clone
std::unique_ptr< ExceptionInfo > clone() const override
Definition RuntimeFunctionAArch64.hpp:62
LIEF::PE
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
LIEF
LIEF namespace.
Definition Abstract/Binary.hpp:36
visibility.h
LIEF_API
#define LIEF_API
Definition visibility.h:41