Skip to content

Commit

Permalink
Removed debugger attachment prevention
Browse files Browse the repository at this point in the history
  • Loading branch information
lmirosevic committed Oct 13, 2015
1 parent 7bf52fa commit 6cd971a
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions GBDeviceInfo/GBDeviceInfo_iOS.m
Expand Up @@ -323,24 +323,4 @@ + (GBOSVersion)_osVersion {
return GBOSVersionMake(majorVersion, minorVersion, patchVersion);
}

#pragma mark - Integrity protection

#if !DEBUG
typedef int (*ptrace_ptr_t)(int _request, pid_t _pid, caddr_t _addr, int _data);
#ifndef PT_DENY_ATTACH
#define PT_DENY_ATTACH 31
#endif

static void DisableGDB() {
void *handle = dlopen(0, RTLD_GLOBAL | RTLD_NOW);
ptrace_ptr_t ptrace_ptr = dlsym(handle, "ptrace");
ptrace_ptr(PT_DENY_ATTACH, 0, 0, 0);
dlclose(handle);
}

+ (void)load {
DisableGDB();
}
#endif

@end

0 comments on commit 6cd971a

Please sign in to comment.