It could be useful to undo detours and hooka. Currently there is no interface for that yet.
The undo for detours and hooks is identical:
- read
hookSize bytes from the new function address. These are the original bytes.
- copy these bytes into the original function at
originalFunctionAddress. Effectively removing the jump.
- deallocate the new function address.
- dereference (lua_unref) the lua hook/detour function.
The interface would be:
rps.unhookCode(address)
rps.undetourCode(address)