Created
January 13, 2019 00:25
-
-
Save jpcima/63ec9f31d64c1a2db89d6c230c2ece66 to your computer and use it in GitHub Desktop.
Testeur de chargement de greffon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
** 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