Skip to content

Commit

Permalink
Ignore return value in HOOK_NATIVE_NOTRAMP since it is always NULL
Browse files Browse the repository at this point in the history
Fixes #79
  • Loading branch information
Mattiwatti committed May 27, 2019
1 parent 2764afe commit 9642f97
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions InjectorCLI/ApplyHooking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 9642f97

Please sign in to comment.