LIEF: Library to Instrument Executable Formats
Version 1.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
lief-install
x86_64
static
include
LIEF
DyldSharedCache
MappingInfo.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_DSC_MAPPING_INFO_H
17
#define LIEF_DSC_MAPPING_INFO_H
18
#include "
LIEF/compiler_attributes.hpp
"
19
#include "
LIEF/visibility.h
"
20
#include "
LIEF/iterators.hpp
"
21
22
#include <memory>
23
#include <cstdint>
24
25
namespace
LIEF
{
26
namespace
dsc
{
27
28
namespace
details
{
29
class
MappingInfo;
30
class
MappingInfoIt;
31
}
32
37
class
LIEF_API
MappingInfo
{
38
public
:
40
class
LIEF_API
Iterator
41
:
public
iterator_facade_base
<Iterator, std::random_access_iterator_tag,
42
MappingInfo, std::ptrdiff_t, const MappingInfo*,
43
const MappingInfo&> {
44
public
:
45
using
implementation
= details::MappingInfoIt;
46
47
Iterator
();
48
49
Iterator
(std::unique_ptr<details::MappingInfoIt> impl);
50
Iterator
(
const
Iterator
&);
51
Iterator
&
operator=
(
const
Iterator
&);
52
53
Iterator
(
Iterator
&&) noexcept;
54
Iterator
& operator=(
Iterator
&&) noexcept;
55
56
~
Iterator
();
57
bool
operator<(const
Iterator
& rhs) const;
58
59
std::ptrdiff_t operator-(const
Iterator
& R) const;
60
61
Iterator
& operator+=(std::ptrdiff_t n);
62
Iterator
& operator-=(std::ptrdiff_t n);
63
64
friend
LIEF_API
bool
operator==(const
Iterator
& LHS, const
Iterator
& RHS);
65
66
friend
LIEF_API
bool
operator!=(const
Iterator
& LHS, const
Iterator
& RHS) {
67
return
!(LHS == RHS);
68
}
69
70
const
MappingInfo
&
operator*
() const
LIEF_LIFETIMEBOUND
;
71
72
// NOLINTNEXTLINE(bugprone-derived-method-shadowing-base-method)
73
const
MappingInfo
* operator->() const
LIEF_LIFETIMEBOUND
;
74
77
std::unique_ptr<
MappingInfo
>
yield
();
78
79
private:
80
void
load() const;
81
82
std::unique_ptr<
details
::MappingInfoIt> impl_;
83
mutable std::unique_ptr<
MappingInfo
> cached_;
84
};
85
86
MappingInfo
(std::unique_ptr<
details
::
MappingInfo
> impl);
87
~
MappingInfo
();
88
90
uint64_t
address
() const;
91
93
uint64_t
size
() const;
94
96
uint64_t
end_address
()
const
{
97
return
address
() +
size
();
98
}
99
101
uint64_t
file_offset
()
const
;
102
104
uint32_t
max_prot
()
const
;
105
107
uint32_t
init_prot
()
const
;
108
109
private
:
110
std::unique_ptr<details::MappingInfo> impl_;
111
};
112
113
}
114
}
115
#endif
LIEF::dsc::MappingInfo::Iterator::Iterator
Iterator(Iterator &&) noexcept
LIEF::dsc::MappingInfo::Iterator::operator=
Iterator & operator=(const Iterator &)
LIEF::dsc::MappingInfo::Iterator::implementation
details::MappingInfoIt implementation
Definition
MappingInfo.hpp:45
LIEF::dsc::MappingInfo::Iterator::yield
std::unique_ptr< MappingInfo > yield()
Transfer ownership of the mapping info at the current position to the caller. Returns nullptr if the ...
LIEF::dsc::MappingInfo::Iterator::Iterator
Iterator(const Iterator &)
LIEF::dsc::MappingInfo::Iterator::operator*
const MappingInfo & operator*() const
LIEF::dsc::MappingInfo::Iterator::Iterator
Iterator()
LIEF::dsc::MappingInfo::Iterator::Iterator
Iterator(std::unique_ptr< details::MappingInfoIt > impl)
LIEF::dsc::MappingInfo::size
uint64_t size() const
Size of the region being mapped.
LIEF::dsc::MappingInfo::max_prot
uint32_t max_prot() const
Max memory protection.
LIEF::dsc::MappingInfo::file_offset
uint64_t file_offset() const
On-disk file offset.
LIEF::dsc::MappingInfo::end_address
uint64_t end_address() const
End virtual address of the region.
Definition
MappingInfo.hpp:96
LIEF::dsc::MappingInfo::init_prot
uint32_t init_prot() const
Initial memory protection.
LIEF::dsc::MappingInfo::MappingInfo
MappingInfo(std::unique_ptr< details::MappingInfo > impl)
LIEF::dsc::MappingInfo::address
uint64_t address() const
The in-memory address where this dyld shared cache region is mapped.
LIEF::iterator_facade_base
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...
Definition
iterators.hpp:729
compiler_attributes.hpp
LIEF_LIFETIMEBOUND
#define LIEF_LIFETIMEBOUND
Definition
compiler_attributes.hpp:72
iterators.hpp
LIEF::dsc::details
Definition
DyldSharedCache/DyldSharedCache.hpp:36
LIEF::dsc
Namespace related to the dyld shared cache support.
Definition
caching.hpp:22
LIEF
LIEF namespace.
Definition
Abstract/Binary.hpp:41
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:45
Generated by
1.17.0