Update README.md

arm
_xeroxz 3 years ago
parent 3812efdd3d
commit b127702604

@ -6,19 +6,27 @@ A c++ header only library for inline hooking. Supports x86_64, x86, and arm. Sma
Installing the hook/Init.
```cpp
hook::make_hook(
&WriteFile, //address to put inline hook at.
&HookWriteFile //address to jmp too.
);
__attribute__((noinline)) // very important that this is not inline!
FILE* hook_test(const char* filename, const char* open_type)
{
std::printf("> filename = %s\n", filename);
std::printf("> open type = %s\n", open_type);
std::getchar();
return hook::get_func(&fopen)(filename, open_type);
}
hook::make_hook(&fopen, &hook_test);
```
Disabling the hook so you can call the original function.
```cpp
hook::disable(&WriteFile);
WriteFile(.....)
### Disable Hook
```
hook::disable(&fopen);
```
### Enable Hook
Enabling the hook.
```
hook::enable(&WriteFile);
hook::enable(&fopen);
```
Loading…
Cancel
Save