LIEF: Library to Instrument Executable Formats
Version 2.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
lief-install
x86_64
static
include
LIEF
runtime
Process.hpp
Go to the documentation of this file.
1
/* Copyright 2017 - 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_RUNTIME_PROCESS_H
16
#define LIEF_RUNTIME_PROCESS_H
17
#include <unordered_map>
18
#include <cstdint>
19
#include <string>
20
21
#include "
LIEF/runtime/utils.hpp
"
22
#include "
LIEF/visibility.h
"
23
#include <optional>
24
25
26
namespace
LIEF::assembly
{
27
class
Engine
;
28
}
29
30
31
namespace
LIEF::runtime
{
32
35
class
LIEF_API
Process
{
36
public
:
38
struct
EnvVars
{
39
std::unordered_map<std::string, std::string>
vars
;
40
41
bool
empty
()
const
{
42
return
vars
.empty();
43
}
44
};
45
47
static
int32_t
pid
();
48
50
static
uint32_t
tid
();
51
53
static
constexpr
ARCH
arch
() {
54
return
runtime::arch();
55
}
56
58
static
constexpr
PLATFORMS
platform
() {
59
return
runtime::platform();
60
}
61
67
static
uint32_t
page_size
();
68
70
static
std::optional<std::string>
get_env
(
const
std::string& key);
71
73
static
EnvVars
get_envs
();
74
76
static
assembly::Engine
*
default_engine
();
77
};
78
}
79
80
#endif
LIEF::assembly::Engine
This class interfaces the assembler/disassembler support.
Definition
Engine.hpp:38
LIEF::runtime::Process
This structure represents the current process and provides functions to query process-level informati...
Definition
Process.hpp:35
LIEF::runtime::Process::pid
static int32_t pid()
Get the Process ID of the current process.
LIEF::runtime::Process::page_size
static uint32_t page_size()
Return the number of bytes in a memory page.
LIEF::runtime::Process::get_envs
static EnvVars get_envs()
Return the environment variables present in the current process.
LIEF::runtime::Process::get_env
static std::optional< std::string > get_env(const std::string &key)
Return the environment variable associated with the given key.
LIEF::runtime::Process::arch
static constexpr ARCH arch()
Return the target architecture of the current process.
Definition
Process.hpp:53
LIEF::runtime::Process::platform
static constexpr PLATFORMS platform()
Return the target platform of the current process.
Definition
Process.hpp:58
LIEF::runtime::Process::tid
static uint32_t tid()
Get the Thread ID of the current thread.
LIEF::runtime::Process::default_engine
static assembly::Engine * default_engine()
Return the assembler/disassembler for the current process.
LIEF::assembly
Namespace related to assembly/disassembly support.
Definition
Abstract/Binary.hpp:48
LIEF::runtime
Definition
android/Host.hpp:23
LIEF::runtime::ARCH
ARCH
Definition
runtime/utils.hpp:36
LIEF::runtime::PLATFORMS
PLATFORMS
Definition
runtime/utils.hpp:27
utils.hpp
LIEF::runtime::Process::EnvVars
This structure wraps environment variables.
Definition
Process.hpp:38
LIEF::runtime::Process::EnvVars::empty
bool empty() const
Definition
Process.hpp:41
LIEF::runtime::Process::EnvVars::vars
std::unordered_map< std::string, std::string > vars
Definition
Process.hpp:39
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:44
Generated by
1.19.0