LIEF: Library to Instrument Executable Formats Version 2.0.0
Loading...
Searching...
No Matches
PogoEntry.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_DEBUG_POGO_ENTRY_H
17#define LIEF_PE_DEBUG_POGO_ENTRY_H
18#include <string_view>
19#include <cstdint>
20#include <ostream>
21
22#include "LIEF/Object.hpp"
23#include "LIEF/visibility.h"
24
25
26namespace LIEF::PE {
27
28class Builder;
29class Parser;
30
31class LIEF_API PogoEntry : public Object {
32 friend class Builder;
33 friend class Parser;
34
35 public:
36 PogoEntry() = default;
37 PogoEntry(PogoEntry&& other) = default;
38 PogoEntry& operator=(PogoEntry&& other) = default;
39 PogoEntry(const PogoEntry&) = default;
40 PogoEntry(uint32_t start_rva, uint32_t size, std::string name) :
41 start_rva_{start_rva},
42 size_{size},
43 name_{std::move(name)} {}
44
45 PogoEntry(uint32_t start_rva, uint32_t size) :
46 PogoEntry{start_rva, size, ""} {}
47
48 PogoEntry& operator=(const PogoEntry&) = default;
49 ~PogoEntry() override = default;
50
51 uint32_t start_rva() const {
52 return start_rva_;
53 }
54
55 uint32_t size() const {
56 return size_;
57 }
58
59 std::string_view name() const {
60 return name_;
61 }
62
63 void start_rva(uint32_t start_rva) {
64 start_rva_ = start_rva;
65 }
66
67 void size(uint32_t size) {
68 size_ = size;
69 }
70
71 void name(std::string name) {
72 name_ = std::move(name);
73 }
74
75 void accept(Visitor& visitor) const override;
76
77 LIEF_API friend std::ostream& operator<<(std::ostream& os,
78 const PogoEntry& entry);
79
80 protected:
81 uint32_t start_rva_ = 0;
82 uint32_t size_ = 0;
83 std::string name_;
84};
85
86} // Namespace PE
87// Namespace LIEF
88
89#endif
Class that is used to rebuild a raw PE binary from a PE::Binary object.
Definition PE/Builder.hpp:44
Main interface to parse PE binaries. In particular, the static Parser::parse functions should be used...
Definition PE/Parser.hpp:53
std::string_view name() const
Definition PogoEntry.hpp:59
~PogoEntry() override=default
PogoEntry(uint32_t start_rva, uint32_t size, std::string name)
Definition PogoEntry.hpp:40
void accept(Visitor &visitor) const override
PogoEntry(PogoEntry &&other)=default
PogoEntry & operator=(const PogoEntry &)=default
friend class Builder
Definition PogoEntry.hpp:32
void size(uint32_t size)
Definition PogoEntry.hpp:67
PogoEntry(const PogoEntry &)=default
friend std::ostream & operator<<(std::ostream &os, const PogoEntry &entry)
friend class Parser
Definition PogoEntry.hpp:33
uint32_t size() const
Definition PogoEntry.hpp:55
PogoEntry & operator=(PogoEntry &&other)=default
void start_rva(uint32_t start_rva)
Definition PogoEntry.hpp:63
void name(std::string name)
Definition PogoEntry.hpp:71
PogoEntry(uint32_t start_rva, uint32_t size)
Definition PogoEntry.hpp:45
uint32_t start_rva() const
Definition PogoEntry.hpp:51
Definition Visitor.hpp:212
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
#define LIEF_API
Definition visibility.h:45