https://github.com/antibioticss/tinyhook
A tiny hook framework for macOS/iOS, inlcuded inline hook, objc runtime hook, symbol resolver..
https://github.com/antibioticss/tinyhook
function-hooking hook-framework hooks inline-hook macos
Last synced: 5 days ago
JSON representation
A tiny hook framework for macOS/iOS, inlcuded inline hook, objc runtime hook, symbol resolver..
- Host: GitHub
- URL: https://github.com/antibioticss/tinyhook
- Owner: Antibioticss
- License: mit
- Created: 2024-08-11T07:19:22.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2026-01-18T08:56:00.000Z (9 days ago)
- Last Synced: 2026-01-18T17:26:00.066Z (8 days ago)
- Topics: function-hooking, hook-framework, hooks, inline-hook, macos
- Language: C
- Homepage: https://antibioticss.github.io/tinyhook/
- Size: 113 KB
- Stars: 110
- Watchers: 4
- Forks: 25
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# tinyhook
> A minimalist hook framework for macOS/iOS, built for speed and size
## Features
- inline hook
- symbol interposing
- symbol resolving
- objc runtime hook
## Building
Build tinyhook yourself or download pre-built binaries from [Releases](https://github.com/Antibioticss/tinyhook/releases)
Nightly builds are available from [Actions](https://github.com/Antibioticss/tinyhook/actions)
### Build with `make`
```bash
make
```
Available targets:
- `static` (default) build static library
- `shared` build shared library
- `all` build both static and shared libraries
- `test` run tinyhook tests
Available variables:
- `ARCH` the arch to build: `arm64`, `arm64e`, `x86_64`
- `TARGET` targeting os: `macosx`(default), `iphoneos`
- `MIN_OSVER` minimum os version requirement
- `DEBUG` generate debug infomation
- `COMPACT` no error log output (not recommended!)
- `NO_EXPORT` hide all symbols (don't use this for dynamic library)
For example, building shared library for iOS 18.0+ `arm64e` binary with `DEBUG` enabled
```bash
make shared ARCH=arm64e TARGET=iphoneos MIN_OSVER=18.0 DEBUG=1
```
### Use `build.sh`
`build.sh` can be used to build universal FAT binaries (i.e. a single binary with multiple arches)
```
arguments:
-a add an arch to build
-t specify target system, macosx(default) or iphoneos
-v specify minimum system version
-c build compact version
-n don't export symbols
```
For example, the below commands are used to build binaries for releasing
```bash
./build.sh -t macosx -v 10.15
./build.sh -t iphoneos -v 12.0
```
Output binaries will be in `build/universal`
## Documentation
Served on GitHub Pages: https://antibioticss.github.io/tinyhook/
## Example
Source code of the examples: [tinyhook/test](https://github.com/Antibioticss/tinyhook/tree/main/test)
## References
Thanks to these projects for their inspiring idea and code!
-
-
-