Skip to content

Instantly share code, notes, and snippets.

@tyilo
Last active December 17, 2015 09:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tyilo/5587181 to your computer and use it in GitHub Desktop.
Save tyilo/5587181 to your computer and use it in GitHub Desktop.
int main(void) {
// Signature of setState
void (*setState)(BOOL);
void *handle = dlopen("/path/to/lib.dylib", RTLD_LAZY);
*(void **) (&setState) = dlsym(handle, "setState");
// To enable
setState(YES);
// To disable
setState(NO);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment