diff options
Diffstat (limited to 'client/src/util')
| -rw-r--r-- | client/src/util/native.h | 1 | ||||
| -rw-r--r-- | client/src/util/syscalls.cpp | 10 | ||||
| -rw-r--r-- | client/src/util/syscalls.h | 2 |
3 files changed, 8 insertions, 5 deletions
diff --git a/client/src/util/native.h b/client/src/util/native.h index 31348ee..b5b0768 100644 --- a/client/src/util/native.h +++ b/client/src/util/native.h @@ -168,6 +168,5 @@ namespace native { using NtQueryInformationProcess = NTSTATUS(__stdcall*)(HANDLE, PROCESSINFOCLASS, PVOID, SIZE_T, PULONG); using NtWaitForSingleObject = NTSTATUS(__stdcall*)(HANDLE, BOOLEAN, PLARGE_INTEGER); using NtCreateThreadEx = NTSTATUS(__stdcall*)(PHANDLE, ACCESS_MASK, PVOID, HANDLE, LPTHREAD_START_ROUTINE, PVOID, ULONG, ULONG_PTR, SIZE_T, SIZE_T, PVOID); - using NtGetContextThread = NTSTATUS(__stdcall*)(HANDLE, PCONTEXT); }; // namespace native
\ No newline at end of file diff --git a/client/src/util/syscalls.cpp b/client/src/util/syscalls.cpp index a755d22..7de7c81 100644 --- a/client/src/util/syscalls.cpp +++ b/client/src/util/syscalls.cpp @@ -8,7 +8,13 @@ syscalls g_syscalls; syscalls::syscalls() { m_call_table = VirtualAlloc(0, 0x100000, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE); std::memset(m_call_table, 0x90, 0x100000); +} + +syscalls::~syscalls() { + VirtualFree(m_call_table, 0, MEM_RELEASE); +} +void syscalls::init() { io::log("syscalls call table : {:x}", uintptr_t(m_call_table)); static auto nt = pe::ntdll(); @@ -42,10 +48,6 @@ syscalls::syscalls() { } } -syscalls::~syscalls() { - VirtualFree(m_call_table, 0, MEM_RELEASE); -} - bool syscalls::valid(const uintptr_t addr, const size_t& size) { auto func = reinterpret_cast<uint8_t*>(addr); diff --git a/client/src/util/syscalls.h b/client/src/util/syscalls.h index 0855d18..ef3bfad 100644 --- a/client/src/util/syscalls.h +++ b/client/src/util/syscalls.h @@ -8,6 +8,8 @@ class syscalls { 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); |