You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm searching for new ways to detect jailbreaks and many blogs present system with NULL argument to make that, similar to what is done in the checkFork method with fork below
private static func checkFork() -> CheckResult {
let pointerToFork = UnsafeMutableRawPointer(bitPattern: -2)
let forkPtr = dlsym(pointerToFork, "fork")
typealias ForkType = @convention(c) () -> pid_t
let fork = unsafeBitCast(forkPtr, to: ForkType.self)
let forkResult = fork()
if forkResult >= 0 {
if forkResult > 0 {
kill(forkResult, SIGTERM)
}
return (false, "Fork was able to create a new process (sandbox violation)")
}
return (true, "")
}
But I could not understand why not to use fork (or system) functions directly and instead use dlsym to get fork. Is there any reason for this?
The text was updated successfully, but these errors were encountered:
I'm searching for new ways to detect jailbreaks and many blogs present system with NULL argument to make that, similar to what is done in the
checkFork
method with fork belowBut I could not understand why not to use fork (or system) functions directly and instead use dlsym to get fork. Is there any reason for this?
The text was updated successfully, but these errors were encountered: