Closed zonya1 closed 3 years ago
I think MH_DisableHook only changes a pointer in trampoline to point to original function so it should be safe.
MH_DisableHook
just restores the bytes at the beginning on the function, so as @Nucleoprotein said, it's completely safe to call it inside the hooked function.
I need to disable a hook after a certain function has been called, inside the hooked code. So far I have just called MH_DisableHook inside the hook function and there does not seem to be any issues yet but I was wondering if this is a safe way to do it? Should you call it outside the hooked code to ensure there is no crash or other issues, or is this fine?