From c9e48c5e9eddfe5b7a895fb3940c41ccf75d3e93 Mon Sep 17 00:00:00 2001 From: auth12 <67507608+auth12@users.noreply.github.com> Date: Mon, 20 Jul 2020 03:09:25 -0700 Subject: Syscalls. Removed asmjit submodule and embedded it instead. Small PE wrapper. --- client/src/util/syscalls.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 client/src/util/syscalls.h (limited to 'client/src/util/syscalls.h') 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> m_indexes; + std::vector 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 + T get(const std::string_view func) { + return reinterpret_cast(uintptr_t(m_call_table) + (m_indexes[func.data()].first * m_stub.size())); + }; +}; + +extern syscalls g_syscalls; \ No newline at end of file -- cgit v1.2.3