Created
May 19, 2023 14:06
-
-
Save aemmitt-ns/833ba6aeec540a19d66cb8827237f731 to your computer and use it in GitHub Desktop.
program to dump out forbidden classes and selectors in NSPredicates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// dump classes and selectors forbidden in NSPredicates | |
// `cc -framework Foundation -o restricted restricted.m` | |
#import <Foundation/Foundation.h> | |
#import <dlfcn.h> | |
int main() { | |
void *cf = dlopen("/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation", 0); | |
NSDictionary* (*RestrictedClasses)() = dlsym(cf, "_CFPredicatePolicyRestrictedClasses"); | |
NSDictionary* (*RestrictedSelectors)() = dlsym(cf, "_CFPredicatePolicyRestrictedSelectors"); | |
NSLog(@"Restricted Selectors: %@", RestrictedSelectors()); | |
NSLog(@"Restricted Classes: %@", RestrictedClasses()); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment