Hook a Swift app with Frida

      Nessun commento su Hook a Swift app with Frida

Greetings dear friends, in this tutorial, I’m going to show you how to hook and modify an iOS app’s behavior. For this purpose, I did create an easy app that requests to insert the password and if the password is correct it will show a message that said the password is correct. the tutorial is similar to this one but this time the app is written in swift.
Downlod

As usual, the first step is to perform the static analysis, for this step you can use the tool that you prefer.

For this example, we will hook the function $s8SiftDemo14ViewControllerC13checkPassword8passwordSbSS_tF and change its return value.

var check = Module.getExportByName(null, "$s8SiftDemo14ViewControllerC13checkPassword8passwordSbSS_tF")
Interceptor.attach(check,{
onLeave(retVal) {
return retVal.replace(0x1)
}
})

Also if the password is wrong are able to bypass the check

As an exercise try to bypass the jb detection