A minimalist hook framework for macOS/iOS, built for speed and size
- inline hook
- symbol interposing
- symbol resolving
- objc runtime hook
Build tinyhook yourself or download pre-built binaries from Releases
Nightly builds are available from Actions
makeAvailable targets:
static(default) build static librarysharedbuild shared libraryallbuild both static and shared librariestestrun tinyhook tests
Available variables:
ARCHthe arch to build:arm64,arm64e,x86_64TARGETtargeting os:macosx(default),iphoneosMIN_OSVERminimum os version requirementDEBUGgenerate debug infomationCOMPACTno error log output (not recommended!)
For example, building shared library for iOS 18.0+ arm64e binary with DEBUG enabled
make shared ARCH=arm64e TARGET=iphoneos MIN_OSVER=18.0 DEBUG=1build.sh can be used to build universal FAT binaries (i.e. a single binary with multiple arches)
arguments:
-a <arch> add an arch to build
-t <target> specify target system, macosx(default) or iphoneos
-v <version> specify minimum system version
-c build compact version
For example, the below commands are used to build binaries for releasing
./build.sh -t macosx -v 10.15
./build.sh -t iphoneos -v 12.0Output binaries will be in build/universal
Served on GitHub Pages: https://antibioticss.github.io/tinyhook/
Source code of the examples: tinyhook/test
Thanks to these projects for their inspiring idea and code!