diff options
| author | auth12 <[email protected]> | 2020-07-20 03:09:25 -0700 |
|---|---|---|
| committer | auth12 <[email protected]> | 2020-07-20 03:09:25 -0700 |
| commit | c9e48c5e9eddfe5b7a895fb3940c41ccf75d3e93 (patch) | |
| tree | 2b04471e76f7fb31aff0151b978ece9af4410a8b /client/src/util/syscalls.h | |
| parent | Merge pull request #1 from auth12/windows (diff) | |
| download | loader-c9e48c5e9eddfe5b7a895fb3940c41ccf75d3e93.tar.xz loader-c9e48c5e9eddfe5b7a895fb3940c41ccf75d3e93.zip | |
Syscalls.
Removed asmjit submodule and embedded it instead.
Small PE wrapper.
Diffstat (limited to 'client/src/util/syscalls.h')
| -rw-r--r-- | client/src/util/syscalls.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/client/src/util/syscalls.h b/client/src/util/syscalls.h new file mode 100644 index 0000000..0d73e4e --- /dev/null +++ b/client/src/util/syscalls.h @@ -0,0 +1,22 @@ +#pragma once + +class syscalls { + std::unordered_map<std::string, std::pair<uint16_t, uint16_t>> m_indexes; + std::vector<char> m_stub; + + void *m_call_table; +public: + syscalls(); + ~syscalls(); + void init(); + bool valid(const uintptr_t func, const size_t &size); + uint16_t get_index(const uintptr_t va, uint16_t &offset); + size_t func_size(const uint8_t *func); + + template<class T> + T get(const std::string_view func) { + return reinterpret_cast<T>(uintptr_t(m_call_table) + (m_indexes[func.data()].first * m_stub.size())); + }; +}; + +extern syscalls g_syscalls;
\ No newline at end of file |