Skip to content

Instantly share code, notes, and snippets.

@adammw
Created September 1, 2015 03:09
Show Gist options
  • Save adammw/41997c4a4c16b91b73a1 to your computer and use it in GitHub Desktop.
Save adammw/41997c4a4c16b91b73a1 to your computer and use it in GitHub Desktop.
clang -framework Foundation -o lockscreen lockscreen.m
#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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment