forked from Hamz-a/boring-flutter
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtemplate_frida_hook_ios.js
More file actions
32 lines (29 loc) · 943 Bytes
/
Copy pathtemplate_frida_hook_ios.js
File metadata and controls
32 lines (29 loc) · 943 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
function log(msg) {
console.log("[" + new Date().toLocaleString() + "] " + msg);
}
function disablePinning(moduleName) {
var baseAddress = Process.getModuleByName(moduleName).base;
var hookAddress = baseAddress.add(ptr("0x00000000")); // modify an offset here
Interceptor.attach(hookAddress, {
onEnter: function(args) {
log("Enter handshake.cc - ssl_verify_peer_cert()");
},
onLeave: function(retval) {
log("Disable certificate validation/pinning");
retval.replace(0x0);
}
});
}
if (ObjC.available) {
const observer = Process.attachModuleObserver({
onAdded(module) {
if (module.name == "Flutter") {
log(module.name + " is loaded");
disablePinning(module.name);
}
},
onRemoved(module) {}
});
} else {
log("Error: Objective-C runtime is not available!");
}