Skip to content

Instantly share code, notes, and snippets.

@jpcima
Created January 13, 2019 00:25
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 jpcima/63ec9f31d64c1a2db89d6c230c2ece66 to your computer and use it in GitHub Desktop.
Save jpcima/63ec9f31d64c1a2db89d6c230c2ece66 to your computer and use it in GitHub Desktop.
Testeur de chargement de greffon
/*
** Construction
gcc -g -o dlopen dlopen.c -ldl
** Utilisation
./dlopen /chemin/fichier.so
*/
#include <dlfcn.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
if (argc != 2)
return 1;
void *dlh = dlopen(argv[1], RTLD_NOW);
if (!dlh)
fprintf(stderr, "error: %s\n", dlerror());
else
printf("OK!\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment