diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/zentrack/zentrack.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/zentrack/zentrack.cpp b/src/zentrack/zentrack.cpp index 8bfd822cc..af4d94a08 100644 --- a/src/zentrack/zentrack.cpp +++ b/src/zentrack/zentrack.cpp @@ -3,14 +3,14 @@ #include "zentrack/zentrack.h" #if ZEN_PLATFORM_WINDOWS -#include <zenbase/zenbase.h> -#include <zencore/windows.h> +# include <zenbase/zenbase.h> +# include <zencore/windows.h> -#include <detours/detours.h> +# include <detours/detours.h> -#define ZEN_EXITCODE_INIT_FAILED 20 -#define ZEN_EXITCODE_HOOKS_FAILED 21 -#define ZEN_EXITCODE_PAYLOAD_FAILED 22 +# define ZEN_EXITCODE_INIT_FAILED 20 +# define ZEN_EXITCODE_HOOKS_FAILED 21 +# define ZEN_EXITCODE_PAYLOAD_FAILED 22 __declspec(dllexport) void dummy() // we need at least one export in order for detours to be happy { @@ -18,12 +18,12 @@ __declspec(dllexport) void dummy() // we need at least one export in order for d ////////////////////////////////////////////////////////////////////////// -#define DETOURED_FUNCTIONS_KERNELBASE \ - DETOURED_FUNCTION(VirtualAlloc) \ - DETOURED_FUNCTION(VirtualFree) \ - DETOURED_FUNCTION(Sleep) +# define DETOURED_FUNCTIONS_KERNELBASE \ + DETOURED_FUNCTION(VirtualAlloc) \ + DETOURED_FUNCTION(VirtualFree) \ + DETOURED_FUNCTION(Sleep) -#define DETOURED_FUNCTIONS DETOURED_FUNCTIONS_KERNELBASE +# define DETOURED_FUNCTIONS DETOURED_FUNCTIONS_KERNELBASE ////////////////////////////////////////////////////////////////////////// @@ -35,11 +35,11 @@ TerminateCurrentProcess(uint32_t ExitCode) TerminateProcess(GetCurrentProcess(), ExitCode); } -#define DETOURED_FUNCTION(func) \ - using Symbol_##func = decltype(func); \ - Symbol_##func* Real_##func; +# define DETOURED_FUNCTION(func) \ + using Symbol_##func = decltype(func); \ + Symbol_##func* Real_##func; DETOURED_FUNCTIONS -#undef DETOURED_FUNCTION +# undef DETOURED_FUNCTION BOOL Hooked_VirtualFree(LPVOID lpAddress, SIZE_T dwSize, DWORD dwFreeType) @@ -90,18 +90,18 @@ HookFunctions() { // First grab the original pre-hook function pointers -#define DETOURED_FUNCTION(FuncName) Real_##FuncName = (decltype(Real_##FuncName))GetProcAddress(hModule, #FuncName); +# define DETOURED_FUNCTION(FuncName) Real_##FuncName = (decltype(Real_##FuncName))GetProcAddress(hModule, # FuncName); if (HMODULE hModule = GetModuleHandleW(L"kernelbase.dll")) { DETOURED_FUNCTIONS_KERNELBASE } -#undef DETOURED_FUNCTION +# undef DETOURED_FUNCTION // Then install our hooks -#define DETOURED_FUNCTION(Func) HookFunction((PVOID*)&Real_##Func, Hooked_##Func, #Func); +# define DETOURED_FUNCTION(Func) HookFunction((PVOID*)&Real_##Func, Hooked_##Func, # Func); DETOURED_FUNCTIONS } |