Created
August 6, 2024 06:11
-
-
Save VitoVan/afafe558210d68bb503cd16eb22e9b2a to your computer and use it in GitHub Desktop.
fuck_dl_open.c
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
#include <dlfcn.h> | |
#include <stdio.h> | |
int main() { | |
printf("Calling dlopen()..\n"); | |
void* handle = dlopen("lib/libSDL2_image.dylib", RTLD_NOW ); | |
if (handle == NULL) { | |
fprintf(stderr, "Could not open libssl.dylib: %s\n", dlerror()); | |
return 1; | |
} | |
if (dlclose(handle) != 0) { | |
fprintf(stderr, "Could not close libssl.dylib: %s\n", dlerror()); | |
return 1; | |
} | |
printf("Success!\n"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment