Skip to content

Instantly share code, notes, and snippets.

@timb-machine
Created September 4, 2017 03:24
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 timb-machine/e9d0150a13e8a86732a1bdba58f7d788 to your computer and use it in GitHub Desktop.
Save timb-machine/e9d0150a13e8a86732a1bdba58f7d788 to your computer and use it in GitHub Desktop.
sorun.c
#include <dlfcn.h>
#include <stdio.h>
int main(int argc, char **argv) {
void *libraryhandle;
int (*functionpointer)(void *, void *, void *, void *, void *, void *, void *, void *, void *);
int functionresult;
libraryhandle = dlopen(argv[1], RTLD_NOW);
functionpointer = dlsym(libraryhandle, argv[2]);
functionresult = functionpointer(argv[3] ? argv[3] : NULL, argv[4] ? argv[4] : NULL, argv[5] ? argv[5] : NULL, argv[6] ? argv[6] : NULL, argv[7] ? argv[7] : NULL, argv[8] ? argv[8] : NULL, argv[9] ? argv[9] : NULL, argv[10] ? argv[10] : NULL, argv[11] ? argv[11] : NULL);
dlclose(libraryhandle);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment