From a976efe67c5f936eb553a0d61b78a311da7224d9 Mon Sep 17 00:00:00 2001 From: comex Date: Sat, 28 Feb 2015 21:54:23 -0500 Subject: 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. --- test/test-hook-functions.c | 3 ++- test/test-interpose.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/test-hook-functions.c b/test/test-hook-functions.c index 7978658..d5ed4d8 100644 --- a/test/test-hook-functions.c +++ b/test/test-hook-functions.c @@ -58,7 +58,8 @@ int main() { } printf("getpid() => %d\n", getpid()); break_before(); - int ret = substitute_hook_functions(hooks, sizeof(hooks)/sizeof(*hooks), 0); + int ret = substitute_hook_functions(hooks, sizeof(hooks)/sizeof(*hooks), + NULL, 0); break_after(); int e = errno; printf("ret = %d\n", ret); diff --git a/test/test-interpose.c b/test/test-interpose.c index ea28abb..28e9f3b 100644 --- a/test/test-interpose.c +++ b/test/test-interpose.c @@ -26,7 +26,7 @@ int main() { }; pid_t (*gp)() = getpid_plus - 5; printf("original pid: %d\n", (int) gp()); - substitute_interpose_imports(handle, hooks, sizeof(hooks)/sizeof(*hooks), 0); + substitute_interpose_imports(handle, hooks, sizeof(hooks)/sizeof(*hooks), NULL, 0); gp = getpid_plus - 5; printf("new pid: %d\n", (int) gp()); printf("new gid: %d\n", (int) getgid()); -- cgit v1.2.3