Skip to content

Instantly share code, notes, and snippets.

@ba0f3
Created June 24, 2015 02:51
Show Gist options
  • Save ba0f3/a972d9acbe4cb785afe3 to your computer and use it in GitHub Desktop.
Save ba0f3/a972d9acbe4cb785afe3 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#include <dlfcn.h>
int main() {
void *handle;
char* (*processSequence)(const char *);
handle = dlopen("../libbogo.so", RTLD_LAZY);
if (!handle) {
printf("Unable to open library: %s\n", dlerror());
return 1;
}
*(void **)(&processSequence) = dlsym(handle, "processSequenceVni");
printf("%s\n", (*processSequence)("To6i ye6u Vie65t Nam"));
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment