From 9642f9737e76b4ffe1b934b5adb37a6a74b4bbfb Mon Sep 17 00:00:00 2001 From: Mattiwatti Date: Mon, 27 May 2019 11:17:21 +0200 Subject: [PATCH] Ignore return value in HOOK_NATIVE_NOTRAMP since it is always NULL Fixes #79 --- InjectorCLI/ApplyHooking.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/InjectorCLI/ApplyHooking.cpp b/InjectorCLI/ApplyHooking.cpp index 1097c4f0..3c8fef25 100644 --- a/InjectorCLI/ApplyHooking.cpp +++ b/InjectorCLI/ApplyHooking.cpp @@ -13,9 +13,7 @@ #define HOOK_NATIVE(name) { \ hdd->d##name = (t_##name)DetourCreateRemoteNative(hProcess, "" STR(name) "", (void*)_##name, Hooked##name, true, &hdd->name##BackupSize); \ if (hdd->d##name == nullptr) { return false; } } -#define HOOK_NATIVE_NOTRAMP(name) { \ - void* p = DetourCreateRemoteNative(hProcess, "" STR(name) "", (void*)_##name, Hooked##name, false, &hdd->name##BackupSize); \ - if (p == nullptr) { return false; } } +#define HOOK_NATIVE_NOTRAMP(name) DetourCreateRemoteNative(hProcess, "" STR(name) "", (void*)_##name, Hooked##name, false, &hdd->name##BackupSize) #define FREE_HOOK(name) FreeMemory(hProcess, (void*)hdd->d##name); hdd->d##name = 0 #define RESTORE_JMP(name) RestoreJumper(hProcess, (void*)_##name, (void*)hdd->d##name, hdd->name##BackupSize)