diff options
author | comex | 2015-01-10 16:04:32 -0500 |
---|---|---|
committer | comex | 2015-01-10 16:04:32 -0500 |
commit | 19a538132d5f5d1a13b51bb7e909f525da791220 (patch) | |
tree | 8523033f1366c0a9754593bc0505360a7bf22c18 /test/test-find-syms.c | |
parent | simplify (diff) | |
download | substitute-19a538132d5f5d1a13b51bb7e909f525da791220.tar.gz |
private syms starting to look good
Diffstat (limited to 'test/test-find-syms.c')
-rw-r--r-- | test/test-find-syms.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/test/test-find-syms.c b/test/test-find-syms.c index 0ad033d..6a8d600 100644 --- a/test/test-find-syms.c +++ b/test/test-find-syms.c @@ -6,8 +6,15 @@ int main() { const char *foundation = "/System/Library/Frameworks/Foundation.framework/Foundation"; dlopen(foundation, RTLD_LAZY); - const char *names[] = { "_setshortValueWithMethod" }; + struct substitute_image *im = substitute_open_image(foundation); + assert(im); + const char *names[] = { "_absolute_from_gregorian" }; substitute_sym *syms[1]; - assert(!substitute_find_syms(foundation, names, syms, 1)); - printf("%p\n", syms[0]); + assert(!substitute_find_private_syms(im, names, syms, 1)); + assert(syms[0]); + + int (*f)(int) = substitute_sym_to_ptr(im, syms[0]); + assert(f(12345) < 0); + + substitute_close_image(im); } |