Created
September 7, 2019 08:27
-
-
Save julepka/de2c9094118d47112e22dc7761579e3b to your computer and use it in GitHub Desktop.
Cycript Detection
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; | |
} | |
} | |
} | |
BOOL hasLibcycript() { | |
int max = _dyld_image_count(); | |
for (int i = 0; i < max; i++) { | |
const char *name = _dyld_get_image_name(i); | |
const char needle[11] = "libcycript"; | |
if ((ret = strstr(name, needle)) != NULL) return YES; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment