Guest User

Untitled

a guest
Jan 15th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. -(void)load {
  2. //handle = dlopen([[NSString stringWithFormat:@"%@/Facebook.dylib", pluginPath] UTF8String], RTLD_LAZY);
  3. handle = dlopen("/usr/lib/Facebook.dylib", RTLD_LAZY);
  4. void *load = dlsym(handle, "post");
  5. load != NULL && ((BOOL (*) (void)) load)();
  6. if (load != NULL)
  7. NSLog(@"Not NULL");
  8. else
  9. NSLog(@"Load is NULL");
  10. dlclose(handle);
  11. }
  12.  
  13. //This is the dylib that should be loaded. (Facebook.dylib)
  14.  
  15. BOOL post () {
  16. NSLog(@"Dylib function called!");
  17. UIAlertView *error = [[UIAlertView alloc] initWithTitle:@"Alert" message:@"It worked!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];
  18. [error show];
  19. [error release];
  20. return YES;
  21. }
Add Comment
Please, Sign In to add comment