The code that performs the interception is in hippomocks.h. It changes the memory protection flags to allow writing to the address of the provided function pointer, and then writes the jump instruction instead of the initial bytes of the function. When the hook is no longer needed, the original bytes are restored. This is the same approach used, for example, in the Microsoft Detours library .
source
share