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
// Generating private key in Secure Enclave | |
let access = SecAccessControlCreateWithFlags(kCFAllocatorDefault, | |
kSecAttrAccessibleWhenUnlockedThisDeviceOnly, | |
.privateKeyUsage, | |
nil)! | |
let attributes: [String: Any] = [kSecAttrKeyType as String: kSecAttrKeyTypeEC, | |
kSecAttrKeySizeInBits as String: 256, | |
kSecAttrTokenID as String: kSecAttrTokenIDSecureEnclave, | |
kSecPrivateKeyAttrs as String: [ kSecAttrIsPermanent as String: true, | |
kSecAttrAccessControl as String: access, |
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
// https://stackoverflow.com/questions/34131835/detect-if-cycript-substrate-or-gdb-is-attached-to-an-ios-apps-process | |
BOOL hasCynject() { | |
int max = _dyld_image_count(); | |
for (int i = 0; i < max; i++) { | |
const char *name = _dyld_get_image_name(i); | |
if (name != NULL) { | |
if (strstr(name, "cynject") == 0) return YES; | |
} | |
} |