2023-02-16 16:01:21 +00:00
|
|
|
/***
|
|
|
|
Copyright (C) 2023 J Reece Wilson (a/k/a "Reece"). All rights reserved.
|
|
|
|
|
|
|
|
File: AuProcAddresses.NT.hpp
|
|
|
|
Date: 2023-2-16
|
|
|
|
Author: Reece
|
|
|
|
***/
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace Aurora
|
|
|
|
{
|
|
|
|
void InitNTAddresses();
|
|
|
|
|
|
|
|
static const wchar_t *kSyncDllName { L"API-MS-Win-Core-Synch-l1-2-0.dll" };
|
|
|
|
static const wchar_t *kNtDllName { L"NTDLL.dll" };
|
|
|
|
static const wchar_t *kKernel32DllName { L"Kernel32.dll" };
|
|
|
|
static const wchar_t *kKernelBaseDllName { L"KernelBase.dll" };
|
|
|
|
|
|
|
|
inline BOOL(_stdcall *pWaitOnAddress)(
|
|
|
|
volatile VOID * Address,
|
|
|
|
PVOID CompareAddress,
|
|
|
|
SIZE_T AddressSize,
|
|
|
|
DWORD dwMilliseconds
|
|
|
|
);
|
|
|
|
|
|
|
|
inline void(_stdcall *pWakeByAddressSingle)(
|
|
|
|
PVOID Address
|
|
|
|
);
|
|
|
|
|
|
|
|
inline void(_stdcall *pWakeByAddressAll)(
|
|
|
|
PVOID Address
|
|
|
|
);
|
|
|
|
|
|
|
|
inline DWORD(_stdcall *pNtDelayExecution)(
|
|
|
|
BOOLEAN Alertable,
|
|
|
|
PLARGE_INTEGER DelayInterval
|
|
|
|
);
|
|
|
|
|
|
|
|
inline PVOID(__stdcall *pVirtualAlloc2)(
|
|
|
|
HANDLE Process,
|
|
|
|
PVOID BaseAddress,
|
|
|
|
SIZE_T Size,
|
|
|
|
ULONG AllocationType,
|
|
|
|
ULONG PageProtection,
|
|
|
|
MEM_EXTENDED_PARAMETER *ExtendedParameters,
|
|
|
|
ULONG ParameterCount
|
|
|
|
);
|
|
|
|
|
|
|
|
inline PVOID(__stdcall *pMapViewOfFile3)(
|
|
|
|
HANDLE FileMapping,
|
|
|
|
HANDLE Process,
|
|
|
|
PVOID BaseAddress,
|
|
|
|
ULONG64 Offset,
|
|
|
|
SIZE_T ViewSize,
|
|
|
|
ULONG AllocationType,
|
|
|
|
ULONG PageProtection,
|
|
|
|
MEM_EXTENDED_PARAMETER *ExtendedParameters,
|
|
|
|
ULONG ParameterCount
|
|
|
|
);
|
|
|
|
|
|
|
|
inline PVOID(__stdcall *pUnmapViewOfFile2)(
|
|
|
|
HANDLE Process,
|
|
|
|
PVOID BaseAddress,
|
|
|
|
ULONG UnmapFlags
|
|
|
|
);
|
|
|
|
|
2023-03-15 00:35:29 +00:00
|
|
|
inline NTSTATUS(__stdcall *pNtWaitForKeyedEvent)(
|
|
|
|
HANDLE Handle,
|
|
|
|
PVOID Key,
|
|
|
|
BOOLEAN Alertable,
|
|
|
|
PLARGE_INTEGER NTTimeout
|
|
|
|
);
|
|
|
|
|
|
|
|
inline NTSTATUS(__stdcall *pNtReleaseKeyedEvent)(
|
|
|
|
HANDLE Handle,
|
|
|
|
PVOID Key,
|
|
|
|
BOOLEAN Alertable,
|
|
|
|
PLARGE_INTEGER NTTimeout
|
|
|
|
);
|
|
|
|
|
|
|
|
inline NTSTATUS(__stdcall *pNtCreateKeyedEvent)(
|
|
|
|
HANDLE Handle,
|
|
|
|
ACCESS_MASK Access,
|
|
|
|
POBJECT_ATTRIBUTES Attr,
|
|
|
|
ULONG Flags
|
|
|
|
);
|
|
|
|
|
|
|
|
inline NTSTATUS(__stdcall *pNtOpenKeyedEvent)(
|
|
|
|
HANDLE Handle,
|
|
|
|
ACCESS_MASK Access,
|
|
|
|
POBJECT_ATTRIBUTES Attr,
|
|
|
|
ULONG Flags
|
|
|
|
);
|
2023-06-15 19:44:27 +00:00
|
|
|
|
|
|
|
inline NTSTATUS(__stdcall *pRtlWaitOnAddress)(
|
|
|
|
const void *addr,
|
|
|
|
const void *cmp,
|
|
|
|
SIZE_T size,
|
|
|
|
const LARGE_INTEGER *timeout);
|
2023-03-15 00:35:29 +00:00
|
|
|
|
2023-02-16 16:01:21 +00:00
|
|
|
#if defined(AURORA_PLATFORM_WIN32)
|
|
|
|
inline NTSTATUS(_stdcall *pRtlGetVersion)(
|
|
|
|
PRTL_OSVERSIONINFOW lpVersionInformation
|
|
|
|
);
|
|
|
|
#endif
|
2023-06-15 19:44:27 +00:00
|
|
|
|
|
|
|
inline bool gUseNativeWaitMutex {};
|
|
|
|
inline bool gUseNativeWaitCondvar {};
|
2023-06-15 23:05:46 +00:00
|
|
|
inline bool gUseNativeWaitSemapahore {};
|
2023-02-16 16:01:21 +00:00
|
|
|
}
|