blob: 5dc1514ed124470537b66652368f258db5620a40 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#include <substitute.h>
#include <stdio.h>
#include <assert.h>
#include <dlfcn.h>
int main() {
const char *foundation = "/System/Library/Frameworks/Foundation.framework/Foundation";
dlopen(foundation, RTLD_LAZY);
struct substitute_image *im = substitute_open_image(foundation);
assert(im);
const char *names[] = { "_absolute_from_gregorian" };
int (*f)(int);
assert(!substitute_find_private_syms(im, names, (void **) &f, 1));
assert(f);
assert(f(12345) < 0);
substitute_close_image(im);
}
|