Skip to content

Instantly share code, notes, and snippets.

@julepka
Created September 7, 2019 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save julepka/de2c9094118d47112e22dc7761579e3b to your computer and use it in GitHub Desktop.
Save julepka/de2c9094118d47112e22dc7761579e3b to your computer and use it in GitHub Desktop.
Cycript Detection
// 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