Skip to content

Instantly share code, notes, and snippets.

@deepredsky
Created March 2, 2017 15:27
Show Gist options
  • Save deepredsky/d3f9b8fc57100181c8fdedc22667c2e9 to your computer and use it in GitHub Desktop.
Save deepredsky/d3f9b8fc57100181c8fdedc22667c2e9 to your computer and use it in GitHub Desktop.
#import <objc/runtime.h>
#import <Foundation/Foundation.h>
int main () {
NSBundle *bundle = [NSBundle bundleWithPath:@"/Applications/Utilities/Keychain Access.app/Contents/Resources/Keychain.menu"];
Class principalClass = [bundle principalClass];
id instance = [[principalClass alloc] init];
[instance performSelector:@selector(_lockScreenMenuHit:) withObject:nil];
return 0;
}
// Compile the source file
// clang -framework Foundation main.m -o lockscreen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment