Lazy WinAPI
process.h
Go to the documentation of this file.
1 #pragma once
2 
9 #include <stdint.h>
10 #include <stdbool.h>
11 
12 #include <windows.h>
13 
21 
27 #define Process_self() GetCurrentProcess()
28 
34 #define Process_self_pid() GetCurrentProcessId()
35 
43 uint32_t Process_get_window_pid(const HWND window);
44 
52 uint32_t Process_get_window_tid(const HWND window);
53 
64 #define Process_open(_pid, _access_rights) OpenProcess(_access_rights, 0, _pid)
65 
71 #define Process_close(_handle) CloseHandle(_handle)
72 
84 const uint8_t* Process_read_mem(HANDLE process, uintptr_t base, uint8_t* buffer, size_t size);
85 
97 bool Process_write_mem(HANDLE process, uintptr_t base, const uint8_t* buffer, size_t size);
98 
111 const wchar_t* Process_get_exe_path(HANDLE process, wchar_t* buffer, size_t size);
112 
const wchar_t * Process_get_exe_path(HANDLE process, wchar_t *buffer, size_t size)
Retrieves full path to process&#39;s binary.
Definition: process.c:29
uint32_t Process_get_window_tid(const HWND window)
Get tid of window.
Definition: process.c:17
uint32_t Process_get_window_pid(const HWND window)
Get pid of window.
Definition: process.c:9
const uint8_t * Process_read_mem(HANDLE process, uintptr_t base, uint8_t *buffer, size_t size)
Reads memory of a process.
Definition: process.c:21
bool Process_write_mem(HANDLE process, uintptr_t base, const uint8_t *buffer, size_t size)
Write into memory of a process.
Definition: process.c:25