Library:Dobby
| Platforms | Windows, macOS, iOS, Android, Linux |
|---|---|
| License | Apache-2.0 |
| Website | https://github.com/jmpews/Dobby |
| On this wiki | Facts · Code · Notes · Topics |
Dobby (Apache-2.0) is a multi-platform inline-hook and instrumentation library for x86, x86-64, ARM and ARM64 on Windows, macOS, iOS, Android and Linux, with an instruction relocator and several trampoline shapes.
Public API (include/dobby.h): DobbyHook(address, fake_func, &origin_func), DobbyInstrument(address, pre_handler) (handler receives a DobbyRegisterContext), DobbyDestroy(address), DobbySymbolResolver(image, symbol), DobbyImportTableReplace(image, symbol, fake, &orig). On ARM64 the context holds sp, x0-x28, fp, lr and the q registers.
Layout of the source: source/InstructionRelocation/{arm,arm64,x64,x86}, source/InterceptRouting/NearBranchTrampoline, source/TrampolineBridge, builtin-plugin/ (ImportTableReplace, SymbolResolver, ObjcRuntimeReplace, BionicLinkerUtil, SupervisorCallMonitor, ApplicationEventMonitor). README credits frida-gum, MinHook, substrate, v8, dart and vixl.
ARM64 trampoline choice (trampoline_arm64.cc, near_trampoline_arm64.cc): if the detour is within the adrp range it writes adrp+add+br on a temporary register; otherwise ldr x?, #literal; br x? followed by the 8-byte target. The near variant is a single b when within +-128 MiB, else a b to a forward trampoline allocated near the source. The relocator (InstructionRelocationARM64.cc) has cases for b/bl, ldr literal, adr, adrp, b.cond, cbz/cbnz and tbz/tbnz.
See Technique:Function hooking/Unix and mobile, Library:MinHook.
Code & repositories
- https://github.com/jmpews/Dobby
- https://github.com/jmpews/Dobby @
5dfc8546954ce3b3198132ab13fddb89ee92cdd7· license: Apache-2.0
Dobby: inline hook framework; ARM64 trampolines and instruction relocation.
Tested on: source read, not run: source read, not run · checked 2026-10-18; last activity 2025-01-26