diff options
| author | auth12 <[email protected]> | 2020-07-22 08:37:58 -0700 |
|---|---|---|
| committer | auth12 <[email protected]> | 2020-07-22 08:37:58 -0700 |
| commit | 7caedef9a8c343b63cef6e971f4f87660520bb82 (patch) | |
| tree | 66477c42a768bf5efb1177130347170c62f6cb60 /client/src/injection/process.h | |
| parent | Added game selection. (diff) | |
| download | loader-7caedef9a8c343b63cef6e971f4f87660520bb82.tar.xz loader-7caedef9a8c343b63cef6e971f4f87660520bb82.zip | |
Client injection.
Process class implementation.
Diffstat (limited to 'client/src/injection/process.h')
| -rw-r--r-- | client/src/injection/process.h | 54 |
1 files changed, 37 insertions, 17 deletions
diff --git a/client/src/injection/process.h b/client/src/injection/process.h index 574713a..ddbadf5 100644 --- a/client/src/injection/process.h +++ b/client/src/injection/process.h @@ -1,19 +1,39 @@ #pragma once -class process { - int m_id; - std::string m_name; - - HANDLE m_handle = INVALID_HANDLE_VALUE; -public: - process() = default; - process(const SYSTEM_PROCESS_INFORMATION* info); - ~process(); - - bool open(); - bool read(const uintptr_t addr, void* data, const size_t size); - bool write(const uintptr_t addr, void* data, const size_t size); - - auto &get_name() { return m_name; } - auto &get_id() { return m_id; } -};
\ No newline at end of file +namespace util { + class process { + int m_id; + std::string m_name; + std::unordered_map<std::string, uintptr_t> m_modules; + + HANDLE m_handle; + public: + process() : m_handle{ INVALID_HANDLE_VALUE } {}; + process(const SYSTEM_PROCESS_INFORMATION* info); + ~process(); + + bool open(); + bool read(const uintptr_t addr, void* data, size_t size); + bool write(const uintptr_t addr, void* data, size_t size); + bool free(const uintptr_t addr, size_t size); + bool thread(const uintptr_t start); + bool enum_modules(); + + uintptr_t peb(); + uintptr_t load(const std::string_view mod); + uintptr_t allocate(size_t size, uint32_t type, uint32_t protection); + uintptr_t module_export(const std::string_view name, const std::string_view func); + + bool close(); + + operator bool() const { return m_handle != INVALID_HANDLE_VALUE; } + + auto& name() { return m_name; } + auto& id() { return m_id; } + auto& handle() { return m_handle; } + }; + + extern std::vector<process> process_list; + + bool fetch_processes(); +}; |