Header for pwn::windows::System class This namespace holds functions for global system manipulation. For process specific stuff, use the pwn::windows::Process class.
More...
#include "Common.hpp"
Go to the source code of this file.
|
| Result< PVOID > | pwn::System::details::QueryInternal (const SYSTEM_INFORMATION_CLASS, const usize) |
| | Should not be called directly. More...
|
| |
| auto | pwn::System::PageSize () -> u32 |
| | Get the page size of the targeted system. More...
|
| |
| u32 | pwn::System::ProcessId (const HANDLE hProcess=::GetCurrentProcess()) |
| |
| auto | pwn::System::ParentProcessId (const u32 dwProcessId) -> Result< u32 > |
| |
| auto | pwn::System::PidOf (std::wstring_view const targetProcessName) -> Result< std::vector< u32 >> |
| |
| const std::wstring | pwn::System::ComputerName () |
| |
| Result< std::wstring > | pwn::System::UserName () |
| |
| Result< std::wstring > | pwn::System::ModuleName (HMODULE hModule) |
| |
| Result< std::wstring > | pwn::System::FileName () |
| |
| std::tuple< u32, u32, u32 > | pwn::System::WindowsVersion () |
| | Get the Windows version as a tuple of int, or raise an exception. More...
|
| |
| template<class T > |
| Result< std::shared_ptr< T > > | pwn::System::Query (SYSTEM_INFORMATION_CLASS SystemInformationClass) |
| | Query system information. More...
|
| |
| Result< std::tuple< u8, u8, u8, u8, u8 > > | pwn::System::ProcessorCount () |
| | Retrieves the system number of processors and their cache. More...
|
| |
| Result< std::vector< RTL_PROCESS_MODULE_INFORMATION > > | pwn::System::Modules () |
| | Get the kernel modules. More...
|
| |
| Result< std::vector< SYSTEM_HANDLE_TABLE_ENTRY_INFO > > | pwn::System::Handles () |
| | Enumerate all the system handles. More...
|
| |
| Result< std::vector< std::tuple< u32, u32 > > > | pwn::System::Threads () |
| | Enumerate all {ProcessId, ThreadId} currently running. More...
|
| |
Header for pwn::windows::System class This namespace holds functions for global system manipulation. For process specific stuff, use the pwn::windows::Process class.
- Author
- hugsy (hugsy.nosp@m.@bla.nosp@m.h.cat)
- Copyright
- This file is part of the
pwn++ project and subject to the same license
◆ ComputerName()
| const std::wstring pwn::System::ComputerName |
( |
| ) |
|
- Returns
- const std::wstring
◆ FileName()
| Result<std::wstring> pwn::System::FileName |
( |
| ) |
|
- Returns
- Result<std::wstring>
◆ Handles()
| Result<std::vector<SYSTEM_HANDLE_TABLE_ENTRY_INFO> > pwn::System::Handles |
( |
| ) |
|
Enumerate all the system handles.
- Returns
- Result<std::vector<SYSTEM_HANDLE_TABLE_ENTRY_INFO>>
◆ ModuleName()
| Result<std::wstring> pwn::System::ModuleName |
( |
HMODULE |
hModule | ) |
|
- Parameters
-
- Returns
- Result<std::wstring>
◆ Modules()
| Result<std::vector<RTL_PROCESS_MODULE_INFORMATION> > pwn::System::Modules |
( |
| ) |
|
Get the kernel modules.
- Returns
- Result<std::vector<RTL_PROCESS_MODULE_INFORMATION>>
◆ PageSize()
| auto pwn::System::PageSize |
( |
| ) |
-> u32 |
Get the page size of the targeted system.
- Returns
- u32
◆ ParentProcessId()
| auto pwn::System::ParentProcessId |
( |
const u32 |
dwProcessId | ) |
-> Result< u32 > |
- Parameters
-
- Returns
- std::optional<u32>
◆ PidOf()
| auto pwn::System::PidOf |
( |
std::wstring_view const |
targetProcessName | ) |
-> Result< std::vector< u32 >> |
- Parameters
-
- Returns
- Result<std::vector<u32>>
◆ ProcessId()
| u32 pwn::System::ProcessId |
( |
const HANDLE |
hProcess = ::GetCurrentProcess() | ) |
|
◆ ProcessorCount()
| Result<std::tuple<u8, u8, u8, u8, u8> > pwn::System::ProcessorCount |
( |
| ) |
|
Retrieves the system number of processors and their cache.
- Returns
- If successful, the tuple returns a tuple of (in that order): processor count, logical processor count, number of L1 caches, number of L2 caches and number of L3 caches
◆ Query()
template<class T >
| Result<std::shared_ptr<T> > pwn::System::Query |
( |
SYSTEM_INFORMATION_CLASS |
SystemInformationClass | ) |
|
Query system information.
- Template Parameters
-
- Parameters
-
- Returns
- Result<std::shared_ptr<T>>
◆ QueryInternal()
| Result<PVOID> pwn::System::details::QueryInternal |
( |
const |
SYSTEM_INFORMATION_CLASS, |
|
|
const |
usize |
|
) |
| |
Should not be called directly.
- Parameters
-
- Returns
- Result<PVOID>
◆ Threads()
| Result<std::vector<std::tuple<u32, u32> > > pwn::System::Threads |
( |
| ) |
|
Enumerate all {ProcessId, ThreadId} currently running.
- Returns
- Result<std::vector<std::tuple<u32, u32>>>
◆ UserName()
| Result<std::wstring> pwn::System::UserName |
( |
| ) |
|
- Returns
- Result<std::wstring>
◆ WindowsVersion()
| std::tuple<u32, u32, u32> pwn::System::WindowsVersion |
( |
| ) |
|
Get the Windows version as a tuple of int, or raise an exception.
- Returns
- PWNAPI