LIEF: Library to Instrument Executable Formats Version 1.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 <cstdint>
19#include <memory>
20#include <LIEF/visibility.h>
21#include <LIEF/iterators.hpp>
23
24namespace LIEF {
25namespace runtime {
26namespace windows {
27class Process;
28
29namespace details {
30class peb;
31}
32
46 public:
47 friend class Process;
48
49 PEB() = delete;
50 PEB(const PEB&) = delete;
51 PEB& operator=(const PEB&) = delete;
52
53 PEB(PEB&&) noexcept;
54 PEB& operator=(PEB&&) noexcept;
55
58
60 bool being_debugged() const;
61
63 uintptr_t ldr() const;
64
66 uintptr_t process_parameters() const;
67
69 uintptr_t atl_thunk_slist_ptr() const;
70
72 uint32_t atl_thunk_slist_ptr32() const;
73
76 uintptr_t post_process_init_routine() const;
77
79 uint32_t session_id() const;
80
92
93 ~PEB();
94
95 private:
96 static std::unique_ptr<PEB> create();
97 PEB(std::unique_ptr<details::peb> impl);
98 std::unique_ptr<details::peb> impl_;
99};
100
101}
102}
103}
104#endif
Definition iterators.hpp:603
This class exposes a user-friendly interface over a LDR_DATA_TABLE_ENTRY, the structure used by the W...
Definition LdrDataTableEntry.hpp:40
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:57
entries_it entries() const
Return a bidirectional iterator over the modules referenced by the loader data (Ldr).
friend class Process
Definition PEB.hpp:47
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:29
Definition LdrDataTableEntry.hpp:32
Definition windows/Host.hpp:25
Definition android/Host.hpp:24
LIEF namespace.
Definition Abstract/Binary.hpp:41
#define LIEF_API
Definition visibility.h:45