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
SubCache.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_SUBCACHE_H
17
#define LIEF_DSC_SUBCACHE_H
18
#include "
LIEF/visibility.h
"
19
#include "
LIEF/iterators.hpp
"
20
#include "
LIEF/DyldSharedCache/uuid.hpp
"
21
22
#include <memory>
23
#include <string>
24
25
namespace
LIEF
{
26
namespace
dsc
{
27
class
DyldSharedCache
;
28
29
namespace
details
{
30
class
SubCache;
31
class
SubCacheIt;
32
}
33
39
class
LIEF_API
SubCache
{
40
public
:
42
class
LIEF_API
Iterator
43
:
public
iterator_facade_base
<Iterator, std::random_access_iterator_tag,
44
std::unique_ptr<SubCache>, std::ptrdiff_t,
45
SubCache*, std::unique_ptr<SubCache>> {
46
public
:
47
using
implementation
= details::SubCacheIt;
48
49
Iterator
(std::unique_ptr<details::SubCacheIt> 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
std::unique_ptr<SubCache>
operator*
()
const
;
71
72
private
:
73
std::unique_ptr<details::SubCacheIt> impl_;
74
};
75
76
public
:
77
SubCache
(std::unique_ptr<details::SubCache> impl);
78
~SubCache
();
79
81
sc_uuid_t
uuid
()
const
;
82
84
uint64_t
vm_offset
()
const
;
85
88
std::string
suffix
()
const
;
89
91
std::unique_ptr<const DyldSharedCache>
cache
()
const
;
92
93
friend
LIEF_API
std::ostream&
operator<<
(std::ostream& os,
94
const
SubCache
& subcache);
95
96
private
:
97
std::unique_ptr<details::SubCache> impl_;
98
};
99
100
}
101
}
102
#endif
LIEF::dsc::DyldSharedCache
This class represents a dyld shared cache file.
Definition
DyldSharedCache/DyldSharedCache.hpp:40
LIEF::dsc::SubCache::Iterator::implementation
details::SubCacheIt implementation
Definition
SubCache.hpp:47
LIEF::dsc::SubCache::Iterator::operator*
std::unique_ptr< SubCache > operator*() const
LIEF::dsc::SubCache::Iterator::Iterator
Iterator(std::unique_ptr< details::SubCacheIt > impl)
LIEF::dsc::SubCache::Iterator::Iterator
Iterator(const Iterator &)
LIEF::dsc::SubCache::Iterator::Iterator
Iterator(Iterator &&) noexcept
LIEF::dsc::SubCache::Iterator::operator=
Iterator & operator=(const Iterator &)
LIEF::dsc::SubCache::cache
std::unique_ptr< const DyldSharedCache > cache() const
The associated DyldSharedCache object for this subcache.
LIEF::dsc::SubCache::SubCache
SubCache(std::unique_ptr< details::SubCache > impl)
LIEF::dsc::SubCache::uuid
sc_uuid_t uuid() const
The uuid of the subcache file.
LIEF::dsc::SubCache::vm_offset
uint64_t vm_offset() const
The offset of this subcache from the main cache base address.
LIEF::dsc::SubCache::~SubCache
~SubCache()
LIEF::dsc::SubCache::suffix
std::string suffix() const
The file name suffix of the subCache file (e.g. .25.data, .03.development).
LIEF::dsc::SubCache::operator<<
friend std::ostream & operator<<(std::ostream &os, const SubCache &subcache)
LIEF::iterator_facade_base
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...
Definition
iterators.hpp:717
iterators.hpp
LIEF::dsc::details
Definition
DyldSharedCache/DyldSharedCache.hpp:35
LIEF::dsc
Namespace related to the dyld shared cache support.
Definition
caching.hpp:22
LIEF::dsc::sc_uuid_t
std::array< uint8_t, 16 > sc_uuid_t
UUID used in different places of the shared cache.
Definition
uuid.hpp:26
LIEF
LIEF namespace.
Definition
Abstract/Binary.hpp:40
uuid.hpp
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:45
Generated by
1.17.0