diff options
author | comex | 2015-02-28 21:54:23 -0500 |
---|---|---|
committer | comex | 2015-02-28 21:54:23 -0500 |
commit | a976efe67c5f936eb553a0d61b78a311da7224d9 (patch) | |
tree | 759de2adb9ad10a80b0373b5dbefdacbc04c9c18 /lib/darwin/interpose.c | |
parent | fix accidental usage of panic() from mach/mach.h instead of substitute_panic (diff) | |
download | substitute-a976efe67c5f936eb553a0d61b78a311da7224d9.tar.gz |
Add extra argument to substitute_hook_functions and interpose_imports for use with unhooking.
I think we'll need to explicitly record trampoline locations to avoid
the possibility of stomping on someone else's stuff if the function was
re-patched...
Also, document substitute_hook_functions.
Diffstat (limited to 'lib/darwin/interpose.c')
-rw-r--r-- | lib/darwin/interpose.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/darwin/interpose.c b/lib/darwin/interpose.c index dd267ac..c74f747 100644 --- a/lib/darwin/interpose.c +++ b/lib/darwin/interpose.c @@ -147,12 +147,17 @@ static void *off_to_addr(const struct interpose_state *st, uint32_t off) { EXPORT int substitute_interpose_imports(const struct substitute_image *image, const struct substitute_import_hook *hooks, - size_t nhooks, int options) { + size_t nhooks, + struct substitute_import_hook_record **recordp, + int options) { int ret = SUBSTITUTE_OK; if (options != 0) substitute_panic("%s: unrecognized options\n", __func__); + if (recordp) + *recordp = NULL; + struct interpose_state st; st.slide = image->slide; st.nsegments = 0; |