Skip to content

Instantly share code, notes, and snippets.

@VitoVan
Created August 6, 2024 06:11
Show Gist options
  • Save VitoVan/afafe558210d68bb503cd16eb22e9b2a to your computer and use it in GitHub Desktop.
Save VitoVan/afafe558210d68bb503cd16eb22e9b2a to your computer and use it in GitHub Desktop.
fuck_dl_open.c
#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