nanpuhaha

Untitled

Jan 26th, 2019
262
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. %hook NSFileManager
  2. - (BOOL)fileExistsAtPath:(NSString *)path {
  3.     if ([path isEqualToString:@"/Applications/Cydia.app"] ||
  4.         [path isEqualToString:@"/Library/MobileSubstrate/MobileSubstrate.dylib"] ||
  5.         [path isEqualToString:@"/bin/bash"] ||
  6.         [path isEqualToString:@"/usr/sbin/sshd"] ||
  7.         [path isEqualToString:@"/etc/apt"] ||
  8.         [path isEqualToString:@"/private/var/lib/apt/"]) {
  9.         return NO;
  10.     }
  11.  
  12.     return %orig;
  13. }
  14. %end
  15.  
  16. %hook UIApplication
  17. - (BOOL)canOpenURL:(NSURL *)url {
  18.     %log;
  19.     return [[url absoluteString] isEqualToString:@"cydia://package/com.example.package"] ? NO : %orig;
  20. }
  21. %end
  22.  
  23. static FILE * (*orig_fopen) ( const char * filename, const char * mode );
  24. FILE * new_fopen ( const char * filename, const char * mode ) {
  25.     if (strcmp(filename, "/bin/bash") == 0) {
  26.         return NULL;
  27.     }
  28.     return orig_fopen(filename, mode);
  29. }
  30.  
  31. %ctor {
  32.     MSHookFunction((void *)fopen, (void *)new_fopen, (void **)&orig_fopen);
  33. }
RAW Paste Data