Last active
October 3, 2016 18:14
-
-
Save cartazio/d2cb3b79eb28444b1d6a405bc0943d80 to your computer and use it in GitHub Desktop.
dylib testing codes; dltest.c takes a single argument thats a file path to a dylib.
This file contains hidden or 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
#! /bin/bash | |
for x in {1..256}; do install_name_tool -add_rpath /$(printf '%127.127d' $x) $targetfile; done | |
# note .. need to replace $targetfile with either the first cli arge variable or a concrete file for this to not be | |
# terrible |
This file contains hidden or 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(int argc, char *argv[]) | |
{ | |
if (dlopen(argv[1], RTLD_NOW | RTLD_GLOBAL) == NULL) { | |
printf("%s\n", dlerror()); | |
return 1; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment