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
PDB
PublicSymbol.hpp
Go to the documentation of this file.
1
/* Copyright 2022 - 2026 R. Thomas
2
*
3
* Licensed under the Apache License, Version 2.0 (the "License");
4
* you may not use this file except in compliance with the License.
5
* You may obtain a copy of the License at
6
*
7
* http://www.apache.org/licenses/LICENSE-2.0
8
*
9
* Unless required by applicable law or agreed to in writing, software
10
* distributed under the License is distributed on an "AS IS" BASIS,
11
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
* See the License for the specific language governing permissions and
13
* limitations under the License.
14
*/
15
#ifndef LIEF_PDB_PUBLIC_SYMBOL_H
16
#define LIEF_PDB_PUBLIC_SYMBOL_H
17
#include <cstdint>
18
#include <memory>
19
#include <string>
20
#include <ostream>
21
22
#include "
LIEF/compiler_attributes.hpp
"
23
#include "
LIEF/iterators.hpp
"
24
#include "
LIEF/visibility.h
"
25
26
namespace
LIEF
{
27
namespace
pdb
{
28
29
namespace
details
{
30
class
PublicSymbol;
31
class
PublicSymbolIt;
32
}
33
36
class
LIEF_API
PublicSymbol
{
37
public
:
38
class
Iterator
final
39
:
public
iterator_facade_base
<Iterator, std::forward_iterator_tag,
40
PublicSymbol, std::ptrdiff_t,
41
const PublicSymbol*, const PublicSymbol&> {
42
public
:
43
using
implementation
= details::PublicSymbolIt;
44
using
iterator_facade_base::operator++;
45
46
LIEF_API
Iterator
();
47
48
LIEF_API
Iterator
(std::unique_ptr<details::PublicSymbolIt> impl);
49
50
LIEF_API
Iterator
(
const
Iterator
&);
51
LIEF_API
Iterator
&
operator=
(
const
Iterator
&);
52
53
LIEF_API
Iterator
(
Iterator
&&) noexcept;
54
LIEF_API
Iterator
& operator=(
Iterator
&&) noexcept;
55
56
LIEF_API
~
Iterator
();
57
58
// NOLINTNEXTLINE(bugprone-derived-method-shadowing-base-method)
59
LIEF_API
Iterator
& operator++();
60
61
friend
LIEF_API
bool
operator==(const
Iterator
& LHS, const
Iterator
& RHS);
62
63
friend
bool
operator!=(const
Iterator
& LHS, const
Iterator
& RHS) {
64
return
!(LHS == RHS);
65
}
66
67
LIEF_API
const
PublicSymbol
&
operator*
() const
LIEF_LIFETIMEBOUND
;
68
69
// NOLINTNEXTLINE(bugprone-derived-method-shadowing-base-method)
70
LIEF_API
const
PublicSymbol
* operator->() const
LIEF_LIFETIMEBOUND
;
71
74
LIEF_API
std::unique_ptr<
PublicSymbol
>
yield
();
75
76
private:
77
void
load() const;
78
79
std::unique_ptr<
details
::PublicSymbolIt> impl_;
80
mutable std::unique_ptr<
PublicSymbol
> cached_;
81
};
82
PublicSymbol
(std::unique_ptr<
details
::
PublicSymbol
> impl);
83
~
PublicSymbol
();
84
85
enum class
FLAGS
: uint32_t {
86
NONE = 0,
87
CODE = 1 << 0,
88
FUNCTION = 1 << 1,
89
MANAGED = 1 << 2,
90
MSIL = 1 << 3,
91
};
92
94
std::string
name
()
const
;
95
97
std::string
demangled_name
()
const
;
98
102
std::string
section_name
()
const
;
103
107
uint32_t
RVA
()
const
;
108
109
std::string
to_string
()
const
;
110
111
LIEF_API
friend
std::ostream&
operator<<
(std::ostream& os,
112
const
PublicSymbol
& sym) {
113
os << sym.
to_string
();
114
return
os;
115
}
116
117
private
:
118
std::unique_ptr<details::PublicSymbol> impl_;
119
};
120
121
}
122
}
123
#endif
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
LIEF::pdb::PublicSymbol::Iterator::yield
std::unique_ptr< PublicSymbol > yield()
Transfer ownership of the public symbol at the current position to the caller. Returns nullptr if the...
LIEF::pdb::PublicSymbol::Iterator::Iterator
Iterator(std::unique_ptr< details::PublicSymbolIt > impl)
LIEF::pdb::PublicSymbol::Iterator::Iterator
Iterator(const Iterator &)
LIEF::pdb::PublicSymbol::Iterator::Iterator
Iterator()
LIEF::pdb::PublicSymbol::Iterator::operator*
const PublicSymbol & operator*() const
LIEF::pdb::PublicSymbol::Iterator::operator=
Iterator & operator=(const Iterator &)
LIEF::pdb::PublicSymbol::Iterator::Iterator
Iterator(Iterator &&) noexcept
LIEF::pdb::PublicSymbol::Iterator::implementation
details::PublicSymbolIt implementation
Definition
PublicSymbol.hpp:43
LIEF::pdb::PublicSymbol::operator<<
friend std::ostream & operator<<(std::ostream &os, const PublicSymbol &sym)
Definition
PublicSymbol.hpp:111
LIEF::pdb::PublicSymbol::PublicSymbol
PublicSymbol(std::unique_ptr< details::PublicSymbol > impl)
LIEF::pdb::PublicSymbol::name
std::string name() const
Name of the symbol.
LIEF::pdb::PublicSymbol::demangled_name
std::string demangled_name() const
Demangled representation of the symbol.
LIEF::pdb::PublicSymbol::to_string
std::string to_string() const
LIEF::pdb::PublicSymbol::section_name
std::string section_name() const
Name of the section in which this symbol is defined (e.g. .text).
LIEF::pdb::PublicSymbol::FLAGS
FLAGS
Definition
PublicSymbol.hpp:85
LIEF::pdb::PublicSymbol::RVA
uint32_t RVA() const
Relative Virtual Address of this symbol.
compiler_attributes.hpp
LIEF_LIFETIMEBOUND
#define LIEF_LIFETIMEBOUND
Definition
compiler_attributes.hpp:72
iterators.hpp
LIEF::pdb::details
Definition
BuildMetadata.hpp:27
LIEF::pdb
Definition
BuildMetadata.hpp:25
LIEF
LIEF namespace.
Definition
Abstract/Binary.hpp:41
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:45
Generated by
1.17.0