This project is still under development
A simple and easy-to-use static inline hook framework for jailed iOS devices and macOS
- Call
stick_init()once in your hook library - Use
stick_hookorstick_replaceto declare hooks - After compiling, use
stickprepto install static patches into the target binary
int stick_init(void);Returns 0 on success.
void stick_hook(char *image_name, uint64_t vmaddr, void *replacement, void **originptr);
stick_hookis implemented as a C macro, this declaration is for reference only
Declare a function hook, and save original function
image_name— file name of the target binaryvmaddr— virtual memory address of the function to hook within the imagereplacement— the replacement functionoriginptr— pointer to store the original function
Note: hooks for the same image must be declared consecutively
void stick_replace(char *image_name, uint64_t vmaddr, void *replacement);Same as above, but does not save original function
stickprep <library> <target>the filename of
targetmust matchimage_namespecified in thelibrary
Patch static hooks into target and update runtime metadata in library.
If library has hooks for multiple binaries, stickprep must be run once for each target binary.
Note: stickprep modifies both library and target. Do not run it more than once on the same binary.
See the test directory for a working example.