use exact address for hooking

Before I tried to hook the entry in my iat, which obviously leads to various
dumb failures...
This commit is contained in:
2018-01-08 18:42:35 +01:00
parent bce85be82e
commit f1ec585409
6 changed files with 72 additions and 27 deletions

View File

@@ -62,15 +62,15 @@ uint32_t PolyHook_Hooks::hookTail_recursion(uint32_t x) {
}
bool PolyHook::hook_all(void) {
bool ret = hook<decltype(&_small)>(detSmall, &_small, trueSmall, &PolyHook_Hooks::hookSmall);
ret |= hook<decltype(&_branch)>(detBranch, &_branch, trueBranch, &PolyHook_Hooks::hookBranch);
ret |= hook<decltype(&_rip_relative)>(detRIPRelative, &_rip_relative, trueRip_Relative, &PolyHook_Hooks::hookRip_relative);
bool ret = hook<decltype(&_small)>(detSmall, getSmall(), trueSmall, &PolyHook_Hooks::hookSmall);
ret |= hook<decltype(&_branch)>(detBranch, getBranch(), trueBranch, &PolyHook_Hooks::hookBranch);
ret |= hook<decltype(&_rip_relative)>(detRIPRelative, getRipRelative(), trueRip_Relative, &PolyHook_Hooks::hookRip_relative);
ret |= hook<decltype(&_AVX)>(detAVX, &_AVX, trueAVX, &PolyHook_Hooks::hookAVX);
ret |= hook<decltype(&_RDRAND)>(detRDRAND, &_RDRAND, trueRDRAND, &PolyHook_Hooks::hookRDRAND);
ret |= hook<decltype(&_AVX)>(detAVX, getAVX(), trueAVX, &PolyHook_Hooks::hookAVX);
ret |= hook<decltype(&_RDRAND)>(detRDRAND, getRDRAND(), trueRDRAND, &PolyHook_Hooks::hookRDRAND);
ret |= hook<decltype(&_loop)>(detLoop, &_loop, trueLoop, &PolyHook_Hooks::hookLoop);
ret |= hook<decltype(&_tail_recursion)>(detTailRecursion, &_tail_recursion, trueTailRecursion, &PolyHook_Hooks::hookTail_recursion);
ret |= hook<decltype(&_loop)>(detLoop, getLoop(), trueLoop, &PolyHook_Hooks::hookLoop);
ret |= hook<decltype(&_tail_recursion)>(detTailRecursion, getTailRecursion(), trueTailRecursion, &PolyHook_Hooks::hookTail_recursion);
return ret;
}