![](https://www.iprog.it/blog/wp-content/uploads/2019/07/frida-twitter-profile.png)
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
![](https://www.iprog.it/blog/wp-content/uploads/2023/01/Screenshot-2023-01-24-at-13.29.23.png)
As usual, the first step is to perform the static analysis, for this step you can use the tool that you prefer.
![](https://www.iprog.it/blog/wp-content/uploads/2023/01/Screenshot-2023-01-24-at-13.20.23-940x430.png)
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
![](https://www.iprog.it/blog/wp-content/uploads/2023/01/Screenshot-2023-01-24-at-13.40.07.png)