Skip to content

Instantly share code, notes, and snippets.

@Temptationx
Last active December 26, 2015 14:59
Show Gist options
  • Save Temptationx/7170016 to your computer and use it in GitHub Desktop.
Save Temptationx/7170016 to your computer and use it in GitHub Desktop.
dlopen, dlsym
#include <stdio.h>
#include <dlfcn.h>
void ppp()
{
}
int main(int argc, const char * argv[])
{
void *h = dlopen(NULL, RTLD_NOW);
printf("%p\n",h);
printf("ppp:%p\n",ppp);
printf("search:%p\n",dlsym(RTLD_DEFAULT, "ppp"));
printf("dlopen(null):%p\n",dlsym(h, "ppp"));
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment