Skip to content

enhancement: add undo for hooks and detours #10

@gynt

Description

@gynt

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:

  1. read hookSize bytes from the new function address. These are the original bytes.
  2. copy these bytes into the original function at originalFunctionAddress. Effectively removing the jump.
  3. deallocate the new function address.
  4. dereference (lua_unref) the lua hook/detour function.

The interface would be:

rps.unhookCode(address)
rps.undetourCode(address)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions