function onLoad(name, callback) {
/
/
void
*
android_dlopen_ext(const char
*
filename,
int
flag, const android_dlextinfo
*
extinfo);
/
/
原型
const android_dlopen_ext
=
Module.findExportByName(null,
"android_dlopen_ext"
);
if
(android_dlopen_ext !
=
null) {
Interceptor.attach(android_dlopen_ext, {
onEnter: function (args) {
if
(args[
0
].readCString().indexOf(name) !
=
=
-
1
) {
this.hook
=
true;
}
},
onLeave: function (retval) {
if
(this.hook) {
callback();
}
}
});
}
}
onLoad(soName, ()
=
> {
let SSL_CTX_set_custom_verify
=
Module.getExportByName(
'libsscronet.so'
,
'SSL_CTX_set_custom_verify'
);
if
(SSL_CTX_set_custom_verify !
=
null) {
Interceptor.attach(SSL_CTX_set_custom_verify, {
onEnter: function (args) {
Interceptor.attach(args[
2
], {
onLeave: function (retval) {
if
(retval >
0x0
) retval.replace(
0x0
);
}
});
}
});
}
});