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.74 KB | None | 0 0
  1. //Loading the dylib
  2.  
  3. -(void)load {
  4. //handle = dlopen([[NSString stringWithFormat:@"%@/Facebook.dylib", pluginPath] UTF8String], RTLD_LAZY);
  5. handle = dlopen("Facebook.dylib", RTLD_LAZY);
  6. void *load = dlsym(handle, "post");
  7. load != NULL && ((BOOL (*) (void)) load)();
  8. if (load != NULL)
  9. NSLog(@"Not NULL");
  10. else
  11. NSLog(@"Load is NULL");
  12. dlclose(handle);
  13. }
  14.  
  15. //This is the dylib that should be loaded. (Facebook.dylib)
  16.  
  17. BOOL post () {
  18. NSLog(@"Dylib function called!");
  19. UIAlertView *error = [[UIAlertView alloc] initWithTitle:@"Alert" message:@"It worked!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles: nil];
  20. [error show];
  21. [error release];
  22. return YES;
  23. }
Add Comment
Please, Sign In to add comment