Interactions with Windows Processes.
More...
Interactions with Windows Processes.
#define Process_close |
( |
|
_handle | ) |
CloseHandle(_handle) |
Alias to CloseHandle().
- Parameters
-
#define Process_open |
( |
|
_pid, |
|
|
|
_access_rights |
|
) |
| OpenProcess(_access_rights, 0, _pid) |
Macro wrapper to open process.
- Note
- See information about access rights.
- Parameters
-
[in] | _pid | Process identifier. |
[in] | _access_rights | Bit mask that specifies desired access rights. |
- Returns
- Handle to opened process.
#define Process_self |
( |
| ) |
GetCurrentProcess() |
Alias to GetCurrentProcess()
- Returns
- Handle to current process.
#define Process_self_pid |
( |
| ) |
GetCurrentProcessId() |
Alias to GetCurrentProcessId()
- Returns
- Pid of current process.
const wchar_t* Process_get_exe_path |
( |
HANDLE |
process, |
|
|
wchar_t * |
buffer, |
|
|
size_t |
size |
|
) |
| |
Retrieves full path to process's binary.
- Note
- Requires access rights either PROCESS_QUERY_INFORMATION or PROCESS_QUERY_LIMITED_INFORMATION
- Parameters
-
[in] | process | Handle to process. |
[out] | buffer | Buffer to hold result. |
[in] | size | Size of buffer. Result is truncated by it. |
- Returns
- Pointer to buffer.
- Return values
-
uint32_t Process_get_window_pid |
( |
const HWND |
window | ) |
|
Get pid of window.
- Note
- If you need both pid & tid then use directly GetWindowThreadProcessId
- Parameters
-
[in] | window | A handle to the window. |
uint32_t Process_get_window_tid |
( |
const HWND |
window | ) |
|
Get tid of window.
- Note
- If you need both pid & tid then use directly GetWindowThreadProcessId
- Parameters
-
[in] | window | A handle to the window. |
const uint8_t* Process_read_mem |
( |
HANDLE |
process, |
|
|
uintptr_t |
base, |
|
|
uint8_t * |
buffer, |
|
|
size_t |
size |
|
) |
| |
Reads memory of a process.
- Parameters
-
[in] | process | Handle to the process. |
[in] | base | A pointer to the base address in the specified process from which to read. |
[out] | buffer | Memory to hold read result. |
[in] | size | Number of bytes to read. |
- Returns
- buffer on success.
- Return values
-
bool Process_write_mem |
( |
HANDLE |
process, |
|
|
uintptr_t |
base, |
|
|
const uint8_t * |
buffer, |
|
|
size_t |
size |
|
) |
| |
Write into memory of a process.
- Parameters
-
[in] | process | Handle to the process. |
[in] | base | A pointer to the base address in the specified process from which to write. |
[in] | buffer | Data to write. |
[in] | size | Number of bytes to write. |
- Return values
-
true | On success. |
false | On failure. |