Created
August 7, 2015 21:55
-
-
Save SamRothCA/16d47b98f171385b3e54 to your computer and use it in GitHub Desktop.
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
NSString * passwordString = @"b"; | |
NSString * mountPoint = @"/a"; | |
NSTask * veraCrypt = [[NSTask alloc] init]; | |
[veraCrypt setLaunchPath:@"/Applications/VeraCrypt.app/Contents/MacOS/VeraCrypt"]; | |
[veraCrypt setArguments:@[@"-t", @"--mount", mountPoint]]; | |
NSPipe * inputPipe = [NSPipe pipe]; | |
[veraCrypt setStandardInput:inputPipe]; | |
NSString * inputString = [NSString stringWithFormat:@"\n%@\n\n\n", passwordString]; | |
NSData * inputData = [inputString dataUsingEncoding:[NSString defaultCStringEncoding]]; | |
[[inputPipe fileHandleForWriting] writeData:inputData]; | |
[veraCrypt launch]; | |
[veraCrypt waitUntilExit]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment