LIEF: Library to Instrument Executable Formats Version 2.0.0
Loading...
Searching...
No Matches
PEB.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_RUNTIME_WINDOWS_PEB_H
17#define LIEF_RUNTIME_WINDOWS_PEB_H
18#include "LIEF/iterators.hpp"
20#include "LIEF/visibility.h"
21#include <cstdint>
22#include <memory>
23
24
25namespace LIEF::runtime::windows {
26class Process;
27
28namespace details {
29class peb;
30}
31
45 public:
46 friend class Process;
47
48 PEB() = delete;
49 PEB(const PEB&) = delete;
50 PEB& operator=(const PEB&) = delete;
51
52 PEB(PEB&&) noexcept;
53 PEB& operator=(PEB&&) noexcept;
54
57
59 bool being_debugged() const;
60
62 uintptr_t ldr() const;
63
65 uintptr_t process_parameters() const;
66
68 uintptr_t atl_thunk_slist_ptr() const;
69
71 uint32_t atl_thunk_slist_ptr32() const;
72
75 uintptr_t post_process_init_routine() const;
76
78 uint32_t session_id() const;
79
91
92 ~PEB();
93
94 private:
95 static std::unique_ptr<PEB> create();
96 PEB(std::unique_ptr<details::peb> impl);
97 std::unique_ptr<details::peb> impl_;
98};
99
100}
101
102
103#endif
Definition iterators.hpp:591
This class exposes a user-friendly interface over a LDR_DATA_TABLE_ENTRY, the structure used by the W...
Definition LdrDataTableEntry.hpp:39
uintptr_t process_parameters() const
Address of the process parameters (RTL_USER_PROCESS_PARAMETERS).
uint32_t session_id() const
Session ID associated with the current process.
uintptr_t atl_thunk_slist_ptr() const
Address of the per-process ATL thunk SList (single-linked list).
iterator_range< LdrDataTableEntry::Iterator > entries_it
Iterator over the LdrDataTableEntry referenced by the loader data.
Definition PEB.hpp:56
entries_it entries() const
Return a bidirectional iterator over the modules referenced by the loader data (Ldr).
friend class Process
Definition PEB.hpp:46
uintptr_t post_process_init_routine() const
Address of the routine called once the process completed its initialization (PostProcessInitRoutine).
bool being_debugged() const
Whether the current process is being debugged.
PEB & operator=(const PEB &)=delete
uint32_t atl_thunk_slist_ptr32() const
32-bit value of the ATL thunk SList pointer.
uintptr_t ldr() const
Address of the loader data structure (PEB_LDR_DATA).
PEB(const PEB &)=delete
This class exposes Windows-specific API for the current process.
Definition windows/Process.hpp:28
Definition LdrDataTableEntry.hpp:31
Definition windows/Host.hpp:24
#define LIEF_API
Definition visibility.h:45